@Test public void testEscapingComparator() throws Exception { try { Class<?> k = ErrorComparator.class; Comparator<? super LogRecord> c; c = LogManagerProperties.newComparator(k.getName()); assertEquals(k, c.getClass()); setPending(new ThreadDeath()); try { c = LogManagerProperties.newComparator(k.getName()); fail(String.valueOf(c)); } catch (ThreadDeath expect) { } setPending(new OutOfMemoryError()); try { c = LogManagerProperties.newComparator(k.getName()); fail(String.valueOf(c)); } catch (OutOfMemoryError expect) { } } finally { setPending(null); } }
@SuppressWarnings("unchecked") static Comparator<? super LogRecord> newComparator(String name) throws Exception { return newObjectFrom(name, Comparator.class); }
LogManagerProperties extends Properties { @SuppressWarnings("unchecked") static Comparator<? super LogRecord> newComparator(String name) throws Exception { return newObjectFrom(name, Comparator.class); } }
LogManagerProperties extends Properties { @SuppressWarnings("unchecked") static Comparator<? super LogRecord> newComparator(String name) throws Exception { return newObjectFrom(name, Comparator.class); } LogManagerProperties(final Properties parent, final String prefix); }
LogManagerProperties extends Properties { @SuppressWarnings("unchecked") static Comparator<? super LogRecord> newComparator(String name) throws Exception { return newObjectFrom(name, Comparator.class); } LogManagerProperties(final Properties parent, final String prefix); @Override @SuppressWarnings("CloneDoesntCallSuperClone") synchronized Object clone(); @Override synchronized String getProperty(final String key); @Override String getProperty(final String key, final String def); @Override Object get(final Object key); @Override synchronized Object put(final Object key, final Object value); @Override Object setProperty(String key, String value); @Override boolean containsKey(final Object key); @Override synchronized Object remove(final Object key); @Override Enumeration<?> propertyNames(); @Override boolean equals(final Object o); @Override int hashCode(); }
LogManagerProperties extends Properties { @SuppressWarnings("unchecked") static Comparator<? super LogRecord> newComparator(String name) throws Exception { return newObjectFrom(name, Comparator.class); } LogManagerProperties(final Properties parent, final String prefix); @Override @SuppressWarnings("CloneDoesntCallSuperClone") synchronized Object clone(); @Override synchronized String getProperty(final String key); @Override String getProperty(final String key, final String def); @Override Object get(final Object key); @Override synchronized Object put(final Object key, final Object value); @Override Object setProperty(String key, String value); @Override boolean containsKey(final Object key); @Override synchronized Object remove(final Object key); @Override Enumeration<?> propertyNames(); @Override boolean equals(final Object o); @Override int hashCode();  }