EA-28491 (more logging)

This commit is contained in:
Roman Shevchenko
2011-06-24 12:39:33 +04:00
parent 3e90ecbbea
commit 655c371db7
2 changed files with 18 additions and 6 deletions
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2010 JetBrains s.r.o.
* Copyright 2000-2011 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,19 +21,20 @@ import com.intellij.openapi.roots.LanguageLevelProjectExtension;
import com.intellij.openapi.util.io.FileUtil;
import com.intellij.pom.java.LanguageLevel;
import com.intellij.psi.impl.DebugUtil;
import com.intellij.psi.impl.source.JavaFileStubBuilder;
import com.intellij.psi.impl.source.JavaLightStubBuilder;
import com.intellij.psi.stubs.StubElement;
import com.intellij.testFramework.LightIdeaTestCase;
import com.intellij.testFramework.PlatformTestUtil;
import com.intellij.util.ThrowableRunnable;
import org.jetbrains.annotations.Nullable;
import java.io.File;
import java.security.SecureRandom;
public class JavaStubBuilderTest extends LightIdeaTestCase {
private static final StubBuilder OLD_BUILDER = new JavaFileStubBuilder();
@SuppressWarnings("deprecation")
private static final StubBuilder OLD_BUILDER = new com.intellij.psi.impl.source.JavaFileStubBuilder();
private static final StubBuilder NEW_BUILDER = new JavaLightStubBuilder();
private static final int SOE_TEST_DEPTH = 20000;
@@ -364,7 +365,7 @@ public class JavaStubBuilderTest extends LightIdeaTestCase {
}).cpuBound().assertTiming();
}
private static void doTest(final String source, final String tree) {
private static void doTest(final String source, @Nullable final String tree) {
final PsiJavaFile file = (PsiJavaFile)createLightFile("test.java", source);
final FileASTNode fileNode = file.getNode();
assertNotNull(fileNode);
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2010 JetBrains s.r.o.
* Copyright 2000-2011 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,6 +16,7 @@
package com.intellij.psi.stubs;
import com.intellij.lang.*;
import com.intellij.openapi.diagnostic.LogUtil;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.fileTypes.FileType;
import com.intellij.openapi.fileTypes.LanguageFileType;
@@ -139,7 +140,7 @@ public class LightStubBuilder implements StubBuilder {
}
}
else {
LOG.error("Element is not of ILighterStubElementType: " + elementType + ", " + element);
LOG.error("Element is not of ILightStubElementType: " + LogUtil.objectAndClass(elementType) + ", " + element);
}
}
@@ -259,6 +260,11 @@ public class LightStubBuilder implements StubBuilder {
public int hashCode() {
return myNode.hashCode();
}
@Override
public String toString() {
return "node wrapper[" + myNode + "]";
}
}
private static class TokenNodeWrapper extends NodeWrapper implements LighterASTTokenNode {
@@ -270,6 +276,11 @@ public class LightStubBuilder implements StubBuilder {
public CharSequence getText() {
return myNode.getText();
}
@Override
public String toString() {
return "token wrapper[" + myNode + "]";
}
}
}
}