Java stack dump when using wrong data type

This forum is to report technical problems with Rel.
Post Reply
Adrian_Hudnott
Posts: 9
Joined: Fri Aug 29, 2008 11:03 pm

Java stack dump when using wrong data type

Post by Adrian_Hudnott »

One of our students uncovered the following bug in Rel 0.3.17 Alpha.

TYPE DATE POSSREP { c CHAR CONSTRAINT LENGTH ( c ) = 8 AND IS_DIGITS ( c ) };
VAR TEST BASE RELATION {ID INTEGER, D DATE} KEY{ID};
TEST := RELATION {TUPLE {ID 1, D "15061989"}};

The value "15061989" is a character string literal when what the student was supposed to write the selector invocation DATE("15061989") instead. However, rather than a simple Tutorial D error, a large Java stack trace revealing the insides of Rel gets dumped into the DBBrowser window, as follows.

ERROR: java.lang.ClassCastException: ca.mb.armchair.rel3.types.TypeCharacter cannot be cast to ca.mb.armchair.rel3.types.userdefined.TypeUserdefined
java.lang.ClassCastException: ca.mb.armchair.rel3.types.TypeCharacter cannot be cast to ca.mb.armchair.rel3.types.userdefined.TypeUserdefined at ca.mb.armchair.rel3.types.userdefined.TypeUserdefined.canAccept(TypeUserdefined.java:174) at ca.mb.armchair.rel3.types.Heading.canAccept(Heading.java:188) at ca.mb.armchair.rel3.types.TypeHeading.canAccept(TypeHeading.java:24) at ca.mb.armchair.rel3.interpreter.TutorialDParser.visit(TutorialDParser.java:1947) at ca.mb.armchair.rel3.languages.tutoriald.parser.ASTAssign.jjtAccept(ASTAssign.java:17) at ca.mb.armchair.rel3.interpreter.TutorialDParser.compileChild(TutorialDParser.java:65) at ca.mb.armchair.rel3.interpreter.TutorialDParser.visit(TutorialDParser.java:1924) at ca.mb.armchair.rel3.languages.tutoriald.parser.ASTAssignment.jjtAccept(ASTAssignment.java:17) at ca.mb.armchair.rel3.languages.tutoriald.parser.SimpleNode.childrenAccept(SimpleNode.java:61) at ca.mb.armchair.rel3.interpreter.TutorialDParser.compileChildren(TutorialDParser.java:70) at ca.mb.armchair.rel3.interpreter.TutorialDParser.visit(TutorialDParser.java:360) at ca.mb.armchair.rel3.languages.tutoriald.parser.ASTStatement.jjtAccept(ASTStatement.java:17) at ca.mb.armchair.rel3.languages.tutoriald.parser.SimpleNode.childrenAccept(SimpleNode.java:61) at ca.mb.armchair.rel3.interpreter.TutorialDParser.compileChildren(TutorialDParser.java:70) at ca.mb.armchair.rel3.interpreter.TutorialDParser.visit(TutorialDParser.java:340) at ca.mb.armchair.rel3.languages.tutoriald.parser.ASTCode.jjtAccept(ASTCode.java:17) at ca.mb.armchair.rel3.interpreter.Interpreter.interpret(Interpreter.java:197) at ca.mb.armchair.rel3.interpreter.Interpreter.interpret(Interpreter.java:213) at ca.mb.armchair.rel3.interpreter.Interpreter.interpret(Interpreter.java:217) at ca.mb.armchair.rel3.client.stream.ClientLocalConnection$2.execute(ClientLocalConnection.java:78) at ca.mb.armchair.rel3.client.stream.ClientLocalConnection.send(ClientLocalConnection.java:42) at ca.mb.armchair.rel3.client.stream.ClientLocalConnection.sendExecute(ClientLocalConnection.java:76) at ca.mb.armchair.rel3.client.string.ClientLocal.sendExecute(ClientLocal.java:56) at ca.mb.armchair.rel3.dbrowser.ui.PanelCommandline$36.doInBackground(PanelCommandline.java:1132) at javax.swing.SwingWorker$1.call(Unknown Source) at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at javax.swing.SwingWorker.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source)
Dave
Site Admin
Posts: 368
Joined: Sun Nov 27, 2005 7:19 pm

Re: Java stack dump when using wrong data type

Post by Dave »

I suck. :oops:

Nice thing about those stack dumps -- they show me exactly where I forgot to put a line of code. :mrgreen:

This will be fixed in the next update.
Post Reply