Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map.Entry;

import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IProgressMonitor;
Expand Down Expand Up @@ -66,7 +65,7 @@ public abstract class AbstractBundleContainer extends PlatformObject implements
*/
private String[] fVMArgs;

static private HashMap<AbstractBundleContainer, String[]> hash = new HashMap<>();
private static final HashMap<AbstractBundleContainer, String[]> fVMArgsCache = new HashMap<>();

/**
* Resolves any string substitution variables in the given text returning
Expand Down Expand Up @@ -223,11 +222,11 @@ protected void clearResolutionStatus() {

@Override
public String[] getVMArguments() {
for (Entry<AbstractBundleContainer, String[]> entry : hash.entrySet()) {
if (entry.getKey().equals(this)) {
return entry.getValue();
}
String[] cachedArgs = fVMArgsCache.get(this);
if (cachedArgs != null) {
return cachedArgs;
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This extra blank line is IMO not necessary after a closing brace.

Suggested change

String FWK_ADMIN_EQ = "org.eclipse.equinox.frameworkadmin.equinox"; //$NON-NLS-1$
if (fVMArgs == null) {
try {
Expand Down Expand Up @@ -261,10 +260,10 @@ public String[] getVMArguments() {

}
if (fVMArgs == null || fVMArgs.length == 0) {
hash.put(this, null);
fVMArgsCache.put(this, null);
return null;
}
hash.put(this, fVMArgs);
fVMArgsCache.put(this, fVMArgs);
return fVMArgs;
}

Expand Down
Loading