mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -27,7 +27,7 @@ target(compile: "Compile project") {
|
||||
}
|
||||
|
||||
loadProject()
|
||||
projectBuilder.useInProcessJavac = true
|
||||
projectBuilder.useInProcessJavac = false
|
||||
projectBuilder.targetFolder = out
|
||||
projectBuilder.cleanOutput()
|
||||
projectBuilder.buildAll()
|
||||
|
||||
+2
@@ -36,6 +36,7 @@ import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpres
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrReferenceExpression;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.params.GrParameter;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.GrTypeDefinition;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrEnumConstant;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.typedef.members.GrMethod;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.controlFlow.Instruction;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.controlFlow.ReadWriteVariableInstruction;
|
||||
@@ -277,6 +278,7 @@ public class GrFinalVariableAccessInspection extends BaseInspection {
|
||||
}
|
||||
|
||||
private static boolean isFieldInitialized(@NotNull GrField field) {
|
||||
if (field instanceof GrEnumConstant) return true;
|
||||
if (field.getInitializerGroovy() != null) return true;
|
||||
|
||||
final boolean isStatic = field.hasModifierProperty(PsiModifier.STATIC);
|
||||
|
||||
+1
-5
@@ -25,7 +25,6 @@ import com.intellij.util.containers.ContainerUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.GrStatement;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.blocks.GrCodeBlock;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.branch.GrReturnStatement;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.api.statements.expressions.GrExpression;
|
||||
import org.jetbrains.plugins.groovy.lang.psi.dataFlow.reachingDefs.VariableInfo;
|
||||
@@ -103,10 +102,7 @@ public class InitialInfo implements ExtractInfoHelper {
|
||||
}
|
||||
}
|
||||
else if (ExtractUtil.isSingleExpression(statements)) {
|
||||
final GrStatement single = statements[0];
|
||||
if (!(single.getParent() instanceof GrCodeBlock)) {
|
||||
outputType = ((GrExpression)single).getType();
|
||||
}
|
||||
outputType = ((GrExpression)statements[0]).getType();
|
||||
}
|
||||
else if (hasReturnValue) {
|
||||
assert returnStatements.size() > 0;
|
||||
|
||||
+10
@@ -496,6 +496,16 @@ class Aaa {
|
||||
this.bar = p // this one is not reported
|
||||
}
|
||||
}
|
||||
''')
|
||||
}
|
||||
|
||||
void testEnumConstants() {
|
||||
testHighlighting('''\
|
||||
enum E {
|
||||
abc, cde
|
||||
|
||||
final int <warning descr="Variable 'x' might not have been initialized">x</warning>
|
||||
}
|
||||
''')
|
||||
}
|
||||
}
|
||||
|
||||
+16
@@ -180,6 +180,22 @@ def foo() {
|
||||
private String testMethod() {
|
||||
return 'b'
|
||||
}
|
||||
''')
|
||||
}
|
||||
|
||||
void testSingleExpressionAsReturnValue() {
|
||||
doTest('''\
|
||||
int foo() {
|
||||
<begin>1<end>
|
||||
}
|
||||
''', '''\
|
||||
int foo() {
|
||||
testMethod()
|
||||
}
|
||||
|
||||
private int testMethod() {
|
||||
return 1
|
||||
}
|
||||
''')
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -10,8 +10,8 @@ def foo(b, c) {
|
||||
testMethod(b, c)
|
||||
}
|
||||
|
||||
private testMethod(b, c) {
|
||||
[].each(new Closure(this, this) {
|
||||
private ArrayList testMethod(b, c) {
|
||||
return [].each(new Closure(this, this) {
|
||||
void call() {
|
||||
b.plus(c)
|
||||
}
|
||||
|
||||
+2
-2
@@ -8,8 +8,8 @@ def foo(b, c) {
|
||||
testMethod(b, c)
|
||||
}
|
||||
|
||||
private testMethod(b, c) {
|
||||
[].each {
|
||||
private ArrayList testMethod(b, c) {
|
||||
return [].each {
|
||||
b.plus(c)
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,6 @@ def foo() {
|
||||
testMethod()
|
||||
}
|
||||
|
||||
private testMethod() {
|
||||
[].collect { it }
|
||||
private List testMethod() {
|
||||
return [].collect { it }
|
||||
}
|
||||
+1
-1
@@ -19,7 +19,7 @@ class StringCategory {
|
||||
testMethod()
|
||||
}
|
||||
|
||||
private testMethod() {
|
||||
private void testMethod() {
|
||||
use(StringCategory) {
|
||||
println "TeSt".lower()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user