sarahtattersall / PIPE

PIPE - Platform Independent Petri Net Editor
MIT License
231 stars 73 forks source link

Build fails with Java 8 #95

Closed sebasuh closed 8 years ago

sebasuh commented 8 years ago

Building verison 5.0.2 with Oracle Java 8 fails, at least on Ubuntu 15.04. One reason is the new "doclint" that forces your JavaDoc to be W3C HTML 4.01 conform (http://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html). After correcting this, I get errors in the last module (PIPE-gui) about incompatible types (incompatible types: java.lang.Object cannot be converted to uk.ac.imperial.pipe.models.petrinet.Transition). I haven't looked into this because in the failed test are method calls that always seem to return ?null? and I got it compiled with Java 7.

I would have uploaded my maven output but GitHub says I have no permission.

sjdayday commented 8 years ago

Thank you for letting us know. I haven't started trying to get PIPE working with Java 8 yet. In the meantime, as you noted, Java 7 should work.

best, Steve

On Wed, Oct 21, 2015 at 7:12 AM, srottschaefer notifications@github.com wrote:

Building with Oracle Java 8 fails, at least on Ubuntu 15.04. One reason is the new "doclint" that forces your JavaDoc to be W3C HTML 4.01 conform ( http://blog.joda.org/2014/02/turning-off-doclint-in-jdk-8-javadoc.html). After correcting this, I get errors in the last module (PIPE-gui) about incompatible types. I haven't looked into this because in the failed test are method calls that always seem to return ?null? and I got it compiled with Java 7.

I would have uploaded my maven output but GitHub says I have no permission.

— Reply to this email directly or view it on GitHub https://github.com/sarahtattersall/PIPE/issues/95.

Steve Doubleday UC Irvine Mathematical Behavioral Sciences stevedoubleday@gmail.com 818-648-8381

dcduba commented 8 years ago

Some of the problems are easy to resolve. argThat<T> is defined as ``. Apparently if it is defined without a T, even if only null is returned, in java 8 it will try to cast Object null to T null, because that is the argument that is expected. Specifically defining that will get rid of those errors:

argThat(new HasMultiple<Transition>(new HasXY(point.getX(), point.getY()), new HasTimed(false))));

Fixing most javadoc errors will cause the build to fail with the following crazy stacktrace:

dec 12, 2015 11:22:01 PM com.sun.xml.internal.bind.v2.util.XmlFactory createParserFactory
SEVERE: null
org.xml.sax.SAXNotRecognizedException: http://javax.xml.XMLConstants/feature/secure-processing
    at org.apache.xerces.parsers.AbstractSAXParser.setFeature(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl.setFeatures(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserImpl.<init>(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParserImpl(Unknown Source)
    at org.apache.xerces.jaxp.SAXParserFactoryImpl.setFeature(Unknown Source)
    at com.sun.xml.internal.bind.v2.util.XmlFactory.createParserFactory(XmlFactory.java:121)
    at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.getXMLReader(UnmarshallerImpl.java:139)
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:157)
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:214)
    at uk.ac.imperial.pipe.io.PetriNetIOImpl.read(PetriNetIOImpl.java:138)
    at uk.ac.imperial.pipe.models.manager.PetriNetManagerImpl.createFromFile(PetriNetManagerImpl.java:96)
    at pipe.controllers.application.PipeApplicationController.createNewTabFromFile(PipeApplicationController.java:168)
    at pipe.actions.gui.ExampleFileAction.actionPerformed(ExampleFileAction.java:70)
    at PipeTest.selectMenuItem(PipeTest.java:140)
    at PipeTest.verifyExampleNetLoadsAndAnimates(PipeTest.java:130)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
    at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
    at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264)
    at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153)
    at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124)
    at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
    at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
    at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

Not sure if that is fixable from within this github project.

sjdayday commented 8 years ago

Thanks -- I'll take a look, soon-ish. Steve

On Sat, Dec 12, 2015 at 2:38 PM, dcduba notifications@github.com wrote:

Some of the problems are easy to resolve. argThat is defined as ``. Apparently if it is defined without a T, even if only null is returned, in java 8 it will try to cast Object null to T null, because that is the argument that is expected. Specifically defining that will get rid of those errors:

argThat(new HasMultiple(new HasXY(point.getX(), point.getY()), new HasTimed(false))));

Fixing most javadoc errors will cause the build to fail with the following crazy stacktrace:

dec 12, 2015 11:22:01 PM com.sun.xml.internal.bind.v2.util.XmlFactory createParserFactory SEVERE: null

org.xml.sax.SAXNotRecognizedException: http://javax.xml.XMLConstants/feature/secure-processing at org.apache.xerces.parsers.AbstractSAXParser.setFeature(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl.setFeatures(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl.(Unknown Source) at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParserImpl(Unknown Source) at org.apache.xerces.jaxp.SAXParserFactoryImpl.setFeature(Unknown Source) at com.sun.xml.internal.bind.v2.util.XmlFactory.createParserFactory(XmlFactory.java:121) at com.sun.xml.internal.bind.v2.runtime.unmarshaller.UnmarshallerImpl.getXMLReader(UnmarshallerImpl.java:139) at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:157) at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:214) at uk.ac.imperial.pipe.io.PetriNetIOImpl.read(PetriNetIOImpl.java:138) at uk.ac.imperial.pipe.models.manager.PetriNetManagerImpl.createFromFile(PetriNetManagerImpl.java:96) at pipe.controllers.application.PipeApplicationController.createNewTabFromFile(PipeApplicationController.java:168) at pipe.actions.gui.ExampleFileAction.actionPerformed(ExampleFileAction.java:70) at PipeTest.selectMenuItem(PipeTest.java:140) at PipeTest.verifyExampleNetLoadsAndAnimates(PipeTest.java:130) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:497) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229) at org.junit.runners.ParentRunner.run(ParentRunner.java:309) at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:264) at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:153) at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:124) at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200) at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153) at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)

Not sure if that is fixable from within this github project.

— Reply to this email directly or view it on GitHub https://github.com/sarahtattersall/PIPE/issues/95#issuecomment-164199514 .

Steve Doubleday UC Irvine Mathematical Behavioral Sciences stevedoubleday@gmail.com 818-648-8381

sjdayday commented 8 years ago

Fixed with 5.0.2 release. Thanks to srottschaefer and dcduba for your research on this -- saved me lots of time. Sorry it took me so long to get to it.