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

ArgoUML does not compile with Java8 or Java 11, small adaptations necessary #14

Closed
stcarrez opened this issue Jun 19, 2020 · 6 comments
Closed

Comments

@stcarrez
Copy link
Contributor

ArgoUML is compiled with Java 5 or 6 but it is desirable to use Java8 or higher.

There are only a few places to correct in order to compile with Java8

  • ListSet class does not compile and must be adapted to use the Spliterator
  • UMLStereotypeListModel and UMLModelElementListModel2 inherit from DefaultListModel and it requires the addAll function to become public instead of protected.

By fixing these, I was able to build and run ArgoUML compiled with Java8 and even Java 11.
(OpenJDK under Ubuntu 20.04LTS).

stcarrez added a commit to stcarrez/argouml that referenced this issue Jun 19, 2020
…a 11, small adaptations necessary

Fix the ListSet class to use the Spliterator so that it compiles with Java 8.
Fix classes that inherit from DefaultListModel to make the addAll() public
instead of protected.

Change-Id: I91836a692dbc6125540502e6c96d87016a827bde
@linustolke
Copy link
Member

What do you mean by Java8? Is there two Java8?
The Jenkins-server that builds everything and runs the tests uses the docker image with java bundled. It uses the image maven:3-ibmjava-8. That in turn contains Java 8.
$ sudo docker exec e89ade7424a8 java -version java version "1.8.0_241" Java(TM) SE Runtime Environment (build 8.0.6.6 - pxa6480sr6fp6-20200303_01(SR6 FP6)) IBM J9 VM (build 2.9, JRE 1.8.0 Linux amd64-64-Bit Compressed References 20200124_438197 (JIT enabled, AOT enabled) OpenJ9 - 6754bf2 OMR - dca2cde IBM - 5cc5f54) JCL - 20200303_01 based on Oracle jdk8u241-b07 $

When buildnig and testing on my Linux host I successfully use another Java8:
$ java -version java version "1.8.0_201" Java(TM) SE Runtime Environment (build 1.8.0_201-b09) Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)

As I hope you noticed from my comment on the Change in Gerrithub, your changes makes many tests fail on that Jenkins-server.

@stcarrez
Copy link
Contributor Author

stcarrez commented Jul 7, 2020

The java version is one thing, the target compilation version is another.

I guess the issue comes from parentpom/pom.xml which has the definition:

<compileSource>1.6</compileSource>

I've changed that locally to use:

<compileSource>11</compileSource>

From maven, I'm using:

java -version
openjdk version "11.0.7" 2020-04-14
OpenJDK Runtime Environment (build 11.0.7+10-post-Ubuntu-3ubuntu1)
OpenJDK 64-Bit Server VM (build 11.0.7+10-post-Ubuntu-3ubuntu1, mixed mode, sharing)

And from Intellij Idea, I was using JDK 1.8.0162 with target version 1.8.
I recently had to abandon the JDK 1.8 in favor of OpenJDK 11.

@stcarrez
Copy link
Contributor Author

stcarrez commented Jul 7, 2020

When running the unit tests with maven, I'm getting:

Tests run: 1175, Failures: 0, Errors: 1, Skipped: 0

The failed test is org.argouml.uml.ui.foundation.extension_mechanisms. TestUMLTagDefinitionComboBoxModel
and it fails because it tries to download a file at http://argouml.org/user-profiles/.

Caused by: org.argouml.model.XmiReferenceException: http://argouml.org/user-profiles/Profile4testGetApplic
ableTagDefinitionsIssue60082556515217236653360.xmi
        at org.argouml.model.mdr.XmiReaderImpl.parse(XmiReaderImpl.java:355)
        at org.argouml.persistence.ModelMemberFilePersister.readModels(ModelMemberFilePersister.java:277)
        ... 29 more
Caused by: javax.jmi.xmi.MalformedXMIException: org.xml.sax.SAXException: XMI parsing error at line: 32: h
ttp://argouml.org/user-profiles/Profile4testGetApplicableTagDefinitionsIssue60082556515217236653360.xmi
org.argouml.model.XmiReferenceRuntimeException: http://argouml.org/user-profiles/Profile4testGetApplicable
TagDefinitionsIssue60082556515217236653360.xmi
        at org.netbeans.lib.jmi.xmi.SAXReader.read(SAXReader.java:62)
        at org.argouml.model.mdr.XmiReaderImpl.parse(XmiReaderImpl.java:282)
        ... 30 more
</error>

@linustolke
Copy link
Member

When running the unit tests with maven, I'm getting:

Tests run: 1175, Failures: 0, Errors: 1, Skipped: 0

Rebase the argouml project (repo sync, repo rebase). I have fixed that now.

@linustolke
Copy link
Member

I guess the issue comes from parentpom/pom.xml which has the definition:

<compileSource>1.6</compileSource>

ArgoUML shouldn't really care about what version of Java it is compiled by and for. Should we stop specifying compileSource in parentpom?

@stcarrez
Copy link
Contributor Author

The compileSource is necessary otherwise the build fails.

I've rebased and changed the parent pom to:

<compileSource>8</compileSource>

and now I'm getting the following

Tests run: 1175, Failures: 0, Errors: 0, Skipped: 0

For me it seems reasonable to compile and use JRE 8 as target.

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

No branches or pull requests

2 participants