Files
openide/java/java-tests/testData/codeInsight/daemonCodeAnalyzer/quickFix/implicitCastToLong/beforeCast.java
Bas Leijdekkers ed2c73e98c more consistent Java inspection names
GitOrigin-RevId: 5c958dfd8b5f55e9e5bede82be5015c3299dd16e
2021-12-20 10:55:14 +00:00

13 lines
435 B
Java

// "Fix all 'Integer multiplication or shift implicitly cast to 'long'' problems in file" "true"
class Test {
void test(int a, int b) {
long c = <caret>a * 2;
long d = 2 * a;
long d1 = -2 * a;
long e = a * b;
long f = a * b * 2; // should be converted to (long) a * b * 2 or 2L * a * b (but not a*b*2L: in this case a*b would still be integer)
long g = a << 2;
long h = 2 << a;
long i = (2) * a;
}
}