This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.net.URL;
if (SharedClassObject.class.isAssignableFrom(cls)) {
return SharedClassObject.findObject(cls.asSubclass(SharedClassObject.class), true);
} else {
return cls.newInstance();
Constructor<?> init = cls.getDeclaredConstructor();
init.setAccessible(true);
return init.newInstance((Object[]) null);
}
case 12: // serialvalue
return SharedClassObject.findObject(cls, true);
case 13:
String[] arr = value.split("#", 2); // NOI18N
return map.get("displayName");
public static class Value {
private Value() { }
public void testNewValueForNonPublicConstructor() throws Exception {
File f = writeFile("layer3.xml",
"<filesystem>\n" +
"<folder name='TestModule'>\n" +
"<file name='sample.txt' >" +
" <attr name='v' newvalue='org.openide.filesystems.XMLFileSystemTestHid$Value'/>" +
"</file>\n" +
"</folder>\n" +
"</filesystem>\n"
);
xfs = FileSystemFactoryHid.createXMLSystem(getName(), this, f.toURL());
FileObject fo = xfs.findResource ("TestModule/sample.txt");
assertNotNull(fo);
Object v = fo.getAttribute("v");
assertNotNull("Attribute found", v);
assertEquals("Right type", Value.class, v.getClass());
public void testVariousXMLAttributes() throws Exception {
URL attribs = XMLFileSystemTestHid.class.getResource("test-layer-attribs.xml");
xfs = FileSystemFactoryHid.createXMLSystem(getName(), this, attribs);
return SharedClassObject.findObject (c.asSubclass(SharedClassObject.class), true);
// create new instance
return c.newInstance();
Constructor<?> init = c.getDeclaredConstructor();
} catch (IOException ex) {
public static class TestDefinitions implements Runnable {
public TestDefinitions() {}
TestDefinitions() {}
static TestDefinitions create() {
return new TestDefinitions();