X-Git-Url: http://secure.phpeclipse.com
diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/corext/refactoring/util/ResourceUtil.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/corext/refactoring/util/ResourceUtil.java
index fec6cc2..cca176a 100644
--- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/corext/refactoring/util/ResourceUtil.java
+++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpdt/internal/corext/refactoring/util/ResourceUtil.java
@@ -17,20 +17,22 @@ import net.sourceforge.phpdt.core.ICompilationUnit;
import net.sourceforge.phpdt.core.IJavaElement;
import net.sourceforge.phpdt.core.IMember;
import net.sourceforge.phpdt.core.IOpenable;
-import net.sourceforge.phpdt.internal.corext.Assert;
+//incastrix
+//import net.sourceforge.phpdt.internal.corext.Assert;
+import org.eclipse.core.runtime.Assert;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IResource;
public class ResourceUtil {
-
- private ResourceUtil(){
+
+ private ResourceUtil() {
}
-
+
public static IFile[] getFiles(ICompilationUnit[] cus) {
- List files= new ArrayList(cus.length);
- for (int i= 0; i < cus.length; i++) {
- IResource resource= ResourceUtil.getResource(cus[i]);
+ List files = new ArrayList(cus.length);
+ for (int i = 0; i < cus.length; i++) {
+ IResource resource = ResourceUtil.getResource(cus[i]);
if (resource != null && resource.getType() == IResource.FILE)
files.add(resource);
}
@@ -38,27 +40,28 @@ public class ResourceUtil {
}
public static IFile getFile(ICompilationUnit cu) {
- IResource resource= ResourceUtil.getResource(cu);
+ IResource resource = ResourceUtil.getResource(cu);
if (resource != null && resource.getType() == IResource.FILE)
- return (IFile)resource;
+ return (IFile) resource;
else
return null;
}
- //----- other ------------------------------
-
+ // ----- other ------------------------------
+
/**
- * Finds an IResource
for a given ICompilationUnit
.
- * If the parameter is a working copy then the IResource
for
- * the original element is returned.
+ * Finds an IResource
for a given
+ * ICompilationUnit
. If the parameter is a working copy then
+ * the IResource
for the original element is returned.
*/
public static IResource getResource(ICompilationUnit cu) {
return cu.getResource();
}
-
/**
- * Returns the IResource
that the given IMember
is defined in.
+ * Returns the IResource
that the given IMember
+ * is defined in.
+ *
* @see #getResource
*/
public static IResource getResource(IMember member) {
@@ -66,20 +69,20 @@ public class ResourceUtil {
return getResource(member.getCompilationUnit());
}
- public static IResource getResource(Object o){
+ public static IResource getResource(Object o) {
if (o instanceof IResource)
- return (IResource)o;
+ return (IResource) o;
if (o instanceof IJavaElement)
- return getResource((IJavaElement)o);
- return null;
+ return getResource((IJavaElement) o);
+ return null;
}
- private static IResource getResource(IJavaElement element){
- if (element.getElementType() == IJavaElement.COMPILATION_UNIT)
+ private static IResource getResource(IJavaElement element) {
+ if (element.getElementType() == IJavaElement.COMPILATION_UNIT)
return getResource((ICompilationUnit) element);
- else if (element instanceof IOpenable)
+ else if (element instanceof IOpenable)
return element.getResource();
- else
- return null;
+ else
+ return null;
}
}