Minor coding problem was fixed
authorEugene Ostroukhov <eugeneo@symbian.org>
Wed, 09 Jun 2010 15:16:09 -0700
changeset 367 f0817aeb2d7e
parent 366 715f288b552a
child 368 749e38c3b756
Minor coding problem was fixed
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/libraries/jsdt/PhoneGapInferrenceProvider.java
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/libraries/jsdt/PhoneGapInferrenceProvider.java	Wed Jun 09 14:44:32 2010 -0700
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/core/libraries/jsdt/PhoneGapInferrenceProvider.java	Wed Jun 09 15:16:09 2010 -0700
@@ -37,58 +37,55 @@
 import org.symbian.tools.wrttools.Activator;
 
 public class PhoneGapInferrenceProvider implements InferrenceProvider {
-	public static final String ID = "org.symbian.tools.wrttools.phonegap";
-	private static final Collection<String> PHONEGAP_TYPES = new TreeSet<String>(
-			Arrays.asList("Acceleration", "AccelerationOptions",
-					"Accelerometer", "Camera", "DeviceError", "Contacts",
-					"Contact", "Geolocation", "PositionOptions", "Coordinates",
-					"Media", "Notification", "Orientation", "Position",
-					"PositionError", "Sms", "Storage"));
-
-	public int applysTo(IInferenceFile scriptFile) {
-		String path = String.valueOf(scriptFile.getFileName());
+    public static final String ID = "org.symbian.tools.wrttools.phonegap";
+    private static final Collection<String> PHONEGAP_TYPES = new TreeSet<String>(Arrays.asList("Acceleration",
+            "AccelerationOptions", "Accelerometer", "Camera", "DeviceError", "Contacts", "Contact", "Geolocation",
+            "PositionOptions", "Coordinates", "Media", "Notification", "Orientation", "Position", "PositionError",
+            "Sms", "Storage"));
 
-		IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(
-				new Path(path));
-		if (file != null && file.isAccessible()) {
-			IJavaScriptUnit unit = (IJavaScriptUnit) JavaScriptCore
-					.create(file);
-			try {
-				IType[] types = unit.getAllTypes();
-				int typeCount = 0;
-				for (IType type : types) {
-					if (PHONEGAP_TYPES.contains(type.getElementName())) {
-						typeCount += 1;
-					}
-				}
-				if (typeCount > 1) {
-                    return ONLY_THIS;
-				}
-			} catch (JavaScriptModelException e) {
-				Activator.log(e);
-			}
-		}
-		return NOT_THIS;
-	}
+    public int applysTo(IInferenceFile scriptFile) {
+        Path path = new Path(String.valueOf(scriptFile.getFileName()));
+        if (path.segmentCount() > 1) {
+            IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
+            if (file != null && file.isAccessible()) {
+                IJavaScriptUnit unit = (IJavaScriptUnit) JavaScriptCore.create(file);
+                try {
+                    IType[] types = unit.getAllTypes();
+                    int typeCount = 0;
+                    for (IType type : types) {
+                        if (PHONEGAP_TYPES.contains(type.getElementName())) {
+                            typeCount += 1;
+                        }
+                    }
+                    if (typeCount > 1) {
+                        return ONLY_THIS;
+                    }
+                } catch (JavaScriptModelException e) {
+                    Activator.log(e);
+                }
+            }
+        }
+        return NOT_THIS;
+    }
 
-	public String getID() {
-		return ID;
-	}
+    public String getID() {
+        return ID;
+    }
 
-	public InferEngine getInferEngine() {
-		final InferEngine engine = new PhoneGapInferEngine();
-		engine.inferenceProvider = this;
-		return engine;
-	}
+    public InferEngine getInferEngine() {
+        final InferEngine engine = new PhoneGapInferEngine();
+        engine.inferenceProvider = this;
+        return engine;
+    }
 
-	public RefactoringSupport getRefactoringSupport() {
-		// TODO Auto-generated method stub
-		return null;
-	}
+    public RefactoringSupport getRefactoringSupport() {
+        // TODO Auto-generated method stub
+        return null;
+    }
 
-	public ResolutionConfiguration getResolutionConfiguration() {
-		final ResolutionConfiguration configuration = new ResolutionConfiguration();
-		return configuration;
-	}
+    public ResolutionConfiguration getResolutionConfiguration() {
+        final ResolutionConfiguration configuration = new ResolutionConfiguration();
+        return configuration;
+    }
 
 }