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

(-)file_not_specified_in_diff (-6 / +20 lines)
Line  Link Here
0
-- Base (BASE)
0
++ Locally Modified (Based On LOCAL)
Lines 72-79 Link Here
72
import org.openide.filesystems.FileObject;
72
import org.openide.filesystems.FileObject;
73
import org.openide.filesystems.FileSystem;
73
import org.openide.filesystems.FileSystem;
74
import org.openide.filesystems.FileUtil;
74
import org.openide.filesystems.FileUtil;
75
import org.openide.loaders.DataLoader;
76
import org.openide.loaders.DataLoaderPool;
75
import org.openide.loaders.DataObject;
77
import org.openide.loaders.DataObject;
76
import org.openide.loaders.DataObjectNotFoundException;
78
import org.openide.loaders.DataObjectExistsException;
77
import org.openide.util.Exceptions;
79
import org.openide.util.Exceptions;
78
import org.openide.util.Parameters;
80
import org.openide.util.Parameters;
79
81
Lines 708-719 Link Here
708
     */
710
     */
709
    public static PUDataObject getPUDataObject(FileObject fo) throws InvalidPersistenceXmlException {
711
    public static PUDataObject getPUDataObject(FileObject fo) throws InvalidPersistenceXmlException {
710
        Parameters.notNull("fo", fo); //NOI18N
712
        Parameters.notNull("fo", fo); //NOI18N
713
        DataLoader.RecognizedFiles recog = new DataLoader.RecognizedFiles () {
714
                                               /** Adds the file object to the marked hashtable.
715
                                               * @param fo file object (can be <CODE>null</CODE>)
716
                                               */
717
                                               @Override
718
                                               public void markRecognized (FileObject fo) {
719
                                               }
720
                                           };
711
721
712
        DataObject dataObject = null;
722
        DataObject dataObject;
713
        try {
723
        try {
714
            dataObject = DataObject.find(fo);
724
            DataLoaderPool pool = DataLoaderPool.getDefault();
715
        } catch (DataObjectNotFoundException ex) {
725
            dataObject = pool.findDataObject(fo,recog);
716
            Exceptions.printStackTrace(ex);
726
        } catch (DataObjectExistsException ex) {
727
                // use existing data object
728
                dataObject = ex.getDataObject ();
729
        } catch (IOException ex) {
730
            dataObject = null;
717
        }
731
        }
718
        if (!(dataObject instanceof PUDataObject)) {
732
        if (!(dataObject instanceof PUDataObject)) {
719
            throw new InvalidPersistenceXmlException(FileUtil.getFileDisplayName(fo));
733
            throw new InvalidPersistenceXmlException(FileUtil.getFileDisplayName(fo));

Return to bug 223688