Permalink
Browse files

clean deprecation warnings

  • Loading branch information...
1 parent 675f4b4 commit 2122005bc8601ab4f91a63ee716263ba3eba9c8b @JPMoresmau committed Feb 10, 2012
Showing with 117 additions and 109 deletions.
  1. +1 −1 net.sf.eclipsefp.haskell.core/src/net/sf/eclipsefp/haskell/core/HaskellCorePlugin.java
  2. +96 −94 net.sf.eclipsefp.haskell.core/src/net/sf/eclipsefp/haskell/core/internal/project/Parser.java
  3. +2 −1 net.sf.eclipsefp.haskell.core/src/net/sf/eclipsefp/haskell/core/partitioned/alex/DeltaVisitor.java
  4. +2 −1 ...f.eclipsefp.haskell.core/src/net/sf/eclipsefp/haskell/core/partitioned/alex/FullBuildVisitor.java
  5. +2 −1 net.sf.eclipsefp.haskell.core/src/net/sf/eclipsefp/haskell/core/partitioned/happy/DeltaVisitor.java
  6. +2 −1 ....eclipsefp.haskell.core/src/net/sf/eclipsefp/haskell/core/partitioned/happy/FullBuildVisitor.java
  7. +2 −1 net.sf.eclipsefp.haskell.core/src/net/sf/eclipsefp/haskell/core/partitioned/uuagc/DeltaVisitor.java
  8. +2 −1 ....eclipsefp.haskell.core/src/net/sf/eclipsefp/haskell/core/partitioned/uuagc/FullBuildVisitor.java
  9. +1 −1 ...lipsefp.haskell.core/src/net/sf/eclipsefp/haskell/core/preferences/CorePreferenceInitializer.java
  10. +1 −1 ...ui/src/net/sf/eclipsefp/haskell/ui/internal/editors/haskell/codeassist/HSCodeTemplateManager.java
  11. +1 −1 net.sf.eclipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/internal/preferences/DebugPP.java
  12. +2 −2 ...clipsefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/internal/preferences/NewHaskellProjectPP.java
  13. +1 −1 ...sefp.haskell.ui/src/net/sf/eclipsefp/haskell/ui/internal/preferences/editor/AbstractEditorPP.java
  14. +2 −2 ...ui/src/net/sf/eclipsefp/haskell/ui/internal/views/projectexplorer/HaskellResourceExtensionCP.java
@@ -161,6 +161,6 @@ private void collectCompilerInfo() {
/** Get an instance-scoped preference store for the plug-in */
public static final IEclipsePreferences instanceScopedPreferences() {
- return new InstanceScope().getNode( getPluginId() );
+ return InstanceScope.INSTANCE.getNode( getPluginId() );
}
}
@@ -1,95 +1,97 @@
-// Copyright (c) 2003-2008 by Leif Frenzel - see http://leiffrenzel.de
-package net.sf.eclipsefp.haskell.core.internal.project;
-
-import java.io.InputStreamReader;
-import java.io.Reader;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import net.sf.eclipsefp.haskell.core.HaskellCorePlugin;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.Path;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.InputSource;
-
-/**
- * <p>
- * A mini parser to get the project descriptor information from the .hsproject
- * file into an IHaskellProject.
- * </p>
- *
- * @author Leif Frenzel
- */
-public class Parser implements IXMLNames {
-
- public static void readIn(final IFile projectDescriptor,
- final HaskellProject project)
- {
- try {
- Reader reader = new InputStreamReader(projectDescriptor
- .getContents());
- Element rootElement = null;
- try {
- DocumentBuilder parser = DocumentBuilderFactory.newInstance()
- .newDocumentBuilder();
- InputSource inputSource = new InputSource(reader);
- rootElement = parser.parse(inputSource).getDocumentElement();
- } catch( Exception ex ) {
- String msg = "Problem when parsing .hsproject file.\n"; //$NON-NLS-1$
- HaskellCorePlugin.log( msg, ex );
- } finally {
- reader.close();
- }
- applyPaths(project, rootElement);
- setupCompiler(project, rootElement);
- } catch( Exception ex ) {
- String msg = "Problem when reading .hsproject file.\n"; //$NON-NLS-1$
- HaskellCorePlugin.log( msg, ex );
- }
- }
-
- // helping methods
- // ////////////////
-
- private static void setupCompiler(final HaskellProject project,
- final Element rootElement)
- {
- final NodeList list = rootElement.getElementsByTagName(COMPILER_ELEMENT);
- if (list.getLength() > 0) {
- if ("null".equals(list.item(0).getTextContent())) { //$NON-NLS-1$
- project.setCompiler(null);
- }
- }
- }
-
- private static String getValue(final Element rootElement,
- final String tagName,
- final String attributeName)
- {
- String result = ""; //$NON-NLS-1$
- NodeList list = rootElement.getElementsByTagName(tagName);
- if (list.getLength() > 0) {
- // we use only the first entry for each path type
- NamedNodeMap attributes = list.item(0).getAttributes();
- Node pathNode = attributes.getNamedItem(attributeName);
- result = pathNode.getNodeValue();
- }
- return result;
- }
-
- private static void applyPaths(final HaskellProject project,
- final Element rootElement)
- {
- if (rootElement != null
- && rootElement.getNodeName().equalsIgnoreCase(DOCUMENT_ELEMENT)) {
- project.addSourcePath(getValue(rootElement, SOURCE_PATH_ELEMENT,
- PATH_ATT));
- project.setOutputPath(getValue(rootElement, OUTPUT_PATH_ELEMENT,
- PATH_ATT));
- project.addTargetName( new Path( getValue(rootElement, TARGET_NAME_ELEMENT,
- NAME_ATT)));
- }
- }
+// Copyright (c) 2003-2008 by Leif Frenzel - see http://leiffrenzel.de
+package net.sf.eclipsefp.haskell.core.internal.project;
+
+import java.io.InputStreamReader;
+import java.io.Reader;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import net.sf.eclipsefp.haskell.core.HaskellCorePlugin;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.Path;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+
+/**
+ * <p>
+ * A mini parser to get the project descriptor information from the .hsproject
+ * file into an IHaskellProject.
+ * </p>
+ *
+ * @author Leif Frenzel
+ *
+ */
+@Deprecated
+public class Parser implements IXMLNames {
+
+ public static void readIn(final IFile projectDescriptor,
+ final HaskellProject project)
+ {
+ try {
+ Reader reader = new InputStreamReader(projectDescriptor
+ .getContents());
+ Element rootElement = null;
+ try {
+ DocumentBuilder parser = DocumentBuilderFactory.newInstance()
+ .newDocumentBuilder();
+ InputSource inputSource = new InputSource(reader);
+ rootElement = parser.parse(inputSource).getDocumentElement();
+ } catch( Exception ex ) {
+ String msg = "Problem when parsing .hsproject file.\n"; //$NON-NLS-1$
+ HaskellCorePlugin.log( msg, ex );
+ } finally {
+ reader.close();
+ }
+ applyPaths(project, rootElement);
+ setupCompiler(project, rootElement);
+ } catch( Exception ex ) {
+ String msg = "Problem when reading .hsproject file.\n"; //$NON-NLS-1$
+ HaskellCorePlugin.log( msg, ex );
+ }
+ }
+
+ // helping methods
+ // ////////////////
+
+ private static void setupCompiler(final HaskellProject project,
+ final Element rootElement)
+ {
+ final NodeList list = rootElement.getElementsByTagName(COMPILER_ELEMENT);
+ if (list.getLength() > 0) {
+ if ("null".equals(list.item(0).getTextContent())) { //$NON-NLS-1$
+ project.setCompiler(null);
+ }
+ }
+ }
+
+ private static String getValue(final Element rootElement,
+ final String tagName,
+ final String attributeName)
+ {
+ String result = ""; //$NON-NLS-1$
+ NodeList list = rootElement.getElementsByTagName(tagName);
+ if (list.getLength() > 0) {
+ // we use only the first entry for each path type
+ NamedNodeMap attributes = list.item(0).getAttributes();
+ Node pathNode = attributes.getNamedItem(attributeName);
+ result = pathNode.getNodeValue();
+ }
+ return result;
+ }
+
+ private static void applyPaths(final HaskellProject project,
+ final Element rootElement)
+ {
+ if (rootElement != null
+ && rootElement.getNodeName().equalsIgnoreCase(DOCUMENT_ELEMENT)) {
+ project.addSourcePath(getValue(rootElement, SOURCE_PATH_ELEMENT,
+ PATH_ATT));
+ project.setOutputPath(getValue(rootElement, OUTPUT_PATH_ELEMENT,
+ PATH_ATT));
+ project.addTargetName( new Path( getValue(rootElement, TARGET_NAME_ELEMENT,
+ NAME_ATT)));
+ }
+ }
}
@@ -9,6 +9,7 @@
import org.eclipse.core.resources.IResourceDeltaVisitor;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
/**
* Performs an incremental build of the resources.
@@ -33,7 +34,7 @@ public boolean visit( final IResourceDelta delta ) throws CoreException {
// Set derived file as derived
resource.getProject().refreshLocal( IResource.DEPTH_INFINITE, null );
IPath derivedPath = resource.getProjectRelativePath().removeFileExtension().addFileExtension( FileUtil.EXTENSION_HS );
- resource.getProject().getFile( derivedPath ).setDerived( true );
+ resource.getProject().getFile( derivedPath ).setDerived( true,new NullProgressMonitor() );
}
}
return true;
@@ -7,6 +7,7 @@
import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
/**
* Builds all resources in the project.
@@ -24,7 +25,7 @@ public boolean visit( final IResource resource ) throws CoreException {
// Set derived file as derived
resource.getProject().refreshLocal( IResource.DEPTH_INFINITE, null );
IPath derivedPath = resource.getProjectRelativePath().removeFileExtension().addFileExtension( FileUtil.EXTENSION_HS );
- resource.getProject().getFile( derivedPath ).setDerived( true );
+ resource.getProject().getFile( derivedPath ).setDerived( true,new NullProgressMonitor() );
}
return true;
}
@@ -9,6 +9,7 @@
import org.eclipse.core.resources.IResourceDeltaVisitor;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
/**
* Performs an incremental build of the resources.
@@ -33,7 +34,7 @@ public boolean visit( final IResourceDelta delta ) throws CoreException {
// Set derived file as derived
resource.getProject().refreshLocal( IResource.DEPTH_INFINITE, null );
IPath derivedPath = resource.getProjectRelativePath().removeFileExtension().addFileExtension( FileUtil.EXTENSION_HS );
- resource.getProject().getFile( derivedPath ).setDerived( true );
+ resource.getProject().getFile( derivedPath ).setDerived( true,new NullProgressMonitor() );
}
}
return true;
@@ -7,6 +7,7 @@
import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
/**
* Builds all resources in the project.
@@ -24,7 +25,7 @@ public boolean visit( final IResource resource ) throws CoreException {
// Set derived file as derived
resource.getProject().refreshLocal( IResource.DEPTH_INFINITE, null );
IPath derivedPath = resource.getProjectRelativePath().removeFileExtension().addFileExtension( FileUtil.EXTENSION_HS );
- resource.getProject().getFile( derivedPath ).setDerived( true );
+ resource.getProject().getFile( derivedPath ).setDerived( true,new NullProgressMonitor() );
}
return true;
}
@@ -9,6 +9,7 @@
import org.eclipse.core.resources.IResourceDeltaVisitor;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
/**
* Performs an incremental build of the resources.
@@ -34,7 +35,7 @@ public boolean visit( final IResourceDelta delta ) throws CoreException {
resource.getProject().refreshLocal( IResource.DEPTH_INFINITE, null );
IPath derivedPath = resource.getProjectRelativePath()
.removeFileExtension().addFileExtension( FileUtil.EXTENSION_HS );
- resource.getProject().getFile( derivedPath ).setDerived( true );
+ resource.getProject().getFile( derivedPath ).setDerived( true,new NullProgressMonitor() );
}
}
return true;
@@ -7,6 +7,7 @@
import org.eclipse.core.resources.IResourceVisitor;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
/**
* Builds all resources in the project.
@@ -25,7 +26,7 @@ public boolean visit( final IResource resource ) throws CoreException {
resource.getProject().refreshLocal( IResource.DEPTH_INFINITE, null );
IPath derivedPath = resource.getProjectRelativePath()
.removeFileExtension().addFileExtension( FileUtil.EXTENSION_HS );
- resource.getProject().getFile( derivedPath ).setDerived( true );
+ resource.getProject().getFile( derivedPath ).setDerived( true,new NullProgressMonitor() );
}
return true;
}
@@ -17,7 +17,7 @@
implements ICorePreferenceNames {
@Override
public void initializeDefaultPreferences() {
- IEclipsePreferences coreNode = new DefaultScope().getNode( HaskellCorePlugin.getPluginId() );
+ IEclipsePreferences coreNode = DefaultScope.INSTANCE.getNode( HaskellCorePlugin.getPluginId() );
coreNode.put( SELECTED_COMPILER, "ghcCompiler" ); //$NON-NLS-1$
coreNode.put( FOLDERS_SRC, FileUtil.DEFAULT_FOLDER_SRC );
coreNode.put( FOLDERS_DOC, FileUtil.DEFAULT_FOLDER_DOC );
@@ -71,7 +71,7 @@ public IPreferenceStore getPreferenceStore() {
/** Save the template's preferences: */
public void savePluginPreferences() {
try {
- new InstanceScope().getNode(CUSTOM_TEMPLATES_KEY).flush();
+ InstanceScope.INSTANCE.getNode(CUSTOM_TEMPLATES_KEY).flush();
} catch( BackingStoreException ex ) {
HaskellUIPlugin.log( UITexts.template_prefSave_backingStore_exception, ex );
}
@@ -104,7 +104,7 @@ public boolean performOk() {
@Override
protected IPreferenceStore doGetPreferenceStore() {
- return new ScopedPreferenceStore(new InstanceScope(),
+ return new ScopedPreferenceStore(InstanceScope.INSTANCE,
HaskellCorePlugin.getPluginId());
}
@@ -341,7 +341,7 @@ public boolean performOk() {
store.setValue( key, text.getText() );
}
try {
- new InstanceScope().getNode(HaskellCorePlugin.getPluginId()).flush();
+ InstanceScope.INSTANCE.getNode(HaskellCorePlugin.getPluginId()).flush();
} catch( BackingStoreException ex ) {
HaskellCorePlugin.log( ex );
}
@@ -350,7 +350,7 @@ public boolean performOk() {
@Override
protected IPreferenceStore doGetPreferenceStore() {
- return new ScopedPreferenceStore(new InstanceScope(),
+ return new ScopedPreferenceStore(InstanceScope.INSTANCE,
HaskellCorePlugin.getPluginId());
}
@@ -46,7 +46,7 @@ public void dispose() {
public boolean performOk() {
overlayStore.propagate();
try {
- new InstanceScope().getNode(HaskellUIPlugin.getPluginId()).flush();
+ InstanceScope.INSTANCE.getNode(HaskellUIPlugin.getPluginId()).flush();
} catch( BackingStoreException ex ) {
HaskellUIPlugin.log( ex );
}
@@ -27,9 +27,9 @@
import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener;
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent;
+import org.eclipse.core.runtime.preferences.InstanceScope;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.ui.IMemento;
import org.eclipse.ui.navigator.ICommonContentExtensionSite;
@@ -161,7 +161,7 @@ public void inputChanged( final Viewer viewer, final Object oldInput,
// TODO lf note to self: config -> navigator service -> can be used to
// get state information from the View
public void init( final ICommonContentExtensionSite config ) {
- IEclipsePreferences node = new InstanceScope().getNode( HaskellCorePlugin
+ IEclipsePreferences node = InstanceScope.INSTANCE.getNode( HaskellCorePlugin
.getPluginId() );
node.addPreferenceChangeListener( new IPreferenceChangeListener() {

0 comments on commit 2122005

Please sign in to comment.