mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge branch 'master' of git@git.labs.intellij.net:idea/community
This commit is contained in:
+3
@@ -45,6 +45,9 @@ public class ReplaceUnderscoresWithSpacesMacro implements Macro {
|
||||
return null;
|
||||
}
|
||||
Result param_result = params[0].calculateResult(context);
|
||||
if (param_result == null) {
|
||||
return null;
|
||||
}
|
||||
return execute(param_result);
|
||||
}
|
||||
|
||||
|
||||
+10
-2
@@ -325,9 +325,14 @@ public class ControlFlowBuilder extends GroovyRecursiveElementVisitor {
|
||||
public void visitUnaryExpression(GrUnaryExpression expression) {
|
||||
final GrExpression operand = expression.getOperand();
|
||||
if (operand != null) {
|
||||
myNegate = !myNegate;
|
||||
final boolean negation = expression.getOperationTokenType() == GroovyElementTypes.mLNOT;
|
||||
if (negation) {
|
||||
myNegate = !myNegate;
|
||||
}
|
||||
operand.accept(this);
|
||||
myNegate = !myNegate;
|
||||
if (negation) {
|
||||
myNegate = !myNegate;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -344,6 +349,9 @@ public class ControlFlowBuilder extends GroovyRecursiveElementVisitor {
|
||||
final ReadWriteVariableInstructionImpl i = new ReadWriteVariableInstructionImpl(referenceExpression, myInstructionNumber++, false);
|
||||
addNode(i);
|
||||
addNode(new ReadWriteVariableInstructionImpl(referenceExpression, myInstructionNumber++, true));
|
||||
if (referenceExpression.getParent() instanceof GrUnaryExpression) {
|
||||
addNode(new ReadWriteVariableInstructionImpl(referenceExpression, myInstructionNumber++, false));
|
||||
}
|
||||
checkPending(i);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -50,22 +50,34 @@ public class LibrariesUtil {
|
||||
final ArrayList<Library> libraries = new ArrayList<Library>();
|
||||
ApplicationManager.getApplication().runReadAction(new Runnable() {
|
||||
public void run() {
|
||||
ModuleRootManager manager = ModuleRootManager.getInstance(module);
|
||||
for (OrderEntry entry : manager.getOrderEntries()) {
|
||||
if (entry instanceof LibraryOrderEntry) {
|
||||
LibraryOrderEntry libEntry = (LibraryOrderEntry)entry;
|
||||
Library library = libEntry.getLibrary();
|
||||
if (condition.value(library)) {
|
||||
libraries.add(library);
|
||||
}
|
||||
}
|
||||
}
|
||||
populateOrderEntries(module, condition, libraries, false);
|
||||
}
|
||||
});
|
||||
|
||||
return libraries.toArray(new Library[libraries.size()]);
|
||||
}
|
||||
|
||||
private static void populateOrderEntries(Module module, Condition<Library> condition, ArrayList<Library> libraries, boolean exportedOnly) {
|
||||
for (OrderEntry entry : ModuleRootManager.getInstance(module).getOrderEntries()) {
|
||||
if (entry instanceof LibraryOrderEntry) {
|
||||
LibraryOrderEntry libEntry = (LibraryOrderEntry)entry;
|
||||
if (exportedOnly && !libEntry.isExported()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Library library = libEntry.getLibrary();
|
||||
if (condition.value(library)) {
|
||||
libraries.add(library);
|
||||
}
|
||||
} else if (entry instanceof ModuleOrderEntry) {
|
||||
final Module dep = ((ModuleOrderEntry)entry).getModule();
|
||||
if (module != null) {
|
||||
populateOrderEntries(dep, condition, libraries, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static Library[] getGlobalLibraries(Condition<Library> condition) {
|
||||
LibraryTable table = LibraryTablesRegistrar.getInstance().getLibraryTable();
|
||||
List<Library> libs = ContainerUtil.findAll(table.getLibraries(), condition);
|
||||
|
||||
@@ -208,6 +208,7 @@ public class GroovyHighlightingTest extends LightCodeInsightFixtureTestCase {
|
||||
public void testByteArrayArgument() throws Exception {doTest();}
|
||||
|
||||
public void testForLoopWithNestedEndlessLoop() throws Exception {doTest(new UnassignedVariableAccessInspection());}
|
||||
public void testPrefixIncrementCfa() throws Exception {doTest(new UnusedDefInspection());}
|
||||
public void testIfIncrementElseReturn() throws Exception {doTest(new UnusedDefInspection()); }
|
||||
|
||||
public void testArrayLikeAccess() throws Exception {doTest();}
|
||||
|
||||
+4
-3
@@ -3,7 +3,8 @@ for(int i = 0; i < 10; i++);
|
||||
0(1) element: null
|
||||
1(2) WRITE i
|
||||
2(3) element: For statement
|
||||
3(4,6) READ i
|
||||
3(4,7) READ i
|
||||
4(5) READ i
|
||||
5(2) WRITE i
|
||||
6() element: null
|
||||
5(6) WRITE i
|
||||
6(2) READ i
|
||||
7() element: null
|
||||
+4
-3
@@ -8,7 +8,8 @@ while (true) {
|
||||
1(2) WRITE i
|
||||
2(3) element: WHILE statement
|
||||
3(4,5) element: IF statement
|
||||
4(7) READ i
|
||||
4(8) READ i
|
||||
5(6) READ i
|
||||
6(2) WRITE i
|
||||
7() element: null
|
||||
6(7) WRITE i
|
||||
7(2) READ i
|
||||
8() element: null
|
||||
@@ -7,9 +7,10 @@ while (condition()) {
|
||||
0(1) element: null
|
||||
1(2) WRITE i
|
||||
2(3) element: WHILE statement
|
||||
3(4,8) READ condition
|
||||
3(4,9) READ condition
|
||||
4(5,6) element: IF statement
|
||||
5(8) READ i
|
||||
5(9) READ i
|
||||
6(7) READ i
|
||||
7(2) WRITE i
|
||||
8() element: null
|
||||
7(8) WRITE i
|
||||
8(2) READ i
|
||||
9() element: null
|
||||
@@ -0,0 +1,7 @@
|
||||
int idx
|
||||
<warning descr="Assignment is not used">idx</warning> = 2
|
||||
idx = 3
|
||||
if (++idx == 8) { //Assignment is used here
|
||||
idx = 33
|
||||
}
|
||||
print idx
|
||||
+1
-1
@@ -63,7 +63,7 @@ public class MavenEmbedderFactory {
|
||||
Arrays.asList("clean", "validate", "generate-sources", "process-sources", "generate-resources",
|
||||
"process-resources", "compile", "process-classes", "generate-test-sources", "process-test-sources",
|
||||
"generate-test-resources",
|
||||
"process-test-resources", "test-compile", "test", "package", "pre-integration-test", "integration-test",
|
||||
"process-test-resources", "test-compile", "test", "prepare-package", "package", "pre-integration-test", "integration-test",
|
||||
"post-integration-test",
|
||||
"verify", "install", "site", "deploy");
|
||||
private static final List<String> BASIC_PHASES =
|
||||
|
||||
+2
-2
@@ -107,7 +107,7 @@ public class MavenImportingSettings implements Cloneable {
|
||||
this.updateFoldersOnImportPhase = updateFoldersOnImportPhase;
|
||||
}
|
||||
|
||||
public boolean shouldDownloadSourcesAutomatically() {
|
||||
public boolean isDownloadSourcesAutomatically() {
|
||||
return downloadSourcesAutomatically;
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ public class MavenImportingSettings implements Cloneable {
|
||||
this.downloadSourcesAutomatically = Value;
|
||||
}
|
||||
|
||||
public boolean shouldDownloadDocsAutomatically() {
|
||||
public boolean isDownloadDocsAutomatically() {
|
||||
return downloadDocsAutomatically;
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -118,8 +118,8 @@ public class MavenImportingSettingsForm {
|
||||
|
||||
myUpdateFoldersOnImportPhaseComboBox.setSelectedItem(data.getUpdateFoldersOnImportPhase());
|
||||
|
||||
myDownloadSourcesCheckBox.setSelected(data.shouldDownloadSourcesAutomatically());
|
||||
myDownloadDocsCheckBox.setSelected(data.shouldDownloadDocsAutomatically());
|
||||
myDownloadSourcesCheckBox.setSelected(data.isDownloadSourcesAutomatically());
|
||||
myDownloadDocsCheckBox.setSelected(data.isDownloadDocsAutomatically());
|
||||
|
||||
updateControls();
|
||||
}
|
||||
|
||||
+2
-2
@@ -338,8 +338,8 @@ public class MavenProjectsManager extends SimpleProjectComponent
|
||||
}
|
||||
scheduleArtifactsDownloading(Collections.singleton(projectWithChanges.first),
|
||||
null,
|
||||
getImportingSettings().shouldDownloadSourcesAutomatically(),
|
||||
getImportingSettings().shouldDownloadDocsAutomatically(),
|
||||
getImportingSettings().isDownloadSourcesAutomatically(),
|
||||
getImportingSettings().isDownloadDocsAutomatically(),
|
||||
null);
|
||||
scheduleForNextImport(projectWithChanges);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user