Merge branch 'master' of git@git.labs.intellij.net:idea/community

This commit is contained in:
Dmitry Jemerov
2010-07-19 14:52:34 +04:00
18 changed files with 44 additions and 77 deletions
-2
View File
@@ -23,8 +23,6 @@
<CLASSES>
<root url="jar://$MODULE_DIR$/../../../lib/dev/compilerapi.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module" module-name="lang-impl" />
@@ -47,7 +47,7 @@ public class LibraryTest extends IdeaTestCase {
final Element element = new Element("root");
library.writeExternal(element);
assertEquals("<root><library name=\"library\"><CLASSES><root url=\"file://x.jar\" /></CLASSES><JAVADOC /><SOURCES><root url=\"file://x-src.jar\" /></SOURCES></library></root>",
assertEquals("<root><library name=\"library\"><CLASSES><root url=\"file://x.jar\" /></CLASSES><SOURCES><root url=\"file://x-src.jar\" /></SOURCES></library></root>",
new XMLOutputter().outputString(element));
ApplicationManager.getApplication().runWriteAction(new Runnable() {
@@ -70,6 +70,7 @@ public class TemplateState implements Disposable {
private Editor myEditor;
private TemplateImpl myTemplate;
private TemplateImpl myPrevTemplate;
private TemplateSegments mySegments = null;
private Map<String, String> myPredefinedVariableValues;
@@ -219,6 +220,7 @@ public class TemplateState implements Disposable {
mySegments = null;
}
myTemplateRange = null;
myPrevTemplate = myTemplate;
myTemplate = null;
releaseEditor();
myTabStopHighlighters.clear();
@@ -271,6 +273,7 @@ public class TemplateState implements Disposable {
myTemplateIndented = false;
myCurrentVariableNumber = -1;
mySegments = new TemplateSegments(myEditor);
myPrevTemplate = myTemplate;
myTemplate = template;
//myArgument = argument;
myPredefinedVariableValues = predefinedVarValues;
@@ -378,7 +381,7 @@ public class TemplateState implements Disposable {
private void afterChangedUpdate() {
if (isFinished()) return;
LOG.assertTrue(myTemplate != null);
LOG.assertTrue(myTemplate != null, myPrevTemplate != null ? myPrevTemplate.getKey() : "prev template is null");
if (myDocumentChanged) {
if (myDocumentChangesTerminateTemplate || mySegments.isInvalid()) {
final int oldIndex = myCurrentVariableNumber;
@@ -277,7 +277,7 @@ public class LibraryImpl implements LibraryEx.ModifiableModelEx, LibraryEx {
if (roots.size() == 0 && rootType.skipWriteIfEmpty()) continue; //compatibility iml/ipr
final Element rootTypeElement = new Element(rootType.name());
roots.writeExternal(rootTypeElement, ROOT_PATH_ELEMENT);
element.addContent(rootTypeElement);
if (rootTypeElement.getAttributes().size() > 0 || rootTypeElement.getContent().size() > 0) element.addContent(rootTypeElement);
}
List<String> urls = new ArrayList<String>(myJarDirectories.keySet());
Collections.sort(urls, new Comparator<String>() {
@@ -25,6 +25,7 @@ import com.intellij.openapi.application.ModalityState;
import com.intellij.openapi.wm.ToolWindow;
import com.intellij.openapi.wm.ToolWindowManager;
import com.intellij.openapi.wm.ToolWindowId;
import com.intellij.openapi.wm.ToolWindowType;
import org.jetbrains.annotations.NotNull;
import javax.swing.*;
@@ -43,7 +44,7 @@ public class PlatformProjectViewOpener implements DirectoryProjectConfigurator {
public void run() {
if (project.isDisposed()) return;
final ToolWindow toolWindow = ToolWindowManager.getInstance(project).getToolWindow(ToolWindowId.PROJECT_VIEW);
if (toolWindow != null) {
if (toolWindow != null && toolWindow.getType() != ToolWindowType.SLIDING) {
toolWindow.activate(null);
}
}
-1
View File
@@ -15,7 +15,6 @@
<CLASSES>
<root url="jar://$MODULE_DIR$/../lib/trilead-ssh2-build213.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="file://$MODULE_DIR$/../trilead-ssh2-build213/src" />
</SOURCES>
-1
View File
@@ -16,7 +16,6 @@
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/trilead-ssh2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MODULE_DIR$/lib/trilead-ssh2-src.zip!/" />
</SOURCES>
-2
View File
@@ -26,8 +26,6 @@
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/gradle-open-api-0.8.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module" module-name="java-impl" />
@@ -14,8 +14,6 @@
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/lucene-core-2.3.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
@@ -16,8 +16,6 @@
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jaxb-impl-2.1.10.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
@@ -25,8 +23,6 @@
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/wadl-core.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
@@ -34,8 +30,6 @@
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jaxb-api-2.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
@@ -43,8 +37,6 @@
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/maven-embedder-1.1-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
@@ -52,8 +44,6 @@
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/classworlds-1.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
@@ -61,8 +51,6 @@
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/plexus-utils-1.5.5.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
@@ -70,8 +58,6 @@
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/maven-2.2.1-uber.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
@@ -79,8 +65,6 @@
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/mercury-artifact-1.0-alpha-6.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
@@ -88,8 +72,6 @@
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/maven-dependency-tree-1.2.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
@@ -97,8 +79,6 @@
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/nexus-indexer-1.2.3.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
@@ -106,8 +86,6 @@
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/archetype-common-2.0-alpha-4-SNAPSHOT.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
@@ -115,8 +93,6 @@
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/activation-1.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
@@ -124,8 +100,6 @@
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/commons-logging-1.1.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
@@ -133,8 +107,6 @@
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/commons-beanutils.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module" module-name="maven" scope="TEST" />
-7
View File
@@ -18,7 +18,6 @@
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/rngom-20051226-patched.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MODULE_DIR$/lib/rngom-src.zip!/src" />
</SOURCES>
@@ -29,8 +28,6 @@
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/isorelax.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
@@ -38,8 +35,6 @@
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/trang-core.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module-library">
@@ -47,8 +42,6 @@
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jing.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
@@ -22,6 +22,7 @@ import com.intellij.codeInsight.daemon.impl.HighlightInfo;
import com.intellij.codeInsight.daemon.impl.analysis.CreateNSDeclarationIntentionFix;
import com.intellij.codeInsight.daemon.impl.quickfix.QuickFixAction;
import com.intellij.lang.xml.XMLLanguage;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiReference;
@@ -44,6 +45,8 @@ import org.jetbrains.annotations.Nullable;
* Date: 24.07.2007
*/
public class PrefixReferenceProvider extends PsiReferenceProviderBase {
private static final Logger LOG = Logger.getInstance("#org.intellij.plugins.relaxNG.references.PrefixReferenceProvider");
@NotNull
public PsiReference[] getReferencesByElement(@NotNull PsiElement element, @NotNull ProcessingContext context) {
final XmlAttributeValue value = (XmlAttributeValue)element;
@@ -102,7 +105,7 @@ public class PrefixReferenceProvider extends PsiReferenceProviderBase {
QuickFixAction.registerQuickFixAction(info,
new CreateNSDeclarationIntentionFix(tag, reference.getCanonicalText()));
} catch (Throwable e) {
e.printStackTrace();
LOG.error(e);
}
}
@@ -17,7 +17,9 @@
package org.intellij.plugins.relaxNG.validation;
import com.intellij.ide.errorTreeView.NewErrorTreeViewPanel;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.command.CommandProcessor;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.Messages;
import com.intellij.openapi.util.Key;
@@ -33,7 +35,6 @@ import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException;
import org.xml.sax.helpers.DefaultHandler;
import javax.swing.*;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Set;
@@ -44,6 +45,8 @@ import java.util.Set;
* Date: 19.11.2007
*/
public class MessageViewHelper {
private static final Logger LOG = Logger.getInstance("#org.intellij.plugins.relaxNG.validation.MessageViewHelper");
private final Project myProject;
private final Set<String> myErrors = new THashSet<String>();
@@ -91,23 +94,23 @@ public class MessageViewHelper {
try {
file = VfsUtil.findFileByURL(new URL(systemId));
} catch (MalformedURLException e) {
System.err.println("systemId = " + systemId);
e.printStackTrace();
LOG.warn("systemId = " + systemId);
LOG.error(e);
}
}
final VirtualFile file1 = file;
SwingUtilities.invokeLater(
new Runnable() {
public void run() {
myErrorsView.addMessage(
warning ? MessageCategory.WARNING : MessageCategory.ERROR,
new String[]{ ex.getLocalizedMessage() },
file1,
ex.getLineNumber() - 1,
ex.getColumnNumber() - 1, null);
}
}
ApplicationManager.getApplication().invokeLater(
new Runnable() {
public void run() {
myErrorsView.addMessage(
warning ? MessageCategory.WARNING : MessageCategory.ERROR,
new String[]{ex.getLocalizedMessage()},
file1,
ex.getLineNumber() - 1,
ex.getColumnNumber() - 1, null);
}
}
);
}
@@ -16,6 +16,7 @@
package org.intellij.plugins.relaxNG.validation;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.util.Key;
import com.intellij.openapi.util.SystemInfo;
@@ -62,12 +63,15 @@ import java.io.StringReader;
* Date: 19.07.2007
*/
public class RngParser {
private static final Logger LOG = Logger.getInstance("#org.intellij.plugins.relaxNG.validation.RngParser");
static final Key<CachedValue<Schema>> SCHEMA_KEY = Key.create("SCHEMA");
static final Key<CachedValue<DPattern>> PATTERN_KEY = Key.create("PATTERN");
public static final DefaultHandler DEFAULT_HANDLER = new DefaultHandler() {
public void error(SAXParseException e) throws SAXException {
System.out.println("e.getMessage() = " + e.getMessage() + " [" + e.getSystemId() + "]");
LOG.info("e.getMessage() = " + e.getMessage() + " [" + e.getSystemId() + "]");
LOG.info(e);
}
};
@@ -90,9 +94,9 @@ public class RngParser {
return (DPattern)p.parse(checking ? new CheckingSchemaBuilder(sb, eh) : sb);
} catch (BuildException e) {
e.printStackTrace();
LOG.info(e);
} catch (IllegalSchemaException e) {
System.out.println("invalid schema: " + file.getVirtualFile().getPresentableUrl());
LOG.info("invalid schema: " + file.getVirtualFile().getPresentableUrl());
}
return null;
}
@@ -166,7 +170,7 @@ public class RngParser {
return Result.createSingleDependency(schema, descriptorFile);
}
} catch (Exception e) {
e.printStackTrace();
LOG.info(e);
return Result.createSingleDependency(null, descriptorFile);
}
}
@@ -17,6 +17,7 @@
package org.intellij.plugins.relaxNG.validation;
import com.intellij.codeInsight.daemon.Validator;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.editor.Document;
import com.intellij.openapi.progress.ProcessCanceledException;
import com.intellij.psi.PsiDocumentManager;
@@ -40,6 +41,7 @@ import org.xml.sax.SAXParseException;
* Date: 30.07.2007
*/
public class XmlInstanceValidator {
private static final Logger LOG = Logger.getInstance("#org.intellij.plugins.relaxNG.validation.MessageViewHelper");
public static void doValidation(@NotNull final XmlDocument doc, final Validator.ValidationHost host, final XmlFile descriptorFile) {
try {
@@ -61,9 +63,11 @@ public class XmlInstanceValidator {
doc.accept(new Psi2SaxAdapter(handler));
} catch (ProcessCanceledException e) {
throw e;
LOG.error(e);
} catch (RuntimeException e) {
LOG.error(e);
} catch (Exception e) {
e.printStackTrace();
LOG.info(e);
}
}
@@ -85,7 +85,7 @@ public abstract class HighlightingTestBase extends TestCase implements IdeaCodeI
}
});
} catch (IOException e) {
e.printStackTrace();
throw new RuntimeException(e);
}
}
-3
View File
@@ -16,7 +16,6 @@
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/svnkit.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MODULE_DIR$/lib/svnkitsrc.zip!/" />
</SOURCES>
@@ -30,8 +29,6 @@
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jna.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>
-5
View File
@@ -22,7 +22,6 @@
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/svnkit.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES>
<root url="jar://$MODULE_DIR$/lib/svnkitsrc.zip!/" />
</SOURCES>
@@ -33,8 +32,6 @@
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/trilead.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
<orderEntry type="module" module-name="platform-impl" />
@@ -43,8 +40,6 @@
<CLASSES>
<root url="jar://$MODULE_DIR$/lib/jna.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</orderEntry>
</component>