Add missing UAST testdata

This commit is contained in:
Dmitry Jemerov
2017-04-10 14:37:05 +02:00
parent 0d5d90577d
commit 4963f53e03
133 changed files with 3961 additions and 0 deletions
@@ -0,0 +1,61 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class DataClass {
public final String STRING_CONSTANT = "ABC";
private final String firstName;
private final String lastName;
private final String age;
public DataClass(String firstName, String lastName, String age) {
this.firstName = firstName;
this.lastName = lastName;
this.age = age;
}
@Override
public String toString() {
return "DataClass{" +
"STRING_CONSTANT='" + STRING_CONSTANT + '\'' +
", firstName='" + firstName + '\'' +
", lastName='" + lastName + '\'' +
", age='" + age + '\'' +
'}';
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
DataClass dataClass = (DataClass) o;
if (STRING_CONSTANT != null ? !STRING_CONSTANT.equals(dataClass.STRING_CONSTANT) : dataClass.STRING_CONSTANT != null)
return false;
if (firstName != null ? !firstName.equals(dataClass.firstName) : dataClass.firstName != null) return false;
if (lastName != null ? !lastName.equals(dataClass.lastName) : dataClass.lastName != null) return false;
return age != null ? age.equals(dataClass.age) : dataClass.age == null;
}
@Override
public int hashCode() {
int result = STRING_CONSTANT != null ? STRING_CONSTANT.hashCode() : 0;
result = 31 * result + (firstName != null ? firstName.hashCode() : 0);
result = 31 * result + (lastName != null ? lastName.hashCode() : 0);
result = 31 * result + (age != null ? age.hashCode() : 0);
return result;
}
}
@@ -0,0 +1,221 @@
UFile (package = )
UClass (name = DataClass)
UField (name = STRING_CONSTANT)
ULiteralExpression (value = "ABC")
UField (name = firstName)
UField (name = lastName)
UField (name = age)
UMethod (name = DataClass)
UParameter (name = firstName)
UParameter (name = lastName)
UParameter (name = age)
UBlockExpression
UBinaryExpression (operator = =)
UQualifiedReferenceExpression
UThisExpression (label = null)
USimpleNameReferenceExpression (identifier = firstName)
USimpleNameReferenceExpression (identifier = firstName)
UBinaryExpression (operator = =)
UQualifiedReferenceExpression
UThisExpression (label = null)
USimpleNameReferenceExpression (identifier = lastName)
USimpleNameReferenceExpression (identifier = lastName)
UBinaryExpression (operator = =)
UQualifiedReferenceExpression
UThisExpression (label = null)
USimpleNameReferenceExpression (identifier = age)
USimpleNameReferenceExpression (identifier = age)
UMethod (name = toString)
UAnnotation (fqName = java.lang.Override)
UBlockExpression
UReturnExpression
UPolyadicExpression (operator = +)
ULiteralExpression (value = "DataClass{")
ULiteralExpression (value = "STRING_CONSTANT='")
USimpleNameReferenceExpression (identifier = STRING_CONSTANT)
ULiteralExpression (value = ''')
ULiteralExpression (value = ", firstName='")
USimpleNameReferenceExpression (identifier = firstName)
ULiteralExpression (value = ''')
ULiteralExpression (value = ", lastName='")
USimpleNameReferenceExpression (identifier = lastName)
ULiteralExpression (value = ''')
ULiteralExpression (value = ", age='")
USimpleNameReferenceExpression (identifier = age)
ULiteralExpression (value = ''')
ULiteralExpression (value = '}')
UMethod (name = equals)
UAnnotation (fqName = java.lang.Override)
UParameter (name = o)
UBlockExpression
UIfExpression
UBinaryExpression (operator = ===)
UThisExpression (label = null)
USimpleNameReferenceExpression (identifier = o)
UReturnExpression
ULiteralExpression (value = true)
UastEmptyExpression
UIfExpression
UBinaryExpression (operator = ||)
UBinaryExpression (operator = ===)
USimpleNameReferenceExpression (identifier = o)
ULiteralExpression (value = null)
UBinaryExpression (operator = !==)
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))
UIdentifier (Identifier (getClass))
UQualifiedReferenceExpression
USimpleNameReferenceExpression (identifier = o)
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))
UIdentifier (Identifier (getClass))
UReturnExpression
ULiteralExpression (value = false)
UastEmptyExpression
UDeclarationsExpression
ULocalVariable (name = dataClass)
UBinaryExpressionWithType
USimpleNameReferenceExpression (identifier = o)
UTypeReferenceExpression (name = DataClass)
UIfExpression
UIfExpression
UBinaryExpression (operator = !==)
USimpleNameReferenceExpression (identifier = STRING_CONSTANT)
ULiteralExpression (value = null)
UPrefixExpression (operator = !)
UQualifiedReferenceExpression
USimpleNameReferenceExpression (identifier = STRING_CONSTANT)
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))
UIdentifier (Identifier (equals))
UQualifiedReferenceExpression
USimpleNameReferenceExpression (identifier = dataClass)
USimpleNameReferenceExpression (identifier = STRING_CONSTANT)
UBinaryExpression (operator = !==)
UQualifiedReferenceExpression
USimpleNameReferenceExpression (identifier = dataClass)
USimpleNameReferenceExpression (identifier = STRING_CONSTANT)
ULiteralExpression (value = null)
UReturnExpression
ULiteralExpression (value = false)
UastEmptyExpression
UIfExpression
UIfExpression
UBinaryExpression (operator = !==)
USimpleNameReferenceExpression (identifier = firstName)
ULiteralExpression (value = null)
UPrefixExpression (operator = !)
UQualifiedReferenceExpression
USimpleNameReferenceExpression (identifier = firstName)
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))
UIdentifier (Identifier (equals))
UQualifiedReferenceExpression
USimpleNameReferenceExpression (identifier = dataClass)
USimpleNameReferenceExpression (identifier = firstName)
UBinaryExpression (operator = !==)
UQualifiedReferenceExpression
USimpleNameReferenceExpression (identifier = dataClass)
USimpleNameReferenceExpression (identifier = firstName)
ULiteralExpression (value = null)
UReturnExpression
ULiteralExpression (value = false)
UastEmptyExpression
UIfExpression
UIfExpression
UBinaryExpression (operator = !==)
USimpleNameReferenceExpression (identifier = lastName)
ULiteralExpression (value = null)
UPrefixExpression (operator = !)
UQualifiedReferenceExpression
USimpleNameReferenceExpression (identifier = lastName)
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))
UIdentifier (Identifier (equals))
UQualifiedReferenceExpression
USimpleNameReferenceExpression (identifier = dataClass)
USimpleNameReferenceExpression (identifier = lastName)
UBinaryExpression (operator = !==)
UQualifiedReferenceExpression
USimpleNameReferenceExpression (identifier = dataClass)
USimpleNameReferenceExpression (identifier = lastName)
ULiteralExpression (value = null)
UReturnExpression
ULiteralExpression (value = false)
UastEmptyExpression
UReturnExpression
UIfExpression
UBinaryExpression (operator = !==)
USimpleNameReferenceExpression (identifier = age)
ULiteralExpression (value = null)
UQualifiedReferenceExpression
USimpleNameReferenceExpression (identifier = age)
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1))
UIdentifier (Identifier (equals))
UQualifiedReferenceExpression
USimpleNameReferenceExpression (identifier = dataClass)
USimpleNameReferenceExpression (identifier = age)
UBinaryExpression (operator = ===)
UQualifiedReferenceExpression
USimpleNameReferenceExpression (identifier = dataClass)
USimpleNameReferenceExpression (identifier = age)
ULiteralExpression (value = null)
UMethod (name = hashCode)
UAnnotation (fqName = java.lang.Override)
UBlockExpression
UDeclarationsExpression
ULocalVariable (name = result)
UIfExpression
UBinaryExpression (operator = !==)
USimpleNameReferenceExpression (identifier = STRING_CONSTANT)
ULiteralExpression (value = null)
UQualifiedReferenceExpression
USimpleNameReferenceExpression (identifier = STRING_CONSTANT)
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))
UIdentifier (Identifier (hashCode))
ULiteralExpression (value = 0)
UBinaryExpression (operator = =)
USimpleNameReferenceExpression (identifier = result)
UBinaryExpression (operator = +)
UBinaryExpression (operator = *)
ULiteralExpression (value = 31)
USimpleNameReferenceExpression (identifier = result)
UParenthesizedExpression
UIfExpression
UBinaryExpression (operator = !==)
USimpleNameReferenceExpression (identifier = firstName)
ULiteralExpression (value = null)
UQualifiedReferenceExpression
USimpleNameReferenceExpression (identifier = firstName)
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))
UIdentifier (Identifier (hashCode))
ULiteralExpression (value = 0)
UBinaryExpression (operator = =)
USimpleNameReferenceExpression (identifier = result)
UBinaryExpression (operator = +)
UBinaryExpression (operator = *)
ULiteralExpression (value = 31)
USimpleNameReferenceExpression (identifier = result)
UParenthesizedExpression
UIfExpression
UBinaryExpression (operator = !==)
USimpleNameReferenceExpression (identifier = lastName)
ULiteralExpression (value = null)
UQualifiedReferenceExpression
USimpleNameReferenceExpression (identifier = lastName)
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))
UIdentifier (Identifier (hashCode))
ULiteralExpression (value = 0)
UBinaryExpression (operator = =)
USimpleNameReferenceExpression (identifier = result)
UBinaryExpression (operator = +)
UBinaryExpression (operator = *)
ULiteralExpression (value = 31)
USimpleNameReferenceExpression (identifier = result)
UParenthesizedExpression
UIfExpression
UBinaryExpression (operator = !==)
USimpleNameReferenceExpression (identifier = age)
ULiteralExpression (value = null)
UQualifiedReferenceExpression
USimpleNameReferenceExpression (identifier = age)
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))
UIdentifier (Identifier (hashCode))
ULiteralExpression (value = 0)
UReturnExpression
USimpleNameReferenceExpression (identifier = result)
@@ -0,0 +1,33 @@
public class DataClass {
public final var STRING_CONSTANT: java.lang.String = "ABC"
private final var firstName: java.lang.String
private final var lastName: java.lang.String
private final var age: java.lang.String
public fun DataClass(firstName: java.lang.String, lastName: java.lang.String, age: java.lang.String) {
this.firstName = firstName
this.lastName = lastName
this.age = age
}
@java.lang.Override
public fun toString() : java.lang.String {
return "DataClass{" + "STRING_CONSTANT='" + STRING_CONSTANT + ''' + ", firstName='" + firstName + ''' + ", lastName='" + lastName + ''' + ", age='" + age + ''' + '}'
}
@java.lang.Override
public fun equals(o: java.lang.Object) : boolean {
if (this === o) return true
if (o === null || getClass() !== o.getClass()) return false
var dataClass: DataClass = o as DataClass
if ((STRING_CONSTANT !== null) ? (!STRING_CONSTANT.equals(dataClass.STRING_CONSTANT)) : (dataClass.STRING_CONSTANT !== null)) return false
if ((firstName !== null) ? (!firstName.equals(dataClass.firstName)) : (dataClass.firstName !== null)) return false
if ((lastName !== null) ? (!lastName.equals(dataClass.lastName)) : (dataClass.lastName !== null)) return false
return (age !== null) ? (age.equals(dataClass.age)) : (dataClass.age === null)
}
@java.lang.Override
public fun hashCode() : int {
var result: int = (STRING_CONSTANT !== null) ? (STRING_CONSTANT.hashCode()) : (0)
result = 31 * result + ((firstName !== null) ? (firstName.hashCode()) : (0))
result = 31 * result + ((lastName !== null) ? (lastName.hashCode()) : (0))
result = 31 * result + ((age !== null) ? (age.hashCode()) : (0))
return result
}
}
@@ -0,0 +1,29 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class AliveThenElse {
public static int foo(boolean f) {
int x = 0;
int y = 1;
int z;
if (f) {
z = y;
}
else {
z = x;
}
return z;
}
}
@@ -0,0 +1,25 @@
UFile (package = ) [public class AliveThenElse {...]
UClass (name = AliveThenElse) [public class AliveThenElse {...}]
UMethod (name = foo) [public static fun foo(f: boolean) : int {...}]
UParameter (name = f) [var f: boolean]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var x: int = 0] = Undetermined
ULocalVariable (name = x) [var x: int = 0]
ULiteralExpression (value = 0) [0] = 0
UDeclarationsExpression [var y: int = 1] = Undetermined
ULocalVariable (name = y) [var y: int = 1]
ULiteralExpression (value = 1) [1] = 1
UDeclarationsExpression [var z: int] = Undetermined
ULocalVariable (name = z) [var z: int]
UIfExpression [if (f) {...}] = Phi((var y = 1), (var x = 0))
USimpleNameReferenceExpression (identifier = f) [f] = Undetermined
UBlockExpression [{...}] = (var y = 1)
UBinaryExpression (operator = =) [z = y] = (var y = 1)
USimpleNameReferenceExpression (identifier = z) [z] = (var z = Undetermined)
USimpleNameReferenceExpression (identifier = y) [y] = (var y = 1)
UBlockExpression [{...}] = (var x = 0)
UBinaryExpression (operator = =) [z = x] = (var x = 0)
USimpleNameReferenceExpression (identifier = z) [z] = (var z = Undetermined)
USimpleNameReferenceExpression (identifier = x) [x] = (var x = 0)
UReturnExpression [return z] = Nothing
USimpleNameReferenceExpression (identifier = z) [z] = Phi((var z = (var y = 1)), (var z = (var x = 0)))
@@ -0,0 +1,31 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class Anonymous {
public static int foo() {
int variable = 42;
Runnable runnable = new Runnable() {
public void run() {
int variable = 24;
variable++;
}
};
runnable.run();
return variable;
}
}
@@ -0,0 +1,24 @@
UFile (package = ) [public class Anonymous {...]
UClass (name = Anonymous) [public class Anonymous {...}]
UMethod (name = foo) [public static fun foo() : int {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var variable: int = 42] = Undetermined
ULocalVariable (name = variable) [var variable: int = 42]
ULiteralExpression (value = 42) [42] = 42
UDeclarationsExpression [var runnable: java.lang.Runnable = anonymous Runnable() {... }] = Undetermined
ULocalVariable (name = runnable) [var runnable: java.lang.Runnable = anonymous Runnable() {... }]
UObjectLiteralExpression [anonymous Runnable() {... }] = Undetermined
UClass (name = null) [final class null {...}]
UMethod (name = run) [public fun run() : void {...}]
UBlockExpression [{...}] = (var variable = 24)
UDeclarationsExpression [var variable: int = 24] = Undetermined
ULocalVariable (name = variable) [var variable: int = 24]
ULiteralExpression (value = 24) [24] = 24
UPostfixExpression (operator = ++) [variable++] = (var variable = 24)
USimpleNameReferenceExpression (identifier = variable) [variable] = (var variable = 24)
UQualifiedReferenceExpression [runnable.run()] = external run()()
USimpleNameReferenceExpression (identifier = runnable) [runnable] = (var runnable = Undetermined)
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [run()] = external run()()
UIdentifier (Identifier (run)) [UIdentifier (Identifier (run))]
UReturnExpression [return variable] = Nothing
USimpleNameReferenceExpression (identifier = variable) [variable] = (var variable = 42)
+30
View File
@@ -0,0 +1,30 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class Bitwise {
public static int foo() {
int first = 0x1234567;
int second = 0x89abcde;
return (first & second) + (first | second) + (first ^ second);
}
public static long bar() {
long first = 0x123456789abcdefL;
long second = 0xfedcba987654321L;
return (first & second) + (first | second) + (first ^ second);
}
}
@@ -0,0 +1,46 @@
UFile (package = ) [public class Bitwise {...]
UClass (name = Bitwise) [public class Bitwise {...}]
UMethod (name = foo) [public static fun foo() : int {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var first: int = 19088743] = Undetermined
ULocalVariable (name = first) [var first: int = 19088743]
ULiteralExpression (value = 19088743) [19088743] = 19088743
UDeclarationsExpression [var second: int = 144358622] = Undetermined
ULocalVariable (name = second) [var second: int = 144358622]
ULiteralExpression (value = 144358622) [144358622] = 144358622
UReturnExpression [return (first & second) + (first | second) + (first ^ second)] = Nothing
UPolyadicExpression (operator = +) [(first & second) + (first | second) + (first ^ second)] = 326630398 (depending on: (var first = 19088743), (var second = 144358622))
UParenthesizedExpression [(first & second)] = 132166 (depending on: (var first = 19088743), (var second = 144358622))
UBinaryExpression (operator = &) [first & second] = 132166 (depending on: (var first = 19088743), (var second = 144358622))
USimpleNameReferenceExpression (identifier = first) [first] = (var first = 19088743)
USimpleNameReferenceExpression (identifier = second) [second] = (var second = 144358622)
UParenthesizedExpression [(first | second)] = 163315199 (depending on: (var first = 19088743), (var second = 144358622))
UBinaryExpression (operator = |) [first | second] = 163315199 (depending on: (var first = 19088743), (var second = 144358622))
USimpleNameReferenceExpression (identifier = first) [first] = (var first = 19088743)
USimpleNameReferenceExpression (identifier = second) [second] = (var second = 144358622)
UParenthesizedExpression [(first ^ second)] = 163183033 (depending on: (var first = 19088743), (var second = 144358622))
UBinaryExpression (operator = ^) [first ^ second] = 163183033 (depending on: (var first = 19088743), (var second = 144358622))
USimpleNameReferenceExpression (identifier = first) [first] = (var first = 19088743)
USimpleNameReferenceExpression (identifier = second) [second] = (var second = 144358622)
UMethod (name = bar) [public static fun bar() : long {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var first: long = 81985529216486895] = Undetermined
ULocalVariable (name = first) [var first: long = 81985529216486895]
ULiteralExpression (value = 81985529216486895) [81985529216486895] = (long)81985529216486895
UDeclarationsExpression [var second: long = 1147797409030816545] = Undetermined
ULocalVariable (name = second) [var second: long = 1147797409030816545]
ULiteralExpression (value = 1147797409030816545) [1147797409030816545] = (long)1147797409030816545
UReturnExpression [return (first & second) + (first | second) + (first ^ second)] = Nothing
UPolyadicExpression (operator = +) [(first & second) + (first | second) + (first ^ second)] = (long)2296730115643514846 (depending on: (var first = (long)81985529216486895), (var second = (long)1147797409030816545))
UParenthesizedExpression [(first & second)] = (long)81417880425546017 (depending on: (var first = (long)81985529216486895), (var second = (long)1147797409030816545))
UBinaryExpression (operator = &) [first & second] = (long)81417880425546017 (depending on: (var first = (long)81985529216486895), (var second = (long)1147797409030816545))
USimpleNameReferenceExpression (identifier = first) [first] = (var first = (long)81985529216486895)
USimpleNameReferenceExpression (identifier = second) [second] = (var second = (long)1147797409030816545)
UParenthesizedExpression [(first | second)] = (long)1148365057821757423 (depending on: (var first = (long)81985529216486895), (var second = (long)1147797409030816545))
UBinaryExpression (operator = |) [first | second] = (long)1148365057821757423 (depending on: (var first = (long)81985529216486895), (var second = (long)1147797409030816545))
USimpleNameReferenceExpression (identifier = first) [first] = (var first = (long)81985529216486895)
USimpleNameReferenceExpression (identifier = second) [second] = (var second = (long)1147797409030816545)
UParenthesizedExpression [(first ^ second)] = (long)1066947177396211406 (depending on: (var first = (long)81985529216486895), (var second = (long)1147797409030816545))
UBinaryExpression (operator = ^) [first ^ second] = (long)1066947177396211406 (depending on: (var first = (long)81985529216486895), (var second = (long)1147797409030816545))
USimpleNameReferenceExpression (identifier = first) [first] = (var first = (long)81985529216486895)
USimpleNameReferenceExpression (identifier = second) [second] = (var second = (long)1147797409030816545)
@@ -0,0 +1,29 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class ByteShort {
public static int foo() {
byte b1 = 100;
short s2 = 2;
byte b11 = b1;
short s21 = s2;
int i3 = b11 + b1;
int i4 = s21 + s2;
int i5 = b11 + s21;
byte b3 = (byte) i3;
short s4 = (short) i4;
return i5 + b3 + s4;
}
}
@@ -0,0 +1,46 @@
UFile (package = ) [public class ByteShort {...]
UClass (name = ByteShort) [public class ByteShort {...}]
UMethod (name = foo) [public static fun foo() : int {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var b1: byte = 100] = Undetermined
ULocalVariable (name = b1) [var b1: byte = 100]
ULiteralExpression (value = 100) [100] = 100
UDeclarationsExpression [var s2: short = 2] = Undetermined
ULocalVariable (name = s2) [var s2: short = 2]
ULiteralExpression (value = 2) [2] = 2
UDeclarationsExpression [var b11: byte = b1] = Undetermined
ULocalVariable (name = b11) [var b11: byte = b1]
USimpleNameReferenceExpression (identifier = b1) [b1] = (var b1 = (byte)100)
UDeclarationsExpression [var s21: short = s2] = Undetermined
ULocalVariable (name = s21) [var s21: short = s2]
USimpleNameReferenceExpression (identifier = s2) [s2] = (var s2 = (short)2)
UDeclarationsExpression [var i3: int = b11 + b1] = Undetermined
ULocalVariable (name = i3) [var i3: int = b11 + b1]
UBinaryExpression (operator = +) [b11 + b1] = 200 (depending on: (var b11 = (var b1 = (byte)100)), (var b1 = (byte)100))
USimpleNameReferenceExpression (identifier = b11) [b11] = (var b11 = (var b1 = (byte)100))
USimpleNameReferenceExpression (identifier = b1) [b1] = (var b1 = (byte)100)
UDeclarationsExpression [var i4: int = s21 + s2] = Undetermined
ULocalVariable (name = i4) [var i4: int = s21 + s2]
UBinaryExpression (operator = +) [s21 + s2] = 4 (depending on: (var s21 = (var s2 = (short)2)), (var s2 = (short)2))
USimpleNameReferenceExpression (identifier = s21) [s21] = (var s21 = (var s2 = (short)2))
USimpleNameReferenceExpression (identifier = s2) [s2] = (var s2 = (short)2)
UDeclarationsExpression [var i5: int = b11 + s21] = Undetermined
ULocalVariable (name = i5) [var i5: int = b11 + s21]
UBinaryExpression (operator = +) [b11 + s21] = 102 (depending on: (var b11 = (var b1 = (byte)100)), (var s21 = (var s2 = (short)2)))
USimpleNameReferenceExpression (identifier = b11) [b11] = (var b11 = (var b1 = (byte)100))
USimpleNameReferenceExpression (identifier = s21) [s21] = (var s21 = (var s2 = (short)2))
UDeclarationsExpression [var b3: byte = i3 as byte] = Undetermined
ULocalVariable (name = b3) [var b3: byte = i3 as byte]
UBinaryExpressionWithType [i3 as byte] = (byte)-56
USimpleNameReferenceExpression (identifier = i3) [i3] = (var i3 = 200 (depending on: (var b11 = (var b1 = (byte)100)), (var b1 = (byte)100)))
UTypeReferenceExpression (name = byte) [byte] = Undetermined
UDeclarationsExpression [var s4: short = i4 as short] = Undetermined
ULocalVariable (name = s4) [var s4: short = i4 as short]
UBinaryExpressionWithType [i4 as short] = (short)4
USimpleNameReferenceExpression (identifier = i4) [i4] = (var i4 = 4 (depending on: (var s21 = (var s2 = (short)2)), (var s2 = (short)2)))
UTypeReferenceExpression (name = short) [short] = Undetermined
UReturnExpression [return i5 + b3 + s4] = Nothing
UPolyadicExpression (operator = +) [i5 + b3 + s4] = 50 (depending on: (var i5 = 102 (depending on: (var b11 = (var b1 = (byte)100)), (var s21 = (var s2 = (short)2)))), (var b3 = (byte)-56), (var s4 = (short)4))
USimpleNameReferenceExpression (identifier = i5) [i5] = (var i5 = 102 (depending on: (var b11 = (var b1 = (byte)100)), (var s21 = (var s2 = (short)2))))
USimpleNameReferenceExpression (identifier = b3) [b3] = (var b3 = (byte)-56)
USimpleNameReferenceExpression (identifier = s4) [s4] = (var s4 = (short)4)
@@ -0,0 +1,37 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class CascadeIf {
public static int foo(boolean f, boolean g, boolean h) {
int x = 0;
int y = 1;
int v = 2;
int w = 3;
int z;
if (f) {
z = y;
}
else if (g) {
z = x;
}
else if (h) {
z = v;
}
else {
z = w;
}
return z;
}
}
@@ -0,0 +1,45 @@
UFile (package = ) [public class CascadeIf {...]
UClass (name = CascadeIf) [public class CascadeIf {...}]
UMethod (name = foo) [public static fun foo(f: boolean, g: boolean, h: boolean) : int {...}]
UParameter (name = f) [var f: boolean]
UParameter (name = g) [var g: boolean]
UParameter (name = h) [var h: boolean]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var x: int = 0] = Undetermined
ULocalVariable (name = x) [var x: int = 0]
ULiteralExpression (value = 0) [0] = 0
UDeclarationsExpression [var y: int = 1] = Undetermined
ULocalVariable (name = y) [var y: int = 1]
ULiteralExpression (value = 1) [1] = 1
UDeclarationsExpression [var v: int = 2] = Undetermined
ULocalVariable (name = v) [var v: int = 2]
ULiteralExpression (value = 2) [2] = 2
UDeclarationsExpression [var w: int = 3] = Undetermined
ULocalVariable (name = w) [var w: int = 3]
ULiteralExpression (value = 3) [3] = 3
UDeclarationsExpression [var z: int] = Undetermined
ULocalVariable (name = z) [var z: int]
UIfExpression [if (f) {...}] = Phi((var y = 1), (var x = 0), (var v = 2), (var w = 3))
USimpleNameReferenceExpression (identifier = f) [f] = Undetermined
UBlockExpression [{...}] = (var y = 1)
UBinaryExpression (operator = =) [z = y] = (var y = 1)
USimpleNameReferenceExpression (identifier = z) [z] = (var z = Undetermined)
USimpleNameReferenceExpression (identifier = y) [y] = (var y = 1)
UIfExpression [if (g) {...}] = Phi((var x = 0), (var v = 2), (var w = 3))
USimpleNameReferenceExpression (identifier = g) [g] = Undetermined
UBlockExpression [{...}] = (var x = 0)
UBinaryExpression (operator = =) [z = x] = (var x = 0)
USimpleNameReferenceExpression (identifier = z) [z] = (var z = Undetermined)
USimpleNameReferenceExpression (identifier = x) [x] = (var x = 0)
UIfExpression [if (h) {...}] = Phi((var v = 2), (var w = 3))
USimpleNameReferenceExpression (identifier = h) [h] = Undetermined
UBlockExpression [{...}] = (var v = 2)
UBinaryExpression (operator = =) [z = v] = (var v = 2)
USimpleNameReferenceExpression (identifier = z) [z] = (var z = Undetermined)
USimpleNameReferenceExpression (identifier = v) [v] = (var v = 2)
UBlockExpression [{...}] = (var w = 3)
UBinaryExpression (operator = =) [z = w] = (var w = 3)
USimpleNameReferenceExpression (identifier = z) [z] = (var z = Undetermined)
USimpleNameReferenceExpression (identifier = w) [w] = (var w = 3)
UReturnExpression [return z] = Nothing
USimpleNameReferenceExpression (identifier = z) [z] = Phi((var z = (var y = 1)), (var z = (var x = 0)), (var z = (var v = 2)), (var z = (var w = 3)))
@@ -0,0 +1,27 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class Characters {
public static char foo() {
char a = 'a';
char c = (char) (a + 2);
char f = (char) (c + 3);
char d = (char) (f - 2);
int diff = f - a;
int aa = a + a;
char cdiff = (char) diff;
return d;
}
}
@@ -0,0 +1,48 @@
UFile (package = ) [public class Characters {...]
UClass (name = Characters) [public class Characters {...}]
UMethod (name = foo) [public static fun foo() : char {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var a: char = 'a'] = Undetermined
ULocalVariable (name = a) [var a: char = 'a']
ULiteralExpression (value = 'a') ['a'] = 'a'
UDeclarationsExpression [var c: char = (a + 2) as char] = Undetermined
ULocalVariable (name = c) [var c: char = (a + 2) as char]
UBinaryExpressionWithType [(a + 2) as char] = 'c' (depending on: (var a = 'a'))
UParenthesizedExpression [(a + 2)] = 'c' (depending on: (var a = 'a'))
UBinaryExpression (operator = +) [a + 2] = 'c' (depending on: (var a = 'a'))
USimpleNameReferenceExpression (identifier = a) [a] = (var a = 'a')
ULiteralExpression (value = 2) [2] = 2
UTypeReferenceExpression (name = char) [char] = Undetermined
UDeclarationsExpression [var f: char = (c + 3) as char] = Undetermined
ULocalVariable (name = f) [var f: char = (c + 3) as char]
UBinaryExpressionWithType [(c + 3) as char] = 'f' (depending on: (var c = 'c' (depending on: (var a = 'a'))))
UParenthesizedExpression [(c + 3)] = 'f' (depending on: (var c = 'c' (depending on: (var a = 'a'))))
UBinaryExpression (operator = +) [c + 3] = 'f' (depending on: (var c = 'c' (depending on: (var a = 'a'))))
USimpleNameReferenceExpression (identifier = c) [c] = (var c = 'c' (depending on: (var a = 'a')))
ULiteralExpression (value = 3) [3] = 3
UTypeReferenceExpression (name = char) [char] = Undetermined
UDeclarationsExpression [var d: char = (f - 2) as char] = Undetermined
ULocalVariable (name = d) [var d: char = (f - 2) as char]
UBinaryExpressionWithType [(f - 2) as char] = 'd' (depending on: (var f = 'f' (depending on: (var c = 'c' (depending on: (var a = 'a'))))))
UParenthesizedExpression [(f - 2)] = 'd' (depending on: (var f = 'f' (depending on: (var c = 'c' (depending on: (var a = 'a'))))))
UBinaryExpression (operator = -) [f - 2] = 'd' (depending on: (var f = 'f' (depending on: (var c = 'c' (depending on: (var a = 'a'))))))
USimpleNameReferenceExpression (identifier = f) [f] = (var f = 'f' (depending on: (var c = 'c' (depending on: (var a = 'a')))))
ULiteralExpression (value = 2) [2] = 2
UTypeReferenceExpression (name = char) [char] = Undetermined
UDeclarationsExpression [var diff: int = f - a] = Undetermined
ULocalVariable (name = diff) [var diff: int = f - a]
UBinaryExpression (operator = -) [f - a] = 5 (depending on: (var f = 'f' (depending on: (var c = 'c' (depending on: (var a = 'a'))))), (var a = 'a'))
USimpleNameReferenceExpression (identifier = f) [f] = (var f = 'f' (depending on: (var c = 'c' (depending on: (var a = 'a')))))
USimpleNameReferenceExpression (identifier = a) [a] = (var a = 'a')
UDeclarationsExpression [var aa: int = a + a] = Undetermined
ULocalVariable (name = aa) [var aa: int = a + a]
UBinaryExpression (operator = +) [a + a] = 'Â' (depending on: (var a = 'a'))
USimpleNameReferenceExpression (identifier = a) [a] = (var a = 'a')
USimpleNameReferenceExpression (identifier = a) [a] = (var a = 'a')
UDeclarationsExpression [var cdiff: char = diff as char] = Undetermined
ULocalVariable (name = cdiff) [var cdiff: char = diff as char]
UBinaryExpressionWithType [diff as char] = ''
USimpleNameReferenceExpression (identifier = diff) [diff] = (var diff = 5 (depending on: (var f = 'f' (depending on: (var c = 'c' (depending on: (var a = 'a'))))), (var a = 'a')))
UTypeReferenceExpression (name = char) [char] = Undetermined
UReturnExpression [return d] = Nothing
USimpleNameReferenceExpression (identifier = d) [d] = (var d = 'd' (depending on: (var f = 'f' (depending on: (var c = 'c' (depending on: (var a = 'a')))))))
@@ -0,0 +1,20 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class Foo {
public static void bar() {
Class<*> FOO_CLASS = Foo.class;
}
}
@@ -0,0 +1,9 @@
UFile (package = ) [public class Foo {...]
UClass (name = Foo) [public class Foo {...}]
UMethod (name = bar) [public static fun bar() : void {...}]
UBlockExpression [{...}] = Undetermined
UDeclarationsExpression [] = Undetermined
UBinaryExpression (operator = =) [FOO_CLASS = Foo] = Undetermined
USimpleNameReferenceExpression (identifier = FOO_CLASS) [FOO_CLASS] = external FOO_CLASS()
UClassLiteralExpression [Foo] = Foo
UTypeReferenceExpression (name = Foo) [Foo] = Undetermined
+30
View File
@@ -0,0 +1,30 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class DeadElse {
public static int foo() {
boolean f = true;
int x = 0;
int y = 1;
int z;
if (f) {
z = y;
}
else {
z = x;
}
return z;
}
}
@@ -0,0 +1,27 @@
UFile (package = ) [public class DeadElse {...]
UClass (name = DeadElse) [public class DeadElse {...}]
UMethod (name = foo) [public static fun foo() : int {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var f: boolean = true] = Undetermined
ULocalVariable (name = f) [var f: boolean = true]
ULiteralExpression (value = true) [true] = true
UDeclarationsExpression [var x: int = 0] = Undetermined
ULocalVariable (name = x) [var x: int = 0]
ULiteralExpression (value = 0) [0] = 0
UDeclarationsExpression [var y: int = 1] = Undetermined
ULocalVariable (name = y) [var y: int = 1]
ULiteralExpression (value = 1) [1] = 1
UDeclarationsExpression [var z: int] = Undetermined
ULocalVariable (name = z) [var z: int]
UIfExpression [if (f) {...}] = (var y = 1)
USimpleNameReferenceExpression (identifier = f) [f] = (var f = true)
UBlockExpression [{...}] = (var y = 1)
UBinaryExpression (operator = =) [z = y] = (var y = 1)
USimpleNameReferenceExpression (identifier = z) [z] = (var z = Undetermined)
USimpleNameReferenceExpression (identifier = y) [y] = (var y = 1)
UBlockExpression [{...}] = (var x = 0)
UBinaryExpression (operator = =) [z = x] = (var x = 0)
USimpleNameReferenceExpression (identifier = z) [z] = (var z = Undetermined)
USimpleNameReferenceExpression (identifier = x) [x] = (var x = 0)
UReturnExpression [return z] = Nothing
USimpleNameReferenceExpression (identifier = z) [z] = (var z = (var y = 1))
+24
View File
@@ -0,0 +1,24 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class DeadFor {
public static int foo() {
int result = 0;
for (int i = 9; i < 5; i++) {
result = result + i;
}
return result;
}
}
@@ -0,0 +1,24 @@
UFile (package = ) [public class DeadFor {...]
UClass (name = DeadFor) [public class DeadFor {...}]
UMethod (name = foo) [public static fun foo() : int {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var result: int = 0] = Undetermined
ULocalVariable (name = result) [var result: int = 0]
ULiteralExpression (value = 0) [0] = 0
UForExpression [for (var i: int = 9; i < 5; i++) {...}] = Undetermined
UDeclarationsExpression [var i: int = 9] = Undetermined
ULocalVariable (name = i) [var i: int = 9]
ULiteralExpression (value = 9) [9] = 9
UBinaryExpression (operator = <) [i < 5] = false (depending on: (var i = 9))
USimpleNameReferenceExpression (identifier = i) [i] = (var i = 9)
ULiteralExpression (value = 5) [5] = 5
UPostfixExpression (operator = ++) [i++] = Undetermined
USimpleNameReferenceExpression (identifier = i) [i] = Undetermined
UBlockExpression [{...}] = Undetermined
UBinaryExpression (operator = =) [result = result + i] = Undetermined
USimpleNameReferenceExpression (identifier = result) [result] = Undetermined
UBinaryExpression (operator = +) [result + i] = Undetermined
USimpleNameReferenceExpression (identifier = result) [result] = Undetermined
USimpleNameReferenceExpression (identifier = i) [i] = Undetermined
UReturnExpression [return result] = Nothing
USimpleNameReferenceExpression (identifier = result) [result] = (var result = 0)
@@ -0,0 +1,29 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class DeadIfComparison {
public static int foo() {
int x = 0;
int y = 1;
int z;
if (x == y) {
z = y;
}
else {
z = x;
}
return z;
}
}
@@ -0,0 +1,26 @@
UFile (package = ) [public class DeadIfComparison {...]
UClass (name = DeadIfComparison) [public class DeadIfComparison {...}]
UMethod (name = foo) [public static fun foo() : int {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var x: int = 0] = Undetermined
ULocalVariable (name = x) [var x: int = 0]
ULiteralExpression (value = 0) [0] = 0
UDeclarationsExpression [var y: int = 1] = Undetermined
ULocalVariable (name = y) [var y: int = 1]
ULiteralExpression (value = 1) [1] = 1
UDeclarationsExpression [var z: int] = Undetermined
ULocalVariable (name = z) [var z: int]
UIfExpression [if (x === y) {...}] = (var x = 0)
UBinaryExpression (operator = ===) [x === y] = false (depending on: (var x = 0), (var y = 1))
USimpleNameReferenceExpression (identifier = x) [x] = (var x = 0)
USimpleNameReferenceExpression (identifier = y) [y] = (var y = 1)
UBlockExpression [{...}] = (var y = 1)
UBinaryExpression (operator = =) [z = y] = (var y = 1)
USimpleNameReferenceExpression (identifier = z) [z] = (var z = Undetermined)
USimpleNameReferenceExpression (identifier = y) [y] = (var y = 1)
UBlockExpression [{...}] = (var x = 0)
UBinaryExpression (operator = =) [z = x] = (var x = 0)
USimpleNameReferenceExpression (identifier = z) [z] = (var z = Undetermined)
USimpleNameReferenceExpression (identifier = x) [x] = (var x = 0)
UReturnExpression [return z] = Nothing
USimpleNameReferenceExpression (identifier = z) [z] = (var z = (var x = 0))
@@ -0,0 +1,40 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public enum DeadSwitchEntries {
FIRST,
SECOND,
THIRD;
public static int bar() {
DeadSwitchEntries key = THIRD;
int result;
switch (key) {
case FIRST:
result = 3;
break;
case SECOND:
result = 7;
break;
case THIRD:
result = 13;
break;
default:
result = 66;
break;
}
return result;
}
}
@@ -0,0 +1,48 @@
UFile (package = ) [public final enum DeadSwitchEntries {...]
UClass (name = DeadSwitchEntries) [public final enum DeadSwitchEntries {...}]
UEnumConstant (name = FIRST) [FIRST] = Undetermined
USimpleNameReferenceExpression (identifier = DeadSwitchEntries) [DeadSwitchEntries] = Undetermined
UEnumConstant (name = SECOND) [SECOND] = Undetermined
USimpleNameReferenceExpression (identifier = DeadSwitchEntries) [DeadSwitchEntries] = Undetermined
UEnumConstant (name = THIRD) [THIRD] = Undetermined
USimpleNameReferenceExpression (identifier = DeadSwitchEntries) [DeadSwitchEntries] = Undetermined
UMethod (name = bar) [public static fun bar() : int {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var key: DeadSwitchEntries = THIRD] = Undetermined
ULocalVariable (name = key) [var key: DeadSwitchEntries = THIRD]
USimpleNameReferenceExpression (identifier = THIRD) [THIRD] = THIRD (enum entry)
UDeclarationsExpression [var result: int] = Undetermined
ULocalVariable (name = result) [var result: int]
USwitchExpression [switch (key) ...] = Undetermined
USimpleNameReferenceExpression (identifier = key) [key] = (var key = THIRD (enum entry))
UExpressionList (switch) [ FIRST -> {... ] = Undetermined
USwitchClauseExpressionWithBody [FIRST -> {...] = Undetermined
USimpleNameReferenceExpression (identifier = FIRST) [FIRST] = FIRST (enum entry)
UExpressionList (switch_entry) [{...] = Undetermined
UBinaryExpression (operator = =) [result = 3] = 3
USimpleNameReferenceExpression (identifier = result) [result] = Undetermined
ULiteralExpression (value = 3) [3] = 3
UBreakExpression (label = null) [break] = Nothing(break)
USwitchClauseExpressionWithBody [SECOND -> {...] = Undetermined
USimpleNameReferenceExpression (identifier = SECOND) [SECOND] = SECOND (enum entry)
UExpressionList (switch_entry) [{...] = Undetermined
UBinaryExpression (operator = =) [result = 7] = 7
USimpleNameReferenceExpression (identifier = result) [result] = Undetermined
ULiteralExpression (value = 7) [7] = 7
UBreakExpression (label = null) [break] = Nothing(break)
USwitchClauseExpressionWithBody [THIRD -> {...] = Undetermined
USimpleNameReferenceExpression (identifier = THIRD) [THIRD] = THIRD (enum entry)
UExpressionList (switch_entry) [{...] = Undetermined
UBinaryExpression (operator = =) [result = 13] = 13
USimpleNameReferenceExpression (identifier = result) [result] = (var result = Undetermined)
ULiteralExpression (value = 13) [13] = 13
UBreakExpression (label = null) [break] = Nothing(break)
USwitchClauseExpressionWithBody [else -> {...] = Undetermined
UDefaultCaseExpression [else] = Undetermined
UExpressionList (switch_entry) [{...] = Undetermined
UBinaryExpression (operator = =) [result = 66] = 66
USimpleNameReferenceExpression (identifier = result) [result] = Undetermined
ULiteralExpression (value = 66) [66] = 66
UBreakExpression (label = null) [break] = Nothing(break)
UReturnExpression [return result] = Nothing
USimpleNameReferenceExpression (identifier = result) [result] = (var result = 13)
@@ -0,0 +1,38 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public enum DeadSwitchEntriesWithoutBreaks {
FIRST,
SECOND,
THIRD;
public static int bar() {
DeadSwitchEntriesWithoutBreaks key = SECOND;
int result;
switch (key) {
case FIRST:
result = 3;
break;
case SECOND:
result = 7;
case THIRD:
result = 13;
default:
result = 66;
break;
}
return result;
}
}
@@ -0,0 +1,46 @@
UFile (package = ) [public final enum DeadSwitchEntriesWithoutBreaks {...]
UClass (name = DeadSwitchEntriesWithoutBreaks) [public final enum DeadSwitchEntriesWithoutBreaks {...}]
UEnumConstant (name = FIRST) [FIRST] = Undetermined
USimpleNameReferenceExpression (identifier = DeadSwitchEntriesWithoutBreaks) [DeadSwitchEntriesWithoutBreaks] = Undetermined
UEnumConstant (name = SECOND) [SECOND] = Undetermined
USimpleNameReferenceExpression (identifier = DeadSwitchEntriesWithoutBreaks) [DeadSwitchEntriesWithoutBreaks] = Undetermined
UEnumConstant (name = THIRD) [THIRD] = Undetermined
USimpleNameReferenceExpression (identifier = DeadSwitchEntriesWithoutBreaks) [DeadSwitchEntriesWithoutBreaks] = Undetermined
UMethod (name = bar) [public static fun bar() : int {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var key: DeadSwitchEntriesWithoutBreaks = SECOND] = Undetermined
ULocalVariable (name = key) [var key: DeadSwitchEntriesWithoutBreaks = SECOND]
USimpleNameReferenceExpression (identifier = SECOND) [SECOND] = SECOND (enum entry)
UDeclarationsExpression [var result: int] = Undetermined
ULocalVariable (name = result) [var result: int]
USwitchExpression [switch (key) ...] = Undetermined
USimpleNameReferenceExpression (identifier = key) [key] = (var key = SECOND (enum entry))
UExpressionList (switch) [ FIRST -> {... ] = Undetermined
USwitchClauseExpressionWithBody [FIRST -> {...] = Undetermined
USimpleNameReferenceExpression (identifier = FIRST) [FIRST] = FIRST (enum entry)
UExpressionList (switch_entry) [{...] = Undetermined
UBinaryExpression (operator = =) [result = 3] = 3
USimpleNameReferenceExpression (identifier = result) [result] = Undetermined
ULiteralExpression (value = 3) [3] = 3
UBreakExpression (label = null) [break] = Nothing(break)
USwitchClauseExpressionWithBody [SECOND -> {...] = Undetermined
USimpleNameReferenceExpression (identifier = SECOND) [SECOND] = SECOND (enum entry)
UExpressionList (switch_entry) [{...] = Undetermined
UBinaryExpression (operator = =) [result = 7] = 7
USimpleNameReferenceExpression (identifier = result) [result] = (var result = Undetermined)
ULiteralExpression (value = 7) [7] = 7
USwitchClauseExpressionWithBody [THIRD -> {...] = Undetermined
USimpleNameReferenceExpression (identifier = THIRD) [THIRD] = THIRD (enum entry)
UExpressionList (switch_entry) [{...] = Undetermined
UBinaryExpression (operator = =) [result = 13] = 13
USimpleNameReferenceExpression (identifier = result) [result] = Phi((var result = 7), (var result = Undetermined))
ULiteralExpression (value = 13) [13] = 13
USwitchClauseExpressionWithBody [else -> {...] = Undetermined
UDefaultCaseExpression [else] = Undetermined
UExpressionList (switch_entry) [{...] = Undetermined
UBinaryExpression (operator = =) [result = 66] = 66
USimpleNameReferenceExpression (identifier = result) [result] = Phi((var result = 13), (var result = Undetermined))
ULiteralExpression (value = 66) [66] = 66
UBreakExpression (label = null) [break] = Nothing(break)
UReturnExpression [return result] = Nothing
USimpleNameReferenceExpression (identifier = result) [result] = (var result = 66)
+30
View File
@@ -0,0 +1,30 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class DeadThen {
public static int foo() {
boolean f = true;
int x = 0;
int y = 1;
int z;
if (!f) {
z = y;
}
else {
z = x;
}
return z;
}
}
@@ -0,0 +1,28 @@
UFile (package = ) [public class DeadThen {...]
UClass (name = DeadThen) [public class DeadThen {...}]
UMethod (name = foo) [public static fun foo() : int {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var f: boolean = true] = Undetermined
ULocalVariable (name = f) [var f: boolean = true]
ULiteralExpression (value = true) [true] = true
UDeclarationsExpression [var x: int = 0] = Undetermined
ULocalVariable (name = x) [var x: int = 0]
ULiteralExpression (value = 0) [0] = 0
UDeclarationsExpression [var y: int = 1] = Undetermined
ULocalVariable (name = y) [var y: int = 1]
ULiteralExpression (value = 1) [1] = 1
UDeclarationsExpression [var z: int] = Undetermined
ULocalVariable (name = z) [var z: int]
UIfExpression [if (!f) {...}] = (var x = 0)
UPrefixExpression (operator = !) [!f] = false (depending on: (var f = true))
USimpleNameReferenceExpression (identifier = f) [f] = (var f = true)
UBlockExpression [{...}] = (var y = 1)
UBinaryExpression (operator = =) [z = y] = (var y = 1)
USimpleNameReferenceExpression (identifier = z) [z] = (var z = Undetermined)
USimpleNameReferenceExpression (identifier = y) [y] = (var y = 1)
UBlockExpression [{...}] = (var x = 0)
UBinaryExpression (operator = =) [z = x] = (var x = 0)
USimpleNameReferenceExpression (identifier = z) [z] = (var z = Undetermined)
USimpleNameReferenceExpression (identifier = x) [x] = (var x = 0)
UReturnExpression [return z] = Nothing
USimpleNameReferenceExpression (identifier = z) [z] = (var z = (var x = 0))
@@ -0,0 +1,24 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class Dependents {
public static int foo() {
int x = 42;
int y = x;
int z = y;
int w = z;
return w;
}
}
@@ -0,0 +1,18 @@
UFile (package = ) [public class Dependents {...]
UClass (name = Dependents) [public class Dependents {...}]
UMethod (name = foo) [public static fun foo() : int {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var x: int = 42] = Undetermined
ULocalVariable (name = x) [var x: int = 42]
ULiteralExpression (value = 42) [42] = 42
UDeclarationsExpression [var y: int = x] = Undetermined
ULocalVariable (name = y) [var y: int = x]
USimpleNameReferenceExpression (identifier = x) [x] = (var x = 42)
UDeclarationsExpression [var z: int = y] = Undetermined
ULocalVariable (name = z) [var z: int = y]
USimpleNameReferenceExpression (identifier = y) [y] = (var y = (var x = 42))
UDeclarationsExpression [var w: int = z] = Undetermined
ULocalVariable (name = w) [var w: int = z]
USimpleNameReferenceExpression (identifier = z) [z] = (var z = (var y = (var x = 42)))
UReturnExpression [return w] = Nothing
USimpleNameReferenceExpression (identifier = w) [w] = (var w = (var z = (var y = (var x = 42))))
+28
View File
@@ -0,0 +1,28 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class DoWhile {
public static int foo() {
int count = 0;
int number = 42;
do {
if (number % 10 == 7) {
count++;
}
number = number / 10;
} while (number > 0);
return count;
}
}
@@ -0,0 +1,32 @@
UFile (package = ) [public class DoWhile {...]
UClass (name = DoWhile) [public class DoWhile {...}]
UMethod (name = foo) [public static fun foo() : int {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var count: int = 0] = Undetermined
ULocalVariable (name = count) [var count: int = 0]
ULiteralExpression (value = 0) [0] = 0
UDeclarationsExpression [var number: int = 42] = Undetermined
ULocalVariable (name = number) [var number: int = 42]
ULiteralExpression (value = 42) [42] = 42
UDoWhileExpression [do {...] = Undetermined
UBinaryExpression (operator = >) [number > 0] = Undetermined
USimpleNameReferenceExpression (identifier = number) [number] = Phi((var number = Undetermined), (var number = 0), (var number = 4))
ULiteralExpression (value = 0) [0] = 0
UBlockExpression [{...}] = Undetermined
UIfExpression [if (number % 10 === 7) {...}] = Phi((var count = Undetermined), (var count = 0), (var count = 1), Undetermined)
UBinaryExpression (operator = ===) [number % 10 === 7] = Undetermined
UBinaryExpression (operator = %) [number % 10] = Undetermined
USimpleNameReferenceExpression (identifier = number) [number] = Phi((var number = Undetermined), (var number = 0), (var number = 4))
ULiteralExpression (value = 10) [10] = 10
ULiteralExpression (value = 7) [7] = 7
UBlockExpression [{...}] = Phi((var count = Undetermined), (var count = 0), (var count = 1))
UPostfixExpression (operator = ++) [count++] = Phi((var count = Undetermined), (var count = 0), (var count = 1))
USimpleNameReferenceExpression (identifier = count) [count] = Phi((var count = Undetermined), (var count = 0), (var count = 1))
UastEmptyExpression [UastEmptyExpression] = Undetermined
UBinaryExpression (operator = =) [number = number / 10] = Undetermined
USimpleNameReferenceExpression (identifier = number) [number] = Phi((var number = Undetermined), (var number = 0), (var number = 4))
UBinaryExpression (operator = /) [number / 10] = Undetermined
USimpleNameReferenceExpression (identifier = number) [number] = Phi((var number = Undetermined), (var number = 0), (var number = 4))
ULiteralExpression (value = 10) [10] = 10
UReturnExpression [return count] = Nothing
USimpleNameReferenceExpression (identifier = count) [count] = Phi((var count = Undetermined), (var count = 0), (var count = 1))
@@ -0,0 +1,27 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class DoWhileInfinite {
public static int foo() {
int count = 0;
int number = 42;
do {
if (number % 10 == 7) {
count++;
}
} while (number > 0);
return count;
}
}
@@ -0,0 +1,27 @@
UFile (package = ) [public class DoWhileInfinite {...]
UClass (name = DoWhileInfinite) [public class DoWhileInfinite {...}]
UMethod (name = foo) [public static fun foo() : int {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var count: int = 0] = Undetermined
ULocalVariable (name = count) [var count: int = 0]
ULiteralExpression (value = 0) [0] = 0
UDeclarationsExpression [var number: int = 42] = Undetermined
ULocalVariable (name = number) [var number: int = 42]
ULiteralExpression (value = 42) [42] = 42
UDoWhileExpression [do {...] = Undetermined
UBinaryExpression (operator = >) [number > 0] = true (depending on: (var number = 42))
USimpleNameReferenceExpression (identifier = number) [number] = (var number = 42)
ULiteralExpression (value = 0) [0] = 0
UBlockExpression [{...}] = Undetermined
UIfExpression [if (number % 10 === 7) {...}] = Undetermined
UBinaryExpression (operator = ===) [number % 10 === 7] = false (depending on: (var number = 42))
UBinaryExpression (operator = %) [number % 10] = 2 (depending on: (var number = 42))
USimpleNameReferenceExpression (identifier = number) [number] = (var number = 42)
ULiteralExpression (value = 10) [10] = 10
ULiteralExpression (value = 7) [7] = 7
UBlockExpression [{...}] = (var count = 0)
UPostfixExpression (operator = ++) [count++] = (var count = 0)
USimpleNameReferenceExpression (identifier = count) [count] = (var count = 0)
UastEmptyExpression [UastEmptyExpression] = Undetermined
UReturnExpression [return count] = Nothing
USimpleNameReferenceExpression (identifier = count) [count] = (var count = 0)
@@ -0,0 +1,27 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class DoWhileWithReturn {
public static int foo() {
int count = 0;
int number = 1;
do {
if (number > 0) return count;
count++;
number--;
} while (number >= 0);
return count;
}
}
@@ -0,0 +1,28 @@
UFile (package = ) [public class DoWhileWithReturn {...]
UClass (name = DoWhileWithReturn) [public class DoWhileWithReturn {...}]
UMethod (name = foo) [public static fun foo() : int {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var count: int = 0] = Undetermined
ULocalVariable (name = count) [var count: int = 0]
ULiteralExpression (value = 0) [0] = 0
UDeclarationsExpression [var number: int = 1] = Undetermined
ULocalVariable (name = number) [var number: int = 1]
ULiteralExpression (value = 1) [1] = 1
UDoWhileExpression [do {...] = Nothing
UBinaryExpression (operator = >=) [number >= 0] = true (depending on: (var number = 1))
USimpleNameReferenceExpression (identifier = number) [number] = (var number = 1)
ULiteralExpression (value = 0) [0] = 0
UBlockExpression [{...}] = Nothing
UIfExpression [if (number > 0) return count] = Nothing
UBinaryExpression (operator = >) [number > 0] = true (depending on: (var number = 1))
USimpleNameReferenceExpression (identifier = number) [number] = (var number = 1)
ULiteralExpression (value = 0) [0] = 0
UReturnExpression [return count] = Nothing
USimpleNameReferenceExpression (identifier = count) [count] = (var count = 0)
UastEmptyExpression [UastEmptyExpression] = Undetermined
UPostfixExpression (operator = ++) [count++] = Undetermined
USimpleNameReferenceExpression (identifier = count) [count] = Undetermined
UPostfixExpression (operator = --) [number--] = Undetermined
USimpleNameReferenceExpression (identifier = number) [number] = Undetermined
UReturnExpression [return count] = Nothing
USimpleNameReferenceExpression (identifier = count) [count] = Undetermined
@@ -0,0 +1,30 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public enum EnumChoice {
FIRST,
SECOND;
public EnumChoice foo(boolean flag) {
EnumChoice result;
if (flag) {
result = FIRST;
}
else {
result = SECOND;
}
return result;
}
}
@@ -0,0 +1,23 @@
UFile (package = ) [public final enum EnumChoice {...]
UClass (name = EnumChoice) [public final enum EnumChoice {...}]
UEnumConstant (name = FIRST) [FIRST] = Undetermined
USimpleNameReferenceExpression (identifier = EnumChoice) [EnumChoice] = Undetermined
UEnumConstant (name = SECOND) [SECOND] = Undetermined
USimpleNameReferenceExpression (identifier = EnumChoice) [EnumChoice] = Undetermined
UMethod (name = foo) [public fun foo(flag: boolean) : EnumChoice {...}]
UParameter (name = flag) [var flag: boolean]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var result: EnumChoice] = Undetermined
ULocalVariable (name = result) [var result: EnumChoice]
UIfExpression [if (flag) {...}] = Phi(FIRST (enum entry), SECOND (enum entry))
USimpleNameReferenceExpression (identifier = flag) [flag] = Undetermined
UBlockExpression [{...}] = FIRST (enum entry)
UBinaryExpression (operator = =) [result = FIRST] = FIRST (enum entry)
USimpleNameReferenceExpression (identifier = result) [result] = (var result = Undetermined)
USimpleNameReferenceExpression (identifier = FIRST) [FIRST] = FIRST (enum entry)
UBlockExpression [{...}] = SECOND (enum entry)
UBinaryExpression (operator = =) [result = SECOND] = SECOND (enum entry)
USimpleNameReferenceExpression (identifier = result) [result] = (var result = Undetermined)
USimpleNameReferenceExpression (identifier = SECOND) [SECOND] = SECOND (enum entry)
UReturnExpression [return result] = Nothing
USimpleNameReferenceExpression (identifier = result) [result] = Phi((var result = FIRST (enum entry)), (var result = SECOND (enum entry)))
@@ -0,0 +1,39 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public enum EnumSwitch {
FIRST,
SECOND,
THIRD;
public static int foo(EnumSwitch key) {
int result;
switch (key) {
case FIRST:
result = 3;
break;
case SECOND:
result = 7;
break;
case THIRD:
result = 13;
break;
default:
result = 66;
break;
}
return result;
}
}
@@ -0,0 +1,46 @@
UFile (package = )
UClass (name = EnumSwitch)
UEnumConstant (name = FIRST)
USimpleNameReferenceExpression (identifier = EnumSwitch)
UEnumConstant (name = SECOND)
USimpleNameReferenceExpression (identifier = EnumSwitch)
UEnumConstant (name = THIRD)
USimpleNameReferenceExpression (identifier = EnumSwitch)
UMethod (name = foo)
UParameter (name = key)
UBlockExpression
UDeclarationsExpression
ULocalVariable (name = result)
USwitchExpression
USimpleNameReferenceExpression (identifier = key)
UExpressionList (switch)
USwitchClauseExpressionWithBody
USimpleNameReferenceExpression (identifier = FIRST)
UExpressionList (switch_entry)
UBinaryExpression (operator = =)
USimpleNameReferenceExpression (identifier = result)
ULiteralExpression (value = 3)
UBreakExpression (label = null)
USwitchClauseExpressionWithBody
USimpleNameReferenceExpression (identifier = SECOND)
UExpressionList (switch_entry)
UBinaryExpression (operator = =)
USimpleNameReferenceExpression (identifier = result)
ULiteralExpression (value = 7)
UBreakExpression (label = null)
USwitchClauseExpressionWithBody
USimpleNameReferenceExpression (identifier = THIRD)
UExpressionList (switch_entry)
UBinaryExpression (operator = =)
USimpleNameReferenceExpression (identifier = result)
ULiteralExpression (value = 13)
UBreakExpression (label = null)
USwitchClauseExpressionWithBody
UDefaultCaseExpression
UExpressionList (switch_entry)
UBinaryExpression (operator = =)
USimpleNameReferenceExpression (identifier = result)
ULiteralExpression (value = 66)
UBreakExpression (label = null)
UReturnExpression
USimpleNameReferenceExpression (identifier = result)
@@ -0,0 +1,31 @@
public final enum EnumSwitch {
FIRST
SECOND
THIRD
public static fun foo(key: EnumSwitch) : int {
var result: int
switch (key)
FIRST -> {
result = 3
break
}
SECOND -> {
result = 7
break
}
THIRD -> {
result = 13
break
}
else -> {
result = 66
break
}
return result
}
}
@@ -0,0 +1,46 @@
UFile (package = ) [public final enum EnumSwitch {...]
UClass (name = EnumSwitch) [public final enum EnumSwitch {...}]
UEnumConstant (name = FIRST) [FIRST] = Undetermined
USimpleNameReferenceExpression (identifier = EnumSwitch) [EnumSwitch] = Undetermined
UEnumConstant (name = SECOND) [SECOND] = Undetermined
USimpleNameReferenceExpression (identifier = EnumSwitch) [EnumSwitch] = Undetermined
UEnumConstant (name = THIRD) [THIRD] = Undetermined
USimpleNameReferenceExpression (identifier = EnumSwitch) [EnumSwitch] = Undetermined
UMethod (name = foo) [public static fun foo(key: EnumSwitch) : int {...}]
UParameter (name = key) [var key: EnumSwitch]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var result: int] = Undetermined
ULocalVariable (name = result) [var result: int]
USwitchExpression [switch (key) ...] = Undetermined
USimpleNameReferenceExpression (identifier = key) [key] = Undetermined
UExpressionList (switch) [ FIRST -> {... ] = Undetermined
USwitchClauseExpressionWithBody [FIRST -> {...] = Undetermined
USimpleNameReferenceExpression (identifier = FIRST) [FIRST] = FIRST (enum entry)
UExpressionList (switch_entry) [{...] = Undetermined
UBinaryExpression (operator = =) [result = 3] = 3
USimpleNameReferenceExpression (identifier = result) [result] = (var result = Undetermined)
ULiteralExpression (value = 3) [3] = 3
UBreakExpression (label = null) [break] = Nothing(break)
USwitchClauseExpressionWithBody [SECOND -> {...] = Undetermined
USimpleNameReferenceExpression (identifier = SECOND) [SECOND] = SECOND (enum entry)
UExpressionList (switch_entry) [{...] = Undetermined
UBinaryExpression (operator = =) [result = 7] = 7
USimpleNameReferenceExpression (identifier = result) [result] = (var result = Undetermined)
ULiteralExpression (value = 7) [7] = 7
UBreakExpression (label = null) [break] = Nothing(break)
USwitchClauseExpressionWithBody [THIRD -> {...] = Undetermined
USimpleNameReferenceExpression (identifier = THIRD) [THIRD] = THIRD (enum entry)
UExpressionList (switch_entry) [{...] = Undetermined
UBinaryExpression (operator = =) [result = 13] = 13
USimpleNameReferenceExpression (identifier = result) [result] = (var result = Undetermined)
ULiteralExpression (value = 13) [13] = 13
UBreakExpression (label = null) [break] = Nothing(break)
USwitchClauseExpressionWithBody [else -> {...] = Undetermined
UDefaultCaseExpression [else] = Undetermined
UExpressionList (switch_entry) [{...] = Undetermined
UBinaryExpression (operator = =) [result = 66] = 66
USimpleNameReferenceExpression (identifier = result) [result] = (var result = Undetermined)
ULiteralExpression (value = 66) [66] = 66
UBreakExpression (label = null) [break] = Nothing(break)
UReturnExpression [return result] = Nothing
USimpleNameReferenceExpression (identifier = result) [result] = Phi((var result = 66), (var result = 13), (var result = 3), (var result = 7))
@@ -0,0 +1,39 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public enum EnumSwitchConditionalBreak {
FIRST,
SECOND,
THIRD;
public static int foo(EnumSwitchConditionalBreak key, int result) {
int newResult;
int counter = 0;
switch (key) {
case FIRST:
if (result > 0) {
newResult = 42;
counter++;
break;
}
counter++;
default:
newResult = 42;
counter++;
break;
}
return newResult + counter;
}
}
@@ -0,0 +1,50 @@
UFile (package = ) [public final enum EnumSwitchConditionalBreak {...]
UClass (name = EnumSwitchConditionalBreak) [public final enum EnumSwitchConditionalBreak {...}]
UEnumConstant (name = FIRST) [FIRST] = Undetermined
USimpleNameReferenceExpression (identifier = EnumSwitchConditionalBreak) [EnumSwitchConditionalBreak] = Undetermined
UEnumConstant (name = SECOND) [SECOND] = Undetermined
USimpleNameReferenceExpression (identifier = EnumSwitchConditionalBreak) [EnumSwitchConditionalBreak] = Undetermined
UEnumConstant (name = THIRD) [THIRD] = Undetermined
USimpleNameReferenceExpression (identifier = EnumSwitchConditionalBreak) [EnumSwitchConditionalBreak] = Undetermined
UMethod (name = foo) [public static fun foo(key: EnumSwitchConditionalBreak, result: int) : int {...}]
UParameter (name = key) [var key: EnumSwitchConditionalBreak]
UParameter (name = result) [var result: int]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var newResult: int] = Undetermined
ULocalVariable (name = newResult) [var newResult: int]
UDeclarationsExpression [var counter: int = 0] = Undetermined
ULocalVariable (name = counter) [var counter: int = 0]
ULiteralExpression (value = 0) [0] = 0
USwitchExpression [switch (key) ...] = Undetermined
USimpleNameReferenceExpression (identifier = key) [key] = Undetermined
UExpressionList (switch) [ FIRST -> {... ] = Undetermined
USwitchClauseExpressionWithBody [FIRST -> {...] = Undetermined
USimpleNameReferenceExpression (identifier = FIRST) [FIRST] = FIRST (enum entry)
UExpressionList (switch_entry) [{...] = Undetermined
UIfExpression [if (result > 0) {...}] = Undetermined
UBinaryExpression (operator = >) [result > 0] = Undetermined
USimpleNameReferenceExpression (identifier = result) [result] = Undetermined
ULiteralExpression (value = 0) [0] = 0
UBlockExpression [{...}] = Nothing(break)
UBinaryExpression (operator = =) [newResult = 42] = 42
USimpleNameReferenceExpression (identifier = newResult) [newResult] = (var newResult = Undetermined)
ULiteralExpression (value = 42) [42] = 42
UPostfixExpression (operator = ++) [counter++] = (var counter = 0)
USimpleNameReferenceExpression (identifier = counter) [counter] = (var counter = 0)
UBreakExpression (label = null) [break] = Nothing(break)
UastEmptyExpression [UastEmptyExpression] = Undetermined
UPostfixExpression (operator = ++) [counter++] = (var counter = 0)
USimpleNameReferenceExpression (identifier = counter) [counter] = (var counter = 0)
USwitchClauseExpressionWithBody [else -> {...] = Undetermined
UDefaultCaseExpression [else] = Undetermined
UExpressionList (switch_entry) [{...] = Undetermined
UBinaryExpression (operator = =) [newResult = 42] = 42
USimpleNameReferenceExpression (identifier = newResult) [newResult] = (var newResult = Undetermined)
ULiteralExpression (value = 42) [42] = 42
UPostfixExpression (operator = ++) [counter++] = Phi((var counter = 1), (var counter = 0))
USimpleNameReferenceExpression (identifier = counter) [counter] = Phi((var counter = 1), (var counter = 0))
UBreakExpression (label = null) [break] = Nothing(break)
UReturnExpression [return newResult + counter] = Nothing
UBinaryExpression (operator = +) [newResult + counter] = Undetermined (depending on: (var newResult = 42), (var counter = Undetermined))
USimpleNameReferenceExpression (identifier = newResult) [newResult] = (var newResult = 42)
USimpleNameReferenceExpression (identifier = counter) [counter] = (var counter = Undetermined)
@@ -0,0 +1,37 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public enum EnumSwitchWithoutBreaks {
FIRST,
SECOND,
THIRD;
public static int foo(EnumSwitchWithoutBreaks key) {
int result;
switch (key) {
case FIRST:
result = 3;
break;
case SECOND:
result = 7;
case THIRD:
result = 13;
default:
result = 66;
break;
}
return result;
}
}
@@ -0,0 +1,44 @@
UFile (package = ) [public final enum EnumSwitchWithoutBreaks {...]
UClass (name = EnumSwitchWithoutBreaks) [public final enum EnumSwitchWithoutBreaks {...}]
UEnumConstant (name = FIRST) [FIRST] = Undetermined
USimpleNameReferenceExpression (identifier = EnumSwitchWithoutBreaks) [EnumSwitchWithoutBreaks] = Undetermined
UEnumConstant (name = SECOND) [SECOND] = Undetermined
USimpleNameReferenceExpression (identifier = EnumSwitchWithoutBreaks) [EnumSwitchWithoutBreaks] = Undetermined
UEnumConstant (name = THIRD) [THIRD] = Undetermined
USimpleNameReferenceExpression (identifier = EnumSwitchWithoutBreaks) [EnumSwitchWithoutBreaks] = Undetermined
UMethod (name = foo) [public static fun foo(key: EnumSwitchWithoutBreaks) : int {...}]
UParameter (name = key) [var key: EnumSwitchWithoutBreaks]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var result: int] = Undetermined
ULocalVariable (name = result) [var result: int]
USwitchExpression [switch (key) ...] = Undetermined
USimpleNameReferenceExpression (identifier = key) [key] = Undetermined
UExpressionList (switch) [ FIRST -> {... ] = Undetermined
USwitchClauseExpressionWithBody [FIRST -> {...] = Undetermined
USimpleNameReferenceExpression (identifier = FIRST) [FIRST] = FIRST (enum entry)
UExpressionList (switch_entry) [{...] = Undetermined
UBinaryExpression (operator = =) [result = 3] = 3
USimpleNameReferenceExpression (identifier = result) [result] = (var result = Undetermined)
ULiteralExpression (value = 3) [3] = 3
UBreakExpression (label = null) [break] = Nothing(break)
USwitchClauseExpressionWithBody [SECOND -> {...] = Undetermined
USimpleNameReferenceExpression (identifier = SECOND) [SECOND] = SECOND (enum entry)
UExpressionList (switch_entry) [{...] = Undetermined
UBinaryExpression (operator = =) [result = 7] = 7
USimpleNameReferenceExpression (identifier = result) [result] = (var result = Undetermined)
ULiteralExpression (value = 7) [7] = 7
USwitchClauseExpressionWithBody [THIRD -> {...] = Undetermined
USimpleNameReferenceExpression (identifier = THIRD) [THIRD] = THIRD (enum entry)
UExpressionList (switch_entry) [{...] = Undetermined
UBinaryExpression (operator = =) [result = 13] = 13
USimpleNameReferenceExpression (identifier = result) [result] = Phi((var result = 7), (var result = Undetermined))
ULiteralExpression (value = 13) [13] = 13
USwitchClauseExpressionWithBody [else -> {...] = Undetermined
UDefaultCaseExpression [else] = Undetermined
UExpressionList (switch_entry) [{...] = Undetermined
UBinaryExpression (operator = =) [result = 66] = 66
USimpleNameReferenceExpression (identifier = result) [result] = Phi((var result = 13), (var result = Undetermined))
ULiteralExpression (value = 66) [66] = 66
UBreakExpression (label = null) [break] = Nothing(break)
UReturnExpression [return result] = Nothing
USimpleNameReferenceExpression (identifier = result) [result] = Phi((var result = 3), (var result = 66))
@@ -0,0 +1,31 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public enum Style {
SHEET("foo") {
@Override
public String getExitAnimation() {
return "bar";
}
};
Style(String s) {
}
public String getExitAnimation() {
return null;
}
}
@@ -0,0 +1,18 @@
UFile (package = )
UClass (name = Style)
UEnumConstant (name = SHEET)
USimpleNameReferenceExpression (identifier = Style)
ULiteralExpression (value = "foo")
UClass (name = null)
UMethod (name = getExitAnimation)
UAnnotation (fqName = java.lang.Override)
UBlockExpression
UReturnExpression
ULiteralExpression (value = "bar")
UMethod (name = Style)
UParameter (name = s)
UBlockExpression
UMethod (name = getExitAnimation)
UBlockExpression
UReturnExpression
ULiteralExpression (value = null)
@@ -0,0 +1,13 @@
public enum Style {
SHEET("foo") {
@java.lang.Override
public fun getExitAnimation() : java.lang.String {
return "bar"
}
}
private fun Style(s: java.lang.String) {
}
public fun getExitAnimation() : java.lang.String {
return null
}
}
@@ -0,0 +1,23 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public abstract class Foo {
public abstract String getTestName(boolean upper);
public void bar() {
String t1 = getTestName(false);
String t2 = getTestName(true);
}
}
@@ -0,0 +1,16 @@
UFile (package = ) [public abstract class Foo {...]
UClass (name = Foo) [public abstract class Foo {...}]
UMethod (name = getTestName) [public abstract fun getTestName(upper: boolean) : java.lang.String = UastEmptyExpression]
UParameter (name = upper) [var upper: boolean]
UMethod (name = bar) [public fun bar() : void {...}]
UBlockExpression [{...}] = Undetermined
UDeclarationsExpression [var t1: java.lang.String = getTestName(false)] = Undetermined
ULocalVariable (name = t1) [var t1: java.lang.String = getTestName(false)]
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [getTestName(false)] = "lower"
UIdentifier (Identifier (getTestName)) [UIdentifier (Identifier (getTestName))]
ULiteralExpression (value = false) [false] = false
UDeclarationsExpression [var t2: java.lang.String = getTestName(true)] = Undetermined
ULocalVariable (name = t2) [var t2: java.lang.String = getTestName(true)]
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [getTestName(true)] = "UPPER"
UIdentifier (Identifier (getTestName)) [UIdentifier (Identifier (getTestName))]
ULiteralExpression (value = true) [true] = true
+27
View File
@@ -0,0 +1,27 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.util.LinkedList;
public class External {
public static boolean foo() {
return new LinkedList<Integer>() == new LinkedList<Integer>();
}
public static boolean bar() {
List<Integer> list = new LinkedList<Integer>();
return list == list;
}
}
@@ -0,0 +1,21 @@
UFile (package = ) [import java.util.LinkedList...]
UImportStatement (isOnDemand = false) [import java.util.LinkedList]
UClass (name = External) [public class External {...}]
UMethod (name = foo) [public static fun foo() : boolean {...}]
UBlockExpression [{...}] = Nothing
UReturnExpression [return LinkedList() === LinkedList()] = Nothing
UBinaryExpression (operator = ===) [LinkedList() === LinkedList()] = Undetermined
UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [LinkedList()] = external LinkedList()()
USimpleNameReferenceExpression (identifier = LinkedList) [LinkedList] = external LinkedList()
UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [LinkedList()] = external LinkedList()()
USimpleNameReferenceExpression (identifier = LinkedList) [LinkedList] = external LinkedList()
UMethod (name = bar) [public static fun bar() : boolean {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var list: List<Integer> = LinkedList()] = Undetermined
ULocalVariable (name = list) [var list: List<Integer> = LinkedList()]
UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [LinkedList()] = external LinkedList()()
USimpleNameReferenceExpression (identifier = LinkedList) [LinkedList] = external LinkedList()
UReturnExpression [return list === list] = Nothing
UBinaryExpression (operator = ===) [list === list] = Undetermined (depending on: (var list = external LinkedList()()))
USimpleNameReferenceExpression (identifier = list) [list] = (var list = external LinkedList()())
USimpleNameReferenceExpression (identifier = list) [list] = (var list = external LinkedList()())
+18
View File
@@ -0,0 +1,18 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class Simple {
public static String foo = "a";
}
+21
View File
@@ -0,0 +1,21 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class Foo {
public static void bar() {
int s = Integer.SIZE;
System.out.println(s);
}
}
@@ -0,0 +1,16 @@
UFile (package = ) [public class Foo {...]
UClass (name = Foo) [public class Foo {...}]
UMethod (name = bar) [public static fun bar() : void {...}]
UBlockExpression [{...}] = external println(s)((var s = 32))
UDeclarationsExpression [var s: int = Integer.SIZE] = Undetermined
ULocalVariable (name = s) [var s: int = Integer.SIZE]
UQualifiedReferenceExpression [Integer.SIZE] = 32
USimpleNameReferenceExpression (identifier = Integer) [Integer] = external Integer()
USimpleNameReferenceExpression (identifier = SIZE) [SIZE] = 32
UQualifiedReferenceExpression [System.out.println(s)] = external println(s)((var s = 32))
UQualifiedReferenceExpression [System.out] = Undetermined
USimpleNameReferenceExpression (identifier = System) [System] = external System()
USimpleNameReferenceExpression (identifier = out) [out] = Undetermined
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [println(s)] = external println(s)((var s = 32))
UIdentifier (Identifier (println)) [UIdentifier (Identifier (println))]
USimpleNameReferenceExpression (identifier = s) [s] = (var s = 32)
@@ -0,0 +1,26 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class FloatDouble {
public static double foo() {
float f1 = 1.0F;
double d2 = 2.0;
double d3 = f1 + d2;
float f2 = f1 + f1;
float f3 = (float) d3;
double d1 = (double) f1;
return d1 + f1 + f2 + f3;
}
}
@@ -0,0 +1,36 @@
UFile (package = ) [public class FloatDouble {...]
UClass (name = FloatDouble) [public class FloatDouble {...}]
UMethod (name = foo) [public static fun foo() : double {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var f1: float = 1.0] = Undetermined
ULocalVariable (name = f1) [var f1: float = 1.0]
ULiteralExpression (value = 1.0) [1.0] = (float)1.0
UDeclarationsExpression [var d2: double = 2.0] = Undetermined
ULocalVariable (name = d2) [var d2: double = 2.0]
ULiteralExpression (value = 2.0) [2.0] = 2.0
UDeclarationsExpression [var d3: double = f1 + d2] = Undetermined
ULocalVariable (name = d3) [var d3: double = f1 + d2]
UBinaryExpression (operator = +) [f1 + d2] = 3.0 (depending on: (var f1 = (float)1.0), (var d2 = 2.0))
USimpleNameReferenceExpression (identifier = f1) [f1] = (var f1 = (float)1.0)
USimpleNameReferenceExpression (identifier = d2) [d2] = (var d2 = 2.0)
UDeclarationsExpression [var f2: float = f1 + f1] = Undetermined
ULocalVariable (name = f2) [var f2: float = f1 + f1]
UBinaryExpression (operator = +) [f1 + f1] = (float)2.0 (depending on: (var f1 = (float)1.0))
USimpleNameReferenceExpression (identifier = f1) [f1] = (var f1 = (float)1.0)
USimpleNameReferenceExpression (identifier = f1) [f1] = (var f1 = (float)1.0)
UDeclarationsExpression [var f3: float = d3 as float] = Undetermined
ULocalVariable (name = f3) [var f3: float = d3 as float]
UBinaryExpressionWithType [d3 as float] = (float)3.0
USimpleNameReferenceExpression (identifier = d3) [d3] = (var d3 = 3.0 (depending on: (var f1 = (float)1.0), (var d2 = 2.0)))
UTypeReferenceExpression (name = float) [float] = Undetermined
UDeclarationsExpression [var d1: double = f1 as double] = Undetermined
ULocalVariable (name = d1) [var d1: double = f1 as double]
UBinaryExpressionWithType [f1 as double] = 1.0
USimpleNameReferenceExpression (identifier = f1) [f1] = (var f1 = (float)1.0)
UTypeReferenceExpression (name = double) [double] = Undetermined
UReturnExpression [return d1 + f1 + f2 + f3] = Nothing
UPolyadicExpression (operator = +) [d1 + f1 + f2 + f3] = 7.0 (depending on: (var d1 = 1.0), (var f1 = (float)1.0), (var f2 = (float)2.0 (depending on: (var f1 = (float)1.0))), (var f3 = (float)3.0))
USimpleNameReferenceExpression (identifier = d1) [d1] = (var d1 = 1.0)
USimpleNameReferenceExpression (identifier = f1) [f1] = (var f1 = (float)1.0)
USimpleNameReferenceExpression (identifier = f2) [f2] = (var f2 = (float)2.0 (depending on: (var f1 = (float)1.0)))
USimpleNameReferenceExpression (identifier = f3) [f3] = (var f3 = (float)3.0)
+24
View File
@@ -0,0 +1,24 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class For {
public static int foo() {
int result = 0;
for (int i = 0; i < 10; i++) {
result = result + i;
}
return result;
}
}
@@ -0,0 +1,24 @@
UFile (package = ) [public class For {...]
UClass (name = For) [public class For {...}]
UMethod (name = foo) [public static fun foo() : int {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var result: int = 0] = Undetermined
ULocalVariable (name = result) [var result: int = 0]
ULiteralExpression (value = 0) [0] = 0
UForExpression [for (var i: int = 0; i < 10; i++) {...}] = Undetermined
UDeclarationsExpression [var i: int = 0] = Undetermined
ULocalVariable (name = i) [var i: int = 0]
ULiteralExpression (value = 0) [0] = 0
UBinaryExpression (operator = <) [i < 10] = Undetermined
USimpleNameReferenceExpression (identifier = i) [i] = Phi((var i = Undetermined), (var i = 1), (var i = 0))
ULiteralExpression (value = 10) [10] = 10
UPostfixExpression (operator = ++) [i++] = Phi((var i = Undetermined), (var i = 1), (var i = 0))
USimpleNameReferenceExpression (identifier = i) [i] = Phi((var i = Undetermined), (var i = 1), (var i = 0))
UBlockExpression [{...}] = Undetermined
UBinaryExpression (operator = =) [result = result + i] = Undetermined
USimpleNameReferenceExpression (identifier = result) [result] = Phi((var result = Undetermined), (var result = 0 (depending on: (var i = 0))), (var result = 0))
UBinaryExpression (operator = +) [result + i] = Undetermined
USimpleNameReferenceExpression (identifier = result) [result] = Phi((var result = Undetermined), (var result = 0 (depending on: (var i = 0))), (var result = 0))
USimpleNameReferenceExpression (identifier = i) [i] = Phi((var i = Undetermined), (var i = 1), (var i = 0))
UReturnExpression [return result] = Nothing
USimpleNameReferenceExpression (identifier = result) [result] = Phi((var result = Undetermined), (var result = 0 (depending on: (var i = 0))), (var result = 0))
+24
View File
@@ -0,0 +1,24 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class For {
public static int sum(List<Integer> numbers) {
int result = 0;
for (int number: numbers) {
result = result + number;
}
return result;
}
}
@@ -0,0 +1,18 @@
UFile (package = ) [public class For {...]
UClass (name = For) [public class For {...}]
UMethod (name = sum) [public static fun sum(numbers: List<Integer>) : int {...}]
UParameter (name = numbers) [var numbers: List<Integer>]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var result: int = 0] = Undetermined
ULocalVariable (name = result) [var result: int = 0]
ULiteralExpression (value = 0) [0] = 0
UForEachExpression [for (number : numbers) {...}] = Undetermined
USimpleNameReferenceExpression (identifier = numbers) [numbers] = Undetermined
UBlockExpression [{...}] = Undetermined
UBinaryExpression (operator = =) [result = result + number] = Undetermined
USimpleNameReferenceExpression (identifier = result) [result] = Phi((var result = Undetermined), (var result = 0))
UBinaryExpression (operator = +) [result + number] = Undetermined
USimpleNameReferenceExpression (identifier = result) [result] = Phi((var result = Undetermined), (var result = 0))
USimpleNameReferenceExpression (identifier = number) [number] = Undetermined
UReturnExpression [return result] = Nothing
USimpleNameReferenceExpression (identifier = result) [result] = Phi((var result = Undetermined), (var result = 0))
@@ -0,0 +1,38 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import java.util.*;
public class For {
public static List<Integer> getList(int size) {
List<Integer> result = new LinkedList<Integer>();
int a = 0;
for (int i = a++; i < size; i++) {
result.add(i);
}
result.add(a);
return result;
}
public static int sum(List<Integer> numbers) {
int result = 0;
int size = 3;
for (int number: getList(++size)) {
result = result + number;
}
return result + size;
}
}
@@ -0,0 +1,60 @@
UFile (package = ) [import java.util...]
UImportStatement (isOnDemand = true) [import java.util]
UClass (name = For) [public class For {...}]
UMethod (name = getList) [public static fun getList(size: int) : java.util.List<java.lang.Integer> {...}]
UParameter (name = size) [var size: int]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var result: java.util.List<java.lang.Integer> = LinkedList()] = Undetermined
ULocalVariable (name = result) [var result: java.util.List<java.lang.Integer> = LinkedList()]
UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0)) [LinkedList()] = external LinkedList()()
USimpleNameReferenceExpression (identifier = LinkedList) [LinkedList] = external LinkedList()
UDeclarationsExpression [var a: int = 0] = Undetermined
ULocalVariable (name = a) [var a: int = 0]
ULiteralExpression (value = 0) [0] = 0
UForExpression [for (var i: int = a++; i < size; i++) {...}] = Undetermined
UDeclarationsExpression [var i: int = a++] = Undetermined
ULocalVariable (name = i) [var i: int = a++]
UPostfixExpression (operator = ++) [a++] = (var a = 0)
USimpleNameReferenceExpression (identifier = a) [a] = (var a = 0)
UBinaryExpression (operator = <) [i < size] = Undetermined
USimpleNameReferenceExpression (identifier = i) [i] = Phi((var i = Undetermined), (var i = 1), (var i = (var a = 0)))
USimpleNameReferenceExpression (identifier = size) [size] = Undetermined
UPostfixExpression (operator = ++) [i++] = Phi((var i = Undetermined), (var i = 1), (var i = (var a = 0)))
USimpleNameReferenceExpression (identifier = i) [i] = Phi((var i = Undetermined), (var i = 1), (var i = (var a = 0)))
UBlockExpression [{...}] = external add(i)(Phi((var i = Undetermined), (var i = 1), (var i = (var a = 0))))
UQualifiedReferenceExpression [result.add(i)] = external add(i)(Phi((var i = Undetermined), (var i = 1), (var i = (var a = 0))))
USimpleNameReferenceExpression (identifier = result) [result] = (var result = external LinkedList()())
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [add(i)] = external add(i)(Phi((var i = Undetermined), (var i = 1), (var i = (var a = 0))))
UIdentifier (Identifier (add)) [UIdentifier (Identifier (add))]
USimpleNameReferenceExpression (identifier = i) [i] = Phi((var i = Undetermined), (var i = 1), (var i = (var a = 0)))
UQualifiedReferenceExpression [result.add(a)] = external add(a)((var a = 1))
USimpleNameReferenceExpression (identifier = result) [result] = (var result = external LinkedList()())
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [add(a)] = external add(a)((var a = 1))
UIdentifier (Identifier (add)) [UIdentifier (Identifier (add))]
USimpleNameReferenceExpression (identifier = a) [a] = (var a = 1)
UReturnExpression [return result] = Nothing
USimpleNameReferenceExpression (identifier = result) [result] = (var result = external LinkedList()())
UMethod (name = sum) [public static fun sum(numbers: java.util.List<java.lang.Integer>) : int {...}]
UParameter (name = numbers) [var numbers: java.util.List<java.lang.Integer>]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var result: int = 0] = Undetermined
ULocalVariable (name = result) [var result: int = 0]
ULiteralExpression (value = 0) [0] = 0
UDeclarationsExpression [var size: int = 3] = Undetermined
ULocalVariable (name = size) [var size: int = 3]
ULiteralExpression (value = 3) [3] = 3
UForEachExpression [for (number : getList(++size)) {...}] = Undetermined
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [getList(++size)] = external getList(++size)(4 (depending on: (var size = 3)))
UIdentifier (Identifier (getList)) [UIdentifier (Identifier (getList))]
UPrefixExpression (operator = ++) [++size] = 4 (depending on: (var size = 3))
USimpleNameReferenceExpression (identifier = size) [size] = (var size = 3)
UBlockExpression [{...}] = Undetermined
UBinaryExpression (operator = =) [result = result + number] = Undetermined
USimpleNameReferenceExpression (identifier = result) [result] = Phi((var result = Undetermined), (var result = 0))
UBinaryExpression (operator = +) [result + number] = Undetermined
USimpleNameReferenceExpression (identifier = result) [result] = Phi((var result = Undetermined), (var result = 0))
USimpleNameReferenceExpression (identifier = number) [number] = Undetermined
UReturnExpression [return result + size] = Nothing
UBinaryExpression (operator = +) [result + size] = Undetermined (depending on: (var size = 4))
USimpleNameReferenceExpression (identifier = result) [result] = Phi((var result = Undetermined), (var result = 0))
USimpleNameReferenceExpression (identifier = size) [size] = (var size = 4)
@@ -0,0 +1,31 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class IdentityEquals {
public static boolean foo() {
Integer i1 = 111;
Integer i2 = 222;
Integer i12 = i1 + i2;
Integer i21 = i2 + i1;
return i12 == i21;
}
public static boolean bar() {
String s1 = "hello";
String s2 = s1 + s1;
String s3 = "hellohello";
return s2 == s3;
}
}
@@ -0,0 +1,41 @@
UFile (package = ) [public class IdentityEquals {...]
UClass (name = IdentityEquals) [public class IdentityEquals {...}]
UMethod (name = foo) [public static fun foo() : boolean {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var i1: java.lang.Integer = 111] = Undetermined
ULocalVariable (name = i1) [var i1: java.lang.Integer = 111]
ULiteralExpression (value = 111) [111] = 111
UDeclarationsExpression [var i2: java.lang.Integer = 222] = Undetermined
ULocalVariable (name = i2) [var i2: java.lang.Integer = 222]
ULiteralExpression (value = 222) [222] = 222
UDeclarationsExpression [var i12: java.lang.Integer = i1 + i2] = Undetermined
ULocalVariable (name = i12) [var i12: java.lang.Integer = i1 + i2]
UBinaryExpression (operator = +) [i1 + i2] = 333 (depending on: (var i1 = 111), (var i2 = 222))
USimpleNameReferenceExpression (identifier = i1) [i1] = (var i1 = 111)
USimpleNameReferenceExpression (identifier = i2) [i2] = (var i2 = 222)
UDeclarationsExpression [var i21: java.lang.Integer = i2 + i1] = Undetermined
ULocalVariable (name = i21) [var i21: java.lang.Integer = i2 + i1]
UBinaryExpression (operator = +) [i2 + i1] = 333 (depending on: (var i2 = 222), (var i1 = 111))
USimpleNameReferenceExpression (identifier = i2) [i2] = (var i2 = 222)
USimpleNameReferenceExpression (identifier = i1) [i1] = (var i1 = 111)
UReturnExpression [return i12 === i21] = Nothing
UBinaryExpression (operator = ===) [i12 === i21] = Undetermined
USimpleNameReferenceExpression (identifier = i12) [i12] = (var i12 = 333 (depending on: (var i1 = 111), (var i2 = 222)))
USimpleNameReferenceExpression (identifier = i21) [i21] = (var i21 = 333 (depending on: (var i2 = 222), (var i1 = 111)))
UMethod (name = bar) [public static fun bar() : boolean {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var s1: java.lang.String = "hello"] = Undetermined
ULocalVariable (name = s1) [var s1: java.lang.String = "hello"]
ULiteralExpression (value = "hello") ["hello"] = "hello"
UDeclarationsExpression [var s2: java.lang.String = s1 + s1] = Undetermined
ULocalVariable (name = s2) [var s2: java.lang.String = s1 + s1]
UBinaryExpression (operator = +) [s1 + s1] = "hellohello" (depending on: (var s1 = "hello"))
USimpleNameReferenceExpression (identifier = s1) [s1] = (var s1 = "hello")
USimpleNameReferenceExpression (identifier = s1) [s1] = (var s1 = "hello")
UDeclarationsExpression [var s3: java.lang.String = "hellohello"] = Undetermined
ULocalVariable (name = s3) [var s3: java.lang.String = "hellohello"]
ULiteralExpression (value = "hellohello") ["hellohello"] = "hellohello"
UReturnExpression [return s2 === s3] = Nothing
UBinaryExpression (operator = ===) [s2 === s3] = Undetermined
USimpleNameReferenceExpression (identifier = s2) [s2] = (var s2 = "hellohello" (depending on: (var s1 = "hello")))
USimpleNameReferenceExpression (identifier = s3) [s3] = (var s3 = "hellohello")
@@ -0,0 +1,28 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class ImmutableField {
final int immutable;
public ImmutableField() {
immutable = 1;
bar(immutable);
bar(immutable);
}
public static int bar(int arg) {
return arg;
}
}
@@ -0,0 +1,19 @@
UFile (package = ) [public class ImmutableField {...]
UClass (name = ImmutableField) [public class ImmutableField {...}]
UField (name = immutable) [final var immutable: int]
UMethod (name = ImmutableField) [public fun ImmutableField() {...}]
UBlockExpression [{...}] = external bar(immutable)((var immutable = 1))
UBinaryExpression (operator = =) [immutable = 1] = 1
USimpleNameReferenceExpression (identifier = immutable) [immutable] = Undetermined
ULiteralExpression (value = 1) [1] = 1
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [bar(immutable)] = external bar(immutable)((var immutable = 1))
UIdentifier (Identifier (bar)) [UIdentifier (Identifier (bar))]
USimpleNameReferenceExpression (identifier = immutable) [immutable] = (var immutable = 1)
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 1)) [bar(immutable)] = external bar(immutable)((var immutable = 1))
UIdentifier (Identifier (bar)) [UIdentifier (Identifier (bar))]
USimpleNameReferenceExpression (identifier = immutable) [immutable] = (var immutable = 1)
UMethod (name = bar) [public static fun bar(arg: int) : int {...}]
UParameter (name = arg) [var arg: int]
UBlockExpression [{...}] = Nothing
UReturnExpression [return arg] = Nothing
USimpleNameReferenceExpression (identifier = arg) [arg] = Undetermined
+25
View File
@@ -0,0 +1,25 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class IncDec {
public static int foo() {
int i1 = 1; // 1
int i2 = ++i1; // 2, 2
int i3 = i2++; // 2, 3
int i4 = --i3; // 1, 1
int i5 = i4--; // 1, 0
return i4 + i5;// 1
}
}
@@ -0,0 +1,27 @@
UFile (package = ) [public class IncDec {...]
UClass (name = IncDec) [public class IncDec {...}]
UMethod (name = foo) [public static fun foo() : int {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var i1: int = 1] = Undetermined
ULocalVariable (name = i1) [var i1: int = 1]
ULiteralExpression (value = 1) [1] = 1
UDeclarationsExpression [var i2: int = ++i1] = Undetermined
ULocalVariable (name = i2) [var i2: int = ++i1]
UPrefixExpression (operator = ++) [++i1] = 2 (depending on: (var i1 = 1))
USimpleNameReferenceExpression (identifier = i1) [i1] = (var i1 = 1)
UDeclarationsExpression [var i3: int = i2++] = Undetermined
ULocalVariable (name = i3) [var i3: int = i2++]
UPostfixExpression (operator = ++) [i2++] = (var i2 = 2 (depending on: (var i1 = 1)))
USimpleNameReferenceExpression (identifier = i2) [i2] = (var i2 = 2 (depending on: (var i1 = 1)))
UDeclarationsExpression [var i4: int = --i3] = Undetermined
ULocalVariable (name = i4) [var i4: int = --i3]
UPrefixExpression (operator = --) [--i3] = 1 (depending on: (var i3 = (var i2 = 2 (depending on: (var i1 = 1)))))
USimpleNameReferenceExpression (identifier = i3) [i3] = (var i3 = (var i2 = 2 (depending on: (var i1 = 1))))
UDeclarationsExpression [var i5: int = i4--] = Undetermined
ULocalVariable (name = i5) [var i5: int = i4--]
UPostfixExpression (operator = --) [i4--] = (var i4 = 1 (depending on: (var i3 = (var i2 = 2 (depending on: (var i1 = 1))))))
USimpleNameReferenceExpression (identifier = i4) [i4] = (var i4 = 1 (depending on: (var i3 = (var i2 = 2 (depending on: (var i1 = 1))))))
UReturnExpression [return i4 + i5] = Nothing
UBinaryExpression (operator = +) [i4 + i5] = 1 (depending on: (var i4 = 0), (var i5 = (var i4 = 1 (depending on: (var i3 = (var i2 = 2 (depending on: (var i1 = 1))))))))
USimpleNameReferenceExpression (identifier = i4) [i4] = (var i4 = 0)
USimpleNameReferenceExpression (identifier = i5) [i5] = (var i5 = (var i4 = 1 (depending on: (var i3 = (var i2 = 2 (depending on: (var i1 = 1)))))))
+34
View File
@@ -0,0 +1,34 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class IntLong {
public static long foo() {
int one = 1;
int two = one + one;
int four = two * two;
int sixteen = four * four;
int twoPowerEight = sixteen * sixteen;
int twoPowerSixteen = twoPowerEight * twoPowerEight;
int twoPowerTwentyFour = twoPowerSixteen * twoPowerEight;
int twoPowerThirtyTwo = twoPowerSixteen * twoPowerSixteen;
long twoPowerFourty = ((long) twoPowerSixteen) * ((long) twoPowerTwentyFour);
long eight = 8L;
long twoPowerFourtyThree = twoPowerFourty * eight;
long twoPowerFourtyEight = twoPowerFourty * twoPowerEight;
long twoPowerFiftySix = twoPowerEight * twoPowerFourty;
return twoPowerFiftySix;
}
}
@@ -0,0 +1,73 @@
UFile (package = ) [public class IntLong {...]
UClass (name = IntLong) [public class IntLong {...}]
UMethod (name = foo) [public static fun foo() : long {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var one: int = 1] = Undetermined
ULocalVariable (name = one) [var one: int = 1]
ULiteralExpression (value = 1) [1] = 1
UDeclarationsExpression [var two: int = one + one] = Undetermined
ULocalVariable (name = two) [var two: int = one + one]
UBinaryExpression (operator = +) [one + one] = 2 (depending on: (var one = 1))
USimpleNameReferenceExpression (identifier = one) [one] = (var one = 1)
USimpleNameReferenceExpression (identifier = one) [one] = (var one = 1)
UDeclarationsExpression [var four: int = two * two] = Undetermined
ULocalVariable (name = four) [var four: int = two * two]
UBinaryExpression (operator = *) [two * two] = 4 (depending on: (var two = 2 (depending on: (var one = 1))))
USimpleNameReferenceExpression (identifier = two) [two] = (var two = 2 (depending on: (var one = 1)))
USimpleNameReferenceExpression (identifier = two) [two] = (var two = 2 (depending on: (var one = 1)))
UDeclarationsExpression [var sixteen: int = four * four] = Undetermined
ULocalVariable (name = sixteen) [var sixteen: int = four * four]
UBinaryExpression (operator = *) [four * four] = 16 (depending on: (var four = 4 (depending on: (var two = 2 (depending on: (var one = 1))))))
USimpleNameReferenceExpression (identifier = four) [four] = (var four = 4 (depending on: (var two = 2 (depending on: (var one = 1)))))
USimpleNameReferenceExpression (identifier = four) [four] = (var four = 4 (depending on: (var two = 2 (depending on: (var one = 1)))))
UDeclarationsExpression [var twoPowerEight: int = sixteen * sixteen] = Undetermined
ULocalVariable (name = twoPowerEight) [var twoPowerEight: int = sixteen * sixteen]
UBinaryExpression (operator = *) [sixteen * sixteen] = 256 (depending on: (var sixteen = 16 (depending on: (var four = 4 (depending on: (var two = 2 (depending on: (var one = 1))))))))
USimpleNameReferenceExpression (identifier = sixteen) [sixteen] = (var sixteen = 16 (depending on: (var four = 4 (depending on: (var two = 2 (depending on: (var one = 1)))))))
USimpleNameReferenceExpression (identifier = sixteen) [sixteen] = (var sixteen = 16 (depending on: (var four = 4 (depending on: (var two = 2 (depending on: (var one = 1)))))))
UDeclarationsExpression [var twoPowerSixteen: int = twoPowerEight * twoPowerEight] = Undetermined
ULocalVariable (name = twoPowerSixteen) [var twoPowerSixteen: int = twoPowerEight * twoPowerEight]
UBinaryExpression (operator = *) [twoPowerEight * twoPowerEight] = 65536 (depending on: (var twoPowerEight = 256 (depending on: (var sixteen = 16 (depending on: (var four = 4 (depending on: (var two = 2 (depending on: (var one = 1))))))))))
USimpleNameReferenceExpression (identifier = twoPowerEight) [twoPowerEight] = (var twoPowerEight = 256 (depending on: (var sixteen = 16 (depending on: (var four = 4 (depending on: (var two = 2 (depending on: (var one = 1)))))))))
USimpleNameReferenceExpression (identifier = twoPowerEight) [twoPowerEight] = (var twoPowerEight = 256 (depending on: (var sixteen = 16 (depending on: (var four = 4 (depending on: (var two = 2 (depending on: (var one = 1)))))))))
UDeclarationsExpression [var twoPowerTwentyFour: int = twoPowerSixteen * twoPowerEight] = Undetermined
ULocalVariable (name = twoPowerTwentyFour) [var twoPowerTwentyFour: int = twoPowerSixteen * twoPowerEight]
UBinaryExpression (operator = *) [twoPowerSixteen * twoPowerEight] = 16777216 (depending on: (var twoPowerSixteen = 65536 (depending on: (var twoPowerEight = 256 (depending on: (var sixteen = 16 (depending on: (var four = 4 (depending on: (var two = 2 (depending on: (var one = 1))))))))))), (var twoPowerEight = 256 (depending on: (var sixteen = 16 (depending on: (var four = 4 (depending on: (var two = 2 (depending on: (var one = 1))))))))))
USimpleNameReferenceExpression (identifier = twoPowerSixteen) [twoPowerSixteen] = (var twoPowerSixteen = 65536 (depending on: (var twoPowerEight = 256 (depending on: (var sixteen = 16 (depending on: (var four = 4 (depending on: (var two = 2 (depending on: (var one = 1)))))))))))
USimpleNameReferenceExpression (identifier = twoPowerEight) [twoPowerEight] = (var twoPowerEight = 256 (depending on: (var sixteen = 16 (depending on: (var four = 4 (depending on: (var two = 2 (depending on: (var one = 1)))))))))
UDeclarationsExpression [var twoPowerThirtyTwo: int = twoPowerSixteen * twoPowerSixteen] = Undetermined
ULocalVariable (name = twoPowerThirtyTwo) [var twoPowerThirtyTwo: int = twoPowerSixteen * twoPowerSixteen]
UBinaryExpression (operator = *) [twoPowerSixteen * twoPowerSixteen] = 0 (depending on: (var twoPowerSixteen = 65536 (depending on: (var twoPowerEight = 256 (depending on: (var sixteen = 16 (depending on: (var four = 4 (depending on: (var two = 2 (depending on: (var one = 1))))))))))))
USimpleNameReferenceExpression (identifier = twoPowerSixteen) [twoPowerSixteen] = (var twoPowerSixteen = 65536 (depending on: (var twoPowerEight = 256 (depending on: (var sixteen = 16 (depending on: (var four = 4 (depending on: (var two = 2 (depending on: (var one = 1)))))))))))
USimpleNameReferenceExpression (identifier = twoPowerSixteen) [twoPowerSixteen] = (var twoPowerSixteen = 65536 (depending on: (var twoPowerEight = 256 (depending on: (var sixteen = 16 (depending on: (var four = 4 (depending on: (var two = 2 (depending on: (var one = 1)))))))))))
UDeclarationsExpression [var twoPowerFourty: long = (twoPowerSixteen as long) * (twoPowerTwentyFour as long)] = Undetermined
ULocalVariable (name = twoPowerFourty) [var twoPowerFourty: long = (twoPowerSixteen as long) * (twoPowerTwentyFour as long)]
UBinaryExpression (operator = *) [(twoPowerSixteen as long) * (twoPowerTwentyFour as long)] = (long)1099511627776
UParenthesizedExpression [(twoPowerSixteen as long)] = (long)65536
UBinaryExpressionWithType [twoPowerSixteen as long] = (long)65536
USimpleNameReferenceExpression (identifier = twoPowerSixteen) [twoPowerSixteen] = (var twoPowerSixteen = 65536 (depending on: (var twoPowerEight = 256 (depending on: (var sixteen = 16 (depending on: (var four = 4 (depending on: (var two = 2 (depending on: (var one = 1)))))))))))
UTypeReferenceExpression (name = long) [long] = Undetermined
UParenthesizedExpression [(twoPowerTwentyFour as long)] = (long)16777216
UBinaryExpressionWithType [twoPowerTwentyFour as long] = (long)16777216
USimpleNameReferenceExpression (identifier = twoPowerTwentyFour) [twoPowerTwentyFour] = (var twoPowerTwentyFour = 16777216 (depending on: (var twoPowerSixteen = 65536 (depending on: (var twoPowerEight = 256 (depending on: (var sixteen = 16 (depending on: (var four = 4 (depending on: (var two = 2 (depending on: (var one = 1))))))))))), (var twoPowerEight = 256 (depending on: (var sixteen = 16 (depending on: (var four = 4 (depending on: (var two = 2 (depending on: (var one = 1)))))))))))
UTypeReferenceExpression (name = long) [long] = Undetermined
UDeclarationsExpression [var eight: long = 8] = Undetermined
ULocalVariable (name = eight) [var eight: long = 8]
ULiteralExpression (value = 8) [8] = (long)8
UDeclarationsExpression [var twoPowerFourtyThree: long = twoPowerFourty * eight] = Undetermined
ULocalVariable (name = twoPowerFourtyThree) [var twoPowerFourtyThree: long = twoPowerFourty * eight]
UBinaryExpression (operator = *) [twoPowerFourty * eight] = (long)8796093022208 (depending on: (var twoPowerFourty = (long)1099511627776), (var eight = (long)8))
USimpleNameReferenceExpression (identifier = twoPowerFourty) [twoPowerFourty] = (var twoPowerFourty = (long)1099511627776)
USimpleNameReferenceExpression (identifier = eight) [eight] = (var eight = (long)8)
UDeclarationsExpression [var twoPowerFourtyEight: long = twoPowerFourty * twoPowerEight] = Undetermined
ULocalVariable (name = twoPowerFourtyEight) [var twoPowerFourtyEight: long = twoPowerFourty * twoPowerEight]
UBinaryExpression (operator = *) [twoPowerFourty * twoPowerEight] = (long)281474976710656 (depending on: (var twoPowerFourty = (long)1099511627776), (var twoPowerEight = 256 (depending on: (var sixteen = 16 (depending on: (var four = 4 (depending on: (var two = 2 (depending on: (var one = 1))))))))))
USimpleNameReferenceExpression (identifier = twoPowerFourty) [twoPowerFourty] = (var twoPowerFourty = (long)1099511627776)
USimpleNameReferenceExpression (identifier = twoPowerEight) [twoPowerEight] = (var twoPowerEight = 256 (depending on: (var sixteen = 16 (depending on: (var four = 4 (depending on: (var two = 2 (depending on: (var one = 1)))))))))
UDeclarationsExpression [var twoPowerFiftySix: long = twoPowerEight * twoPowerFourty] = Undetermined
ULocalVariable (name = twoPowerFiftySix) [var twoPowerFiftySix: long = twoPowerEight * twoPowerFourty]
UBinaryExpression (operator = *) [twoPowerEight * twoPowerFourty] = (long)281474976710656 (depending on: (var twoPowerEight = 256 (depending on: (var sixteen = 16 (depending on: (var four = 4 (depending on: (var two = 2 (depending on: (var one = 1))))))))), (var twoPowerFourty = (long)1099511627776))
USimpleNameReferenceExpression (identifier = twoPowerEight) [twoPowerEight] = (var twoPowerEight = 256 (depending on: (var sixteen = 16 (depending on: (var four = 4 (depending on: (var two = 2 (depending on: (var one = 1)))))))))
USimpleNameReferenceExpression (identifier = twoPowerFourty) [twoPowerFourty] = (var twoPowerFourty = (long)1099511627776)
UReturnExpression [return twoPowerFiftySix] = Nothing
USimpleNameReferenceExpression (identifier = twoPowerFiftySix) [twoPowerFiftySix] = (var twoPowerFiftySix = (long)281474976710656 (depending on: (var twoPowerEight = 256 (depending on: (var sixteen = 16 (depending on: (var four = 4 (depending on: (var two = 2 (depending on: (var one = 1))))))))), (var twoPowerFourty = (long)1099511627776)))
+28
View File
@@ -0,0 +1,28 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class Labeled {
public static int foo() {
int first = 1;
int second = 2;
labeled: while (true) {
second = 3;
if (first > 0) break labeled;
}
return second;
}
}
@@ -0,0 +1,25 @@
UFile (package = ) [public class Labeled {...]
UClass (name = Labeled) [public class Labeled {...}]
UMethod (name = foo) [public static fun foo() : int {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var first: int = 1] = Undetermined
ULocalVariable (name = first) [var first: int = 1]
ULiteralExpression (value = 1) [1] = 1
UDeclarationsExpression [var second: int = 2] = Undetermined
ULocalVariable (name = second) [var second: int = 2]
ULiteralExpression (value = 2) [2] = 2
ULabeledExpression (label = labeled) [labeled@ while (true) {...}] = Undetermined
UWhileExpression [while (true) {...}] = Undetermined
ULiteralExpression (value = true) [true] = true
UBlockExpression [{...}] = Nothing(break)
UBinaryExpression (operator = =) [second = 3] = 3
USimpleNameReferenceExpression (identifier = second) [second] = (var second = 2)
ULiteralExpression (value = 3) [3] = 3
UIfExpression [if (first > 0) break@labeled] = Nothing(break)
UBinaryExpression (operator = >) [first > 0] = true (depending on: (var first = 1))
USimpleNameReferenceExpression (identifier = first) [first] = (var first = 1)
ULiteralExpression (value = 0) [0] = 0
UBreakExpression (label = labeled) [break@labeled] = Nothing(break)
UastEmptyExpression [UastEmptyExpression] = Undetermined
UReturnExpression [return second] = Nothing
USimpleNameReferenceExpression (identifier = second) [second] = (var second = 3)
@@ -0,0 +1,30 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class LabeledOuter {
public static int foo() {
int second = 2;
labeled: for (int first = 1; first < 4; first++) {
while (second < 10) {
second = 3;
if (first > 0) break labeled;
}
second = 4;
}
return second;
}
}
@@ -0,0 +1,37 @@
UFile (package = ) [public class LabeledOuter {...]
UClass (name = LabeledOuter) [public class LabeledOuter {...}]
UMethod (name = foo) [public static fun foo() : int {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var second: int = 2] = Undetermined
ULocalVariable (name = second) [var second: int = 2]
ULiteralExpression (value = 2) [2] = 2
ULabeledExpression (label = labeled) [labeled@ for (var first: int = 1; first < 4; first++) {...}] = Undetermined
UForExpression [for (var first: int = 1; first < 4; first++) {...}] = Undetermined
UDeclarationsExpression [var first: int = 1] = Undetermined
ULocalVariable (name = first) [var first: int = 1]
ULiteralExpression (value = 1) [1] = 1
UBinaryExpression (operator = <) [first < 4] = true (depending on: (var first = 1))
USimpleNameReferenceExpression (identifier = first) [first] = (var first = 1)
ULiteralExpression (value = 4) [4] = 4
UPostfixExpression (operator = ++) [first++] = Undetermined
USimpleNameReferenceExpression (identifier = first) [first] = Undetermined
UBlockExpression [{...}] = Nothing(break)
UWhileExpression [while (second < 10) {...}] = Nothing(break)
UBinaryExpression (operator = <) [second < 10] = true (depending on: (var second = 2))
USimpleNameReferenceExpression (identifier = second) [second] = (var second = 2)
ULiteralExpression (value = 10) [10] = 10
UBlockExpression [{...}] = Nothing(break)
UBinaryExpression (operator = =) [second = 3] = 3
USimpleNameReferenceExpression (identifier = second) [second] = (var second = 2)
ULiteralExpression (value = 3) [3] = 3
UIfExpression [if (first > 0) break@labeled] = Nothing(break)
UBinaryExpression (operator = >) [first > 0] = true (depending on: (var first = 1))
USimpleNameReferenceExpression (identifier = first) [first] = (var first = 1)
ULiteralExpression (value = 0) [0] = 0
UBreakExpression (label = labeled) [break@labeled] = Nothing(break)
UastEmptyExpression [UastEmptyExpression] = Undetermined
UBinaryExpression (operator = =) [second = 4] = 4
USimpleNameReferenceExpression (identifier = second) [second] = Undetermined
ULiteralExpression (value = 4) [4] = 4
UReturnExpression [return second] = Nothing
USimpleNameReferenceExpression (identifier = second) [second] = (var second = 3)
+28
View File
@@ -0,0 +1,28 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class Lambda {
public static int foo() {
int variable = 42;
Runnable runnable = () -> {
int variable1 = 24;
variable1++;
};
runnable.run();
return variable;
}
}
@@ -0,0 +1,22 @@
UFile (package = ) [public class Lambda {...]
UClass (name = Lambda) [public class Lambda {...}]
UMethod (name = foo) [public static fun foo() : int {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var variable: int = 42] = Undetermined
ULocalVariable (name = variable) [var variable: int = 42]
ULiteralExpression (value = 42) [42] = 42
UDeclarationsExpression [var runnable: java.lang.Runnable = { {...}] = Undetermined
ULocalVariable (name = runnable) [var runnable: java.lang.Runnable = { {...}]
ULambdaExpression [{ {...}] = Undetermined
UBlockExpression [{...}] = (var variable1 = 24)
UDeclarationsExpression [var variable1: int = 24] = Undetermined
ULocalVariable (name = variable1) [var variable1: int = 24]
ULiteralExpression (value = 24) [24] = 24
UPostfixExpression (operator = ++) [variable1++] = (var variable1 = 24)
USimpleNameReferenceExpression (identifier = variable1) [variable1] = (var variable1 = 24)
UQualifiedReferenceExpression [runnable.run()] = external run()()
USimpleNameReferenceExpression (identifier = runnable) [runnable] = (var runnable = Undetermined)
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [run()] = external run()()
UIdentifier (Identifier (run)) [UIdentifier (Identifier (run))]
UReturnExpression [return variable] = Nothing
USimpleNameReferenceExpression (identifier = variable) [variable] = (var variable = 42)
@@ -0,0 +1,23 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class LocalClass {
public static int foo() {
class Local {};
return new Local().hashCode();
}
}
@@ -0,0 +1,13 @@
UFile (package = )
UClass (name = LocalClass)
UMethod (name = foo)
UBlockExpression
UDeclarationsExpression
UClass (name = Local)
UastEmptyExpression
UReturnExpression
UQualifiedReferenceExpression
UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0))
USimpleNameReferenceExpression (identifier = Local)
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0))
UIdentifier (Identifier (hashCode))
@@ -0,0 +1,8 @@
public class LocalClass {
public static fun foo() : int {
class Local {
}
UastEmptyExpression
return Local().hashCode()
}
}
+28
View File
@@ -0,0 +1,28 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class Logicals {
public static boolean foo() {
int one = 1;
int two = 2;
int three = 3;
int four = 4;
boolean b1 = two > one && four > three;
boolean b2 = one > two && four > three;
boolean b3 = b1 || b2;
boolean b4 = two > one || three > four;
return b1 && !b2 && b3 && b4;
}
}
@@ -0,0 +1,55 @@
UFile (package = ) [public class Logicals {...]
UClass (name = Logicals) [public class Logicals {...}]
UMethod (name = foo) [public static fun foo() : boolean {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var one: int = 1] = Undetermined
ULocalVariable (name = one) [var one: int = 1]
ULiteralExpression (value = 1) [1] = 1
UDeclarationsExpression [var two: int = 2] = Undetermined
ULocalVariable (name = two) [var two: int = 2]
ULiteralExpression (value = 2) [2] = 2
UDeclarationsExpression [var three: int = 3] = Undetermined
ULocalVariable (name = three) [var three: int = 3]
ULiteralExpression (value = 3) [3] = 3
UDeclarationsExpression [var four: int = 4] = Undetermined
ULocalVariable (name = four) [var four: int = 4]
ULiteralExpression (value = 4) [4] = 4
UDeclarationsExpression [var b1: boolean = two > one && four > three] = Undetermined
ULocalVariable (name = b1) [var b1: boolean = two > one && four > three]
UBinaryExpression (operator = &&) [two > one && four > three] = true (depending on: (var two = 2), (var one = 1), (var four = 4), (var three = 3))
UBinaryExpression (operator = >) [two > one] = true (depending on: (var two = 2), (var one = 1))
USimpleNameReferenceExpression (identifier = two) [two] = (var two = 2)
USimpleNameReferenceExpression (identifier = one) [one] = (var one = 1)
UBinaryExpression (operator = >) [four > three] = true (depending on: (var four = 4), (var three = 3))
USimpleNameReferenceExpression (identifier = four) [four] = (var four = 4)
USimpleNameReferenceExpression (identifier = three) [three] = (var three = 3)
UDeclarationsExpression [var b2: boolean = one > two && four > three] = Undetermined
ULocalVariable (name = b2) [var b2: boolean = one > two && four > three]
UBinaryExpression (operator = &&) [one > two && four > three] = false (depending on: (var one = 1), (var two = 2), (var four = 4), (var three = 3))
UBinaryExpression (operator = >) [one > two] = false (depending on: (var one = 1), (var two = 2))
USimpleNameReferenceExpression (identifier = one) [one] = (var one = 1)
USimpleNameReferenceExpression (identifier = two) [two] = (var two = 2)
UBinaryExpression (operator = >) [four > three] = true (depending on: (var four = 4), (var three = 3))
USimpleNameReferenceExpression (identifier = four) [four] = (var four = 4)
USimpleNameReferenceExpression (identifier = three) [three] = (var three = 3)
UDeclarationsExpression [var b3: boolean = b1 || b2] = Undetermined
ULocalVariable (name = b3) [var b3: boolean = b1 || b2]
UBinaryExpression (operator = ||) [b1 || b2] = true (depending on: (var b1 = true (depending on: (var two = 2), (var one = 1), (var four = 4), (var three = 3))), (var b2 = false (depending on: (var one = 1), (var two = 2), (var four = 4), (var three = 3))))
USimpleNameReferenceExpression (identifier = b1) [b1] = (var b1 = true (depending on: (var two = 2), (var one = 1), (var four = 4), (var three = 3)))
USimpleNameReferenceExpression (identifier = b2) [b2] = (var b2 = false (depending on: (var one = 1), (var two = 2), (var four = 4), (var three = 3)))
UDeclarationsExpression [var b4: boolean = two > one || three > four] = Undetermined
ULocalVariable (name = b4) [var b4: boolean = two > one || three > four]
UBinaryExpression (operator = ||) [two > one || three > four] = true (depending on: (var two = 2), (var one = 1), (var three = 3), (var four = 4))
UBinaryExpression (operator = >) [two > one] = true (depending on: (var two = 2), (var one = 1))
USimpleNameReferenceExpression (identifier = two) [two] = (var two = 2)
USimpleNameReferenceExpression (identifier = one) [one] = (var one = 1)
UBinaryExpression (operator = >) [three > four] = false (depending on: (var three = 3), (var four = 4))
USimpleNameReferenceExpression (identifier = three) [three] = (var three = 3)
USimpleNameReferenceExpression (identifier = four) [four] = (var four = 4)
UReturnExpression [return b1 && !b2 && b3 && b4] = Nothing
UPolyadicExpression (operator = &&) [b1 && !b2 && b3 && b4] = true (depending on: (var b1 = true (depending on: (var two = 2), (var one = 1), (var four = 4), (var three = 3))), (var b2 = false (depending on: (var one = 1), (var two = 2), (var four = 4), (var three = 3))), (var b3 = true (depending on: (var b1 = true (depending on: (var two = 2), (var one = 1), (var four = 4), (var three = 3))), (var b2 = false (depending on: (var one = 1), (var two = 2), (var four = 4), (var three = 3))))), (var b4 = true (depending on: (var two = 2), (var one = 1), (var three = 3), (var four = 4))))
USimpleNameReferenceExpression (identifier = b1) [b1] = (var b1 = true (depending on: (var two = 2), (var one = 1), (var four = 4), (var three = 3)))
UPrefixExpression (operator = !) [!b2] = true (depending on: (var b2 = false (depending on: (var one = 1), (var two = 2), (var four = 4), (var three = 3))))
USimpleNameReferenceExpression (identifier = b2) [b2] = (var b2 = false (depending on: (var one = 1), (var two = 2), (var four = 4), (var three = 3)))
USimpleNameReferenceExpression (identifier = b3) [b3] = (var b3 = true (depending on: (var b1 = true (depending on: (var two = 2), (var one = 1), (var four = 4), (var three = 3))), (var b2 = false (depending on: (var one = 1), (var two = 2), (var four = 4), (var three = 3)))))
USimpleNameReferenceExpression (identifier = b4) [b4] = (var b4 = true (depending on: (var two = 2), (var one = 1), (var three = 3), (var four = 4)))
@@ -0,0 +1,32 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class Anonymous {
public static void bar() {
int variable1 = 24;
variable1++;
}
public static int foo() {
int variable = 42;
Runnable runnable = User::bar;
runnable.run();
return variable;
}
}
@@ -0,0 +1,24 @@
UFile (package = ) [public class Anonymous {...]
UClass (name = Anonymous) [public class Anonymous {...}]
UMethod (name = bar) [public static fun bar() : void {...}]
UBlockExpression [{...}] = (var variable1 = 24)
UDeclarationsExpression [var variable1: int = 24] = Undetermined
ULocalVariable (name = variable1) [var variable1: int = 24]
ULiteralExpression (value = 24) [24] = 24
UPostfixExpression (operator = ++) [variable1++] = (var variable1 = 24)
USimpleNameReferenceExpression (identifier = variable1) [variable1] = (var variable1 = 24)
UMethod (name = foo) [public static fun foo() : int {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var variable: int = 42] = Undetermined
ULocalVariable (name = variable) [var variable: int = 42]
ULiteralExpression (value = 42) [42] = 42
UDeclarationsExpression [var runnable: java.lang.Runnable = User::bar] = Undetermined
ULocalVariable (name = runnable) [var runnable: java.lang.Runnable = User::bar]
UCallableReferenceExpression (name = bar) [User::bar] = external User::bar()
USimpleNameReferenceExpression (identifier = User) [User] = external User()
UQualifiedReferenceExpression [runnable.run()] = external run()()
USimpleNameReferenceExpression (identifier = runnable) [runnable] = (var runnable = external User::bar())
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [run()] = external run()()
UIdentifier (Identifier (run)) [UIdentifier (Identifier (run))]
UReturnExpression [return variable] = Nothing
USimpleNameReferenceExpression (identifier = variable) [variable] = (var variable = 42)
@@ -0,0 +1,27 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class Modification {
public static String foo() {
String s1 = "Hello ";
s1 += "world";
int m = 10;
int n = 5;
m += n -= 3;
m /= n *= 2;
s1 += " = ";
return s1 + m + " / " + n;
}
}
@@ -0,0 +1,35 @@
UFile (package = ) [public class Modification {...]
UClass (name = Modification) [public class Modification {...}]
UMethod (name = foo) [public static fun foo() : java.lang.String {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var s1: java.lang.String = "Hello "] = Undetermined
ULocalVariable (name = s1) [var s1: java.lang.String = "Hello "]
ULiteralExpression (value = "Hello ") ["Hello "] = "Hello "
UBinaryExpression (operator = +=) [s1 += "world"] = "Hello world" (depending on: (var s1 = "Hello "))
USimpleNameReferenceExpression (identifier = s1) [s1] = (var s1 = "Hello ")
ULiteralExpression (value = "world") ["world"] = "world"
UDeclarationsExpression [var m: int = 10] = Undetermined
ULocalVariable (name = m) [var m: int = 10]
ULiteralExpression (value = 10) [10] = 10
UDeclarationsExpression [var n: int = 5] = Undetermined
ULocalVariable (name = n) [var n: int = 5]
ULiteralExpression (value = 5) [5] = 5
UBinaryExpression (operator = +=) [m += n -= 3] = 12 (depending on: (var m = 10), (var n = 5))
USimpleNameReferenceExpression (identifier = m) [m] = (var m = 10)
UBinaryExpression (operator = -=) [n -= 3] = 2 (depending on: (var n = 5))
USimpleNameReferenceExpression (identifier = n) [n] = (var n = 5)
ULiteralExpression (value = 3) [3] = 3
UBinaryExpression (operator = /=) [m /= n *= 2] = 3 (depending on: (var m = 12 (depending on: (var n = 5))), (var n = 2))
USimpleNameReferenceExpression (identifier = m) [m] = (var m = 12 (depending on: (var n = 5)))
UBinaryExpression (operator = *=) [n *= 2] = 4 (depending on: (var n = 2))
USimpleNameReferenceExpression (identifier = n) [n] = (var n = 2)
ULiteralExpression (value = 2) [2] = 2
UBinaryExpression (operator = +=) [s1 += " = "] = "Hello world = " (depending on: (var s1 = "Hello world"))
USimpleNameReferenceExpression (identifier = s1) [s1] = (var s1 = "Hello world")
ULiteralExpression (value = " = ") [" = "] = " = "
UReturnExpression [return s1 + m + " / " + n] = Nothing
UPolyadicExpression (operator = +) [s1 + m + " / " + n] = "Hello world = 3 / 4" (depending on: (var s1 = "Hello world = "), (var m = 3 (depending on: (var n = 2))), (var n = 4))
USimpleNameReferenceExpression (identifier = s1) [s1] = (var s1 = "Hello world = ")
USimpleNameReferenceExpression (identifier = m) [m] = (var m = 3 (depending on: (var n = 2)))
ULiteralExpression (value = " / ") [" / "] = " / "
USimpleNameReferenceExpression (identifier = n) [n] = (var n = 4)
@@ -0,0 +1,28 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class MutableField {
static int mutable = 0;
public static int foo() {
mutable = 1;
bar();
return mutable;
}
public static void bar() {
mutable = 2;
}
}
@@ -0,0 +1,18 @@
UFile (package = ) [public class MutableField {...]
UClass (name = MutableField) [public class MutableField {...}]
UField (name = mutable) [static var mutable: int = 0]
ULiteralExpression (value = 0) [0] = 0
UMethod (name = foo) [public static fun foo() : int {...}]
UBlockExpression [{...}] = Nothing
UBinaryExpression (operator = =) [mutable = 1] = 1
USimpleNameReferenceExpression (identifier = mutable) [mutable] = external mutable()
ULiteralExpression (value = 1) [1] = 1
UCallExpression (kind = UastCallKind(name='method_call'), argCount = 0)) [bar()] = external bar()()
UIdentifier (Identifier (bar)) [UIdentifier (Identifier (bar))]
UReturnExpression [return mutable] = Nothing
USimpleNameReferenceExpression (identifier = mutable) [mutable] = external mutable()
UMethod (name = bar) [public static fun bar() : void {...}]
UBlockExpression [{...}] = 2
UBinaryExpression (operator = =) [mutable = 2] = 2
USimpleNameReferenceExpression (identifier = mutable) [mutable] = external mutable()
ULiteralExpression (value = 2) [2] = 2
@@ -0,0 +1,38 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class NotANumber {
public static boolean foo() {
double x = 0.0 / 0.0;
boolean b1 = x < x;
boolean b2 = x > x;
boolean b3 = x <= x;
boolean b4 = x >= x;
boolean b5 = x == x;
boolean b6 = x != x;
return b1 || b2 || b3 || b4 || b5 || !b6;
}
public static boolean bar() {
float x = 0.0f / 0.0f;
boolean b1 = x <= x;
boolean b2 = x >= x;
boolean b3 = x < x;
boolean b4 = x > x;
boolean b5 = x == x;
boolean b6 = x != x;
return b1 || b2 || b3 || b4 || b5 || !b6;
}
}
@@ -0,0 +1,94 @@
UFile (package = ) [public class NotANumber {...]
UClass (name = NotANumber) [public class NotANumber {...}]
UMethod (name = foo) [public static fun foo() : boolean {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var x: double = 0.0 / 0.0] = Undetermined
ULocalVariable (name = x) [var x: double = 0.0 / 0.0]
UBinaryExpression (operator = /) [0.0 / 0.0] = NaN
ULiteralExpression (value = 0.0) [0.0] = 0.0
ULiteralExpression (value = 0.0) [0.0] = 0.0
UDeclarationsExpression [var b1: boolean = x < x] = Undetermined
ULocalVariable (name = b1) [var b1: boolean = x < x]
UBinaryExpression (operator = <) [x < x] = false (depending on: (var x = NaN))
USimpleNameReferenceExpression (identifier = x) [x] = (var x = NaN)
USimpleNameReferenceExpression (identifier = x) [x] = (var x = NaN)
UDeclarationsExpression [var b2: boolean = x > x] = Undetermined
ULocalVariable (name = b2) [var b2: boolean = x > x]
UBinaryExpression (operator = >) [x > x] = false (depending on: (var x = NaN))
USimpleNameReferenceExpression (identifier = x) [x] = (var x = NaN)
USimpleNameReferenceExpression (identifier = x) [x] = (var x = NaN)
UDeclarationsExpression [var b3: boolean = x <= x] = Undetermined
ULocalVariable (name = b3) [var b3: boolean = x <= x]
UBinaryExpression (operator = <=) [x <= x] = false (depending on: (var x = NaN))
USimpleNameReferenceExpression (identifier = x) [x] = (var x = NaN)
USimpleNameReferenceExpression (identifier = x) [x] = (var x = NaN)
UDeclarationsExpression [var b4: boolean = x >= x] = Undetermined
ULocalVariable (name = b4) [var b4: boolean = x >= x]
UBinaryExpression (operator = >=) [x >= x] = false (depending on: (var x = NaN))
USimpleNameReferenceExpression (identifier = x) [x] = (var x = NaN)
USimpleNameReferenceExpression (identifier = x) [x] = (var x = NaN)
UDeclarationsExpression [var b5: boolean = x === x] = Undetermined
ULocalVariable (name = b5) [var b5: boolean = x === x]
UBinaryExpression (operator = ===) [x === x] = false (depending on: (var x = NaN))
USimpleNameReferenceExpression (identifier = x) [x] = (var x = NaN)
USimpleNameReferenceExpression (identifier = x) [x] = (var x = NaN)
UDeclarationsExpression [var b6: boolean = x !== x] = Undetermined
ULocalVariable (name = b6) [var b6: boolean = x !== x]
UBinaryExpression (operator = !==) [x !== x] = true (depending on: (var x = NaN))
USimpleNameReferenceExpression (identifier = x) [x] = (var x = NaN)
USimpleNameReferenceExpression (identifier = x) [x] = (var x = NaN)
UReturnExpression [return b1 || b2 || b3 || b4 || b5 || !b6] = Nothing
UPolyadicExpression (operator = ||) [b1 || b2 || b3 || b4 || b5 || !b6] = false (depending on: (var b1 = false (depending on: (var x = NaN))), (var b2 = false (depending on: (var x = NaN))), (var b3 = false (depending on: (var x = NaN))), (var b4 = false (depending on: (var x = NaN))), (var b5 = false (depending on: (var x = NaN))), (var b6 = true (depending on: (var x = NaN))))
USimpleNameReferenceExpression (identifier = b1) [b1] = (var b1 = false (depending on: (var x = NaN)))
USimpleNameReferenceExpression (identifier = b2) [b2] = (var b2 = false (depending on: (var x = NaN)))
USimpleNameReferenceExpression (identifier = b3) [b3] = (var b3 = false (depending on: (var x = NaN)))
USimpleNameReferenceExpression (identifier = b4) [b4] = (var b4 = false (depending on: (var x = NaN)))
USimpleNameReferenceExpression (identifier = b5) [b5] = (var b5 = false (depending on: (var x = NaN)))
UPrefixExpression (operator = !) [!b6] = false (depending on: (var b6 = true (depending on: (var x = NaN))))
USimpleNameReferenceExpression (identifier = b6) [b6] = (var b6 = true (depending on: (var x = NaN)))
UMethod (name = bar) [public static fun bar() : boolean {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var x: float = 0.0 / 0.0] = Undetermined
ULocalVariable (name = x) [var x: float = 0.0 / 0.0]
UBinaryExpression (operator = /) [0.0 / 0.0] = (float)NaN
ULiteralExpression (value = 0.0) [0.0] = (float)0.0
ULiteralExpression (value = 0.0) [0.0] = (float)0.0
UDeclarationsExpression [var b1: boolean = x <= x] = Undetermined
ULocalVariable (name = b1) [var b1: boolean = x <= x]
UBinaryExpression (operator = <=) [x <= x] = false (depending on: (var x = (float)NaN))
USimpleNameReferenceExpression (identifier = x) [x] = (var x = (float)NaN)
USimpleNameReferenceExpression (identifier = x) [x] = (var x = (float)NaN)
UDeclarationsExpression [var b2: boolean = x >= x] = Undetermined
ULocalVariable (name = b2) [var b2: boolean = x >= x]
UBinaryExpression (operator = >=) [x >= x] = false (depending on: (var x = (float)NaN))
USimpleNameReferenceExpression (identifier = x) [x] = (var x = (float)NaN)
USimpleNameReferenceExpression (identifier = x) [x] = (var x = (float)NaN)
UDeclarationsExpression [var b3: boolean = x < x] = Undetermined
ULocalVariable (name = b3) [var b3: boolean = x < x]
UBinaryExpression (operator = <) [x < x] = false (depending on: (var x = (float)NaN))
USimpleNameReferenceExpression (identifier = x) [x] = (var x = (float)NaN)
USimpleNameReferenceExpression (identifier = x) [x] = (var x = (float)NaN)
UDeclarationsExpression [var b4: boolean = x > x] = Undetermined
ULocalVariable (name = b4) [var b4: boolean = x > x]
UBinaryExpression (operator = >) [x > x] = false (depending on: (var x = (float)NaN))
USimpleNameReferenceExpression (identifier = x) [x] = (var x = (float)NaN)
USimpleNameReferenceExpression (identifier = x) [x] = (var x = (float)NaN)
UDeclarationsExpression [var b5: boolean = x === x] = Undetermined
ULocalVariable (name = b5) [var b5: boolean = x === x]
UBinaryExpression (operator = ===) [x === x] = false (depending on: (var x = (float)NaN))
USimpleNameReferenceExpression (identifier = x) [x] = (var x = (float)NaN)
USimpleNameReferenceExpression (identifier = x) [x] = (var x = (float)NaN)
UDeclarationsExpression [var b6: boolean = x !== x] = Undetermined
ULocalVariable (name = b6) [var b6: boolean = x !== x]
UBinaryExpression (operator = !==) [x !== x] = true (depending on: (var x = (float)NaN))
USimpleNameReferenceExpression (identifier = x) [x] = (var x = (float)NaN)
USimpleNameReferenceExpression (identifier = x) [x] = (var x = (float)NaN)
UReturnExpression [return b1 || b2 || b3 || b4 || b5 || !b6] = Nothing
UPolyadicExpression (operator = ||) [b1 || b2 || b3 || b4 || b5 || !b6] = false (depending on: (var b1 = false (depending on: (var x = (float)NaN))), (var b2 = false (depending on: (var x = (float)NaN))), (var b3 = false (depending on: (var x = (float)NaN))), (var b4 = false (depending on: (var x = (float)NaN))), (var b5 = false (depending on: (var x = (float)NaN))), (var b6 = true (depending on: (var x = (float)NaN))))
USimpleNameReferenceExpression (identifier = b1) [b1] = (var b1 = false (depending on: (var x = (float)NaN)))
USimpleNameReferenceExpression (identifier = b2) [b2] = (var b2 = false (depending on: (var x = (float)NaN)))
USimpleNameReferenceExpression (identifier = b3) [b3] = (var b3 = false (depending on: (var x = (float)NaN)))
USimpleNameReferenceExpression (identifier = b4) [b4] = (var b4 = false (depending on: (var x = (float)NaN)))
USimpleNameReferenceExpression (identifier = b5) [b5] = (var b5 = false (depending on: (var x = (float)NaN)))
UPrefixExpression (operator = !) [!b6] = false (depending on: (var b6 = true (depending on: (var x = (float)NaN))))
USimpleNameReferenceExpression (identifier = b6) [b6] = (var b6 = true (depending on: (var x = (float)NaN)))
@@ -0,0 +1,20 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class Foo {
public void bar(String x) {
String f = x + "1";
}
}
@@ -0,0 +1,10 @@
UFile (package = ) [public class Foo {...]
UClass (name = Foo) [public class Foo {...}]
UMethod (name = bar) [public fun bar(x: java.lang.String) : void {...}]
UParameter (name = x) [var x: java.lang.String]
UBlockExpression [{...}] = Undetermined
UDeclarationsExpression [var f: java.lang.String = x + "1"] = Undetermined
ULocalVariable (name = f) [var f: java.lang.String = x + "1"]
UBinaryExpression (operator = +) [x + "1"] = "01"
USimpleNameReferenceExpression (identifier = x) [x] = "0"
ULiteralExpression (value = "1") ["1"] = "1"
@@ -0,0 +1,26 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package A.B.C;
class Foo {
}
class Bar {
public Foo getFoo() {
return new A.B.C.Foo();
}
}
@@ -0,0 +1,14 @@
UFile (package = A.B.C)
UClass (name = Foo)
UClass (name = Bar)
UMethod (name = getFoo)
UBlockExpression
UReturnExpression
UCallExpression (kind = UastCallKind(name='constructor_call'), argCount = 0))
UQualifiedReferenceExpression
UQualifiedReferenceExpression
UQualifiedReferenceExpression
USimpleNameReferenceExpression (identifier = A)
USimpleNameReferenceExpression (identifier = B)
USimpleNameReferenceExpression (identifier = C)
USimpleNameReferenceExpression (identifier = Foo)
@@ -0,0 +1,10 @@
package A.B.C
class Foo {
}
class Bar {
public fun getFoo() : A.B.C.Foo {
return A.B.C.Foo()
}
}
@@ -0,0 +1,21 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class ReturnMinusX {
public static int foo() {
int x = 42;
return -x;
}
}
@@ -0,0 +1,10 @@
UFile (package = ) [public class ReturnMinusX {...]
UClass (name = ReturnMinusX) [public class ReturnMinusX {...}]
UMethod (name = foo) [public static fun foo() : int {...}]
UBlockExpression [{...}] = Nothing
UDeclarationsExpression [var x: int = 42] = Undetermined
ULocalVariable (name = x) [var x: int = 42]
ULiteralExpression (value = 42) [42] = 42
UReturnExpression [return -x] = Nothing
UPrefixExpression (operator = -) [-x] = -42 (depending on: (var x = 42))
USimpleNameReferenceExpression (identifier = x) [x] = (var x = 42)
@@ -0,0 +1,23 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class ReturnSum {
public static int foo() {
int x = 1 + 2;
int y = 3 + 4;
int z = x + y;
return z + z; // 20
}
}

Some files were not shown because too many files have changed in this diff Show More