mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 13:02:30 +07:00
Cleanup (i18n; text corrected)
This commit is contained in:
@@ -341,9 +341,8 @@ public class HighlightControlFlowUtil {
|
||||
PsiMethod redirectedConstructor = redirectedConstructors.get(j);
|
||||
// variable must be initialized before its usage
|
||||
if (offset < redirectedConstructor.getTextRange().getStartOffset()) continue;
|
||||
PsiCodeBlock redirBody = redirectedConstructor.getBody();
|
||||
if (redirBody != null
|
||||
&& variableDefinitelyAssignedIn(variable, redirBody)) {
|
||||
PsiCodeBlock redirectedBody = redirectedConstructor.getBody();
|
||||
if (redirectedBody != null && variableDefinitelyAssignedIn(variable, redirectedBody)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -682,10 +681,8 @@ public class HighlightControlFlowUtil {
|
||||
return null;
|
||||
}
|
||||
if (!isEffectivelyFinal(variable, lambdaExpression, context)) {
|
||||
final HighlightInfo highlightInfo = HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR)
|
||||
.range(context)
|
||||
.descriptionAndTooltip("Variable used in lambda expression should be effectively final")
|
||||
.create();
|
||||
String text = JavaErrorMessages.message("lambda.variable.must.be.final");
|
||||
HighlightInfo highlightInfo = HighlightInfo.newHighlightInfo(HighlightInfoType.ERROR).range(context).descriptionAndTooltip(text).create();
|
||||
QuickFixAction.registerQuickFixAction(highlightInfo, QUICK_FIX_FACTORY.createVariableAccessFromInnerClassFix(variable, lambdaExpression));
|
||||
return highlightInfo;
|
||||
}
|
||||
|
||||
@@ -143,6 +143,7 @@ variable.assigned.in.loop=Variable ''{0}'' might be assigned in loop
|
||||
assignment.to.final.variable=Cannot assign a value to final variable ''{0}''
|
||||
variable.must.be.final=Variable ''{0}'' is accessed from within inner class, needs to be declared final
|
||||
variable.must.be.final.or.effectively.final=Variable ''{0}'' is accessed from within inner class, needs to be final or effectively final
|
||||
lambda.variable.must.be.final=Variable used in lambda expression should be final or effectively final
|
||||
initializer.must.be.able.to.complete.normally=Initializer must be able to complete normally
|
||||
weaker.privileges={0}; attempting to assign weaker access privileges (''{1}''); was ''{2}''
|
||||
incompatible.return.type=attempting to use incompatible return type
|
||||
|
||||
@@ -12,7 +12,7 @@ public class XXX {
|
||||
int j = 0;
|
||||
j = 2;
|
||||
final int L = 0;
|
||||
I i = (int h) -> { int k = 0; return h + <error descr="Variable used in lambda expression should be effectively final">j</error> + l + L; };
|
||||
I i = (int h) -> { int k = 0; return h + <error descr="Variable used in lambda expression should be final or effectively final">j</error> + l + L; };
|
||||
}
|
||||
|
||||
void bar() {
|
||||
@@ -20,7 +20,7 @@ public class XXX {
|
||||
int j = 0;
|
||||
j = 2;
|
||||
final int L = 0;
|
||||
I i = (int h) -> { int k = 0; return h + k + <error descr="Variable used in lambda expression should be effectively final">j</error> + l + L; };
|
||||
I i = (int h) -> { int k = 0; return h + k + <error descr="Variable used in lambda expression should be final or effectively final">j</error> + l + L; };
|
||||
}
|
||||
|
||||
void foo(J i) { }
|
||||
@@ -53,21 +53,21 @@ public class XXX {
|
||||
int y;
|
||||
if (cond) y = 1;
|
||||
y = 2;
|
||||
foo(() -> x+<error descr="Variable used in lambda expression should be effectively final">y</error>);
|
||||
foo(() -> x+<error descr="Variable used in lambda expression should be final or effectively final">y</error>);
|
||||
}
|
||||
|
||||
void m6(int x) {
|
||||
foo(() -> <error descr="Variable used in lambda expression should be effectively final">x</error>+1);
|
||||
foo(() -> <error descr="Variable used in lambda expression should be final or effectively final">x</error>+1);
|
||||
x++;
|
||||
}
|
||||
|
||||
void m7(int x) {
|
||||
foo(() -> <error descr="Variable used in lambda expression should be effectively final">x</error>=1);
|
||||
foo(() -> <error descr="Variable used in lambda expression should be final or effectively final">x</error>=1);
|
||||
}
|
||||
|
||||
void m8() {
|
||||
int y;
|
||||
foo(() -> <error descr="Variable used in lambda expression should be effectively final">y</error>=1);
|
||||
foo(() -> <error descr="Variable used in lambda expression should be final or effectively final">y</error>=1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ class XXX {
|
||||
int k = 0;
|
||||
int n = 2;
|
||||
Runnable r = ()->{
|
||||
<error descr="Variable used in lambda expression should be effectively final">k</error> = n;
|
||||
<error descr="Variable used in lambda expression should be final or effectively final">k</error> = n;
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user