Skip to content

Commit

Permalink
Fixes #3720
Browse files Browse the repository at this point in the history
  • Loading branch information
Manindra29 committed Sep 8, 2015
1 parent abe7b52 commit d587c14
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
15 changes: 3 additions & 12 deletions java/src/processing/mode/java/pdex/ASTGenerator.java
Expand Up @@ -1297,24 +1297,15 @@ protected Class<?> findClassIfExists(String className){

for (ImportStatement impS : imports) {
String temp = impS.getPackageName();

if (temp.endsWith("*")) {
temp = temp.substring(0, temp.length() - 1) + className;
} else {
int x = temp.lastIndexOf('.');
//log("fclife " + temp.substring(x + 1));
if (!temp.substring(x + 1).equals(className)) {
continue;
}
if (impS.isStarredImport() && className.indexOf('.') == -1) {
temp = impS.getPackageName() + "." + className;
}
tehClass = loadClass(temp);
if (tehClass != null) {
log(tehClass.getName() + " located.");
return tehClass;
}

//log("Doesn't exist in package: " + impS.getImportName());

//log("Doesn't exist in imp package: " + impS.getImportName());
}

PdePreprocessor p = new PdePreprocessor(null);
Expand Down
19 changes: 13 additions & 6 deletions java/src/processing/mode/java/pdex/ImportStatement.java
Expand Up @@ -69,11 +69,18 @@ public String getPackageName(){
return ret;
}

public int getTab() {
return tab;
}
public int getTab() {
return tab;
}

public int getLineNumber() {
return lineNumber;
}
public int getLineNumber() {
return lineNumber;
}

public boolean isStarredImport() {
String ret = new String(importName.trim());
if(ret.endsWith(";"))
ret = ret.substring(0, ret.length() - 1).trim();
return ret.endsWith(".*");
}
}
1 change: 1 addition & 0 deletions java/src/processing/mode/java/pdex/JavaTextArea.java
Expand Up @@ -181,6 +181,7 @@ public void processKeyEvent(KeyEvent evt) {
if (suggestion.isVisible()) {
prepareSuggestions(evt);
}
return;
}
}

Expand Down

0 comments on commit d587c14

Please sign in to comment.