cleanup
authorAlexey Kudravtsev <cdr@intellij.com>
Wed, 1 Feb 2012 15:25:43 +0000 (19:25 +0400)
committerAlexey Kudravtsev <cdr@intellij.com>
Thu, 2 Feb 2012 09:18:31 +0000 (13:18 +0400)
platform/platform-impl/src/com/intellij/openapi/components/impl/stores/StorageUtil.java
platform/platform-impl/src/com/intellij/openapi/progress/util/ProgressWindow.java

index 5e4431fc4099222c32045e980fae1b1e11bcced5..b6624845f61f416de2e9ede737f9013d960b8667 100644 (file)
@@ -190,7 +190,7 @@ public class StorageUtil {
   public static boolean contentEquals(@NotNull final Document document, @NotNull final IFile file) {
     try {
       final Pair<String, String> pair = loadFile(file);
   public static boolean contentEquals(@NotNull final Document document, @NotNull final IFile file) {
     try {
       final Pair<String, String> pair = loadFile(file);
-      return pair.first == null ? false : pair.first.equals(printDocumentToString(document, pair.second));
+      return pair.first != null && pair.first.equals(printDocumentToString(document, pair.second));
     }
     catch (IOException e) {
       LOG.debug(e);
     }
     catch (IOException e) {
       LOG.debug(e);
@@ -201,7 +201,7 @@ public class StorageUtil {
   public static boolean contentEquals(@NotNull final Element element, @NotNull final IFile file) {
     try {
       final Pair<String, String> pair = loadFile(file);
   public static boolean contentEquals(@NotNull final Element element, @NotNull final IFile file) {
     try {
       final Pair<String, String> pair = loadFile(file);
-      return pair.first == null ? false : pair.first.equals(printElement(element, pair.second));
+      return pair.first != null && pair.first.equals(printElement(element, pair.second));
     }
     catch (IOException e) {
       LOG.debug(e);
     }
     catch (IOException e) {
       LOG.debug(e);
index ccbb4f8afcc4fbac29441fc86db62dc283f185db..0a6c80418c06ebbd0ea28b9bdc963ff3d1f4ddf0 100644 (file)
@@ -164,7 +164,6 @@ public class ProgressWindow extends BlockingProgressIndicator implements Disposa
                 final DialogWrapper popup = myDialog.myPopup;
                 if (popup != null) {
                   myFocusTrackback.registerFocusComponent(new FocusTrackback.ComponentQuery() {
                 final DialogWrapper popup = myDialog.myPopup;
                 if (popup != null) {
                   myFocusTrackback.registerFocusComponent(new FocusTrackback.ComponentQuery() {
-                    @SuppressWarnings({"ConstantConditions"})
                     public Component getComponent() {
                       return popup.getPreferredFocusedComponent();
                     }
                     public Component getComponent() {
                       return popup.getPreferredFocusedComponent();
                     }
@@ -250,7 +249,7 @@ public class ProgressWindow extends BlockingProgressIndicator implements Disposa
     if (isDialogShowing()) {
       if (myFocusTrackback != null) {
         myFocusTrackback.setWillBeSheduledForRestore();
     if (isDialogShowing()) {
       if (myFocusTrackback != null) {
         myFocusTrackback.setWillBeSheduledForRestore();
-      }      
+      }
     }
 
     UIUtil.invokeLaterIfNeeded(new Runnable() {
     }
 
     UIUtil.invokeLaterIfNeeded(new Runnable() {
@@ -260,11 +259,12 @@ public class ProgressWindow extends BlockingProgressIndicator implements Disposa
         if (myDialog != null) {
           myDialog.hide();
         }
         if (myDialog != null) {
           myDialog.hide();
         }
-        
+
         if (myFocusTrackback != null) {
           if (wasShowing) {
             myFocusTrackback.restoreFocus();
         if (myFocusTrackback != null) {
           if (wasShowing) {
             myFocusTrackback.restoreFocus();
-          } else {
+          }
+          else {
             myFocusTrackback.consume();
           }
         }
             myFocusTrackback.consume();
           }
         }