Skip to content

Commit 3b1eea0

Browse files
committed
Bug fixes
1 parent 176d658 commit 3b1eea0

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

swan_assist/src/de/fraunhofer/iem/swan/assist/actions/LaunchSwanAction.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import de.fraunhofer.iem.swan.assist.util.Constants;
1616

1717
import java.io.File;
18-
import java.io.FileInputStream;
1918
import java.io.IOException;
2019
import java.io.InputStream;
2120
import java.util.ArrayList;
@@ -42,7 +41,7 @@ public void actionPerformed(AnActionEvent anActionEvent) {
4241
InputStream input = null;
4342

4443
try {
45-
input = new FileInputStream(getClass().getClassLoader().getResource("").getPath()+"config.properties");
44+
input = getClass().getClassLoader().getResourceAsStream("config.properties");
4645
config.load(input);
4746
} catch (IOException e) {
4847
e.printStackTrace();

swan_assist/src/de/fraunhofer/iem/swan/assist/data/JSONFileLoader.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,6 @@ public static ArrayList<MethodWrapper> getMethods(ArrayList<Pair<String, String>
101101
if (method.getUpdateOperation().equals(Constants.METHOD_DELETED) || method.isTrainingMethod())
102102
continue;
103103

104-
System.out.println(method.getSignature(true));
105104
filteredList.add(method);
106105
}
107106
return filteredList;

swan_assist/src/de/fraunhofer/iem/swan/assist/util/PsiTraversal.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import org.apache.commons.lang3.StringUtils;
1414
import java.util.ArrayList;
1515
import java.util.List;
16+
import java.util.Objects;
1617

1718
/**
1819
* Methods to find PSI methods using the PSI object or event.
@@ -97,7 +98,15 @@ public static String getMethodSignature(PsiMethod psiMethod) {
9798

9899
PsiClass psiClass = PsiTreeUtil.getParentOfType(psiMethod, PsiClass.class);
99100

100-
return psiMethod.getReturnType().getCanonicalText() + " " +
101+
String returnType ="";
102+
if(psiMethod.getReturnType()!=null){
103+
if(psiMethod.getReturnType() instanceof PsiPrimitiveType)
104+
returnType = ((PsiPrimitiveType) psiMethod.getReturnType()).getName();
105+
else
106+
returnType = psiMethod.getReturnType().getCanonicalText();
107+
}
108+
109+
return returnType+ " " +
101110
psiClass.getQualifiedName() + "." + psiMethod.getName() + " (" +
102111
StringUtils.join(getParameters(psiMethod), ", ") + ")";
103112
}

0 commit comments

Comments
 (0)