Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize imports with Eclipse IDE to remove unused test imports #582

Merged
merged 2 commits into from
Dec 18, 2020

Conversation

scottmarlow
Copy link
Contributor

Eliminated the unused Java imports in support of running the https://gist.github.com/scottmarlow/d4a13d15e7c0ea83d35004445b4b84f0 script to product the https://gist.github.com/scottmarlow/0e31e5256507ad0e5c78b3f274d8d4a7 output that shows the per (Jakarta EE Platform TCK) test group dependencies and number of Platform SPEC assertions as well (per test group).

@scottmarlow
Copy link
Contributor Author

@scottmarlow
Copy link
Contributor Author

Somehow import jakarta.security.auth.message.MessageInfo got updated to import com.sun.nio.sctp.MessageInfo

@scottmarlow scottmarlow force-pushed the optimize_imports_eclipse branch from 90426ec to f7bf2a2 Compare December 3, 2020 18:56
@alwin-joseph
Copy link
Contributor

https://ci.eclipse.org/jakartaee-tck/job/jakartaee-tck-scottmarlow/job/optimize_imports_eclipse/1/testReport/ had some test failures that need to be looked into.

I see the build has failures in this run. One of the causes is "import com.sun.jmx.mbeanserver.Repository.RegistrationContext" missing?

@scottmarlow
Copy link
Contributor Author

thanks @alwin-joseph , I'll revert the removal of that. I added the Jakarta SPEC API jar to my Eclipse IDE project but I suspect the project still is missing classes like the com.sun.jmx.mbeanserver.Repository.RegistrationContext dependency.

@scottmarlow
Copy link
Contributor Author

thanks @alwin-joseph , I'll revert the removal of that. I added the Jakarta SPEC API jar to my Eclipse IDE project but I suspect the project still is missing classes like the com.sun.jmx.mbeanserver.Repository.RegistrationContext dependency.

From searching the build logs for Compile failed; found some missing imports on PortableRemoteObject + org.apache.tools.ant.util.StringUtils. I'll push these changes and try again.

I didn't see any references to com.sun.jmx.mbeanserver.Repository.RegistrationContext or RegistrationContext in the build_jakartaeetck.log.

@scottmarlow scottmarlow force-pushed the optimize_imports_eclipse branch 2 times, most recently from dcc9aa0 to 59d2248 Compare December 7, 2020 23:28
@scottmarlow
Copy link
Contributor Author

I started https://ci.eclipse.org/jakartaee-tck/job/jakartaee-tck-scottmarlow/job/optimize_imports_eclipse/4/testReport/ this morning after addressing some of the missing imports.

I'll look in the build log after for more Compile failed; failures.

@scottmarlow
Copy link
Contributor Author

scottmarlow commented Dec 9, 2020

Compile failed;

I see the compile failure for webservices now. Looks like a number of extra unneeded imports were added by Eclipse that cause the compile failures. It is likely that Intellij + Eclipse would of done a better job of eliminating the unneeded imports if I had added all of the proper dependencies to the Intellij/Eclipse project. Lesson learned :)

For example:

diff --git a/src/com/sun/ts/tests/webservices12/servlet/HandlerTest/server/HelloImpl.java b/src/com/sun/ts/tests/webservices12/servlet/HandlerTest/server/HelloImpl.java
index da824a7e3..53ff91d47 100644
--- a/src/com/sun/ts/tests/webservices12/servlet/HandlerTest/server/HelloImpl.java
+++ b/src/com/sun/ts/tests/webservices12/servlet/HandlerTest/server/HelloImpl.java
@@ -16,14 +16,10 @@

 package com.sun.ts.tests.webservices12.servlet.HandlerTest.server;

-import com.sun.ts.lib.util.*;
-import com.sun.ts.lib.porting.*;
-import com.sun.ts.lib.harness.*;
-import com.sun.javatest.Status;
-import jakarta.xml.ws.WebServiceException;
-import jakarta.xml.ws.Holder;
+import com.sun.ts.tests.samples.ejb.ee.simpleHello.Hello;

 import jakarta.jws.WebService;
+import jakarta.xml.ws.Holder;

 @WebService(portName = "HelloPort", serviceName = "HandlerTestService", targetNamespace = "http://handlertestservice.org/wsdl", wsdlLocation = "WEB-INF/wsdl/HandlerTestService.wsdl", endpointInterface = "com.sun.ts.tests.webservices12.servlet.HandlerTest.server.Hello")

The import com.sun.ts.tests.samples.ejb.ee.simpleHello.Hello is likely incorrect.

@scottmarlow scottmarlow force-pushed the optimize_imports_eclipse branch from 59d2248 to 6169ab9 Compare December 9, 2020 15:14
@scottmarlow
Copy link
Contributor Author

There were too many bad webservices changes, so reverted those and squashed the rest. Will build/test again now.

@scottmarlow
Copy link
Contributor Author

@scottmarlow
Copy link
Contributor Author

Next will be updating copyright date to 2020, I think that a glassfish-copyright-plugin change will be needed to deal with some Apache copyright statements.

@scottmarlow
Copy link
Contributor Author

scottmarlow commented Dec 14, 2020

Next will be updating copyright date to 2020

The copyright date was updated to 2020.

I created eclipse-ee4j/glassfish-copyright-plugin#23 for better handling of the Apache v1.1 license references (I didn't create a pr for the glassfish-copyright-plugin issue).

@scottmarlow
Copy link
Contributor Author

https://ci.eclipse.org/jakartaee-tck/job/jakartaee-tck-scottmarlow/job/optimize_imports_eclipse/1/testReport/ had some test failures that need to be looked into.

I see the build has failures in this run. One of the causes is "import com.sun.jmx.mbeanserver.Repository.RegistrationContext" missing?

Addressed!

Copy link
Contributor

@gurunrao gurunrao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@RohitKumarJain RohitKumarJain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!!!

@scottmarlow scottmarlow merged commit 4d7d240 into jakartaee:master Dec 18, 2020
@scottmarlow scottmarlow deleted the optimize_imports_eclipse branch December 18, 2020 14:44
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.

4 participants