Permission Analysis Report
Analysis of: org.eclipse.core.runtime
Detail
Class: org.eclipse.core.internal.registry.RegistryObjectManager (Application)
DoPrivileged location: Line# 65 void <init>( )
Permission: java.util.PropertyPermission "eclipse.noRegistryFlushing", "read"
Primordial/java.lang.String java.lang.System.getProperty( java.lang.String )
CODE
public RegistryObjectManager() {
extensionPoints = new HashtableOfStringAndInt();
if ("true".equalsIgnoreCase(System.getProperty(InternalPlatform.PROP_NO_REGISTRY_FLUSHING))) { //$NON-NLS-1$
cache = new ReferenceMap(ReferenceMap.HARD, CACHE_INITIAL_SIZE, DEFAULT_LOADFACTOR);
} else {
cache = new ReferenceMap(ReferenceMap.SOFT, CACHE_INITIAL_SIZE, DEFAULT_LOADFACTOR);
}
newContributions = new KeyedHashSet();
fileOffsets = new HashtableOfInt();
}
Tainted variable reference trace:
Permission Requirements:
- permission java.util.PropertyPermission "eclipse.noRegistryFlushing", "read";
Conclusion:
Wrap the line as shown in the following:
public RegistryObjectManager() {
extensionPoints = new HashtableOfStringAndInt();
// get the noRegistryFlushing value
String noRegistryFlushing;
if(System.getSecurityManager() == null) {
noRegistryFlushing = System.getProperty(InternalPlatform.PROP_NO_REGISTRY_FLUSHING);
} else {
noRegistryFlushing = (String) AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
return System.getProperty(InternalPlatform.PROP_NO_REGISTRY_FLUSHING);
}
});
}
if ("true".equalsIgnoreCase(noRegistryFlushing)) { //$NON-NLS-1$
cache = new ReferenceMap(ReferenceMap.HARD, CACHE_INITIAL_SIZE, DEFAULT_LOADFACTOR);
} else {
cache = new ReferenceMap(ReferenceMap.SOFT, CACHE_INITIAL_SIZE, DEFAULT_LOADFACTOR);
}
newContributions = new KeyedHashSet();
fileOffsets = new HashtableOfInt();
}
DoPrivileged location: Line# 88 boolean init( long )
Permission: java.util.PropertyPermission "eclipse.noLazyRegistryCacheLoading", "read"
Primordial/java.lang.String java.lang.System.getProperty( java.lang.String )
CODE
/**
* Initialize the object manager. Return true if the initialization succeeded, false otherwise
*/
synchronized boolean init(long timeStamp) {
TableReader reader = new TableReader();
Object[] results = reader.loadTables(timeStamp);
if (results == null) {
return false;
}
fileOffsets = (HashtableOfInt) results[0];
extensionPoints = (HashtableOfStringAndInt) results[1];
nextId = ((Integer) results[2]).intValue();
fromCache = true;
if ("true".equalsIgnoreCase(System.getProperty(InternalPlatform.PROP_NO_LAZY_CACHE_LOADING))) { //$NON-NLS-1$
//TODO Here we could grow all the tables to the right size (ReferenceMap)
reader.setHoldObjects(true);
markOrphansHasDirty(getOrphans());
fromCache = reader.readAllCache(this);
formerContributions = getFormerContributions();
}
return fromCache;
}
Tainted variable reference trace:
Permission Requirements:
- permission java.util.PropertyPermission "eclipse.noLazyRegistryCacheLoading", "read";
Conclusion:
Wrap the line as shown in the following:
synchronized boolean init(long timeStamp) {
TableReader reader = new TableReader();
Object[] results = reader.loadTables(timeStamp);
if (results == null) {
return false;
}
fileOffsets = (HashtableOfInt) results[0];
extensionPoints = (HashtableOfStringAndInt) results[1];
nextId = ((Integer) results[2]).intValue();
fromCache = true;
// get the noLazyRegistryCacheLoading value
String noLazyRegistryCacheLoading;
if(System.getSecurityManager() == null) {
noLazyRegistryCacheLoading = System.getProperty(InternalPlatform.PROP_NO_LAZY_CACHE_LOADING);
} else {
noLazyRegistryCacheLoading = (String) AccessController.doPrivileged(new PrivilegedAction() {
public Object run() {
return System.getProperty(InternalPlatform.PROP_NO_LAZY_CACHE_LOADING);
}
});
}
if ("true".equalsIgnoreCase(noLazyRegistryCacheLoading)) { //$NON-NLS-1$
//TODO Here we could grow all the tables to the right size (ReferenceMap)
reader.setHoldObjects(true);
markOrphansHasDirty(getOrphans());
fromCache = reader.readAllCache(this);
formerContributions = getFormerContributions();
}
return fromCache;
}