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 21028
Collapse All | Expand All

(-)openide/src/org/openide/loaders/InstanceSupport.java (-1 / +12 lines)
Lines 195-201 Link Here
195
            if (isSerialized ()) {
195
            if (isSerialized ()) {
196
                // create from ser file
196
                // create from ser file
197
                BufferedInputStream bis = new BufferedInputStream(instanceOrigin().getInputStream(), 1024);
197
                BufferedInputStream bis = new BufferedInputStream(instanceOrigin().getInputStream(), 1024);
198
                org.openide.util.io.NbObjectInputStream nbis = new org.openide.util.io.NbObjectInputStream(bis);
198
                org.openide.util.io.NbObjectInputStream nbis = new org.openide.util.io.NbObjectInputStream(bis) {
199
                    protected Class resolveClass(ObjectStreamClass v) throws IOException, ClassNotFoundException {
200
                      ClassLoader cl = org.openide.TopManager.getDefault().currentClassLoader();
201
                      try {
202
                        return Class.forName(v.getName(), false, cl);
203
                      } catch (ClassNotFoundException cnfe) {
204
                      String msg = "Offending classloader: " + cl; // NOI18N
205
                      ErrorManager.getDefault ().annotate(cnfe, ErrorManager.INFORMATIONAL, msg, null, null, null);
206
                      throw cnfe;
207
                    }
208
                  }
209
                };
199
                Object o = nbis.readObject();
210
                Object o = nbis.readObject();
200
                nbis.close();
211
                nbis.close();
201
                return o;
212
                return o;

Return to bug 21028