Skip to content

Commit 726feb3

Browse files
committed
Java: Fix magic in TC with future optimiser.
1 parent f90d1fd commit 726feb3

File tree

1 file changed

+7
-5
lines changed
  • java/ql/lib/semmle/code/java/frameworks/android

1 file changed

+7
-5
lines changed

java/ql/lib/semmle/code/java/frameworks/android/Android.qll

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@ import semmle.code.xml.AndroidManifest
1111
*/
1212
class AndroidComponent extends Class {
1313
AndroidComponent() {
14-
this.getASupertype*().hasQualifiedName("android.app", "Activity") or
15-
this.getASupertype*().hasQualifiedName("android.app", "Service") or
16-
this.getASupertype*().hasQualifiedName("android.content", "BroadcastReceiver") or
17-
this.getASupertype*().hasQualifiedName("android.content", "ContentProvider") or
18-
this.getASupertype*().hasQualifiedName("android.content", "ContentResolver")
14+
// The casts here are due to misoptimisation if they are missing
15+
// but are not needed semantically.
16+
this.(Class).getASupertype*().hasQualifiedName("android.app", "Activity") or
17+
this.(Class).getASupertype*().hasQualifiedName("android.app", "Service") or
18+
this.(Class).getASupertype*().hasQualifiedName("android.content", "BroadcastReceiver") or
19+
this.(Class).getASupertype*().hasQualifiedName("android.content", "ContentProvider") or
20+
this.(Class).getASupertype*().hasQualifiedName("android.content", "ContentResolver")
1921
}
2022

2123
/** The XML element corresponding to this Android component. */

0 commit comments

Comments
 (0)