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.

View | Details | Raw Unified | Return to bug 65950
Collapse All | Expand All

(-)openide/loaders/src/org/openide/loaders/InstanceDataObject.java (-3 / +5 lines)
Lines 1482-1491 Link Here
1482
        FileObject memContext = sfs.findResource(prefix);
1482
        FileObject memContext = sfs.findResource(prefix);
1483
        if (memContext == null) throw new FileNotFoundException("SFS:xml/memory while converting a " + obj.getClass().getName()); //NOI18N
1483
        if (memContext == null) throw new FileNotFoundException("SFS:xml/memory while converting a " + obj.getClass().getName()); //NOI18N
1484
1484
1485
        String[] classes = new String[] {obj.getClass().getName(), Object.class.getName()};
1485
        Class clazz = obj.getClass();
1486
        for (int i = 0; i < classes.length; i++) {
1486
        while (clazz != null) {
1487
            String className = clazz.getName();
1487
            String convertorPath = new StringBuffer(200).append(prefix).append('/').
1488
            String convertorPath = new StringBuffer(200).append(prefix).append('/').
1488
                append(classes[i].replace('.', '/')).toString(); // NOI18N
1489
                append(className.replace('.', '/')).toString(); // NOI18N
1489
            FileObject fo = sfs.findResource(convertorPath);
1490
            FileObject fo = sfs.findResource(convertorPath);
1490
            if (fo != null) {
1491
            if (fo != null) {
1491
                String providerPath = (String) fo.getAttribute(EA_PROVIDER_PATH);
1492
                String providerPath = (String) fo.getAttribute(EA_PROVIDER_PATH);
Lines 1497-1502 Link Here
1497
                   return ret;
1498
                   return ret;
1498
               }
1499
               }
1499
            }
1500
            }
1501
            clazz = clazz.getSuperclass();
1500
        }
1502
        }
1501
        throw new FileNotFoundException("None convertor was found under SFS/xml/memory/ for " + obj.getClass()); //NOI18N
1503
        throw new FileNotFoundException("None convertor was found under SFS/xml/memory/ for " + obj.getClass()); //NOI18N
1502
    }
1504
    }
(-)core/settings/src/org/netbeans/modules/settings/Env.java (-9 / +12 lines)
Lines 101-119 Link Here
101
    /** look up appropriate provider according to clazz */
101
    /** look up appropriate provider according to clazz */
102
    public static FileObject findProvider(Class clazz) throws IOException {
102
    public static FileObject findProvider(Class clazz) throws IOException {
103
        String prefix = "xml/memory/"; //NOI18N
103
        String prefix = "xml/memory/"; //NOI18N
104
        String name = clazz.getName().replace('.', '/');
105
        FileSystem sfs = Repository.getDefault().getDefaultFileSystem();
104
        FileSystem sfs = Repository.getDefault().getDefaultFileSystem();
106
        FileObject memContext = sfs.findResource(prefix);
105
        FileObject memContext = sfs.findResource(prefix);
107
        if (memContext == null) throw new java.io.FileNotFoundException("SFS/xml/memory/"); //NOI18N
106
        if (memContext == null) throw new java.io.FileNotFoundException("SFS/xml/memory/"); //NOI18N
108
        
107
    
109
        String convertorPath = new StringBuffer(200).append(prefix).
108
        while (clazz != null) {
110
            append(name).toString(); // NOI18N
109
            String name = clazz.getName().replace('.', '/');
111
        FileObject fo = sfs.findResource(convertorPath);
110
            String convertorPath = new StringBuffer(200).append(prefix).
112
        if (fo != null) {
111
                append(name).toString(); // NOI18N
113
            String providerPath = (String) fo.getAttribute(EA_PROVIDER_PATH);
112
            FileObject fo = sfs.findResource(convertorPath);
114
            if (providerPath != null) {
113
            if (fo != null) {
115
                return sfs.findResource(providerPath);
114
                String providerPath = (String) fo.getAttribute(EA_PROVIDER_PATH);
115
                if (providerPath != null) {
116
                    return sfs.findResource(providerPath);
117
                }
116
            }
118
            }
119
            clazz = clazz.getSuperclass();
117
        }
120
        }
118
        return null;
121
        return null;
119
    }
122
    }

Return to bug 65950