@Test public void testGet() throws Exception { String prefix = LogManagerPropertiesTest.class.getName(); LogManager manager = LogManager.getLogManager(); try { String key = prefix.concat(".dummy"); Properties parent = new Properties(); parent.put(key, "value"); parent.put("", "empty"); read(manager, parent); parent = new Properties(); LogManagerProperties mp = new LogManagerProperties(parent, prefix); assertFalse(contains(mp, key, null)); assertEquals("value", mp.get(key)); assertTrue(contains(mp, key, "value")); parent.put(key, "newValue"); assertEquals("newValue", mp.get(key)); assertEquals("empty", mp.get("")); } finally { manager.reset(); } }
@Override public Object get(final Object key) { if (key instanceof String) { return this.getProperty((String) key); } else { return super.get(key); } }
LogManagerProperties extends Properties { @Override public Object get(final Object key) { if (key instanceof String) { return this.getProperty((String) key); } else { return super.get(key); } } }
LogManagerProperties extends Properties { @Override public Object get(final Object key) { if (key instanceof String) { return this.getProperty((String) key); } else { return super.get(key); } } LogManagerProperties(final Properties parent, final String prefix); }
LogManagerProperties extends Properties { @Override public Object get(final Object key) { if (key instanceof String) { return this.getProperty((String) key); } else { return super.get(key); } } 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 { @Override public Object get(final Object key) { if (key instanceof String) { return this.getProperty((String) key); } else { return super.get(key); } } 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();  }