@ -13,7 +13,7 @@ public class AnalysisStops {
private native Object externalFunc ( ) ;
private native Object externalFunc ( ) ;
public void skipPointerDerefMayCauseLocalFalseNegative ( ) {
public void skipPointerDerefMayCauseLocalFalseNegative Bad ( ) {
Object ret = externalFunc ( ) ;
Object ret = externalFunc ( ) ;
ret . toString ( ) ;
ret . toString ( ) ;
int i = 1 / 0 ;
int i = 1 / 0 ;
@ -25,7 +25,7 @@ public class AnalysisStops {
return new Object ( ) ;
return new Object ( ) ;
}
}
public void skipPointerDerefMayCauseCalleeFalsePositive ( ) {
public void skipPointerDerefMayCauseCalleeFalsePositive Ok ( ) {
Object o = skipPointerDerefPreventsSpecInferenceRetObj ( ) ;
Object o = skipPointerDerefPreventsSpecInferenceRetObj ( ) ;
o . toString ( ) ;
o . toString ( ) ;
}
}
@ -36,7 +36,7 @@ public class AnalysisStops {
return 0 ;
return 0 ;
}
}
public void skipPointerDerefMayCauseCalleeFalseNegative ( ) {
public void skipPointerDerefMayCauseCalleeFalseNegative Bad ( ) {
int ret = skipPointerDerefPreventsSpecInferenceRetZero ( ) ;
int ret = skipPointerDerefPreventsSpecInferenceRetZero ( ) ;
int i = 1 / ret ;
int i = 1 / ret ;
}
}
@ -45,7 +45,7 @@ public class AnalysisStops {
int j = 1 / i ;
int j = 1 / i ;
}
}
public void skipPointerDerefMayCauseInterprocFalseNegative ( ) {
public void skipPointerDerefMayCauseInterprocFalseNegative Bad ( ) {
int i = skipPointerDerefPreventsSpecInferenceRetZero ( ) ;
int i = skipPointerDerefPreventsSpecInferenceRetZero ( ) ;
divideByParam ( i ) ;
divideByParam ( i ) ;
}
}
@ -54,12 +54,12 @@ public class AnalysisStops {
return ( String ) externalFunc ( ) ;
return ( String ) externalFunc ( ) ;
}
}
public void castFailureOnUndefinedObjMayCauseFalseNegative ( ) {
public void castFailureOnUndefinedObjMayCauseFalseNegative Bad ( ) {
castExternalPreventsSpecInference ( ) ;
castExternalPreventsSpecInference ( ) ;
int i = 1 / 0 ;
int i = 1 / 0 ;
}
}
public void callOnCastUndefinedObjMayCauseFalseNegative ( ) {
public void callOnCastUndefinedObjMayCauseFalseNegative Bad ( ) {
String s = castExternalPreventsSpecInference ( ) ;
String s = castExternalPreventsSpecInference ( ) ;
s . toString ( ) ;
s . toString ( ) ;
int i = 1 / 0 ;
int i = 1 / 0 ;
@ -81,54 +81,54 @@ public class AnalysisStops {
private native MyObj externalFunc2 ( ) ;
private native MyObj externalFunc2 ( ) ;
public void callOnUndefinedObjMayCauseFalseNegative ( ) {
public void callOnUndefinedObjMayCauseFalseNegative Bad ( ) {
MyObj ret = externalFunc2 ( ) ;
MyObj ret = externalFunc2 ( ) ;
int i = 1 / ret . retZero ( ) ;
int i = 1 / ret . retZero ( ) ;
}
}
public void callOnUndefinedObjMayCauseFalsePositive ( ) {
public void callOnUndefinedObjMayCauseFalsePositive Ok ( ) {
MyObj ret = externalFunc2 ( ) ;
MyObj ret = externalFunc2 ( ) ;
int i = 1 / ret . retOne ( ) ;
int i = 1 / ret . retOne ( ) ;
}
}
public void fieldWriteOnUndefinedObjMayCauseFalseNegative ( ) {
public void fieldWriteOnUndefinedObjMayCauseFalseNegative Bad ( ) {
MyObj ret = externalFunc2 ( ) ;
MyObj ret = externalFunc2 ( ) ;
ret . f = new Object ( ) ;
ret . f = new Object ( ) ;
int i = 1 / 0 ;
int i = 1 / 0 ;
}
}
public void fieldWriteOnUndefinedObjMayCauseFalsePositive ( ) {
public void fieldWriteOnUndefinedObjMayCauseFalsePositive Ok ( ) {
MyObj ret = externalFunc2 ( ) ;
MyObj ret = externalFunc2 ( ) ;
ret . f = new Object ( ) ;
ret . f = new Object ( ) ;
ret . f . toString ( ) ;
ret . f . toString ( ) ;
}
}
public void fieldReadOnUndefinedObjMayCauseFalseNegative ( ) {
public void fieldReadOnUndefinedObjMayCauseFalseNegative Bad ( ) {
MyObj ret = externalFunc2 ( ) ;
MyObj ret = externalFunc2 ( ) ;
Object o = ret . f ;
Object o = ret . f ;
int i = 1 / 0 ;
int i = 1 / 0 ;
}
}
public void fieldReadOnUndefinedObjMayCauseFalsePositive ( ) {
public void fieldReadOnUndefinedObjMayCauseFalsePositive Ok ( ) {
MyObj ret = externalFunc2 ( ) ;
MyObj ret = externalFunc2 ( ) ;
Object o = ret . f ;
Object o = ret . f ;
o . toString ( ) ;
o . toString ( ) ;
}
}
public void recursiveAngelicTypesMayCauseFalseNegative ( ) {
public void recursiveAngelicTypesMayCauseFalseNegative Bad ( ) {
MyObj ret = externalFunc2 ( ) ;
MyObj ret = externalFunc2 ( ) ;
MyObj rec1 = ret . rec ;
MyObj rec1 = ret . rec ;
MyObj rec2 = rec1 . rec ;
MyObj rec2 = rec1 . rec ;
int i = 1 / 0 ;
int i = 1 / 0 ;
}
}
public void recursiveAngelicTypesMayCauseFalsePositive ( ) {
public void recursiveAngelicTypesMayCauseFalsePositive Ok ( ) {
MyObj ret = externalFunc2 ( ) ;
MyObj ret = externalFunc2 ( ) ;
MyObj rec1 = ret . rec ;
MyObj rec1 = ret . rec ;
rec1 . rec . toString ( ) ;
rec1 . rec . toString ( ) ;
}
}
public void infiniteMaterializationMayCauseFalseNegative ( boolean b ) {
public void infiniteMaterializationMayCauseFalseNegative Bad ( boolean b ) {
MyObj rec = externalFunc2 ( ) ;
MyObj rec = externalFunc2 ( ) ;
while ( b ) {
while ( b ) {
rec = rec . rec ;
rec = rec . rec ;
@ -136,7 +136,7 @@ public class AnalysisStops {
int i = 1 / 0 ;
int i = 1 / 0 ;
}
}
public void infiniteMaterializationMayCauseFalsePositive ( boolean b ) {
public void infiniteMaterializationMayCauseFalsePositive Ok ( boolean b ) {
MyObj rec = externalFunc2 ( ) ;
MyObj rec = externalFunc2 ( ) ;
while ( b ) {
while ( b ) {
rec = rec . rec ;
rec = rec . rec ;
@ -144,7 +144,7 @@ public class AnalysisStops {
rec . toString ( ) ;
rec . toString ( ) ;
}
}
public void primitiveFieldOfAngelicObjMayCauseFalseNegative ( ) {
public void primitiveFieldOfAngelicObjMayCauseFalseNegative Bad ( ) {
MyObj ret = externalFunc2 ( ) ;
MyObj ret = externalFunc2 ( ) ;
if ( ret . i = = 0 ) {
if ( ret . i = = 0 ) {
int i = 1 / 0 ;
int i = 1 / 0 ;
@ -153,14 +153,14 @@ public class AnalysisStops {
}
}
}
}
public void primitiveFieldOfAngelicObjMayCauseFalsePositive ( ) {
public void primitiveFieldOfAngelicObjMayCauseFalsePositive Ok ( ) {
MyObj ret = externalFunc2 ( ) ;
MyObj ret = externalFunc2 ( ) ;
if ( ret . i ! = 0 ) {
if ( ret . i ! = 0 ) {
int i = 1 / ret . i ;
int i = 1 / ret . i ;
}
}
}
}
public void heapFieldOfAngelicObjMayCauseFalseNegative ( ) {
public void heapFieldOfAngelicObjMayCauseFalseNegative Bad ( ) {
MyObj ret = externalFunc2 ( ) ;
MyObj ret = externalFunc2 ( ) ;
Object obj = ret . f ;
Object obj = ret . f ;
if ( obj = = ret . f ) {
if ( obj = = ret . f ) {
@ -168,7 +168,7 @@ public class AnalysisStops {
}
}
}
}
public void heapFieldOfAngelicObjMayCauseFalsePositive ( ) {
public void heapFieldOfAngelicObjMayCauseFalsePositive Ok ( ) {
MyObj ret = externalFunc2 ( ) ;
MyObj ret = externalFunc2 ( ) ;
Object obj = ret . f ;
Object obj = ret . f ;
if ( obj ! = ret . f ) {
if ( obj ! = ret . f ) {
@ -176,7 +176,7 @@ public class AnalysisStops {
}
}
}
}
public void fieldReadAferCastMayCauseFalseNegative ( Iterator < MyObj > iter ) {
public void fieldReadAferCastMayCauseFalseNegative Bad ( Iterator < MyObj > iter ) {
MyObj ret = iter . next ( ) ;
MyObj ret = iter . next ( ) ;
Object obj = ret . f ;
Object obj = ret . f ;
obj . toString ( ) ;
obj . toString ( ) ;
@ -186,51 +186,51 @@ public class AnalysisStops {
}
}
}
}
public void derefParam ( MyObj obj ) {
public void derefParam Ok ( MyObj obj ) {
Object f = obj . f ;
Object f = obj . f ;
f . toString ( ) ;
f . toString ( ) ;
}
}
public void fieldReadInCalleeMayCauseFalsePositive ( ) {
public void fieldReadInCalleeMayCauseFalsePositive Ok ( ) {
MyObj ret = externalFunc2 ( ) ;
MyObj ret = externalFunc2 ( ) ;
derefParam ( ret ) ;
derefParam Ok ( ret ) ;
}
}
public void fieldReadInCalleeMayCauseFalseNegative ( ) {
public void fieldReadInCalleeMayCauseFalseNegative Bad ( ) {
MyObj ret = externalFunc2 ( ) ;
MyObj ret = externalFunc2 ( ) ;
ret . f = null ;
ret . f = null ;
derefParam ( ret ) ;
derefParam Ok ( ret ) ;
}
}
public void fieldReadInCalleeWithAngelicObjFieldMayCauseFalsePositive ( ) {
public void fieldReadInCalleeWithAngelicObjFieldMayCauseFalsePositive Ok ( ) {
MyObj ret = externalFunc2 ( ) ;
MyObj ret = externalFunc2 ( ) ;
derefParam ( ret . rec ) ;
derefParam Ok ( ret . rec ) ;
}
}
public void fieldReadInCalleeWithAngelicObjFieldMayCauseFalseNegative ( ) {
public void fieldReadInCalleeWithAngelicObjFieldMayCauseFalseNegative Bad ( ) {
MyObj ret = externalFunc2 ( ) ;
MyObj ret = externalFunc2 ( ) ;
ret . rec . f = null ;
ret . rec . f = null ;
derefParam ( ret . rec ) ;
derefParam Ok ( ret . rec ) ;
}
}
public void accessPathOnParam ( MyObj obj ) {
public void accessPathOnParam Ok ( MyObj obj ) {
MyObj ret = obj . rec ;
MyObj ret = obj . rec ;
Object f = ret . f ;
Object f = ret . f ;
f . toString ( ) ;
f . toString ( ) ;
}
}
public void accessPathInCalleeMayCauseFalsePositive ( ) {
public void accessPathInCalleeMayCauseFalsePositive Ok ( ) {
MyObj ret = externalFunc2 ( ) ;
MyObj ret = externalFunc2 ( ) ;
accessPathOnParam ( ret ) ;
accessPathOnParam Ok ( ret ) ;
}
}
public void accessPathInCalleeMayCauseFalseNegative ( ) {
public void accessPathInCalleeMayCauseFalseNegative Bad ( ) {
MyObj ret = externalFunc2 ( ) ;
MyObj ret = externalFunc2 ( ) ;
ret . rec . f = null ;
ret . rec . f = null ;
accessPathOnParam ( ret ) ;
accessPathOnParam Ok ( ret ) ;
}
}
public void skipFunctionInLoopMayCauseFalseNegative ( ) {
public void skipFunctionInLoopMayCauseFalseNegative Bad ( ) {
Object o = null ;
Object o = null ;
for ( int i = 0 ; i < 10 ; i + + ) {
for ( int i = 0 ; i < 10 ; i + + ) {
externalFunc ( ) ;
externalFunc ( ) ;
@ -239,32 +239,32 @@ public class AnalysisStops {
}
}
// will fail to find error unless spec inference succeeds for all callees
// will fail to find error unless spec inference succeeds for all callees
public void specInferenceMayFailAndCauseFalseNegative ( boolean b , Iterator < MyObj > iter ) {
public void specInferenceMayFailAndCauseFalseNegative Bad ( boolean b , Iterator < MyObj > iter ) {
skipPointerDerefMayCauseLocalFalseNegative ( ) ;
skipPointerDerefMayCauseLocalFalseNegative Bad ( ) ;
skipPointerDerefPreventsSpecInferenceRetObj ( ) ;
skipPointerDerefPreventsSpecInferenceRetObj ( ) ;
skipPointerDerefPreventsSpecInferenceRetZero ( ) ;
skipPointerDerefPreventsSpecInferenceRetZero ( ) ;
skipPointerDerefMayCauseCalleeFalseNegative ( ) ;
skipPointerDerefMayCauseCalleeFalseNegative Bad ( ) ;
skipPointerDerefMayCauseInterprocFalseNegative ( ) ;
skipPointerDerefMayCauseInterprocFalseNegative Bad ( ) ;
castFailureOnUndefinedObjMayCauseFalseNegative ( ) ;
castFailureOnUndefinedObjMayCauseFalseNegative Bad ( ) ;
callOnCastUndefinedObjMayCauseFalseNegative ( ) ;
callOnCastUndefinedObjMayCauseFalseNegative Bad ( ) ;
callOnUndefinedObjMayCauseFalseNegative ( ) ;
callOnUndefinedObjMayCauseFalseNegative Bad ( ) ;
callOnUndefinedObjMayCauseFalsePositive ( ) ;
callOnUndefinedObjMayCauseFalsePositive Ok ( ) ;
fieldWriteOnUndefinedObjMayCauseFalseNegative ( ) ;
fieldWriteOnUndefinedObjMayCauseFalseNegative Bad ( ) ;
fieldWriteOnUndefinedObjMayCauseFalsePositive ( ) ;
fieldWriteOnUndefinedObjMayCauseFalsePositive Ok ( ) ;
fieldReadOnUndefinedObjMayCauseFalseNegative ( ) ;
fieldReadOnUndefinedObjMayCauseFalseNegative Bad ( ) ;
fieldReadOnUndefinedObjMayCauseFalsePositive ( ) ;
fieldReadOnUndefinedObjMayCauseFalsePositive Ok ( ) ;
recursiveAngelicTypesMayCauseFalseNegative ( ) ;
recursiveAngelicTypesMayCauseFalseNegative Bad ( ) ;
recursiveAngelicTypesMayCauseFalsePositive ( ) ;
recursiveAngelicTypesMayCauseFalsePositive Ok ( ) ;
infiniteMaterializationMayCauseFalseNegative ( b ) ;
infiniteMaterializationMayCauseFalseNegative Bad ( b ) ;
infiniteMaterializationMayCauseFalsePositive ( b ) ;
infiniteMaterializationMayCauseFalsePositive Ok ( b ) ;
primitiveFieldOfAngelicObjMayCauseFalsePositive ( ) ;
primitiveFieldOfAngelicObjMayCauseFalsePositive Ok ( ) ;
primitiveFieldOfAngelicObjMayCauseFalseNegative ( ) ;
primitiveFieldOfAngelicObjMayCauseFalseNegative Bad ( ) ;
heapFieldOfAngelicObjMayCauseFalsePositive ( ) ;
heapFieldOfAngelicObjMayCauseFalsePositive Ok ( ) ;
heapFieldOfAngelicObjMayCauseFalseNegative ( ) ;
heapFieldOfAngelicObjMayCauseFalseNegative Bad ( ) ;
fieldReadAferCastMayCauseFalseNegative ( iter ) ;
fieldReadAferCastMayCauseFalseNegative Bad ( iter ) ;
fieldReadInCalleeMayCauseFalsePositive ( ) ;
fieldReadInCalleeMayCauseFalsePositive Ok ( ) ;
fieldReadInCalleeWithAngelicObjFieldMayCauseFalsePositive ( ) ;
fieldReadInCalleeWithAngelicObjFieldMayCauseFalsePositive Ok ( ) ;
accessPathInCalleeMayCauseFalsePositive ( ) ;
accessPathInCalleeMayCauseFalsePositive Ok ( ) ;
int i = 1 / 0 ;
int i = 1 / 0 ;
}
}
}
}