UIB : Add error handling check null dereference 22/18622/1
authorjeonghwan kim <jeonghwan0613.kim@samsung.com>
Thu, 27 Mar 2014 07:47:38 +0000 (16:47 +0900)
committerjeonghwan kim <jeonghwan0613.kim@samsung.com>
Thu, 27 Mar 2014 07:47:38 +0000 (16:47 +0900)
Change-Id: Idc4318a8ef6637e0c5db865aa74d346a2c9ef542
Signed-off-by: jeonghwan kim <jeonghwan0613.kim@samsung.com>
org.tizen.webuibuilder/src/org/tizen/webuibuilder/builder/WebUIBuilderBuilder.java

index 28aedc3..67588be 100644 (file)
@@ -38,8 +38,6 @@ import org.eclipse.core.runtime.IProgressMonitor;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.QualifiedName;
 import org.eclipse.ui.actions.WorkspaceModifyOperation;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 import org.tizen.webuibuilder.BuilderConstants;
 import org.tizen.webuibuilder.animator.AnimatorConstants;
 import org.tizen.webuibuilder.model.PartFactory;
@@ -58,7 +56,6 @@ public class WebUIBuilderBuilder extends IncrementalProjectBuilder {
     private static final String XSLT_PAGE_MANAGED_JS = "res/xslt/page_managed_js_ver0_0_2.xslt"; //$NON-NLS-1$
     public static final String XSLT_PAGE_CSS = "res/xslt/page_managed_css_ver0_0_3.xslt"; //$NON-NLS-1$
     public static final String XSLT_INDEX_MANAGED_JS = "res/xslt/index_managed_js_ver0_0_1.xslt"; //$NON-NLS-1$
-    private static Logger logger = LoggerFactory.getLogger(WebUIBuilderBuilder.class);
 
     // org.eclipse.jst.pagedesigner.editors.HTMLEditor.MODE_SOURCE;
     public static final int MODE_SOURCE = 3;
@@ -68,12 +65,6 @@ public class WebUIBuilderBuilder extends IncrementalProjectBuilder {
         return projectManager.getOldDescriptorManager();
     }
 
-    // private static PartFactory getPartFactory(IProject project) {
-    // ProjectManager projectManager = ProjectManager
-    // .getProjectManager(project);
-    // return projectManager.getPartFactory();
-    // }
-
     public static void build(IProject project) throws CoreException, IOException {
         BuildProjectOperation op = new BuildProjectOperation(project);
         try {
@@ -323,57 +314,50 @@ public class WebUIBuilderBuilder extends IncrementalProjectBuilder {
         // delete Html file
         if ((style & BuilderConstants.HTML_FILE) != 0) {
             IFile file = PageManager.getHtmlFile(res);
-            if (file.exists()) {
+            if (file != null && file.exists()) {
                 file.delete(false, null);
-            } else {
             }
         }
 
         if ((style & BuilderConstants.MANAGED_JS_FILE) != 0) {
             IFile file = PageManager.getManagedJsFile(res);
-            if (file.exists()) {
+            if (file != null && file.exists()) {
                 file.delete(false, null);
-            } else {
             }
         }
 
         if ((style & BuilderConstants.JS_FILE) != 0) {
             IFile file = PageManager.getJsFile(res);
-            if (file.exists()) {
+            if (file != null && file.exists()) {
                 file.delete(false, null);
-            } else {
             }
         }
 
         if ((style & BuilderConstants.CSS_FILE) != 0) {
             IFile file = PageManager.getCssFile(res);
-            if (file.exists()) {
+            if (file != null && file.exists()) {
                 file.delete(false, null);
-            } else {
             }
         }
 
         if ((style & BuilderConstants.MANAGED_CSS_FILE) != 0) {
             IFile file = PageManager.getManagedCssFile(res);
-            if (file.exists()) {
+            if (file != null && file.exists()) {
                 file.delete(false, null);
-            } else {
             }
         }
 
         if ((style & AnimatorConstants.ANIMATOR_MANAGED_JS_FILE) != 0) {
             IFile file = PageManager.getAnimatorManagedJsFile(res);
-            if (file.exists()) {
+            if (file != null && file.exists()) {
                 file.delete(false, null);
-            } else {
             }
         }
 
         if ((style & AnimatorConstants.ANIMATOR_MANAGED_CSS_FILE) != 0) {
             IFile file = PageManager.getAnimatorManagedCssFile(res);
-            if (file.exists()) {
+            if (file != null && file.exists()) {
                 file.delete(false, null);
-            } else {
             }
         }
     }