 |
|
|
|
|
|
|
|
Examples of Wasp messages for Jun library
Examples of Wasp messages are presented here for the library
Jun for Java
of the version Jun250.
Jun is a 3d graphics library with topology and geometry
provided as an Open Source Software.
Four bugs in the part of the Jun library
were found from the Wasp messages.
-
The message bellow reports about null pointer exception if the
_ParameterTypesOf method is executed in the line 267.
[C] (t/sra/smalltalk/StObject.java 267,58) null pointer
exception for variable $new112[]
aClass = (Class)arguments$[i].getClass(().getField( ...
#REFERENCES arguments^=$new112!
#DECLARATIONS $new112:(548,48) arguments:(256,57)
The method call graph may help you to see that the following single
call chain leads to the error place:
sra/smalltalk/StObject._ParameterTypesOf<--sra/smalltalk/StObject._searchMethod<--
sra/smalltalk/StObject.perform_withArguments_<--sra/smalltalk/StObject.perform_with_<--
StObject.perform_(534,29);
The reason of the bug is the second null parameter of the method call in the following catch clause:
} catch (Exception e) {
this.perform_with_(aSymbol,null);
}
-
The next message says that the variable 'index' is possibly equal to 256 for
the indicated context of method calls. IndexOutOfBoundsException would be thrown in this case.
[W] (t/sra/jun/goodies/lisp/JunLispSmallTypeTable.java 73,34)
range 0:255 overflow on value 1:256
_TypeTable[index] $= value;
#CONTEXT at_put_(73,34?) <-
atAllSeparatorsPut_(125,37?),atAllDigitsPut_(84,37?),
atAllLettersPut_(97,37?)
Such situation may be reached when the at_put_ method
is called from the atAllLettersPut_ method for some exotic letter as parameter.
-
The mext message means that null pointer exception is thrown
for the value calculated as the result of the newEdge method.
[C] (t/sra/jun/topology/elements/JunBody.java 800,50)
null pointer exception for variable $method_result
faces.addElement($((JunMEL) operator).newEdge().loop...
Analysis of the source code with the help of the method call graph leads to
the following call:
return Body_loop_vertex_vertex_adviseEdge_loop_edge_edge_(
aJunBody, aJunLoopOrProxy, aJunVertexOrProxy1,
aJunVertexOrProxy2, null, null, null, null);
Fifth null parameter is the reason why the newEdge method result is null.
-
The message below is like the previous one.
[C] (t/sra/jun/topology/setoperators/JunUNION.java 756,39)
null pointer exception for variable $method_result
this.changedSurfaceOf_($kve.aliveEdge().leftLoop());
The call kve.aliveEdge() produces null because the field edgeProxy2
of the JunKVE class is null. It is never assigned in the JunKVE class.
 |
The part (approximately a fifth) of the Wasp message listing
for some part of the Jun library is presented below.
Analysed configuration of the part of the Jun library includes
at about 19000 lines of the source code.
First three messages in the listing were
commented above. The fourth message can be easy to disprove by means of source
code analysis. It is difficult to confirm or disprove the fifth message without
good knowledge of the Jun program. The same is for the most part of other
messages of the listing below. Note that messages of the type "method <method
name> not completed normally"
may be induced by caught error "null pointer exception".
########## null pointer exception & wrong cast (CONDITIONAL ERRORS) ########
[C] (t/sra/smalltalk/StObject.java 267,58) null pointer exception for
variable $new112[]
aClass = (Class)
arguments#[i].getClass(...
#REFERENCES arguments^=$new112!
#DECLARATIONS $new112:(548,48) arguments:(256,57)
[C] (t/sra/jun/topology/elements/JunBody.java 800,50) null pointer exception
for variable $method_result
faces.addElement(#((JunMEL) operator).newEdge().loop ...
[C] (t/sra/jun/topology/setoperators/JunUNION.java 756,39) null pointer
exception for variable $fmethod_result
this.changedSurfaceOf_(#kve.aliveEdge().leftLoop());
[C] (t/sra/jun/goodies/lisp/JunLispCons.java 175,39) null pointer exception
for variable tailObject
return #tailObject.equals(objectTail);
[C] (t/sra/jun/geometry/basic/Jun3dPoint.java 210,38) impermissible cast for
variable aPoint
Jun3dPoint thePoint = #(Jun3dPoint) aPoint;
#CONTEXT isLessThanOrEqualTo_(210,38) <-
JunBoundingBox.containsOrTouchesPoint_(t/sra/jun/geometry/basic/JunBoundingBox.java,
43,31)
########################## Scalar Errors (WARNINGS) ########################
[W] (t/sra/jun/goodies/lisp/JunLispSmallTypeTable.java 73,34) range 0:255
overflow on value 1:256
_TypeTable[index] #= value;
#CONTEXT at_put_(73,34?) <-
atAllSeparatorsPut_(125,37?),atAllDigitsPut_(84,37?),
atAllLettersPut_(97,37?)
[W] (t/sra/jun/geometry/surfaces/Jun2dPolygon.java 192,117 193,120 201,78
202,78 207,75 220,78 221,78 226,75 241,78 242,78 247,75 260,78 261,78
266,75 289,83 299,83) zero divisor 0:65536
...nus_(this.pointAt_((concaveIndex - 1 + size) #% size)).unitVector();
[W] (t/sra/jun/topology/setoperators/JunUNION.java 378,94 419,94) division
by zero for variable numLoops
...ue_(aNumber1 + ((aNumber2 - aNumber1) * progressIndex #/ numLoops));
############################ UNREACHABLE BRANCHES ##########################
[W] (t/sra/jun/topology/setoperators/JunUNION.java 136,8) method
basicSurfaceOf_ not completed normally
#private JunSurface basicSurfaceOf_(JunLoop aLoop) {
#CONTEXT basicSurfaceOf_(136,8) <- melLoop_vertex_vertex_(869,66?)
[W] (t/sra/jun/topology/setoperators/JunUNION.java 175,19) false condition -
unreachable then-branch
if #(aLoop != null) {
#CONTEXT changedSurfaceOf_(175,19) <-
kevEdge_vertex_(593,21),melLoop_vertex_vertex_(863,21)
[W] (t/sra/smalltalk/StObject.java 256,8) method _ParameterTypesOf not
completed normally
#public static Class[] _ParameterTypesOf(Object[] arguments) {
[W] (t/sra/smalltalk/StObject.java 259,34) condition in for cycle always =
true
for (int i = 0; i #< numberOfArguments; i++) {
[W] (t/sra/smalltalk/StObject.java 268,26) unreachable catch clause
} #catch (NoSuchFieldException e) {
[W] (t/sra/smalltalk/StObject.java 399,8) method _searchMethod not completed
normally
#public Method _searchMethod(String selector, Object[]
arguments...
[W] (t/sra/smalltalk/StObject.java 415,40) true condition - unreachable
else-branch
if (this.myDependents() #== null) {
#CONTEXT addDependentListener(415,40) <- addDependent_(407,21) <-
StUIBuilder.StUIBuilder(t/sra/smalltalk/StUIBuilder.java,29,22)
[W] (t/sra/jun/topology/elements/JunEdge.java 235,16) uncaught exception
#throw new SmalltalkException("invalid argument");
[W] (t/sra/jun/topology/elements/JunEdge.java 524,16) while condition in do
statement always = false
#do {
######################## UNUSED VARIABLES (Strong) #######################
[W] (t/sra/jun/topology/setoperators/JunUNION.java 385,61) variable
intersectingPoint assigned but not used
Jun3dPoint intersectingPoint #= null;
[W] (t/sra/jun/topology/abstracts/JunAbstractOperator.java 32,21) variable
$new58.body assigned but not used
body #= null;
#REFERENCES this^=$new58!
#DECLARATIONS $new58:(t/sra/jun/topology/euleroperators/JunMEVVL.java,61,
38) this:(31,34)
#CONTEXT JunAbstractOperator(32,21) <- JunAbstractOperator(40,20)
[W] (t/sra/smalltalk/StObject.java 440,44) formal parameter evt not used
public void changed_(DependentEvent #evt) {
#CONTEXT changed_(440,44) <- changed_(459,21) <-
StValueModel.value_(t/sra/smalltalk/StValueModel.java,105,21)
[W] (t/sra/jun/topology/elements/JunLoop.java 940,85) formal parameter v2
not used
...public Object value_value_value_(Object v1, Object e, Object #v2) {
[W] (t/sra/jun/topology/elements/JunEdge.java 34,40) variable
$new44.startVertex assigned but not used
protected JunVertex startVertex #= null;
#REFERENCES this^=$new44!
#DECLARATIONS $new44:(749,33) this:(30,13)
[W] (t/sra/jun/geometry/surfaces/Jun2dPolygon.java 31,36) variables
$new37.signedArea,$new49.signedArea,$new51.signedArea assigned but not
used
protected double signedArea #= Double.NaN;
#REFERENCES this^=$new37,$new49,$new51!
#DECLARATIONS $new37:(605,23) $new49:(312,33) $new51:(316,26) this:(22,13)
#CONTEXT (31,36) <- Jun2dPolygon(42,57) <-
reversed(605,39)
# (31,36) <- Jun2dPolygon(50,55)
# (31,36) <- Jun2dPolygon(42,57) <- reversed(605,39)
# (31,36) <- Jun2dPolygon(50,55)
######################### UNUSED VARIABLES (Weak) ########################
[W] (t/sra/smalltalk/StImage.java 162,18) variable $new68.bits assigned but
not used
this.bits #= bits;
#REFERENCES this^=$new68!
#DECLARATIONS $new68:(t/sra/jun/goodies/colors/JunColorChoiceHSB.java,52,
36) this:(161,17)
#CONTEXT bits_(162,18) <- StImage(58,13) <-
_InitializeBars(t/sra/jun/goodies/colors/JunColorChoiceHSB.java,52,
47?)
|