Changeset 5303


Ignore:
Timestamp:
Aug 30, 2016, 4:31:20 AM (6 years ago)
Author:
Christian Schulte
Message:

o Merged change up to 5302 from 'trunk' into branch 'jomc-tools-1.x'.

See #107

Location:
jomc-tools/branches/jomc-tools-1.x
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • jomc-tools/branches/jomc-tools-1.x

  • jomc-tools/branches/jomc-tools-1.x/jomc-ant-tasks

  • jomc-tools/branches/jomc-tools-1.x/jomc-ant-tasks/src/main/java/org/jomc/ant/ProjectClassLoader.java

    r5263 r5303  
    4646import java.net.URL;
    4747import java.net.URLClassLoader;
    48 import java.util.ArrayList;
    4948import java.util.Collections;
    5049import java.util.Enumeration;
     
    104103     * Excluded modlets.
    105104     */
    106     private Modlets excludedModlets;
     105    private final Modlets excludedModlets = new Modlets();
    107106
    108107    /**
     
    114113     * Excluded services.
    115114     */
    116     private Services excludedServices;
     115    private final Services excludedServices = new Services();
    117116
    118117    /**
     
    124123     * Excluded schemas.
    125124     */
    126     private Schemas excludedSchemas;
     125    private final Schemas excludedSchemas = new Schemas();
    127126
    128127    /**
     
    134133     * Set of excluded providers.
    135134     */
    136     private Set<String> excludedProviders;
     135    private final Set<String> excludedProviders = Collections.synchronizedSet( new HashSet<String>( 128 ) );
    137136
    138137    /**
     
    154153     * Set of temporary resources.
    155154     */
    156     private final Set<File> temporaryResources = new HashSet<File>();
     155    private final Set<File> temporaryResources = Collections.synchronizedSet( new HashSet<File>( 128 ) );
    157156
    158157    /**
     
    339338        if ( this.modletResourceLocations == null )
    340339        {
    341             this.modletResourceLocations = new HashSet<String>();
     340            this.modletResourceLocations = new HashSet<String>( 128 );
    342341        }
    343342
     
    359358        if ( this.providerResourceLocations == null )
    360359        {
    361             this.providerResourceLocations = new HashSet<String>();
     360            this.providerResourceLocations = new HashSet<String>( 128 );
    362361        }
    363362
     
    379378        if ( this.modletExcludes == null )
    380379        {
    381             this.modletExcludes = new HashSet<String>();
     380            this.modletExcludes = new HashSet<String>( 128 );
    382381        }
    383382
     
    409408    public final Modlets getExcludedModlets()
    410409    {
    411         if ( this.excludedModlets == null )
    412         {
    413             this.excludedModlets = new Modlets();
    414         }
    415 
    416410        return this.excludedModlets;
    417411    }
     
    431425        if ( this.providerExcludes == null )
    432426        {
    433             this.providerExcludes = new HashSet<String>();
     427            this.providerExcludes = new HashSet<String>( 128 );
    434428        }
    435429
     
    461455    public final Set<String> getExcludedProviders()
    462456    {
    463         if ( this.excludedProviders == null )
    464         {
    465             this.excludedProviders = new HashSet<String>();
    466         }
    467 
    468457        return this.excludedProviders;
    469458    }
     
    483472        if ( this.serviceExcludes == null )
    484473        {
    485             this.serviceExcludes = new HashSet<String>();
     474            this.serviceExcludes = new HashSet<String>( 128 );
    486475        }
    487476
     
    513502    public final Services getExcludedServices()
    514503    {
    515         if ( this.excludedServices == null )
    516         {
    517             this.excludedServices = new Services();
    518         }
    519 
    520504        return this.excludedServices;
    521505    }
     
    535519        if ( this.schemaExcludes == null )
    536520        {
    537             this.schemaExcludes = new HashSet<String>();
     521            this.schemaExcludes = new HashSet<String>( 128 );
    538522        }
    539523
     
    565549    public final Schemas getExcludedSchemas()
    566550    {
    567         if ( this.excludedSchemas == null )
    568         {
    569             this.excludedSchemas = new Schemas();
    570         }
    571 
    572551        return this.excludedSchemas;
    573552    }
     
    628607        BufferedWriter writer = null;
    629608        URL filteredResource = resource;
    630         final List<String> filteredLines = new ArrayList<String>();
     609        final List<String> filteredLines = new LinkedList<String>();
    631610
    632611        try
     
    881860    }
    882861
    883     private void addExcludedModlet( final Modlet modlet )
     862    private synchronized void addExcludedModlet( final Modlet modlet )
    884863    {
    885864        try
     
    911890    }
    912891
    913     private void addExcludedSchema( final Schema schema )
     892    private synchronized void addExcludedSchema( final Schema schema )
    914893    {
    915894        if ( this.getExcludedSchemas().getSchemaBySystemId( schema.getSystemId() ) == null )
     
    919898    }
    920899
    921     private void addExcludedService( final Service service )
     900    private synchronized void addExcludedService( final Service service )
    922901    {
    923902        for ( int i = 0, s0 = this.getExcludedServices().getService().size(); i < s0; i++ )
  • jomc-tools/branches/jomc-tools-1.x/jomc-cli

  • jomc-tools/branches/jomc-tools-1.x/jomc-cli/src/main/java/org/jomc/cli/commands/AbstractModletCommand.java

    r5299 r5303  
    476476         * {@code Modlets} excluded by the instance.
    477477         */
    478         private Modlets excludedModlets;
     478        private final Modlets excludedModlets = new Modlets();
    479479
    480480        /**
     
    625625        public Modlets getExcludedModlets()
    626626        {
    627             if ( this.excludedModlets == null )
    628             {
    629                 this.excludedModlets = new Modlets();
    630             }
    631 
    632627            return this.excludedModlets;
    633628        }
     
    963958                        it.remove();
    964959                        filtered = true;
    965                         this.getExcludedModlets().getModlet().add( m );
     960                        synchronized ( this )
     961                        {
     962                            this.getExcludedModlets().getModlet().add( m );
     963                        }
    966964                        log( Level.FINE,
    967965                             Messages.getMessage( "modletExclusionInfo", resource.toExternalForm(), m.getName() ),
Note: See TracChangeset for help on using the changeset viewer.