cleanup
authorAlexey Kudravtsev <cdr@intellij.com>
Tue, 16 Feb 2010 12:41:19 +0000 (15:41 +0300)
committerAlexey Kudravtsev <cdr@intellij.com>
Wed, 17 Feb 2010 13:53:20 +0000 (16:53 +0300)
128 files changed:
java/compiler/impl/src/com/intellij/compiler/classParsing/MemberInfoExternalizer.java
java/compiler/impl/src/com/intellij/compiler/classParsing/MethodInfo.java
java/compiler/impl/src/com/intellij/compiler/impl/OneProjectItemCompileScope.java
java/compiler/impl/src/com/intellij/compiler/make/CacheUtils.java
java/compiler/impl/src/com/intellij/compiler/make/Dependency.java
java/compiler/impl/src/com/intellij/compiler/make/DependencyCacheNavigator.java
java/debugger/impl/src/com/intellij/debugger/engine/DebugProcessImpl.java
java/debugger/impl/src/com/intellij/debugger/engine/JVMNameUtil.java
java/debugger/impl/src/com/intellij/debugger/engine/PositionManagerImpl.java
java/debugger/impl/src/com/intellij/debugger/engine/SuspendManagerImpl.java
java/debugger/impl/src/com/intellij/debugger/engine/evaluation/expression/CodeFragmentEvaluator.java
java/debugger/impl/src/com/intellij/debugger/impl/InvokeThread.java
java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/DebuggerTreeNodeExpression.java
java/debugger/impl/src/com/intellij/debugger/ui/impl/watch/NodeDescriptorFactoryImpl.java
java/execution/impl/src/com/intellij/compiler/options/CompileStepBeforeRun.java
java/execution/impl/src/com/intellij/execution/junit2/configuration/CommonJavaParameters.java
java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/ClasspathPanel.java
java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/LibraryChooserElement.java
java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/LayoutTreeComponent.java
java/idea-ui/src/com/intellij/openapi/roots/ui/configuration/artifacts/nodes/PackagingElementNode.java
java/java-impl/src/com/intellij/codeInsight/completion/JavaCompletionContributor.java
java/java-impl/src/com/intellij/codeInsight/editorActions/CopyPasteReferenceProcessor.java
java/java-impl/src/com/intellij/codeInsight/folding/impl/JavaFoldingBuilder.java
java/java-impl/src/com/intellij/codeInsight/hint/JavaImplementationTextSelectioner.java
java/java-impl/src/com/intellij/codeInsight/lookup/LookupItemUtil.java
java/java-impl/src/com/intellij/psi/impl/source/PsiJavaCodeReferenceElementImpl.java
java/java-impl/src/com/intellij/psi/impl/source/parsing/JavadocParsing.java
java/java-impl/src/com/intellij/psi/impl/source/tree/JavaChangeUtilSupport.java
java/java-impl/src/com/intellij/psi/impl/source/tree/java/PsiReferenceExpressionImpl.java
java/java-impl/src/com/intellij/psi/impl/source/tree/java/ReplaceExpressionUtil.java
java/java-impl/src/com/intellij/psi/scope/util/PsiScopesUtil.java
java/java-impl/src/com/intellij/refactoring/IntroduceHandlerBase.java
java/java-impl/src/com/intellij/refactoring/changeSignature/ChangeSignatureDialog.java
java/java-impl/src/com/intellij/refactoring/changeSignature/MethodCallUsageInfo.java
java/java-impl/src/com/intellij/refactoring/extractMethod/ControlFlowWrapper.java
java/java-impl/src/com/intellij/refactoring/rename/JavaNameSuggestionProvider.java
java/java-impl/src/com/intellij/refactoring/rename/naming/PsiNamedElementAutomaticRenamer.java
java/java-impl/src/com/intellij/refactoring/util/classRefs/ClassInstanceScanner.java
platform/lang-api/src/com/intellij/execution/runners/ProgramRunnerUtil.java
platform/lang-impl/src/com/intellij/codeInsight/completion/CodeCompletionHandlerBase.java
platform/lang-impl/src/com/intellij/codeInsight/completion/CompletionData.java
platform/lang-impl/src/com/intellij/codeInsight/folding/impl/DocumentFoldingInfo.java
platform/lang-impl/src/com/intellij/extapi/psi/PsiElementBase.java
platform/lang-impl/src/com/intellij/find/actions/ShowUsagesAction.java
platform/lang-impl/src/com/intellij/ide/favoritesTreeView/FavoritesTreeStructure.java
platform/lang-impl/src/com/intellij/ide/projectView/impl/nodes/ProjectViewDirectoryHelper.java
platform/lang-impl/src/com/intellij/openapi/roots/impl/ContentEntryImpl.java
platform/lang-impl/src/com/intellij/psi/formatter/FormattingDocumentModelImpl.java
platform/lang-impl/src/com/intellij/psi/impl/file/impl/FileManagerImpl.java
platform/lang-impl/src/com/intellij/psi/impl/search/PsiSearchHelperImpl.java
platform/lang-impl/src/com/intellij/psi/impl/smartPointers/SmartPointerManagerImpl.java
platform/lang-impl/src/com/intellij/psi/impl/source/codeStyle/CodeStyleManagerImpl.java
platform/lang-impl/src/com/intellij/psi/impl/source/resolve/reference/impl/providers/FileReferenceSet.java
platform/lang-impl/src/com/intellij/psi/impl/source/tree/SharedImplUtil.java
platform/lang-impl/src/com/intellij/psi/templateLanguages/TemplateDataElementType.java
platform/lang-impl/src/com/intellij/refactoring/rename/RenameHandlerRegistry.java
platform/lang-impl/src/com/intellij/refactoring/rename/naming/AutomaticRenamer.java
platform/lang-impl/src/com/intellij/refactoring/rename/naming/NameSuggester.java
platform/platform-api/src/com/intellij/execution/process/ProcessHandler.java
platform/platform-api/src/com/intellij/ide/plugins/PluginManager.java
platform/platform-api/src/com/intellij/ide/util/treeView/TreeBuilderUtil.java
platform/platform-api/src/com/intellij/openapi/roots/ui/util/CompositeAppearance.java
platform/platform-api/src/com/intellij/ui/ListUtil.java
platform/platform-api/src/com/intellij/ui/table/BaseTableView.java
platform/platform-impl/src/com/intellij/ide/IdeEventQueue.java
platform/platform-impl/src/com/intellij/ide/impl/DataManagerImpl.java
platform/platform-impl/src/com/intellij/ide/impl/DataValidator.java
platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/ActionManagerImpl.java
platform/platform-impl/src/com/intellij/openapi/actionSystem/impl/Utils.java
platform/platform-impl/src/com/intellij/openapi/components/impl/stores/ComponentStoreImpl.java
platform/platform-impl/src/com/intellij/openapi/diff/impl/incrementalMerge/MergeList.java
platform/platform-impl/src/com/intellij/openapi/diff/impl/processing/PreferWholeLines.java
platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorHistoryManager.java
platform/platform-impl/src/com/intellij/openapi/fileEditor/impl/EditorsSplitters.java
platform/platform-impl/src/com/intellij/openapi/project/DumbServiceImpl.java
platform/platform-impl/src/com/intellij/openapi/vfs/impl/win32/Win32Kernel.java
platform/platform-impl/src/com/intellij/ui/EditorComboBox.java
platform/platform-impl/src/com/intellij/util/PendingEventDispatcher.java
platform/smRunner/src/com/intellij/execution/testframework/sm/runner/TestSuiteStack.java
platform/smRunner/src/com/intellij/execution/testframework/sm/runner/ui/statistics/StatisticsTableModel.java
platform/testFramework/src/com/intellij/testFramework/PlatformTestUtil.java
platform/usageView/src/com/intellij/usages/UsageInfo2UsageAdapter.java
platform/util/src/com/intellij/openapi/diff/impl/highlighting/Util.java
platform/util/src/com/intellij/util/ArrayUtil.java
platform/util/src/com/intellij/util/ReflectionUtil.java
platform/util/src/com/intellij/util/containers/VariableWidthIntArray.java
platform/util/src/com/intellij/util/xmlb/OptionTagBinding.java
platform/vcs-impl/src/com/intellij/ide/actions/StartUseVcsDialog.java
platform/vcs-impl/src/com/intellij/openapi/vcs/actions/VcsGroupsWrapper.java
platform/vcs-impl/src/com/intellij/openapi/vcs/ex/LineStatusTracker.java
platform/vcs-impl/src/com/intellij/openapi/vcs/ex/Range.java
platform/xdebugger-impl/src/com/intellij/xdebugger/impl/ui/XDebugSessionTab.java
plugins/IdeaTestAssistant/src/com/intellij/testAssistant/TestDataNavigationHandler.java
plugins/ant/src/com/intellij/lang/ant/config/execution/OutputParser2.java
plugins/ant/src/com/intellij/lang/ant/config/explorer/AntExplorerTreeStructure.java
plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/actions/AddFileOrDirectoryAction.java
plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/actions/IgnoreFileAction.java
plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/config/CvsApplicationLevelConfiguration.java
plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/cvsoperations/cvsAdd/AddFileOperation.java
plugins/cvs/cvs-plugin/src/com/intellij/cvsSupport2/cvsoperations/javacvsSpecificImpls/AdminWriterOnCache.java
plugins/git4idea/src/org/jetbrains/git4idea/ssh/SSHMain.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/parameterInfo/GroovyParameterInfoHandler.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/auxiliary/GrLabelReference.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/statements/expressions/CompleteReferenceExpression.java
plugins/groovy/src/org/jetbrains/plugins/groovy/lang/psi/impl/types/GrCodeReferenceElementImpl.java
plugins/junit/src/com/intellij/execution/junit2/segments/InputObjectRegistry.java
plugins/junit/src/com/intellij/execution/junit2/ui/StatisticsTable.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/converters/MavenArtifactCoordinatesConverter.java
plugins/maven/src/main/java/org/jetbrains/idea/maven/dom/references/MavenPropertyPsiReference.java
plugins/properties/src/com/intellij/lang/properties/references/PropertyReferenceBase.java
plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browser/DeleteOptionsDialog.java
plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browser/ImportOptionsDialog.java
plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/browser/MkdirOptionsDialog.java
plugins/ui-designer/src/com/intellij/uiDesigner/designSurface/GridDropLocation.java
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/context/XsltContextProvider.java
plugins/xpath/xpath-lang/src/org/intellij/lang/xpath/xslt/impl/references/ModeReference.java
plugins/xpath/xpath-view/src/org/intellij/plugins/xpathView/XPathEvalAction.java
xml/dom-impl/src/com/intellij/util/xml/impl/DomAnchorImpl.java
xml/dom-impl/src/com/intellij/util/xml/impl/DomFileElementImpl.java
xml/dom-impl/src/com/intellij/util/xml/impl/DomInvocationHandler.java
xml/dom-openapi/src/com/intellij/util/xml/highlighting/DomElementsInspection.java
xml/dom-openapi/src/com/intellij/util/xml/model/impl/BaseDomModelFactory.java
xml/impl/src/com/intellij/codeInsight/completion/XmlCompletionData.java
xml/impl/src/com/intellij/psi/CompositeLanguageFileViewProvider.java
xml/impl/src/com/intellij/psi/impl/source/parsing/xml/OldXmlParsing.java
xml/impl/src/com/intellij/psi/impl/source/xml/XmlEntityDeclImpl.java
xml/impl/src/com/intellij/psi/impl/source/xml/XmlEntityRefImpl.java
xml/impl/src/com/intellij/xml/impl/ExternalDocumentValidator.java

index ffaa5d227fcd2bc24aa37c5ba35c8700d5e96fe6..a807bd59f126a13454f71a1813c0e0efca1a57d6 100644 (file)
@@ -57,7 +57,7 @@ public class MemberInfoExternalizer {
     else if (tag == FIELD_INFO_TAG) {
       return new FieldInfo(in);
     }
-    LOG.assertTrue(false, "Unknown member info");
+    LOG.error("Unknown member info");
     return null;
   }
 
@@ -69,7 +69,7 @@ public class MemberInfoExternalizer {
     else if (tag == MEMBER_REFERENCE_INFO_TAG) {
       return new MemberReferenceInfo(in);
     }
-    LOG.assertTrue(false, "Unknown declaration info tag: " + tag);
+    LOG.error("Unknown declaration info tag: " + tag);
     return null;
   }
 
@@ -108,7 +108,7 @@ public class MemberInfoExternalizer {
     else if (tag == ENUM_CONSTANT_VALUE_TAG) {
       return new EnumConstantValue(in);
     }
-    LOG.assertTrue(false, "Unknown constant value type " + tag);
+    LOG.error("Unknown constant value type " + tag);
     return null;
   }
 
@@ -120,7 +120,7 @@ public class MemberInfoExternalizer {
       out.writeByte(FIELD_INFO_TAG);
     }
     else {
-      LOG.assertTrue(false, "Unknown member info");
+      LOG.error("Unknown member info");
     }
     info.save(out);
   }
index 1aa0cda20e28331964b80aee57074544dde04ae4..c18d9ae801d7323d07bd997d104aabe695dc949e 100644 (file)
@@ -161,7 +161,7 @@ public class MethodInfo extends MemberInfo {
       String descriptor = symbolTable.getSymbol(getDescriptor());
       int endIndex = descriptor.indexOf(')');
       if (endIndex <= 0) {
-        LOG.assertTrue(false, "Corrupted method descriptor: "+descriptor);
+        LOG.error("Corrupted method descriptor: " + descriptor);
       }
       myParameterDescriptors = parseParameterDescriptors(descriptor.substring(1, endIndex));
     }
index c815ecde5e452e2f07d76391073c4e01d3d94b39..d85b28af44e85877b25ec9b32ee92ff361aeb715 100644 (file)
@@ -71,7 +71,7 @@ public class OneProjectItemCompileScope extends UserDataHolderBase implements Co
   public Module[] getAffectedModules() {
     final Module module = ModuleUtil.findModuleForFile(myFile, myProject);
     if (module == null) {
-      LOG.assertTrue(false, "Module is null for file " + myFile.getPresentableUrl());
+      LOG.error("Module is null for file " + myFile.getPresentableUrl());
       return Module.EMPTY_ARRAY;
     }
     return new Module[] {module};
index 1514175abc8895d81317815d21e335cbcce409c2..e2ce0fa640d71d3ceabec6ee3fcc59d39ad32f5b 100644 (file)
@@ -47,7 +47,7 @@ public class CacheUtils {
     String descriptor = symbolTable.getSymbol(methodDeclarationId.getDescriptor());
     int endIndex = descriptor.indexOf(')');
     if (endIndex <= 0) {
-      LOG.assertTrue(false, "Corrupted method descriptor: "+descriptor);
+      LOG.error("Corrupted method descriptor: " + descriptor);
     }
     return parseSignature(descriptor.substring(1, endIndex));
   }
index 3eb5aed1eeb04284391c2dcc194ff34f69bd3d80..cf50003bc0e4cb59aab6053ca4bdf9dd32c5edae 100644 (file)
@@ -97,7 +97,7 @@ public class Dependency {
         String descriptorStr = symbolTable.getSymbol(descriptor);
         int endIndex = descriptorStr.indexOf(')');
         if (endIndex <= 0) {
-          LOG.assertTrue(false, "Corrupted method descriptor: "+ descriptorStr);
+          LOG.error("Corrupted method descriptor: " + descriptorStr);
         }
         myParameterDescriptors = parseParameterDescriptors(descriptorStr.substring(1, endIndex));
       }
index 29c595abf30457b7ee5c7e29cea4410e36dcec7d..a93caa2aeb541a0230f7fd6ed69d061444472848 100644 (file)
@@ -39,7 +39,7 @@ public class DependencyCacheNavigator {
     int superQName = myCache.getSuperQualifiedName(classQName);
 
     if (classQName == superQName) {
-      LOG.assertTrue(false, "Superclass qualified name is the same as class' name: " + classQName);
+      LOG.error("Superclass qualified name is the same as class' name: " + classQName);
       return;
     }
 
@@ -70,7 +70,7 @@ public class DependencyCacheNavigator {
   public void walkSubClasses(int fromClassQName, ClassInfoProcessor processor) throws CacheCorruptedException {
     for (int subQName : myCache.getSubclasses(fromClassQName)) {
       if (fromClassQName == subQName) {
-        LOG.assertTrue(false, "Subclass qualified name is the same as class' name: " + fromClassQName);
+        LOG.error("Subclass qualified name is the same as class' name: " + fromClassQName);
         return;
       }
       if (subQName != Cache.UNKNOWN) {
index c05df216afbfa627ba6c2f9e5f6f15eaeb3d0b85..e9cd41bdbc0f0e4704dc490d02fd480ba38c98e5 100644 (file)
@@ -245,7 +245,7 @@ public abstract class DebugProcessImpl implements DebugProcess {
   @SuppressWarnings({"HardCodedStringLiteral"})
   protected void commitVM(VirtualMachine vm) {
     if (!isInInitialState()) {
-      LOG.assertTrue(false, "State is invalid " + myState.get());
+      LOG.error("State is invalid " + myState.get());
     }
     DebuggerManagerThreadImpl.assertIsManagerThread();
     myPositionManager = createPositionManager();
index f5e40da93aea3316f116dbde4c593c118ed512d1..6faffeba08138558329a9942884e5817095eae4d 100644 (file)
@@ -95,7 +95,7 @@ public class JVMNameUtil {
       buffer.append(getPrimitiveSignature(psiType.getCanonicalText()));
     }
     else {
-      LOG.assertTrue(false, "unknown type " + type.getCanonicalText());
+      LOG.error("unknown type " + type.getCanonicalText());
     }
   }
 
index 8b8813ebe377f40aee3a5150083ac562784a50e1..1c0134e06326bb598abe42a6a690026dcecd3686 100644 (file)
@@ -215,12 +215,12 @@ public class PositionManagerImpl implements PositionManager {
         if(PsiUtil.isLocalOrAnonymousClass(psiClass)) {
           final PsiClass parentNonLocal = JVMNameUtil.getTopLevelParentClass(psiClass);
           if(parentNonLocal == null) {
-            LOG.assertTrue(false, "Local or anonymous class has no non-local parent");
+            LOG.error("Local or anonymous class has no non-local parent");
             return Collections.emptyList();
           }
           final String parentClassName = JVMNameUtil.getNonAnonymousClassName(parentNonLocal);
           if(parentClassName == null) {
-            LOG.assertTrue(false, "The name of a parent of a local (anonymous) class is null");
+            LOG.error("The name of a parent of a local (anonymous) class is null");
             return Collections.emptyList();
           }
           final List<ReferenceType> outers = myDebugProcess.getVirtualMachineProxy().classesByName(parentClassName);
index 6acf537430c9cec94194438d44031af7f1f0a1a6..6d5c2b3ae38279a0c207fb64a2c555b7717d72c5 100644 (file)
@@ -120,7 +120,7 @@ public class SuspendManagerImpl implements SuspendManager {
         if (thread != null) { // check that thread is suspended at the moment
           try {
             if (!thread.isSuspended()) {
-              LOG.assertTrue(false, "Context thread must be suspended");
+              LOG.error("Context thread must be suspended");
             }
           }
           catch (ObjectCollectedException ignored) {}
index 5fb1e8b2823a2ccec96c8247d9289c3adb60165e..6572d44e25709e41167493b04c5c583904063610 100644 (file)
@@ -86,7 +86,7 @@ public class CodeFragmentEvaluator extends BlockStatementEvaluator{
       return vm.mirrorOf((String)value);
     }
     else {
-      LOG.assertTrue(false, "unknown default initializer type " + value.getClass().getName());
+      LOG.error("unknown default initializer type " + value.getClass().getName());
       return null;
     }
   }
index b041959ed403e0159c0aed610fd2e9bfa99ebaf1..6848a3f3450b5ae150da5b29c37d318580697236 100644 (file)
@@ -129,7 +129,7 @@ public abstract class InvokeThread<E extends PrioritizedTask> {
         }
 
         if(getCurrentRequest() != current) {
-          LOG.assertTrue(false, "Expected " + current + " instead of " + getCurrentRequest());
+          LOG.error("Expected " + current + " instead of " + getCurrentRequest());
         }
 
         processEvent(myEvents.get());
index bb89a974ac0eb0b6ea0fe15aadf6d2203985abee..f744512122e833cc5f89c97e8323d31f02ae4451 100644 (file)
@@ -266,7 +266,7 @@ public class DebuggerTreeNodeExpression {
       return ((ValueDescriptorImpl)node.getDescriptor()).getTreeEvaluation(node, context);
     }
     else {
-      LOG.assertTrue(false, node.getDescriptor() != null ? node.getDescriptor().getClass().getName() : "null");
+      LOG.error(node.getDescriptor() != null ? node.getDescriptor().getClass().getName() : "null");
       return null;
     }
   }
index 575f1260d37e4a81faddebea54af386ce3c528c8..9596b397b2223e2c87f984e393305ec4cd1bf658 100644 (file)
@@ -138,7 +138,7 @@ public class NodeDescriptorFactoryImpl implements NodeDescriptorFactory {
     final DescriptorData<FieldDescriptorImpl> descriptorData;
     if (objRef == null ) {
       if (!field.isStatic()) {
-        LOG.assertTrue(false, "Object reference is null for non-static field: " + field);
+        LOG.error("Object reference is null for non-static field: " + field);
       }
       descriptorData = new StaticFieldData(field);
     }
index d165861a020c40d03075d30bde8a7b1b628bcfea..88c56e8ca7708083d85182814ce8bf5d122afa1f 100644 (file)
@@ -102,10 +102,8 @@ public class CompileStepBeforeRun extends BeforeRunTaskProvider<CompileStepBefor
             if (modules.length > 0) {
               for (Module module : modules) {
                 if (module == null) {
-                  LOG.assertTrue(
-                    false,
-                    "RunConfiguration should not return null modules. Configuration=" + runConfiguration.getName() + "; class=" + runConfiguration.getClass().getName()
-                  );
+                  LOG.error("RunConfiguration should not return null modules. Configuration=" + runConfiguration.getName() + "; class=" +
+                            runConfiguration.getClass().getName());
                 }
               }
               scope = compilerManager.createModulesCompileScope(modules, true);
index 8d411dbd9bd9bcb124271c67237f29ab752dd7b1..f32438d59ee427799bd910059dec4ed8e0c4d670 100644 (file)
@@ -32,6 +32,7 @@ import com.intellij.openapi.ui.popup.JBPopupFactory;
 import com.intellij.openapi.util.IconLoader;
 import com.intellij.openapi.vfs.VirtualFile;
 import com.intellij.ui.RawCommandLineEditor;
+import com.intellij.util.ArrayUtil;
 
 import javax.swing.*;
 import java.awt.*;
@@ -152,7 +153,7 @@ public class CommonJavaParameters extends JPanel {
         final List<String> macros = new ArrayList<String>(PathMacros.getInstance().getUserMacroNames());
         macros.add("MODULE_DIR");
 
-        final JList list = new JList(macros.toArray(new String[macros.size()]));
+        final JList list = new JList(ArrayUtil.toStringArray(macros));
         final JBPopup popup = JBPopupFactory.getInstance().createListPopupBuilder(list).setItemChoosenCallback(new Runnable() {
           public void run() {
             final Object value = list.getSelectedValue();
index 3e57d38f4728aa9aab09601cec5a10212da522eb..9d04aa700dbdc01804db535820b89df68542264c 100644 (file)
@@ -18,8 +18,6 @@ package com.intellij.openapi.roots.ui.configuration;
 import com.intellij.ide.DataManager;
 import com.intellij.openapi.Disposable;
 import com.intellij.openapi.actionSystem.*;
-import com.intellij.openapi.application.ApplicationManager;
-import com.intellij.openapi.application.ModalityState;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.fileChooser.FileChooserDescriptor;
 import com.intellij.openapi.module.Module;
@@ -530,7 +528,7 @@ public class ClasspathPanel extends JPanel {
                 }
               }
             }
-            LOG.assertTrue(false, "Unknown library " + item);
+            LOG.error("Unknown library " + item);
             return null;
           }
 
@@ -549,7 +547,7 @@ public class ClasspathPanel extends JPanel {
                 }
               }
             }
-            LOG.assertTrue(false, "Unknown library " + item);
+            LOG.error("Unknown library " + item);
             return null;
           }
 
@@ -886,7 +884,7 @@ public class ClasspathPanel extends JPanel {
       if (columnIndex == ITEM_COLUMN) {
         return item;
       }
-      LOG.assertTrue(false, "Incorrect column index: " + columnIndex);
+      LOG.error("Incorrect column index: " + columnIndex);
       return null;
     }
 
index 54386314ffa90777c26203c8836559e65a11cd00..99c2c8efebd677b2e37b50208516dbfb21baf96b 100644 (file)
@@ -56,7 +56,7 @@ public class LibraryChooserElement {
     myLibrary = library;
     myOrderEntry = orderEntry;
     if (myLibrary == null && myOrderEntry == null) {
-      LOG.assertTrue(false, "Both library and order entry are null");
+      LOG.error("Both library and order entry are null");
       myName = ProjectBundle.message("module.libraries.unknown.item");
     }
     else {
index 3b7c3a3ad4d931f1603fa2bfb67b5ef8c5f665ba..db8f14791cb183e40c1bd69898bba65b2b1934ad 100644 (file)
@@ -44,6 +44,7 @@ import com.intellij.ui.treeStructure.SimpleNode;
 import com.intellij.ui.treeStructure.SimpleTreeBuilder;
 import com.intellij.ui.treeStructure.SimpleTreeStructure;
 import com.intellij.ui.treeStructure.WeightBasedComparator;
+import com.intellij.util.ArrayUtil;
 import com.intellij.util.containers.ContainerUtil;
 import com.intellij.util.ui.tree.TreeUtil;
 import org.jetbrains.annotations.NonNls;
@@ -288,7 +289,7 @@ public class LayoutTreeComponent implements DnDTarget, Disposable {
     myBuilder.addSubtreeToUpdate(treeNode, new Runnable() {
       public void run() {
         List<PackagingElementNode<?>> nodes = myTree.findNodes(toSelect);
-        myBuilder.select(nodes.toArray(new Object[nodes.size()]), null);
+        myBuilder.select(ArrayUtil.toObjectArray(nodes), null);
       }
     });
   }
index 349016a15a2e8a8e7bc833fd66df0fc7352c3c20..7e1e8e653623533df4dce83e1f63aa87986bc21f 100644 (file)
@@ -27,6 +27,7 @@ import com.intellij.packaging.elements.PackagingElement;
 import com.intellij.packaging.ui.ArtifactEditorContext;
 import com.intellij.ui.SimpleTextAttributes;
 import com.intellij.ui.treeStructure.SimpleNode;
+import com.intellij.util.ArrayUtil;
 import com.intellij.util.SmartList;
 import com.intellij.util.StringBuilderSpinAllocator;
 import org.jetbrains.annotations.NotNull;
@@ -81,7 +82,7 @@ public class PackagingElementNode<E extends PackagingElement<?>> extends Artifac
 
   @Override
   public Object[] getEqualityObjects() {
-    return myPackagingElements.toArray(new Object[myPackagingElements.size()]);
+    return ArrayUtil.toObjectArray(myPackagingElements);
   }
 
   @Override
index 6c6c209a4d78596b925d3a051038eca13a64966f..d6d33237a64abaa929512ea445ce819c2ef6c793 100644 (file)
@@ -222,12 +222,11 @@ public class JavaCompletionContributor extends CompletionContributor {
 
             final Object[] variants = reference.getVariants();
             if (variants == null) {
-              LOG.assertTrue(false, "Reference=" + reference);
+              LOG.error("Reference=" + reference);
             }
             for (Object completion : variants) {
               if (completion == null) {
-                LOG.assertTrue(false, "Position=" + insertedElement + "\n;Reference=" + reference + "\n;variants=" + Arrays.toString(
-                  variants));
+                LOG.error("Position=" + insertedElement + "\n;Reference=" + reference + "\n;variants=" + Arrays.toString(variants));
               }
               if (completion instanceof LookupElement) {
                 result.addElement((LookupElement)completion);
index dabe31bccb7463591daf36afcaf2232ae84e0352..3f70ed37a9e4593d2cbe3429a54e9a06b63e1320 100644 (file)
@@ -26,6 +26,7 @@ import com.intellij.openapi.project.DumbService;
 import com.intellij.openapi.application.ApplicationManager;
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.psi.*;
+import com.intellij.util.ArrayUtil;
 import com.intellij.util.IncorrectOperationException;
 import org.jetbrains.annotations.Nullable;
 
@@ -238,7 +239,7 @@ public class CopyPasteReferenceProcessor implements CopyPastePostProcessor {
     }
     if (array.isEmpty()) return;
 
-    Object[] selectedObjects = array.toArray(new Object[array.size()]);
+    Object[] selectedObjects = ArrayUtil.toObjectArray(array);
     Arrays.sort(
       selectedObjects,
       new Comparator<Object>() {
index bdea5103dccd3e4c99ca370014e6d12604f9cb7c..a2455da108b28ce98e915305a0383235696a5d4e 100644 (file)
@@ -516,15 +516,8 @@ public class JavaFoldingBuilder extends FoldingBuilderEx implements DumbAware {
 
               final String baseClassName = quick ? anonymousClass.getBaseClassReference().getReferenceName() : anonymousClass.getBaseClassType().resolve().getName();
               if (lastLineEnd >= seq.length() || firstLineStart >= seq.length() || firstLineStart < 0) {
-                LOG.assertTrue(false, "llE=" +
-                                      lastLineEnd +
-                                      "; fLS=" +
-                                      firstLineStart +
-                                      "; len=" +
-                                      seq.length() +
-                                      "rE=" +
-                                      rangeEnd +
-                                      "; class=" + baseClassName);
+                LOG.error("llE=" + lastLineEnd + "; fLS=" + firstLineStart + "; len=" + seq.length() + "rE=" + rangeEnd + "; class=" +
+                          baseClassName);
               }
 
               final String params = StringUtil.join(method.getParameterList().getParameters(), new Function<PsiParameter, String>() {
index 8e5800d295c60657c98ec5bb041263a6bab64198..8028a96d4a084490f0b0a7b6bfeabfaab6270ad4 100644 (file)
@@ -46,7 +46,7 @@ public class JavaImplementationTextSelectioner implements ImplementationTextSele
         return element.getTextRange().getStartOffset();
       }
       else {
-        LOG.assertTrue(false, "Element should not be null: " + parent.getText());
+        LOG.error("Element should not be null: " + parent.getText());
         return parent.getTextRange().getStartOffset();
       }
     }
index 4e53c23a2c6d9fea3cfdcd28f6b714ef703743e9..aca3dff1c9d9c838873d5da6eb3551e97108e1bf 100644 (file)
@@ -137,7 +137,7 @@ public class LookupItemUtil{
     }
 
     if (s == null) {
-      LOG.assertTrue(false, "Null string for object: " + object + " of class " + (object != null ?object.getClass():null));
+      LOG.error("Null string for object: " + object + " of class " + (object != null ? object.getClass() : null));
     }
     if (object instanceof LookupValueWithTail) {
       item.setAttribute(LookupItem.TAIL_TEXT_ATTR, " " + ((LookupValueWithTail)object).getTailText());
index 6a99cc098da450552d8ea3b2b080f181a0626129..5144c7793908be0688ca6588aed6430ecfde7eee 100644 (file)
@@ -354,7 +354,7 @@ public class PsiJavaCodeReferenceElementImpl extends CompositePsiElement impleme
   public JavaResolveResult[] multiResolve(final boolean incompleteCode) {
     final PsiManagerEx manager = getManager();
     if (manager == null) {
-      LOG.assertTrue(false, "getManager() == null!");
+      LOG.error("getManager() == null!");
       return JavaResolveResult.EMPTY_ARRAY;
     }
 
@@ -400,7 +400,7 @@ public class PsiJavaCodeReferenceElementImpl extends CompositePsiElement impleme
           return JavaResolveResult.EMPTY_ARRAY;
         }
         else {
-          LOG.assertTrue(false, "Invalid java reference!");
+          LOG.error("Invalid java reference!");
           return JavaResolveResult.EMPTY_ARRAY;
         }
 
index d5439d0dce6fccdad7e13675c66de6663ba23fb4..42dfd622a4bf2d85340af946f8adf288033bd2c4 100644 (file)
@@ -331,7 +331,7 @@ public class JavadocParsing extends Parsing {
         LeafElement tokenElement = myParsing.createTokenElement(lexer);
         IElementType type = lexer.getTokenType();
         if (!TOKEN_FILTER.contains(type)) {
-          LOG.assertTrue(false, "Missed token should be space or asterisks:" + tokenElement);
+          LOG.error("Missed token should be space or asterisks:" + tokenElement);
           throw new RuntimeException();
         }
         if (last != null) {
index 1bc212c954c8eeedbb84f196a926b1c4eef88aa3..14b44609ccc5b323e6c7358468498a6e31617509 100644 (file)
@@ -436,7 +436,7 @@ public class JavaChangeUtilSupport implements TreeGenerator, TreeCopyHandler {
       }
     }
     else {
-      LOG.assertTrue(false, "Wrong element type: " + original.getElementType());
+      LOG.error("Wrong element type: " + original.getElementType());
     }
   }
 
index 8cb2b20f6a6f48580e61945407204f1727cacde5..deea549bc0d10f2475c4e9b18d64d55b37d8cc15 100644 (file)
@@ -284,7 +284,7 @@ public class PsiReferenceExpressionImpl extends ExpressionPsiElement implements
   public JavaResolveResult[] multiResolve(boolean incompleteCode) {
     final PsiManagerEx manager = getManager();
     if (manager == null) {
-      LOG.assertTrue(false, "getManager() == null!");
+      LOG.error("getManager() == null!");
       return null;
     }
     ResolveResult[] results = manager.getResolveCache().resolveWithCaching(this, OurGenericsResolver.INSTANCE, true, incompleteCode);
@@ -619,7 +619,7 @@ public class PsiReferenceExpressionImpl extends ExpressionPsiElement implements
     if (nameChild == null) {
       final TreeElement dot = (TreeElement)findChildByRole(ChildRole.DOT);
       if (dot == null) {
-        LOG.assertTrue(false, this);
+        LOG.error(toString());
       }
       return new TextRange(dot.getStartOffsetInParent() + dot.getTextLength(), getTextLength());
     }
index b18e8b8f0e1a78675bfa7b2bd98e7897e30e0038..f016798a5f6be3dbbd1358bae874ae30d292a2b0 100644 (file)
@@ -154,7 +154,7 @@ public class ReplaceExpressionUtil implements Constants {
       return 14;
     }
     else {
-      LOG.assertTrue(false, "Unknown element type:"+i);
+      LOG.error("Unknown element type:" + i);
       return -1;
     }
   }
index bae8d6c2d350002bc006b7f75903db3fc422fc07..22c5be988e64e7eb704a60d6569b775937dba5d0 100644 (file)
@@ -233,7 +233,7 @@ public class PsiScopesUtil {
             }
           }
           else{
-            LOG.assertTrue(false, "Unknown name element " + referenceNameElement + " in reference " + ref.getText() + "(" + ref + ")");
+            LOG.error("Unknown name element " + referenceNameElement + " in reference " + ref.getText() + "(" + ref + ")");
           }
         }
         else if (referenceNameElement instanceof PsiIdentifier){
@@ -243,7 +243,7 @@ public class PsiScopesUtil {
           resolveAndWalk(processor, ref, null);
         }
         else{
-          LOG.assertTrue(false, "Unknown name element " + referenceNameElement + " in reference " + ref.getText() + "(" + ref + ")");
+          LOG.error("Unknown name element " + referenceNameElement + " in reference " + ref.getText() + "(" + ref + ")");
         }
       }
       else{
index 3216086a31ca298e3a1375af4b969c841b5c5f7f..bccfa30c379f2fab813e5b9d9650a7049cad4677 100644 (file)
@@ -54,7 +54,7 @@ public abstract class IntroduceHandlerBase {
       invokeImpl(project, (PsiLocalVariable)tempExpr, editor);
     }
     else {
-      LOG.assertTrue(false, "elements[0] should be PsiExpression or PsiLocalVariable");
+      LOG.error("elements[0] should be PsiExpression or PsiLocalVariable");
     }
   }
 
index 6e8f0acb09b18f7da10ec2b5a1df1b2b4a09862f..510c5e1892c4f83083d4efab213d43682b883f31 100644 (file)
@@ -238,7 +238,7 @@ public class ChangeSignatureDialog extends RefactoringDialog {
       final PsiElementFactory factory = JavaPsiFacade.getInstance(myMethod.getProject()).getElementFactory();
       final PsiTypeElement typeElement = myMethod.getReturnTypeElement();
       if (typeElement == null) {
-        LOG.assertTrue(false, myMethod.getClass().getName());
+        LOG.error(myMethod.getClass().getName());
         return panel;
       }
       myReturnTypeCodeFragment = factory.createTypeCodeFragment(typeElement.getText(), myMethod.getParameterList(), true, true);
index eacc2e9fbc59ac61444899cd95b8fb2f4864a9ff..616ec7f5c32ecf05df9f380000e58c2bd72286ab 100644 (file)
@@ -52,7 +52,7 @@ public class MethodCallUsageInfo extends UsageInfo {
     else if (parent instanceof PsiAnonymousClass) {
       return ((PsiNewExpression)parent.getParent()).resolveConstructor();
     }
-    LOG.assertTrue(false, "Unknown reference");
+    LOG.error("Unknown reference");
 
     return null;
   }
index ffe10f406a718f7ddbc6affc4b9bd91cd4b0a8a3..23bd6406fdf575b6c691939cb68d760ea6b8f350 100644 (file)
@@ -281,7 +281,7 @@ public class ControlFlowWrapper {
         if (myFlowStart <= startOffset && endOffset <= myFlowEnd) continue;
       }
       else {
-        LOG.assertTrue(false, exitStatement);
+        LOG.error(String.valueOf(exitStatement));
         continue;
       }
 
index 8b8414794e191ee8d668a61b8123bc4998d63f9c..23a2b12cc3bcc295439372ed09794f8e8dec65db 100644 (file)
@@ -165,7 +165,7 @@ public class JavaNameSuggestionProvider implements NameSuggestionProvider {
           result.add(suggestProperlyCasedName(prefix, NameUtil.splitNameIntoWords(name)));
         }
         result.add(suggestProperlyCasedName(prefix, NameUtil.splitNameIntoWords(name.toLowerCase())));
-        return result.toArray(new String[result.size()]);
+        return ArrayUtil.toStringArray(result);
       }
 
     }
index dd0e4c62973d4fd5e8daa43b96bec75e1d423186..b5c4e74566c44ba5e474824da7b7f3aa5c2a75f6 100644 (file)
@@ -45,13 +45,8 @@ public abstract class PsiNamedElementAutomaticRenamer<T extends PsiNamedElement>
     String canonicalName = nameToCanonicalName(elementName, element);
     final String newCanonicalName = suggester.suggestName(canonicalName);
     if (newCanonicalName.length() == 0) {
-      LOG.assertTrue(false,
-          "oldName = " + getOldName() +
-              ", newName = " + getNewName() +
-              ", name = " + elementName +
-              ", canonicalName = " +  canonicalName +
-              ", newCanonicalName = " + newCanonicalName
-      );
+      LOG.error("oldName = " + getOldName() + ", newName = " + getNewName() + ", name = " + elementName + ", canonicalName = " +
+                canonicalName + ", newCanonicalName = " + newCanonicalName);
     }
     return canonicalNameToName(newCanonicalName, element);
   }
index 99f8f33fcfafca511408965b290460ba43c505b3..cc72b668299308953e952e42eab4b6d3693c8118 100644 (file)
@@ -186,7 +186,7 @@ public class ClassInstanceScanner extends DelegatingClassReferenceVisitor {
       visitor.visitReadUsage(expression, null, referencedElement);
     }
     else {
-      LOG.assertTrue(false, "Unknown variation of class instance usage");
+      LOG.error("Unknown variation of class instance usage");
     }
   }
 
index 2fe12089b83a42cb219717d46e8504d97c966aad..1362af5b7213f9dcbe7ead49e2a2b3f9670816fb 100644 (file)
@@ -44,7 +44,7 @@ public class ProgramRunnerUtil {
 
     String message = ExecutionBundle.message("error.running.configuration.with.error.error.message", runProfile != null? runProfile.getName() : "Run profile", e.getMessage());
     if (ApplicationManager.getApplication().isUnitTestMode()) {
-      LOG.assertTrue(false, message);
+      LOG.error(message);
     }
     else {
       if (message.contains("87") && e instanceof ProcessNotCreatedException) {
index 0892b7696ce9f944fc767edad91e827b3fcaa551..efd1e6381a122436b30b92fa0773f67d6727c9eb 100644 (file)
@@ -396,7 +396,7 @@ public class CodeCompletionHandlerBase implements CodeInsightActionHandler {
     if (fileCopy == null) {
       PsiElement elementAfterCommit = findElementAt(hostFile, hostStartOffset);
       if (wasInjected) {
-        LOG.assertTrue(false, "No injected fragmnent found at offset " + hostStartOffset + " in the patched file copy, found: " + elementAfterCommit);
+        LOG.error("No injected fragmnent found at offset " + hostStartOffset + " in the patched file copy, found: " + elementAfterCommit);
       }
       fileCopy = elementAfterCommit == null ? oldFileCopy : elementAfterCommit.getContainingFile();
     }
@@ -420,11 +420,8 @@ public class CodeCompletionHandlerBase implements CodeInsightActionHandler {
           final String allDoc = hostFile.getViewProvider().getDocument().getText();
           String docText = allDoc.substring(Math.max(0, context.getStartOffset() - 10), Math.min(allDoc.length(), context.getStartOffset() + 10));
 
-          LOG.assertTrue(false, "offset " + newContext.getStartOffset() + " at:\n" +
-                                "text=\"" + injectedFile.getText() + "\"\n" +
-                                "instance=" + injectedFile + "\n" +
-                                "patcher=" + patcher + "\n" +
-                                "docText=" + docText);
+          LOG.error("offset " + newContext.getStartOffset() + " at:\n" + "text=\"" + injectedFile.getText() + "\"\n" + "instance=" +
+                    injectedFile + "\n" + "patcher=" + patcher + "\n" + "docText=" + docText);
         }
         EditorFactory.getInstance().releaseEditor(editor);
         return Pair.create(newContext, element);
@@ -433,7 +430,7 @@ public class CodeCompletionHandlerBase implements CodeInsightActionHandler {
     }
     PsiElement element = findElementAt(fileCopy, context.getStartOffset());
     if (element == null) {
-      LOG.assertTrue(false, "offset " + context.getStartOffset() + " at:\ntext=\"" + fileCopy.getText() + "\"\ninstance=" + fileCopy);
+      LOG.error("offset " + context.getStartOffset() + " at:\ntext=\"" + fileCopy.getText() + "\"\ninstance=" + fileCopy);
     }
     return Pair.create(context, element);
   }
@@ -463,7 +460,7 @@ public class CodeCompletionHandlerBase implements CodeInsightActionHandler {
     Project project = context.project;
     Editor editor = context.editor;
     if (!ApplicationManager.getApplication().isUnitTestMode() && context.editor.getComponent().getRootPane() == null) {
-      LOG.assertTrue(false, "null root pane");
+      LOG.error("null root pane");
     }
 
     for (final CompletionContributor contributor : CompletionContributor.forParameters(parameters)) {
index 7f234341b844894dec2e340ca802d0ce8c0017db..58257600360f9ac1e68224aec4afe880ea6eb7da 100644 (file)
@@ -248,7 +248,7 @@ public class CompletionData {
       s = ((PresentableLookupValue)object).getPresentation();
     }
     else {
-      LOG.assertTrue(false, "Null string for object: " + object + " of class " + (object != null ?object.getClass():null));
+      LOG.error("Null string for object: " + object + " of class " + (object != null ? object.getClass() : null));
     }
 
     LookupItem item = new LookupItem(object, s);
@@ -311,7 +311,7 @@ public class CompletionData {
 
       for (Object completion : completions) {
         if (completion == null) {
-          LOG.assertTrue(false, "Position=" + position + "\n;Reference=" + reference + "\n;variants=" + Arrays.toString(completions));
+          LOG.error("Position=" + position + "\n;Reference=" + reference + "\n;variants=" + Arrays.toString(completions));
         }
         if (completion instanceof PsiElement) {
           final PsiElement psiElement = (PsiElement)completion;
index a667dd956f435e95ff4f58da970bc50997087a5c..8f1cd78588a9ef0a17d840243d406598c6631133 100644 (file)
@@ -181,7 +181,7 @@ public class DocumentFoldingInfo implements JDOMExternalizable, CodeFoldingState
         PsiElement restoredElement = FoldingPolicy.restoreBySignature(psiElement.getContainingFile(), signature);
         if (!psiElement.equals(restoredElement)){
           restoredElement = FoldingPolicy.restoreBySignature(psiElement.getContainingFile(), signature);
-          LOG.assertTrue(false, "element:" + psiElement + ", signature:" + signature + ", file:" + psiElement.getContainingFile());
+          LOG.error("element:" + psiElement + ", signature:" + signature + ", file:" + psiElement.getContainingFile());
         }
 
         Element e = new Element(ELEMENT_TAG);
index b8d550e237dbf67df5b648a6229d3beadcde078b..51b3594a0fdad69937d758c6794dec552c188142 100644 (file)
@@ -243,7 +243,7 @@ public abstract class PsiElementBase extends ElementBase implements NavigatableP
   protected <T> T findNotNullChildByClass(Class<T> aClass) {
     final T child = findChildByClass(aClass);
     if (child == null) {
-      LOG.assertTrue(false, getText() + "\n parent=" + getParent().getText());
+      LOG.error(getText() + "\n parent=" + getParent().getText());
     }
     return child;
   }
index 69d744506b30bb003be063ea83995d89a6cf8ffd..a286f77354af220ceaf9a51d851ce13212b57ddf 100644 (file)
@@ -59,6 +59,7 @@ import com.intellij.usages.impl.NullUsage;
 import com.intellij.usages.impl.UsageNode;
 import com.intellij.usages.impl.UsageViewImpl;
 import com.intellij.usages.rules.UsageFilteringRuleProvider;
+import com.intellij.util.ArrayUtil;
 import com.intellij.util.Icons;
 import com.intellij.util.Processor;
 import com.intellij.util.messages.MessageBusConnection;
@@ -364,7 +365,7 @@ public class ShowUsagesAction extends AnAction {
       }
 
       protected Object[] getAllElements() {
-        return data.toArray(new Object[data.size()]);
+        return ArrayUtil.toObjectArray(data);
       }
 
       protected String getElementText(Object element) {
index 191f663966138c4c88f052bfecf0e5f18bb72600..6a9a22165cefc74da4bd539c4668a5d8c610d75a 100644 (file)
@@ -100,7 +100,7 @@ public class FavoritesTreeStructure extends ProjectTreeStructure {
       if (result.isEmpty()) {
         result.add(getEmptyScreen());
       }
-      return result.toArray(new Object[result.size()]);
+      return ArrayUtil.toObjectArray(result);
     }
     catch (Exception e) {
     }
index adf7c33ace82016da402cc952293a981d0e5fe30..e2341a1be15a5bbe7dd774d3931cf0f7881b831c 100644 (file)
@@ -223,7 +223,7 @@ public class ProjectViewDirectoryHelper {
         }
       }
       else {
-        LOG.assertTrue(false, "Either PsiFile or PsiDirectory expected as a child of " + child.getParent() + ", but was " + child);
+        LOG.error("Either PsiFile or PsiDirectory expected as a child of " + child.getParent() + ", but was " + child);
       }
     }
   }
index eccbbbf3ce533a67778c2dba3c3da09d77c44bd5..f7260d85a6c6d8ea082491e3e66b870adfc4d455 100644 (file)
@@ -218,7 +218,7 @@ public class ContentEntryImpl extends RootModelComponentBase implements ContentE
     final String rootUrl = getUrl();
     try {
       if (!FileUtil.isAncestor(new File(rootUrl), new File(url), false)) {
-        LOG.assertTrue(false, "The file " + url + " is not under content entry root " + rootUrl);
+        LOG.error("The file " + url + " is not under content entry root " + rootUrl);
       }
     }
     catch (IOException e) {
index 9276f2b051f49c092474604e5e49f72b8bc31075..84d0cf06351eb5f44e4dcd6cc09227cbc4bfd784 100644 (file)
@@ -42,10 +42,11 @@ public class FormattingDocumentModelImpl implements FormattingDocumentModel{
     Document document = getDocumentToBeUsedFor(file);
     if (document != null) {
       if (PsiDocumentManager.getInstance(file.getProject()).isUncommited(document)) {
-        LOG.assertTrue(false, "Document is uncommited");
+        LOG.error("Document is uncommited");
       }
       if (!document.getText().equals(file.getText())) {
-        LOG.assertTrue(false, "Document and psi file texts should be equal : \nDocument text:\n" + document.getText() + "\nFile text:\n" + file.getText());
+        LOG.error(
+          "Document and psi file texts should be equal : \nDocument text:\n" + document.getText() + "\nFile text:\n" + file.getText());
       }
       return new FormattingDocumentModelImpl(document, file);
     }
index 9153e01dc4d11a8fd99c125d403d13c29fbfc72f..b7dd5cc7ddbf6cd6532be3bc4dc02261e693c648 100644 (file)
@@ -312,7 +312,7 @@ public class FileManagerImpl implements FileManager {
 
     ApplicationManager.getApplication().assertReadAccessAllowed();
     if (!vFile.isValid()) {
-      LOG.assertTrue(false, "Invalid file: " + vFile);
+      LOG.error("Invalid file: " + vFile);
       return null;
     }
 
index fe97f81cca293b77edaaefb875d66583e80d9576..d8fd4fa9944020029f2da9f30e84ef04332e0469 100644 (file)
@@ -103,7 +103,7 @@ public class PsiSearchHelperImpl implements PsiSearchHelper {
         return todoPattern;
       }
     }
-    LOG.assertTrue(false, "Could not find matching TODO pattern for index pattern " + pattern.getPatternString());
+    LOG.error("Could not find matching TODO pattern for index pattern " + pattern.getPatternString());
     return null;
   }
 
index ce5583246b2d8a04729092eac856ffbeb78b0e92..3e1a0f9da35d035ce1182b7f8b57ec1a519606fa 100644 (file)
@@ -126,7 +126,7 @@ public class SmartPointerManagerImpl extends SmartPointerManager {
   @NotNull
   public <E extends PsiElement> SmartPsiElementPointer<E> createSmartPsiElementPointer(E element) {
     if (!element.isValid()) {
-      LOG.assertTrue(false, "Invalid element:" + element);
+      LOG.error("Invalid element:" + element);
     }
 
     PsiFile file = element.getContainingFile();
index 987edc4db8920bb7fa83c2fc88df1c51119334e7..155c9951d2c8e17823a1dc5959cda07a837d850e 100644 (file)
@@ -149,10 +149,10 @@ public class CodeStyleManagerImpl extends CodeStyleManager {
     final PsiElement start = findElementInTreeWithFormatterEnabled(file, startOffset);
     final PsiElement end = findElementInTreeWithFormatterEnabled(file, endOffset);
     if (start != null && !start.isValid()) {
-      LOG.assertTrue(false, "start=" + start + "; file=" + file);
+      LOG.error("start=" + start + "; file=" + file);
     }
     if (end != null && !end.isValid()) {
-      LOG.assertTrue(false, "end=" + start + "; end=" + file);
+      LOG.error("end=" + start + "; end=" + file);
     }
 
     boolean formatFromStart = startOffset == 0;
index 93342a6f88771b8ddad6b8d9b9893973d2567808..2a21662b0a992f0b6d0701b7a414ff00d7e17f80 100644 (file)
@@ -266,7 +266,7 @@ public class FileReferenceSet {
   private PsiFile getContainingFile() {
     PsiFile file = myElement.getContainingFile();
     if (file == null) {
-      LOG.assertTrue(false, "Invalid element: " + myElement);
+      LOG.error("Invalid element: " + myElement);
     }
 
     return file.getOriginalFile();
index cc2113e6182d2e1df5470f57004eac3074132b66..f99a11945d1d64fcd811b7b923576e39ed3bb474 100644 (file)
@@ -85,7 +85,7 @@ public class SharedImplUtil {
       if (tree instanceof FileElement) return ((FileElement)tree).getCharTable();
       tree = tree.getTreeParent();
     }
-    LOG.assertTrue(false, "Invalid root element");
+    LOG.error("Invalid root element");
     return null;
   }
 
index 1e9b71dbcc3a26b3dde4650e29abda8710cb441d..cb243e0c26b0afdd787071d6cf0ead6d9b665c60 100644 (file)
@@ -156,11 +156,11 @@ public class TemplateDataElementType extends IFileElementType implements ITempla
     final CharSequence buffer = lexer.getBufferSequence();
     final int tokenStart = lexer.getTokenStart();
     if (tokenStart < 0 || tokenStart > buffer.length()) {
-      LOG.assertTrue(false, "Invalid start: " + tokenStart + "; " + lexer);
+      LOG.error("Invalid start: " + tokenStart + "; " + lexer);
     }
     final int tokenEnd = lexer.getTokenEnd();
     if (tokenEnd < 0 || tokenEnd > buffer.length()) {
-      LOG.assertTrue(false, "Invalid end: " + tokenEnd + "; " + lexer);
+      LOG.error("Invalid end: " + tokenEnd + "; " + lexer);
     }
 
     return new OuterLanguageElementImpl(outerElementType, table.intern(buffer, tokenStart, tokenEnd));
index 9d3994f7bcad7891dfdecf40d3943e8c8df0f8c7..65a64ab876c1c311dc20a0ab086530604bcd19e5 100644 (file)
@@ -26,6 +26,7 @@ import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.refactoring.RefactoringBundle;
 import com.intellij.refactoring.lang.TitledHandler;
 import com.intellij.refactoring.util.RadioUpDownListener;
+import com.intellij.util.ArrayUtil;
 import com.intellij.util.containers.HashSet;
 import org.jetbrains.annotations.Nullable;
 
@@ -80,7 +81,7 @@ public class RenameHandlerRegistry {
     }
     if (availableHandlers.size() == 1) return availableHandlers.values().iterator().next();
     if (availableHandlers.size() > 1) {
-      final String[] strings = availableHandlers.keySet().toArray(new String[availableHandlers.keySet().size()]);
+      final String[] strings = ArrayUtil.toStringArray(availableHandlers.keySet());
       final HandlersChooser chooser = new HandlersChooser(PlatformDataKeys.PROJECT.getData(dataContext), strings);
       chooser.show();
       if (chooser.isOK()) {
index 7f1519cd2e7e32a3797817fdd08e41ce0bcfc992..655afe2866c6c47e489f208552a1d8a0262046f0 100644 (file)
@@ -99,13 +99,8 @@ public abstract class AutomaticRenamer {
         String canonicalName = nameToCanonicalName(name, element);
         final String newCanonicalName = suggester.suggestName(canonicalName);
         if (newCanonicalName.length() == 0) {
-          LOG.assertTrue(false,
-                         "oldClassName = " + oldClassName +
-                         ", newClassName = " + newClassName +
-                         ", name = " + name +
-                         ", canonicalName = " +  canonicalName +
-                         ", newCanonicalName = " + newCanonicalName
-                         );
+          LOG.error("oldClassName = " + oldClassName + ", newClassName = " + newClassName + ", name = " + name + ", canonicalName = " +
+                    canonicalName + ", newCanonicalName = " + newCanonicalName);
         }
         String newName = canonicalNameToName(newCanonicalName, element);
         if (!newName.equals(name)) {
index 0abd6dd647e2ebdddf8e6385163ae5962f94041c..591c574816143d6fdaebd37356194998b8d79e6c 100644 (file)
@@ -184,8 +184,8 @@ public class NameSuggester {
           final int propertyWordFirst = matches.get(first);
 
           if (first >= myOldClassName.length || last >= myOldClassName.length) {
-            LOG.assertTrue(false, "old class name = " + myOldClassNameAsGiven + ", new class name = " + myNewClassNameAsGiven +
-                                  ", propertyWords = " + Arrays.asList(propertyWords).toString());
+            LOG.error("old class name = " + myOldClassNameAsGiven + ", new class name = " + myNewClassNameAsGiven + ", propertyWords = " +
+                      Arrays.asList(propertyWords).toString());
           }
 
           final String replacement = suggestReplacement(propertyWords[propertyWordFirst], newString);
index 9c8e83fffee45dcf520ac8eb5725acac7bfb8fe2..e7cb96652371d9f785fa2ba4653e701edb8c0597 100644 (file)
@@ -58,7 +58,7 @@ public abstract class ProcessHandler extends UserDataHolderBase {
       myEventMulticaster.startNotified(new ProcessEvent(this));
     }
     else {
-      LOG.assertTrue(false, "startNotify called already");
+      LOG.error("startNotify called already");
     }
   }
 
index 4ba1aef918a9076679546b8653f6bc5c08493c12..ea08b49757b8a90e5d4382c8bfc41bf4b7713d39 100644 (file)
@@ -470,7 +470,7 @@ public class PluginManager {
 
       final ClassLoader loader = pluginDescriptor.getPluginClassLoader();
       if (loader == null) {
-        getLogger().assertTrue(false, "Plugin class loader should be initialized for plugin " + id);
+        getLogger().error("Plugin class loader should be initialized for plugin " + id);
       }
       classLoaders.add(loader);
     }
index 89624b54605a23e6009857e2c7b85ebc2a5b3cc9..9493ea3539c9bcf5b21cfe0284b6f606ae51542d 100644 (file)
@@ -53,7 +53,7 @@ public class TreeBuilderUtil {
       final Object userObject = childNode.getUserObject();
       if (tree.isPathSelected(path)) {
         if (!(userObject instanceof NodeDescriptor)) {
-          LOG.assertTrue(false, "Node: " + childNode + "; userObject: " + userObject + " of class " + userObject.getClass());
+          LOG.error("Node: " + childNode + "; userObject: " + userObject + " of class " + userObject.getClass());
         }
         selectionPaths.add(storeElementsOnly ? ((NodeDescriptor)userObject).getElement() : path);
       }
index eb9b280b865eb884924c9fcbe36e1167580e85b4..1f9112f016dec496d92ceb5ab3c61f95c3d69ad4 100644 (file)
@@ -68,7 +68,7 @@ public class CompositeAppearance implements ModifiableCellAppearance {
       for (Iterator<TextSection> iterator = mySections.iterator(); iterator.hasNext();) {
         TextSection textSection = iterator.next();
         if (textSection == null) {
-          LOG.assertTrue(false, "index: " + index + " size: " + mySections.size());
+          LOG.error("index: " + index + " size: " + mySections.size());
           iterator.remove();
         }
       }
index dc3c86baac342a54722cdea77645e3949161b037..66a38046314340ee474da63dad9743ed15290a68 100644 (file)
@@ -268,7 +268,7 @@ public class ListUtil {
     if (model instanceof FilteringListModel) return FILTERED_MODEL;
 
     if (model == null) LOG.assertTrue(false);
-    else LOG.assertTrue(false, "Unknown model class: " + model.getClass().getName());
+    else LOG.error("Unknown model class: " + model.getClass().getName());
     return null;
   }
 
index 59a0643d45ee17e2249c0228de81c01d65e593c6..f58b24c6e381aad373d27ed65e52755cd6e8c1ad 100644 (file)
@@ -101,8 +101,7 @@ public abstract class BaseTableView extends Table {
       final int modelIndex = column.getModelIndex();
       storage.put(orderPropertyName(i), String.valueOf(modelIndex));
       if (storedColumns[modelIndex]) {
-        LOG.assertTrue(false,
-                       "columnCount: " + columnCount + " current: " + i + " modelINdex: " + modelIndex);
+        LOG.error("columnCount: " + columnCount + " current: " + i + " modelINdex: " + modelIndex);
       }
       storedColumns[modelIndex] = true;
     }
@@ -160,7 +159,7 @@ public abstract class BaseTableView extends Table {
     for (int i = 0; i < model.getColumnCount(); i++)
       if (model.getColumn(i).getModelIndex() == index)
         return i;
-    LOG.assertTrue(false, "Total: " + model.getColumnCount() + " index: "+ index);
+    LOG.error("Total: " + model.getColumnCount() + " index: " + index);
     return index;
   }
 }
index 4ad3015d48fe1d703153d6db4f56fffd77f3cf81..6f66e323ef014b00127f262169a287c6a7c7a259 100644 (file)
@@ -234,7 +234,7 @@ public class IdeEventQueue extends EventQueue {
     synchronized (myLock) {
       final boolean wasRemoved = myIdleListeners.remove(runnable);
       if (!wasRemoved) {
-        LOG.assertTrue(false, "unknown runnable: " + runnable);
+        LOG.error("unknown runnable: " + runnable);
       }
       final MyFireIdleRequest request = myListener2Request.remove(runnable);
       LOG.assertTrue(request != null);
@@ -260,7 +260,7 @@ public class IdeEventQueue extends EventQueue {
     synchronized (myLock) {
       final boolean wasRemoved = myActivityListeners.remove(runnable);
       if (!wasRemoved) {
-        LOG.assertTrue(false, "unknown runnable: " + runnable);
+        LOG.error("unknown runnable: " + runnable);
       }
     }
   }
index 775f44ab6b833caebdcf9f8f4c8d998a77b14287..649f6708c328137f6a5e0bb956b19a0dfa97f7ed 100644 (file)
@@ -290,8 +290,8 @@ public class DataManagerImpl extends DataManager implements ApplicationComponent
             myEventCount + "; current event count = " + currentEventCount
         );
         */
-        LOG.assertTrue(false, "cannot share data context between Swing events; initial event count = " + myEventCount +
-                              "; current event count = " + currentEventCount);
+        LOG.error("cannot share data context between Swing events; initial event count = " + myEventCount + "; current event count = " +
+                  currentEventCount);
       }
 
       Component _component = myRef.get();
index a2e4e3f4062f4bf0cdb0acb458d4e8469ba938eb..c2b0462573abf903129665376db2a97ec5e5c20a 100644 (file)
@@ -85,8 +85,8 @@ public abstract class DataValidator<T> {
     public T[] findInvalid(final String dataId, T[] array, final Object dataSource) {
       for (T element : array) {
         if (element == null) {
-          LOG.assertTrue(false, "Data isn't valid. " + dataId + "=null Provided by: " + dataSource.getClass().getName() +
-                                " (" + dataSource.toString() + ")");
+          LOG.error(
+            "Data isn't valid. " + dataId + "=null Provided by: " + dataSource.getClass().getName() + " (" + dataSource.toString() + ")");
         }
         T invalid = myElementValidator.findInvalid(dataId, element, dataSource);
         if (invalid != null) {
index 520db075c1ad0a43a5c4367725bf039512e9900d..0048b5fde244f9282fa9e7623f8baf10ae3988e1 100644 (file)
@@ -839,7 +839,7 @@ public final class ActionManagerImpl extends ActionManagerEx implements Applicat
 
   private static void assertActionIsGroupOrStub(final AnAction action) {
     if (!(action instanceof ActionGroup || action instanceof ActionStub)) {
-      LOG.assertTrue(false, "Action : "+action + "; class: "+action.getClass());
+      LOG.error("Action : " + action + "; class: " + action.getClass());
     }
   }
 
@@ -1147,7 +1147,7 @@ public final class ActionManagerImpl extends ActionManagerEx implements Applicat
     public void removeTimerListener(TimerListener listener){
       final boolean removed = myTimerListeners.remove(listener);
       if (!removed) {
-        LOG.assertTrue(false, "Unknown listener " + listener);
+        LOG.error("Unknown listener " + listener);
       }
     }
 
index 0f444fb37a8bd501412dd12d6809ee1f9ca7f5fa..6c537cb7bcbac0e9dc814ccc2b8ea6b856b3fa8e 100644 (file)
@@ -99,7 +99,7 @@ public class Utils{
       AnAction child = children[i];
       if (child == null) {
         String groupId = ActionManager.getInstance().getId(group);
-        LOG.assertTrue(false, "action is null: i=" + i + " group=" + group + " group id=" + groupId);
+        LOG.error("action is null: i=" + i + " group=" + group + " group id=" + groupId);
         continue;
       }
 
index f40da2a5825b9c9b524ce5fab3bead7f023671b2..341d3d3caf2408bad340332dd0890678ca520709 100644 (file)
@@ -348,7 +348,7 @@ abstract class ComponentStoreImpl implements IComponentStore {
   private static String getComponentName(@NotNull final PersistentStateComponent<?> persistentStateComponent) {
     final State stateSpec = getStateSpec(persistentStateComponent);
     if (stateSpec == null) {
-      LOG.assertTrue(false, "Null state spec for " + persistentStateComponent);
+      LOG.error("Null state spec for " + persistentStateComponent);
     }
     return stateSpec.name();
   }
index 24a24125fd6625c385347e9f75cb6a93d59e8858..eae0f578e829f37edcbe6698da686424a3a88764 100644 (file)
@@ -90,7 +90,7 @@ public class MergeList implements ChangeList.Parent, UserDataHolder {
             rightChanges.add(SimpleChange.fromRanges(ranges[1], new TextRange(rightTextLength, rightTextLength), mergeList.myChanges[1]));
             leftChanges.add(SimpleChange.fromRanges(ranges[1], new TextRange(leftTextLength, leftTextLength), mergeList.myChanges[0]));
           } else {
-            LOG.assertTrue(false, "Left Text: " + leftText + "\n" + "Right Text: " + rightText + "\nBase Text: " + baseText);
+            LOG.error("Left Text: " + leftText + "\n" + "Right Text: " + rightText + "\nBase Text: " + baseText);
           }
         } else {
           rightChanges.add(SimpleChange.fromRanges(ranges[1], ranges[2], mergeList.myChanges[1]));
@@ -98,7 +98,7 @@ public class MergeList implements ChangeList.Parent, UserDataHolder {
       }
       else if (ranges[2] == null) {
         if (ranges[0] == null) {
-          LOG.assertTrue(false, "Left Text: " + leftText + "\n" + "Right Text: " + rightText + "\nBase Text: " + baseText);
+          LOG.error("Left Text: " + leftText + "\n" + "Right Text: " + rightText + "\nBase Text: " + baseText);
         }
         leftChanges.add(SimpleChange.fromRanges(ranges[1], ranges[0], mergeList.myChanges[0]));
       }
index edcac10b3e3b4abcbbea72f30c52ae19c0454a7f..2a6a01c104147f56f1bc7eb4fa119bb2d57ad29b 100644 (file)
@@ -30,8 +30,7 @@ class PreferWholeLines implements DiffCorrection {
       DiffFragment nextFragment = fragments[i + 1];
       FragmentSide side = FragmentSide.chooseSide(fragment);
       if (nextFragment.isOneSide()) {
-        LOG.assertTrue(false,
-                       "<" + side.getText(fragment) + "> <" + side.getOtherText(nextFragment) + ">");
+        LOG.error("<" + side.getText(fragment) + "> <" + side.getOtherText(nextFragment) + ">");
       }
       if (StringUtil.startsWithChar(side.getText(fragment), '\n') &&
           StringUtil.startsWithChar(side.getText(nextFragment), '\n') &&
index 4c034522dac05915e676cd171e31ced9c547c88b..619ae78e7d40e9b2f437017ebcac248512203617 100644 (file)
@@ -125,7 +125,7 @@ public final class EditorHistoryManager extends AbstractProjectComponent impleme
     final FileEditor[] editors = editorsWithProviders.getFirst();
     final FileEditorProvider[] oldProviders = editorsWithProviders.getSecond();
     if (editors.length <= 0) {
-      LOG.assertTrue(false, "No editors for file " + file.getPresentableUrl());
+      LOG.error("No editors for file " + file.getPresentableUrl());
     }
     final FileEditor selectedEditor = editorManager.getSelectedEditor(file);
     LOG.assertTrue(selectedEditor != null);
index 0953b839cf6deda8c4139adc5700a135c956d823..3041414f2323c258ef277db0aa5af45725309456 100644 (file)
@@ -148,7 +148,7 @@ public final class EditorsSplitters extends JPanel {
       return res;
     }
     else {
-      LOG.assertTrue(false, comp != null ? comp.getClass().getName() : null);
+      LOG.error(comp != null ? comp.getClass().getName() : null);
       return null;
     }
   }
index bfd46bad00cc3ffdc355660108c1cadd379141f8..b2b1c86543bc64376850d55bb84facbe0ebd75f8 100644 (file)
@@ -308,7 +308,7 @@ public class DumbServiceImpl extends DumbService {
                     final IndexUpdateRunnable nextUpdateRunnable = myUpdatesQueue.pullFirst();
                     // run next action under already existing progress indicator
                     if (!myActionQueue.offer(new Ref<CacheUpdateRunner>(nextUpdateRunnable.myAction))) {
-                      LOG.assertTrue(false, "Action queue rejected next updateRunnable!");
+                      LOG.error("Action queue rejected next updateRunnable!");
                       nextUpdateRunnable.run();
                     }
                   }
index 5fce05c6b9198d27f23259e94bcdb904942df851..66d976010ac4cbe4e0198e3ff33bcac5d3d5acf6 100644 (file)
@@ -58,7 +58,7 @@ public class Win32Kernel {
       names.add(info.name);
     }
 
-    return names.toArray(new String[names.size()]);
+    return ArrayUtil.toStringArray(names);
   }
 
   public boolean exists(String path) {
index 1d701013e79c2157ebace5dfec487de5b0851033..5b320c544bede560469da4b5088dc1bdf5d51b98 100644 (file)
@@ -29,6 +29,7 @@ import com.intellij.openapi.fileTypes.FileType;
 import com.intellij.openapi.fileTypes.FileTypes;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.ui.TextComponentAccessor;
+import com.intellij.util.ArrayUtil;
 
 import javax.swing.*;
 import java.awt.*;
@@ -199,7 +200,7 @@ public class EditorComboBox extends JComboBox implements DocumentListener {
         objects.add(itemAt);
       }
     }
-    setModel(new DefaultComboBoxModel(objects.toArray(new Object[objects.size()])));
+    setModel(new DefaultComboBoxModel(ArrayUtil.toObjectArray(objects)));
   }
 
   private class MyEditor implements ComboBoxEditor {
index adffad01cf50933c05e5a1941d87811a5ce3fc8c..e70784de9bdb606e9bdbaa11e9c8bb650f0daf80 100644 (file)
@@ -171,8 +171,7 @@ public class PendingEventDispatcher <T extends EventListener> {
   private void dispatch(Method method, Object[] args) {
     assertDispatchThread();
     if(myCurrentDispatchMethod != null) {
-      LOG.assertTrue(false,
-                     "Event cannot be raised when dispatching another event is in progress. Dispatching " + myCurrentDispatchMethod.getName());
+      LOG.error("Event cannot be raised when dispatching another event is in progress. Dispatching " + myCurrentDispatchMethod.getName());
     }
 
     method.setAccessible(true);
index 7887db9c3c7c778bc74c660e922a36548f0ae5a4..9033ed9ea73181262aafde2021da529c36280054 100644 (file)
@@ -55,13 +55,16 @@ public class TestSuiteStack {
   @NotNull
   public SMTestProxy popSuite(final String suiteName) throws EmptyStackException {
     if (myStack.isEmpty()) {
-      LOG.assertTrue(false, "Pop error: Test runner tried to close test suite which has been already closed or wasn't started at all. Unexpected suite name [" + suiteName + "]");
+      LOG.error(
+        "Pop error: Test runner tried to close test suite which has been already closed or wasn't started at all. Unexpected suite name [" +
+        suiteName + "]");
       return null;
     }
     final SMTestProxy currentSuite = myStack.pop();
 
     if (!suiteName.equals(currentSuite.getName())) {
-      LOG.assertTrue(false, "Pop error: Unexpected closing suite. Expected [" + suiteName + "] but [" + currentSuite.getName() + "] was found. Rest of stack: " + getSuitePathPresentation());
+      LOG.error("Pop error: Unexpected closing suite. Expected [" + suiteName + "] but [" + currentSuite.getName() +
+                "] was found. Rest of stack: " + getSuitePathPresentation());
       return null;
     }
 
index 274dcba288010345821b6f9480d35c1bde972419..dfd0ba5b668586737c88722d67b9b2ac58131cf0 100644 (file)
@@ -136,7 +136,7 @@ public class StatisticsTableModel extends ListTableModel<SMTestProxy> {
 
   public void setValueAt(final Object aValue, final int rowIndex, final int columnIndex) {
     // Setting value is prevented!
-    LOG.assertTrue(false, "value: " + aValue + " row: " + rowIndex + " column: " + columnIndex);
+    LOG.error("value: " + aValue + " row: " + rowIndex + " column: " + columnIndex);
   }
 
   @Nullable
index e0c0b24009cfacdc577a2a59f0f773135df75214..800f286f6b6f8e633fef2fdefde4eb3d214162f4 100644 (file)
@@ -29,6 +29,7 @@ import com.intellij.openapi.util.Condition;
 import com.intellij.openapi.util.Disposer;
 import com.intellij.openapi.util.text.StringUtil;
 import com.intellij.util.Alarm;
+import com.intellij.util.ArrayUtil;
 import com.intellij.util.SystemProperties;
 import com.intellij.util.ui.UIUtil;
 import junit.framework.Assert;
@@ -230,7 +231,7 @@ public class PlatformTestUtil {
     if (comparator != null) {
       ArrayList<?> list = new ArrayList<Object>(Arrays.asList(children));
       Collections.sort(list, comparator);
-      children = list.toArray(new Object[list.size()]);
+      children = ArrayUtil.toObjectArray(list);
     }
     for (Object child : children) {
       currentLine = doPrint(buffer, currentLevel + 1, child, structure, comparator, maxRowCount, currentLine, paddingChar);
index 06ce759a280ff8c893d908812b45bdf55089c788..7d10f844cf4b119a084dc86e422a21a6b0dfbbc0 100644 (file)
@@ -84,8 +84,7 @@ public class UsageInfo2UsageAdapter implements UsageInModule, UsageInLibrary, Us
           myLineNumber = getLineNumber(document, startOffset);
 
           if (endOffset > document.getTextLength()) {
-            LOG.assertTrue(false,
-                           "Invalid usage info, psiElement:" + element + " end offset: " + endOffset + " psiFile: " + psiFile.getName());
+            LOG.error("Invalid usage info, psiElement:" + element + " end offset: " + endOffset + " psiFile: " + psiFile.getName());
           }
 
           myRangeMarkers.add(document.createRangeMarker(startOffset, endOffset));
index d0e72eff5b23f58d690f30ecd1bf28fda342cab3..1356eb6d20af92bc16f881a6954d938c6850f00d 100644 (file)
@@ -72,7 +72,7 @@ public class Util {
     String[] lines1 = splitByLines(fragment.getText1());
     String[] lines2 = splitByLines(fragment.getText2());
     if (lines1 != null && lines2 != null && lines1.length != lines2.length) {
-      LOG.assertTrue(false, "1:<" + fragment.getText1() + "> 2:<" + fragment.getText2() + ">");
+      LOG.error("1:<" + fragment.getText1() + "> 2:<" + fragment.getText2() + ">");
     }
     int length = lines1 == null ? lines2.length : lines1.length;
     DiffFragment[] lines = new DiffFragment[length];
index 8c8f973b120616823e51d8dcf130fb157881392b..879d4539fffce7d979f45d143882e326b4ab8329 100644 (file)
@@ -34,14 +34,15 @@ public class ArrayUtil {
   public static final byte[] EMPTY_BYTE_ARRAY = new byte[0];
   public static final int [] EMPTY_INT_ARRAY = new int[0];
   public static final boolean[] EMPTY_BOOLEAN_ARRAY = new boolean[0];
-  public static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];
-  public static final String[] EMPTY_STRING_ARRAY = new String[0];
-  public static final Class[] EMPTY_CLASS_ARRAY = new Class[0];
+  @SuppressWarnings({"SSBasedInspection"}) public static final Object[] EMPTY_OBJECT_ARRAY = new Object[0];
+  @SuppressWarnings({"SSBasedInspection"}) public static final String[] EMPTY_STRING_ARRAY = new String[0];
+  @SuppressWarnings({"SSBasedInspection"}) public static final Class[] EMPTY_CLASS_ARRAY = new Class[0];
   public static final long[] EMPTY_LONG_ARRAY = new long[0];
   public static final Collection[] EMPTY_COLLECTION_ARRAY = new Collection[0];
   public static final CharSequence EMPTY_CHAR_SEQUENCE = new CharArrayCharSequence(EMPTY_CHAR_ARRAY);
 
-  public static byte[] realloc (final byte [] array, final int newSize) {
+  @NotNull
+  public static byte[] realloc (@NotNull byte [] array, final int newSize) {
     if (newSize == 0) {
       return EMPTY_BYTE_ARRAY;
     }
@@ -56,7 +57,8 @@ public class ArrayUtil {
     return result;
   }
 
-  public static int[] realloc (final int [] array, final int newSize) {
+  @NotNull
+  public static int[] realloc (@NotNull int [] array, final int newSize) {
     if (newSize == 0) {
       return EMPTY_INT_ARRAY;
     }
@@ -71,13 +73,15 @@ public class ArrayUtil {
     return result;
   }
 
-  public static int[] append(int[] array, int value) {
+  @NotNull
+  public static int[] append(@NotNull int[] array, int value) {
     array = realloc(array, array.length + 1);
     array[array.length - 1] = value;
     return array;
   }
 
-  public static char[] realloc (final char[] array, final int newSize) {
+  @NotNull
+  public static char[] realloc (@NotNull char[] array, final int newSize) {
     if (newSize == 0) {
       return EMPTY_CHAR_ARRAY;
     }
@@ -117,7 +121,8 @@ public class ArrayUtil {
     return collection.toArray(new String[collection.size()]);
   }
 
-  public static <T> T[] mergeArrays(T[] a1, T[] a2, Class<T> aClass) {
+  @NotNull
+  public static <T> T[] mergeArrays(@NotNull T[] a1, @NotNull T[] a2, @NotNull Class<T> aClass) {
     if (a1.length == 0) {
       return a2;
     }
@@ -156,10 +161,12 @@ public class ArrayUtil {
    * @param src array to which the <code>element</code> should be appended.
    * @param element object to be appended to the end of <code>src</code> array.
    */
+  @NotNull
   public static <T> T[] append(@NotNull final T[] src,final T element){
     return append(src, element, (Class<T>)src.getClass().getComponentType());
   }
 
+  @NotNull
   public static <T> T[] append(@NotNull T[] src, final T element, @NotNull Class<T> componentType) {
     int length=src.length;
     T[] result=(T[])Array.newInstance(componentType, length+ 1);
index 394f67ac39f53232cef894b1651b8155f75721e9..0bff817da623cb2cb2b677bc006a3ea8325d2e38 100644 (file)
@@ -65,10 +65,8 @@ public class ReflectionUtil {
         final TypeVariable typeVariable = (TypeVariable)resolved;
         index = ArrayUtil.find(ReflectionCache.getTypeParameters(anInterface), typeVariable);
         if (index < 0) {
-          LOG.assertTrue(false, "Cannot resolve type variable:\n" +
-                              "typeVariable = " + typeVariable + "\n" +
-                              "genericDeclaration = " + declarationToString(typeVariable.getGenericDeclaration()) + "\n" +
-                              "searching in " + declarationToString(anInterface));
+          LOG.error("Cannot resolve type variable:\n" + "typeVariable = " + typeVariable + "\n" + "genericDeclaration = " +
+                    declarationToString(typeVariable.getGenericDeclaration()) + "\n" + "searching in " + declarationToString(anInterface));
         }
         final Type type = i < genericInterfaces.length ? genericInterfaces[i] : aClass.getGenericSuperclass();
         if (type instanceof Class) {
index ef5cc676d4929a512563867eb0e7e5054ec8942f..f82ca19646ec168cec6eef33800be1a054835a7e 100644 (file)
@@ -82,13 +82,13 @@ public final class VariableWidthIntArray implements Cloneable {
       case SHORT: return shortArray[index];
       case BYTE: return byteArray[index];
     }
-    LOG.assertTrue( false, "No array allocated" );
+    LOG.error("No array allocated");
     return 0;
   }
 
   public void put( int index, int value ) {
     if( value < minValue || value > maxValue ) {
-      LOG.assertTrue( false, "Value out of domain" );
+      LOG.error("Value out of domain");
     }
 
     switch( arrayType ) {
@@ -97,7 +97,7 @@ public final class VariableWidthIntArray implements Cloneable {
       case BYTE: byteArray[index] = (byte)value; return;
     }
 
-    LOG.assertTrue( false, "No array allocated" );
+    LOG.error("No array allocated");
   }
 
   public Object clone() throws CloneNotSupportedException {
@@ -118,7 +118,8 @@ public final class VariableWidthIntArray implements Cloneable {
       case INT: System.arraycopy( intArray, from, intArray, to, count ); break;
       case SHORT: System.arraycopy( shortArray, from, shortArray, to, count ); break;
       case BYTE: System.arraycopy( byteArray, from, byteArray, to, count ); break;
-      default: LOG.assertTrue( false, "Invalid array type" );
+      default:
+        LOG.error("Invalid array type");
     }
   }
 
index 2a7c8e6b9f789b105cbc9f7acd633687a87299db..e076e36327353662b5fd432598870fedc76d10ad 100644 (file)
@@ -18,6 +18,7 @@ package com.intellij.util.xmlb;
 
 import com.intellij.openapi.diagnostic.Logger;
 import com.intellij.openapi.util.JDOMUtil;
+import com.intellij.util.ArrayUtil;
 import org.jdom.Attribute;
 import org.jdom.Content;
 import org.jdom.Element;
@@ -87,7 +88,7 @@ class OptionTagBinding implements Binding {
       }
 
       if (children.size() > 0) {
-        Object value = myBinding.deserialize(accessor.read(o), children.toArray(new Object[children.size()]));
+        Object value = myBinding.deserialize(accessor.read(o), ArrayUtil.toObjectArray(children));
         accessor.write(o, value);
       }
       else {
index 61b699d9281fd3175e45ca79da4f451ad57d0114..7b67aef3f0f5d4b80693c0cc5463238b6faafc9f 100644 (file)
@@ -19,6 +19,7 @@ import com.intellij.openapi.help.HelpManager;
 import com.intellij.openapi.ui.DialogWrapper;
 import com.intellij.openapi.ui.MultiLineLabelUI;
 import com.intellij.openapi.vcs.VcsBundle;
+import com.intellij.util.ArrayUtil;
 import com.intellij.util.ui.UIUtil;
 
 import javax.swing.*;
@@ -113,7 +114,7 @@ public class StartUseVcsDialog extends DialogWrapper {
     keys.add("");
     keys.addAll(displayNames);
     Collections.sort(keys);
-    return keys.toArray(new Object[keys.size()]);
+    return ArrayUtil.toObjectArray(keys);
   }
 
   private static class VcsCombo extends JComboBox {
index 7cbd28e6314f5b029bcef99cc2815f405a293f68..acdee8ce201792ac4c4795819d34545697cbbecb 100644 (file)
@@ -44,9 +44,8 @@ public class VcsGroupsWrapper extends DefaultActionGroup {
                                                                          0));
       for (AnAction child : children) {
         if (!(child instanceof StandardVcsGroup)) {
-          LOG.assertTrue(false,
-                         "Any version control group should extends com.intellij.openapi.vcs.actions.StandardVcsGroup class. Groupd class: " +
-                         child.getClass().getName() + ", group ID: " + ActionManager.getInstance().getId(child));
+          LOG.error("Any version control group should extends com.intellij.openapi.vcs.actions.StandardVcsGroup class. Groupd class: " +
+                    child.getClass().getName() + ", group ID: " + ActionManager.getInstance().getId(child));
         }
         else {
           validChildren.add(child);
index 44c0946f3b13dd74af9b094f90a9a6db4555b569..f476453ee4b3ee5951de83c00622364640bb2026 100644 (file)
@@ -390,7 +390,7 @@ public class LineStatusTracker {
         myRanges.addAll(rangesAfterChange);
 
         if (myHighlighterCount != myRanges.size()) {
-          LOG.assertTrue(false, "Highlighters: " + myHighlighterCount + ", ranges: " + myRanges.size());
+          LOG.error("Highlighters: " + myHighlighterCount + ", ranges: " + myRanges.size());
         }
 
         myRanges = mergeRanges(myRanges);
@@ -401,7 +401,7 @@ public class LineStatusTracker {
         }
 
         if (myHighlighterCount != myRanges.size()) {
-          LOG.assertTrue(false, "Highlighters: " + myHighlighterCount + ", ranges: " + myRanges.size());
+          LOG.error("Highlighters: " + myHighlighterCount + ", ranges: " + myRanges.size());
         }
       }
 
index 2e341af967007dababb7d2d1a4e304a570fdcbdd..eba9acb089a33c8971969541dcf7c4dab4444f12 100644 (file)
@@ -53,7 +53,7 @@ public class Range {
     if ((change.deleted > 0) && (change.inserted > 0)) return MODIFIED;
     if ((change.deleted > 0)) return DELETED;
     if ((change.inserted > 0)) return INSERTED;
-    LOG.assertTrue(false, "Unknown change type");
+    LOG.error("Unknown change type");
     return 0;
   }
 
index 4a2be06fd5d3aa1a072593537dda0225682408b9..23129e1810c36d4450c6b58fd011de1de7c6ad60 100644 (file)
@@ -40,6 +40,7 @@ import com.intellij.openapi.project.Project;
 import com.intellij.openapi.util.registry.Registry;
 import com.intellij.ui.content.Content;
 import com.intellij.ui.content.tabs.PinToolwindowTabAction;
+import com.intellij.util.ArrayUtil;
 import com.intellij.xdebugger.XDebugProcess;
 import com.intellij.xdebugger.XDebugSession;
 import com.intellij.xdebugger.XDebuggerBundle;
@@ -132,7 +133,7 @@ public class XDebugSessionTab extends DebuggerLogConsoleManagerBase {
 
   public XDebugSessionData saveData() {
     final List<String> watchExpressions = myWatchesView.getWatchExpressions();
-    return new XDebugSessionData(watchExpressions.toArray(new String[watchExpressions.size()]));
+    return new XDebugSessionData(ArrayUtil.toStringArray(watchExpressions));
   }
 
   public ExecutionConsole getConsole() {
index 0856f6cd98f3b5e327c62e19b7662820b3358b1e..8682806dc338a094bfacc28f525a22d5e787d815 100644 (file)
@@ -99,7 +99,7 @@ public class TestDataNavigationHandler implements GutterIconNavigationHandler<Ps
     if (myFileNames.size() == 2) {
       shortNames.add(CREATE_MISSING_OPTION);
     }
-    final JList list = new JList(shortNames.toArray(new String[shortNames.size()]));
+    final JList list = new JList(ArrayUtil.toStringArray(shortNames));
     list.setCellRenderer(new ColoredListCellRenderer() {
       @Override
       protected void customizeCellRenderer(JList list, Object value, int index, boolean selected, boolean hasFocus) {
index 492a79a0561893bb6c450c8e8b1f4e39edea7fc8..6b2b629dde2b87bf015855004b04c70297c484a4 100644 (file)
@@ -45,7 +45,7 @@ final class OutputParser2 extends OutputParser implements PacketProcessor, Input
     SegmentReader reader = new SegmentReader(packet);
     int index = reader.readInt();
     if (myLastPacketIndex + 1 < index) {
-      LOG.assertTrue(false, "last: " + myLastPacketIndex + " current: " + index);
+      LOG.error("last: " + myLastPacketIndex + " current: " + index);
     }
     if (myLastPacketIndex + 1 > index) return;
     myLastPacketIndex++;
index bcfbce834253dfd08328c6b10fb97c869135ec99..5049c3356a37b4508e9bf3803dfc8b75ad4887c2 100644 (file)
@@ -64,7 +64,7 @@ final class AntExplorerTreeStructure extends AbstractTreeStructure {
     else if (element instanceof AntBuildTarget) {
       return new AntTargetNodeDescriptor(myProject, parentDescriptor, (AntBuildTargetBase)element);
     }
-    LOG.assertTrue(false, "Unknown element for this tree structure " + element);
+    LOG.error("Unknown element for this tree structure " + element);
     return null;
   }
 
index 827878244f3ebe0190c131cd19922b9849a32ba5..0ad0135e59915496c73a78bf5cfe993643ddc1bf 100644 (file)
@@ -104,7 +104,7 @@ public class AddFileOrDirectoryAction extends ActionOnSelectedElement {
     Collection<AddedFileInfo> roots = new CreateTreeOnFileList(filesToAdd,  project, includeAllRoots).getRoots();
 
     if (roots.size() == 0) {
-      LOG.assertTrue(false, filesToAdd);
+      LOG.error(filesToAdd.toString());
     }
 
     if (showDialog){
index a16592798c9c8dd6b723ab8224af591eece37af0..aeef0caf2a9b123a1b8135d2f1964e3c999ad13c 100644 (file)
@@ -113,9 +113,7 @@ public class IgnoreFileAction extends AnAction {
           VirtualFile cvsIgnoreFile = CvsVfsUtil.refreshAndfFindChild(parent, CvsUtil.CVS_IGNORE_FILE);
           if (cvsIgnoreFile == null) {
             String path = parent.getPath() + "/" + CvsUtil.CVS_IGNORE_FILE;
-            LOG.assertTrue(false,
-                           String.valueOf(CvsVfsUtil.findFileByPath(path)) + " " + parent.getPath() + " " +
-                           new File(VfsUtil.virtualToIoFile(parent), CvsUtil.CVS_IGNORE_FILE).isFile());
+            LOG.error(String.valueOf(CvsVfsUtil.findFileByPath(path)) + " " + parent.getPath() + " " + new File(VfsUtil.virtualToIoFile(parent), CvsUtil.CVS_IGNORE_FILE).isFile());
             return;
           }
 
index cdb94979508bbb6ac4c8523154fed176a345fa03..b807b713baafd12fec315766a1c796bc66af92d3 100644 (file)
@@ -147,7 +147,7 @@ public class CvsApplicationLevelConfiguration implements ApplicationComponent, J
       return result;
     }
     catch (Exception ex) {
-      LOG.assertTrue(false, "userHome = " + userHome + ", presenation = " + presentation);
+      LOG.error("userHome = " + userHome + ", presenation = " + presentation);
       return "";
     }
   }
index 62fe1b7dec692f04dc9e9239e4e6cb11d74835a7..dbea130210491f45e26105ab3e604a19e0f7a66f 100644 (file)
@@ -45,7 +45,7 @@ public class AddFileOperation extends CvsOperationOnFiles {
     List<AbstractFileObject> fileObjects = command.getFileObjects().getFileObjects();
     for (final AbstractFileObject fileObject: fileObjects) {
       if (fileObject.getParent() == null) {
-        LOG.assertTrue(false, "Local Root: " + getLocalRootFor(root) + ", Files: " + myFiles);
+        LOG.error("Local Root: " + getLocalRootFor(root) + ", Files: " + myFiles);
       }
     }
   }
index 32400daadd5be459cd02f9e7b0d148aa2c0c428c..b77014a997145bfd77477570e56a4eca2e2c8cf8 100644 (file)
@@ -118,7 +118,7 @@ public class AdminWriterOnCache implements IAdminWriter {
   }
 
   public void pruneDirectory(DirectoryObject directoryObject, ICvsFileSystem cvsFileSystem) {
-    LOG.assertTrue(false, "Cannot be called");
+    LOG.error("Cannot be called");
   }
 
   public void editFile(FileObject fileObject,
index 991226263ce06aee5581a5cbb565976abb7ae36b..8eb04a3477439317bdce371c6e1e1d7127ab3f45 100644 (file)
@@ -440,7 +440,7 @@ public class SSHMain {
       database.addHostkeys(knownHostFile);
     }
     final List<String> algorithms = myHost.getHostKeyAlgorithms();
-    c.setServerHostKeyAlgorithms(algorithms.toArray(new String[algorithms.size()]));
+    c.setServerHostKeyAlgorithms(ArrayUtil.toStringArray(algorithms));
   }
 
   /**
@@ -520,7 +520,7 @@ public class SSHMain {
         return rc;
       }
       else {
-        return result.toArray(new String[result.size()]);
+        return ArrayUtil.toStringArray(result);
       }
     }
   }
index 019dfba4f97772ca64117178d6e471511377733e..a312c60674a0e0f9ae7814bd8d77e829a23b9993 100644 (file)
@@ -68,7 +68,7 @@ public class GroovyParameterInfoHandler implements ParameterInfoHandler<GroovyPs
           methods.add(new GroovyResolveResultImpl(element, true));
         }
       }
-      return methods.toArray(new Object[methods.size()]);
+      return ArrayUtil.toObjectArray(methods);
     }
 
     return null;
@@ -143,7 +143,7 @@ public class GroovyParameterInfoHandler implements ParameterInfoHandler<GroovyPs
         return groovyResolveResult.getElement() instanceof PsiNamedElement;
       }
     });
-    context.setItemsToShow(namedElements.toArray(new Object[namedElements.size()]));
+    context.setItemsToShow(ArrayUtil.toObjectArray(namedElements));
     context.showHint(place, place.getTextRange().getStartOffset(), this);
   }
 
index 48447a9d028b526508e7735015bf9efdb1a2e632..8d526828c7fb394d070fc1f0465db96b8d363566 100644 (file)
@@ -19,6 +19,7 @@ package org.jetbrains.plugins.groovy.lang.psi.impl.auxiliary;
 import com.intellij.openapi.util.TextRange;
 import com.intellij.psi.PsiElement;
 import com.intellij.psi.PsiReference;
+import com.intellij.util.ArrayUtil;
 import com.intellij.util.IncorrectOperationException;
 import org.jetbrains.annotations.NotNull;
 import org.jetbrains.plugins.groovy.lang.psi.GroovyPsiElementFactory;
@@ -88,7 +89,7 @@ public class GrLabelReference implements PsiReference {
       }
       context = context.getContext();
     }
-    return result.toArray(new Object[result.size()]);
+    return ArrayUtil.toObjectArray(result);
   }
 
   public boolean isSoft() {
index ffbe24d8458be3ea2831704245e1d334bb058a7d..e08f6f53608053d89a0225390a49897c999824af 100644 (file)
@@ -94,12 +94,12 @@ public class CompleteReferenceExpression {
           variantList.add(variant);
         }
 
-        propertyVariants = variantList.toArray(new Object[variantList.size()]);
+        propertyVariants = ArrayUtil.toObjectArray(variantList);
       }
     }
 
     propertyVariants =
-      ArrayUtil.mergeArrays(propertyVariants, namedArgsVariants.toArray(new Object[namedArgsVariants.size()]), Object.class);
+      ArrayUtil.mergeArrays(propertyVariants, ArrayUtil.toObjectArray(namedArgsVariants), Object.class);
 
     if (refExpr.getKind() == GrReferenceExpressionImpl.Kind.TYPE_OR_PROPERTY) {
       ResolverProcessor classVariantsCollector = CompletionProcessor.createClassCompletionProcessor(refExpr);
index c89295c286b04eddf1bd8df80f8024cfd115fd8f..6c1d4ba60b90256f46ed2e12d3f83d3a5b441fda 100644 (file)
@@ -230,7 +230,7 @@ public class GrCodeReferenceElementImpl extends GrReferenceElementImpl implement
         result.add(variant);
       }
     }
-    return result.toArray(new Object[result.size()]);
+    return ArrayUtil.toObjectArray(result);
   }
 
   private Object[] getVariantsImpl(ReferenceKind kind) {
index 676a5d4fb41805ca9b29e11002c9658d1a525f3f..766a77d4e81f207ed2117e96c71db454e56df249 100644 (file)
@@ -33,7 +33,7 @@ public class InputObjectRegistry {
   public TestProxy getByKey(final String key) {
     final TestProxy result = myKnownObjects.get(key);
     if (result == null) {
-      LOG.assertTrue(false, "Unknwon key: " + key);
+      LOG.error("Unknwon key: " + key);
       LOG.info("Known keys:");
       final ArrayList<String> knownKeys = new ArrayList<String>(myKnownObjects.keySet());
       Collections.sort(knownKeys);
index 2a079c63aac25dcfe5ec78576d5d00915863aa4d..bb8eca3b22e2da77e8e4f4d981c90fde3858678d 100644 (file)
@@ -73,7 +73,7 @@ public class StatisticsTable extends ListTableModel {
   }
 
   public void setValueAt(final Object aValue, final int rowIndex, final int columnIndex) {
-    LOG.assertTrue(false, "value: " + aValue + " row: " + rowIndex + " column: " + columnIndex);
+    LOG.error("value: " + aValue + " row: " + rowIndex + " column: " + columnIndex);
   }
 
   public boolean isCellEditable(final int rowIndex, final int columnIndex) {
index 34eb8e1aec71aef503373ba5a0e2c89b0d3930e4..0bd0966ed6333d56c7a6b1b7f7f3716ea617e006 100644 (file)
@@ -312,7 +312,7 @@ public abstract class MavenArtifactCoordinatesConverter extends ResolvingConvert
     private String[] getGroupIdVariants(MavenProjectIndicesManager manager, MavenDomShortArtifactCoordinates coordinates) {
       if (DomUtil.hasXml(coordinates.getGroupId())) {
         Set<String> strings = manager.getGroupIds();
-        return strings.toArray(new String[strings.size()]);
+        return ArrayUtil.toStringArray(strings);
       }
       return MavenArtifactUtil.DEFAULT_GROUPS;
     }
index 71234c65b98f661b364863d79c183797d6b38f82..37ebc09c55596c506cd7b0195ebc4b360e04c9f3 100644 (file)
@@ -28,6 +28,7 @@ import com.intellij.psi.xml.XmlDocument;
 import com.intellij.psi.xml.XmlFile;
 import com.intellij.psi.xml.XmlTag;
 import com.intellij.psi.xml.XmlTagChild;
+import com.intellij.util.ArrayUtil;
 import com.intellij.util.Function;
 import com.intellij.util.Icons;
 import com.intellij.util.IncorrectOperationException;
@@ -199,7 +200,7 @@ public class MavenPropertyPsiReference extends MavenPsiReference {
   public Object[] getVariants() {
     List<Object> result = new ArrayList<Object>();
     collectVariants(result);
-    return result.toArray(new Object[result.size()]);
+    return ArrayUtil.toObjectArray(result);
   }
 
   protected void collectVariants(List<Object> result) {
index 479b6b701bd308e99125927fae2d36ac4541fe94..a9300721225b5a504898d589984f8d2842f5821c 100644 (file)
@@ -105,7 +105,7 @@ public abstract class PropertyReferenceBase implements PsiPolyVariantReference,
     else {*/
       ElementManipulator<PsiElement> manipulator = ElementManipulators.getManipulator(myElement);
       if (manipulator == null) {
-        LOG.assertTrue(false, "Cannot find manipulator for " + myElement + " of class " + myElement.getClass());
+        LOG.error("Cannot find manipulator for " + myElement + " of class " + myElement.getClass());
       }
       return manipulator.handleContentChange(myElement, getRangeInElement(), newElementName);
     /*}*/
index c48319cb8625417badba8500617a1595fc493c28..6d569fce7b67ebf00e535448c0aa7b3ce7fc2c3c 100644 (file)
@@ -18,6 +18,7 @@ package org.jetbrains.idea.svn.dialogs.browser;
 import com.intellij.openapi.project.Project;
 import com.intellij.openapi.ui.DialogWrapper;
 import com.intellij.openapi.vcs.VcsConfiguration;
+import com.intellij.util.ArrayUtil;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.Nullable;
 
@@ -92,7 +93,7 @@ public class DeleteOptionsDialog extends DialogWrapper {
     final ArrayList<String> messages = VcsConfiguration.getInstance(myProject).getRecentMessages();
     Collections.reverse(messages);
 
-    final String[] model = messages.toArray(new String[messages.size()]);
+    final String[] model = ArrayUtil.toStringArray(messages);
     final JComboBox messagesBox = new JComboBox(model);
     messagesBox.setRenderer(new MessageBoxCellRenderer());
     panel.add(messagesBox, gc);
index d16e78bb0d3e04e47eb41662763a436bc16b5acf..6de82420a5d8c72ef9690429685839346f0b0c80 100644 (file)
@@ -22,6 +22,7 @@ import com.intellij.openapi.ui.DialogWrapper;
 import com.intellij.openapi.ui.TextFieldWithBrowseButton;
 import com.intellij.openapi.vcs.VcsConfiguration;
 import com.intellij.openapi.vfs.VirtualFile;
+import com.intellij.util.ArrayUtil;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.Nullable;
 import org.jetbrains.idea.svn.DepthCombo;
@@ -165,7 +166,7 @@ public class ImportOptionsDialog extends DialogWrapper implements ActionListener
     final ArrayList<String> messages = VcsConfiguration.getInstance(myProject).getRecentMessages();
     Collections.reverse(messages);
 
-    final String[] model = messages.toArray(new String[messages.size()]);
+    final String[] model = ArrayUtil.toStringArray(messages);
     final JComboBox messagesBox = new JComboBox(model);
     messagesBox.setRenderer(new MessageBoxCellRenderer());
     panel.add(messagesBox, gc);
index 5f69a79898f1ae8cac5551da95009a6aca3e7950..0333d4f555e387e6b54856168d540a78a2cd486c 100644 (file)
@@ -19,6 +19,7 @@ import com.intellij.openapi.project.Project;
 import com.intellij.openapi.ui.DialogWrapper;
 import com.intellij.openapi.vcs.VcsConfiguration;
 import com.intellij.ui.DocumentAdapter;
+import com.intellij.util.ArrayUtil;
 import org.jetbrains.annotations.NonNls;
 import org.jetbrains.annotations.Nullable;
 import org.tmatesoft.svn.core.SVNException;
@@ -64,7 +65,7 @@ public class MkdirOptionsDialog extends DialogWrapper {
       final ArrayList<String> messages = VcsConfiguration.getInstance(project).getRecentMessages();
       Collections.reverse(messages);
 
-      final String[] model = messages.toArray(new String[messages.size()]);
+      final String[] model = ArrayUtil.toStringArray(messages);
       myMessagesBox.setModel(new DefaultComboBoxModel(model));
       myMessagesBox.setRenderer(new MessageBoxCellRenderer());
     }
index c66cae060f30fee06742f538fc300f4bbc6cc973..d4c89d4fe0efb92008ac9fb1253ea6c648c62f93 100644 (file)
@@ -209,9 +209,8 @@ public class GridDropLocation implements ComponentDropLocation {
 
       RadComponent old = container.findComponentInRect(row + relativeRow, column + relativeCol, rowSpan, colSpan);
       if (old != null) {
-        LOG.assertTrue(false,
-                       "Drop rectangle not empty: (" + (row + relativeRow) + ", " + (column + relativeCol)
-                       + ", " + rowSpan + ", " + colSpan + "), component ID=" + old.getId());
+        LOG.error("Drop rectangle not empty: (" + (row + relativeRow) + ", " + (column + relativeCol) + ", " + rowSpan + ", " + colSpan +
+                  "), component ID=" + old.getId());
       }
 
       final GridConstraints constraints = c.getConstraints();
index 979dee5ddfd9e71c908ec5e3bdd95a35685a59f5..45378bd859c68cc47237d13061ddd7592f316ba0 100644 (file)
@@ -27,6 +27,7 @@ import com.intellij.psi.util.CachedValueProvider;
 import com.intellij.psi.util.CachedValuesManager;
 import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.psi.xml.*;
+import com.intellij.util.ArrayUtil;
 import com.intellij.util.IncorrectOperationException;
 import com.intellij.xml.XmlAttributeDescriptor;
 import com.intellij.xml.XmlElementDescriptor;
@@ -264,7 +265,7 @@ public class XsltContextProvider extends ContextProvider {
                 }
 
                 //noinspection unchecked
-                return new Result<ElementNames>(names, names.dependencies.toArray(new Object[names.dependencies.size()]));
+                return new Result<ElementNames>(names, ArrayUtil.toObjectArray(names.dependencies));
             }
         }, false);
     }
index 27b2dfafba7f1aa185c374c802bc1fa7bb9e35ed..b28d846437694aa15639684428476f8939f97aff 100644 (file)
@@ -77,7 +77,7 @@ class ModeReference extends SimpleAttributeReference implements PsiPolyVariantRe
                 final PsiElement[] modes = ResolveUtil.collect(getMatcher().variantMatcher());
                 l.addAll(Arrays.asList(modes));
             }
-            return l.toArray(new Object[l.size()]);
+          return ArrayUtil.toObjectArray(l);
         }
         return ArrayUtil.EMPTY_OBJECT_ARRAY;
     }
@@ -165,7 +165,7 @@ class ModeReference extends SimpleAttributeReference implements PsiPolyVariantRe
                 lookups.add(new NamespaceLookup(prefix));
             }
 
-            return lookups.toArray(new Object[lookups.size()]);
+          return ArrayUtil.toObjectArray(lookups);
         }
 
         public void registerQuickfix(HighlightInfo highlightInfo, PrefixReference psiReference) {
index 1a821147747bd8b4e1dc93772b2297dea4ce41a3..cc56c483848573ad44e9db12cd2572c9414175f7 100644 (file)
@@ -235,7 +235,7 @@ public class XPathEvalAction extends XPathAction {
             } else if (result instanceof Boolean) {
                 Messages.showMessageDialog(result.toString(), "XPath result (Boolean)", Messages.getInformationIcon());
             } else {
-                LOG.assertTrue(false, "Unknown XPath result: " + result);
+              LOG.error("Unknown XPath result: " + result);
             }
         } catch (XPathSyntaxException e) {
             LOG.debug(e);
index 7912652468ebcd485a7bffe707fa45a838176d6e..234de3afe58c6a791153ecb09b0f8b7b49e19df8 100644 (file)
@@ -38,7 +38,7 @@ public abstract class DomAnchorImpl<T extends DomElement> {
   public static <T extends DomElement> DomAnchorImpl<T> createAnchor(@NotNull T t) {
     final DomElement parent = t.getParent();
     if (parent == null) {
-      LOG.assertTrue(false, "Parent null: " + t);
+      LOG.error("Parent null: " + t);
     }
 
     if (parent instanceof DomFileElementImpl) {
@@ -73,7 +73,7 @@ public abstract class DomAnchorImpl<T extends DomElement> {
         }
       }
       diag.append("Child name: ").append(t.getXmlElementName()).append(";").append(t.getXmlElementNamespaceKey());
-      LOG.assertTrue(false, diag);
+      LOG.error(diag.toString());
     }
     return new IndexedAnchor<T>(parentAnchor, description, index);
   }
index b03360b4bc1263c3b45e8d85377efb594de17ca7..a4d19f215895c407b8cf02029f18d83a8c8673e2 100644 (file)
@@ -270,7 +270,7 @@ public class DomFileElementImpl<T extends DomElement> implements DomFileElement<
         if (fileElement == null) {
           final FileDescriptionCachedValueProvider<DomElement> provider = myManager.getOrCreateCachedValueProvider(myFile);
           String s = provider.getFileElementWithLogging();
-          LOG.assertTrue(false, "Null, log=" + s);
+          LOG.error("Null, log=" + s);
         } else {
           assert false: this + " does not equal to " + fileElement;
         }
index fca7ce5da9048f7b4dc88396fab328c00f5abc46..c7decb64abd33421c33ba1804838766c518bf5ca 100644 (file)
@@ -79,7 +79,7 @@ public abstract class DomInvocationHandler<T extends AbstractDomChildDescription
         converter =  myManager.getConverterManager().getConverterByClass(parameter);
       }
       if (converter == null) {
-        LOG.assertTrue(false, "No converter specified: String<->" + parameter.getName());
+        LOG.error("No converter specified: String<->" + parameter.getName());
       }
       return converter;
     }
@@ -139,7 +139,7 @@ public abstract class DomInvocationHandler<T extends AbstractDomChildDescription
 
   protected final void checkIsValid() {
     if (!isValid()) {
-      LOG.assertTrue(false, myType.toString() + " @" + hashCode() + "\nclass=" + getClass() + "\nxml=" + getXmlElement());
+      LOG.error(myType.toString() + " @" + hashCode() + "\nclass=" + getClass() + "\nxml=" + getXmlElement());
     }
   }
 
index d12b957460b1c6373d3e7022ffc2e5fa80839b57..e8a6fa0a06142b2fb051ee3367f0915b21f32e3b 100644 (file)
@@ -80,7 +80,7 @@ public abstract class DomElementsInspection<T extends DomElement> extends XmlSup
       for (final DomElement child : DomUtil.getDefinedChildren(element, true, true)) {
         final XmlElement element1 = child.getXmlElement();
         if (element1 == null) {
-          LOG.assertTrue(false, "child=" + child + "; parent=" + element);
+          LOG.error("child=" + child + "; parent=" + element);
         }
         if (element1.isPhysical()) {
           visitor.consume(child);
index fc948234d9f86c5c14fa76e28a15cc3202cd9c5f..70c0b2e3096c2489d5ad36c377359c370faa6c5a 100644 (file)
@@ -22,6 +22,7 @@ import com.intellij.psi.PsiElement;
 import com.intellij.psi.PsiFile;
 import com.intellij.psi.util.PsiModificationTracker;
 import com.intellij.psi.xml.XmlFile;
+import com.intellij.util.ArrayUtil;
 import com.intellij.util.xml.DomElement;
 import com.intellij.util.xml.DomFileElement;
 import com.intellij.util.xml.ModelMerger;
@@ -91,7 +92,7 @@ public abstract class BaseDomModelFactory<S extends UserDataHolder, T extends Do
     if (scope != null) {
       dependencies.add(ProjectRootManager.getInstance(getProject()));
     }
-    return dependencies.toArray(new Object[dependencies.size()]);
+    return ArrayUtil.toObjectArray(dependencies);
   }
 
   @Nullable
index 58eb6cd8ec10ef8fbb25d0c46ff7a80f06ad1e7f..5c3cb534b13992b1b43a7ca2ce5d9618c5524b13 100644 (file)
@@ -145,7 +145,7 @@ public class XmlCompletionData extends CompletionData {
         if (simpleContent != null) {
           final HashSet<String> variants = new HashSet<String>();
           XmlUtil.collectEnumerationValues(simpleContent, variants);
-          return variants.toArray(new Object[variants.size()]);
+          return ArrayUtil.toObjectArray(variants);
         }
       }
 
index 577f58b5d536eb5a29c4decd0428ee2cf5527add..fb51b7ad2d33f3f18bb3845b5eee97a6fc7cb170 100644 (file)
@@ -193,7 +193,7 @@ public class CompositeLanguageFileViewProvider extends SingleRootFileViewProvide
         message += "\n     contentsText:\n" + getContents().toString();
         message += "\n     jspText:\n" + getPsi(getBaseLanguage()).getNode().getText();
       }
-      LOG.assertTrue(false, message);
+      LOG.error(message);
       assert false;
     }
   }
index a4b3a4e2cc5dc52ac0675da34293b389ea6dc2cd..4e24e7acdca327719c97c95174182bafcfa8aeda 100644 (file)
@@ -938,7 +938,7 @@ public class OldXmlParsing implements XmlElementType {
 
         IElementType type = lexer.getTokenType();
         if (!XML_WHITE_SPACE_OR_COMMENT_BIT_SET.contains(type)) {
-          LOG.assertTrue(false, "Missed token should be white space or comment:" + type);
+          LOG.error("Missed token should be white space or comment:" + type);
           throw new RuntimeException();
         }
 
index 1b3df38dd743a73b2594709110d2c5b3d6de8340..c64803b27d2e1813c8774be3b6e837c5eb633cfe 100644 (file)
@@ -126,7 +126,7 @@ public class XmlEntityDeclImpl extends XmlElementImpl implements XmlEntityDecl,
 
     switch (context) {
       default :
-        LOG.assertTrue(false, "Entity: " + getName() + " context: " + context);
+        LOG.error("Entity: " + getName() + " context: " + context);
         return null;
 
       case CONTEXT_ELEMENT_CONTENT_SPEC:
index 0b4d68beee2d3315058c3dbecf3567d8508534ad..2444863f1026f15a1d75d4285681669a09ddf4eb 100644 (file)
@@ -25,6 +25,7 @@ import com.intellij.psi.util.CachedValueProvider;
 import com.intellij.psi.util.CachedValuesManager;
 import com.intellij.psi.util.PsiTreeUtil;
 import com.intellij.psi.xml.*;
+import com.intellij.util.ArrayUtil;
 import com.intellij.xml.XmlElementDescriptor;
 import com.intellij.xml.impl.schema.AnyXmlElementDescriptor;
 import com.intellij.xml.util.XmlUtil;
@@ -207,7 +208,7 @@ public class XmlEntityRefImpl extends XmlElementImpl implements XmlEntityRef {
         }
       }
 
-      return new CachedValueProvider.Result<XmlEntityDecl>(result[0], deps.toArray(new Object[deps.size()]));
+      return new CachedValueProvider.Result<XmlEntityDecl>(result[0], ArrayUtil.toObjectArray(deps));
     }
     finally {
       targetElement.putUserData(EVALUATION_IN_PROCESS, null);
index da409f4e1e23f512bacb3bc89b13c1104f531b59..17e875218422ed3dfea90049d63d58d08365ea30 100644 (file)
@@ -316,14 +316,9 @@ public class ExternalDocumentValidator {
   private static void assertValidElement(PsiElement currentElement, PsiElement originalElement, String message) {
     if (currentElement==null) {
       XmlTag tag = PsiTreeUtil.getParentOfType(originalElement, XmlTag.class);
-      LOG.assertTrue(
-        false,
-        "The validator message:"+ message+ " is bound to null node,\n" +
-        "initial element:"+originalElement.getText()+",\n"+
-        "parent:" + originalElement.getParent()+",\n" +
-        "tag:" + (tag != null? tag.getText():"null") + ",\n" +
-        "offset in tag: " + (originalElement.getTextOffset() - (tag == null ? 0 : tag.getTextOffset()))
-      );
+      LOG.error("The validator message:" + message + " is bound to null node,\n" + "initial element:" + originalElement.getText() + ",\n" +
+                "parent:" + originalElement.getParent() + ",\n" + "tag:" + (tag != null ? tag.getText() : "null") + ",\n" +
+                "offset in tag: " + (originalElement.getTextOffset() - (tag == null ? 0 : tag.getTextOffset())));
     }
   }