Skip to content

Commit 527f2bf

Browse files
committed
Compatibility with java 6
(cherry picked from commit 0be9c40)
1 parent f2e9135 commit 527f2bf

File tree

6 files changed

+12
-10
lines changed

6 files changed

+12
-10
lines changed

src/com/goide/inspections/GoVarDeclarationInspection.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2015 Sergey Ignatov, Alexander Zolotov, Florin Patan
2+
* Copyright 2013-2016 Sergey Ignatov, Alexander Zolotov, Florin Patan
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -35,7 +35,8 @@ private static Pair<List<? extends GoCompositeElement>, List<GoExpression>> getP
3535
PsiElement assign = varDeclaration instanceof GoShortVarDeclaration ? ((GoShortVarDeclaration)varDeclaration).getVarAssign()
3636
: varDeclaration.getAssign();
3737
if (assign == null) {
38-
return Pair.create(ContainerUtil.emptyList(), ContainerUtil.emptyList());
38+
return Pair.create(ContainerUtil.emptyList(),
39+
ContainerUtil.emptyList());
3940
}
4041
if (varDeclaration instanceof GoRecvStatement || varDeclaration instanceof GoRangeClause) {
4142
List<GoCompositeElement> v = ContainerUtil.newArrayList();

src/com/goide/psi/GoFile.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ public Result<List<GoFunctionDeclaration>> compute() {
126126
List<GoFunctionDeclaration> functions = stub != null
127127
? getChildrenByType(stub, GoTypes.FUNCTION_DECLARATION,
128128
GoFunctionDeclarationStubElementType.ARRAY_FACTORY)
129-
: calc(
129+
: GoFile.this.calc(
130130
Conditions.instanceOf(GoFunctionDeclaration.class));
131131
return Result.create(functions, GoFile.this);
132132
}
@@ -141,7 +141,7 @@ public Result<List<GoMethodDeclaration>> compute() {
141141
StubElement<GoFile> stub = getStub();
142142
List<GoMethodDeclaration> calc = stub != null
143143
? getChildrenByType(stub, GoTypes.METHOD_DECLARATION, GoMethodDeclarationStubElementType.ARRAY_FACTORY)
144-
: calc(Conditions.instanceOf(GoMethodDeclaration.class));
144+
: GoFile.this.calc(Conditions.instanceOf(GoMethodDeclaration.class));
145145
return Result.create(calc, GoFile.this);
146146
}
147147
});

src/com/goide/psi/impl/GoPsiImplUtil.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,7 @@ private static GoExpression getLastExpressionAfter(@NotNull List<GoExpression> l
13611361
}
13621362

13631363
@NotNull
1364-
private static List<GoExpression> getExpressionsBefore(@NotNull List<GoExpression> list, @Nullable PsiElement anchor) {
1364+
private static List<GoExpression> getExpressionsBefore(@NotNull List<GoExpression> list, @Nullable final PsiElement anchor) {
13651365
if (anchor == null) {
13661366
return list;
13671367
}

src/com/goide/runconfig/GoRunningState.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
import com.intellij.execution.process.ProcessOutputTypes;
2727
import com.intellij.execution.runners.ExecutionEnvironment;
2828
import com.intellij.openapi.module.Module;
29+
import com.intellij.openapi.util.text.StringUtil;
2930
import org.jetbrains.annotations.NotNull;
3031

3132
import java.util.Map;
@@ -51,13 +52,13 @@ public GoRunningState(@NotNull ExecutionEnvironment env, @NotNull Module module,
5152
@Override
5253
protected ProcessHandler startProcess() throws ExecutionException {
5354
GoExecutor executor = patchExecutor(createCommonExecutor());
54-
GeneralCommandLine commandLine = executor.withParameterString(myConfiguration.getParams()).createCommandLine();
55+
final GeneralCommandLine commandLine = executor.withParameterString(myConfiguration.getParams()).createCommandLine();
5556
return new KillableColoredProcessHandler(commandLine) {
5657
@Override
5758
public void startNotify() {
5859
Map<String, String> environment = commandLine.getEnvironment();
59-
notifyTextAvailable("GOROOT=" + environment.getOrDefault(GoConstants.GO_ROOT, "") + '\n', ProcessOutputTypes.SYSTEM);
60-
notifyTextAvailable("GOPATH=" + environment.getOrDefault(GoConstants.GO_PATH, "") + '\n', ProcessOutputTypes.SYSTEM);
60+
notifyTextAvailable("GOROOT=" + StringUtil.nullize(environment.get(GoConstants.GO_ROOT)) + '\n', ProcessOutputTypes.SYSTEM);
61+
notifyTextAvailable("GOPATH=" + StringUtil.nullize(environment.get(GoConstants.GO_PATH)) + '\n', ProcessOutputTypes.SYSTEM);
6162
super.startNotify();
6263
}
6364
};

src/com/goide/runconfig/testing/GoTestLocator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ private GoTestLocator() {}
4848
@Override
4949
public List<Location> getLocation(@NotNull String protocolId,
5050
@NotNull String path,
51-
@NotNull Project project,
51+
@NotNull final Project project,
5252
@NotNull GlobalSearchScope scope) {
5353
if (PROTOCOL.equals(protocolId)) {
5454
IdFilter idFilter = GoIdFilter.getTestsFilter(project);

src/com/goide/runconfig/testing/GoTestRunningState.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public ExecutionResult execute(@NotNull Executor executor, @NotNull ProgramRunne
7373

7474
GoTestConsoleProperties consoleProperties = new GoTestConsoleProperties(myConfiguration, executor);
7575
String frameworkName = myConfiguration.getTestFramework().getName();
76-
ConsoleView consoleView = SMTestRunnerConnectionUtil.createAndAttachConsole(frameworkName, processHandler, consoleProperties);
76+
final ConsoleView consoleView = SMTestRunnerConnectionUtil.createAndAttachConsole(frameworkName, processHandler, consoleProperties);
7777
consoleView.addMessageFilter(new GoConsoleFilter(myConfiguration.getProject(), myModule, myConfiguration.getWorkingDirectoryUrl()));
7878
ProcessTerminatedListener.attach(processHandler);
7979

0 commit comments

Comments
 (0)