@SuppressWarnings("rawtypes") private static Class filePathToClass(String cpEntry, String path) { if (path.length() <= cpEntry.length()) { throw new IllegalArgumentException("Illegal path: cp=" + cpEntry + " path=" + path); } if (path.charAt(cpEntry.length()) != '/') { throw new IllegalArgumentException("Illegal path: cp=" + cpEntry + " path=" + path); } path = path.substring(cpEntry.length() + 1); path = path.replaceAll("/", ".").substring(0, path.length() - 6); try { return Class.forName(path, false, ClassLoader.getSystemClassLoader()); } catch (ClassNotFoundException e) { throw fail("Could not load class at path: " + path); } catch (NoClassDefFoundError ex) { warn("Class at path " + path + " is unloadable"); return null; } }
unit.defaultUnitScale = entry.getValue().second; } else { Redwood.Util.warn("Unknown default unit " + entry.getValue().first + " for " + entry.getKey());
ClassLoader.getSystemClassLoader())); } catch (ClassNotFoundException ex) { warn("Could not load class in jar: " + f + " at path: " + clazz); } catch (NoClassDefFoundError ex) { debug("Could not scan class: " + clazz + " (in jar: " + f + ')'); warn("Could not open jar file: " + f + "(are you sure the file exists?)");
ClassLoader.getSystemClassLoader())); } catch (ClassNotFoundException ex) { warn("Could not load class in jar: " + f + " at path: " + clazz); } catch (NoClassDefFoundError ex) { debug("Could not scan class: " + clazz + " (in jar: " + f + ')'); warn("Could not open jar file: " + f + "(are you sure the file exists?)");
try { respondError("Invalid language: '" + language + '\'', httpExchange); } catch (IOException e) { warn(e); } return new Properties();
ClassLoader.getSystemClassLoader())); } catch (ClassNotFoundException ex) { warn("Could not load class in jar: " + f + " at path: " + clazz); } catch (NoClassDefFoundError ex) { debug("Could not scan class: " + clazz + " (in jar: " + f + ')'); warn("Could not open jar file: " + f + "(are you sure the file exists?)");
unit.defaultUnitScale = entry.getValue().second; } else { Redwood.Util.warn("Unknown default unit " + entry.getValue().first + " for " + entry.getKey());
break; case SERIALIZED: warn("You probably cannot read the serialized output, so printing in text instead"); new TextOutputter().print(anno, System.out); break;
@SuppressWarnings("rawtypes") private static Class filePathToClass(String cpEntry, String path) { if (path.length() <= cpEntry.length()) { throw new IllegalArgumentException("Illegal path: cp=" + cpEntry + " path=" + path); } if (path.charAt(cpEntry.length()) != '/') { throw new IllegalArgumentException("Illegal path: cp=" + cpEntry + " path=" + path); } path = path.substring(cpEntry.length() + 1); path = path.replaceAll("/", ".").substring(0, path.length() - 6); try { return Class.forName(path, false, ClassLoader.getSystemClassLoader()); } catch (ClassNotFoundException e) { throw fail("Could not load class at path: " + path); } catch (NoClassDefFoundError ex) { warn("Class at path " + path + " is unloadable"); return null; } }
@SuppressWarnings("rawtypes") private static Class filePathToClass(String cpEntry, String path) { if (path.length() <= cpEntry.length()) { throw new IllegalArgumentException("Illegal path: cp=" + cpEntry + " path=" + path); } if (path.charAt(cpEntry.length()) != '/') { throw new IllegalArgumentException("Illegal path: cp=" + cpEntry + " path=" + path); } path = path.substring(cpEntry.length() + 1); path = path.replaceAll("/", ".").substring(0, path.length() - 6); try { return Class.forName(path, false, ClassLoader.getSystemClassLoader()); } catch (ClassNotFoundException e) { throw fail("Could not load class at path: " + path); } catch (NoClassDefFoundError ex) { warn("Class at path " + path + " is unloadable"); return null; } }
@SuppressWarnings("rawtypes") private static Class filePathToClass(String cpEntry, String path) { if (path.length() <= cpEntry.length()) { throw new IllegalArgumentException("Illegal path: cp=" + cpEntry + " path=" + path); } if (path.charAt(cpEntry.length()) != '/') { throw new IllegalArgumentException("Illegal path: cp=" + cpEntry + " path=" + path); } path = path.substring(cpEntry.length() + 1); path = path.replaceAll("/", ".").substring(0, path.length() - 6); try { return Class.forName(path, false, ClassLoader.getSystemClassLoader()); } catch (ClassNotFoundException e) { throw fail("Could not load class at path: " + path); } catch (NoClassDefFoundError ex) { warn("Class at path " + path + " is unloadable"); return null; } }
warn("found @Option annotations in class " + c + ", but didn't set any of them (all options were instance variables and no instance given?)");
warn("FileBackedCache", "could not delete block: " + block);
this.blacklistSubnets.add(parseSubnet(subnet)); } catch (IllegalArgumentException e) { warn("Could not parse subnet: " + subnet);
try { respondError("Invalid language: '" + language + '\'', httpExchange); } catch (IOException e) { warn(e); } return new Properties();
if (writer != null && !haveClosedWriter) { writer.second.apply(); } } catch (IOException e) { warn(e);
break; case SERIALIZED: warn("You probably cannot read the serialized output, so printing in text instead"); new TextOutputter().print(anno, System.out); break;
@Override public boolean hasNext() { // Still have elements in this block if (elements.hasNext()) return true; // Still have files to traverse elements = null; while (index < files.length && elements == null) { try { elements = readBlock(files[index]).iterator(); } catch (OutOfMemoryError e) { warn("FileBackedCache", "Caught out of memory error (clearing cache): " + e.getMessage()); FileBackedCache.this.clear(); //noinspection EmptyCatchBlock try { Thread.sleep(1000); } catch (InterruptedException e2) { throw new RuntimeInterruptedException(e2); } elements = readBlock(files[index]).iterator(); } catch (RuntimeException e) { err(e); } index += 1; } // No more elements return elements != null && hasNext(); } @Override