Revision: 6831 Author: [email protected] Date: Tue Nov 10 20:40:43 2009 Log: Moving several files from com.google.gwt.dev.javac.impl -> com.google.gwt.dev.javac
Having a subpackage was kind of pointless. Review by: bobv (desk) http://code.google.com/p/google-web-toolkit/source/detail?r=6831 Added: /trunk/dev/core/src/com/google/gwt/dev/javac/FileCompilationUnit.java /trunk/dev/core/src/com/google/gwt/dev/javac/Shared.java /trunk/dev/core/src/com/google/gwt/dev/javac/SourceFileCompilationUnit.java /trunk/dev/core/test/com/google/gwt/dev/javac/JdtBehaviorTest.java Deleted: /trunk/dev/core/src/com/google/gwt/dev/javac/impl/FileCompilationUnit.java /trunk/dev/core/src/com/google/gwt/dev/javac/impl/Shared.java /trunk/dev/core/src/com/google/gwt/dev/javac/impl/SourceFileCompilationUnit.java /trunk/dev/core/src/com/google/gwt/dev/jdt/Shared.java /trunk/dev/core/test/com/google/gwt/dev/javac/impl/JdtBehaviorTest.java Modified: /trunk/dev/core/src/com/google/gwt/dev/javac/CompilationState.java /trunk/dev/core/src/com/google/gwt/dev/javac/CompiledClass.java /trunk/dev/core/src/com/google/gwt/dev/javac/JdtCompiler.java /trunk/dev/core/src/com/google/gwt/dev/javac/StandardGeneratorContext.java /trunk/dev/core/src/com/google/gwt/dev/javac/TypeOracleMediator.java /trunk/dev/core/src/com/google/gwt/dev/jdt/AbstractCompiler.java /trunk/dev/core/test/com/google/gwt/dev/javac/CompilationStateTest.java /trunk/dev/core/test/com/google/gwt/dev/javac/CompilationStateTestBase.java /trunk/dev/core/test/com/google/gwt/dev/javac/JavaCompilationSuite.java /trunk/dev/core/test/com/google/gwt/dev/javac/JdtCompilerTest.java /trunk/dev/core/test/com/google/gwt/dev/javac/TypeOracleMediatorTest.java /trunk/dev/core/test/com/google/gwt/dev/javac/impl/MockJavaResource.java /trunk/dev/core/test/com/google/gwt/dev/javac/impl/StaticJavaResource.java /trunk/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiCompatibilityChecker.java /trunk/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiContainer.java ======================================= --- /dev/null +++ /trunk/dev/core/src/com/google/gwt/dev/javac/FileCompilationUnit.java Tue Nov 10 20:40:43 2009 @@ -0,0 +1,70 @@ +/* + * Copyright 2008 Google Inc. + * + * 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.google.gwt.dev.javac; + +import com.google.gwt.dev.util.Util; + +import java.io.File; + +/** + * A compilation unit based on a file. + */ +public class FileCompilationUnit extends CompilationUnit { + private final File file; + private final String typeName; + + public FileCompilationUnit(File file, String packageName) { + this.file = file; + String fileName = file.getName(); + assert fileName.endsWith(".java"); + fileName = fileName.substring(0, fileName.length() - 5); + if (packageName.length() == 0) { + this.typeName = fileName; + } else { + this.typeName = packageName + '.' + fileName; + } + } + + @Override + public String getDisplayLocation() { + return file.getAbsolutePath(); + } + + @Override + public long getLastModified() { + return file.lastModified(); + } + + @Override + public String getSource() { + return Util.readFileAsString(file); + } + + @Override + public String getTypeName() { + return typeName; + } + + @Override + public boolean isGenerated() { + return false; + } + + @Override + public boolean isSuperSource() { + return false; + } +} ======================================= --- /dev/null +++ /trunk/dev/core/src/com/google/gwt/dev/javac/Shared.java Tue Nov 10 20:40:43 2009 @@ -0,0 +1,201 @@ +/* + * Copyright 2008 Google Inc. + * + * 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.google.gwt.dev.javac; + +import com.google.gwt.core.ext.typeinfo.JClassType; +import com.google.gwt.core.ext.typeinfo.JConstructor; +import com.google.gwt.core.ext.typeinfo.JField; +import com.google.gwt.core.ext.typeinfo.JMethod; +import com.google.gwt.core.ext.typeinfo.JPackage; +import com.google.gwt.core.ext.typeinfo.JParameter; +import com.google.gwt.core.ext.typeinfo.JType; +import com.google.gwt.dev.resource.Resource; +import com.google.gwt.dev.util.Util; +import com.google.gwt.util.tools.Utility; + +import org.eclipse.jdt.internal.compiler.lookup.FieldBinding; +import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; +import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.List; + +/** + * A grab bag of utility functions useful for dealing with java files. + */ +public class Shared { + + public static final int MOD_ABSTRACT = 0x00000001; + public static final int MOD_FINAL = 0x00000002; + public static final int MOD_NATIVE = 0x00000004; + public static final int MOD_PRIVATE = 0x00000008; + public static final int MOD_PROTECTED = 0x00000010; + public static final int MOD_PUBLIC = 0x00000020; + public static final int MOD_STATIC = 0x00000040; + public static final int MOD_TRANSIENT = 0x00000080; + public static final int MOD_VOLATILE = 0x00000100; + public static final JClassType[] NO_JCLASSES = new JClassType[0]; + public static final JConstructor[] NO_JCTORS = new JConstructor[0]; + public static final JField[] NO_JFIELDS = new JField[0]; + public static final JMethod[] NO_JMETHODS = new JMethod[0]; + public static final JPackage[] NO_JPACKAGES = new JPackage[0]; + public static final JParameter[] NO_JPARAMS = new JParameter[0]; + public static final JType[] NO_JTYPES = new JType[0]; + public static final String[][] NO_STRING_ARR_ARR = new String[0][]; + public static final String[] NO_STRINGS = new String[0]; + + public static int bindingToModifierBits(FieldBinding binding) { + int bits = 0; + bits |= (binding.isPublic() ? MOD_PUBLIC : 0); + bits |= (binding.isPrivate() ? MOD_PRIVATE : 0); + bits |= (binding.isProtected() ? MOD_PROTECTED : 0); + bits |= (binding.isStatic() ? MOD_STATIC : 0); + bits |= (binding.isTransient() ? MOD_TRANSIENT : 0); + bits |= (binding.isFinal() ? MOD_FINAL : 0); + bits |= (binding.isVolatile() ? MOD_VOLATILE : 0); + return bits; + } + + public static int bindingToModifierBits(MethodBinding binding) { + int bits = 0; + bits |= (binding.isPublic() ? MOD_PUBLIC : 0); + bits |= (binding.isPrivate() ? MOD_PRIVATE : 0); + bits |= (binding.isProtected() ? MOD_PROTECTED : 0); + bits |= (binding.isStatic() ? MOD_STATIC : 0); + bits |= (binding.isFinal() ? MOD_FINAL : 0); + bits |= (binding.isNative() ? MOD_NATIVE : 0); + bits |= (binding.isAbstract() ? MOD_ABSTRACT : 0); + return bits; + } + + public static int bindingToModifierBits(ReferenceBinding binding) { + int bits = 0; + bits |= (binding.isPublic() ? MOD_PUBLIC : 0); + bits |= (binding.isPrivate() ? MOD_PRIVATE : 0); + bits |= (binding.isProtected() ? MOD_PROTECTED : 0); + bits |= (binding.isStatic() ? MOD_STATIC : 0); + bits |= (binding.isFinal() ? MOD_FINAL : 0); + bits |= (binding.isAbstract() ? MOD_ABSTRACT : 0); + return bits; + } + + public static String getPackageName(String qualifiedTypeName) { + int pos = qualifiedTypeName.lastIndexOf('.'); + return (pos < 0) ? "" : qualifiedTypeName.substring(0, pos); + } + + public static String getPackageNameFromBinary(String binaryName) { + int pos = binaryName.lastIndexOf('/'); + return (pos < 0) ? "" : binaryName.substring(0, pos).replace('/', '.'); + } + + public static String getShortName(String qualifiedTypeName) { + int pos = qualifiedTypeName.lastIndexOf('.'); + return (pos < 0) ? qualifiedTypeName : qualifiedTypeName.substring(pos + 1); + } + + public static String getTypeName(Resource sourceFile) { + String path = sourceFile.getPath(); + assert (path.endsWith(".java")); + path = path.substring(0, path.lastIndexOf('.')); + return path.replace('/', '.'); + } + + public static String makeTypeName(String packageName, String shortName) { + if (packageName.length() == 0) { + return shortName; + } else { + return packageName + '.' + shortName; + } + } + + public static String readContent(InputStream content) { + try { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + byte[] buf = new byte[1024]; + for (int readCount = content.read(buf); readCount > 0; readCount = content.read(buf)) { + out.write(buf, 0, readCount); + } + return Util.toString(out.toByteArray()); + } catch (IOException e) { + throw new RuntimeException(e); + } finally { + Utility.close(content); + } + } + + public static String readSource(Resource sourceFile) { + InputStream contents = sourceFile.openContents(); + return Util.readStreamAsString(contents); + } + + public static String toPath(String qualifiedTypeName) { + return qualifiedTypeName.replace('.', '/') + ".java"; + } + + public static String toTypeName(String path) { + assert (path.endsWith(".java")); + path = path.substring(0, path.lastIndexOf('.')); + return path.replace('/', '.'); + } + + static String[] modifierBitsToNames(int bits) { + List<String> strings = new ArrayList<String>(); + + // The order is based on the order in which we want them to appear. + // + if (0 != (bits & MOD_PUBLIC)) { + strings.add("public"); + } + + if (0 != (bits & MOD_PRIVATE)) { + strings.add("private"); + } + + if (0 != (bits & MOD_PROTECTED)) { + strings.add("protected"); + } + + if (0 != (bits & MOD_STATIC)) { + strings.add("static"); + } + + if (0 != (bits & MOD_ABSTRACT)) { + strings.add("abstract"); + } + + if (0 != (bits & MOD_FINAL)) { + strings.add("final"); + } + + if (0 != (bits & MOD_NATIVE)) { + strings.add("native"); + } + + if (0 != (bits & MOD_TRANSIENT)) { + strings.add("transient"); + } + + if (0 != (bits & MOD_VOLATILE)) { + strings.add("volatile"); + } + + return strings.toArray(NO_STRINGS); + } +} ======================================= --- /dev/null +++ /trunk/dev/core/src/com/google/gwt/dev/javac/SourceFileCompilationUnit.java Tue Nov 10 20:40:43 2009 @@ -0,0 +1,78 @@ +/* + * Copyright 2008 Google Inc. + * + * 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.google.gwt.dev.javac; + +import com.google.gwt.dev.resource.Resource; + + +/** + * A compilation unit that was generated. + */ +public class SourceFileCompilationUnit extends CompilationUnit { + + /** + * A token to retrieve this object's bytes from the disk cache. It's generally + * much faster to read from the disk cache than to reread individual + * resources. + */ + private long cacheToken = -1; + + private Resource sourceFile; + + public SourceFileCompilationUnit(Resource sourceFile) { + this.sourceFile = sourceFile; + } + + @Override + public String getDisplayLocation() { + return sourceFile.getLocation(); + } + + @Override + public long getLastModified() { + return sourceFile.getLastModified(); + } + + @Override + public String getSource() { + if (cacheToken < 0) { + String sourceCode = Shared.readSource(sourceFile); + cacheToken = diskCache.writeString(sourceCode); + return sourceCode; + } else { + return diskCache.readString(cacheToken); + } + } + + public Resource getSourceFile() { + return sourceFile; + } + + @Override + public String getTypeName() { + return Shared.getTypeName(sourceFile); + } + + @Override + public boolean isGenerated() { + return false; + } + + @Override + public boolean isSuperSource() { + return sourceFile.wasRerooted(); + } +} ======================================= --- /dev/null +++ /trunk/dev/core/test/com/google/gwt/dev/javac/JdtBehaviorTest.java Tue Nov 10 20:40:43 2009 @@ -0,0 +1,219 @@ +/* + * Copyright 2008 Google Inc. + * + * 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.google.gwt.dev.javac; + +import com.google.gwt.dev.javac.impl.JavaResourceBase; +import com.google.gwt.dev.javac.impl.MockResource; + +import junit.framework.TestCase; + +import org.eclipse.jdt.core.compiler.CategorizedProblem; +import org.eclipse.jdt.core.compiler.CharOperation; +import org.eclipse.jdt.internal.compiler.ClassFile; +import org.eclipse.jdt.internal.compiler.CompilationResult; +import org.eclipse.jdt.internal.compiler.Compiler; +import org.eclipse.jdt.internal.compiler.DefaultErrorHandlingPolicies; +import org.eclipse.jdt.internal.compiler.ICompilerRequestor; +import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader; +import org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException; +import org.eclipse.jdt.internal.compiler.env.ICompilationUnit; +import org.eclipse.jdt.internal.compiler.env.INameEnvironment; +import org.eclipse.jdt.internal.compiler.env.NameEnvironmentAnswer; +import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Set; + +/** + * Validates certain JDT behaviors that the compilation process may depend on + * for correctness. One useful aspect would be that if we upgrade JDT in the + * future, this test could help validate our assumptions. + */ +public class JdtBehaviorTest extends TestCase { + + /** + * Hook-point if we need to modify the compiler behavior. + */ + private static class CompilerImpl extends Compiler { + + public CompilerImpl(INameEnvironment environment, + ICompilerRequestor requestor) { + super(environment, DefaultErrorHandlingPolicies.proceedWithAllProblems(), + JdtCompiler.getCompilerOptions(), requestor, + new DefaultProblemFactory(Locale.getDefault())); + } + } + + /** + * Hook point to accept results. + */ + private class ICompilerRequestorImpl implements ICompilerRequestor { + public void acceptResult(CompilationResult result) { + if (result.hasErrors()) { + StringBuilder sb = new StringBuilder(); + for (CategorizedProblem problem : result.getErrors()) { + sb.append(problem.toString()); + sb.append('\n'); + } + fail(sb.toString()); + } + for (ClassFile classFile : result.getClassFiles()) { + char[][] classNameArray = classFile.getCompoundName(); + char[][] packageArray = CharOperation.subarray(classNameArray, 0, + classNameArray.length - 1); + char[] packageName = CharOperation.concatWith(packageArray, '.'); + char[] className = CharOperation.concatWith(classNameArray, '.'); + addPackages(String.valueOf(packageName)); + classFiles.put(String.valueOf(className), classFile); + } + } + + private void addPackages(String packageName) { + while (true) { + packages.add(String.valueOf(packageName)); + int pos = packageName.lastIndexOf('.'); + if (pos > 0) { + packageName = packageName.substring(0, pos); + } else { + packages.add(""); + break; + } + } + } + } + + /** + * How JDT receives files from the environment. + */ + private class INameEnvironmentImpl implements INameEnvironment { + public void cleanup() { + // intentionally blank + } + + public NameEnvironmentAnswer findType(char[] type, char[][] pkg) { + return findType(CharOperation.arrayConcat(pkg, type)); + } + + public NameEnvironmentAnswer findType(char[][] compoundTypeName) { + final char[] typeChars = CharOperation.concatWith(compoundTypeName, '.'); + String typeName = String.valueOf(typeChars); + // System.out.println("findType: " + typeName); + ClassFile classFile = classFiles.get(typeName); + if (classFile != null) { + try { + byte[] bytes = classFile.getBytes(); + char[] loc = classFile.fileName(); + ClassFileReader cfr = new ClassFileReader(bytes, loc); + return new NameEnvironmentAnswer(cfr, null); + } catch (ClassFormatException e) { + throw new RuntimeException("Unexpectedly unable to parse class file", + e); + } + } + return null; + } + + public boolean isPackage(char[][] parentPkg, char[] pkg) { + final char[] pathChars = CharOperation.concatWith(parentPkg, pkg, '.'); + String packageName = String.valueOf(pathChars); + // System.out.println("isPackage: " + packageName); + return packages.contains(packageName); + } + } + + private static class ResourceAdapter implements ICompilationUnit { + + private final MockResource sourceFile; + + public ResourceAdapter(MockResource resource) { + sourceFile = resource; + } + + public char[] getContents() { + return Shared.readSource(sourceFile).toCharArray(); + } + + public char[] getFileName() { + return sourceFile.getLocation().toCharArray(); + } + + public char[] getMainTypeName() { + return Shared.getShortName(Shared.getTypeName(sourceFile)).toCharArray(); + } + + public char[][] getPackageName() { + return CharOperation.splitOn('.', Shared.getPackageName( + Shared.getTypeName(sourceFile)).toCharArray()); + } + + @Override + public String toString() { + return sourceFile.toString(); + } + } + + protected Map<String, ClassFile> classFiles = new HashMap<String, ClassFile>(); + + /** + * New object for each test case. + */ + protected INameEnvironmentImpl environment = new INameEnvironmentImpl(); + + protected Set<String> packages = new HashSet<String>(); + + /** + * New object for each test case. + */ + protected ICompilerRequestorImpl requestor = new ICompilerRequestorImpl(); + + /** + * New object for each test case. + */ + CompilerImpl compiler = new CompilerImpl(environment, requestor); + + public void testIncrementalBuild() { + List<MockResource> resources = new ArrayList<MockResource>(); + Collections.addAll(resources, JavaResourceBase.getStandardResources()); + resources.add(JavaResourceBase.FOO); + doCompile(resources); + + // Now incremental build the bar cup. + doCompile(Arrays.asList(JavaResourceBase.BAR)); + } + + public void testSingleBuild() { + List<MockResource> resources = new ArrayList<MockResource>(); + Collections.addAll(resources, JavaResourceBase.getStandardResources()); + resources.add(JavaResourceBase.FOO); + resources.add(JavaResourceBase.BAR); + doCompile(resources); + } + + private void doCompile(List<? extends MockResource> resources) { + ICompilationUnit[] icus = new ICompilationUnit[resources.size()]; + for (int i = 0; i < icus.length; ++i) { + icus[i] = new ResourceAdapter(resources.get(i)); + } + compiler.compile(icus); + } +} ======================================= --- /trunk/dev/core/src/com/google/gwt/dev/javac/impl/FileCompilationUnit.java Thu Apr 2 13:40:27 2009 +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright 2008 Google Inc. - * - * 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.google.gwt.dev.javac.impl; - -import com.google.gwt.dev.javac.CompilationUnit; -import com.google.gwt.dev.util.Util; - -import java.io.File; - -/** - * A compilation unit based on a file. - */ -public class FileCompilationUnit extends CompilationUnit { - private final File file; - private final String typeName; - - public FileCompilationUnit(File file, String packageName) { - this.file = file; - String fileName = file.getName(); - assert fileName.endsWith(".java"); - fileName = fileName.substring(0, fileName.length() - 5); - if (packageName.length() == 0) { - this.typeName = fileName; - } else { - this.typeName = packageName + '.' + fileName; - } - } - - @Override - public String getDisplayLocation() { - return file.getAbsolutePath(); - } - - @Override - public long getLastModified() { - return file.lastModified(); - } - - @Override - public String getSource() { - return Util.readFileAsString(file); - } - - @Override - public String getTypeName() { - return typeName; - } - - @Override - public boolean isGenerated() { - return false; - } - - @Override - public boolean isSuperSource() { - return false; - } -} ======================================= --- /trunk/dev/core/src/com/google/gwt/dev/javac/impl/Shared.java Mon Nov 9 19:37:01 2009 +++ /dev/null @@ -1,201 +0,0 @@ -/* - * Copyright 2008 Google Inc. - * - * 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.google.gwt.dev.javac.impl; - -import com.google.gwt.core.ext.typeinfo.JClassType; -import com.google.gwt.core.ext.typeinfo.JConstructor; -import com.google.gwt.core.ext.typeinfo.JField; -import com.google.gwt.core.ext.typeinfo.JMethod; -import com.google.gwt.core.ext.typeinfo.JPackage; -import com.google.gwt.core.ext.typeinfo.JParameter; -import com.google.gwt.core.ext.typeinfo.JType; -import com.google.gwt.dev.resource.Resource; -import com.google.gwt.dev.util.Util; -import com.google.gwt.util.tools.Utility; - -import org.eclipse.jdt.internal.compiler.lookup.FieldBinding; -import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; -import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; - -import java.io.ByteArrayOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.util.ArrayList; -import java.util.List; - -/** - * A grab bag of utility functions useful for dealing with java files. - */ -public class Shared { - - public static final int MOD_ABSTRACT = 0x00000001; - public static final int MOD_FINAL = 0x00000002; - public static final int MOD_NATIVE = 0x00000004; - public static final int MOD_PRIVATE = 0x00000008; - public static final int MOD_PROTECTED = 0x00000010; - public static final int MOD_PUBLIC = 0x00000020; - public static final int MOD_STATIC = 0x00000040; - public static final int MOD_TRANSIENT = 0x00000080; - public static final int MOD_VOLATILE = 0x00000100; - public static final JClassType[] NO_JCLASSES = new JClassType[0]; - public static final JConstructor[] NO_JCTORS = new JConstructor[0]; - public static final JField[] NO_JFIELDS = new JField[0]; - public static final JMethod[] NO_JMETHODS = new JMethod[0]; - public static final JPackage[] NO_JPACKAGES = new JPackage[0]; - public static final JParameter[] NO_JPARAMS = new JParameter[0]; - public static final JType[] NO_JTYPES = new JType[0]; - public static final String[][] NO_STRING_ARR_ARR = new String[0][]; - public static final String[] NO_STRINGS = new String[0]; - - public static int bindingToModifierBits(FieldBinding binding) { - int bits = 0; - bits |= (binding.isPublic() ? MOD_PUBLIC : 0); - bits |= (binding.isPrivate() ? MOD_PRIVATE : 0); - bits |= (binding.isProtected() ? MOD_PROTECTED : 0); - bits |= (binding.isStatic() ? MOD_STATIC : 0); - bits |= (binding.isTransient() ? MOD_TRANSIENT : 0); - bits |= (binding.isFinal() ? MOD_FINAL : 0); - bits |= (binding.isVolatile() ? MOD_VOLATILE : 0); - return bits; - } - - public static int bindingToModifierBits(MethodBinding binding) { - int bits = 0; - bits |= (binding.isPublic() ? MOD_PUBLIC : 0); - bits |= (binding.isPrivate() ? MOD_PRIVATE : 0); - bits |= (binding.isProtected() ? MOD_PROTECTED : 0); - bits |= (binding.isStatic() ? MOD_STATIC : 0); - bits |= (binding.isFinal() ? MOD_FINAL : 0); - bits |= (binding.isNative() ? MOD_NATIVE : 0); - bits |= (binding.isAbstract() ? MOD_ABSTRACT : 0); - return bits; - } - - public static int bindingToModifierBits(ReferenceBinding binding) { - int bits = 0; - bits |= (binding.isPublic() ? MOD_PUBLIC : 0); - bits |= (binding.isPrivate() ? MOD_PRIVATE : 0); - bits |= (binding.isProtected() ? MOD_PROTECTED : 0); - bits |= (binding.isStatic() ? MOD_STATIC : 0); - bits |= (binding.isFinal() ? MOD_FINAL : 0); - bits |= (binding.isAbstract() ? MOD_ABSTRACT : 0); - return bits; - } - - public static String getPackageName(String qualifiedTypeName) { - int pos = qualifiedTypeName.lastIndexOf('.'); - return (pos < 0) ? "" : qualifiedTypeName.substring(0, pos); - } - - public static String getPackageNameFromBinary(String binaryName) { - int pos = binaryName.lastIndexOf('/'); - return (pos < 0) ? "" : binaryName.substring(0, pos).replace('/', '.'); - } - - public static String getShortName(String qualifiedTypeName) { - int pos = qualifiedTypeName.lastIndexOf('.'); - return (pos < 0) ? qualifiedTypeName : qualifiedTypeName.substring(pos + 1); - } - - public static String getTypeName(Resource sourceFile) { - String path = sourceFile.getPath(); - assert (path.endsWith(".java")); - path = path.substring(0, path.lastIndexOf('.')); - return path.replace('/', '.'); - } - - public static String makeTypeName(String packageName, String shortName) { - if (packageName.length() == 0) { - return shortName; - } else { - return packageName + '.' + shortName; - } - } - - public static String readContent(InputStream content) { - try { - ByteArrayOutputStream out = new ByteArrayOutputStream(); - byte[] buf = new byte[1024]; - for (int readCount = content.read(buf); readCount > 0; readCount = content.read(buf)) { - out.write(buf, 0, readCount); - } - return Util.toString(out.toByteArray()); - } catch (IOException e) { - throw new RuntimeException(e); - } finally { - Utility.close(content); - } - } - - public static String readSource(Resource sourceFile) { - InputStream contents = sourceFile.openContents(); - return Util.readStreamAsString(contents); - } - - public static String toPath(String qualifiedTypeName) { - return qualifiedTypeName.replace('.', '/') + ".java"; - } - - public static String toTypeName(String path) { - assert (path.endsWith(".java")); - path = path.substring(0, path.lastIndexOf('.')); - return path.replace('/', '.'); - } - - static String[] modifierBitsToNames(int bits) { - List<String> strings = new ArrayList<String>(); - - // The order is based on the order in which we want them to appear. - // - if (0 != (bits & MOD_PUBLIC)) { - strings.add("public"); - } - - if (0 != (bits & MOD_PRIVATE)) { - strings.add("private"); - } - - if (0 != (bits & MOD_PROTECTED)) { - strings.add("protected"); - } - - if (0 != (bits & MOD_STATIC)) { - strings.add("static"); - } - - if (0 != (bits & MOD_ABSTRACT)) { - strings.add("abstract"); - } - - if (0 != (bits & MOD_FINAL)) { - strings.add("final"); - } - - if (0 != (bits & MOD_NATIVE)) { - strings.add("native"); - } - - if (0 != (bits & MOD_TRANSIENT)) { - strings.add("transient"); - } - - if (0 != (bits & MOD_VOLATILE)) { - strings.add("volatile"); - } - - return strings.toArray(NO_STRINGS); - } -} ======================================= --- /trunk/dev/core/src/com/google/gwt/dev/javac/impl/SourceFileCompilationUnit.java Mon Nov 9 19:37:01 2009 +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright 2008 Google Inc. - * - * 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.google.gwt.dev.javac.impl; - -import com.google.gwt.dev.javac.CompilationUnit; -import com.google.gwt.dev.resource.Resource; - - -/** - * A compilation unit that was generated. - */ -public class SourceFileCompilationUnit extends CompilationUnit { - - /** - * A token to retrieve this object's bytes from the disk cache. It's generally - * much faster to read from the disk cache than to reread individual - * resources. - */ - private long cacheToken = -1; - - private Resource sourceFile; - - public SourceFileCompilationUnit(Resource sourceFile) { - this.sourceFile = sourceFile; - } - - @Override - public String getDisplayLocation() { - return sourceFile.getLocation(); - } - - @Override - public long getLastModified() { - return sourceFile.getLastModified(); - } - - @Override - public String getSource() { - if (cacheToken < 0) { - String sourceCode = Shared.readSource(sourceFile); - cacheToken = diskCache.writeString(sourceCode); - return sourceCode; - } else { - return diskCache.readString(cacheToken); - } - } - - public Resource getSourceFile() { - return sourceFile; - } - - @Override - public String getTypeName() { - return Shared.getTypeName(sourceFile); - } - - @Override - public boolean isGenerated() { - return false; - } - - @Override - public boolean isSuperSource() { - return sourceFile.wasRerooted(); - } -} ======================================= --- /trunk/dev/core/src/com/google/gwt/dev/jdt/Shared.java Tue Apr 1 15:56:19 2008 +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright 2008 Google Inc. - * - * 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.google.gwt.dev.jdt; - -import com.google.gwt.core.ext.typeinfo.JClassType; -import com.google.gwt.core.ext.typeinfo.JConstructor; -import com.google.gwt.core.ext.typeinfo.JField; -import com.google.gwt.core.ext.typeinfo.JMethod; -import com.google.gwt.core.ext.typeinfo.JPackage; -import com.google.gwt.core.ext.typeinfo.JParameter; -import com.google.gwt.core.ext.typeinfo.JType; - -import org.eclipse.jdt.internal.compiler.lookup.FieldBinding; -import org.eclipse.jdt.internal.compiler.lookup.MethodBinding; -import org.eclipse.jdt.internal.compiler.lookup.ReferenceBinding; - -import java.util.ArrayList; -import java.util.List; - -/** - * Utility methods and constants. - */ -class Shared { - static final int MOD_ABSTRACT = 0x00000001; - static final int MOD_FINAL = 0x00000002; - static final int MOD_NATIVE = 0x00000004; - static final int MOD_PRIVATE = 0x00000008; - static final int MOD_PROTECTED = 0x00000010; - static final int MOD_PUBLIC = 0x00000020; - static final int MOD_STATIC = 0x00000040; - static final int MOD_TRANSIENT = 0x00000080; - static final int MOD_VOLATILE = 0x00000100; - static final JClassType[] NO_JCLASSES = new JClassType[0]; - static final JConstructor[] NO_JCTORS = new JConstructor[0]; - static final JField[] NO_JFIELDS = new JField[0]; - static final JMethod[] NO_JMETHODS = new JMethod[0]; - static final JPackage[] NO_JPACKAGES = new JPackage[0]; - static final JParameter[] NO_JPARAMS = new JParameter[0]; - static final JType[] NO_JTYPES = new JType[0]; - static final String[][] NO_STRING_ARR_ARR = new String[0][]; - static final String[] NO_STRINGS = new String[0]; - - public static int bindingToModifierBits(FieldBinding binding) { - int bits = 0; - bits |= (binding.isPublic() ? MOD_PUBLIC : 0); - bits |= (binding.isPrivate() ? MOD_PRIVATE : 0); - bits |= (binding.isProtected() ? MOD_PROTECTED : 0); - bits |= (binding.isStatic() ? MOD_STATIC : 0); - bits |= (binding.isTransient() ? MOD_TRANSIENT : 0); - bits |= (binding.isFinal() ? MOD_FINAL : 0); - bits |= (binding.isVolatile() ? MOD_VOLATILE : 0); - return bits; - } - - public static int bindingToModifierBits(MethodBinding binding) { - int bits = 0; - bits |= (binding.isPublic() ? MOD_PUBLIC : 0); - bits |= (binding.isPrivate() ? MOD_PRIVATE : 0); - bits |= (binding.isProtected() ? MOD_PROTECTED : 0); - bits |= (binding.isStatic() ? MOD_STATIC : 0); - bits |= (binding.isFinal() ? MOD_FINAL : 0); - bits |= (binding.isNative() ? MOD_NATIVE : 0); - bits |= (binding.isAbstract() ? MOD_ABSTRACT : 0); - return bits; - } - - public static int bindingToModifierBits(ReferenceBinding binding) { - int bits = 0; - bits |= (binding.isPublic() ? MOD_PUBLIC : 0); - bits |= (binding.isPrivate() ? MOD_PRIVATE : 0); - bits |= (binding.isProtected() ? MOD_PROTECTED : 0); - bits |= (binding.isStatic() ? MOD_STATIC : 0); - bits |= (binding.isFinal() ? MOD_FINAL : 0); - bits |= (binding.isAbstract() ? MOD_ABSTRACT : 0); - return bits; - } - - static String[] modifierBitsToNames(int bits) { - List<String> strings = new ArrayList<String>(); - - // The order is based on the order in which we want them to appear. - // - if (0 != (bits & MOD_PUBLIC)) { - strings.add("public"); - } - - if (0 != (bits & MOD_PRIVATE)) { - strings.add("private"); - } - - if (0 != (bits & MOD_PROTECTED)) { - strings.add("protected"); - } - - if (0 != (bits & MOD_STATIC)) { - strings.add("static"); - } - - if (0 != (bits & MOD_ABSTRACT)) { - strings.add("abstract"); - } - - if (0 != (bits & MOD_FINAL)) { - strings.add("final"); - } - - if (0 != (bits & MOD_NATIVE)) { - strings.add("native"); - } - - if (0 != (bits & MOD_TRANSIENT)) { - strings.add("transient"); - } - - if (0 != (bits & MOD_VOLATILE)) { - strings.add("volatile"); - } - - return strings.toArray(NO_STRINGS); - } -} ======================================= --- /trunk/dev/core/test/com/google/gwt/dev/javac/impl/JdtBehaviorTest.java Mon Nov 9 19:37:01 2009 +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright 2008 Google Inc. - * - * 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.google.gwt.dev.javac.impl; - -import com.google.gwt.dev.javac.JdtCompiler; - -import junit.framework.TestCase; - -import org.eclipse.jdt.core.compiler.CategorizedProblem; -import org.eclipse.jdt.core.compiler.CharOperation; -import org.eclipse.jdt.internal.compiler.ClassFile; -import org.eclipse.jdt.internal.compiler.CompilationResult; -import org.eclipse.jdt.internal.compiler.Compiler; -import org.eclipse.jdt.internal.compiler.DefaultErrorHandlingPolicies; -import org.eclipse.jdt.internal.compiler.ICompilerRequestor; -import org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader; -import org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException; -import org.eclipse.jdt.internal.compiler.env.ICompilationUnit; -import org.eclipse.jdt.internal.compiler.env.INameEnvironment; -import org.eclipse.jdt.internal.compiler.env.NameEnvironmentAnswer; -import org.eclipse.jdt.internal.compiler.problem.DefaultProblemFactory; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Set; - -/** - * Validates certain JDT behaviors that the compilation process may depend on - * for correctness. One useful aspect would be that if we upgrade JDT in the - * future, this test could help validate our assumptions. - */ -public class JdtBehaviorTest extends TestCase { - - /** - * Hook-point if we need to modify the compiler behavior. - */ - private static class CompilerImpl extends Compiler { - - public CompilerImpl(INameEnvironment environment, - ICompilerRequestor requestor) { - super(environment, DefaultErrorHandlingPolicies.proceedWithAllProblems(), - JdtCompiler.getCompilerOptions(), requestor, - new DefaultProblemFactory(Locale.getDefault())); - } - } - - /** - * Hook point to accept results. - */ - private class ICompilerRequestorImpl implements ICompilerRequestor { - public void acceptResult(CompilationResult result) { - if (result.hasErrors()) { - StringBuilder sb = new StringBuilder(); - for (CategorizedProblem problem : result.getErrors()) { - sb.append(problem.toString()); - sb.append('\n'); - } - fail(sb.toString()); - } - for (ClassFile classFile : result.getClassFiles()) { - char[][] classNameArray = classFile.getCompoundName(); - char[][] packageArray = CharOperation.subarray(classNameArray, 0, - classNameArray.length - 1); - char[] packageName = CharOperation.concatWith(packageArray, '.'); - char[] className = CharOperation.concatWith(classNameArray, '.'); - addPackages(String.valueOf(packageName)); - classFiles.put(String.valueOf(className), classFile); - } - } - - private void addPackages(String packageName) { - while (true) { - packages.add(String.valueOf(packageName)); - int pos = packageName.lastIndexOf('.'); - if (pos > 0) { - packageName = packageName.substring(0, pos); - } else { - packages.add(""); - break; - } - } - } - } - - /** - * How JDT receives files from the environment. - */ - private class INameEnvironmentImpl implements INameEnvironment { - public void cleanup() { - // intentionally blank - } - - public NameEnvironmentAnswer findType(char[] type, char[][] pkg) { - return findType(CharOperation.arrayConcat(pkg, type)); - } - - public NameEnvironmentAnswer findType(char[][] compoundTypeName) { - final char[] typeChars = CharOperation.concatWith(compoundTypeName, '.'); - String typeName = String.valueOf(typeChars); - // System.out.println("findType: " + typeName); - ClassFile classFile = classFiles.get(typeName); - if (classFile != null) { - try { - byte[] bytes = classFile.getBytes(); - char[] loc = classFile.fileName(); - ClassFileReader cfr = new ClassFileReader(bytes, loc); - return new NameEnvironmentAnswer(cfr, null); - } catch (ClassFormatException e) { - throw new RuntimeException("Unexpectedly unable to parse class file", - e); - } - } - return null; - } - - public boolean isPackage(char[][] parentPkg, char[] pkg) { - final char[] pathChars = CharOperation.concatWith(parentPkg, pkg, '.'); - String packageName = String.valueOf(pathChars); - // System.out.println("isPackage: " + packageName); - return packages.contains(packageName); - } - } - - private static class ResourceAdapter implements ICompilationUnit { - - private final MockResource sourceFile; - - public ResourceAdapter(MockResource resource) { - sourceFile = resource; - } - - public char[] getContents() { - return Shared.readSource(sourceFile).toCharArray(); - } - - public char[] getFileName() { - return sourceFile.getLocation().toCharArray(); - } - - public char[] getMainTypeName() { - return Shared.getShortName(Shared.getTypeName(sourceFile)).toCharArray(); - } - - public char[][] getPackageName() { - return CharOperation.splitOn('.', Shared.getPackageName( - Shared.getTypeName(sourceFile)).toCharArray()); - } - - @Override - public String toString() { - return sourceFile.toString(); - } - } - - protected Map<String, ClassFile> classFiles = new HashMap<String, ClassFile>(); - - /** - * New object for each test case. - */ - protected INameEnvironmentImpl environment = new INameEnvironmentImpl(); - - protected Set<String> packages = new HashSet<String>(); - - /** - * New object for each test case. - */ - protected ICompilerRequestorImpl requestor = new ICompilerRequestorImpl(); - - /** - * New object for each test case. - */ - CompilerImpl compiler = new CompilerImpl(environment, requestor); - - public void testIncrementalBuild() { - List<MockResource> resources = new ArrayList<MockResource>(); - Collections.addAll(resources, JavaResourceBase.getStandardResources()); - resources.add(JavaResourceBase.FOO); - doCompile(resources); - - // Now incremental build the bar cup. - doCompile(Arrays.asList(JavaResourceBase.BAR)); - } - - public void testSingleBuild() { - List<MockResource> resources = new ArrayList<MockResource>(); - Collections.addAll(resources, JavaResourceBase.getStandardResources()); - resources.add(JavaResourceBase.FOO); - resources.add(JavaResourceBase.BAR); - doCompile(resources); - } - - private void doCompile(List<? extends MockResource> resources) { - ICompilationUnit[] icus = new ICompilationUnit[resources.size()]; - for (int i = 0; i < icus.length; ++i) { - icus[i] = new ResourceAdapter(resources.get(i)); - } - compiler.compile(icus); - } -} ======================================= --- /trunk/dev/core/src/com/google/gwt/dev/javac/CompilationState.java Mon Nov 9 19:37:01 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/javac/CompilationState.java Tue Nov 10 20:40:43 2009 @@ -19,8 +19,6 @@ import com.google.gwt.core.ext.typeinfo.TypeOracle; import com.google.gwt.dev.javac.CompilationUnit.State; import com.google.gwt.dev.javac.StandardGeneratorContext.Generated; -import com.google.gwt.dev.javac.impl.Shared; -import com.google.gwt.dev.javac.impl.SourceFileCompilationUnit; import com.google.gwt.dev.js.ast.JsProgram; import com.google.gwt.dev.resource.Resource; import com.google.gwt.dev.resource.ResourceOracle; ======================================= --- /trunk/dev/core/src/com/google/gwt/dev/javac/CompiledClass.java Mon Nov 9 20:50:50 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/javac/CompiledClass.java Tue Nov 10 20:40:43 2009 @@ -16,7 +16,6 @@ package com.google.gwt.dev.javac; import com.google.gwt.core.ext.typeinfo.JRealClassType; -import com.google.gwt.dev.javac.impl.Shared; import com.google.gwt.dev.util.DiskCache; import com.google.gwt.dev.util.Name.InternalName; ======================================= --- /trunk/dev/core/src/com/google/gwt/dev/javac/JdtCompiler.java Thu Nov 5 10:41:38 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/javac/JdtCompiler.java Tue Nov 10 20:40:43 2009 @@ -15,7 +15,6 @@ */ package com.google.gwt.dev.javac; -import com.google.gwt.dev.javac.impl.Shared; import com.google.gwt.dev.util.PerfLogger; import com.google.gwt.util.tools.Utility; ======================================= --- /trunk/dev/core/src/com/google/gwt/dev/javac/StandardGeneratorContext.java Tue Nov 10 20:40:00 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/javac/StandardGeneratorContext.java Tue Nov 10 20:40:43 2009 @@ -27,8 +27,6 @@ import com.google.gwt.core.ext.typeinfo.JClassType; import com.google.gwt.core.ext.typeinfo.TypeOracle; import com.google.gwt.dev.cfg.ModuleDef; -import com.google.gwt.dev.javac.impl.FileCompilationUnit; -import com.google.gwt.dev.javac.impl.Shared; import com.google.gwt.dev.resource.ResourceOracle; import com.google.gwt.dev.util.DiskCache; import com.google.gwt.dev.util.PerfLogger; ======================================= --- /trunk/dev/core/src/com/google/gwt/dev/javac/TypeOracleMediator.java Tue Nov 10 20:40:00 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/javac/TypeOracleMediator.java Tue Nov 10 20:40:43 2009 @@ -53,8 +53,6 @@ import com.google.gwt.dev.javac.asm.ResolveTypeSignature; import com.google.gwt.dev.javac.asm.CollectAnnotationData.AnnotationData; import com.google.gwt.dev.javac.asm.CollectClassData.AnnotationEnum; -import com.google.gwt.dev.javac.impl.Shared; -import com.google.gwt.dev.javac.impl.SourceFileCompilationUnit; import com.google.gwt.dev.resource.Resource; import com.google.gwt.dev.util.Name; import com.google.gwt.dev.util.PerfLogger; ======================================= --- /trunk/dev/core/src/com/google/gwt/dev/jdt/AbstractCompiler.java Mon Jul 6 14:45:31 2009 +++ /trunk/dev/core/src/com/google/gwt/dev/jdt/AbstractCompiler.java Tue Nov 10 20:40:43 2009 @@ -21,8 +21,8 @@ import com.google.gwt.dev.javac.CompilationUnit; import com.google.gwt.dev.javac.GWTProblem; import com.google.gwt.dev.javac.JdtCompiler; +import com.google.gwt.dev.javac.Shared; import com.google.gwt.dev.javac.JdtCompiler.CompilationUnitAdapter; -import com.google.gwt.dev.javac.impl.Shared; import com.google.gwt.dev.util.CharArrayComparator; import com.google.gwt.dev.util.Empty; import com.google.gwt.dev.util.PerfLogger; ======================================= --- /trunk/dev/core/test/com/google/gwt/dev/javac/CompilationStateTest.java Mon Nov 9 19:37:01 2009 +++ /trunk/dev/core/test/com/google/gwt/dev/javac/CompilationStateTest.java Tue Nov 10 20:40:43 2009 @@ -19,7 +19,6 @@ import com.google.gwt.dev.javac.impl.JavaResourceBase; import com.google.gwt.dev.javac.impl.MockJavaResource; import com.google.gwt.dev.javac.impl.MockResourceOracle; -import com.google.gwt.dev.javac.impl.Shared; import com.google.gwt.dev.javac.impl.TweakedMockJavaResource; import java.util.Collections; ======================================= --- /trunk/dev/core/test/com/google/gwt/dev/javac/CompilationStateTestBase.java Mon Nov 9 19:37:01 2009 +++ /trunk/dev/core/test/com/google/gwt/dev/javac/CompilationStateTestBase.java Tue Nov 10 20:40:43 2009 @@ -22,7 +22,6 @@ import com.google.gwt.dev.javac.impl.MockJavaResource; import com.google.gwt.dev.javac.impl.MockResource; import com.google.gwt.dev.javac.impl.MockResourceOracle; -import com.google.gwt.dev.javac.impl.Shared; import com.google.gwt.dev.resource.Resource; import com.google.gwt.dev.util.Util; import com.google.gwt.dev.util.log.AbstractTreeLogger; ======================================= --- /trunk/dev/core/test/com/google/gwt/dev/javac/JavaCompilationSuite.java Tue Nov 10 08:11:52 2009 +++ /trunk/dev/core/test/com/google/gwt/dev/javac/JavaCompilationSuite.java Tue Nov 10 20:40:43 2009 @@ -18,7 +18,6 @@ import com.google.gwt.dev.javac.asm.CollectClassDataTest; import com.google.gwt.dev.javac.asm.CollectReferencesVisitorTest; import com.google.gwt.dev.javac.asm.ResolveGenericsTest; -import com.google.gwt.dev.javac.impl.JdtBehaviorTest; import junit.framework.Test; import junit.framework.TestSuite; @@ -36,6 +35,7 @@ suite.addTestSuite(CompilationUnitFileReferenceTest.class); suite.addTestSuite(GWTProblemTest.class); suite.addTestSuite(JavaSourceParserTest.class); + suite.addTestSuite(JdtBehaviorTest.class); suite.addTestSuite(JdtCompilerTest.class); suite.addTestSuite(JSORestrictionsTest.class); suite.addTestSuite(JsniCheckerTest.class); @@ -45,8 +45,6 @@ suite.addTestSuite(CollectReferencesVisitorTest.class); suite.addTestSuite(ResolveGenericsTest.class); - suite.addTestSuite(JdtBehaviorTest.class); - // TODO: Move these to another package. suite.addTestSuite(GeneratedClassnameComparatorTest.class); suite.addTestSuite(GeneratedClassnameFinderTest.class); ======================================= --- /trunk/dev/core/test/com/google/gwt/dev/javac/JdtCompilerTest.java Thu Apr 2 13:44:20 2009 +++ /trunk/dev/core/test/com/google/gwt/dev/javac/JdtCompilerTest.java Tue Nov 10 20:40:43 2009 @@ -16,7 +16,6 @@ package com.google.gwt.dev.javac; import com.google.gwt.dev.javac.impl.JavaResourceBase; -import com.google.gwt.dev.javac.impl.SourceFileCompilationUnit; import com.google.gwt.dev.resource.Resource; import junit.framework.TestCase; ======================================= --- /trunk/dev/core/test/com/google/gwt/dev/javac/TypeOracleMediatorTest.java Mon Nov 9 20:50:50 2009 +++ /trunk/dev/core/test/com/google/gwt/dev/javac/TypeOracleMediatorTest.java Tue Nov 10 20:40:43 2009 @@ -31,7 +31,6 @@ import com.google.gwt.core.ext.typeinfo.TypeOracle; import com.google.gwt.core.ext.typeinfo.TypeOracleException; import com.google.gwt.dev.javac.impl.MockJavaResource; -import com.google.gwt.dev.javac.impl.Shared; import com.google.gwt.dev.javac.impl.StaticJavaResource; import com.google.gwt.dev.resource.Resource; import com.google.gwt.dev.util.log.AbstractTreeLogger; ======================================= --- /trunk/dev/core/test/com/google/gwt/dev/javac/impl/MockJavaResource.java Tue Aug 11 12:45:07 2009 +++ /trunk/dev/core/test/com/google/gwt/dev/javac/impl/MockJavaResource.java Tue Nov 10 20:40:43 2009 @@ -15,6 +15,8 @@ */ package com.google.gwt.dev.javac.impl; +import com.google.gwt.dev.javac.Shared; + public abstract class MockJavaResource extends MockResource { private final String qualifiedTypeName; ======================================= --- /trunk/dev/core/test/com/google/gwt/dev/javac/impl/StaticJavaResource.java Mon Nov 9 19:37:01 2009 +++ /trunk/dev/core/test/com/google/gwt/dev/javac/impl/StaticJavaResource.java Tue Nov 10 20:40:43 2009 @@ -15,6 +15,8 @@ */ package com.google.gwt.dev.javac.impl; +import com.google.gwt.dev.javac.Shared; + public class StaticJavaResource extends MockResource { private final CharSequence source; ======================================= --- /trunk/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiCompatibilityChecker.java Mon Nov 9 19:37:01 2009 +++ /trunk/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiCompatibilityChecker.java Tue Nov 10 20:40:43 2009 @@ -18,7 +18,7 @@ import com.google.gwt.core.ext.TreeLogger; import com.google.gwt.core.ext.UnableToCompleteException; import com.google.gwt.core.ext.typeinfo.NotFoundException; -import com.google.gwt.dev.javac.impl.Shared; +import com.google.gwt.dev.javac.Shared; import com.google.gwt.dev.resource.Resource; import com.google.gwt.dev.util.Util; import com.google.gwt.dev.util.log.AbstractTreeLogger; ======================================= --- /trunk/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiContainer.java Mon Nov 9 19:37:01 2009 +++ /trunk/tools/api-checker/src/com/google/gwt/tools/apichecker/ApiContainer.java Tue Nov 10 20:40:43 2009 @@ -25,8 +25,8 @@ import com.google.gwt.dev.javac.CompilationUnit; import com.google.gwt.dev.javac.CompilationUnitInvalidator; import com.google.gwt.dev.javac.JdtCompiler; +import com.google.gwt.dev.javac.SourceFileCompilationUnit; import com.google.gwt.dev.javac.TypeOracleMediator; -import com.google.gwt.dev.javac.impl.SourceFileCompilationUnit; import com.google.gwt.dev.resource.Resource; import java.util.ArrayList; --~--~---------~--~----~------------~-------~--~----~ http://groups.google.com/group/Google-Web-Toolkit-Contributors -~----------~----~----~----~------~----~------~--~---
