Eliminate cast compiler warnings

This commit is contained in:
Ruben Dijkstra 2015-08-24 22:43:58 +02:00
parent b381c411f8
commit a14078f76d
2 changed files with 2 additions and 2 deletions

View File

@ -58,7 +58,7 @@ public class SimpleCompiler implements JavaCompiler {
// manifest only jars in the classpath correctly
URL url = cl.findResource("META-INF/MANIFEST.MF");
Manifest manifest = new Manifest(url.openStream());
String classpath = (String) manifest.getMainAttributes().getValue("Class-Path");
String classpath = manifest.getMainAttributes().getValue("Class-Path");
for (String entry : classpath.split(" ")) {
URL entryUrl = new URL(entry);
String decodedPath = URLDecoder.decode(entryUrl.getPath(), "UTF-8");

View File

@ -40,7 +40,7 @@ public class SimpleCompilerTest {
// create classpath
StringBuilder path = new StringBuilder();
for (URL url : ((URLClassLoader) classLoader).getURLs()) {
for (URL url : classLoader.getURLs()) {
if (path.length() > 0) {
path.append(File.pathSeparator);
}