Skip to content

Cleanup in imports#293

Open
dmatej wants to merge 5 commits intoeclipse-ee4j:masterfrom
dmatej:imports
Open

Cleanup in imports#293
dmatej wants to merge 5 commits intoeclipse-ee4j:masterfrom
dmatej:imports

Conversation

@dmatej
Copy link
Copy Markdown
Contributor

@dmatej dmatej commented Apr 22, 2026

  • except tools/ior/ which is built by a Makefile, but for some reason make doesn't like it, so I could not test it.
  • I have changed hamcrest distribution to the one we use most often. It doesn't change anything here.
  • GlassFish tests passed with this change locally.

dmatej added 4 commits April 22, 2026 21:35
Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
- I don't think we execute these tests anywhere, but Eclipse IDE reported it as
  an error

Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
@dmatej dmatej added this to the 5.1.0 milestone Apr 22, 2026
Signed-off-by: David Matějček <david.matejcek@omnifish.ee>
@OndroMih
Copy link
Copy Markdown

OndroMih commented May 1, 2026

Here's a summary of changes generated by AI:

AI Summary of changes

Summary

This PR is a pure import cleanup across the entire codebase. No logic is changed.


Change Groups

1. Replace wildcard imports with explicit imports

The dominant change across all 1163 files. Every occurrence of wildcard imports
(import foo.bar.*) is replaced with individual, explicit import statements.
This affects all packages and sub-packages listed below.

Typical patterns replaced:

  • org.omg.CORBA.* → individual CORBA types
  • org.omg.PortableServer.* → individual POA types
  • org.omg.CosNaming.* → individual naming types
  • org.omg.PortableInterceptor.* → individual interceptor types
  • org.omg.IOP.* → individual IOP types
  • corba.framework.* → individual framework classes
  • java.util.*, java.io.* → individual utility/IO types
  • ServerRequestInterceptor.*, ClientRequestInterceptor.*, ClientRequestInfo.*, etc. → individual IDL-generated types

Representative files (functional-tests):

  • corba/hcks/idlPOAServant.java – 51 wildcard imports replaced with 14 explicit ones (also removed unused imports)
  • pi/clientinterceptor/POAClient.java, POAServer.java, RMIClient.java, etc.
  • pi/clientrequestinfo/POAClient.java, POAServer.java, RMIClient.java, etc.
  • pi/serverinterceptor/POAClient.java, POAServer.java, DSIRMIServer.java, etc.
  • pi/iorinterceptor/SampleIORInterceptor.java, Server.java, ServerTestInitializer.java
  • pi/orbinit/ClientTestInitializer.java, PropsClient.java, SystemClient.java
  • pi/ort/SampleIORInterceptor.java, Server.java, ServerTestInitializer.java
  • corba/poapolicies/FactoryForRetainAndUseServantManager.java
  • corba/rmipoacounter/counterClient.java, counterImpl.java
  • corba/systemexceptions/Server.java
  • javax/rmi/CORBA/serialization/ComplexTestObjectFour.java, ComplexTestObjectTwo.java, etc.
  • javax/rmi/PortableContext.java, download/TheClient.java, download/TheServer.java, download/TheTest.java
  • mantis/m4764130/Client.java, Server.java
  • exception-annotation-processor/.../FileGenerator.java

2. Remove unused imports

Several files had imports that were not actually used and are now removed entirely.

Files:

  • corba/hcks/idlPOAServant.java – removed ~37 unused IOR/transport/impl imports
  • corba/hcks/Server.java – removed java.rmi.RMISecurityManager, javax.rmi.PortableRemoteObject
  • corba/hcks/SsPicInterceptor.java – removed org.omg.PortableInterceptor.InvalidSlot
  • corba/framework/ResolveNS.java – removed org.omg.CORBA.Object
  • corba/framework/TraceElement.java – removed java.lang.reflect.Method
  • corba/framework/MethodEvent.java – removed java.util.EventObject
  • corba/framework/statusU.java – removed java.util.StringTokenizer
  • corba/folb_8_1/ClientForTiming.java – removed LogEventHandler, TimerEventController, TimerFactory, TimerManager
  • corba/purgecalls/ClientORBInitializer.java – removed org.omg.PortableInterceptor.ORBInitializer
  • corba/rmipoacounter/counterIF.java – removed java.rmi.Remote, java.rmi.RemoteException
  • corba/preinvokepostinvoke/Interface.java – removed java.rmi.Remote
  • javax/rmi/download/SecurityManager.java – removed java.util.Hashtable, java.lang.reflect.Member
  • javax/rmi/CORBA/serialization/EmptyTestObject.java – removed unused IO imports
  • javax/rmi/CORBA/serialization/IDLValueHelper.java – removed unused imports
  • javax/rmi/CORBA/serialization/BudgetSummary.java – removed java.lang.reflect.Array
  • pi/orbinit/SampleClientRequestInterceptor.java, SampleIORInterceptor.java, SampleServerRequestInterceptor.java – removed ORBInitTest.* and org.omg.CORBA.LocalObject
  • pi/clientrequestinfo/InvokeOneWay.java, InvokeRecursive.java, InvokeStrategy.java – removed all imports (none needed)

3. Reorder imports to follow standard Java conventions

Imports are reordered to follow the conventional order:

  1. com.sun.corba.* / project-specific
  2. corba.framework.* / test framework
  3. java.*
  4. javax.*
  5. org.*
  6. IDL-generated packages (e.g. ClientRequestInterceptor.*, HelloApp.*, WombatStuff.*)

This affects virtually all 1163 files. Representative examples:

  • corba/hcks/C.java, U.java, Client.java, MyInterceptor.java
  • corba/folb_8_1/Common.java, IORInterceptorImpl.java, SocketFactoryImpl.java
  • corba/connectintercept_1_4/MySocketFactory.java, ORBDBadServerIdHandler.java
  • corba/giopheaderpadding/Client.java, Server.java
  • corba/islocal/Client.java, Server.java
  • corba/rogueclient/RogueClient.java, RogueClientTest.java, Server.java
  • corba/systemexceptions/Server.java, ColocatedClientServer.java
  • corba/requestpartitioning/Server.java, RequestPartitioningTest.java
  • pi/serverinterceptor/DSIRMIClient.java, POAClient.java, POAServer.java
  • pi/clientinterceptor/POAClient.java, POAServer.java, TestInitializer.java
  • pi/iorinterceptor/IORInterceptor.java, SocketFactory.java, ServerORBInitializer.java
  • mantis/m4764130/Interceptor.java

4. Replace corba.framework.* wildcard with explicit framework class imports

Test classes that used import corba.framework.* now import only the specific
framework classes they actually use (CORBATest, Controller, Options,
InternalExec, ThreadExec, InternalProcess, etc.).

Files:

  • corba/adapteractivator/AdapterActivator.java
  • corba/codeset/CodeSetTest.java
  • corba/fwddecl/ForwardDeclTest.java (also adds @Override)
  • corba/giopheaderpadding/GIOPHeaderPaddingTest.java
  • corba/invocation/InvocationTest.java
  • corba/multiorb/MultiORBTest.java
  • corba/oneway/OneWayTest.java
  • corba/poaandequals/POAAndEquals.java
  • corba/poamanager/POAManagerTest.java
  • corba/poapolicies/POAPoliciesTest.java
  • corba/poatest/OneWayTest.java
  • corba/rmipoacounter/RMIPOACounterTest.java
  • corba/rogueclient/RogueClientTest.java
  • corba/systemexceptions/SystemExceptionsTest.java
  • corba/unarrow/UncheckedNarrowTest.java
  • mantis/m4764130/SendingContextTest.java
  • pi/clientinterceptor/ClientInterceptorTest.java
  • pi/clientrequestinfo/ClientRequestInfoTest.java
  • pi/iorinterceptor/IORInterceptorTest.java
  • pi/orbinit/ORBInitTest.java
  • pi/ort/ORTTest.java

5. Remove test.Test / test.* imports replaced by direct framework base class

Several test classes previously imported test.Test or test.* and now only
import the concrete CORBATest or Controller they actually extend/use.

Files:

  • corba/adapteractivator/AdapterActivator.java
  • corba/codeset/CodeSetTest.java
  • corba/fwddecl/ForwardDeclTest.java
  • corba/invocation/InvocationTest.java
  • corba/poaandequals/POAAndEquals.java
  • corba/poamanager/POAManagerTest.java
  • corba/rmipoacounter/RMIPOACounterTest.java
  • corba/unarrow/UncheckedNarrowTest.java
  • mantis/m4764130/SendingContextTest.java

6. Blank-line formatting between import groups

Many files gain or lose blank lines between import groups to visually separate
java.*, javax.*, org.*, and project-specific imports. This is a cosmetic
companion to the reordering in group 3.

Representative files:

  • corba/framework/CORBATest.java
  • corba/folb_8_1/ColocatedCS.java
  • corba/hcks/ColocatedClientServer.java, rmiiAttributesIServantPOA.java, rmiiIServant.java, rmiiIServantPOA.java
  • corba/giopheaderpadding/ColocatedClientServer.java, rmiiIServantPOA.java
  • corba/islocal/rmiiIServantConnect.java, rmiiIServantPOA.java
  • corba/purgecalls/Client.java, ClientInterceptor.java, Server.java
  • corba/poamanager/Utility.java, HelloServer.java
  • corba/poapolicies/HelloServer.java, BasicObjectFactoryImpl.java
  • corba/poaandequals/WombatClient.java, WombatServer.java
  • pi/orbinit/ClientCommon.java
  • pi/clientrequestinfo/ClientCommon.java
  • pi/iorinterceptor/Server.java
  • pi/ort/Server.java

7. Hamcrest dependency alignment

The hamcrest distribution used in the build is changed from hamcrest-all to hamcrest.
No functional change to tests, only dependency alignment.

Files changed (5 pom.xml files):

  1. root pom.xml (line 153-155):

    • <artifactId>hamcrest-all</artifactId><artifactId>hamcrest</artifactId>
    • <version>1.3</version><version>3.0</version>
  2. idlj/pom.xml (line 37):

    • <artifactId>hamcrest-all</artifactId><artifactId>hamcrest</artifactId>
  3. omgapi/pom.xml (line 78):

    • <artifactId>hamcrest-all</artifactId><artifactId>hamcrest</artifactId>
  4. orbmain/pom.xml (line 73):

    • <artifactId>hamcrest-all</artifactId><artifactId>hamcrest</artifactId>
  5. rmic/pom.xml (line 47):

    • <artifactId>hamcrest-all</artifactId><artifactId>hamcrest</artifactId>

Note: The root pom.xml also updates the version from 1.3 to 3.0, while the module
pom.xml files inherit this version and only change the artifactId.


8. Other file changes

Non-Java, non-pom.xml files (9 files total):

  1. make/build.xml (line 24):

    • default="all"default="test" (Ant build file default target change)
  2. orbmain/src/main/java/com/sun/corba/ee/impl/oa/poa/minor_code_example.txt:

    • Import cleanup in embedded Java code example (package declaration with imports)
  3. src/share/classes/org/omg/PortableServer/package.html (line 147):

    • import javax.rmi.PortableRemoteObject ;import javax.rmi.PortableRemoteObject;
    • Import cleanup in HTML code example
  4. test/src/share/classes/corba/fsm/Client.sjava:

    • Import cleanup (.sjava extension - test framework file)
  5. test/src/share/classes/corba/fsm/FSMTest.sjava:

    • Import cleanup (.sjava extension - test framework file)
  6. test/src/share/classes/corba/shutdown/Client.sjava:

    • Import cleanup (.sjava extension - test framework file)
  7. test/src/share/classes/corba/shutdown/Server.sjava:

    • Import cleanup (.sjava extension - test framework file)
  8. www/design/6763340_diffs.txt:

    • Historical diff documentation file - contains import cleanup examples
  9. www/design/SAF/interceptor_usage.text:

    • Import cleanup in embedded Java code example

Summary:

  • 1149 Java files: all import cleanup
  • 5 pom.xml files: dependency alignment (hamcrest)
  • 9 other files: import cleanup in documentation, build files, and test framework files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants