hivemind-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject cvs commit: jakarta-hivemind/framework/src/java/org/apache/hivemind/order Orderer.java
Date Thu, 19 Aug 2004 22:24:02 GMT
hlship      2004/08/19 15:24:02

  Modified:    framework/src/test/org/apache/hivemind/util
                        TestToStringBuilder.java
               framework/src/test/hivemind/test
                        TestServicesByInterface.java TestContains.java
               framework/src/java/org/apache/hivemind/impl
                        ElementsInnerProxyList.java RegistryImpl.java
               framework/src/java/org/apache/hivemind/test
                        HiveMindTestCase.java
               framework/src/java/org/apache/hivemind/parse
                        DescriptorParser.java ConversionDescriptor.java
                        AbstractParser.java
               library/src/java/org/apache/hivemind/lib/impl
                        NameLookupImpl.java
               framework/src/java/org/apache/hivemind/ant
                        ConstructRegistry.java
               examples/src/test/com/panorama/startup/impl
                        TestExecuteStatic.java TestTaskExecutor.java
               library/src/test/hivemind/test/lib
                        TestDefaultImplementationBuilder.java
               .        .project
               framework/src/test/hivemind/test/services
                        TestThreadedModel.java
               framework/src/test/hivemind/test/services/impl
                        CountFactory.java
               framework/src/java/org/apache/hivemind/order Orderer.java
  Log:
  Clean up some slightly dubious code identified by FindBugs.
  
  Revision  Changes    Path
  1.2       +2 -0      jakarta-hivemind/framework/src/test/org/apache/hivemind/util/TestToStringBuilder.java
  
  Index: TestToStringBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/test/org/apache/hivemind/util/TestToStringBuilder.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestToStringBuilder.java	9 Jun 2004 14:55:32 -0000	1.1
  +++ TestToStringBuilder.java	19 Aug 2004 22:23:59 -0000	1.2
  @@ -35,6 +35,8 @@
   
       protected void setUp() throws Exception
       {
  +    	super.setUp();
  +    	
           _originalDefaultMode = ToStringBuilder.getDefaultMode();
       }
   
  
  
  
  1.3       +4 -0      jakarta-hivemind/framework/src/test/hivemind/test/TestServicesByInterface.java
  
  Index: TestServicesByInterface.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/test/hivemind/test/TestServicesByInterface.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestServicesByInterface.java	3 Aug 2004 14:02:15 -0000	1.2
  +++ TestServicesByInterface.java	19 Aug 2004 22:24:00 -0000	1.3
  @@ -28,11 +28,15 @@
   
       protected void setUp() throws Exception
       {
  +    	super.setUp();
  +    	
           registry = buildFrameworkRegistry("servicesByInterface.xml");
       }
   
       protected void tearDown() throws Exception
       {
  +    	super.tearDown();
  +    	
           registry.shutdown();
       }
   
  
  
  
  1.2       +4 -0      jakarta-hivemind/framework/src/test/hivemind/test/TestContains.java
  
  Index: TestContains.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/test/hivemind/test/TestContains.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TestContains.java	19 Aug 2004 13:35:54 -0000	1.1
  +++ TestContains.java	19 Aug 2004 22:24:00 -0000	1.2
  @@ -27,11 +27,15 @@
   
       protected void setUp() throws Exception
       {
  +    	super.setUp();
  +    	
           registry = buildFrameworkRegistry("contains.xml");
       }
   
       protected void tearDown() throws Exception
       {
  +    	super.tearDown();
  +    	
           registry.shutdown();
       }
   
  
  
  
  1.3       +1 -1      jakarta-hivemind/framework/src/java/org/apache/hivemind/impl/ElementsInnerProxyList.java
  
  Index: ElementsInnerProxyList.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/java/org/apache/hivemind/impl/ElementsInnerProxyList.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- ElementsInnerProxyList.java	25 Jun 2004 20:19:59 -0000	1.2
  +++ ElementsInnerProxyList.java	19 Aug 2004 22:24:00 -0000	1.3
  @@ -78,7 +78,7 @@
           return inner().hashCode();
       }
   
  -    public String toString()
  +    public synchronized String toString()
       {
           if (_inner != null)
               return _inner.toString();
  
  
  
  1.18      +2 -2      jakarta-hivemind/framework/src/java/org/apache/hivemind/impl/RegistryImpl.java
  
  Index: RegistryImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/java/org/apache/hivemind/impl/RegistryImpl.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- RegistryImpl.java	19 Aug 2004 14:11:42 -0000	1.17
  +++ RegistryImpl.java	19 Aug 2004 22:24:00 -0000	1.18
  @@ -407,7 +407,7 @@
        * Invokes {@link ShutdownCoordinator#shutdown()}, then releases
        * the coordinator, modules and variable sources.
        */
  -    public void shutdown()
  +    public synchronized void shutdown()
       {
           checkShutdown();
           // Allow service implementations and such to shutdown.
  @@ -433,7 +433,7 @@
           _threadEventNotifier = null;
       }
   
  -    private void checkShutdown()
  +    private synchronized void checkShutdown()
       {
           if (_shutdown)
               throw new ApplicationRuntimeException(HiveMindMessages.registryShutdown());
  
  
  
  1.11      +2 -0      jakarta-hivemind/framework/src/java/org/apache/hivemind/test/HiveMindTestCase.java
  
  Index: HiveMindTestCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/java/org/apache/hivemind/test/HiveMindTestCase.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- HiveMindTestCase.java	11 Aug 2004 22:13:26 -0000	1.10
  +++ HiveMindTestCase.java	19 Aug 2004 22:24:00 -0000	1.11
  @@ -149,6 +149,8 @@
        */
       protected void tearDown() throws Exception
       {
  +    	super.tearDown();
  +    	
           if (_appender != null)
           {
               _appender = null;
  
  
  
  1.30      +1 -1      jakarta-hivemind/framework/src/java/org/apache/hivemind/parse/DescriptorParser.java
  
  Index: DescriptorParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/java/org/apache/hivemind/parse/DescriptorParser.java,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- DescriptorParser.java	19 Aug 2004 14:11:42 -0000	1.29
  +++ DescriptorParser.java	19 Aug 2004 22:24:00 -0000	1.30
  @@ -786,7 +786,7 @@
           ElementModelImpl elementModel = (ElementModelImpl) peekObject();
   
           ConversionDescriptor cd =
  -            new ConversionDescriptor(_errorHandler, elementModel, "smart", getLocation());
  +            new ConversionDescriptor(_errorHandler, elementModel, getLocation());
   
           push(elementName, cd, STATE_CONVERSION);
   
  
  
  
  1.10      +0 -3      jakarta-hivemind/framework/src/java/org/apache/hivemind/parse/ConversionDescriptor.java
  
  Index: ConversionDescriptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/java/org/apache/hivemind/parse/ConversionDescriptor.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ConversionDescriptor.java	29 Jul 2004 13:18:51 -0000	1.9
  +++ ConversionDescriptor.java	19 Aug 2004 22:24:00 -0000	1.10
  @@ -40,7 +40,6 @@
   
       private ErrorHandler _errorHandler;
       private ElementModelImpl _elementModel;
  -    private String _defaultTranslator;
   
       private String _className;
       private String _parentMethodName = "addElement";
  @@ -49,12 +48,10 @@
       public ConversionDescriptor(
           ErrorHandler errorHandler,
           ElementModelImpl elementModel,
  -        String defaultTranslator,
           Location location)
       {
           _errorHandler = errorHandler;
           _elementModel = elementModel;
  -        _defaultTranslator = defaultTranslator;
   
           setLocation(location);
       }
  
  
  
  1.6       +3 -0      jakarta-hivemind/framework/src/java/org/apache/hivemind/parse/AbstractParser.java
  
  Index: AbstractParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/java/org/apache/hivemind/parse/AbstractParser.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AbstractParser.java	3 Aug 2004 14:02:19 -0000	1.5
  +++ AbstractParser.java	19 Aug 2004 22:24:00 -0000	1.6
  @@ -164,6 +164,9 @@
           if (_location == null)
               _location = new LocationImpl(_resource, line, column);
   
  +		_currentLine = line;
  +		_currentColumn = column;
  +		
           return _location;
       }
   
  
  
  
  1.5       +15 -9     jakarta-hivemind/library/src/java/org/apache/hivemind/lib/impl/NameLookupImpl.java
  
  Index: NameLookupImpl.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/library/src/java/org/apache/hivemind/lib/impl/NameLookupImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- NameLookupImpl.java	9 Jun 2004 14:57:15 -0000	1.4
  +++ NameLookupImpl.java	19 Aug 2004 22:24:00 -0000	1.5
  @@ -36,7 +36,7 @@
   public class NameLookupImpl implements NameLookup, RemoteExceptionListener
   {
       private RemoteExceptionCoordinator _coordinator;
  -    private InitialContext _initialContext;
  +    private Context _initialContext;
       private String _initialFactory;
       private String _URLPackages;
       private String _providerURL;
  @@ -79,18 +79,24 @@
   
       private Context getInitialContext() throws NamingException
       {
  -        Hashtable properties = new Hashtable();
  +        if (_initialContext == null)
  +        {
  +
  +            Hashtable properties = new Hashtable();
   
  -        if (!HiveMind.isBlank(_initialFactory))
  -            properties.put(Context.INITIAL_CONTEXT_FACTORY, _initialFactory);
  +            if (!HiveMind.isBlank(_initialFactory))
  +                properties.put(Context.INITIAL_CONTEXT_FACTORY, _initialFactory);
   
  -        if (!HiveMind.isBlank(_providerURL))
  -            properties.put(Context.PROVIDER_URL, _providerURL);
  +            if (!HiveMind.isBlank(_providerURL))
  +                properties.put(Context.PROVIDER_URL, _providerURL);
   
  -        if (!HiveMind.isBlank(_URLPackages))
  -            properties.put(Context.URL_PKG_PREFIXES, _URLPackages);
  +            if (!HiveMind.isBlank(_URLPackages))
  +                properties.put(Context.URL_PKG_PREFIXES, _URLPackages);
  +
  +            _initialContext = constructContext(properties);
  +        }
   
  -        return constructContext(properties);
  +        return _initialContext;
       }
   
       /**
  
  
  
  1.11      +2 -2      jakarta-hivemind/framework/src/java/org/apache/hivemind/ant/ConstructRegistry.java
  
  Index: ConstructRegistry.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/java/org/apache/hivemind/ant/ConstructRegistry.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- ConstructRegistry.java	19 Aug 2004 14:11:42 -0000	1.10
  +++ ConstructRegistry.java	19 Aug 2004 22:24:01 -0000	1.11
  @@ -244,10 +244,10 @@
           InputStream rawStream = resourceURL.openStream();
           InputStream stream = new BufferedInputStream(rawStream);
   
  -        InputSource source = new InputSource(stream);
  -
           try
           {
  +            InputSource source = new InputSource(stream);
  +
               return builder.parse(source);
           }
           finally
  
  
  
  1.3       +3 -1      jakarta-hivemind/examples/src/test/com/panorama/startup/impl/TestExecuteStatic.java
  
  Index: TestExecuteStatic.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/examples/src/test/com/panorama/startup/impl/TestExecuteStatic.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- TestExecuteStatic.java	24 Jul 2004 13:51:26 -0000	1.2
  +++ TestExecuteStatic.java	19 Aug 2004 22:24:01 -0000	1.3
  @@ -30,8 +30,10 @@
           _staticMethodInvoked = true;
       }
   
  -    protected void tearDown()
  +    protected void tearDown() throws Exception
       {
  +    	super.tearDown();
  +    	
           _staticMethodInvoked = false;
       }
   
  
  
  
  1.5       +6 -2      jakarta-hivemind/examples/src/test/com/panorama/startup/impl/TestTaskExecutor.java
  
  Index: TestTaskExecutor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/examples/src/test/com/panorama/startup/impl/TestTaskExecutor.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TestTaskExecutor.java	3 Aug 2004 14:02:18 -0000	1.4
  +++ TestTaskExecutor.java	19 Aug 2004 22:24:01 -0000	1.5
  @@ -42,13 +42,17 @@
   {
       private static List _tokens = new ArrayList();
   
  -    protected void setUp()
  +    protected void setUp() throws Exception
       {
  +        super.setUp();
  +
           _tokens.clear();
       }
   
  -    protected void tearDown()
  +    protected void tearDown() throws Exception
       {
  +        super.tearDown();
  +
           _tokens.clear();
       }
   
  
  
  
  1.7       +2 -0      jakarta-hivemind/library/src/test/hivemind/test/lib/TestDefaultImplementationBuilder.java
  
  Index: TestDefaultImplementationBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/library/src/test/hivemind/test/lib/TestDefaultImplementationBuilder.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- TestDefaultImplementationBuilder.java	18 Aug 2004 19:34:10 -0000	1.6
  +++ TestDefaultImplementationBuilder.java	19 Aug 2004 22:24:01 -0000	1.7
  @@ -39,6 +39,8 @@
   
       protected void setUp() throws Exception
       {
  +    	super.setUp();
  +    	
           DefaultImplementationBuilderImpl bi = new DefaultImplementationBuilderImpl();
   
           bi.setClassFactory(new ClassFactoryImpl());
  
  
  
  1.3       +15 -16    jakarta-hivemind/.project
  
  Index: .project
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/.project,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- .project	3 Sep 2003 11:34:52 -0000	1.2
  +++ .project	19 Aug 2004 22:24:01 -0000	1.3
  @@ -1,18 +1,17 @@
   <?xml version="1.0" encoding="UTF-8"?>
  -
   <projectDescription>
  -  <name>commons-hivemind</name>
  -  <comment>HiveMind is a dynamic services and configuration microkernel. Its primary
feature is the dynamic creation of a runtime registry of services and configuration data,
where any HiveMind module may contribute extensions to any other HiveMind module.</comment>
  -  <projects>
  -  </projects>
  -  <buildSpec>
  -    <buildCommand>
  -      <name>org.eclipse.jdt.core.javabuilder</name>
  -      <arguments>
  -      </arguments>
  -    </buildCommand>
  -  </buildSpec>
  -  <natures>
  -    <nature>org.eclipse.jdt.core.javanature</nature>
  -  </natures>
  -</projectDescription>
  \ No newline at end of file
  +	<name>jakarta-hivemind</name>
  +	<comment>HiveMind is a dynamic services and configuration microkernel. Its primary
feature is the dynamic creation of a runtime registry of services and configuration data,
where any HiveMind module may contribute extensions to any other HiveMind module.</comment>
  +	<projects>
  +	</projects>
  +	<buildSpec>
  +		<buildCommand>
  +			<name>org.eclipse.jdt.core.javabuilder</name>
  +			<arguments>
  +			</arguments>
  +		</buildCommand>
  +	</buildSpec>
  +	<natures>
  +		<nature>org.eclipse.jdt.core.javanature</nature>
  +	</natures>
  +</projectDescription>
  
  
  
  1.13      +3 -1      jakarta-hivemind/framework/src/test/hivemind/test/services/TestThreadedModel.java
  
  Index: TestThreadedModel.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/test/hivemind/test/services/TestThreadedModel.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- TestThreadedModel.java	18 Aug 2004 19:34:11 -0000	1.12
  +++ TestThreadedModel.java	19 Aug 2004 22:24:01 -0000	1.13
  @@ -151,8 +151,10 @@
   
       public static boolean _didShutdown = false;
   
  -    protected void tearDown()
  +    protected void tearDown() throws Exception
       {
  +    	super.tearDown();
  +    	
           _didShutdown = false;
       }
   
  
  
  
  1.8       +1 -1      jakarta-hivemind/framework/src/test/hivemind/test/services/impl/CountFactory.java
  
  Index: CountFactory.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/test/hivemind/test/services/impl/CountFactory.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- CountFactory.java	16 Aug 2004 14:42:25 -0000	1.7
  +++ CountFactory.java	19 Aug 2004 22:24:02 -0000	1.8
  @@ -49,7 +49,7 @@
           _count++;
       }
   
  -    private class CountHandler implements InvocationHandler
  +    private static class CountHandler implements InvocationHandler
       {
           private Object _inner;
   
  
  
  
  1.9       +1 -1      jakarta-hivemind/framework/src/java/org/apache/hivemind/order/Orderer.java
  
  Index: Orderer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-hivemind/framework/src/java/org/apache/hivemind/order/Orderer.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Orderer.java	11 Jul 2004 23:31:28 -0000	1.8
  +++ Orderer.java	19 Aug 2004 22:24:02 -0000	1.9
  @@ -304,7 +304,7 @@
           }
       }
   
  -    private class Node
  +    private static class Node
       {
           private Object _object;
           private String _name;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-cvs-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-cvs-help@jakarta.apache.org


Mime
View raw message