182
183 static int lzint( long l) { return Long.numberOfLeadingZeros(l); }
184 static int lzcomp(long l) { return Long.numberOfLeadingZeros(l); }
185
186 static int tzint( int i) { return Integer.numberOfTrailingZeros(i); }
187 static int tzcomp(int i) { return Integer.numberOfTrailingZeros(i); }
188
189 static int tzint( long l) { return Long.numberOfTrailingZeros(l); }
190 static int tzcomp(long l) { return Long.numberOfTrailingZeros(l); }
191
192 static void testclass(String classname, int x) throws Exception {
193 System.setProperty("value", "" + x);
194 loadandrunclass(classname);
195 }
196
197 static void testclass(String classname, long x) throws Exception {
198 System.setProperty("value", "" + x);
199 loadandrunclass(classname);
200 }
201
202 @SuppressWarnings("deprecation")
203 static void loadandrunclass(String classname) throws Exception {
204 Class<?> cl = Class.forName(classname);
205 URLClassLoader apploader = (URLClassLoader) cl.getClassLoader();
206 ClassLoader loader = new URLClassLoader(apploader.getURLs(), apploader.getParent());
207 Class<?> c = loader.loadClass(classname);
208 Runnable r = (Runnable) c.newInstance();
209 r.run();
210 }
211
212 public static class lzconI implements Runnable {
213 static final int VALUE;
214
215 static {
216 int value = 0;
217 try {
218 value = Integer.decode(System.getProperty("value"));
219 } catch (Throwable e) {}
220 VALUE = value;
221 }
222
|
182
183 static int lzint( long l) { return Long.numberOfLeadingZeros(l); }
184 static int lzcomp(long l) { return Long.numberOfLeadingZeros(l); }
185
186 static int tzint( int i) { return Integer.numberOfTrailingZeros(i); }
187 static int tzcomp(int i) { return Integer.numberOfTrailingZeros(i); }
188
189 static int tzint( long l) { return Long.numberOfTrailingZeros(l); }
190 static int tzcomp(long l) { return Long.numberOfTrailingZeros(l); }
191
192 static void testclass(String classname, int x) throws Exception {
193 System.setProperty("value", "" + x);
194 loadandrunclass(classname);
195 }
196
197 static void testclass(String classname, long x) throws Exception {
198 System.setProperty("value", "" + x);
199 loadandrunclass(classname);
200 }
201
202 @SuppressWarnings({"deprecation","unused"})
203 static void loadandrunclass(String classname) throws Exception {
204 Class<?> cl = Class.forName(classname);
205 URLClassLoader apploader = (URLClassLoader) cl.getClassLoader();
206 ClassLoader loader = new URLClassLoader(apploader.getURLs(), apploader.getParent());
207 Class<?> c = loader.loadClass(classname);
208 Runnable r = (Runnable) c.newInstance();
209 r.run();
210 }
211
212 public static class lzconI implements Runnable {
213 static final int VALUE;
214
215 static {
216 int value = 0;
217 try {
218 value = Integer.decode(System.getProperty("value"));
219 } catch (Throwable e) {}
220 VALUE = value;
221 }
222
|