New decompiler API

This commit is contained in:
Roman Shevchenko
2014-02-10 20:22:20 +01:00
parent a281951184
commit f6c6bec736
17 changed files with 383 additions and 278 deletions
@@ -1,3 +1,18 @@
/*
* Copyright 2000-2014 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.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.intellij.psi;
import com.intellij.JavaTestUtil;
@@ -6,7 +21,7 @@ import com.intellij.openapi.util.io.FileUtil;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.openapi.vfs.LocalFileSystem;
import com.intellij.openapi.vfs.VirtualFile;
import com.intellij.psi.impl.compiled.DefaultClsStubBuilderFactory;
import com.intellij.psi.impl.compiled.ClsFileImpl;
import com.intellij.psi.stubs.PsiFileStub;
import com.intellij.psi.stubs.StubBase;
import com.intellij.testFramework.LightIdeaTestCase;
@@ -81,7 +96,7 @@ public class ClsBuilderTest extends LightIdeaTestCase {
}
private static void doTest(VirtualFile vFile, String goldFile) throws ClsFormatException, IOException {
final PsiFileStub stub = (new DefaultClsStubBuilderFactory()).buildFileStub(vFile, vFile.contentsToByteArray());
final PsiFileStub stub = ClsFileImpl.buildFileStub(vFile, vFile.contentsToByteArray());
assert stub != null : vFile;
final String butWas = ((StubBase)stub).printTree();