jflap-lib icon indicating copy to clipboard operation
jflap-lib copied to clipboard

Bug: assertion fails when loading FSA

Open HansvdLaan opened this issue 7 years ago • 1 comments

Whenever I load a Finite State Automaton: FiniteStateAutomaton automaton = (FiniteStateAutomaton)new XMLCodec().decode(new File("something.jff"), null);

I get the following error:

java.lang.AssertionError
	at edu.duke.cs.jflap.file.xml.AutomatonTransducer.addBlocks(AutomatonTransducer.java:217)
	at edu.duke.cs.jflap.file.xml.AutomatonTransducer.readBlocks(AutomatonTransducer.java:483)
	at edu.duke.cs.jflap.file.xml.AutomatonTransducer.readAutomaton(AutomatonTransducer.java:411)
	at edu.duke.cs.jflap.file.xml.AutomatonTransducer.fromDOM(AutomatonTransducer.java:402)
	at edu.duke.cs.jflap.file.XMLCodec.decode(XMLCodec.java:62)
	at edu.duke.cs.jflap.file.XMLCodec.decode(XMLCodec.java:90)
	at checker.nfa.NFABuilder.generateNFA(NFABuilder.java:17)
	at checker.CheckerUtils.parseGroup(CheckerUtils.java:123)
	at checker.CheckerUtils.readSettings(CheckerUtils.java:41)
	at checker.CheckerUtils.readSettings(CheckerUtils.java:30)
	at checker.CheckerUtils.loadCheckerSettings(CheckerUtils.java:24)
	at checker.CheckerUtilsTests.setUp(CheckerUtilsTests.java:20)
	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:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:24)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
	at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:51)
	at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
	at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)

The FSA loads without problems with the assertion commented out.

HansvdLaan avatar Feb 05 '18 20:02 HansvdLaan

I had fixed this is my local (older) version of jflap before I came across this project by simply commenting out the assertion. I have yet to experience any side effects.

HansvdLaan avatar Feb 05 '18 20:02 HansvdLaan