diff options
author | Christopher Vogt <oss.nsp@cvogt.org> | 2016-09-12 14:01:23 +0100 |
---|---|---|
committer | Christopher Vogt <oss.nsp@cvogt.org> | 2016-09-12 14:01:23 +0100 |
commit | 268d5ff5a42c0b94654393935f4aaff4673428fc (patch) | |
tree | a693d5743dd72a7904c3b00e4c1c527214585412 | |
parent | 55e5bad90af19376e3bacbedaea8702456f61d39 (diff) | |
download | cbt-268d5ff5a42c0b94654393935f4aaff4673428fc.tar.gz cbt-268d5ff5a42c0b94654393935f4aaff4673428fc.tar.bz2 cbt-268d5ff5a42c0b94654393935f4aaff4673428fc.zip |
allows any Throwable in Java code
-rw-r--r-- | nailgun_launcher/EarlyDependencies.java | 2 | ||||
-rw-r--r-- | nailgun_launcher/NailgunLauncher.java | 6 | ||||
-rw-r--r-- | nailgun_launcher/Stage0Lib.java | 16 |
3 files changed, 12 insertions, 12 deletions
diff --git a/nailgun_launcher/EarlyDependencies.java b/nailgun_launcher/EarlyDependencies.java index 74719c3..4ffbdfd 100644 --- a/nailgun_launcher/EarlyDependencies.java +++ b/nailgun_launcher/EarlyDependencies.java @@ -29,7 +29,7 @@ class EarlyDependencies{ public EarlyDependencies( String mavenCache, String mavenUrl, ClassLoaderCache2<ClassLoader> classLoaderCache, ClassLoader rootClassLoader - ) throws Exception { + ) throws Throwable { scalaReflect_2_11_8_File = mavenCache + "/org/scala-lang/scala-reflect/2.11.8/scala-reflect-2.11.8.jar"; scalaCompiler_2_11_8_File = mavenCache + "/org/scala-lang/scala-compiler/2.11.8/scala-compiler-2.11.8.jar"; scalaXml_1_0_5_File = mavenCache + "/org/scala-lang/modules/scala-xml_2.11/1.0.5/scala-xml_2.11-1.0.5.jar"; diff --git a/nailgun_launcher/NailgunLauncher.java b/nailgun_launcher/NailgunLauncher.java index 159041f..fbb9e9c 100644 --- a/nailgun_launcher/NailgunLauncher.java +++ b/nailgun_launcher/NailgunLauncher.java @@ -27,7 +27,7 @@ public class NailgunLauncher{ private static String STAGE1 = "stage1/"; @SuppressWarnings("unchecked") - public static Object getBuild( Object context ) throws Exception{ + public static Object getBuild( Object context ) throws Throwable{ BuildStage1Result res = buildStage1( (Boolean) get(context, "cbtHasChangedCompat"), (Long) get(context, "startCompat"), @@ -47,7 +47,7 @@ public class NailgunLauncher{ .invoke(null, context, res.changed); } - public static void main( String[] args ) throws Exception { + public static void main( String[] args ) throws Throwable { Long _start = System.currentTimeMillis(); if(args[0].equals("check-alive")){ System.exit(33); @@ -99,7 +99,7 @@ public class NailgunLauncher{ public static BuildStage1Result buildStage1( Boolean changed, long start, String cache, String cbtHome, String compatibilityTarget, ClassLoaderCache2<ClassLoader> classLoaderCache - ) throws Exception { + ) throws Throwable { _assert(TARGET != null, "environment variable TARGET not defined"); String nailgunTarget = cbtHome + "/" + NAILGUN + TARGET; String stage1Sources = cbtHome + "/" + STAGE1; diff --git a/nailgun_launcher/Stage0Lib.java b/nailgun_launcher/Stage0Lib.java index 5f8c5c7..ebf9d09 100644 --- a/nailgun_launcher/Stage0Lib.java +++ b/nailgun_launcher/Stage0Lib.java @@ -19,7 +19,7 @@ public class Stage0Lib{ } } - public static int runMain(String cls, String[] args, ClassLoader cl, SecurityManager defaultSecurityManager) throws Exception{ + public static int runMain(String cls, String[] args, ClassLoader cl, SecurityManager defaultSecurityManager) throws Throwable{ try{ System.setSecurityManager( new TrapSecurityManager() ); cl.loadClass(cls) @@ -37,7 +37,7 @@ public class Stage0Lib{ } } - public static Object get(Object object, String method) throws Exception{ + public static Object get(Object object, String method) throws Throwable{ return object.getClass().getMethod( method ).invoke(object); } @@ -46,7 +46,7 @@ public class Stage0Lib{ return join( pathSeparator, files ); } - public static File write(File file, String content, OpenOption... options) throws Exception{ + public static File write(File file, String content, OpenOption... options) throws Throwable{ file.getParentFile().mkdirs(); Files.write(file.toPath(), content.getBytes(), options); return file; @@ -55,7 +55,7 @@ public class Stage0Lib{ public static Boolean compile( Boolean changed, Long start, String classpath, String target, EarlyDependencies earlyDeps, List<File> sourceFiles, SecurityManager defaultSecurityManager - ) throws Exception{ + ) throws Throwable{ File statusFile = new File( new File(target) + ".last-success" ); Long lastSuccessfullCompile = statusFile.lastModified(); for( File file: sourceFiles ){ @@ -103,12 +103,12 @@ public class Stage0Lib{ return changed; } - public static ClassLoader classLoader( String file ) throws Exception{ + public static ClassLoader classLoader( String file ) throws Throwable{ return new CbtURLClassLoader( new URL[]{ new URL("file:"+file) } ); } - public static ClassLoader classLoader( String file, ClassLoader parent ) throws Exception{ + public static ClassLoader classLoader( String file, ClassLoader parent ) throws Throwable{ return new CbtURLClassLoader( new URL[]{ new URL("file:"+file) }, parent ); @@ -155,7 +155,7 @@ public class Stage0Lib{ return (HttpURLConnection) urlString.openConnection(proxy); } - public static void download(URL urlString, Path target, String sha1) throws Exception { + public static void download(URL urlString, Path target, String sha1) throws Throwable { final Path unverified = Paths.get(target+".unverified"); if(!Files.exists(target)) { new File(target.toString()).getParentFile().mkdirs(); @@ -174,7 +174,7 @@ public class Stage0Lib{ } } - public static String sha1(byte[] bytes) throws Exception { + public static String sha1(byte[] bytes) throws Throwable { final MessageDigest sha1 = MessageDigest.getInstance("SHA1"); sha1.update(bytes, 0, bytes.length); return (new HexBinaryAdapter()).marshal(sha1.digest()); |