Bug #5984

Missing exception result checks in Statements request

Added by Tuukka Lehtonen over 2 years ago. Updated over 1 year ago.

Status:On holdStart date:
Priority:4Due date:
Assignee:Antti Villberg% Done:

0%

Category:-Spent time:-
Target version:-
Release notes:
Story points-
Velocity based estimate-

Description

java.lang.ClassCastException: org.simantics.db.exception.ManyObjectsForFunctionalRelationException cannot be cast to org.simantics.db.impl.query.IntArray
    at org.simantics.db.impl.query.Statements$1AssertionMapProc.execute(Statements.java:159)
    at org.simantics.db.impl.query.PrincipalTypes.computeForEach(PrincipalTypes.java:154)
    at org.simantics.db.impl.query.PrincipalTypes.queryEach(PrincipalTypes.java:75)
    at org.simantics.db.impl.query.Statements.getAssertionMap(Statements.java:189)
    at org.simantics.db.impl.query.Statements.forSingleAssertion(Statements.java:197)
    at org.simantics.db.impl.query.Statements.computeFunctionalIndex(Statements.java:320)
    at org.simantics.db.impl.query.Statements.computeForEach(Statements.java:704)
    at org.simantics.db.impl.query.Statements.queryEach(Statements.java:86)
    at org.simantics.db.impl.query.QueryProcessor.forEachStatement(QueryProcessor.java:3420)
    at org.simantics.db.impl.graph.ReadGraphImpl.getStatements(ReadGraphImpl.java:625)
    at org.simantics.db.impl.graph.ReadGraphImpl.getSingleStatement(ReadGraphImpl.java:934)
    at elementsOfR(-1)
    at aprosDiagram(-1)
    at scl.Alstom.Fupros$5.Temp.apply(_SCL_FunctionValue)
    at diagramConstructor2(-1)
    at translateDiagram2(-1)
    at translateDiagram(-1)
    at translateDiagrams(-1)
    at translation(-1)
    at scl.Alstom.Fupros$8.Temp.doApply(_SCL_FunctionValue)
    at org.simantics.scl.compiler.internal.interpreted.IApply.execute(IApply.java:29)
    at org.simantics.scl.compiler.internal.interpreted.ILambda$1.apply(ILambda.java:39)
    at org.simantics.scl.db.SCLFunctions$4.perform(SCLFunctions.java:117)
    at fi.vtt.simantics.procore.internal.SessionImplSocket$2.run(SessionImplSocket.java:564)
    at fi.vtt.simantics.procore.internal.SessionRequestManager$3.run(SessionRequestManager.java:184)
Rethrown as 
org.simantics.db.exception.DatabaseException: java.lang.ClassCastException: org.simantics.db.exception.ManyObjectsForFunctionalRelationException cannot be cast to org.simantics.db.impl.query.IntArray
    at fi.vtt.simantics.procore.internal.WriteStateBase.finish(WriteStateBase.java:67)
    at fi.vtt.simantics.procore.internal.SessionRequestManager$4.run(SessionRequestManager.java:248)
    at org.simantics.db.impl.query.QueryThread.run(QueryThread.java:251)

The execute method indicated above is missing checks AssertedStatements returning an Exception instead of a proper result.

                AssertedStatements stms = AssertedStatements.queryEach(graph, type, r2, graph.processor, entry, null, NOPT);
                if(result == null) {
                    result = stms.getResult();

Naturally the graph model is invalid (with multiple assertions for same functional predicate) in these cases but this is also a bug.

History

#1 Updated by Tuukka Lehtonen over 2 years ago

  • Target version changed from 1.18.3 to 1.20.0

#2 Updated by Tuukka Lehtonen over 2 years ago

  • Release changed from 35 to 29

#3 Updated by Tuukka Lehtonen over 2 years ago

  • Due date deleted (2015-08-28)
  • Target version deleted (1.20.0)
  • Start date deleted (2015-08-11)
  • Release changed from 29 to 30

#4 Updated by Tuukka Lehtonen over 2 years ago

  • Release changed from 30 to 31

#5 Updated by Tuukka Lehtonen almost 2 years ago

  • Release changed from 31 to 39

#6 Updated by Tuukka Lehtonen over 1 year ago

  • Release deleted (39)

#7 Updated by Tuukka Lehtonen over 1 year ago

  • Status changed from New to On hold

#8 Updated by Antti Villberg over 1 year ago

  • Due date set to 2017-01-02
  • Target version set to 2016-51
  • Start date set to 2016-12-19

#9 Updated by Antti Villberg over 1 year ago

  • Status changed from On hold to In Progress

#10 Updated by Antti Villberg over 1 year ago

  • Target version changed from 2016-51 to 2016-52

#11 Updated by Antti Villberg over 1 year ago

  • Due date deleted (2017-01-02)
  • Target version deleted (2016-52)
  • Start date deleted (2016-12-19)

#12 Updated by Antti Villberg over 1 year ago

  • Status changed from In Progress to On hold

Also available in: Atom PDF