From 6dacfd56b3c155751862c1c8b6f20a62f29e27fd Mon Sep 17 00:00:00 2001 From: "nor..67" Date: Fri, 18 Jan 2013 15:59:00 +0000 Subject: [PATCH] SDK: - cleanup logger use in ProjectAssetManager and ProjectExtensionManager git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10095 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../gde/core/assets/ProjectAssetManager.java | 14 +++++++------- .../j2seproject/ProjectExtensionManager.java | 16 ++++++++-------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/sdk/jme3-core/src/com/jme3/gde/core/assets/ProjectAssetManager.java b/sdk/jme3-core/src/com/jme3/gde/core/assets/ProjectAssetManager.java index 1c9dbfa6f..3f57733fb 100644 --- a/sdk/jme3-core/src/com/jme3/gde/core/assets/ProjectAssetManager.java +++ b/sdk/jme3-core/src/com/jme3/gde/core/assets/ProjectAssetManager.java @@ -75,7 +75,7 @@ import org.openide.util.lookup.Lookups; */ @SuppressWarnings("unchecked") public class ProjectAssetManager extends DesktopAssetManager { - + private static final Logger logger = Logger.getLogger(ProjectAssetManager.class.getName()); private Project project; private List folderNames = new LinkedList(); private final List assetEventListeners = Collections.synchronizedList(new LinkedList()); @@ -105,7 +105,7 @@ public class ProjectAssetManager extends DesktopAssetManager { this.project = new DummyProject(this, path); } String string = project.getProjectDirectory().getPath(); - Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Add locator: {0}", string); + logger.log(Level.INFO, "Add locator: {0}", string); registerLocator(string, "com.jme3.asset.plugins.FileLocator"); for (AssetManagerConfigurator di : Lookup.getDefault().lookupAll(AssetManagerConfigurator.class)) { di.prepareManager(this); @@ -123,13 +123,13 @@ public class ProjectAssetManager extends DesktopAssetManager { } Logger.getLogger(ProjectAssetManager.class.getName()).log(Level.INFO, "Clear {0} classpath entries and {1} url locators for project {2}", new Object[]{classPathItems.size(), jarItems.size(), project.toString()}); for (FileObject fileObject : jarItems) { - Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Remove locator:{0}", fileObject.toURL()); + logger.log(Level.FINE, "Remove locator:{0}", fileObject.toURL()); unregisterLocator(fileObject.toURL().toExternalForm(), com.jme3.asset.plugins.UrlLocator.class); } jarItems.clear(); for (ClassPathItem fileObject : classPathItems) { - Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Remove classpath:{0}", fileObject.object); + logger.log(Level.FINE, "Remove classpath:{0}", fileObject.object); fileObject.object.removeRecursiveListener(fileObject.listener); } classPathItems.clear(); @@ -156,12 +156,12 @@ public class ProjectAssetManager extends DesktopAssetManager { for (FileObject fileObject : roots) { if (!fileObject.equals(getAssetFolder())) { fileObject.addRecursiveListener(listener); - Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Add classpath:{0}", fileObject); + logger.log(Level.FINE, "Add classpath:{0}", fileObject); classPathItems.add(new ClassPathItem(fileObject, listener)); urls.add(fileObject.toURL()); } if (fileObject.toURL().toExternalForm().startsWith("jar")) { - Logger.getLogger(this.getClass().getName()).log(Level.FINE, "Add locator:{0}", fileObject.toURL()); + logger.log(Level.FINE, "Add locator:{0}", fileObject.toURL()); jarItems.add(fileObject); registerLocator(fileObject.toURL().toExternalForm(), "com.jme3.asset.plugins.UrlLocator"); @@ -267,7 +267,7 @@ public class ProjectAssetManager extends DesktopAssetManager { */ public void addFolderLocator(String relativePath) { String string = project.getProjectDirectory().getPath() + "/" + relativePath + "/"; - Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Add locator:{0}", string); + logger.log(Level.INFO, "Add locator:{0}", string); registerLocator(string, "com.jme3.asset.plugins.FileLocator"); folderNames.add(relativePath); diff --git a/sdk/jme3-core/src/com/jme3/gde/core/j2seproject/ProjectExtensionManager.java b/sdk/jme3-core/src/com/jme3/gde/core/j2seproject/ProjectExtensionManager.java index e416e4387..fb3bb6ef5 100644 --- a/sdk/jme3-core/src/com/jme3/gde/core/j2seproject/ProjectExtensionManager.java +++ b/sdk/jme3-core/src/com/jme3/gde/core/j2seproject/ProjectExtensionManager.java @@ -64,7 +64,7 @@ import org.openide.util.Exceptions; * @author normenhansen */ public class ProjectExtensionManager { - + private static final Logger logger = Logger.getLogger(ProjectExtensionManager.class.getName()); private String extensionName; private String extensionVersion; private String extensionTargets; @@ -447,7 +447,7 @@ public class ProjectExtensionManager { //XXX: deleting old (beta) files here FileObject fo = projectRoot.getFileObject(entry.getName()); if (fo != null && entry.getSize() != -1 && entry.getSize() == fo.getSize()) { - Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Deleting old folder " + fo.getNameExt()); + logger.log(Level.INFO, "Deleting old folder " + fo.getNameExt()); fo.delete(); } FileUtil.createFolder(projectRoot, fileName); @@ -455,7 +455,7 @@ public class ProjectExtensionManager { //XXX: deleting old (beta) files here FileObject fo = projectRoot.getFileObject(entry.getName()); if (fo != null && !fo.equals(projectRoot)) { - Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Deleting old file " + fo.getNameExt()); + logger.log(Level.INFO, "Deleting old file " + fo.getNameExt()); fo.delete(); } fo = projectRoot.getFileObject(fileName); @@ -463,7 +463,7 @@ public class ProjectExtensionManager { fo = FileUtil.createData(projectRoot, fileName); writeFile(str, fo); } else { - Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Not overwriting existing file " + fo.getNameExt()); + logger.log(Level.INFO, "Not overwriting existing file " + fo.getNameExt()); } } } @@ -485,7 +485,7 @@ public class ProjectExtensionManager { //XXX: deleting old (beta) files here FileObject old = projectRoot.getFileObject(entry.getName()); if (old != null && !old.equals(projectRoot)) { - Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Deleting old file " + old.getNameExt()); + logger.log(Level.INFO, "Deleting old file " + old.getNameExt()); if (entry.getSize() != -1 && entry.getSize() == old.getSize()) { old.delete(); } @@ -494,11 +494,11 @@ public class ProjectExtensionManager { FileObject obj = projectRoot.getFileObject(fileName); if (obj != null && !obj.equals(projectRoot) && !obj.isFolder()) { if (entry.getSize() != -1 && entry.getSize() == obj.getSize()) { - Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Deleting file " + obj.getNameExt()); + logger.log(Level.INFO, "Deleting file " + obj.getNameExt()); obj.delete(); } else { kept = true; - Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Keeping file " + obj.getNameExt()); + logger.log(Level.INFO, "Keeping file " + obj.getNameExt()); } } } @@ -518,7 +518,7 @@ public class ProjectExtensionManager { private void writeFile(ZipInputStream str, FileObject fo) throws IOException { OutputStream out = fo.getOutputStream(); try { - Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Creating file " + fo.getNameExt()); + logger.log(Level.INFO, "Creating file " + fo.getNameExt()); FileUtil.copy(str, out); } finally { out.close();