return false;
}
private InputStream retrieveJavaSource(String classname) {
ZipInputStream zipIn = null;
try {
Version wgaVersion = (Version) WGADesignConfigurationModel.VERSIONCOMPLIANCE_TO_WGA_VERSION.get(_versionCompliance.getKey());
if (wgaVersion != null) {
InputStream sourceIn;
try {
sourceIn = Plugin.getDefault().getResourceAsStream("resources/wga/source_" + wgaVersion.getMajorVersion() + "_" + wgaVersion.getMinorVersion() + ".jar");
}
catch (Exception e) {
Plugin.getDefault().logError("Unable to find source for wga version compliance '" + wgaVersion.getMajorVersion() + "." + wgaVersion.getMinorVersion() + "'.");
return null;
}
zipIn = new ZipInputStream(sourceIn);
ZipEntry entry = zipIn.getNextEntry();
while (entry != null) {
String sourceName = entry.getName();
sourceName = sourceName.replaceAll("/", ".");
if (sourceName.endsWith(".java")) {
sourceName = sourceName.substring(0, sourceName.length() - ".java".length());
}
if (sourceName.equals(classname)) {
return zipIn;
}
entry = zipIn.getNextEntry();
}
}
}
catch (IOException e) {
}
// source not found
try {
zipIn.close();
}
catch (IOException e) {
}
return null;