Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use bulk mode in class name completion (fixes #40) #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/main/java/org/fife/rsta/ac/java/JarReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,20 @@ public void getClassesInPackage(List<ClassFile> addTo, String[] pkgs,
public List<ClassFile> getClassesWithNamesStartingWith(String prefix) {
List<ClassFile> res = new ArrayList<ClassFile>();
String currentPkg = ""; // Don't use null; we're appending to it
packageMap.getClassesWithNamesStartingWith(info, prefix, currentPkg,
res);

try {
info.bulkClassFileCreationStart();

try {
packageMap.getClassesWithNamesStartingWith(info, prefix, currentPkg, res);
} finally {
info.bulkClassFileCreationEnd();
}

} catch (final IOException ioe) {
ioe.printStackTrace();
}

return res;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/fife/rsta/ac/java/PackageMapNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ void getClassesWithNamesStartingWith(LibraryInfo info, String prefix,
if (cf==null) {
String fqClassName = currentPkg + className + ".class";
try {
cf = info.createClassFile(fqClassName);
cf = info.createClassFileBulk(fqClassName);
cfEntry.setValue(cf); // Update the map
} catch (IOException ioe) {
ioe.printStackTrace();
Expand Down