Commits

Anonymous committed c3f288a

Few checkstyle issues.

  • Participants
  • Parent commits 560bc4d

Comments (0)

Files changed (6)

File core/src/org/netbeans/modules/android/core/ddm/AndroidDebugBridgeFactory.java

 import com.android.ddmlib.DebugPortManager;
 import com.android.ddmlib.Log;
 import com.android.ddmlib.Log.LogLevel;
+import java.util.logging.Level;
 import java.util.logging.Logger;
 import org.netbeans.modules.android.core.sdk.DalvikPlatform;
 import org.netbeans.modules.android.core.sdk.DalvikPlatformManager;
  */
 public final class AndroidDebugBridgeFactory {
 
-  /**
+  /*
    * Get adb location form DalvikPlatformManager (SdkConstants.OS_SDK_TOOLS_FOLDER + SdkConstants.FN_ADB)
    * store it in prefs for fast access
    * add listener to DPM to get changes and restart adb
 
     private static DalvikPlatform usedPlatform;
     private static AndroidDebugBridge bridge;
-    public static final String ADB_TOOL = "adb";    //NOI18N
+    private static final String ADB_TOOL = "adb";    //NOI18N
 
-    private static boolean DEBUG = Boolean.getBoolean("AndroidDebugBridgeFactory.debug");   //NOI18N
+    private static final boolean DEBUG = Boolean.getBoolean("AndroidDebugBridgeFactory.debug");   //NOI18N
 
     private AndroidDebugBridgeFactory () {
     }
 
+    /** Singleton accessor. */
     public static synchronized AndroidDebugBridge getDefault () {
         if (usedPlatform != null) {
             return bridge;
-        }
-        else {
+        } else {
             final DalvikPlatform androidPlatform = findPlatform();
             return androidPlatform == null ? null : forSDK(androidPlatform);
         }
 
                 @Override
                 public void printLog(LogLevel arg0, String arg1, String arg2) {
-                    Logger.getLogger(AndroidDebugBridgeFactory.class.getName()).warning(arg1 + " " +arg2);      //NOI18N
+                    Logger.getLogger(AndroidDebugBridgeFactory.class.getName()).log(
+                        Level.WARNING, "{0} {1}", new Object[]{arg1, arg2});
                 }
 
                 @Override
                 public void printAndPromptLog(LogLevel arg0, String arg1, String arg2) {
-                    Logger.getLogger(AndroidDebugBridgeFactory.class.getName()).warning(arg1 + " " +arg2);      //NOI18N
+                    Logger.getLogger(AndroidDebugBridgeFactory.class.getName()).log(
+                        Level.WARNING, "{0} {1}", new Object[]{arg1, arg2});
                 }
             });
             DdmPreferences.setLogLevel("verbose");

File core/src/org/netbeans/modules/android/core/ddm/DebugPortProvider.java

  *
  * @author tom
  */
-class DebugPortProvider implements IDebugPortProvider {
+final class DebugPortProvider implements IDebugPortProvider {
     
     private static DebugPortProvider instance;
 

File core/src/org/netbeans/modules/android/core/ddm/EmulatorControlSupport.java

   /**
    * Map between the display GSMmode and the internal tag used by the display.
    */
-  private final static String[][] GSM_MODES = new String[][]{
-      { "unregistered", GsmMode.UNREGISTERED.getTag()},
-      { "home", GsmMode.HOME.getTag()},
-      { "roaming", GsmMode.ROAMING.getTag()},
-      { "searching", GsmMode.SEARCHING.getTag()},
-      { "denied", GsmMode.DENIED.getTag()},
+  private static final String[][] GSM_MODES = new String[][]{
+      {"unregistered", GsmMode.UNREGISTERED.getTag()},
+      {"home", GsmMode.HOME.getTag()},
+      {"roaming", GsmMode.ROAMING.getTag()},
+      {"searching", GsmMode.SEARCHING.getTag()},
+      {"denied", GsmMode.DENIED.getTag()},
   };
   
-  private final static String[] NETWORK_SPEEDS = new String[]{
+  private static final String[] NETWORK_SPEEDS = new String[]{
       "Full",
       "GSM",
       "HSCSD",
       "HSDPA",
   };
   
-  private final static String[] NETWORK_LATENCIES = new String[]{
+  private static final String[] NETWORK_LATENCIES = new String[]{
       "None",
       "GPRS",
       "EDGE",
 
   private final IDevice device;
   private EmulatorConsole console;
-  
+
+  /** Device properties that can be controlled by tools. */
   public enum Control {
     VOICE(NbBundle.getMessage(EmulatorControlSupport.class, "PROP_Voice"), 
         NbBundle.getMessage(EmulatorControlSupport.class, "DESC_Voice")),

File core/src/org/netbeans/modules/android/core/sdk/DalvikPlatformManager.java

  *
  * @author jesse, radim
  */
-public class DalvikPlatformManager {
+public final class DalvikPlatformManager {
 
   public static final String PROP_INSTALLED_PLATFORMS = "installedPlatforms";
   public static final String PROP_SDK_LOCATION = "sdkLocation";

File core/src/org/netbeans/modules/android/core/sdk/SdkLogProvider.java

 import java.util.logging.Logger;
 
 /**
- * A simple cache to share SDK managers
+ * Utility to create SDK loggers.
  * @author radim
  */
 public class SdkLogProvider {
 
   private static final Logger LOG = Logger.getLogger(SdkLogProvider.class.getName());
 
+  private SdkLogProvider() {
+  }
+
   /**
    * Creates an instance of {@link ISdkLog}.
    *
-   * @param errorReportOn {@code true} to log errors to standard Java util logging API
+   * @param errorReportOn {@code true} to log errors to standard Java utilities logging API
+   * @return log consumer
    */
   public static ISdkLog createSdkLogger(final boolean errorReportOn) {
     return new ISdkLog() {
 
+      @Override
       public void warning(String warningFormat, Object... args) {
         LOG.log(errorReportOn ? Level.WARNING : Level.FINER, String.format(warningFormat, args));
       }
 
+      @Override
       public void error(Throwable t, String errorFormat, Object... args) {
         LOG.log(errorReportOn ? Level.SEVERE : Level.FINER, String.format(errorFormat, args));
         LOG.log(errorReportOn ? Level.SEVERE : Level.FINER, null, t);
       }
 
+      @Override
       public void printf(String msgFormat, Object... args) {
         LOG.log(errorReportOn ? Level.CONFIG : Level.FINER, String.format(msgFormat, args));
       }

File libs/checkstyle-5.3/sun_checks.xml

         <module name="HiddenField"/>
         <module name="IllegalInstantiation"/>
         <module name="InnerAssignment"/>
-        <module name="MagicNumber"/>
+        <!--<module name="MagicNumber"/> frequently used in forms -->
         <module name="MissingSwitchDefault"/>
         <module name="RedundantThrows"/>
         <module name="SimplifyBooleanExpression"/>