private void annotate(SAXParseException exception) throws SAXException { Exceptions.attachMessage(exception, "Occurred at: " + exception.getSystemId() + ":" + exception.getLineNumber()); // NOI18N }
protected Class resolveClass(ObjectStreamClass v) throws IOException, ClassNotFoundException { ClassLoader cl = getNBClassLoader(); try { return Class.forName(v.getName(), false, cl); } catch (ClassNotFoundException cnfe) { String msg = "Offending classloader: " + cl; // NOI18N Exceptions.attachMessage(cnfe, msg); throw cnfe; } }
factory = SAXParserFactory.newInstance(); } catch (FactoryConfigurationError err) { Exceptions.attachMessage( err, "Info about thread context classloader: " + // NOI18N
/** Get a resource bundle the hard way. * @param baseName bundle basename * @param locale the locale to use (but still uses {@link #getBranding default branding}) * @param loader the class loader to use * @return the resource bundle * @exception MissingResourceException if the bundle does not exist */ public static ResourceBundle getBundle(String baseName, Locale locale, ClassLoader loader) throws MissingResourceException { if (USE_DEBUG_LOADER) { loader = DebugLoader.get(loader); } // Could more simply use ResourceBundle.getBundle (plus some special logic // with MergedBundle to handle branding) instead of manually finding bundles. // However this code is faster and has some other desirable properties. // Cf. #13847. ResourceBundle b = getBundleFast(baseName, locale, loader); if (b != null) { return b; } else { MissingResourceException e = new MissingResourceException("No such bundle " + baseName, baseName, null); // NOI18N if (Lookup.getDefault().lookup(ClassLoader.class) == null) { Exceptions.attachMessage(e, "Class loader not yet initialized in lookup"); // NOI18N } else { Exceptions.attachMessage(e, "Offending classloader: " + loader); // NOI18N } throw e; } }
bi = java.beans.Introspector.getBeanInfo(clazz); } catch (java.beans.IntrospectionException ie) { Exceptions.attachMessage(ie, "Encountered while introspecting " + } catch (Error e) { Exceptions.attachMessage(e, "Encountered while introspecting " +
Exceptions.attachMessage(e, "While loading: " + res); // NOI18N LOG.log(Level.WARNING, null, e);
Exceptions.attachMessage(ex, "Current component: " + c); // NOI18N Exceptions.attachMessage(ex, "List of components: " + components); // NOI18N Exceptions.attachMessage(ex, "List of actions: " + Arrays.asList(actions)); // NOI18N Exceptions.printStackTrace(ex);
if (!isStopException(io)) { if (fo.isValid() && fo.canRead()) { Exceptions.attachMessage(io, "While parsing: " + fo); // NOI18N Logger.getLogger(DefaultParser.class.getName()).log(Level.INFO, null, io); state = ERROR; Exceptions.attachMessage(sex, "While parsing: " + fo); // NOI18N Logger.getLogger(DefaultParser.class.getName()).log(Level.INFO, null, sex); state = ERROR; if(elements.length == 0 || !elements[0].getMethodName().equals("skipChar")) { //NOI18N Exceptions.attachMessage(npe, "While parsing: " + fo); // NOI18N Logger.getLogger(DefaultParser.class.getName()).log(Level.INFO, null, npe);
private final String annotateName(FileObject fo) { String bundleName = (String) fo.getAttribute("SystemFileSystem.localizingBundle"); // NOI18N if (bundleName != null) { try { bundleName = Utilities.translate(bundleName); ResourceBundle b = NbBundle.getBundle(bundleName); try { return b.getString(fo.getPath()); } catch (MissingResourceException ex) { // ignore--normal } } catch (MissingResourceException ex) { Exceptions.attachMessage(ex, warningMessage(bundleName, fo)); LOG.log(Level.INFO, null, ex); // ignore } } return (String) fo.getAttribute("displayName"); // NOI18N }
refreshChildrenInAtomicAction((AbstractFolder) getRoot(), rootElem); } catch (IOException iox) { Exceptions.attachMessage(iox, Arrays.toString(urls)); throw iox; } catch (Exception e) {
bi = java.beans.Introspector.getBeanInfo(clazz); } catch (java.beans.IntrospectionException ie) { Exceptions.attachMessage(ie, "Encountered while introspecting " + } catch (Error e) { Exceptions.attachMessage(e, "Encountered while introspecting " +
/** Fire PROP_ENABLE if the value is currently known (and clear that value). */ void maybeFireEnabledChange() { boolean fire = false; synchronized (getLock()) { if (getProperty(PROP_ENABLED) != null) { putProperty(PROP_ENABLED, null); fire = true; } } if (fire) { try { firePropertyChange(PROP_ENABLED, null, null); } catch (NullPointerException e) { // Probably because of a JDK bug that AbstractButton$ButtonActionPropertyChangeListener.propertyChange does not grok null values for "enabled" prop: Exceptions.attachMessage(e, "You cannot add " + getClass().getName() + " directly to a JMenu etc.; use org.openide.awt.Actions.connect instead"); // NOI18N Logger.getLogger(NodeAction.class.getName()).log(Level.WARNING, null, e); } } }
Exceptions.attachMessage(e, "Bad method: " + clazz.getName() + "." + nameGetter.getName());
Exceptions.attachMessage(ex, "Current component: " + c); // NOI18N Exceptions.attachMessage(ex, "List of components: " + components); // NOI18N Exceptions.attachMessage(ex, "List of actions: " + Arrays.asList(actions)); // NOI18N Exceptions.printStackTrace(ex);
Exceptions.attachMessage(e, "Trying to invoke " + method + " where introspected class is " +
Exceptions.attachMessage(npe, "Probably an ImageIcon with a null source image: " + icon + " - " + r.getText()); //NOI18N
static final void wrapThrowable(Throwable outer, Throwable inner, String message) { outer.initCause(inner); Exceptions.attachMessage(outer, message); }
protected Class resolveClass(ObjectStreamClass v) throws IOException, ClassNotFoundException { ClassLoader cl = getNBClassLoader(); try { return Class.forName(v.getName(), false, cl); } catch (ClassNotFoundException cnfe) { String msg = "Offending classloader: " + cl; // NOI18N Exceptions.attachMessage(cnfe, msg); throw cnfe; } }
protected Class resolveClass(ObjectStreamClass v) throws IOException, ClassNotFoundException { ClassLoader cl = getNBClassLoader(); try { return Class.forName(v.getName(), false, cl); } catch (ClassNotFoundException cnfe) { String msg = "Offending classloader: " + cl; // NOI18N Exceptions.attachMessage(cnfe, msg); throw cnfe; } }
/** * @param index Index to constant pool entries * @return method name * @throws IndexOutOfBoundsException when the constant pool size is smaller than index. */ public String getMethodName(int index) { try { EntryFieldMethodRef methodRef = (EntryFieldMethodRef) entries.get(index); return ((EntryUTF8) entries.get(((EntryNameType) entries.get(methodRef.nameAndTypeIndex)).getNameIndex())).getUTF8(); } catch (RuntimeException re) { throw Exceptions.attachMessage(re, description); } }