id
int32
0
12.9k
code
sequencelengths
2
264k
5,200
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "abstract", "class", "ClassFileBytesDisassembler", "{", "public", "final", "static", "int", "DETAILED", "=", "1", ";", "public", "final", "static", "int", "DEFAULT", "=", "2", ";", "public", "final", "static", "int", "SYSTEM", "=", "4", ";", "public", "final", "static", "int", "COMPACT", "=", "8", ";", "public", "final", "static", "int", "WORKING_COPY", "=", "16", ";", "public", "abstract", "String", "disassemble", "(", "byte", "[", "]", "classFileBytes", ",", "String", "lineSeparator", ")", "throws", "ClassFormatException", ";", "public", "abstract", "String", "disassemble", "(", "byte", "[", "]", "classFileBytes", ",", "String", "lineSeparator", ",", "int", "mode", ")", "throws", "ClassFormatException", ";", "public", "abstract", "String", "getDescription", "(", ")", ";", "}", "</s>" ]
5,201
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "IConstantPool", "{", "int", "getConstantPoolCount", "(", ")", ";", "int", "getEntryKind", "(", "int", "index", ")", ";", "IConstantPoolEntry", "decodeEntry", "(", "int", "index", ")", ";", "}", "</s>" ]
5,202
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "IConstantValueAttribute", "extends", "IClassFileAttribute", "{", "int", "getConstantValueIndex", "(", ")", ";", "IConstantPoolEntry", "getConstantValue", "(", ")", ";", "}", "</s>" ]
5,203
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "IFieldInfo", "{", "IConstantValueAttribute", "getConstantValueAttribute", "(", ")", ";", "int", "getAccessFlags", "(", ")", ";", "char", "[", "]", "getName", "(", ")", ";", "int", "getNameIndex", "(", ")", ";", "char", "[", "]", "getDescriptor", "(", ")", ";", "int", "getDescriptorIndex", "(", ")", ";", "boolean", "hasConstantValueAttribute", "(", ")", ";", "boolean", "isSynthetic", "(", ")", ";", "boolean", "isDeprecated", "(", ")", ";", "int", "getAttributeCount", "(", ")", ";", "IClassFileAttribute", "[", "]", "getAttributes", "(", ")", ";", "}", "</s>" ]
5,204
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "IAnnotation", "{", "int", "getTypeIndex", "(", ")", ";", "char", "[", "]", "getTypeName", "(", ")", ";", "int", "getComponentsNumber", "(", ")", ";", "IAnnotationComponent", "[", "]", "getComponents", "(", ")", ";", "}", "</s>" ]
5,205
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "ILocalVariableTableEntry", "{", "int", "getStartPC", "(", ")", ";", "int", "getLength", "(", ")", ";", "int", "getNameIndex", "(", ")", ";", "int", "getDescriptorIndex", "(", ")", ";", "int", "getIndex", "(", ")", ";", "char", "[", "]", "getName", "(", ")", ";", "char", "[", "]", "getDescriptor", "(", ")", ";", "}", "</s>" ]
5,206
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "import", "java", ".", "util", ".", "Comparator", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "AST", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "CompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "SortElementsOperation", ";", "import", "org", ".", "eclipse", ".", "text", ".", "edits", ".", "TextEdit", ";", "import", "org", ".", "eclipse", ".", "text", ".", "edits", ".", "TextEditGroup", ";", "public", "final", "class", "CompilationUnitSorter", "{", "private", "CompilationUnitSorter", "(", ")", "{", "}", "private", "static", "void", "checkASTLevel", "(", "int", "level", ")", "{", "switch", "(", "level", ")", "{", "case", "AST", ".", "JLS2", ":", "case", "AST", ".", "JLS3", ":", "break", ";", "default", ":", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "}", "public", "static", "final", "String", "RELATIVE_ORDER", "=", "\"\"", ";", "public", "static", "void", "sort", "(", "ICompilationUnit", "compilationUnit", ",", "int", "[", "]", "positions", ",", "Comparator", "comparator", ",", "int", "options", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "sort", "(", "AST", ".", "JLS2", ",", "compilationUnit", ",", "positions", ",", "comparator", ",", "options", ",", "monitor", ")", ";", "}", "public", "static", "void", "sort", "(", "int", "level", ",", "ICompilationUnit", "compilationUnit", ",", "int", "[", "]", "positions", ",", "Comparator", "comparator", ",", "int", "options", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "if", "(", "compilationUnit", "==", "null", "||", "comparator", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "checkASTLevel", "(", "level", ")", ";", "ICompilationUnit", "[", "]", "compilationUnits", "=", "new", "ICompilationUnit", "[", "]", "{", "compilationUnit", "}", ";", "SortElementsOperation", "operation", "=", "new", "SortElementsOperation", "(", "level", ",", "compilationUnits", ",", "positions", ",", "comparator", ")", ";", "operation", ".", "runOperation", "(", "monitor", ")", ";", "}", "public", "static", "TextEdit", "sort", "(", "CompilationUnit", "unit", ",", "Comparator", "comparator", ",", "int", "options", ",", "TextEditGroup", "group", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "if", "(", "unit", "==", "null", "||", "comparator", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", ")", ";", "}", "SortElementsOperation", "operation", "=", "new", "SortElementsOperation", "(", "AST", ".", "JLS3", ",", "new", "IJavaElement", "[", "]", "{", "unit", ".", "getJavaElement", "(", ")", "}", ",", "null", ",", "comparator", ")", ";", "return", "operation", ".", "calculateEdit", "(", "unit", ",", "group", ")", ";", "}", "}", "</s>" ]
5,207
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "IParameterAnnotation", "{", "int", "getAnnotationsNumber", "(", ")", ";", "IAnnotation", "[", "]", "getAnnotations", "(", ")", ";", "}", "</s>" ]
5,208
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "ISourceAttribute", "extends", "IClassFileAttribute", "{", "int", "getSourceFileIndex", "(", ")", ";", "char", "[", "]", "getSourceFileName", "(", ")", ";", "}", "</s>" ]
5,209
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "ILocalVariableTypeTableEntry", "{", "int", "getStartPC", "(", ")", ";", "int", "getLength", "(", ")", ";", "int", "getNameIndex", "(", ")", ";", "int", "getSignatureIndex", "(", ")", ";", "int", "getIndex", "(", ")", ";", "char", "[", "]", "getName", "(", ")", ";", "char", "[", "]", "getSignature", "(", ")", ";", "}", "</s>" ]
5,210
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "IClassFileReader", "{", "int", "ALL", "=", "0xFFFF", ";", "int", "CONSTANT_POOL", "=", "0x0001", ";", "int", "METHOD_INFOS", "=", "0x0002", "+", "CONSTANT_POOL", ";", "int", "FIELD_INFOS", "=", "0x0004", "+", "CONSTANT_POOL", ";", "int", "SUPER_INTERFACES", "=", "0x0008", "+", "CONSTANT_POOL", ";", "int", "CLASSFILE_ATTRIBUTES", "=", "0x0010", "+", "CONSTANT_POOL", ";", "int", "METHOD_BODIES", "=", "0x0020", ";", "int", "ALL_BUT_METHOD_BODIES", "=", "ALL", "&", "~", "METHOD_BODIES", ";", "int", "getAccessFlags", "(", ")", ";", "IFieldInfo", "[", "]", "getFieldInfos", "(", ")", ";", "char", "[", "]", "[", "]", "getInterfaceNames", "(", ")", ";", "int", "[", "]", "getInterfaceIndexes", "(", ")", ";", "IInnerClassesAttribute", "getInnerClassesAttribute", "(", ")", ";", "IMethodInfo", "[", "]", "getMethodInfos", "(", ")", ";", "char", "[", "]", "getClassName", "(", ")", ";", "int", "getClassIndex", "(", ")", ";", "char", "[", "]", "getSuperclassName", "(", ")", ";", "int", "getSuperclassIndex", "(", ")", ";", "boolean", "isClass", "(", ")", ";", "boolean", "isInterface", "(", ")", ";", "ISourceAttribute", "getSourceFileAttribute", "(", ")", ";", "IConstantPool", "getConstantPool", "(", ")", ";", "int", "getMinorVersion", "(", ")", ";", "int", "getMajorVersion", "(", ")", ";", "int", "getAttributeCount", "(", ")", ";", "IClassFileAttribute", "[", "]", "getAttributes", "(", ")", ";", "int", "getMagic", "(", ")", ";", "int", "getFieldsCount", "(", ")", ";", "int", "getMethodsCount", "(", ")", ";", "}", "</s>" ]
5,211
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "IStackMapAttribute", "extends", "IClassFileAttribute", "{", "int", "getNumberOfEntries", "(", ")", ";", "IStackMapFrame", "[", "]", "getStackMapFrame", "(", ")", ";", "}", "</s>" ]
5,212
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "IEnclosingMethodAttribute", "extends", "IClassFileAttribute", "{", "char", "[", "]", "getEnclosingClass", "(", ")", ";", "int", "getEnclosingClassIndex", "(", ")", ";", "char", "[", "]", "getMethodDescriptor", "(", ")", ";", "int", "getMethodDescriptorIndex", "(", ")", ";", "char", "[", "]", "getMethodName", "(", ")", ";", "int", "getMethodNameIndex", "(", ")", ";", "int", "getMethodNameAndTypeIndex", "(", ")", ";", "}", "</s>" ]
5,213
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "IExceptionAttribute", "extends", "IClassFileAttribute", "{", "int", "getExceptionsNumber", "(", ")", ";", "char", "[", "]", "[", "]", "getExceptionNames", "(", ")", ";", "int", "[", "]", "getExceptionIndexes", "(", ")", ";", "}", "</s>" ]
5,214
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "ICodeAttribute", "extends", "IClassFileAttribute", "{", "int", "getMaxLocals", "(", ")", ";", "int", "getMaxStack", "(", ")", ";", "ILineNumberAttribute", "getLineNumberAttribute", "(", ")", ";", "ILocalVariableAttribute", "getLocalVariableAttribute", "(", ")", ";", "IExceptionTableEntry", "[", "]", "getExceptionTable", "(", ")", ";", "byte", "[", "]", "getBytecodes", "(", ")", ";", "long", "getCodeLength", "(", ")", ";", "int", "getAttributesCount", "(", ")", ";", "IClassFileAttribute", "[", "]", "getAttributes", "(", ")", ";", "int", "getExceptionTableLength", "(", ")", ";", "void", "traverse", "(", "IBytecodeVisitor", "visitor", ")", "throws", "ClassFormatException", ";", "}", "</s>" ]
5,215
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "IAnnotationComponent", "{", "int", "getComponentNameIndex", "(", ")", ";", "char", "[", "]", "getComponentName", "(", ")", ";", "IAnnotationComponentValue", "getComponentValue", "(", ")", ";", "}", "</s>" ]
5,216
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "class", "ByteCodeVisitorAdapter", "implements", "IBytecodeVisitor", "{", "public", "void", "_aaload", "(", "int", "pc", ")", "{", "}", "public", "void", "_aastore", "(", "int", "pc", ")", "{", "}", "public", "void", "_aconst_null", "(", "int", "pc", ")", "{", "}", "public", "void", "_aload_0", "(", "int", "pc", ")", "{", "}", "public", "void", "_aload_1", "(", "int", "pc", ")", "{", "}", "public", "void", "_aload_2", "(", "int", "pc", ")", "{", "}", "public", "void", "_aload_3", "(", "int", "pc", ")", "{", "}", "public", "void", "_aload", "(", "int", "pc", ",", "int", "index", ")", "{", "}", "public", "void", "_anewarray", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "constantClass", ")", "{", "}", "public", "void", "_areturn", "(", "int", "pc", ")", "{", "}", "public", "void", "_arraylength", "(", "int", "pc", ")", "{", "}", "public", "void", "_astore_0", "(", "int", "pc", ")", "{", "}", "public", "void", "_astore_1", "(", "int", "pc", ")", "{", "}", "public", "void", "_astore_2", "(", "int", "pc", ")", "{", "}", "public", "void", "_astore_3", "(", "int", "pc", ")", "{", "}", "public", "void", "_astore", "(", "int", "pc", ",", "int", "index", ")", "{", "}", "public", "void", "_athrow", "(", "int", "pc", ")", "{", "}", "public", "void", "_baload", "(", "int", "pc", ")", "{", "}", "public", "void", "_bastore", "(", "int", "pc", ")", "{", "}", "public", "void", "_bipush", "(", "int", "pc", ",", "byte", "_byte", ")", "{", "}", "public", "void", "_caload", "(", "int", "pc", ")", "{", "}", "public", "void", "_castore", "(", "int", "pc", ")", "{", "}", "public", "void", "_checkcast", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "constantClass", ")", "{", "}", "public", "void", "_d2f", "(", "int", "pc", ")", "{", "}", "public", "void", "_d2i", "(", "int", "pc", ")", "{", "}", "public", "void", "_d2l", "(", "int", "pc", ")", "{", "}", "public", "void", "_dadd", "(", "int", "pc", ")", "{", "}", "public", "void", "_daload", "(", "int", "pc", ")", "{", "}", "public", "void", "_dastore", "(", "int", "pc", ")", "{", "}", "public", "void", "_dcmpg", "(", "int", "pc", ")", "{", "}", "public", "void", "_dcmpl", "(", "int", "pc", ")", "{", "}", "public", "void", "_dconst_0", "(", "int", "pc", ")", "{", "}", "public", "void", "_dconst_1", "(", "int", "pc", ")", "{", "}", "public", "void", "_ddiv", "(", "int", "pc", ")", "{", "}", "public", "void", "_dload_0", "(", "int", "pc", ")", "{", "}", "public", "void", "_dload_1", "(", "int", "pc", ")", "{", "}", "public", "void", "_dload_2", "(", "int", "pc", ")", "{", "}", "public", "void", "_dload_3", "(", "int", "pc", ")", "{", "}", "public", "void", "_dload", "(", "int", "pc", ",", "int", "index", ")", "{", "}", "public", "void", "_dmul", "(", "int", "pc", ")", "{", "}", "public", "void", "_dneg", "(", "int", "pc", ")", "{", "}", "public", "void", "_drem", "(", "int", "pc", ")", "{", "}", "public", "void", "_dreturn", "(", "int", "pc", ")", "{", "}", "public", "void", "_dstore_0", "(", "int", "pc", ")", "{", "}", "public", "void", "_dstore_1", "(", "int", "pc", ")", "{", "}", "public", "void", "_dstore_2", "(", "int", "pc", ")", "{", "}", "public", "void", "_dstore_3", "(", "int", "pc", ")", "{", "}", "public", "void", "_dstore", "(", "int", "pc", ",", "int", "index", ")", "{", "}", "public", "void", "_dsub", "(", "int", "pc", ")", "{", "}", "public", "void", "_dup_x1", "(", "int", "pc", ")", "{", "}", "public", "void", "_dup_x2", "(", "int", "pc", ")", "{", "}", "public", "void", "_dup", "(", "int", "pc", ")", "{", "}", "public", "void", "_dup2_x1", "(", "int", "pc", ")", "{", "}", "public", "void", "_dup2_x2", "(", "int", "pc", ")", "{", "}", "public", "void", "_dup2", "(", "int", "pc", ")", "{", "}", "public", "void", "_f2d", "(", "int", "pc", ")", "{", "}", "public", "void", "_f2i", "(", "int", "pc", ")", "{", "}", "public", "void", "_f2l", "(", "int", "pc", ")", "{", "}", "public", "void", "_fadd", "(", "int", "pc", ")", "{", "}", "public", "void", "_faload", "(", "int", "pc", ")", "{", "}", "public", "void", "_fastore", "(", "int", "pc", ")", "{", "}", "public", "void", "_fcmpg", "(", "int", "pc", ")", "{", "}", "public", "void", "_fcmpl", "(", "int", "pc", ")", "{", "}", "public", "void", "_fconst_0", "(", "int", "pc", ")", "{", "}", "public", "void", "_fconst_1", "(", "int", "pc", ")", "{", "}", "public", "void", "_fconst_2", "(", "int", "pc", ")", "{", "}", "public", "void", "_fdiv", "(", "int", "pc", ")", "{", "}", "public", "void", "_fload_0", "(", "int", "pc", ")", "{", "}", "public", "void", "_fload_1", "(", "int", "pc", ")", "{", "}", "public", "void", "_fload_2", "(", "int", "pc", ")", "{", "}", "public", "void", "_fload_3", "(", "int", "pc", ")", "{", "}", "public", "void", "_fload", "(", "int", "pc", ",", "int", "index", ")", "{", "}", "public", "void", "_fmul", "(", "int", "pc", ")", "{", "}", "public", "void", "_fneg", "(", "int", "pc", ")", "{", "}", "public", "void", "_frem", "(", "int", "pc", ")", "{", "}", "public", "void", "_freturn", "(", "int", "pc", ")", "{", "}", "public", "void", "_fstore_0", "(", "int", "pc", ")", "{", "}", "public", "void", "_fstore_1", "(", "int", "pc", ")", "{", "}", "public", "void", "_fstore_2", "(", "int", "pc", ")", "{", "}", "public", "void", "_fstore_3", "(", "int", "pc", ")", "{", "}", "public", "void", "_fstore", "(", "int", "pc", ",", "int", "index", ")", "{", "}", "public", "void", "_fsub", "(", "int", "pc", ")", "{", "}", "public", "void", "_getfield", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "constantFieldref", ")", "{", "}", "public", "void", "_getstatic", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "constantFieldref", ")", "{", "}", "public", "void", "_goto_w", "(", "int", "pc", ",", "int", "branchOffset", ")", "{", "}", "public", "void", "_goto", "(", "int", "pc", ",", "int", "branchOffset", ")", "{", "}", "public", "void", "_i2b", "(", "int", "pc", ")", "{", "}", "public", "void", "_i2c", "(", "int", "pc", ")", "{", "}", "public", "void", "_i2d", "(", "int", "pc", ")", "{", "}", "public", "void", "_i2f", "(", "int", "pc", ")", "{", "}", "public", "void", "_i2l", "(", "int", "pc", ")", "{", "}", "public", "void", "_i2s", "(", "int", "pc", ")", "{", "}", "public", "void", "_iadd", "(", "int", "pc", ")", "{", "}", "public", "void", "_iaload", "(", "int", "pc", ")", "{", "}", "public", "void", "_iand", "(", "int", "pc", ")", "{", "}", "public", "void", "_iastore", "(", "int", "pc", ")", "{", "}", "public", "void", "_iconst_0", "(", "int", "pc", ")", "{", "}", "public", "void", "_iconst_1", "(", "int", "pc", ")", "{", "}", "public", "void", "_iconst_2", "(", "int", "pc", ")", "{", "}", "public", "void", "_iconst_3", "(", "int", "pc", ")", "{", "}", "public", "void", "_iconst_4", "(", "int", "pc", ")", "{", "}", "public", "void", "_iconst_5", "(", "int", "pc", ")", "{", "}", "public", "void", "_iconst_m1", "(", "int", "pc", ")", "{", "}", "public", "void", "_idiv", "(", "int", "pc", ")", "{", "}", "public", "void", "_if_acmpeq", "(", "int", "pc", ",", "int", "branchOffset", ")", "{", "}", "public", "void", "_if_acmpne", "(", "int", "pc", ",", "int", "branchOffset", ")", "{", "}", "public", "void", "_if_icmpeq", "(", "int", "pc", ",", "int", "branchOffset", ")", "{", "}", "public", "void", "_if_icmpge", "(", "int", "pc", ",", "int", "branchOffset", ")", "{", "}", "public", "void", "_if_icmpgt", "(", "int", "pc", ",", "int", "branchOffset", ")", "{", "}", "public", "void", "_if_icmple", "(", "int", "pc", ",", "int", "branchOffset", ")", "{", "}", "public", "void", "_if_icmplt", "(", "int", "pc", ",", "int", "branchOffset", ")", "{", "}", "public", "void", "_if_icmpne", "(", "int", "pc", ",", "int", "branchOffset", ")", "{", "}", "public", "void", "_ifeq", "(", "int", "pc", ",", "int", "branchOffset", ")", "{", "}", "public", "void", "_ifge", "(", "int", "pc", ",", "int", "branchOffset", ")", "{", "}", "public", "void", "_ifgt", "(", "int", "pc", ",", "int", "branchOffset", ")", "{", "}", "public", "void", "_ifle", "(", "int", "pc", ",", "int", "branchOffset", ")", "{", "}", "public", "void", "_iflt", "(", "int", "pc", ",", "int", "branchOffset", ")", "{", "}", "public", "void", "_ifne", "(", "int", "pc", ",", "int", "branchOffset", ")", "{", "}", "public", "void", "_ifnonnull", "(", "int", "pc", ",", "int", "branchOffset", ")", "{", "}", "public", "void", "_ifnull", "(", "int", "pc", ",", "int", "branchOffset", ")", "{", "}", "public", "void", "_iinc", "(", "int", "pc", ",", "int", "index", ",", "int", "_const", ")", "{", "}", "public", "void", "_iload_0", "(", "int", "pc", ")", "{", "}", "public", "void", "_iload_1", "(", "int", "pc", ")", "{", "}", "public", "void", "_iload_2", "(", "int", "pc", ")", "{", "}", "public", "void", "_iload_3", "(", "int", "pc", ")", "{", "}", "public", "void", "_iload", "(", "int", "pc", ",", "int", "index", ")", "{", "}", "public", "void", "_imul", "(", "int", "pc", ")", "{", "}", "public", "void", "_ineg", "(", "int", "pc", ")", "{", "}", "public", "void", "_instanceof", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "constantClass", ")", "{", "}", "public", "void", "_invokedynamic", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "nameEntry", ",", "IConstantPoolEntry", "descriptorEntry", ")", "{", "}", "public", "void", "_invokeinterface", "(", "int", "pc", ",", "int", "index", ",", "byte", "nargs", ",", "IConstantPoolEntry", "constantInterfaceMethodref", ")", "{", "}", "public", "void", "_invokespecial", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "constantMethodref", ")", "{", "}", "public", "void", "_invokestatic", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "constantMethodref", ")", "{", "}", "public", "void", "_invokevirtual", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "constantMethodref", ")", "{", "}", "public", "void", "_ior", "(", "int", "pc", ")", "{", "}", "public", "void", "_irem", "(", "int", "pc", ")", "{", "}", "public", "void", "_ireturn", "(", "int", "pc", ")", "{", "}", "public", "void", "_ishl", "(", "int", "pc", ")", "{", "}", "public", "void", "_ishr", "(", "int", "pc", ")", "{", "}", "public", "void", "_istore_0", "(", "int", "pc", ")", "{", "}", "public", "void", "_istore_1", "(", "int", "pc", ")", "{", "}", "public", "void", "_istore_2", "(", "int", "pc", ")", "{", "}", "public", "void", "_istore_3", "(", "int", "pc", ")", "{", "}", "public", "void", "_istore", "(", "int", "pc", ",", "int", "index", ")", "{", "}", "public", "void", "_isub", "(", "int", "pc", ")", "{", "}", "public", "void", "_iushr", "(", "int", "pc", ")", "{", "}", "public", "void", "_ixor", "(", "int", "pc", ")", "{", "}", "public", "void", "_jsr_w", "(", "int", "pc", ",", "int", "branchOffset", ")", "{", "}", "public", "void", "_jsr", "(", "int", "pc", ",", "int", "branchOffset", ")", "{", "}", "public", "void", "_l2d", "(", "int", "pc", ")", "{", "}", "public", "void", "_l2f", "(", "int", "pc", ")", "{", "}", "public", "void", "_l2i", "(", "int", "pc", ")", "{", "}", "public", "void", "_ladd", "(", "int", "pc", ")", "{", "}", "public", "void", "_laload", "(", "int", "pc", ")", "{", "}", "public", "void", "_land", "(", "int", "pc", ")", "{", "}", "public", "void", "_lastore", "(", "int", "pc", ")", "{", "}", "public", "void", "_lcmp", "(", "int", "pc", ")", "{", "}", "public", "void", "_lconst_0", "(", "int", "pc", ")", "{", "}", "public", "void", "_lconst_1", "(", "int", "pc", ")", "{", "}", "public", "void", "_ldc_w", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "constantPoolEntry", ")", "{", "}", "public", "void", "_ldc", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "constantPoolEntry", ")", "{", "}", "public", "void", "_ldc2_w", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "constantPoolEntry", ")", "{", "}", "public", "void", "_ldiv", "(", "int", "pc", ")", "{", "}", "public", "void", "_lload_0", "(", "int", "pc", ")", "{", "}", "public", "void", "_lload_1", "(", "int", "pc", ")", "{", "}", "public", "void", "_lload_2", "(", "int", "pc", ")", "{", "}", "public", "void", "_lload_3", "(", "int", "pc", ")", "{", "}", "public", "void", "_lload", "(", "int", "pc", ",", "int", "index", ")", "{", "}", "public", "void", "_lmul", "(", "int", "pc", ")", "{", "}", "public", "void", "_lneg", "(", "int", "pc", ")", "{", "}", "public", "void", "_lookupswitch", "(", "int", "pc", ",", "int", "defaultoffset", ",", "int", "npairs", ",", "int", "[", "]", "[", "]", "offset_pairs", ")", "{", "}", "public", "void", "_lor", "(", "int", "pc", ")", "{", "}", "public", "void", "_lrem", "(", "int", "pc", ")", "{", "}", "public", "void", "_lreturn", "(", "int", "pc", ")", "{", "}", "public", "void", "_lshl", "(", "int", "pc", ")", "{", "}", "public", "void", "_lshr", "(", "int", "pc", ")", "{", "}", "public", "void", "_lstore_0", "(", "int", "pc", ")", "{", "}", "public", "void", "_lstore_1", "(", "int", "pc", ")", "{", "}", "public", "void", "_lstore_2", "(", "int", "pc", ")", "{", "}", "public", "void", "_lstore_3", "(", "int", "pc", ")", "{", "}", "public", "void", "_lstore", "(", "int", "pc", ",", "int", "index", ")", "{", "}", "public", "void", "_lsub", "(", "int", "pc", ")", "{", "}", "public", "void", "_lushr", "(", "int", "pc", ")", "{", "}", "public", "void", "_lxor", "(", "int", "pc", ")", "{", "}", "public", "void", "_monitorenter", "(", "int", "pc", ")", "{", "}", "public", "void", "_monitorexit", "(", "int", "pc", ")", "{", "}", "public", "void", "_multianewarray", "(", "int", "pc", ",", "int", "index", ",", "int", "dimensions", ",", "IConstantPoolEntry", "constantClass", ")", "{", "}", "public", "void", "_new", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "constantClass", ")", "{", "}", "public", "void", "_newarray", "(", "int", "pc", ",", "int", "atype", ")", "{", "}", "public", "void", "_nop", "(", "int", "pc", ")", "{", "}", "public", "void", "_pop", "(", "int", "pc", ")", "{", "}", "public", "void", "_pop2", "(", "int", "pc", ")", "{", "}", "public", "void", "_putfield", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "constantFieldref", ")", "{", "}", "public", "void", "_putstatic", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "constantFieldref", ")", "{", "}", "public", "void", "_ret", "(", "int", "pc", ",", "int", "index", ")", "{", "}", "public", "void", "_return", "(", "int", "pc", ")", "{", "}", "public", "void", "_saload", "(", "int", "pc", ")", "{", "}", "public", "void", "_sastore", "(", "int", "pc", ")", "{", "}", "public", "void", "_sipush", "(", "int", "pc", ",", "short", "value", ")", "{", "}", "public", "void", "_swap", "(", "int", "pc", ")", "{", "}", "public", "void", "_tableswitch", "(", "int", "pc", ",", "int", "defaultoffset", ",", "int", "low", ",", "int", "high", ",", "int", "[", "]", "jump_offsets", ")", "{", "}", "public", "void", "_wide", "(", "int", "pc", ",", "int", "iincopcode", ",", "int", "index", ",", "int", "_const", ")", "{", "}", "public", "void", "_wide", "(", "int", "pc", ",", "int", "opcode", ",", "int", "index", ")", "{", "}", "public", "void", "_breakpoint", "(", "int", "pc", ")", "{", "}", "public", "void", "_impdep1", "(", "int", "pc", ")", "{", "}", "public", "void", "_impdep2", "(", "int", "pc", ")", "{", "}", "}", "</s>" ]
5,217
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "IAnnotationComponentValue", "{", "int", "BYTE_TAG", "=", "'B'", ";", "int", "CHAR_TAG", "=", "'C'", ";", "int", "DOUBLE_TAG", "=", "'D'", ";", "int", "FLOAT_TAG", "=", "'F'", ";", "int", "INTEGER_TAG", "=", "'I'", ";", "int", "LONG_TAG", "=", "'J'", ";", "int", "SHORT_TAG", "=", "'S'", ";", "int", "BOOLEAN_TAG", "=", "'Z'", ";", "int", "STRING_TAG", "=", "'s'", ";", "int", "ENUM_TAG", "=", "'e'", ";", "int", "CLASS_TAG", "=", "'c'", ";", "int", "ANNOTATION_TAG", "=", "'@'", ";", "int", "ARRAY_TAG", "=", "'['", ";", "IAnnotationComponentValue", "[", "]", "getAnnotationComponentValues", "(", ")", ";", "IAnnotation", "getAnnotationValue", "(", ")", ";", "IConstantPoolEntry", "getClassInfo", "(", ")", ";", "int", "getClassInfoIndex", "(", ")", ";", "IConstantPoolEntry", "getConstantValue", "(", ")", ";", "int", "getConstantValueIndex", "(", ")", ";", "char", "[", "]", "getEnumConstantName", "(", ")", ";", "int", "getEnumConstantNameIndex", "(", ")", ";", "char", "[", "]", "getEnumConstantTypeName", "(", ")", ";", "int", "getEnumConstantTypeNameIndex", "(", ")", ";", "int", "getTag", "(", ")", ";", "int", "getValuesNumber", "(", ")", ";", "}", "</s>" ]
5,218
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "ILocalVariableAttribute", "extends", "IClassFileAttribute", "{", "int", "getLocalVariableTableLength", "(", ")", ";", "ILocalVariableTableEntry", "[", "]", "getLocalVariableTable", "(", ")", ";", "}", "</s>" ]
5,219
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "IRuntimeVisibleParameterAnnotationsAttribute", "extends", "IClassFileAttribute", "{", "int", "getParametersNumber", "(", ")", ";", "IParameterAnnotation", "[", "]", "getParameterAnnotations", "(", ")", ";", "}", "</s>" ]
5,220
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "class", "OpcodeStringValues", "implements", "IOpcodeMnemonics", "{", "public", "static", "final", "String", "[", "]", "BYTECODE_NAMES", "=", "new", "String", "[", "256", "]", ";", "static", "{", "BYTECODE_NAMES", "[", "NOP", "]", "=", "\"nop\"", ";", "BYTECODE_NAMES", "[", "ACONST_NULL", "]", "=", "\"aconst_null\"", ";", "BYTECODE_NAMES", "[", "ICONST_M1", "]", "=", "\"iconst_m1\"", ";", "BYTECODE_NAMES", "[", "ICONST_0", "]", "=", "\"iconst_0\"", ";", "BYTECODE_NAMES", "[", "ICONST_1", "]", "=", "\"iconst_1\"", ";", "BYTECODE_NAMES", "[", "ICONST_2", "]", "=", "\"iconst_2\"", ";", "BYTECODE_NAMES", "[", "ICONST_3", "]", "=", "\"iconst_3\"", ";", "BYTECODE_NAMES", "[", "ICONST_4", "]", "=", "\"iconst_4\"", ";", "BYTECODE_NAMES", "[", "ICONST_5", "]", "=", "\"iconst_5\"", ";", "BYTECODE_NAMES", "[", "LCONST_0", "]", "=", "\"lconst_0\"", ";", "BYTECODE_NAMES", "[", "LCONST_1", "]", "=", "\"lconst_1\"", ";", "BYTECODE_NAMES", "[", "FCONST_0", "]", "=", "\"fconst_0\"", ";", "BYTECODE_NAMES", "[", "FCONST_1", "]", "=", "\"fconst_1\"", ";", "BYTECODE_NAMES", "[", "FCONST_2", "]", "=", "\"fconst_2\"", ";", "BYTECODE_NAMES", "[", "DCONST_0", "]", "=", "\"dconst_0\"", ";", "BYTECODE_NAMES", "[", "DCONST_1", "]", "=", "\"dconst_1\"", ";", "BYTECODE_NAMES", "[", "BIPUSH", "]", "=", "\"bipush\"", ";", "BYTECODE_NAMES", "[", "SIPUSH", "]", "=", "\"sipush\"", ";", "BYTECODE_NAMES", "[", "LDC", "]", "=", "\"ldc\"", ";", "BYTECODE_NAMES", "[", "LDC_W", "]", "=", "\"ldc_w\"", ";", "BYTECODE_NAMES", "[", "LDC2_W", "]", "=", "\"ldc2_w\"", ";", "BYTECODE_NAMES", "[", "ILOAD", "]", "=", "\"iload\"", ";", "BYTECODE_NAMES", "[", "LLOAD", "]", "=", "\"lload\"", ";", "BYTECODE_NAMES", "[", "FLOAD", "]", "=", "\"fload\"", ";", "BYTECODE_NAMES", "[", "DLOAD", "]", "=", "\"dload\"", ";", "BYTECODE_NAMES", "[", "ALOAD", "]", "=", "\"aload\"", ";", "BYTECODE_NAMES", "[", "ILOAD_0", "]", "=", "\"iload_0\"", ";", "BYTECODE_NAMES", "[", "ILOAD_1", "]", "=", "\"iload_1\"", ";", "BYTECODE_NAMES", "[", "ILOAD_2", "]", "=", "\"iload_2\"", ";", "BYTECODE_NAMES", "[", "ILOAD_3", "]", "=", "\"iload_3\"", ";", "BYTECODE_NAMES", "[", "LLOAD_0", "]", "=", "\"lload_0\"", ";", "BYTECODE_NAMES", "[", "LLOAD_1", "]", "=", "\"lload_1\"", ";", "BYTECODE_NAMES", "[", "LLOAD_2", "]", "=", "\"lload_2\"", ";", "BYTECODE_NAMES", "[", "LLOAD_3", "]", "=", "\"lload_3\"", ";", "BYTECODE_NAMES", "[", "FLOAD_0", "]", "=", "\"fload_0\"", ";", "BYTECODE_NAMES", "[", "FLOAD_1", "]", "=", "\"fload_1\"", ";", "BYTECODE_NAMES", "[", "FLOAD_2", "]", "=", "\"fload_2\"", ";", "BYTECODE_NAMES", "[", "FLOAD_3", "]", "=", "\"fload_3\"", ";", "BYTECODE_NAMES", "[", "DLOAD_0", "]", "=", "\"dload_0\"", ";", "BYTECODE_NAMES", "[", "DLOAD_1", "]", "=", "\"dload_1\"", ";", "BYTECODE_NAMES", "[", "DLOAD_2", "]", "=", "\"dload_2\"", ";", "BYTECODE_NAMES", "[", "DLOAD_3", "]", "=", "\"dload_3\"", ";", "BYTECODE_NAMES", "[", "ALOAD_0", "]", "=", "\"aload_0\"", ";", "BYTECODE_NAMES", "[", "ALOAD_1", "]", "=", "\"aload_1\"", ";", "BYTECODE_NAMES", "[", "ALOAD_2", "]", "=", "\"aload_2\"", ";", "BYTECODE_NAMES", "[", "ALOAD_3", "]", "=", "\"aload_3\"", ";", "BYTECODE_NAMES", "[", "IALOAD", "]", "=", "\"iaload\"", ";", "BYTECODE_NAMES", "[", "LALOAD", "]", "=", "\"laload\"", ";", "BYTECODE_NAMES", "[", "FALOAD", "]", "=", "\"faload\"", ";", "BYTECODE_NAMES", "[", "DALOAD", "]", "=", "\"daload\"", ";", "BYTECODE_NAMES", "[", "AALOAD", "]", "=", "\"aaload\"", ";", "BYTECODE_NAMES", "[", "BALOAD", "]", "=", "\"baload\"", ";", "BYTECODE_NAMES", "[", "CALOAD", "]", "=", "\"caload\"", ";", "BYTECODE_NAMES", "[", "SALOAD", "]", "=", "\"saload\"", ";", "BYTECODE_NAMES", "[", "ISTORE", "]", "=", "\"istore\"", ";", "BYTECODE_NAMES", "[", "LSTORE", "]", "=", "\"lstore\"", ";", "BYTECODE_NAMES", "[", "FSTORE", "]", "=", "\"fstore\"", ";", "BYTECODE_NAMES", "[", "DSTORE", "]", "=", "\"dstore\"", ";", "BYTECODE_NAMES", "[", "ASTORE", "]", "=", "\"astore\"", ";", "BYTECODE_NAMES", "[", "ISTORE_0", "]", "=", "\"istore_0\"", ";", "BYTECODE_NAMES", "[", "ISTORE_1", "]", "=", "\"istore_1\"", ";", "BYTECODE_NAMES", "[", "ISTORE_2", "]", "=", "\"istore_2\"", ";", "BYTECODE_NAMES", "[", "ISTORE_3", "]", "=", "\"istore_3\"", ";", "BYTECODE_NAMES", "[", "LSTORE_0", "]", "=", "\"lstore_0\"", ";", "BYTECODE_NAMES", "[", "LSTORE_1", "]", "=", "\"lstore_1\"", ";", "BYTECODE_NAMES", "[", "LSTORE_2", "]", "=", "\"lstore_2\"", ";", "BYTECODE_NAMES", "[", "LSTORE_3", "]", "=", "\"lstore_3\"", ";", "BYTECODE_NAMES", "[", "FSTORE_0", "]", "=", "\"fstore_0\"", ";", "BYTECODE_NAMES", "[", "FSTORE_1", "]", "=", "\"fstore_1\"", ";", "BYTECODE_NAMES", "[", "FSTORE_2", "]", "=", "\"fstore_2\"", ";", "BYTECODE_NAMES", "[", "FSTORE_3", "]", "=", "\"fstore_3\"", ";", "BYTECODE_NAMES", "[", "DSTORE_0", "]", "=", "\"dstore_0\"", ";", "BYTECODE_NAMES", "[", "DSTORE_1", "]", "=", "\"dstore_1\"", ";", "BYTECODE_NAMES", "[", "DSTORE_2", "]", "=", "\"dstore_2\"", ";", "BYTECODE_NAMES", "[", "DSTORE_3", "]", "=", "\"dstore_3\"", ";", "BYTECODE_NAMES", "[", "ASTORE_0", "]", "=", "\"astore_0\"", ";", "BYTECODE_NAMES", "[", "ASTORE_1", "]", "=", "\"astore_1\"", ";", "BYTECODE_NAMES", "[", "ASTORE_2", "]", "=", "\"astore_2\"", ";", "BYTECODE_NAMES", "[", "ASTORE_3", "]", "=", "\"astore_3\"", ";", "BYTECODE_NAMES", "[", "IASTORE", "]", "=", "\"iastore\"", ";", "BYTECODE_NAMES", "[", "LASTORE", "]", "=", "\"lastore\"", ";", "BYTECODE_NAMES", "[", "FASTORE", "]", "=", "\"fastore\"", ";", "BYTECODE_NAMES", "[", "DASTORE", "]", "=", "\"dastore\"", ";", "BYTECODE_NAMES", "[", "AASTORE", "]", "=", "\"aastore\"", ";", "BYTECODE_NAMES", "[", "BASTORE", "]", "=", "\"bastore\"", ";", "BYTECODE_NAMES", "[", "CASTORE", "]", "=", "\"castore\"", ";", "BYTECODE_NAMES", "[", "SASTORE", "]", "=", "\"sastore\"", ";", "BYTECODE_NAMES", "[", "POP", "]", "=", "\"pop\"", ";", "BYTECODE_NAMES", "[", "POP2", "]", "=", "\"pop2\"", ";", "BYTECODE_NAMES", "[", "DUP", "]", "=", "\"dup\"", ";", "BYTECODE_NAMES", "[", "DUP_X1", "]", "=", "\"dup_x1\"", ";", "BYTECODE_NAMES", "[", "DUP_X2", "]", "=", "\"dup_x2\"", ";", "BYTECODE_NAMES", "[", "DUP2", "]", "=", "\"dup2\"", ";", "BYTECODE_NAMES", "[", "DUP2_X1", "]", "=", "\"dup2_x1\"", ";", "BYTECODE_NAMES", "[", "DUP2_X2", "]", "=", "\"dup2_x2\"", ";", "BYTECODE_NAMES", "[", "SWAP", "]", "=", "\"swap\"", ";", "BYTECODE_NAMES", "[", "IADD", "]", "=", "\"iadd\"", ";", "BYTECODE_NAMES", "[", "LADD", "]", "=", "\"ladd\"", ";", "BYTECODE_NAMES", "[", "FADD", "]", "=", "\"fadd\"", ";", "BYTECODE_NAMES", "[", "DADD", "]", "=", "\"dadd\"", ";", "BYTECODE_NAMES", "[", "ISUB", "]", "=", "\"isub\"", ";", "BYTECODE_NAMES", "[", "LSUB", "]", "=", "\"lsub\"", ";", "BYTECODE_NAMES", "[", "FSUB", "]", "=", "\"fsub\"", ";", "BYTECODE_NAMES", "[", "DSUB", "]", "=", "\"dsub\"", ";", "BYTECODE_NAMES", "[", "IMUL", "]", "=", "\"imul\"", ";", "BYTECODE_NAMES", "[", "LMUL", "]", "=", "\"lmul\"", ";", "BYTECODE_NAMES", "[", "FMUL", "]", "=", "\"fmul\"", ";", "BYTECODE_NAMES", "[", "DMUL", "]", "=", "\"dmul\"", ";", "BYTECODE_NAMES", "[", "IDIV", "]", "=", "\"idiv\"", ";", "BYTECODE_NAMES", "[", "LDIV", "]", "=", "\"ldiv\"", ";", "BYTECODE_NAMES", "[", "FDIV", "]", "=", "\"fdiv\"", ";", "BYTECODE_NAMES", "[", "DDIV", "]", "=", "\"ddiv\"", ";", "BYTECODE_NAMES", "[", "IREM", "]", "=", "\"irem\"", ";", "BYTECODE_NAMES", "[", "LREM", "]", "=", "\"lrem\"", ";", "BYTECODE_NAMES", "[", "FREM", "]", "=", "\"frem\"", ";", "BYTECODE_NAMES", "[", "DREM", "]", "=", "\"drem\"", ";", "BYTECODE_NAMES", "[", "INEG", "]", "=", "\"ineg\"", ";", "BYTECODE_NAMES", "[", "LNEG", "]", "=", "\"lneg\"", ";", "BYTECODE_NAMES", "[", "FNEG", "]", "=", "\"fneg\"", ";", "BYTECODE_NAMES", "[", "DNEG", "]", "=", "\"dneg\"", ";", "BYTECODE_NAMES", "[", "ISHL", "]", "=", "\"ishl\"", ";", "BYTECODE_NAMES", "[", "LSHL", "]", "=", "\"lshl\"", ";", "BYTECODE_NAMES", "[", "ISHR", "]", "=", "\"ishr\"", ";", "BYTECODE_NAMES", "[", "LSHR", "]", "=", "\"lshr\"", ";", "BYTECODE_NAMES", "[", "IUSHR", "]", "=", "\"iushr\"", ";", "BYTECODE_NAMES", "[", "LUSHR", "]", "=", "\"lushr\"", ";", "BYTECODE_NAMES", "[", "IAND", "]", "=", "\"iand\"", ";", "BYTECODE_NAMES", "[", "LAND", "]", "=", "\"land\"", ";", "BYTECODE_NAMES", "[", "IOR", "]", "=", "\"ior\"", ";", "BYTECODE_NAMES", "[", "LOR", "]", "=", "\"lor\"", ";", "BYTECODE_NAMES", "[", "IXOR", "]", "=", "\"ixor\"", ";", "BYTECODE_NAMES", "[", "LXOR", "]", "=", "\"lxor\"", ";", "BYTECODE_NAMES", "[", "IINC", "]", "=", "\"iinc\"", ";", "BYTECODE_NAMES", "[", "I2L", "]", "=", "\"i2l\"", ";", "BYTECODE_NAMES", "[", "I2F", "]", "=", "\"i2f\"", ";", "BYTECODE_NAMES", "[", "I2D", "]", "=", "\"i2d\"", ";", "BYTECODE_NAMES", "[", "L2I", "]", "=", "\"l2i\"", ";", "BYTECODE_NAMES", "[", "L2F", "]", "=", "\"l2f\"", ";", "BYTECODE_NAMES", "[", "L2D", "]", "=", "\"l2d\"", ";", "BYTECODE_NAMES", "[", "F2I", "]", "=", "\"f2i\"", ";", "BYTECODE_NAMES", "[", "F2L", "]", "=", "\"f2l\"", ";", "BYTECODE_NAMES", "[", "F2D", "]", "=", "\"f2d\"", ";", "BYTECODE_NAMES", "[", "D2I", "]", "=", "\"d2i\"", ";", "BYTECODE_NAMES", "[", "D2L", "]", "=", "\"d2l\"", ";", "BYTECODE_NAMES", "[", "D2F", "]", "=", "\"d2f\"", ";", "BYTECODE_NAMES", "[", "I2B", "]", "=", "\"i2b\"", ";", "BYTECODE_NAMES", "[", "I2C", "]", "=", "\"i2c\"", ";", "BYTECODE_NAMES", "[", "I2S", "]", "=", "\"i2s\"", ";", "BYTECODE_NAMES", "[", "LCMP", "]", "=", "\"lcmp\"", ";", "BYTECODE_NAMES", "[", "FCMPL", "]", "=", "\"fcmpl\"", ";", "BYTECODE_NAMES", "[", "FCMPG", "]", "=", "\"fcmpg\"", ";", "BYTECODE_NAMES", "[", "DCMPL", "]", "=", "\"dcmpl\"", ";", "BYTECODE_NAMES", "[", "DCMPG", "]", "=", "\"dcmpg\"", ";", "BYTECODE_NAMES", "[", "IFEQ", "]", "=", "\"ifeq\"", ";", "BYTECODE_NAMES", "[", "IFNE", "]", "=", "\"ifne\"", ";", "BYTECODE_NAMES", "[", "IFLT", "]", "=", "\"iflt\"", ";", "BYTECODE_NAMES", "[", "IFGE", "]", "=", "\"ifge\"", ";", "BYTECODE_NAMES", "[", "IFGT", "]", "=", "\"ifgt\"", ";", "BYTECODE_NAMES", "[", "IFLE", "]", "=", "\"ifle\"", ";", "BYTECODE_NAMES", "[", "IF_ICMPEQ", "]", "=", "\"if_icmpeq\"", ";", "BYTECODE_NAMES", "[", "IF_ICMPNE", "]", "=", "\"if_icmpne\"", ";", "BYTECODE_NAMES", "[", "IF_ICMPLT", "]", "=", "\"if_icmplt\"", ";", "BYTECODE_NAMES", "[", "IF_ICMPGE", "]", "=", "\"if_icmpge\"", ";", "BYTECODE_NAMES", "[", "IF_ICMPGT", "]", "=", "\"if_icmpgt\"", ";", "BYTECODE_NAMES", "[", "IF_ICMPLE", "]", "=", "\"if_icmple\"", ";", "BYTECODE_NAMES", "[", "IF_ACMPEQ", "]", "=", "\"if_acmpeq\"", ";", "BYTECODE_NAMES", "[", "IF_ACMPNE", "]", "=", "\"if_acmpne\"", ";", "BYTECODE_NAMES", "[", "GOTO", "]", "=", "\"goto\"", ";", "BYTECODE_NAMES", "[", "JSR", "]", "=", "\"jsr\"", ";", "BYTECODE_NAMES", "[", "RET", "]", "=", "\"ret\"", ";", "BYTECODE_NAMES", "[", "TABLESWITCH", "]", "=", "\"tableswitch\"", ";", "BYTECODE_NAMES", "[", "LOOKUPSWITCH", "]", "=", "\"lookupswitch\"", ";", "BYTECODE_NAMES", "[", "IRETURN", "]", "=", "\"ireturn\"", ";", "BYTECODE_NAMES", "[", "LRETURN", "]", "=", "\"lreturn\"", ";", "BYTECODE_NAMES", "[", "FRETURN", "]", "=", "\"freturn\"", ";", "BYTECODE_NAMES", "[", "DRETURN", "]", "=", "\"dreturn\"", ";", "BYTECODE_NAMES", "[", "ARETURN", "]", "=", "\"areturn\"", ";", "BYTECODE_NAMES", "[", "RETURN", "]", "=", "\"return\"", ";", "BYTECODE_NAMES", "[", "GETSTATIC", "]", "=", "\"getstatic\"", ";", "BYTECODE_NAMES", "[", "PUTSTATIC", "]", "=", "\"putstatic\"", ";", "BYTECODE_NAMES", "[", "GETFIELD", "]", "=", "\"getfield\"", ";", "BYTECODE_NAMES", "[", "PUTFIELD", "]", "=", "\"putfield\"", ";", "BYTECODE_NAMES", "[", "INVOKEVIRTUAL", "]", "=", "\"\"", ";", "BYTECODE_NAMES", "[", "INVOKESPECIAL", "]", "=", "\"\"", ";", "BYTECODE_NAMES", "[", "INVOKESTATIC", "]", "=", "\"invokestatic\"", ";", "BYTECODE_NAMES", "[", "INVOKEINTERFACE", "]", "=", "\"\"", ";", "BYTECODE_NAMES", "[", "INVOKEDYNAMIC", "]", "=", "\"\"", ";", "BYTECODE_NAMES", "[", "NEW", "]", "=", "\"new\"", ";", "BYTECODE_NAMES", "[", "NEWARRAY", "]", "=", "\"newarray\"", ";", "BYTECODE_NAMES", "[", "ANEWARRAY", "]", "=", "\"anewarray\"", ";", "BYTECODE_NAMES", "[", "ARRAYLENGTH", "]", "=", "\"arraylength\"", ";", "BYTECODE_NAMES", "[", "ATHROW", "]", "=", "\"athrow\"", ";", "BYTECODE_NAMES", "[", "CHECKCAST", "]", "=", "\"checkcast\"", ";", "BYTECODE_NAMES", "[", "INSTANCEOF", "]", "=", "\"instanceof\"", ";", "BYTECODE_NAMES", "[", "MONITORENTER", "]", "=", "\"monitorenter\"", ";", "BYTECODE_NAMES", "[", "MONITOREXIT", "]", "=", "\"monitorexit\"", ";", "BYTECODE_NAMES", "[", "WIDE", "]", "=", "\"wide\"", ";", "BYTECODE_NAMES", "[", "MULTIANEWARRAY", "]", "=", "\"\"", ";", "BYTECODE_NAMES", "[", "IFNULL", "]", "=", "\"ifnull\"", ";", "BYTECODE_NAMES", "[", "IFNONNULL", "]", "=", "\"ifnonnull\"", ";", "BYTECODE_NAMES", "[", "GOTO_W", "]", "=", "\"goto_w\"", ";", "BYTECODE_NAMES", "[", "JSR_W", "]", "=", "\"jsr_w\"", ";", "BYTECODE_NAMES", "[", "BREAKPOINT", "]", "=", "\"breakpoint\"", ";", "BYTECODE_NAMES", "[", "IMPDEP1", "]", "=", "\"impdep1\"", ";", "BYTECODE_NAMES", "[", "IMPDEP2", "]", "=", "\"impdep2\"", ";", "}", "}", "</s>" ]
5,221
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "ILocalVariableTypeTableAttribute", "extends", "IClassFileAttribute", "{", "int", "getLocalVariableTypeTableLength", "(", ")", ";", "ILocalVariableTypeTableEntry", "[", "]", "getLocalVariableTypeTable", "(", ")", ";", "}", "</s>" ]
5,222
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "IOpcodeMnemonics", "{", "int", "NOP", "=", "0x00", ";", "int", "ACONST_NULL", "=", "0x01", ";", "int", "ICONST_M1", "=", "0x02", ";", "int", "ICONST_0", "=", "0x03", ";", "int", "ICONST_1", "=", "0x04", ";", "int", "ICONST_2", "=", "0x05", ";", "int", "ICONST_3", "=", "0x06", ";", "int", "ICONST_4", "=", "0x07", ";", "int", "ICONST_5", "=", "0x08", ";", "int", "LCONST_0", "=", "0x09", ";", "int", "LCONST_1", "=", "0x0A", ";", "int", "FCONST_0", "=", "0x0B", ";", "int", "FCONST_1", "=", "0x0C", ";", "int", "FCONST_2", "=", "0x0D", ";", "int", "DCONST_0", "=", "0x0E", ";", "int", "DCONST_1", "=", "0x0F", ";", "int", "BIPUSH", "=", "0x10", ";", "int", "SIPUSH", "=", "0x11", ";", "int", "LDC", "=", "0x12", ";", "int", "LDC_W", "=", "0x13", ";", "int", "LDC2_W", "=", "0x14", ";", "int", "ILOAD", "=", "0x15", ";", "int", "LLOAD", "=", "0x16", ";", "int", "FLOAD", "=", "0x17", ";", "int", "DLOAD", "=", "0x18", ";", "int", "ALOAD", "=", "0x19", ";", "int", "ILOAD_0", "=", "0x1A", ";", "int", "ILOAD_1", "=", "0x1B", ";", "int", "ILOAD_2", "=", "0x1C", ";", "int", "ILOAD_3", "=", "0x1D", ";", "int", "LLOAD_0", "=", "0x1E", ";", "int", "LLOAD_1", "=", "0x1F", ";", "int", "LLOAD_2", "=", "0x20", ";", "int", "LLOAD_3", "=", "0x21", ";", "int", "FLOAD_0", "=", "0x22", ";", "int", "FLOAD_1", "=", "0x23", ";", "int", "FLOAD_2", "=", "0x24", ";", "int", "FLOAD_3", "=", "0x25", ";", "int", "DLOAD_0", "=", "0x26", ";", "int", "DLOAD_1", "=", "0x27", ";", "int", "DLOAD_2", "=", "0x28", ";", "int", "DLOAD_3", "=", "0x29", ";", "int", "ALOAD_0", "=", "0x2A", ";", "int", "ALOAD_1", "=", "0x2B", ";", "int", "ALOAD_2", "=", "0x2C", ";", "int", "ALOAD_3", "=", "0x2D", ";", "int", "IALOAD", "=", "0x2E", ";", "int", "LALOAD", "=", "0x2F", ";", "int", "FALOAD", "=", "0x30", ";", "int", "DALOAD", "=", "0x31", ";", "int", "AALOAD", "=", "0x32", ";", "int", "BALOAD", "=", "0x33", ";", "int", "CALOAD", "=", "0x34", ";", "int", "SALOAD", "=", "0x35", ";", "int", "ISTORE", "=", "0x36", ";", "int", "LSTORE", "=", "0x37", ";", "int", "FSTORE", "=", "0x38", ";", "int", "DSTORE", "=", "0x39", ";", "int", "ASTORE", "=", "0x3A", ";", "int", "ISTORE_0", "=", "0x3B", ";", "int", "ISTORE_1", "=", "0x3C", ";", "int", "ISTORE_2", "=", "0x3D", ";", "int", "ISTORE_3", "=", "0x3E", ";", "int", "LSTORE_0", "=", "0x3F", ";", "int", "LSTORE_1", "=", "0x40", ";", "int", "LSTORE_2", "=", "0x41", ";", "int", "LSTORE_3", "=", "0x42", ";", "int", "FSTORE_0", "=", "0x43", ";", "int", "FSTORE_1", "=", "0x44", ";", "int", "FSTORE_2", "=", "0x45", ";", "int", "FSTORE_3", "=", "0x46", ";", "int", "DSTORE_0", "=", "0x47", ";", "int", "DSTORE_1", "=", "0x48", ";", "int", "DSTORE_2", "=", "0x49", ";", "int", "DSTORE_3", "=", "0x4A", ";", "int", "ASTORE_0", "=", "0x4B", ";", "int", "ASTORE_1", "=", "0x4C", ";", "int", "ASTORE_2", "=", "0x4D", ";", "int", "ASTORE_3", "=", "0x4E", ";", "int", "IASTORE", "=", "0x4F", ";", "int", "LASTORE", "=", "0x50", ";", "int", "FASTORE", "=", "0x51", ";", "int", "DASTORE", "=", "0x52", ";", "int", "AASTORE", "=", "0x53", ";", "int", "BASTORE", "=", "0x54", ";", "int", "CASTORE", "=", "0x55", ";", "int", "SASTORE", "=", "0x56", ";", "int", "POP", "=", "0x57", ";", "int", "POP2", "=", "0x58", ";", "int", "DUP", "=", "0x59", ";", "int", "DUP_X1", "=", "0x5A", ";", "int", "DUP_X2", "=", "0x5B", ";", "int", "DUP2", "=", "0x5C", ";", "int", "DUP2_X1", "=", "0x5D", ";", "int", "DUP2_X2", "=", "0x5E", ";", "int", "SWAP", "=", "0x5F", ";", "int", "IADD", "=", "0x60", ";", "int", "LADD", "=", "0x61", ";", "int", "FADD", "=", "0x62", ";", "int", "DADD", "=", "0x63", ";", "int", "ISUB", "=", "0x64", ";", "int", "LSUB", "=", "0x65", ";", "int", "FSUB", "=", "0x66", ";", "int", "DSUB", "=", "0x67", ";", "int", "IMUL", "=", "0x68", ";", "int", "LMUL", "=", "0x69", ";", "int", "FMUL", "=", "0x6A", ";", "int", "DMUL", "=", "0x6B", ";", "int", "IDIV", "=", "0x6C", ";", "int", "LDIV", "=", "0x6D", ";", "int", "FDIV", "=", "0x6E", ";", "int", "DDIV", "=", "0x6F", ";", "int", "IREM", "=", "0x70", ";", "int", "LREM", "=", "0x71", ";", "int", "FREM", "=", "0x72", ";", "int", "DREM", "=", "0x73", ";", "int", "INEG", "=", "0x74", ";", "int", "LNEG", "=", "0x75", ";", "int", "FNEG", "=", "0x76", ";", "int", "DNEG", "=", "0x77", ";", "int", "ISHL", "=", "0x78", ";", "int", "LSHL", "=", "0x79", ";", "int", "ISHR", "=", "0x7A", ";", "int", "LSHR", "=", "0x7B", ";", "int", "IUSHR", "=", "0x7C", ";", "int", "LUSHR", "=", "0x7D", ";", "int", "IAND", "=", "0x7E", ";", "int", "LAND", "=", "0x7F", ";", "int", "IOR", "=", "0x80", ";", "int", "LOR", "=", "0x81", ";", "int", "IXOR", "=", "0x82", ";", "int", "LXOR", "=", "0x83", ";", "int", "IINC", "=", "0x84", ";", "int", "I2L", "=", "0x85", ";", "int", "I2F", "=", "0x86", ";", "int", "I2D", "=", "0x87", ";", "int", "L2I", "=", "0x88", ";", "int", "L2F", "=", "0x89", ";", "int", "L2D", "=", "0x8A", ";", "int", "F2I", "=", "0x8B", ";", "int", "F2L", "=", "0x8C", ";", "int", "F2D", "=", "0x8D", ";", "int", "D2I", "=", "0x8E", ";", "int", "D2L", "=", "0x8F", ";", "int", "D2F", "=", "0x90", ";", "int", "I2B", "=", "0x91", ";", "int", "I2C", "=", "0x92", ";", "int", "I2S", "=", "0x93", ";", "int", "LCMP", "=", "0x94", ";", "int", "FCMPL", "=", "0x95", ";", "int", "FCMPG", "=", "0x96", ";", "int", "DCMPL", "=", "0x97", ";", "int", "DCMPG", "=", "0x98", ";", "int", "IFEQ", "=", "0x99", ";", "int", "IFNE", "=", "0x9A", ";", "int", "IFLT", "=", "0x9B", ";", "int", "IFGE", "=", "0x9C", ";", "int", "IFGT", "=", "0x9D", ";", "int", "IFLE", "=", "0x9E", ";", "int", "IF_ICMPEQ", "=", "0x9F", ";", "int", "IF_ICMPNE", "=", "0xA0", ";", "int", "IF_ICMPLT", "=", "0xA1", ";", "int", "IF_ICMPGE", "=", "0xA2", ";", "int", "IF_ICMPGT", "=", "0xA3", ";", "int", "IF_ICMPLE", "=", "0xA4", ";", "int", "IF_ACMPEQ", "=", "0xA5", ";", "int", "IF_ACMPNE", "=", "0xA6", ";", "int", "GOTO", "=", "0xA7", ";", "int", "JSR", "=", "0xA8", ";", "int", "RET", "=", "0xA9", ";", "int", "TABLESWITCH", "=", "0xAA", ";", "int", "LOOKUPSWITCH", "=", "0xAB", ";", "int", "IRETURN", "=", "0xAC", ";", "int", "LRETURN", "=", "0xAD", ";", "int", "FRETURN", "=", "0xAE", ";", "int", "DRETURN", "=", "0xAF", ";", "int", "ARETURN", "=", "0xB0", ";", "int", "RETURN", "=", "0xB1", ";", "int", "GETSTATIC", "=", "0xB2", ";", "int", "PUTSTATIC", "=", "0xB3", ";", "int", "GETFIELD", "=", "0xB4", ";", "int", "PUTFIELD", "=", "0xB5", ";", "int", "INVOKEVIRTUAL", "=", "0xB6", ";", "int", "INVOKESPECIAL", "=", "0xB7", ";", "int", "INVOKESTATIC", "=", "0xB8", ";", "int", "INVOKEINTERFACE", "=", "0xB9", ";", "int", "INVOKEDYNAMIC", "=", "0xBA", ";", "int", "NEW", "=", "0xBB", ";", "int", "NEWARRAY", "=", "0xBC", ";", "int", "ANEWARRAY", "=", "0xBD", ";", "int", "ARRAYLENGTH", "=", "0xBE", ";", "int", "ATHROW", "=", "0xBF", ";", "int", "CHECKCAST", "=", "0xC0", ";", "int", "INSTANCEOF", "=", "0xC1", ";", "int", "MONITORENTER", "=", "0xC2", ";", "int", "MONITOREXIT", "=", "0xC3", ";", "int", "WIDE", "=", "0xC4", ";", "int", "MULTIANEWARRAY", "=", "0xC5", ";", "int", "IFNULL", "=", "0xC6", ";", "int", "IFNONNULL", "=", "0xC7", ";", "int", "GOTO_W", "=", "0xC8", ";", "int", "JSR_W", "=", "0xC9", ";", "int", "BREAKPOINT", "=", "0xCA", ";", "int", "IMPDEP1", "=", "0xFE", ";", "int", "IMPDEP2", "=", "0xFF", ";", "}", "</s>" ]
5,223
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "IAttributeNamesConstants", "{", "char", "[", "]", "SYNTHETIC", "=", "\"Synthetic\"", ".", "toCharArray", "(", ")", ";", "char", "[", "]", "CONSTANT_VALUE", "=", "\"\"", ".", "toCharArray", "(", ")", ";", "char", "[", "]", "LINE_NUMBER", "=", "\"\"", ".", "toCharArray", "(", ")", ";", "char", "[", "]", "LOCAL_VARIABLE", "=", "\"\"", ".", "toCharArray", "(", ")", ";", "char", "[", "]", "INNER_CLASSES", "=", "\"InnerClasses\"", ".", "toCharArray", "(", ")", ";", "char", "[", "]", "CODE", "=", "\"Code\"", ".", "toCharArray", "(", ")", ";", "char", "[", "]", "EXCEPTIONS", "=", "\"Exceptions\"", ".", "toCharArray", "(", ")", ";", "char", "[", "]", "SOURCE", "=", "\"SourceFile\"", ".", "toCharArray", "(", ")", ";", "char", "[", "]", "DEPRECATED", "=", "\"Deprecated\"", ".", "toCharArray", "(", ")", ";", "char", "[", "]", "SIGNATURE", "=", "\"Signature\"", ".", "toCharArray", "(", ")", ";", "char", "[", "]", "ENCLOSING_METHOD", "=", "\"\"", ".", "toCharArray", "(", ")", ";", "char", "[", "]", "LOCAL_VARIABLE_TYPE_TABLE", "=", "\"\"", ".", "toCharArray", "(", ")", ";", "char", "[", "]", "RUNTIME_VISIBLE_ANNOTATIONS", "=", "\"\"", ".", "toCharArray", "(", ")", ";", "char", "[", "]", "RUNTIME_INVISIBLE_ANNOTATIONS", "=", "\"\"", ".", "toCharArray", "(", ")", ";", "char", "[", "]", "RUNTIME_VISIBLE_PARAMETER_ANNOTATIONS", "=", "\"\"", ".", "toCharArray", "(", ")", ";", "char", "[", "]", "RUNTIME_INVISIBLE_PARAMETER_ANNOTATIONS", "=", "\"\"", ".", "toCharArray", "(", ")", ";", "char", "[", "]", "ANNOTATION_DEFAULT", "=", "\"\"", ".", "toCharArray", "(", ")", ";", "char", "[", "]", "STACK_MAP_TABLE", "=", "\"\"", ".", "toCharArray", "(", ")", ";", "char", "[", "]", "STACK_MAP", "=", "\"StackMap\"", ".", "toCharArray", "(", ")", ";", "}", "</s>" ]
5,224
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "IBytecodeVisitor", "{", "void", "_aaload", "(", "int", "pc", ")", ";", "void", "_aastore", "(", "int", "pc", ")", ";", "void", "_aconst_null", "(", "int", "pc", ")", ";", "void", "_aload", "(", "int", "pc", ",", "int", "index", ")", ";", "void", "_aload_0", "(", "int", "pc", ")", ";", "void", "_aload_1", "(", "int", "pc", ")", ";", "void", "_aload_2", "(", "int", "pc", ")", ";", "void", "_aload_3", "(", "int", "pc", ")", ";", "void", "_anewarray", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "constantClass", ")", ";", "void", "_areturn", "(", "int", "pc", ")", ";", "void", "_arraylength", "(", "int", "pc", ")", ";", "void", "_astore", "(", "int", "pc", ",", "int", "index", ")", ";", "void", "_astore_0", "(", "int", "pc", ")", ";", "void", "_astore_1", "(", "int", "pc", ")", ";", "void", "_astore_2", "(", "int", "pc", ")", ";", "void", "_astore_3", "(", "int", "pc", ")", ";", "void", "_athrow", "(", "int", "pc", ")", ";", "void", "_baload", "(", "int", "pc", ")", ";", "void", "_bastore", "(", "int", "pc", ")", ";", "void", "_bipush", "(", "int", "pc", ",", "byte", "_byte", ")", ";", "void", "_caload", "(", "int", "pc", ")", ";", "void", "_castore", "(", "int", "pc", ")", ";", "void", "_checkcast", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "constantClass", ")", ";", "void", "_d2f", "(", "int", "pc", ")", ";", "void", "_d2i", "(", "int", "pc", ")", ";", "void", "_d2l", "(", "int", "pc", ")", ";", "void", "_dadd", "(", "int", "pc", ")", ";", "void", "_daload", "(", "int", "pc", ")", ";", "void", "_dastore", "(", "int", "pc", ")", ";", "void", "_dcmpg", "(", "int", "pc", ")", ";", "void", "_dcmpl", "(", "int", "pc", ")", ";", "void", "_dconst_0", "(", "int", "pc", ")", ";", "void", "_dconst_1", "(", "int", "pc", ")", ";", "void", "_ddiv", "(", "int", "pc", ")", ";", "void", "_dload", "(", "int", "pc", ",", "int", "index", ")", ";", "void", "_dload_0", "(", "int", "pc", ")", ";", "void", "_dload_1", "(", "int", "pc", ")", ";", "void", "_dload_2", "(", "int", "pc", ")", ";", "void", "_dload_3", "(", "int", "pc", ")", ";", "void", "_dmul", "(", "int", "pc", ")", ";", "void", "_dneg", "(", "int", "pc", ")", ";", "void", "_drem", "(", "int", "pc", ")", ";", "void", "_dreturn", "(", "int", "pc", ")", ";", "void", "_dstore", "(", "int", "pc", ",", "int", "index", ")", ";", "void", "_dstore_0", "(", "int", "pc", ")", ";", "void", "_dstore_1", "(", "int", "pc", ")", ";", "void", "_dstore_2", "(", "int", "pc", ")", ";", "void", "_dstore_3", "(", "int", "pc", ")", ";", "void", "_dsub", "(", "int", "pc", ")", ";", "void", "_dup", "(", "int", "pc", ")", ";", "void", "_dup_x1", "(", "int", "pc", ")", ";", "void", "_dup_x2", "(", "int", "pc", ")", ";", "void", "_dup2", "(", "int", "pc", ")", ";", "void", "_dup2_x1", "(", "int", "pc", ")", ";", "void", "_dup2_x2", "(", "int", "pc", ")", ";", "void", "_f2d", "(", "int", "pc", ")", ";", "void", "_f2i", "(", "int", "pc", ")", ";", "void", "_f2l", "(", "int", "pc", ")", ";", "void", "_fadd", "(", "int", "pc", ")", ";", "void", "_faload", "(", "int", "pc", ")", ";", "void", "_fastore", "(", "int", "pc", ")", ";", "void", "_fcmpg", "(", "int", "pc", ")", ";", "void", "_fcmpl", "(", "int", "pc", ")", ";", "void", "_fconst_0", "(", "int", "pc", ")", ";", "void", "_fconst_1", "(", "int", "pc", ")", ";", "void", "_fconst_2", "(", "int", "pc", ")", ";", "void", "_fdiv", "(", "int", "pc", ")", ";", "void", "_fload", "(", "int", "pc", ",", "int", "index", ")", ";", "void", "_fload_0", "(", "int", "pc", ")", ";", "void", "_fload_1", "(", "int", "pc", ")", ";", "void", "_fload_2", "(", "int", "pc", ")", ";", "void", "_fload_3", "(", "int", "pc", ")", ";", "void", "_fmul", "(", "int", "pc", ")", ";", "void", "_fneg", "(", "int", "pc", ")", ";", "void", "_frem", "(", "int", "pc", ")", ";", "void", "_freturn", "(", "int", "pc", ")", ";", "void", "_fstore", "(", "int", "pc", ",", "int", "index", ")", ";", "void", "_fstore_0", "(", "int", "pc", ")", ";", "void", "_fstore_1", "(", "int", "pc", ")", ";", "void", "_fstore_2", "(", "int", "pc", ")", ";", "void", "_fstore_3", "(", "int", "pc", ")", ";", "void", "_fsub", "(", "int", "pc", ")", ";", "void", "_getfield", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "constantFieldref", ")", ";", "void", "_getstatic", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "constantFieldref", ")", ";", "void", "_goto", "(", "int", "pc", ",", "int", "branchOffset", ")", ";", "void", "_goto_w", "(", "int", "pc", ",", "int", "branchOffset", ")", ";", "void", "_i2b", "(", "int", "pc", ")", ";", "void", "_i2c", "(", "int", "pc", ")", ";", "void", "_i2d", "(", "int", "pc", ")", ";", "void", "_i2f", "(", "int", "pc", ")", ";", "void", "_i2l", "(", "int", "pc", ")", ";", "void", "_i2s", "(", "int", "pc", ")", ";", "void", "_iadd", "(", "int", "pc", ")", ";", "void", "_iaload", "(", "int", "pc", ")", ";", "void", "_iand", "(", "int", "pc", ")", ";", "void", "_iastore", "(", "int", "pc", ")", ";", "void", "_iconst_m1", "(", "int", "pc", ")", ";", "void", "_iconst_0", "(", "int", "pc", ")", ";", "void", "_iconst_1", "(", "int", "pc", ")", ";", "void", "_iconst_2", "(", "int", "pc", ")", ";", "void", "_iconst_3", "(", "int", "pc", ")", ";", "void", "_iconst_4", "(", "int", "pc", ")", ";", "void", "_iconst_5", "(", "int", "pc", ")", ";", "void", "_idiv", "(", "int", "pc", ")", ";", "void", "_if_acmpeq", "(", "int", "pc", ",", "int", "branchOffset", ")", ";", "void", "_if_acmpne", "(", "int", "pc", ",", "int", "branchOffset", ")", ";", "void", "_if_icmpeq", "(", "int", "pc", ",", "int", "branchOffset", ")", ";", "void", "_if_icmpne", "(", "int", "pc", ",", "int", "branchOffset", ")", ";", "void", "_if_icmplt", "(", "int", "pc", ",", "int", "branchOffset", ")", ";", "void", "_if_icmpge", "(", "int", "pc", ",", "int", "branchOffset", ")", ";", "void", "_if_icmpgt", "(", "int", "pc", ",", "int", "branchOffset", ")", ";", "void", "_if_icmple", "(", "int", "pc", ",", "int", "branchOffset", ")", ";", "void", "_ifeq", "(", "int", "pc", ",", "int", "branchOffset", ")", ";", "void", "_ifne", "(", "int", "pc", ",", "int", "branchOffset", ")", ";", "void", "_iflt", "(", "int", "pc", ",", "int", "branchOffset", ")", ";", "void", "_ifge", "(", "int", "pc", ",", "int", "branchOffset", ")", ";", "void", "_ifgt", "(", "int", "pc", ",", "int", "branchOffset", ")", ";", "void", "_ifle", "(", "int", "pc", ",", "int", "branchOffset", ")", ";", "void", "_ifnonnull", "(", "int", "pc", ",", "int", "branchOffset", ")", ";", "void", "_ifnull", "(", "int", "pc", ",", "int", "branchOffset", ")", ";", "void", "_iinc", "(", "int", "pc", ",", "int", "index", ",", "int", "_const", ")", ";", "void", "_iload", "(", "int", "pc", ",", "int", "index", ")", ";", "void", "_iload_0", "(", "int", "pc", ")", ";", "void", "_iload_1", "(", "int", "pc", ")", ";", "void", "_iload_2", "(", "int", "pc", ")", ";", "void", "_iload_3", "(", "int", "pc", ")", ";", "void", "_imul", "(", "int", "pc", ")", ";", "void", "_ineg", "(", "int", "pc", ")", ";", "void", "_instanceof", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "constantClass", ")", ";", "void", "_invokedynamic", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "nameEntry", ",", "IConstantPoolEntry", "descriptorEntry", ")", ";", "void", "_invokeinterface", "(", "int", "pc", ",", "int", "index", ",", "byte", "nargs", ",", "IConstantPoolEntry", "constantInterfaceMethodref", ")", ";", "void", "_invokespecial", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "constantMethodref", ")", ";", "void", "_invokestatic", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "constantMethodref", ")", ";", "void", "_invokevirtual", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "constantMethodref", ")", ";", "void", "_ior", "(", "int", "pc", ")", ";", "void", "_irem", "(", "int", "pc", ")", ";", "void", "_ireturn", "(", "int", "pc", ")", ";", "void", "_ishl", "(", "int", "pc", ")", ";", "void", "_ishr", "(", "int", "pc", ")", ";", "void", "_istore", "(", "int", "pc", ",", "int", "index", ")", ";", "void", "_istore_0", "(", "int", "pc", ")", ";", "void", "_istore_1", "(", "int", "pc", ")", ";", "void", "_istore_2", "(", "int", "pc", ")", ";", "void", "_istore_3", "(", "int", "pc", ")", ";", "void", "_isub", "(", "int", "pc", ")", ";", "void", "_iushr", "(", "int", "pc", ")", ";", "void", "_ixor", "(", "int", "pc", ")", ";", "void", "_jsr", "(", "int", "pc", ",", "int", "branchOffset", ")", ";", "void", "_jsr_w", "(", "int", "pc", ",", "int", "branchOffset", ")", ";", "void", "_l2d", "(", "int", "pc", ")", ";", "void", "_l2f", "(", "int", "pc", ")", ";", "void", "_l2i", "(", "int", "pc", ")", ";", "void", "_ladd", "(", "int", "pc", ")", ";", "void", "_laload", "(", "int", "pc", ")", ";", "void", "_land", "(", "int", "pc", ")", ";", "void", "_lastore", "(", "int", "pc", ")", ";", "void", "_lcmp", "(", "int", "pc", ")", ";", "void", "_lconst_0", "(", "int", "pc", ")", ";", "void", "_lconst_1", "(", "int", "pc", ")", ";", "void", "_ldc", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "constantPoolEntry", ")", ";", "void", "_ldc_w", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "constantPoolEntry", ")", ";", "void", "_ldc2_w", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "constantPoolEntry", ")", ";", "void", "_ldiv", "(", "int", "pc", ")", ";", "void", "_lload", "(", "int", "pc", ",", "int", "index", ")", ";", "void", "_lload_0", "(", "int", "pc", ")", ";", "void", "_lload_1", "(", "int", "pc", ")", ";", "void", "_lload_2", "(", "int", "pc", ")", ";", "void", "_lload_3", "(", "int", "pc", ")", ";", "void", "_lmul", "(", "int", "pc", ")", ";", "void", "_lneg", "(", "int", "pc", ")", ";", "void", "_lookupswitch", "(", "int", "pc", ",", "int", "defaultoffset", ",", "int", "npairs", ",", "int", "[", "]", "[", "]", "offset_pairs", ")", ";", "void", "_lor", "(", "int", "pc", ")", ";", "void", "_lrem", "(", "int", "pc", ")", ";", "void", "_lreturn", "(", "int", "pc", ")", ";", "void", "_lshl", "(", "int", "pc", ")", ";", "void", "_lshr", "(", "int", "pc", ")", ";", "void", "_lstore", "(", "int", "pc", ",", "int", "index", ")", ";", "void", "_lstore_0", "(", "int", "pc", ")", ";", "void", "_lstore_1", "(", "int", "pc", ")", ";", "void", "_lstore_2", "(", "int", "pc", ")", ";", "void", "_lstore_3", "(", "int", "pc", ")", ";", "void", "_lsub", "(", "int", "pc", ")", ";", "void", "_lushr", "(", "int", "pc", ")", ";", "void", "_lxor", "(", "int", "pc", ")", ";", "void", "_monitorenter", "(", "int", "pc", ")", ";", "void", "_monitorexit", "(", "int", "pc", ")", ";", "void", "_multianewarray", "(", "int", "pc", ",", "int", "index", ",", "int", "dimensions", ",", "IConstantPoolEntry", "constantClass", ")", ";", "void", "_new", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "constantClass", ")", ";", "void", "_newarray", "(", "int", "pc", ",", "int", "atype", ")", ";", "void", "_nop", "(", "int", "pc", ")", ";", "void", "_pop", "(", "int", "pc", ")", ";", "void", "_pop2", "(", "int", "pc", ")", ";", "void", "_putfield", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "constantFieldref", ")", ";", "void", "_putstatic", "(", "int", "pc", ",", "int", "index", ",", "IConstantPoolEntry", "constantFieldref", ")", ";", "void", "_ret", "(", "int", "pc", ",", "int", "index", ")", ";", "void", "_return", "(", "int", "pc", ")", ";", "void", "_saload", "(", "int", "pc", ")", ";", "void", "_sastore", "(", "int", "pc", ")", ";", "void", "_sipush", "(", "int", "pc", ",", "short", "value", ")", ";", "void", "_swap", "(", "int", "pc", ")", ";", "void", "_tableswitch", "(", "int", "pc", ",", "int", "defaultoffset", ",", "int", "low", ",", "int", "high", ",", "int", "[", "]", "jump_offsets", ")", ";", "void", "_wide", "(", "int", "pc", ",", "int", "opcode", ",", "int", "index", ")", ";", "void", "_wide", "(", "int", "pc", ",", "int", "iincopcode", ",", "int", "index", ",", "int", "_const", ")", ";", "void", "_breakpoint", "(", "int", "pc", ")", ";", "void", "_impdep1", "(", "int", "pc", ")", ";", "void", "_impdep2", "(", "int", "pc", ")", ";", "}", "</s>" ]
5,225
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "IRuntimeInvisibleParameterAnnotationsAttribute", "extends", "IClassFileAttribute", "{", "int", "getParametersNumber", "(", ")", ";", "IParameterAnnotation", "[", "]", "getParameterAnnotations", "(", ")", ";", "}", "</s>" ]
5,226
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "IInnerClassesAttributeEntry", "{", "int", "getAccessFlags", "(", ")", ";", "int", "getInnerNameIndex", "(", ")", ";", "int", "getOuterClassNameIndex", "(", ")", ";", "int", "getInnerClassNameIndex", "(", ")", ";", "char", "[", "]", "getInnerName", "(", ")", ";", "char", "[", "]", "getOuterClassName", "(", ")", ";", "char", "[", "]", "getInnerClassName", "(", ")", ";", "}", "</s>" ]
5,227
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "ILineNumberAttribute", "extends", "IClassFileAttribute", "{", "int", "getLineNumberTableLength", "(", ")", ";", "int", "[", "]", "[", "]", "getLineNumberTable", "(", ")", ";", "}", "</s>" ]
5,228
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "IConstantPoolEntry", "{", "int", "getKind", "(", ")", ";", "int", "getClassInfoNameIndex", "(", ")", ";", "int", "getClassIndex", "(", ")", ";", "int", "getNameAndTypeIndex", "(", ")", ";", "int", "getStringIndex", "(", ")", ";", "String", "getStringValue", "(", ")", ";", "int", "getIntegerValue", "(", ")", ";", "float", "getFloatValue", "(", ")", ";", "double", "getDoubleValue", "(", ")", ";", "long", "getLongValue", "(", ")", ";", "int", "getNameAndTypeInfoDescriptorIndex", "(", ")", ";", "int", "getNameAndTypeInfoNameIndex", "(", ")", ";", "char", "[", "]", "getClassInfoName", "(", ")", ";", "char", "[", "]", "getClassName", "(", ")", ";", "char", "[", "]", "getFieldName", "(", ")", ";", "char", "[", "]", "getMethodName", "(", ")", ";", "char", "[", "]", "getFieldDescriptor", "(", ")", ";", "char", "[", "]", "getMethodDescriptor", "(", ")", ";", "char", "[", "]", "getUtf8Value", "(", ")", ";", "int", "getUtf8Length", "(", ")", ";", "}", "</s>" ]
5,229
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "IStackMapTableAttribute", "extends", "IClassFileAttribute", "{", "int", "getNumberOfEntries", "(", ")", ";", "IStackMapFrame", "[", "]", "getStackMapFrame", "(", ")", ";", "}", "</s>" ]
5,230
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "IModifierConstants", "{", "int", "ACC_PUBLIC", "=", "0x0001", ";", "int", "ACC_PRIVATE", "=", "0x0002", ";", "int", "ACC_PROTECTED", "=", "0x0004", ";", "int", "ACC_STATIC", "=", "0x0008", ";", "int", "ACC_FINAL", "=", "0x0010", ";", "int", "ACC_SUPER", "=", "0x0020", ";", "int", "ACC_SYNCHRONIZED", "=", "0x0020", ";", "int", "ACC_VOLATILE", "=", "0x0040", ";", "int", "ACC_BRIDGE", "=", "0x0040", ";", "int", "ACC_TRANSIENT", "=", "0x0080", ";", "int", "ACC_VARARGS", "=", "0x0080", ";", "int", "ACC_NATIVE", "=", "0x0100", ";", "int", "ACC_INTERFACE", "=", "0x0200", ";", "int", "ACC_ABSTRACT", "=", "0x0400", ";", "int", "ACC_STRICT", "=", "0x0800", ";", "int", "ACC_SYNTHETIC", "=", "0x1000", ";", "int", "ACC_ANNOTATION", "=", "0x2000", ";", "int", "ACC_ENUM", "=", "0x4000", ";", "}", "</s>" ]
5,231
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "import", "java", ".", "util", ".", "EventObject", ";", "public", "class", "BufferChangedEvent", "extends", "EventObject", "{", "private", "int", "length", ";", "private", "int", "offset", ";", "private", "String", "text", ";", "private", "static", "final", "long", "serialVersionUID", "=", "655379473891745999L", ";", "public", "BufferChangedEvent", "(", "IBuffer", "buffer", ",", "int", "offset", ",", "int", "length", ",", "String", "text", ")", "{", "super", "(", "buffer", ")", ";", "this", ".", "offset", "=", "offset", ";", "this", ".", "length", "=", "length", ";", "this", ".", "text", "=", "text", ";", "}", "public", "IBuffer", "getBuffer", "(", ")", "{", "return", "(", "IBuffer", ")", "this", ".", "source", ";", "}", "public", "int", "getLength", "(", ")", "{", "return", "this", ".", "length", ";", "}", "public", "int", "getOffset", "(", ")", "{", "return", "this", ".", "offset", ";", "}", "public", "String", "getText", "(", ")", "{", "return", "this", ".", "text", ";", "}", "}", "</s>" ]
5,232
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "public", "interface", "ITypeHierarchyChangedListener", "{", "void", "typeHierarchyChanged", "(", "ITypeHierarchy", "typeHierarchy", ")", ";", "}", "</s>" ]
5,233
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "text", ".", "edits", ".", "TextEdit", ";", "import", "org", ".", "eclipse", ".", "text", ".", "edits", ".", "UndoEdit", ";", "public", "interface", "IBuffer", "{", "public", "interface", "ITextEditCapability", "{", "public", "UndoEdit", "applyTextEdit", "(", "TextEdit", "edit", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "}", "public", "void", "addBufferChangedListener", "(", "IBufferChangedListener", "listener", ")", ";", "public", "void", "append", "(", "char", "[", "]", "text", ")", ";", "public", "void", "append", "(", "String", "text", ")", ";", "public", "void", "close", "(", ")", ";", "public", "char", "getChar", "(", "int", "position", ")", ";", "public", "char", "[", "]", "getCharacters", "(", ")", ";", "public", "String", "getContents", "(", ")", ";", "public", "int", "getLength", "(", ")", ";", "public", "IOpenable", "getOwner", "(", ")", ";", "public", "String", "getText", "(", "int", "offset", ",", "int", "length", ")", "throws", "IndexOutOfBoundsException", ";", "public", "IResource", "getUnderlyingResource", "(", ")", ";", "public", "boolean", "hasUnsavedChanges", "(", ")", ";", "public", "boolean", "isClosed", "(", ")", ";", "public", "boolean", "isReadOnly", "(", ")", ";", "public", "void", "removeBufferChangedListener", "(", "IBufferChangedListener", "listener", ")", ";", "public", "void", "replace", "(", "int", "position", ",", "int", "length", ",", "char", "[", "]", "text", ")", ";", "public", "void", "replace", "(", "int", "position", ",", "int", "length", ",", "String", "text", ")", ";", "public", "void", "save", "(", "IProgressMonitor", "progress", ",", "boolean", "force", ")", "throws", "JavaModelException", ";", "public", "void", "setContents", "(", "char", "[", "]", "contents", ")", ";", "public", "void", "setContents", "(", "String", "contents", ")", ";", "}", "</s>" ]
5,234
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "JavaModelStatus", ";", "public", "abstract", "class", "ClasspathContainerInitializer", "{", "public", "static", "final", "int", "ATTRIBUTE_NOT_SUPPORTED", "=", "1", ";", "public", "static", "final", "int", "ATTRIBUTE_READ_ONLY", "=", "2", ";", "public", "ClasspathContainerInitializer", "(", ")", "{", "}", "public", "abstract", "void", "initialize", "(", "IPath", "containerPath", ",", "IJavaProject", "project", ")", "throws", "CoreException", ";", "public", "boolean", "canUpdateClasspathContainer", "(", "IPath", "containerPath", ",", "IJavaProject", "project", ")", "{", "return", "false", ";", "}", "public", "void", "requestClasspathContainerUpdate", "(", "IPath", "containerPath", ",", "IJavaProject", "project", ",", "IClasspathContainer", "containerSuggestion", ")", "throws", "CoreException", "{", "}", "public", "String", "getDescription", "(", "IPath", "containerPath", ",", "IJavaProject", "project", ")", "{", "return", "containerPath", ".", "makeRelative", "(", ")", ".", "toString", "(", ")", ";", "}", "public", "IClasspathContainer", "getFailureContainer", "(", "final", "IPath", "containerPath", ",", "IJavaProject", "project", ")", "{", "final", "String", "description", "=", "getDescription", "(", "containerPath", ",", "project", ")", ";", "return", "new", "IClasspathContainer", "(", ")", "{", "public", "IClasspathEntry", "[", "]", "getClasspathEntries", "(", ")", "{", "return", "new", "IClasspathEntry", "[", "0", "]", ";", "}", "public", "String", "getDescription", "(", ")", "{", "return", "description", ";", "}", "public", "int", "getKind", "(", ")", "{", "return", "0", ";", "}", "public", "IPath", "getPath", "(", ")", "{", "return", "containerPath", ";", "}", "public", "String", "toString", "(", ")", "{", "return", "getDescription", "(", ")", ";", "}", "}", ";", "}", "public", "Object", "getComparisonID", "(", "IPath", "containerPath", ",", "IJavaProject", "project", ")", "{", "if", "(", "containerPath", "==", "null", ")", "{", "return", "null", ";", "}", "else", "{", "return", "containerPath", ".", "segment", "(", "0", ")", ";", "}", "}", "public", "IStatus", "getAccessRulesStatus", "(", "IPath", "containerPath", ",", "IJavaProject", "project", ")", "{", "if", "(", "canUpdateClasspathContainer", "(", "containerPath", ",", "project", ")", ")", "{", "return", "Status", ".", "OK_STATUS", ";", "}", "return", "new", "JavaModelStatus", "(", "ATTRIBUTE_READ_ONLY", ")", ";", "}", "public", "IStatus", "getAttributeStatus", "(", "IPath", "containerPath", ",", "IJavaProject", "project", ",", "String", "attributeKey", ")", "{", "if", "(", "canUpdateClasspathContainer", "(", "containerPath", ",", "project", ")", ")", "{", "return", "Status", ".", "OK_STATUS", ";", "}", "return", "new", "JavaModelStatus", "(", "ATTRIBUTE_READ_ONLY", ")", ";", "}", "public", "IStatus", "getSourceAttachmentStatus", "(", "IPath", "containerPath", ",", "IJavaProject", "project", ")", "{", "if", "(", "canUpdateClasspathContainer", "(", "containerPath", ",", "project", ")", ")", "{", "return", "Status", ".", "OK_STATUS", ";", "}", "return", "new", "JavaModelStatus", "(", "ATTRIBUTE_READ_ONLY", ")", ";", "}", "}", "</s>" ]
5,235
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "public", "class", "CompletionContext", "{", "public", "static", "final", "int", "TL_MEMBER_START", "=", "1", ";", "public", "static", "final", "int", "TL_STATEMENT_START", "=", "2", ";", "public", "static", "final", "int", "TOKEN_KIND_UNKNOWN", "=", "0", ";", "public", "static", "final", "int", "TOKEN_KIND_NAME", "=", "1", ";", "public", "static", "final", "int", "TOKEN_KIND_STRING_LITERAL", "=", "2", ";", "public", "boolean", "isInJavadoc", "(", ")", "{", "return", "false", ";", "}", "public", "boolean", "isInJavadocText", "(", ")", "{", "return", "false", ";", "}", "public", "boolean", "isInJavadocFormalReference", "(", ")", "{", "return", "false", ";", "}", "public", "boolean", "isExtended", "(", ")", "{", "return", "false", ";", "}", "public", "char", "[", "]", "[", "]", "getExpectedTypesSignatures", "(", ")", "{", "return", "null", ";", "}", "public", "char", "[", "]", "[", "]", "getExpectedTypesKeys", "(", ")", "{", "return", "null", ";", "}", "public", "char", "[", "]", "getToken", "(", ")", "{", "return", "null", ";", "}", "public", "int", "getTokenKind", "(", ")", "{", "return", "-", "1", ";", "}", "public", "int", "getTokenLocation", "(", ")", "{", "return", "-", "1", ";", "}", "public", "int", "getTokenStart", "(", ")", "{", "return", "-", "1", ";", "}", "public", "int", "getTokenEnd", "(", ")", "{", "return", "-", "1", ";", "}", "public", "int", "getOffset", "(", ")", "{", "return", "-", "1", ";", "}", "public", "IJavaElement", "getEnclosingElement", "(", ")", "{", "return", "null", ";", "}", "public", "IJavaElement", "[", "]", "getVisibleElements", "(", "String", "typeSignature", ")", "{", "return", "null", ";", "}", "}", "</s>" ]
5,236
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "public", "interface", "IBufferChangedListener", "{", "public", "void", "bufferChanged", "(", "BufferChangedEvent", "event", ")", ";", "}", "</s>" ]
5,237
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "public", "interface", "IMemberValuePair", "{", "int", "K_INT", "=", "1", ";", "int", "K_BYTE", "=", "2", ";", "int", "K_SHORT", "=", "3", ";", "int", "K_CHAR", "=", "4", ";", "int", "K_FLOAT", "=", "5", ";", "int", "K_DOUBLE", "=", "6", ";", "int", "K_LONG", "=", "7", ";", "int", "K_BOOLEAN", "=", "8", ";", "int", "K_STRING", "=", "9", ";", "int", "K_ANNOTATION", "=", "10", ";", "int", "K_CLASS", "=", "11", ";", "int", "K_QUALIFIED_NAME", "=", "12", ";", "int", "K_SIMPLE_NAME", "=", "13", ";", "int", "K_UNKNOWN", "=", "14", ";", "String", "getMemberName", "(", ")", ";", "Object", "getValue", "(", ")", ";", "int", "getValueKind", "(", ")", ";", "}", "</s>" ]
5,238
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "ASTParser", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "CompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "AST", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "IBinding", ";", "import", "org", ".", "eclipse", ".", "text", ".", "edits", ".", "TextEdit", ";", "import", "org", ".", "eclipse", ".", "text", ".", "edits", ".", "UndoEdit", ";", "public", "interface", "ICompilationUnit", "extends", "ITypeRoot", ",", "IWorkingCopy", ",", "ISourceManipulation", "{", "public", "static", "final", "int", "NO_AST", "=", "0", ";", "public", "static", "final", "int", "FORCE_PROBLEM_DETECTION", "=", "0x01", ";", "public", "static", "final", "int", "ENABLE_STATEMENTS_RECOVERY", "=", "0x02", ";", "public", "static", "final", "int", "ENABLE_BINDINGS_RECOVERY", "=", "0x04", ";", "public", "static", "final", "int", "IGNORE_METHOD_BODIES", "=", "0x08", ";", "public", "UndoEdit", "applyTextEdit", "(", "TextEdit", "edit", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "void", "becomeWorkingCopy", "(", "IProblemRequestor", "problemRequestor", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "void", "becomeWorkingCopy", "(", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "void", "commitWorkingCopy", "(", "boolean", "force", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "IImportDeclaration", "createImport", "(", "String", "name", ",", "IJavaElement", "sibling", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "IImportDeclaration", "createImport", "(", "String", "name", ",", "IJavaElement", "sibling", ",", "int", "flags", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "IPackageDeclaration", "createPackageDeclaration", "(", "String", "name", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "IType", "createType", "(", "String", "contents", ",", "IJavaElement", "sibling", ",", "boolean", "force", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "void", "discardWorkingCopy", "(", ")", "throws", "JavaModelException", ";", "IJavaElement", "[", "]", "findElements", "(", "IJavaElement", "element", ")", ";", "ICompilationUnit", "findWorkingCopy", "(", "WorkingCopyOwner", "owner", ")", ";", "IType", "[", "]", "getAllTypes", "(", ")", "throws", "JavaModelException", ";", "IImportDeclaration", "getImport", "(", "String", "name", ")", ";", "IImportContainer", "getImportContainer", "(", ")", ";", "IImportDeclaration", "[", "]", "getImports", "(", ")", "throws", "JavaModelException", ";", "ICompilationUnit", "getPrimary", "(", ")", ";", "WorkingCopyOwner", "getOwner", "(", ")", ";", "IPackageDeclaration", "getPackageDeclaration", "(", "String", "name", ")", ";", "IPackageDeclaration", "[", "]", "getPackageDeclarations", "(", ")", "throws", "JavaModelException", ";", "IType", "getType", "(", "String", "name", ")", ";", "IType", "[", "]", "getTypes", "(", ")", "throws", "JavaModelException", ";", "ICompilationUnit", "getWorkingCopy", "(", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "ICompilationUnit", "getWorkingCopy", "(", "WorkingCopyOwner", "owner", ",", "IProblemRequestor", "problemRequestor", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "public", "boolean", "hasResourceChanged", "(", ")", ";", "boolean", "isWorkingCopy", "(", ")", ";", "CompilationUnit", "reconcile", "(", "int", "astLevel", ",", "boolean", "forceProblemDetection", ",", "WorkingCopyOwner", "owner", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "CompilationUnit", "reconcile", "(", "int", "astLevel", ",", "boolean", "forceProblemDetection", ",", "boolean", "enableStatementsRecovery", ",", "WorkingCopyOwner", "owner", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "CompilationUnit", "reconcile", "(", "int", "astLevel", ",", "int", "reconcileFlags", ",", "WorkingCopyOwner", "owner", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "void", "restore", "(", ")", "throws", "JavaModelException", ";", "}", "</s>" ]
5,239
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "public", "interface", "ICodeFormatter", "{", "String", "format", "(", "String", "string", ",", "int", "indentationLevel", ",", "int", "[", "]", "positions", ",", "String", "lineSeparator", ")", ";", "}", "</s>" ]
5,240
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IStatus", ";", "public", "interface", "IJavaModelStatus", "extends", "IStatus", "{", "IJavaElement", "[", "]", "getElements", "(", ")", ";", "IPath", "getPath", "(", ")", ";", "String", "getString", "(", ")", ";", "boolean", "isDoesNotExist", "(", ")", ";", "}", "</s>" ]
5,241
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "public", "interface", "IMember", "extends", "IJavaElement", ",", "ISourceReference", ",", "ISourceManipulation", ",", "IParent", "{", "String", "[", "]", "getCategories", "(", ")", "throws", "JavaModelException", ";", "IClassFile", "getClassFile", "(", ")", ";", "ICompilationUnit", "getCompilationUnit", "(", ")", ";", "IType", "getDeclaringType", "(", ")", ";", "int", "getFlags", "(", ")", "throws", "JavaModelException", ";", "ISourceRange", "getJavadocRange", "(", ")", "throws", "JavaModelException", ";", "ISourceRange", "getNameRange", "(", ")", "throws", "JavaModelException", ";", "int", "getOccurrenceCount", "(", ")", ";", "ITypeRoot", "getTypeRoot", "(", ")", ";", "IType", "getType", "(", "String", "name", ",", "int", "occurrenceCount", ")", ";", "boolean", "isBinary", "(", ")", ";", "}", "</s>" ]
5,242
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "public", "interface", "IJavaModelStatusConstants", "{", "public", "static", "final", "int", "INVALID_CP_CONTAINER_ENTRY", "=", "962", ";", "public", "static", "final", "int", "CP_CONTAINER_PATH_UNBOUND", "=", "963", ";", "public", "static", "final", "int", "INVALID_CLASSPATH", "=", "964", ";", "public", "static", "final", "int", "CP_VARIABLE_PATH_UNBOUND", "=", "965", ";", "public", "static", "final", "int", "CORE_EXCEPTION", "=", "966", ";", "public", "static", "final", "int", "INVALID_ELEMENT_TYPES", "=", "967", ";", "public", "static", "final", "int", "NO_ELEMENTS_TO_PROCESS", "=", "968", ";", "public", "static", "final", "int", "ELEMENT_DOES_NOT_EXIST", "=", "969", ";", "public", "static", "final", "int", "NULL_PATH", "=", "970", ";", "public", "static", "final", "int", "PATH_OUTSIDE_PROJECT", "=", "971", ";", "public", "static", "final", "int", "RELATIVE_PATH", "=", "972", ";", "public", "static", "final", "int", "DEVICE_PATH", "=", "973", ";", "public", "static", "final", "int", "NULL_STRING", "=", "974", ";", "public", "static", "final", "int", "READ_ONLY", "=", "976", ";", "public", "static", "final", "int", "NAME_COLLISION", "=", "977", ";", "public", "static", "final", "int", "INVALID_DESTINATION", "=", "978", ";", "public", "static", "final", "int", "INVALID_PATH", "=", "979", ";", "public", "static", "final", "int", "INDEX_OUT_OF_BOUNDS", "=", "980", ";", "public", "static", "final", "int", "UPDATE_CONFLICT", "=", "981", ";", "public", "static", "final", "int", "NULL_NAME", "=", "982", ";", "public", "static", "final", "int", "INVALID_NAME", "=", "983", ";", "public", "static", "final", "int", "INVALID_CONTENTS", "=", "984", ";", "public", "static", "final", "int", "IO_EXCEPTION", "=", "985", ";", "public", "static", "final", "int", "DOM_EXCEPTION", "=", "986", ";", "public", "static", "final", "int", "TARGET_EXCEPTION", "=", "987", ";", "public", "static", "final", "int", "BUILDER_INITIALIZATION_ERROR", "=", "990", ";", "public", "static", "final", "int", "BUILDER_SERIALIZATION_ERROR", "=", "991", ";", "public", "static", "final", "int", "EVALUATION_ERROR", "=", "992", ";", "public", "static", "final", "int", "INVALID_SIBLING", "=", "993", ";", "public", "static", "final", "int", "INVALID_RESOURCE", "=", "995", ";", "public", "static", "final", "int", "INVALID_RESOURCE_TYPE", "=", "996", ";", "public", "static", "final", "int", "INVALID_PROJECT", "=", "997", ";", "public", "static", "final", "int", "INVALID_PACKAGE", "=", "998", ";", "public", "static", "final", "int", "NO_LOCAL_CONTENTS", "=", "999", ";", "public", "static", "final", "int", "INVALID_CLASSPATH_FILE_FORMAT", "=", "1000", ";", "public", "static", "final", "int", "CLASSPATH_CYCLE", "=", "1001", ";", "public", "static", "final", "int", "DISABLED_CP_EXCLUSION_PATTERNS", "=", "1002", ";", "public", "static", "final", "int", "DISABLED_CP_MULTIPLE_OUTPUT_LOCATIONS", "=", "1003", ";", "public", "static", "final", "int", "INCOMPATIBLE_JDK_LEVEL", "=", "1004", ";", "public", "static", "final", "int", "COMPILER_FAILURE", "=", "1005", ";", "public", "static", "final", "int", "ELEMENT_NOT_ON_CLASSPATH", "=", "1006", ";", "public", "static", "final", "int", "CANNOT_RETRIEVE_ATTACHED_JAVADOC", "=", "1008", ";", "public", "static", "final", "int", "UNKNOWN_JAVADOC_FORMAT", "=", "1009", ";", "public", "static", "final", "int", "DEPRECATED_VARIABLE", "=", "1010", ";", "public", "static", "final", "int", "BAD_TEXT_EDIT_LOCATION", "=", "1011", ";", "}", "</s>" ]
5,243
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "public", "interface", "IClassFile", "extends", "ITypeRoot", "{", "ICompilationUnit", "becomeWorkingCopy", "(", "IProblemRequestor", "problemRequestor", ",", "WorkingCopyOwner", "owner", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "byte", "[", "]", "getBytes", "(", ")", "throws", "JavaModelException", ";", "IType", "getType", "(", ")", ";", "IJavaElement", "getWorkingCopy", "(", "IProgressMonitor", "monitor", ",", "IBufferFactory", "factory", ")", "throws", "JavaModelException", ";", "boolean", "isClass", "(", ")", "throws", "JavaModelException", ";", "boolean", "isInterface", "(", ")", "throws", "JavaModelException", ";", "}", "</s>" ]
5,244
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "public", "interface", "IAccessRule", "{", "int", "K_ACCESSIBLE", "=", "0", ";", "int", "K_NON_ACCESSIBLE", "=", "1", ";", "int", "K_DISCOURAGED", "=", "2", ";", "int", "IGNORE_IF_BETTER", "=", "0x100", ";", "IPath", "getPattern", "(", ")", ";", "int", "getKind", "(", ")", ";", "boolean", "ignoreIfBetter", "(", ")", ";", "}", "</s>" ]
5,245
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IProject", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "IAnnotationBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "IMethodBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "IPackageBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "ITypeBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "IVariableBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "eval", ".", "IEvaluationContext", ";", "public", "interface", "IJavaProject", "extends", "IParent", ",", "IJavaElement", ",", "IOpenable", "{", "IClasspathEntry", "decodeClasspathEntry", "(", "String", "encodedEntry", ")", ";", "String", "encodeClasspathEntry", "(", "IClasspathEntry", "classpathEntry", ")", ";", "IJavaElement", "findElement", "(", "IPath", "path", ")", "throws", "JavaModelException", ";", "IJavaElement", "findElement", "(", "IPath", "path", ",", "WorkingCopyOwner", "owner", ")", "throws", "JavaModelException", ";", "IJavaElement", "findElement", "(", "String", "bindingKey", ",", "WorkingCopyOwner", "owner", ")", "throws", "JavaModelException", ";", "IPackageFragment", "findPackageFragment", "(", "IPath", "path", ")", "throws", "JavaModelException", ";", "IPackageFragmentRoot", "findPackageFragmentRoot", "(", "IPath", "path", ")", "throws", "JavaModelException", ";", "IPackageFragmentRoot", "[", "]", "findPackageFragmentRoots", "(", "IClasspathEntry", "entry", ")", ";", "IType", "findType", "(", "String", "fullyQualifiedName", ")", "throws", "JavaModelException", ";", "IType", "findType", "(", "String", "fullyQualifiedName", ",", "IProgressMonitor", "progressMonitor", ")", "throws", "JavaModelException", ";", "IType", "findType", "(", "String", "fullyQualifiedName", ",", "WorkingCopyOwner", "owner", ")", "throws", "JavaModelException", ";", "IType", "findType", "(", "String", "fullyQualifiedName", ",", "WorkingCopyOwner", "owner", ",", "IProgressMonitor", "progressMonitor", ")", "throws", "JavaModelException", ";", "IType", "findType", "(", "String", "packageName", ",", "String", "typeQualifiedName", ")", "throws", "JavaModelException", ";", "IType", "findType", "(", "String", "packageName", ",", "String", "typeQualifiedName", ",", "IProgressMonitor", "progressMonitor", ")", "throws", "JavaModelException", ";", "IType", "findType", "(", "String", "packageName", ",", "String", "typeQualifiedName", ",", "WorkingCopyOwner", "owner", ")", "throws", "JavaModelException", ";", "IType", "findType", "(", "String", "packageName", ",", "String", "typeQualifiedName", ",", "WorkingCopyOwner", "owner", ",", "IProgressMonitor", "progressMonitor", ")", "throws", "JavaModelException", ";", "IPackageFragmentRoot", "[", "]", "getAllPackageFragmentRoots", "(", ")", "throws", "JavaModelException", ";", "Object", "[", "]", "getNonJavaResources", "(", ")", "throws", "JavaModelException", ";", "String", "getOption", "(", "String", "optionName", ",", "boolean", "inheritJavaCoreOptions", ")", ";", "Map", "getOptions", "(", "boolean", "inheritJavaCoreOptions", ")", ";", "IPath", "getOutputLocation", "(", ")", "throws", "JavaModelException", ";", "IPackageFragmentRoot", "getPackageFragmentRoot", "(", "String", "externalLibraryPath", ")", ";", "IPackageFragmentRoot", "getPackageFragmentRoot", "(", "IResource", "resource", ")", ";", "IPackageFragmentRoot", "[", "]", "getPackageFragmentRoots", "(", ")", "throws", "JavaModelException", ";", "IPackageFragmentRoot", "[", "]", "getPackageFragmentRoots", "(", "IClasspathEntry", "entry", ")", ";", "IPackageFragment", "[", "]", "getPackageFragments", "(", ")", "throws", "JavaModelException", ";", "IProject", "getProject", "(", ")", ";", "IClasspathEntry", "[", "]", "getRawClasspath", "(", ")", "throws", "JavaModelException", ";", "String", "[", "]", "getRequiredProjectNames", "(", ")", "throws", "JavaModelException", ";", "IClasspathEntry", "[", "]", "getResolvedClasspath", "(", "boolean", "ignoreUnresolvedEntry", ")", "throws", "JavaModelException", ";", "boolean", "hasBuildState", "(", ")", ";", "boolean", "hasClasspathCycle", "(", "IClasspathEntry", "[", "]", "entries", ")", ";", "boolean", "isOnClasspath", "(", "IJavaElement", "element", ")", ";", "boolean", "isOnClasspath", "(", "IResource", "resource", ")", ";", "IEvaluationContext", "newEvaluationContext", "(", ")", ";", "ITypeHierarchy", "newTypeHierarchy", "(", "IRegion", "region", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "ITypeHierarchy", "newTypeHierarchy", "(", "IRegion", "region", ",", "WorkingCopyOwner", "owner", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "ITypeHierarchy", "newTypeHierarchy", "(", "IType", "type", ",", "IRegion", "region", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "ITypeHierarchy", "newTypeHierarchy", "(", "IType", "type", ",", "IRegion", "region", ",", "WorkingCopyOwner", "owner", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "IPath", "readOutputLocation", "(", ")", ";", "IClasspathEntry", "[", "]", "readRawClasspath", "(", ")", ";", "void", "setOption", "(", "String", "optionName", ",", "String", "optionValue", ")", ";", "void", "setOptions", "(", "Map", "newOptions", ")", ";", "void", "setOutputLocation", "(", "IPath", "path", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "void", "setRawClasspath", "(", "IClasspathEntry", "[", "]", "entries", ",", "IPath", "outputLocation", ",", "boolean", "canModifyResources", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "void", "setRawClasspath", "(", "IClasspathEntry", "[", "]", "entries", ",", "boolean", "canModifyResources", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "void", "setRawClasspath", "(", "IClasspathEntry", "[", "]", "entries", ",", "IClasspathEntry", "[", "]", "referencedEntries", ",", "IPath", "outputLocation", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "IClasspathEntry", "[", "]", "getReferencedClasspathEntries", "(", ")", "throws", "JavaModelException", ";", "void", "setRawClasspath", "(", "IClasspathEntry", "[", "]", "entries", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "void", "setRawClasspath", "(", "IClasspathEntry", "[", "]", "entries", ",", "IPath", "outputLocation", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "}", "</s>" ]
5,246
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "public", "interface", "IElementChangedListener", "{", "public", "void", "elementChanged", "(", "ElementChangedEvent", "event", ")", ";", "}", "</s>" ]
5,247
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "IProblem", ";", "public", "interface", "ICompletionRequestor", "{", "void", "acceptAnonymousType", "(", "char", "[", "]", "superTypePackageName", ",", "char", "[", "]", "superTypeName", ",", "char", "[", "]", "[", "]", "parameterPackageNames", ",", "char", "[", "]", "[", "]", "parameterTypeNames", ",", "char", "[", "]", "[", "]", "parameterNames", ",", "char", "[", "]", "completionName", ",", "int", "modifiers", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", ";", "void", "acceptClass", "(", "char", "[", "]", "packageName", ",", "char", "[", "]", "className", ",", "char", "[", "]", "completionName", ",", "int", "modifiers", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", ";", "void", "acceptError", "(", "IProblem", "error", ")", ";", "void", "acceptField", "(", "char", "[", "]", "declaringTypePackageName", ",", "char", "[", "]", "declaringTypeName", ",", "char", "[", "]", "name", ",", "char", "[", "]", "typePackageName", ",", "char", "[", "]", "typeName", ",", "char", "[", "]", "completionName", ",", "int", "modifiers", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", ";", "void", "acceptInterface", "(", "char", "[", "]", "packageName", ",", "char", "[", "]", "interfaceName", ",", "char", "[", "]", "completionName", ",", "int", "modifiers", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", ";", "void", "acceptKeyword", "(", "char", "[", "]", "keywordName", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", ";", "void", "acceptLabel", "(", "char", "[", "]", "labelName", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", ";", "void", "acceptLocalVariable", "(", "char", "[", "]", "name", ",", "char", "[", "]", "typePackageName", ",", "char", "[", "]", "typeName", ",", "int", "modifiers", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", ";", "void", "acceptMethod", "(", "char", "[", "]", "declaringTypePackageName", ",", "char", "[", "]", "declaringTypeName", ",", "char", "[", "]", "selector", ",", "char", "[", "]", "[", "]", "parameterPackageNames", ",", "char", "[", "]", "[", "]", "parameterTypeNames", ",", "char", "[", "]", "[", "]", "parameterNames", ",", "char", "[", "]", "returnTypePackageName", ",", "char", "[", "]", "returnTypeName", ",", "char", "[", "]", "completionName", ",", "int", "modifiers", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", ";", "void", "acceptMethodDeclaration", "(", "char", "[", "]", "declaringTypePackageName", ",", "char", "[", "]", "declaringTypeName", ",", "char", "[", "]", "selector", ",", "char", "[", "]", "[", "]", "parameterPackageNames", ",", "char", "[", "]", "[", "]", "parameterTypeNames", ",", "char", "[", "]", "[", "]", "parameterNames", ",", "char", "[", "]", "returnTypePackageName", ",", "char", "[", "]", "returnTypeName", ",", "char", "[", "]", "completionName", ",", "int", "modifiers", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", ";", "void", "acceptModifier", "(", "char", "[", "]", "modifierName", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", ";", "void", "acceptPackage", "(", "char", "[", "]", "packageName", ",", "char", "[", "]", "completionName", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", ";", "void", "acceptType", "(", "char", "[", "]", "packageName", ",", "char", "[", "]", "typeName", ",", "char", "[", "]", "completionName", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", ";", "void", "acceptVariableName", "(", "char", "[", "]", "typePackageName", ",", "char", "[", "]", "typeName", ",", "char", "[", "]", "name", ",", "char", "[", "]", "completionName", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", ";", "}", "</s>" ]
5,248
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "public", "interface", "IAnnotatable", "{", "IAnnotation", "getAnnotation", "(", "String", "name", ")", ";", "IAnnotation", "[", "]", "getAnnotations", "(", ")", "throws", "JavaModelException", ";", "}", "</s>" ]
5,249
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "public", "interface", "IRegion", "{", "void", "add", "(", "IJavaElement", "element", ")", ";", "boolean", "contains", "(", "IJavaElement", "element", ")", ";", "IJavaElement", "[", "]", "getElements", "(", ")", ";", "boolean", "remove", "(", "IJavaElement", "element", ")", ";", "}", "</s>" ]
5,250
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "public", "interface", "IClasspathContainer", "{", "int", "K_APPLICATION", "=", "1", ";", "int", "K_SYSTEM", "=", "2", ";", "int", "K_DEFAULT_SYSTEM", "=", "3", ";", "IClasspathEntry", "[", "]", "getClasspathEntries", "(", ")", ";", "String", "getDescription", "(", ")", ";", "int", "getKind", "(", ")", ";", "IPath", "getPath", "(", ")", ";", "}", "</s>" ]
5,251
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "public", "interface", "ILocalVariable", "extends", "IJavaElement", ",", "ISourceReference", ",", "IAnnotatable", "{", "String", "getElementName", "(", ")", ";", "ISourceRange", "getNameRange", "(", ")", ";", "String", "getTypeSignature", "(", ")", ";", "}", "</s>" ]
5,252
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "import", "java", ".", "io", ".", "OutputStream", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "public", "interface", "ITypeHierarchy", "{", "void", "addTypeHierarchyChangedListener", "(", "ITypeHierarchyChangedListener", "listener", ")", ";", "boolean", "contains", "(", "IType", "type", ")", ";", "boolean", "exists", "(", ")", ";", "IType", "[", "]", "getAllClasses", "(", ")", ";", "IType", "[", "]", "getAllInterfaces", "(", ")", ";", "IType", "[", "]", "getAllSubtypes", "(", "IType", "type", ")", ";", "IType", "[", "]", "getAllSuperclasses", "(", "IType", "type", ")", ";", "IType", "[", "]", "getAllSuperInterfaces", "(", "IType", "type", ")", ";", "IType", "[", "]", "getAllSupertypes", "(", "IType", "type", ")", ";", "IType", "[", "]", "getAllTypes", "(", ")", ";", "int", "getCachedFlags", "(", "IType", "type", ")", ";", "IType", "[", "]", "getExtendingInterfaces", "(", "IType", "type", ")", ";", "IType", "[", "]", "getImplementingClasses", "(", "IType", "type", ")", ";", "IType", "[", "]", "getRootClasses", "(", ")", ";", "IType", "[", "]", "getRootInterfaces", "(", ")", ";", "IType", "[", "]", "getSubclasses", "(", "IType", "type", ")", ";", "IType", "[", "]", "getSubtypes", "(", "IType", "type", ")", ";", "IType", "getSuperclass", "(", "IType", "type", ")", ";", "IType", "[", "]", "getSuperInterfaces", "(", "IType", "type", ")", ";", "IType", "[", "]", "getSupertypes", "(", "IType", "type", ")", ";", "IType", "getType", "(", ")", ";", "void", "refresh", "(", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "void", "removeTypeHierarchyChangedListener", "(", "ITypeHierarchyChangedListener", "listener", ")", ";", "void", "store", "(", "OutputStream", "outputStream", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "}", "</s>" ]
5,253
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "public", "interface", "ISourceManipulation", "{", "void", "copy", "(", "IJavaElement", "container", ",", "IJavaElement", "sibling", ",", "String", "rename", ",", "boolean", "replace", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "void", "delete", "(", "boolean", "force", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "void", "move", "(", "IJavaElement", "container", ",", "IJavaElement", "sibling", ",", "String", "rename", ",", "boolean", "replace", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "void", "rename", "(", "String", "name", ",", "boolean", "replace", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "}", "</s>" ]
5,254
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "import", "java", ".", "util", ".", "EventObject", ";", "public", "class", "ElementChangedEvent", "extends", "EventObject", "{", "public", "static", "final", "int", "POST_CHANGE", "=", "1", ";", "public", "static", "final", "int", "PRE_AUTO_BUILD", "=", "2", ";", "public", "static", "final", "int", "POST_RECONCILE", "=", "4", ";", "private", "static", "final", "long", "serialVersionUID", "=", "-", "8947240431612844420L", ";", "private", "int", "type", ";", "public", "ElementChangedEvent", "(", "IJavaElementDelta", "delta", ",", "int", "type", ")", "{", "super", "(", "delta", ")", ";", "this", ".", "type", "=", "type", ";", "}", "public", "IJavaElementDelta", "getDelta", "(", ")", "{", "return", "(", "IJavaElementDelta", ")", "this", ".", "source", ";", "}", "public", "int", "getType", "(", ")", "{", "return", "this", ".", "type", ";", "}", "}", "</s>" ]
5,255
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "io", ".", "ByteArrayOutputStream", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "OutputStreamWriter", ";", "import", "java", ".", "io", ".", "Reader", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "javax", ".", "xml", ".", "parsers", ".", "DocumentBuilder", ";", "import", "javax", ".", "xml", ".", "parsers", ".", "DocumentBuilderFactory", ";", "import", "javax", ".", "xml", ".", "parsers", ".", "ParserConfigurationException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Assert", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Path", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IAccessRule", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IClasspathAttribute", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IClasspathEntry", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Messages", ";", "import", "org", ".", "w3c", ".", "dom", ".", "Element", ";", "import", "org", ".", "w3c", ".", "dom", ".", "Node", ";", "import", "org", ".", "w3c", ".", "dom", ".", "NodeList", ";", "import", "org", ".", "xml", ".", "sax", ".", "InputSource", ";", "import", "org", ".", "xml", ".", "sax", ".", "SAXException", ";", "public", "class", "UserLibrary", "{", "private", "static", "final", "String", "CURRENT_VERSION", "=", "\"1\"", ";", "private", "static", "final", "String", "TAG_VERSION", "=", "\"version\"", ";", "private", "static", "final", "String", "TAG_USERLIBRARY", "=", "\"userlibrary\"", ";", "private", "static", "final", "String", "TAG_SOURCEATTACHMENT", "=", "\"\"", ";", "private", "static", "final", "String", "TAG_SOURCEATTACHMENTROOT", "=", "\"\"", ";", "private", "static", "final", "String", "TAG_PATH", "=", "\"path\"", ";", "private", "static", "final", "String", "TAG_ARCHIVE", "=", "\"archive\"", ";", "private", "static", "final", "String", "TAG_SYSTEMLIBRARY", "=", "\"\"", ";", "private", "boolean", "isSystemLibrary", ";", "private", "IClasspathEntry", "[", "]", "entries", ";", "public", "UserLibrary", "(", "IClasspathEntry", "[", "]", "entries", ",", "boolean", "isSystemLibrary", ")", "{", "Assert", ".", "isNotNull", "(", "entries", ")", ";", "this", ".", "entries", "=", "entries", ";", "this", ".", "isSystemLibrary", "=", "isSystemLibrary", ";", "}", "public", "IClasspathEntry", "[", "]", "getEntries", "(", ")", "{", "return", "this", ".", "entries", ";", "}", "public", "boolean", "isSystemLibrary", "(", ")", "{", "return", "this", ".", "isSystemLibrary", ";", "}", "public", "boolean", "equals", "(", "Object", "obj", ")", "{", "if", "(", "obj", "!=", "null", "&&", "obj", ".", "getClass", "(", ")", "==", "getClass", "(", ")", ")", "{", "UserLibrary", "other", "=", "(", "UserLibrary", ")", "obj", ";", "if", "(", "this", ".", "entries", ".", "length", "==", "other", ".", "entries", ".", "length", "&&", "this", ".", "isSystemLibrary", "==", "other", ".", "isSystemLibrary", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "entries", ".", "length", ";", "i", "++", ")", "{", "if", "(", "!", "this", ".", "entries", "[", "i", "]", ".", "equals", "(", "other", ".", "entries", "[", "i", "]", ")", ")", "{", "return", "false", ";", "}", "}", "return", "true", ";", "}", "}", "return", "false", ";", "}", "public", "int", "hashCode", "(", ")", "{", "int", "hashCode", "=", "0", ";", "if", "(", "this", ".", "isSystemLibrary", ")", "{", "hashCode", "++", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "entries", ".", "length", ";", "i", "++", ")", "{", "hashCode", "=", "hashCode", "*", "17", "+", "this", ".", "entries", ".", "hashCode", "(", ")", ";", "}", "return", "hashCode", ";", "}", "public", "static", "String", "serialize", "(", "IClasspathEntry", "[", "]", "entries", ",", "boolean", "isSystemLibrary", ")", "throws", "IOException", "{", "ByteArrayOutputStream", "s", "=", "new", "ByteArrayOutputStream", "(", ")", ";", "OutputStreamWriter", "writer", "=", "new", "OutputStreamWriter", "(", "s", ",", "\"UTF8\"", ")", ";", "XMLWriter", "xmlWriter", "=", "new", "XMLWriter", "(", "writer", ",", "null", ",", "true", ")", ";", "HashMap", "library", "=", "new", "HashMap", "(", ")", ";", "library", ".", "put", "(", "TAG_VERSION", ",", "String", ".", "valueOf", "(", "CURRENT_VERSION", ")", ")", ";", "library", ".", "put", "(", "TAG_SYSTEMLIBRARY", ",", "String", ".", "valueOf", "(", "isSystemLibrary", ")", ")", ";", "xmlWriter", ".", "printTag", "(", "TAG_USERLIBRARY", ",", "library", ",", "true", ",", "true", ",", "false", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "entries", ".", "length", ";", "i", "<", "length", ";", "++", "i", ")", "{", "ClasspathEntry", "cpEntry", "=", "(", "ClasspathEntry", ")", "entries", "[", "i", "]", ";", "HashMap", "archive", "=", "new", "HashMap", "(", ")", ";", "archive", ".", "put", "(", "TAG_PATH", ",", "cpEntry", ".", "getPath", "(", ")", ".", "toString", "(", ")", ")", ";", "IPath", "sourceAttach", "=", "cpEntry", ".", "getSourceAttachmentPath", "(", ")", ";", "if", "(", "sourceAttach", "!=", "null", ")", "archive", ".", "put", "(", "TAG_SOURCEATTACHMENT", ",", "sourceAttach", ")", ";", "IPath", "sourceAttachRoot", "=", "cpEntry", ".", "getSourceAttachmentRootPath", "(", ")", ";", "if", "(", "sourceAttachRoot", "!=", "null", ")", "archive", ".", "put", "(", "TAG_SOURCEATTACHMENTROOT", ",", "sourceAttachRoot", ")", ";", "boolean", "hasExtraAttributes", "=", "cpEntry", ".", "extraAttributes", "!=", "null", "&&", "cpEntry", ".", "extraAttributes", ".", "length", "!=", "0", ";", "boolean", "hasRestrictions", "=", "cpEntry", ".", "getAccessRuleSet", "(", ")", "!=", "null", ";", "xmlWriter", ".", "printTag", "(", "TAG_ARCHIVE", ",", "archive", ",", "true", ",", "true", ",", "!", "(", "hasExtraAttributes", "||", "hasRestrictions", ")", ")", ";", "if", "(", "hasExtraAttributes", ")", "{", "cpEntry", ".", "encodeExtraAttributes", "(", "xmlWriter", ",", "true", ",", "true", ")", ";", "}", "if", "(", "hasRestrictions", ")", "{", "cpEntry", ".", "encodeAccessRules", "(", "xmlWriter", ",", "true", ",", "true", ")", ";", "}", "if", "(", "hasExtraAttributes", "||", "hasRestrictions", ")", "{", "xmlWriter", ".", "endTag", "(", "TAG_ARCHIVE", ",", "true", ",", "true", ")", ";", "}", "}", "xmlWriter", ".", "endTag", "(", "TAG_USERLIBRARY", ",", "true", ",", "true", ")", ";", "writer", ".", "flush", "(", ")", ";", "writer", ".", "close", "(", ")", ";", "return", "s", ".", "toString", "(", "\"UTF8\"", ")", ";", "}", "public", "static", "UserLibrary", "createFromString", "(", "Reader", "reader", ")", "throws", "IOException", "{", "Element", "cpElement", ";", "try", "{", "DocumentBuilder", "parser", "=", "DocumentBuilderFactory", ".", "newInstance", "(", ")", ".", "newDocumentBuilder", "(", ")", ";", "cpElement", "=", "parser", ".", "parse", "(", "new", "InputSource", "(", "reader", ")", ")", ".", "getDocumentElement", "(", ")", ";", "}", "catch", "(", "SAXException", "e", ")", "{", "throw", "new", "IOException", "(", "Messages", ".", "file_badFormat", ")", ";", "}", "catch", "(", "ParserConfigurationException", "e", ")", "{", "throw", "new", "IOException", "(", "Messages", ".", "file_badFormat", ")", ";", "}", "finally", "{", "reader", ".", "close", "(", ")", ";", "}", "if", "(", "!", "cpElement", ".", "getNodeName", "(", ")", ".", "equalsIgnoreCase", "(", "TAG_USERLIBRARY", ")", ")", "{", "throw", "new", "IOException", "(", "Messages", ".", "file_badFormat", ")", ";", "}", "boolean", "isSystem", "=", "Boolean", ".", "valueOf", "(", "cpElement", ".", "getAttribute", "(", "TAG_SYSTEMLIBRARY", ")", ")", ".", "booleanValue", "(", ")", ";", "NodeList", "list", "=", "cpElement", ".", "getChildNodes", "(", ")", ";", "int", "length", "=", "list", ".", "getLength", "(", ")", ";", "ArrayList", "res", "=", "new", "ArrayList", "(", "length", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "++", "i", ")", "{", "Node", "node", "=", "list", ".", "item", "(", "i", ")", ";", "if", "(", "node", ".", "getNodeType", "(", ")", "==", "Node", ".", "ELEMENT_NODE", ")", "{", "Element", "element", "=", "(", "Element", ")", "node", ";", "if", "(", "element", ".", "getNodeName", "(", ")", ".", "equals", "(", "TAG_ARCHIVE", ")", ")", "{", "String", "path", "=", "element", ".", "getAttribute", "(", "TAG_PATH", ")", ";", "IPath", "sourceAttach", "=", "element", ".", "hasAttribute", "(", "TAG_SOURCEATTACHMENT", ")", "?", "new", "Path", "(", "element", ".", "getAttribute", "(", "TAG_SOURCEATTACHMENT", ")", ")", ":", "null", ";", "IPath", "sourceAttachRoot", "=", "element", ".", "hasAttribute", "(", "TAG_SOURCEATTACHMENTROOT", ")", "?", "new", "Path", "(", "element", ".", "getAttribute", "(", "TAG_SOURCEATTACHMENTROOT", ")", ")", ":", "null", ";", "NodeList", "children", "=", "element", ".", "getElementsByTagName", "(", "\"*\"", ")", ";", "boolean", "[", "]", "foundChildren", "=", "new", "boolean", "[", "children", ".", "getLength", "(", ")", "]", ";", "NodeList", "attributeList", "=", "ClasspathEntry", ".", "getChildAttributes", "(", "ClasspathEntry", ".", "TAG_ATTRIBUTES", ",", "children", ",", "foundChildren", ")", ";", "IClasspathAttribute", "[", "]", "extraAttributes", "=", "ClasspathEntry", ".", "decodeExtraAttributes", "(", "attributeList", ")", ";", "attributeList", "=", "ClasspathEntry", ".", "getChildAttributes", "(", "ClasspathEntry", ".", "TAG_ACCESS_RULES", ",", "children", ",", "foundChildren", ")", ";", "IAccessRule", "[", "]", "accessRules", "=", "ClasspathEntry", ".", "decodeAccessRules", "(", "attributeList", ")", ";", "IClasspathEntry", "entry", "=", "JavaCore", ".", "newLibraryEntry", "(", "new", "Path", "(", "path", ")", ",", "sourceAttach", ",", "sourceAttachRoot", ",", "accessRules", ",", "extraAttributes", ",", "false", ")", ";", "res", ".", "add", "(", "entry", ")", ";", "}", "}", "}", "IClasspathEntry", "[", "]", "entries", "=", "(", "IClasspathEntry", "[", "]", ")", "res", ".", "toArray", "(", "new", "IClasspathEntry", "[", "res", ".", "size", "(", ")", "]", ")", ";", "return", "new", "UserLibrary", "(", "entries", ",", "isSystem", ")", ";", "}", "public", "String", "toString", "(", ")", "{", "if", "(", "this", ".", "entries", "==", "null", ")", "return", "\"null\"", ";", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "int", "length", "=", "this", ".", "entries", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "buffer", ".", "append", "(", "this", ".", "entries", "[", "i", "]", ".", "toString", "(", ")", "+", "'\\n'", ")", ";", "}", "return", "buffer", ".", "toString", "(", ")", ";", "}", "}", "</s>" ]
5,256
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "public", "class", "OpenableElementInfo", "extends", "JavaElementInfo", "{", "protected", "IJavaElement", "[", "]", "children", "=", "JavaElement", ".", "NO_ELEMENTS", ";", "protected", "boolean", "isStructureKnown", "=", "false", ";", "public", "void", "addChild", "(", "IJavaElement", "child", ")", "{", "int", "length", "=", "this", ".", "children", ".", "length", ";", "if", "(", "length", "==", "0", ")", "{", "this", ".", "children", "=", "new", "IJavaElement", "[", "]", "{", "child", "}", ";", "}", "else", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "if", "(", "this", ".", "children", "[", "i", "]", ".", "equals", "(", "child", ")", ")", "return", ";", "}", "System", ".", "arraycopy", "(", "this", ".", "children", ",", "0", ",", "this", ".", "children", "=", "new", "IJavaElement", "[", "length", "+", "1", "]", ",", "0", ",", "length", ")", ";", "this", ".", "children", "[", "length", "]", "=", "child", ";", "}", "}", "public", "IJavaElement", "[", "]", "getChildren", "(", ")", "{", "return", "this", ".", "children", ";", "}", "public", "boolean", "isStructureKnown", "(", ")", "{", "return", "this", ".", "isStructureKnown", ";", "}", "public", "void", "removeChild", "(", "IJavaElement", "child", ")", "{", "for", "(", "int", "i", "=", "0", ",", "length", "=", "this", ".", "children", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IJavaElement", "element", "=", "this", ".", "children", "[", "i", "]", ";", "if", "(", "element", ".", "equals", "(", "child", ")", ")", "{", "if", "(", "length", "==", "1", ")", "{", "this", ".", "children", "=", "JavaElement", ".", "NO_ELEMENTS", ";", "}", "else", "{", "IJavaElement", "[", "]", "newChildren", "=", "new", "IJavaElement", "[", "length", "-", "1", "]", ";", "System", ".", "arraycopy", "(", "this", ".", "children", ",", "0", ",", "newChildren", ",", "0", ",", "i", ")", ";", "if", "(", "i", "<", "length", "-", "1", ")", "System", ".", "arraycopy", "(", "this", ".", "children", ",", "i", "+", "1", ",", "newChildren", ",", "i", ",", "length", "-", "1", "-", "i", ")", ";", "this", ".", "children", "=", "newChildren", ";", "}", "break", ";", "}", "}", "}", "public", "void", "setChildren", "(", "IJavaElement", "[", "]", "children", ")", "{", "this", ".", "children", "=", "children", ";", "}", "public", "void", "setIsStructureKnown", "(", "boolean", "newIsStructureKnown", ")", "{", "this", ".", "isStructureKnown", "=", "newIsStructureKnown", ";", "}", "}", "</s>" ]
5,257
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IMemberValuePair", ";", "public", "class", "SourceAnnotationMethodInfo", "extends", "SourceMethodInfo", "{", "public", "int", "defaultValueStart", "=", "-", "1", ";", "public", "int", "defaultValueEnd", "=", "-", "1", ";", "public", "IMemberValuePair", "defaultValue", ";", "public", "boolean", "isAnnotationMethod", "(", ")", "{", "return", "true", ";", "}", "}", "</s>" ]
5,258
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ClasspathContainerInitializer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IClasspathContainer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "UserLibraryClasspathContainerInitializer", "extends", "ClasspathContainerInitializer", "{", "public", "boolean", "canUpdateClasspathContainer", "(", "IPath", "containerPath", ",", "IJavaProject", "project", ")", "{", "return", "isUserLibraryContainer", "(", "containerPath", ")", ";", "}", "public", "Object", "getComparisonID", "(", "IPath", "containerPath", ",", "IJavaProject", "project", ")", "{", "return", "containerPath", ";", "}", "public", "String", "getDescription", "(", "IPath", "containerPath", ",", "IJavaProject", "project", ")", "{", "if", "(", "isUserLibraryContainer", "(", "containerPath", ")", ")", "{", "return", "containerPath", ".", "segment", "(", "1", ")", ";", "}", "return", "super", ".", "getDescription", "(", "containerPath", ",", "project", ")", ";", "}", "public", "void", "initialize", "(", "IPath", "containerPath", ",", "IJavaProject", "project", ")", "throws", "CoreException", "{", "if", "(", "isUserLibraryContainer", "(", "containerPath", ")", ")", "{", "String", "userLibName", "=", "containerPath", ".", "segment", "(", "1", ")", ";", "UserLibrary", "userLibrary", "=", "JavaModelManager", ".", "getUserLibraryManager", "(", ")", ".", "getUserLibrary", "(", "userLibName", ")", ";", "if", "(", "userLibrary", "!=", "null", ")", "{", "UserLibraryClasspathContainer", "container", "=", "new", "UserLibraryClasspathContainer", "(", "userLibName", ")", ";", "JavaCore", ".", "setClasspathContainer", "(", "containerPath", ",", "new", "IJavaProject", "[", "]", "{", "project", "}", ",", "new", "IClasspathContainer", "[", "]", "{", "container", "}", ",", "null", ")", ";", "}", "else", "if", "(", "JavaModelManager", ".", "CP_RESOLVE_VERBOSE", "||", "JavaModelManager", ".", "CP_RESOLVE_VERBOSE_FAILURE", ")", "{", "verbose_no_user_library_found", "(", "project", ",", "userLibName", ")", ";", "}", "}", "else", "if", "(", "JavaModelManager", ".", "CP_RESOLVE_VERBOSE", "||", "JavaModelManager", ".", "CP_RESOLVE_VERBOSE_FAILURE", ")", "{", "verbose_not_a_user_library", "(", "project", ",", "containerPath", ")", ";", "}", "}", "private", "boolean", "isUserLibraryContainer", "(", "IPath", "path", ")", "{", "return", "path", "!=", "null", "&&", "path", ".", "segmentCount", "(", ")", "==", "2", "&&", "JavaCore", ".", "USER_LIBRARY_CONTAINER_ID", ".", "equals", "(", "path", ".", "segment", "(", "0", ")", ")", ";", "}", "public", "void", "requestClasspathContainerUpdate", "(", "IPath", "containerPath", ",", "IJavaProject", "project", ",", "IClasspathContainer", "containerSuggestion", ")", "throws", "CoreException", "{", "if", "(", "isUserLibraryContainer", "(", "containerPath", ")", ")", "{", "String", "name", "=", "containerPath", ".", "segment", "(", "1", ")", ";", "if", "(", "containerSuggestion", "!=", "null", ")", "{", "JavaModelManager", ".", "getUserLibraryManager", "(", ")", ".", "setUserLibrary", "(", "name", ",", "containerSuggestion", ".", "getClasspathEntries", "(", ")", ",", "containerSuggestion", ".", "getKind", "(", ")", "==", "IClasspathContainer", ".", "K_SYSTEM", ")", ";", "}", "else", "{", "JavaModelManager", ".", "getUserLibraryManager", "(", ")", ".", "removeUserLibrary", "(", "name", ")", ";", "}", "}", "}", "private", "void", "verbose_no_user_library_found", "(", "IJavaProject", "project", ",", "String", "userLibraryName", ")", "{", "Util", ".", "verbose", "(", "\"\"", "+", "\"tproject:", "\"", "+", "project", ".", "getElementName", "(", ")", "+", "'\\n'", "+", "\"\"", "+", "userLibraryName", ")", ";", "}", "private", "void", "verbose_not_a_user_library", "(", "IJavaProject", "project", ",", "IPath", "containerPath", ")", "{", "Util", ".", "verbose", "(", "\"\"", "+", "\"tproject:", "\"", "+", "project", ".", "getElementName", "(", ")", "+", "'\\n'", "+", "\"\"", "+", "containerPath", ")", ";", "}", "}", "</s>" ]
5,259
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "LRUCache", ";", "public", "class", "ElementCache", "extends", "OverflowingLRUCache", "{", "IJavaElement", "spaceLimitParent", "=", "null", ";", "public", "ElementCache", "(", "int", "size", ")", "{", "super", "(", "size", ")", ";", "}", "public", "ElementCache", "(", "int", "size", ",", "int", "overflow", ")", "{", "super", "(", "size", ",", "overflow", ")", ";", "}", "protected", "boolean", "close", "(", "LRUCacheEntry", "entry", ")", "{", "Openable", "element", "=", "(", "Openable", ")", "entry", ".", "key", ";", "try", "{", "if", "(", "!", "element", ".", "canBeRemovedFromCache", "(", ")", ")", "{", "return", "false", ";", "}", "else", "{", "element", ".", "close", "(", ")", ";", "return", "true", ";", "}", "}", "catch", "(", "JavaModelException", "npe", ")", "{", "return", "false", ";", "}", "}", "protected", "void", "ensureSpaceLimit", "(", "Object", "info", ",", "IJavaElement", "parent", ")", "{", "int", "childrenSize", "=", "(", "(", "JavaElementInfo", ")", "info", ")", ".", "getChildren", "(", ")", ".", "length", ";", "int", "spaceNeeded", "=", "1", "+", "(", "int", ")", "(", "(", "1", "+", "this", ".", "loadFactor", ")", "*", "(", "childrenSize", "+", "this", ".", "overflow", ")", ")", ";", "if", "(", "this", ".", "spaceLimit", "<", "spaceNeeded", ")", "{", "shrink", "(", ")", ";", "setSpaceLimit", "(", "spaceNeeded", ")", ";", "this", ".", "spaceLimitParent", "=", "parent", ";", "}", "}", "protected", "LRUCache", "newInstance", "(", "int", "size", ",", "int", "newOverflow", ")", "{", "return", "new", "ElementCache", "(", "size", ",", "newOverflow", ")", ";", "}", "protected", "void", "resetSpaceLimit", "(", "int", "defaultLimit", ",", "IJavaElement", "parent", ")", "{", "if", "(", "parent", ".", "equals", "(", "this", ".", "spaceLimitParent", ")", ")", "{", "setSpaceLimit", "(", "defaultLimit", ")", ";", "this", ".", "spaceLimitParent", "=", "null", ";", "}", "}", "}", "</s>" ]
5,260
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ISourceRange", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "SourceRange", ";", "public", "class", "CompilationUnitElementInfo", "extends", "OpenableElementInfo", "{", "protected", "int", "sourceLength", ";", "protected", "long", "timestamp", ";", "public", "int", "annotationNumber", "=", "0", ";", "public", "int", "getSourceLength", "(", ")", "{", "return", "this", ".", "sourceLength", ";", "}", "protected", "ISourceRange", "getSourceRange", "(", ")", "{", "return", "new", "SourceRange", "(", "0", ",", "this", ".", "sourceLength", ")", ";", "}", "public", "void", "setSourceLength", "(", "int", "newSourceLength", ")", "{", "this", ".", "sourceLength", "=", "newSourceLength", ";", "}", "}", "</s>" ]
5,261
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IContainer", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IStatus", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Path", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "jobs", ".", "ISchedulingRule", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaModelStatus", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaModelStatusConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IPackageFragment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IPackageFragmentRoot", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaConventions", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Messages", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "CreatePackageFragmentOperation", "extends", "JavaModelOperation", "{", "protected", "String", "[", "]", "pkgName", ";", "public", "CreatePackageFragmentOperation", "(", "IPackageFragmentRoot", "parentElement", ",", "String", "packageName", ",", "boolean", "force", ")", "{", "super", "(", "null", ",", "new", "IJavaElement", "[", "]", "{", "parentElement", "}", ",", "force", ")", ";", "this", ".", "pkgName", "=", "packageName", "==", "null", "?", "null", ":", "Util", ".", "getTrimmedSimpleNames", "(", "packageName", ")", ";", "}", "protected", "void", "executeOperation", "(", ")", "throws", "JavaModelException", "{", "try", "{", "JavaElementDelta", "delta", "=", "null", ";", "PackageFragmentRoot", "root", "=", "(", "PackageFragmentRoot", ")", "getParentElement", "(", ")", ";", "beginTask", "(", "Messages", ".", "operation_createPackageFragmentProgress", ",", "this", ".", "pkgName", ".", "length", ")", ";", "IContainer", "parentFolder", "=", "(", "IContainer", ")", "root", ".", "resource", "(", ")", ";", "String", "[", "]", "sideEffectPackageName", "=", "CharOperation", ".", "NO_STRINGS", ";", "ArrayList", "results", "=", "new", "ArrayList", "(", "this", ".", "pkgName", ".", "length", ")", ";", "char", "[", "]", "[", "]", "inclusionPatterns", "=", "root", ".", "fullInclusionPatternChars", "(", ")", ";", "char", "[", "]", "[", "]", "exclusionPatterns", "=", "root", ".", "fullExclusionPatternChars", "(", ")", ";", "int", "i", ";", "for", "(", "i", "=", "0", ";", "i", "<", "this", ".", "pkgName", ".", "length", ";", "i", "++", ")", "{", "String", "subFolderName", "=", "this", ".", "pkgName", "[", "i", "]", ";", "sideEffectPackageName", "=", "Util", ".", "arrayConcat", "(", "sideEffectPackageName", ",", "subFolderName", ")", ";", "IResource", "subFolder", "=", "parentFolder", ".", "findMember", "(", "subFolderName", ")", ";", "if", "(", "subFolder", "==", "null", ")", "{", "createFolder", "(", "parentFolder", ",", "subFolderName", ",", "this", ".", "force", ")", ";", "parentFolder", "=", "parentFolder", ".", "getFolder", "(", "new", "Path", "(", "subFolderName", ")", ")", ";", "IPackageFragment", "addedFrag", "=", "root", ".", "getPackageFragment", "(", "sideEffectPackageName", ")", ";", "if", "(", "!", "Util", ".", "isExcluded", "(", "parentFolder", ",", "inclusionPatterns", ",", "exclusionPatterns", ")", ")", "{", "if", "(", "delta", "==", "null", ")", "{", "delta", "=", "newJavaElementDelta", "(", ")", ";", "}", "delta", ".", "added", "(", "addedFrag", ")", ";", "}", "results", ".", "add", "(", "addedFrag", ")", ";", "}", "else", "{", "parentFolder", "=", "(", "IContainer", ")", "subFolder", ";", "}", "worked", "(", "1", ")", ";", "}", "if", "(", "results", ".", "size", "(", ")", ">", "0", ")", "{", "this", ".", "resultElements", "=", "new", "IJavaElement", "[", "results", ".", "size", "(", ")", "]", ";", "results", ".", "toArray", "(", "this", ".", "resultElements", ")", ";", "if", "(", "delta", "!=", "null", ")", "{", "addDelta", "(", "delta", ")", ";", "}", "}", "}", "finally", "{", "done", "(", ")", ";", "}", "}", "protected", "ISchedulingRule", "getSchedulingRule", "(", ")", "{", "if", "(", "this", ".", "pkgName", ".", "length", "==", "0", ")", "return", "null", ";", "IResource", "parentResource", "=", "(", "(", "JavaElement", ")", "getParentElement", "(", ")", ")", ".", "resource", "(", ")", ";", "IResource", "resource", "=", "(", "(", "IContainer", ")", "parentResource", ")", ".", "getFolder", "(", "new", "Path", "(", "this", ".", "pkgName", "[", "0", "]", ")", ")", ";", "return", "resource", ".", "getWorkspace", "(", ")", ".", "getRuleFactory", "(", ")", ".", "createRule", "(", "resource", ")", ";", "}", "public", "IJavaModelStatus", "verify", "(", ")", "{", "IJavaElement", "parentElement", "=", "getParentElement", "(", ")", ";", "if", "(", "parentElement", "==", "null", ")", "{", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "NO_ELEMENTS_TO_PROCESS", ")", ";", "}", "String", "packageName", "=", "this", ".", "pkgName", "==", "null", "?", "null", ":", "Util", ".", "concatWith", "(", "this", ".", "pkgName", ",", "'.'", ")", ";", "IJavaProject", "project", "=", "parentElement", ".", "getJavaProject", "(", ")", ";", "if", "(", "this", ".", "pkgName", "==", "null", "||", "(", "this", ".", "pkgName", ".", "length", ">", "0", "&&", "JavaConventions", ".", "validatePackageName", "(", "packageName", ",", "project", ".", "getOption", "(", "JavaCore", ".", "COMPILER_SOURCE", ",", "true", ")", ",", "project", ".", "getOption", "(", "JavaCore", ".", "COMPILER_COMPLIANCE", ",", "true", ")", ")", ".", "getSeverity", "(", ")", "==", "IStatus", ".", "ERROR", ")", ")", "{", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INVALID_NAME", ",", "packageName", ")", ";", "}", "IJavaElement", "root", "=", "getParentElement", "(", ")", ";", "if", "(", "root", ".", "isReadOnly", "(", ")", ")", "{", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "READ_ONLY", ",", "root", ")", ";", "}", "IContainer", "parentFolder", "=", "(", "IContainer", ")", "(", "(", "JavaElement", ")", "root", ")", ".", "resource", "(", ")", ";", "int", "i", ";", "for", "(", "i", "=", "0", ";", "i", "<", "this", ".", "pkgName", ".", "length", ";", "i", "++", ")", "{", "IResource", "subFolder", "=", "parentFolder", ".", "findMember", "(", "this", ".", "pkgName", "[", "i", "]", ")", ";", "if", "(", "subFolder", "!=", "null", ")", "{", "if", "(", "subFolder", ".", "getType", "(", ")", "!=", "IResource", ".", "FOLDER", ")", "{", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "NAME_COLLISION", ",", "Messages", ".", "bind", "(", "Messages", ".", "status_nameCollision", ",", "subFolder", ".", "getFullPath", "(", ")", ".", "toString", "(", ")", ")", ")", ";", "}", "parentFolder", "=", "(", "IContainer", ")", "subFolder", ";", "}", "}", "return", "JavaModelStatus", ".", "VERIFIED_OK", ";", "}", "}", "</s>" ]
5,262
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "text", ".", "NumberFormat", ";", "import", "java", ".", "util", ".", "Date", ";", "public", "class", "VerboseElementCache", "extends", "ElementCache", "{", "private", "Object", "beingAdded", ";", "private", "String", "name", ";", "public", "VerboseElementCache", "(", "int", "size", ",", "String", "name", ")", "{", "super", "(", "size", ")", ";", "this", ".", "name", "=", "name", ";", "}", "protected", "boolean", "makeSpace", "(", "int", "space", ")", "{", "if", "(", "this", ".", "beingAdded", "==", "null", ")", "return", "super", ".", "makeSpace", "(", "space", ")", ";", "String", "fillingRatio", "=", "toStringFillingRation", "(", "this", ".", "name", ")", ";", "boolean", "result", "=", "super", ".", "makeSpace", "(", "space", ")", ";", "String", "newFillingRatio", "=", "toStringFillingRation", "(", "this", ".", "name", ")", ";", "if", "(", "!", "fillingRatio", ".", "equals", "(", "newFillingRatio", ")", ")", "{", "System", ".", "out", ".", "println", "(", "Thread", ".", "currentThread", "(", ")", "+", "\"", "\"", "+", "new", "Date", "(", "System", ".", "currentTimeMillis", "(", ")", ")", ".", "toString", "(", ")", ")", ";", "System", ".", "out", ".", "println", "(", "Thread", ".", "currentThread", "(", ")", "+", "\"\"", "+", "fillingRatio", "+", "\"", "(NOW", "\"", "+", "NumberFormat", ".", "getInstance", "(", ")", ".", "format", "(", "fillingRatio", "(", ")", ")", "+", "\"%", "full)\"", ")", ";", "System", ".", "out", ".", "println", "(", "Thread", ".", "currentThread", "(", ")", "+", "\"\"", "+", "(", "(", "JavaElement", ")", "this", ".", "beingAdded", ")", ".", "toStringWithAncestors", "(", ")", ")", ";", "System", ".", "out", ".", "println", "(", ")", ";", "}", "return", "result", ";", "}", "public", "Object", "put", "(", "Object", "key", ",", "Object", "value", ")", "{", "try", "{", "if", "(", "this", ".", "beingAdded", "==", "null", ")", "this", ".", "beingAdded", "=", "key", ";", "return", "super", ".", "put", "(", "key", ",", "value", ")", ";", "}", "finally", "{", "if", "(", "key", ".", "equals", "(", "this", ".", "beingAdded", ")", ")", "this", ".", "beingAdded", "=", "null", ";", "}", "}", "}", "</s>" ]
5,263
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "public", "class", "SourceConstructorInfo", "extends", "SourceMethodElementInfo", "{", "private", "static", "final", "char", "[", "]", "RETURN_TYPE_NAME", "=", "new", "char", "[", "]", "{", "'v'", ",", "'o'", ",", "'i'", ",", "'d'", "}", ";", "public", "boolean", "isAnnotationMethod", "(", ")", "{", "return", "false", ";", "}", "public", "boolean", "isConstructor", "(", ")", "{", "return", "true", ";", "}", "public", "char", "[", "]", "getReturnTypeName", "(", ")", "{", "return", "RETURN_TYPE_NAME", ";", "}", "protected", "void", "setReturnType", "(", "char", "[", "]", "type", ")", "{", "}", "}", "</s>" ]
5,264
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "ASTNode", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "Binding", ";", "public", "class", "SourceField", "extends", "NamedMember", "implements", "IField", "{", "protected", "SourceField", "(", "JavaElement", "parent", ",", "String", "name", ")", "{", "super", "(", "parent", ",", "name", ")", ";", "}", "public", "boolean", "equals", "(", "Object", "o", ")", "{", "if", "(", "!", "(", "o", "instanceof", "SourceField", ")", ")", "return", "false", ";", "return", "super", ".", "equals", "(", "o", ")", ";", "}", "public", "ASTNode", "findNode", "(", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "CompilationUnit", "ast", ")", "{", "ASTNode", "node", "=", "super", ".", "findNode", "(", "ast", ")", ";", "if", "(", "node", "==", "null", ")", "return", "null", ";", "if", "(", "node", ".", "getNodeType", "(", ")", "==", "ASTNode", ".", "ENUM_CONSTANT_DECLARATION", ")", "{", "return", "node", ";", "}", "return", "node", ".", "getParent", "(", ")", ";", "}", "public", "Object", "getConstant", "(", ")", "throws", "JavaModelException", "{", "Object", "constant", "=", "null", ";", "SourceFieldElementInfo", "info", "=", "(", "SourceFieldElementInfo", ")", "getElementInfo", "(", ")", ";", "final", "char", "[", "]", "constantSourceChars", "=", "info", ".", "initializationSource", ";", "if", "(", "constantSourceChars", "==", "null", ")", "{", "return", "null", ";", "}", "String", "constantSource", "=", "new", "String", "(", "constantSourceChars", ")", ";", "String", "signature", "=", "info", ".", "getTypeSignature", "(", ")", ";", "try", "{", "if", "(", "signature", ".", "equals", "(", "Signature", ".", "SIG_INT", ")", ")", "{", "constant", "=", "new", "Integer", "(", "constantSource", ")", ";", "}", "else", "if", "(", "signature", ".", "equals", "(", "Signature", ".", "SIG_SHORT", ")", ")", "{", "constant", "=", "new", "Short", "(", "constantSource", ")", ";", "}", "else", "if", "(", "signature", ".", "equals", "(", "Signature", ".", "SIG_BYTE", ")", ")", "{", "constant", "=", "new", "Byte", "(", "constantSource", ")", ";", "}", "else", "if", "(", "signature", ".", "equals", "(", "Signature", ".", "SIG_BOOLEAN", ")", ")", "{", "constant", "=", "Boolean", ".", "valueOf", "(", "constantSource", ")", ";", "}", "else", "if", "(", "signature", ".", "equals", "(", "Signature", ".", "SIG_CHAR", ")", ")", "{", "if", "(", "constantSourceChars", ".", "length", "!=", "3", ")", "{", "return", "null", ";", "}", "constant", "=", "new", "Character", "(", "constantSourceChars", "[", "1", "]", ")", ";", "}", "else", "if", "(", "signature", ".", "equals", "(", "Signature", ".", "SIG_DOUBLE", ")", ")", "{", "constant", "=", "new", "Double", "(", "constantSource", ")", ";", "}", "else", "if", "(", "signature", ".", "equals", "(", "Signature", ".", "SIG_FLOAT", ")", ")", "{", "constant", "=", "new", "Float", "(", "constantSource", ")", ";", "}", "else", "if", "(", "signature", ".", "equals", "(", "Signature", ".", "SIG_LONG", ")", ")", "{", "if", "(", "constantSource", ".", "endsWith", "(", "\"L\"", ")", "||", "constantSource", ".", "endsWith", "(", "\"l\"", ")", ")", "{", "int", "index", "=", "constantSource", ".", "lastIndexOf", "(", "\"L\"", ")", ";", "if", "(", "index", "!=", "-", "1", ")", "{", "constant", "=", "new", "Long", "(", "constantSource", ".", "substring", "(", "0", ",", "index", ")", ")", ";", "}", "else", "{", "constant", "=", "new", "Long", "(", "constantSource", ".", "substring", "(", "0", ",", "constantSource", ".", "lastIndexOf", "(", "\"l\"", ")", ")", ")", ";", "}", "}", "else", "{", "constant", "=", "new", "Long", "(", "constantSource", ")", ";", "}", "}", "else", "if", "(", "signature", ".", "equals", "(", "\"QString;\"", ")", ")", "{", "constant", "=", "constantSource", ";", "}", "else", "if", "(", "signature", ".", "equals", "(", "\"\"", ")", ")", "{", "constant", "=", "constantSource", ";", "}", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "return", "null", ";", "}", "return", "constant", ";", "}", "public", "int", "getElementType", "(", ")", "{", "return", "FIELD", ";", "}", "public", "String", "getKey", "(", ")", "{", "try", "{", "return", "getKey", "(", "this", ",", "false", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "return", "null", ";", "}", "}", "protected", "char", "getHandleMementoDelimiter", "(", ")", "{", "return", "JavaElement", ".", "JEM_FIELD", ";", "}", "public", "IJavaElement", "getPrimaryElement", "(", "boolean", "checkOwner", ")", "{", "if", "(", "checkOwner", ")", "{", "CompilationUnit", "cu", "=", "(", "CompilationUnit", ")", "getAncestor", "(", "COMPILATION_UNIT", ")", ";", "if", "(", "cu", ".", "isPrimary", "(", ")", ")", "return", "this", ";", "}", "IJavaElement", "primaryParent", "=", "this", ".", "parent", ".", "getPrimaryElement", "(", "false", ")", ";", "return", "(", "(", "IType", ")", "primaryParent", ")", ".", "getField", "(", "this", ".", "name", ")", ";", "}", "public", "String", "getTypeSignature", "(", ")", "throws", "JavaModelException", "{", "SourceFieldElementInfo", "info", "=", "(", "SourceFieldElementInfo", ")", "getElementInfo", "(", ")", ";", "return", "info", ".", "getTypeSignature", "(", ")", ";", "}", "public", "boolean", "isEnumConstant", "(", ")", "throws", "JavaModelException", "{", "return", "Flags", ".", "isEnum", "(", "getFlags", "(", ")", ")", ";", "}", "public", "boolean", "isResolved", "(", ")", "{", "return", "false", ";", "}", "public", "JavaElement", "resolved", "(", "Binding", "binding", ")", "{", "SourceRefElement", "resolvedHandle", "=", "new", "ResolvedSourceField", "(", "this", ".", "parent", ",", "this", ".", "name", ",", "new", "String", "(", "binding", ".", "computeUniqueKey", "(", ")", ")", ")", ";", "resolvedHandle", ".", "occurrenceCount", "=", "this", ".", "occurrenceCount", ";", "return", "resolvedHandle", ";", "}", "protected", "void", "toStringInfo", "(", "int", "tab", ",", "StringBuffer", "buffer", ",", "Object", "info", ",", "boolean", "showResolvedInfo", ")", "{", "buffer", ".", "append", "(", "tabString", "(", "tab", ")", ")", ";", "if", "(", "info", "==", "null", ")", "{", "toStringName", "(", "buffer", ")", ";", "buffer", ".", "append", "(", "\"", "(not", "open)\"", ")", ";", "}", "else", "if", "(", "info", "==", "NO_INFO", ")", "{", "toStringName", "(", "buffer", ")", ";", "}", "else", "{", "try", "{", "buffer", ".", "append", "(", "Signature", ".", "toString", "(", "getTypeSignature", "(", ")", ")", ")", ";", "buffer", ".", "append", "(", "\"", "\"", ")", ";", "toStringName", "(", "buffer", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "buffer", ".", "append", "(", "\"\"", "+", "getElementName", "(", ")", ")", ";", "}", "}", "}", "}", "</s>" ]
5,265
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "io", ".", "Writer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "GenericXMLWriter", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "class", "XMLWriter", "extends", "GenericXMLWriter", "{", "public", "XMLWriter", "(", "Writer", "writer", ",", "IJavaProject", "project", ",", "boolean", "printXmlVersion", ")", "{", "super", "(", "writer", ",", "Util", ".", "getLineSeparator", "(", "(", "String", ")", "null", ",", "project", ")", ",", "printXmlVersion", ")", ";", "}", "}", "</s>" ]
5,266
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IBuffer", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "BadLocationException", ";", "import", "org", ".", "eclipse", ".", "jface", ".", "text", ".", "Document", ";", "public", "class", "DocumentAdapter", "extends", "Document", "{", "private", "IBuffer", "buffer", ";", "public", "DocumentAdapter", "(", "IBuffer", "buffer", ")", "{", "super", "(", "buffer", ".", "getContents", "(", ")", ")", ";", "this", ".", "buffer", "=", "buffer", ";", "}", "public", "void", "set", "(", "String", "text", ")", "{", "super", ".", "set", "(", "text", ")", ";", "this", ".", "buffer", ".", "setContents", "(", "text", ")", ";", "}", "public", "void", "replace", "(", "int", "offset", ",", "int", "length", ",", "String", "text", ")", "throws", "BadLocationException", "{", "super", ".", "replace", "(", "offset", ",", "length", ",", "text", ")", ";", "this", ".", "buffer", ".", "replace", "(", "offset", ",", "length", ",", "text", ")", ";", "}", "}", "</s>" ]
5,267
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "OperationCanceledException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CategorizedProblem", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "problem", ".", "AbortCompilation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "problem", ".", "DefaultProblemFactory", ";", "public", "class", "CancelableProblemFactory", "extends", "DefaultProblemFactory", "{", "public", "IProgressMonitor", "monitor", ";", "public", "CancelableProblemFactory", "(", "IProgressMonitor", "monitor", ")", "{", "super", "(", ")", ";", "this", ".", "monitor", "=", "monitor", ";", "}", "public", "CategorizedProblem", "createProblem", "(", "char", "[", "]", "originatingFileName", ",", "int", "problemId", ",", "String", "[", "]", "problemArguments", ",", "String", "[", "]", "messageArguments", ",", "int", "severity", ",", "int", "startPosition", ",", "int", "endPosition", ",", "int", "lineNumber", ",", "int", "columnNumber", ")", "{", "if", "(", "this", ".", "monitor", "!=", "null", "&&", "this", ".", "monitor", ".", "isCanceled", "(", ")", ")", "throw", "new", "AbortCompilation", "(", "true", ",", "new", "OperationCanceledException", "(", ")", ")", ";", "return", "super", ".", "createProblem", "(", "originatingFileName", ",", "problemId", ",", "problemArguments", ",", "messageArguments", ",", "severity", ",", "startPosition", ",", "endPosition", ",", "lineNumber", ",", "columnNumber", ")", ";", "}", "public", "CategorizedProblem", "createProblem", "(", "char", "[", "]", "originatingFileName", ",", "int", "problemId", ",", "String", "[", "]", "problemArguments", ",", "int", "elaborationId", ",", "String", "[", "]", "messageArguments", ",", "int", "severity", ",", "int", "startPosition", ",", "int", "endPosition", ",", "int", "lineNumber", ",", "int", "columnNumber", ")", "{", "if", "(", "this", ".", "monitor", "!=", "null", "&&", "this", ".", "monitor", ".", "isCanceled", "(", ")", ")", "throw", "new", "AbortCompilation", "(", "true", ",", "new", "OperationCanceledException", "(", ")", ")", ";", "return", "super", ".", "createProblem", "(", "originatingFileName", ",", "problemId", ",", "problemArguments", ",", "elaborationId", ",", "messageArguments", ",", "severity", ",", "startPosition", ",", "endPosition", ",", "lineNumber", ",", "columnNumber", ")", ";", "}", "}", "</s>" ]
5,268
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "public", "class", "ResolvedBinaryType", "extends", "BinaryType", "{", "private", "String", "uniqueKey", ";", "public", "ResolvedBinaryType", "(", "JavaElement", "parent", ",", "String", "name", ",", "String", "uniqueKey", ")", "{", "super", "(", "parent", ",", "name", ")", ";", "this", ".", "uniqueKey", "=", "uniqueKey", ";", "}", "public", "String", "getFullyQualifiedParameterizedName", "(", ")", "throws", "JavaModelException", "{", "return", "getFullyQualifiedParameterizedName", "(", "getFullyQualifiedName", "(", "'.'", ")", ",", "this", ".", "uniqueKey", ")", ";", "}", "public", "String", "getKey", "(", ")", "{", "return", "this", ".", "uniqueKey", ";", "}", "public", "boolean", "isResolved", "(", ")", "{", "return", "true", ";", "}", "protected", "void", "toStringInfo", "(", "int", "tab", ",", "StringBuffer", "buffer", ",", "Object", "info", ",", "boolean", "showResolvedInfo", ")", "{", "super", ".", "toStringInfo", "(", "tab", ",", "buffer", ",", "info", ",", "showResolvedInfo", ")", ";", "if", "(", "showResolvedInfo", ")", "{", "buffer", ".", "append", "(", "\"", "{key=\"", ")", ";", "buffer", ".", "append", "(", "this", ".", "uniqueKey", ")", ";", "buffer", ".", "append", "(", "\"}\"", ")", ";", "}", "}", "public", "JavaElement", "unresolved", "(", ")", "{", "SourceRefElement", "handle", "=", "new", "BinaryType", "(", "this", ".", "parent", ",", "this", ".", "name", ")", ";", "handle", ".", "occurrenceCount", "=", "this", ".", "occurrenceCount", ";", "return", "handle", ";", "}", "}", "</s>" ]
5,269
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Messages", ";", "public", "class", "MoveResourceElementsOperation", "extends", "CopyResourceElementsOperation", "{", "public", "MoveResourceElementsOperation", "(", "IJavaElement", "[", "]", "elementsToMove", ",", "IJavaElement", "[", "]", "destContainers", ",", "boolean", "force", ")", "{", "super", "(", "elementsToMove", ",", "destContainers", ",", "force", ")", ";", "}", "protected", "String", "getMainTaskName", "(", ")", "{", "return", "Messages", ".", "operation_moveResourceProgress", ";", "}", "protected", "boolean", "isMove", "(", ")", "{", "return", "true", ";", "}", "}", "</s>" ]
5,270
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IField", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaModelStatus", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaModelStatusConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "ASTNode", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "FieldDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "SimpleName", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "VariableDeclarationFragment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "rewrite", ".", "ASTRewrite", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Messages", ";", "public", "class", "CreateFieldOperation", "extends", "CreateTypeMemberOperation", "{", "public", "CreateFieldOperation", "(", "IType", "parentElement", ",", "String", "source", ",", "boolean", "force", ")", "{", "super", "(", "parentElement", ",", "source", ",", "force", ")", ";", "}", "protected", "ASTNode", "generateElementAST", "(", "ASTRewrite", "rewriter", ",", "ICompilationUnit", "cu", ")", "throws", "JavaModelException", "{", "ASTNode", "node", "=", "super", ".", "generateElementAST", "(", "rewriter", ",", "cu", ")", ";", "if", "(", "node", ".", "getNodeType", "(", ")", "!=", "ASTNode", ".", "FIELD_DECLARATION", ")", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INVALID_CONTENTS", ")", ")", ";", "return", "node", ";", "}", "protected", "IJavaElement", "generateResultHandle", "(", ")", "{", "return", "getType", "(", ")", ".", "getField", "(", "getASTNodeName", "(", ")", ")", ";", "}", "public", "String", "getMainTaskName", "(", ")", "{", "return", "Messages", ".", "operation_createFieldProgress", ";", "}", "private", "VariableDeclarationFragment", "getFragment", "(", "ASTNode", "node", ")", "{", "Iterator", "fragments", "=", "(", "(", "FieldDeclaration", ")", "node", ")", ".", "fragments", "(", ")", ".", "iterator", "(", ")", ";", "if", "(", "this", ".", "anchorElement", "!=", "null", ")", "{", "VariableDeclarationFragment", "fragment", "=", "null", ";", "String", "fragmentName", "=", "this", ".", "anchorElement", ".", "getElementName", "(", ")", ";", "while", "(", "fragments", ".", "hasNext", "(", ")", ")", "{", "fragment", "=", "(", "VariableDeclarationFragment", ")", "fragments", ".", "next", "(", ")", ";", "if", "(", "fragment", ".", "getName", "(", ")", ".", "getIdentifier", "(", ")", ".", "equals", "(", "fragmentName", ")", ")", "{", "return", "fragment", ";", "}", "}", "return", "fragment", ";", "}", "else", "{", "return", "(", "VariableDeclarationFragment", ")", "fragments", ".", "next", "(", ")", ";", "}", "}", "protected", "void", "initializeDefaultPosition", "(", ")", "{", "IType", "parentElement", "=", "getType", "(", ")", ";", "try", "{", "IField", "[", "]", "fields", "=", "parentElement", ".", "getFields", "(", ")", ";", "if", "(", "fields", "!=", "null", "&&", "fields", ".", "length", ">", "0", ")", "{", "final", "IField", "lastField", "=", "fields", "[", "fields", ".", "length", "-", "1", "]", ";", "if", "(", "parentElement", ".", "isEnum", "(", ")", ")", "{", "IField", "field", "=", "lastField", ";", "if", "(", "!", "field", ".", "isEnumConstant", "(", ")", ")", "{", "createAfter", "(", "lastField", ")", ";", "}", "}", "else", "{", "createAfter", "(", "lastField", ")", ";", "}", "}", "else", "{", "IJavaElement", "[", "]", "elements", "=", "parentElement", ".", "getChildren", "(", ")", ";", "if", "(", "elements", "!=", "null", "&&", "elements", ".", "length", ">", "0", ")", "{", "createBefore", "(", "elements", "[", "0", "]", ")", ";", "}", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "}", "protected", "IJavaModelStatus", "verifyNameCollision", "(", ")", "{", "if", "(", "this", ".", "createdNode", "!=", "null", ")", "{", "IType", "type", "=", "getType", "(", ")", ";", "String", "fieldName", "=", "getASTNodeName", "(", ")", ";", "if", "(", "type", ".", "getField", "(", "fieldName", ")", ".", "exists", "(", ")", ")", "{", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "NAME_COLLISION", ",", "Messages", ".", "bind", "(", "Messages", ".", "status_nameCollision", ",", "fieldName", ")", ")", ";", "}", "}", "return", "JavaModelStatus", ".", "VERIFIED_OK", ";", "}", "private", "String", "getASTNodeName", "(", ")", "{", "if", "(", "this", ".", "alteredName", "!=", "null", ")", "return", "this", ".", "alteredName", ";", "return", "getFragment", "(", "this", ".", "createdNode", ")", ".", "getName", "(", ")", ".", "getIdentifier", "(", ")", ";", "}", "protected", "SimpleName", "rename", "(", "ASTNode", "node", ",", "SimpleName", "newName", ")", "{", "VariableDeclarationFragment", "fragment", "=", "getFragment", "(", "node", ")", ";", "SimpleName", "oldName", "=", "fragment", ".", "getName", "(", ")", ";", "fragment", ".", "setName", "(", "newName", ")", ";", "return", "oldName", ";", "}", "}", "</s>" ]
5,271
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "public", "interface", "INamingRequestor", "{", "void", "acceptNameWithPrefixAndSuffix", "(", "char", "[", "]", "name", ",", "boolean", "isFirstPrefix", ",", "boolean", "isFirstSuffix", ",", "int", "reusedCharacters", ")", ";", "void", "acceptNameWithPrefix", "(", "char", "[", "]", "name", ",", "boolean", "isFirstPrefix", ",", "int", "reusedCharacters", ")", ";", "void", "acceptNameWithSuffix", "(", "char", "[", "]", "name", ",", "boolean", "isFirstSuffix", ",", "int", "reusedCharacters", ")", ";", "void", "acceptNameWithoutPrefixAndSuffix", "(", "char", "[", "]", "name", ",", "int", "reusedCharacters", ")", ";", "}", "</s>" ]
5,272
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "HashSet", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IFile", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IFolder", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IProject", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IWorkspace", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "ResourcesPlugin", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Assert", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IStatus", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Path", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "MementoTokenizer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Messages", ";", "public", "class", "JavaModel", "extends", "Openable", "implements", "IJavaModel", "{", "public", "static", "HashSet", "existingExternalFiles", "=", "new", "HashSet", "(", ")", ";", "public", "static", "HashSet", "existingExternalConfirmedFiles", "=", "new", "HashSet", "(", ")", ";", "protected", "JavaModel", "(", ")", "throws", "Error", "{", "super", "(", "null", ")", ";", "}", "protected", "boolean", "buildStructure", "(", "OpenableElementInfo", "info", ",", "IProgressMonitor", "pm", ",", "Map", "newElements", ",", "IResource", "underlyingResource", ")", "{", "IProject", "[", "]", "projects", "=", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ".", "getProjects", "(", ")", ";", "int", "length", "=", "projects", ".", "length", ";", "IJavaElement", "[", "]", "children", "=", "new", "IJavaElement", "[", "length", "]", ";", "int", "index", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IProject", "project", "=", "projects", "[", "i", "]", ";", "if", "(", "JavaProject", ".", "hasJavaNature", "(", "project", ")", ")", "{", "children", "[", "index", "++", "]", "=", "getJavaProject", "(", "project", ")", ";", "}", "}", "if", "(", "index", "<", "length", ")", "System", ".", "arraycopy", "(", "children", ",", "0", ",", "children", "=", "new", "IJavaElement", "[", "index", "]", ",", "0", ",", "index", ")", ";", "info", ".", "setChildren", "(", "children", ")", ";", "newElements", ".", "put", "(", "this", ",", "info", ")", ";", "return", "true", ";", "}", "public", "boolean", "contains", "(", "IResource", "resource", ")", "{", "switch", "(", "resource", ".", "getType", "(", ")", ")", "{", "case", "IResource", ".", "ROOT", ":", "case", "IResource", ".", "PROJECT", ":", "return", "true", ";", "}", "IJavaProject", "[", "]", "projects", ";", "try", "{", "projects", "=", "getJavaProjects", "(", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "return", "false", ";", "}", "for", "(", "int", "i", "=", "0", ",", "length", "=", "projects", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "JavaProject", "project", "=", "(", "JavaProject", ")", "projects", "[", "i", "]", ";", "if", "(", "!", "project", ".", "contains", "(", "resource", ")", ")", "{", "return", "false", ";", "}", "}", "return", "true", ";", "}", "public", "void", "copy", "(", "IJavaElement", "[", "]", "elements", ",", "IJavaElement", "[", "]", "containers", ",", "IJavaElement", "[", "]", "siblings", ",", "String", "[", "]", "renamings", ",", "boolean", "force", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "if", "(", "elements", "!=", "null", "&&", "elements", ".", "length", ">", "0", "&&", "elements", "[", "0", "]", "!=", "null", "&&", "elements", "[", "0", "]", ".", "getElementType", "(", ")", "<", "IJavaElement", ".", "TYPE", ")", "{", "runOperation", "(", "new", "CopyResourceElementsOperation", "(", "elements", ",", "containers", ",", "force", ")", ",", "elements", ",", "siblings", ",", "renamings", ",", "monitor", ")", ";", "}", "else", "{", "runOperation", "(", "new", "CopyElementsOperation", "(", "elements", ",", "containers", ",", "force", ")", ",", "elements", ",", "siblings", ",", "renamings", ",", "monitor", ")", ";", "}", "}", "protected", "Object", "createElementInfo", "(", ")", "{", "return", "new", "JavaModelInfo", "(", ")", ";", "}", "public", "void", "delete", "(", "IJavaElement", "[", "]", "elements", ",", "boolean", "force", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "if", "(", "elements", "!=", "null", "&&", "elements", ".", "length", ">", "0", "&&", "elements", "[", "0", "]", "!=", "null", "&&", "elements", "[", "0", "]", ".", "getElementType", "(", ")", "<", "IJavaElement", ".", "TYPE", ")", "{", "new", "DeleteResourceElementsOperation", "(", "elements", ",", "force", ")", ".", "runOperation", "(", "monitor", ")", ";", "}", "else", "{", "new", "DeleteElementsOperation", "(", "elements", ",", "force", ")", ".", "runOperation", "(", "monitor", ")", ";", "}", "}", "public", "boolean", "equals", "(", "Object", "o", ")", "{", "if", "(", "!", "(", "o", "instanceof", "JavaModel", ")", ")", "return", "false", ";", "return", "super", ".", "equals", "(", "o", ")", ";", "}", "public", "int", "getElementType", "(", ")", "{", "return", "JAVA_MODEL", ";", "}", "public", "static", "void", "flushExternalFileCache", "(", ")", "{", "existingExternalFiles", "=", "new", "HashSet", "(", ")", ";", "existingExternalConfirmedFiles", "=", "new", "HashSet", "(", ")", ";", "}", "public", "IJavaElement", "getHandleFromMemento", "(", "String", "token", ",", "MementoTokenizer", "memento", ",", "WorkingCopyOwner", "owner", ")", "{", "switch", "(", "token", ".", "charAt", "(", "0", ")", ")", "{", "case", "JEM_JAVAPROJECT", ":", "if", "(", "!", "memento", ".", "hasMoreTokens", "(", ")", ")", "return", "this", ";", "String", "projectName", "=", "memento", ".", "nextToken", "(", ")", ";", "JavaElement", "project", "=", "(", "JavaElement", ")", "getJavaProject", "(", "projectName", ")", ";", "return", "project", ".", "getHandleFromMemento", "(", "memento", ",", "owner", ")", ";", "}", "return", "null", ";", "}", "protected", "void", "getHandleMemento", "(", "StringBuffer", "buff", ")", "{", "buff", ".", "append", "(", "getElementName", "(", ")", ")", ";", "}", "protected", "char", "getHandleMementoDelimiter", "(", ")", "{", "Assert", ".", "isTrue", "(", "false", ",", "\"\"", ")", ";", "return", "0", ";", "}", "public", "IJavaProject", "getJavaProject", "(", "String", "projectName", ")", "{", "return", "new", "JavaProject", "(", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ".", "getProject", "(", "projectName", ")", ",", "this", ")", ";", "}", "public", "IJavaProject", "getJavaProject", "(", "IResource", "resource", ")", "{", "switch", "(", "resource", ".", "getType", "(", ")", ")", "{", "case", "IResource", ".", "FOLDER", ":", "return", "new", "JavaProject", "(", "(", "(", "IFolder", ")", "resource", ")", ".", "getProject", "(", ")", ",", "this", ")", ";", "case", "IResource", ".", "FILE", ":", "return", "new", "JavaProject", "(", "(", "(", "IFile", ")", "resource", ")", ".", "getProject", "(", ")", ",", "this", ")", ";", "case", "IResource", ".", "PROJECT", ":", "return", "new", "JavaProject", "(", "(", "IProject", ")", "resource", ",", "this", ")", ";", "default", ":", "throw", "new", "IllegalArgumentException", "(", "Messages", ".", "element_invalidResourceForProject", ")", ";", "}", "}", "public", "IJavaProject", "[", "]", "getJavaProjects", "(", ")", "throws", "JavaModelException", "{", "ArrayList", "list", "=", "getChildrenOfType", "(", "JAVA_PROJECT", ")", ";", "IJavaProject", "[", "]", "array", "=", "new", "IJavaProject", "[", "list", ".", "size", "(", ")", "]", ";", "list", ".", "toArray", "(", "array", ")", ";", "return", "array", ";", "}", "public", "Object", "[", "]", "getNonJavaResources", "(", ")", "throws", "JavaModelException", "{", "return", "(", "(", "JavaModelInfo", ")", "getElementInfo", "(", ")", ")", ".", "getNonJavaResources", "(", ")", ";", "}", "public", "IPath", "getPath", "(", ")", "{", "return", "Path", ".", "ROOT", ";", "}", "public", "IResource", "resource", "(", "PackageFragmentRoot", "root", ")", "{", "return", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ";", "}", "public", "IResource", "getUnderlyingResource", "(", ")", "{", "return", "null", ";", "}", "public", "IWorkspace", "getWorkspace", "(", ")", "{", "return", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ";", "}", "public", "void", "move", "(", "IJavaElement", "[", "]", "elements", ",", "IJavaElement", "[", "]", "containers", ",", "IJavaElement", "[", "]", "siblings", ",", "String", "[", "]", "renamings", ",", "boolean", "force", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "if", "(", "elements", "!=", "null", "&&", "elements", ".", "length", ">", "0", "&&", "elements", "[", "0", "]", "!=", "null", "&&", "elements", "[", "0", "]", ".", "getElementType", "(", ")", "<", "IJavaElement", ".", "TYPE", ")", "{", "runOperation", "(", "new", "MoveResourceElementsOperation", "(", "elements", ",", "containers", ",", "force", ")", ",", "elements", ",", "siblings", ",", "renamings", ",", "monitor", ")", ";", "}", "else", "{", "runOperation", "(", "new", "MoveElementsOperation", "(", "elements", ",", "containers", ",", "force", ")", ",", "elements", ",", "siblings", ",", "renamings", ",", "monitor", ")", ";", "}", "}", "public", "void", "refreshExternalArchives", "(", "IJavaElement", "[", "]", "elementsScope", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "if", "(", "elementsScope", "==", "null", ")", "{", "elementsScope", "=", "new", "IJavaElement", "[", "]", "{", "this", "}", ";", "}", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "getDeltaProcessor", "(", ")", ".", "checkExternalArchiveChanges", "(", "elementsScope", ",", "monitor", ")", ";", "}", "public", "void", "rename", "(", "IJavaElement", "[", "]", "elements", ",", "IJavaElement", "[", "]", "destinations", ",", "String", "[", "]", "renamings", ",", "boolean", "force", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "MultiOperation", "op", ";", "if", "(", "elements", "!=", "null", "&&", "elements", ".", "length", ">", "0", "&&", "elements", "[", "0", "]", "!=", "null", "&&", "elements", "[", "0", "]", ".", "getElementType", "(", ")", "<", "IJavaElement", ".", "TYPE", ")", "{", "op", "=", "new", "RenameResourceElementsOperation", "(", "elements", ",", "destinations", ",", "renamings", ",", "force", ")", ";", "}", "else", "{", "op", "=", "new", "RenameElementsOperation", "(", "elements", ",", "destinations", ",", "renamings", ",", "force", ")", ";", "}", "op", ".", "runOperation", "(", "monitor", ")", ";", "}", "protected", "void", "runOperation", "(", "MultiOperation", "op", ",", "IJavaElement", "[", "]", "elements", ",", "IJavaElement", "[", "]", "siblings", ",", "String", "[", "]", "renamings", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "op", ".", "setRenamings", "(", "renamings", ")", ";", "if", "(", "siblings", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "elements", ".", "length", ";", "i", "++", ")", "{", "op", ".", "setInsertBefore", "(", "elements", "[", "i", "]", ",", "siblings", "[", "i", "]", ")", ";", "}", "}", "op", ".", "runOperation", "(", "monitor", ")", ";", "}", "protected", "void", "toStringInfo", "(", "int", "tab", ",", "StringBuffer", "buffer", ",", "Object", "info", ",", "boolean", "showResolvedInfo", ")", "{", "buffer", ".", "append", "(", "tabString", "(", "tab", ")", ")", ";", "buffer", ".", "append", "(", "\"Java", "Model\"", ")", ";", "if", "(", "info", "==", "null", ")", "{", "buffer", ".", "append", "(", "\"", "(not", "open)\"", ")", ";", "}", "}", "public", "static", "Object", "getTarget", "(", "IPath", "path", ",", "boolean", "checkResourceExistence", ")", "{", "Object", "target", "=", "getWorkspaceTarget", "(", "path", ")", ";", "if", "(", "target", "!=", "null", ")", "return", "target", ";", "return", "getExternalTarget", "(", "path", ",", "checkResourceExistence", ")", ";", "}", "public", "static", "IResource", "getWorkspaceTarget", "(", "IPath", "path", ")", "{", "if", "(", "path", "==", "null", "||", "path", ".", "getDevice", "(", ")", "!=", "null", ")", "return", "null", ";", "IWorkspace", "workspace", "=", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ";", "if", "(", "workspace", "==", "null", ")", "return", "null", ";", "return", "workspace", ".", "getRoot", "(", ")", ".", "findMember", "(", "path", ")", ";", "}", "public", "static", "Object", "getExternalTarget", "(", "IPath", "path", ",", "boolean", "checkResourceExistence", ")", "{", "if", "(", "path", "==", "null", ")", "return", "null", ";", "ExternalFoldersManager", "externalFoldersManager", "=", "JavaModelManager", ".", "getExternalManager", "(", ")", ";", "Object", "linkedFolder", "=", "externalFoldersManager", ".", "getFolder", "(", "path", ")", ";", "if", "(", "linkedFolder", "!=", "null", ")", "{", "if", "(", "checkResourceExistence", ")", "{", "File", "externalFile", "=", "new", "File", "(", "path", ".", "toOSString", "(", ")", ")", ";", "if", "(", "!", "externalFile", ".", "isDirectory", "(", ")", ")", "{", "return", "null", ";", "}", "}", "return", "linkedFolder", ";", "}", "File", "externalFile", "=", "new", "File", "(", "path", ".", "toOSString", "(", ")", ")", ";", "if", "(", "!", "checkResourceExistence", ")", "{", "return", "externalFile", ";", "}", "else", "if", "(", "existingExternalFilesContains", "(", "externalFile", ")", ")", "{", "return", "externalFile", ";", "}", "else", "{", "if", "(", "JavaModelManager", ".", "ZIP_ACCESS_VERBOSE", ")", "{", "System", ".", "out", ".", "println", "(", "\"(\"", "+", "Thread", ".", "currentThread", "(", ")", "+", "\"\"", "+", "path", ".", "toString", "(", ")", ")", ";", "}", "if", "(", "externalFile", ".", "isFile", "(", ")", ")", "{", "existingExternalFilesAdd", "(", "externalFile", ")", ";", "return", "externalFile", ";", "}", "}", "return", "null", ";", "}", "private", "synchronized", "static", "void", "existingExternalFilesAdd", "(", "File", "externalFile", ")", "{", "existingExternalFiles", ".", "add", "(", "externalFile", ")", ";", "}", "private", "synchronized", "static", "boolean", "existingExternalFilesContains", "(", "File", "externalFile", ")", "{", "return", "existingExternalFiles", ".", "contains", "(", "externalFile", ")", ";", "}", "public", "static", "boolean", "isFile", "(", "Object", "target", ")", "{", "return", "getFile", "(", "target", ")", "!=", "null", ";", "}", "public", "static", "synchronized", "File", "getFile", "(", "Object", "target", ")", "{", "if", "(", "existingExternalConfirmedFiles", ".", "contains", "(", "target", ")", ")", "return", "(", "File", ")", "target", ";", "if", "(", "target", "instanceof", "File", ")", "{", "File", "f", "=", "(", "File", ")", "target", ";", "if", "(", "f", ".", "isFile", "(", ")", ")", "{", "existingExternalConfirmedFiles", ".", "add", "(", "f", ")", ";", "return", "f", ";", "}", "}", "return", "null", ";", "}", "protected", "IStatus", "validateExistence", "(", "IResource", "underlyingResource", ")", "{", "return", "JavaModelStatus", ".", "VERIFIED_OK", ";", "}", "}", "</s>" ]
5,273
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaModelStatusConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "ASTNode", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "SimpleName", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "rewrite", ".", "ASTRewrite", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Messages", ";", "public", "class", "CreateInitializerOperation", "extends", "CreateTypeMemberOperation", "{", "protected", "int", "numberOfInitializers", "=", "1", ";", "public", "CreateInitializerOperation", "(", "IType", "parentElement", ",", "String", "source", ")", "{", "super", "(", "parentElement", ",", "source", ",", "false", ")", ";", "}", "protected", "ASTNode", "generateElementAST", "(", "ASTRewrite", "rewriter", ",", "ICompilationUnit", "cu", ")", "throws", "JavaModelException", "{", "ASTNode", "node", "=", "super", ".", "generateElementAST", "(", "rewriter", ",", "cu", ")", ";", "if", "(", "node", ".", "getNodeType", "(", ")", "!=", "ASTNode", ".", "INITIALIZER", ")", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INVALID_CONTENTS", ")", ")", ";", "return", "node", ";", "}", "protected", "IJavaElement", "generateResultHandle", "(", ")", "{", "try", "{", "getType", "(", ")", ".", "getCompilationUnit", "(", ")", ".", "close", "(", ")", ";", "if", "(", "this", ".", "anchorElement", "==", "null", ")", "{", "return", "getType", "(", ")", ".", "getInitializer", "(", "this", ".", "numberOfInitializers", ")", ";", "}", "else", "{", "IJavaElement", "[", "]", "children", "=", "getType", "(", ")", ".", "getChildren", "(", ")", ";", "int", "count", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "children", ".", "length", ";", "i", "++", ")", "{", "IJavaElement", "child", "=", "children", "[", "i", "]", ";", "if", "(", "child", ".", "equals", "(", "this", ".", "anchorElement", ")", ")", "{", "if", "(", "child", ".", "getElementType", "(", ")", "==", "IJavaElement", ".", "INITIALIZER", "&&", "this", ".", "insertionPolicy", "==", "CreateElementInCUOperation", ".", "INSERT_AFTER", ")", "{", "count", "++", ";", "}", "return", "getType", "(", ")", ".", "getInitializer", "(", "count", ")", ";", "}", "else", "if", "(", "child", ".", "getElementType", "(", ")", "==", "IJavaElement", ".", "INITIALIZER", ")", "{", "count", "++", ";", "}", "}", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "return", "null", ";", "}", "public", "String", "getMainTaskName", "(", ")", "{", "return", "Messages", ".", "operation_createInitializerProgress", ";", "}", "protected", "SimpleName", "rename", "(", "ASTNode", "node", ",", "SimpleName", "newName", ")", "{", "return", "null", ";", "}", "protected", "void", "initializeDefaultPosition", "(", ")", "{", "IType", "parentElement", "=", "getType", "(", ")", ";", "try", "{", "IJavaElement", "[", "]", "elements", "=", "parentElement", ".", "getInitializers", "(", ")", ";", "if", "(", "elements", "!=", "null", "&&", "elements", ".", "length", ">", "0", ")", "{", "this", ".", "numberOfInitializers", "=", "elements", ".", "length", ";", "createAfter", "(", "elements", "[", "elements", ".", "length", "-", "1", "]", ")", ";", "}", "else", "{", "elements", "=", "parentElement", ".", "getChildren", "(", ")", ";", "if", "(", "elements", "!=", "null", "&&", "elements", ".", "length", ">", "0", ")", "{", "createBefore", "(", "elements", "[", "0", "]", ")", ";", "}", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "}", "}", "</s>" ]
5,274
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "HashSet", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "java", ".", "util", ".", "Set", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IAnnotation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElementDelta", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IParent", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "JavaElementDeltaBuilder", "{", "IJavaElement", "javaElement", ";", "int", "maxDepth", "=", "Integer", ".", "MAX_VALUE", ";", "Map", "infos", ";", "Map", "annotationInfos", ";", "Map", "oldPositions", ";", "Map", "newPositions", ";", "public", "JavaElementDelta", "delta", "=", "null", ";", "HashSet", "added", ";", "HashSet", "removed", ";", "static", "class", "ListItem", "{", "public", "IJavaElement", "previous", ";", "public", "IJavaElement", "next", ";", "public", "ListItem", "(", "IJavaElement", "previous", ",", "IJavaElement", "next", ")", "{", "this", ".", "previous", "=", "previous", ";", "this", ".", "next", "=", "next", ";", "}", "}", "public", "JavaElementDeltaBuilder", "(", "IJavaElement", "javaElement", ")", "{", "this", ".", "javaElement", "=", "javaElement", ";", "initialize", "(", ")", ";", "recordElementInfo", "(", "javaElement", ",", "(", "JavaModel", ")", "this", ".", "javaElement", ".", "getJavaModel", "(", ")", ",", "0", ")", ";", "}", "public", "JavaElementDeltaBuilder", "(", "IJavaElement", "javaElement", ",", "int", "maxDepth", ")", "{", "this", ".", "javaElement", "=", "javaElement", ";", "this", ".", "maxDepth", "=", "maxDepth", ";", "initialize", "(", ")", ";", "recordElementInfo", "(", "javaElement", ",", "(", "JavaModel", ")", "this", ".", "javaElement", ".", "getJavaModel", "(", ")", ",", "0", ")", ";", "}", "private", "void", "added", "(", "IJavaElement", "element", ")", "{", "this", ".", "added", ".", "add", "(", "element", ")", ";", "ListItem", "current", "=", "getNewPosition", "(", "element", ")", ";", "ListItem", "previous", "=", "null", ",", "next", "=", "null", ";", "if", "(", "current", ".", "previous", "!=", "null", ")", "previous", "=", "getNewPosition", "(", "current", ".", "previous", ")", ";", "if", "(", "current", ".", "next", "!=", "null", ")", "next", "=", "getNewPosition", "(", "current", ".", "next", ")", ";", "if", "(", "previous", "!=", "null", ")", "previous", ".", "next", "=", "current", ".", "next", ";", "if", "(", "next", "!=", "null", ")", "next", ".", "previous", "=", "current", ".", "previous", ";", "}", "public", "void", "buildDeltas", "(", ")", "{", "this", ".", "delta", "=", "new", "JavaElementDelta", "(", "this", ".", "javaElement", ")", ";", "if", "(", "this", ".", "javaElement", ".", "getElementType", "(", ")", ">=", "IJavaElement", ".", "COMPILATION_UNIT", ")", "{", "this", ".", "delta", ".", "fineGrained", "(", ")", ";", "}", "recordNewPositions", "(", "this", ".", "javaElement", ",", "0", ")", ";", "findAdditions", "(", "this", ".", "javaElement", ",", "0", ")", ";", "findDeletions", "(", ")", ";", "findChangesInPositioning", "(", "this", ".", "javaElement", ",", "0", ")", ";", "trimDelta", "(", "this", ".", "delta", ")", ";", "if", "(", "this", ".", "delta", ".", "getAffectedChildren", "(", ")", ".", "length", "==", "0", ")", "{", "this", ".", "delta", ".", "contentChanged", "(", ")", ";", "}", "}", "private", "boolean", "equals", "(", "char", "[", "]", "[", "]", "[", "]", "first", ",", "char", "[", "]", "[", "]", "[", "]", "second", ")", "{", "if", "(", "first", "==", "second", ")", "return", "true", ";", "if", "(", "first", "==", "null", "||", "second", "==", "null", ")", "return", "false", ";", "if", "(", "first", ".", "length", "!=", "second", ".", "length", ")", "return", "false", ";", "for", "(", "int", "i", "=", "first", ".", "length", ";", "--", "i", ">=", "0", ";", ")", "if", "(", "!", "CharOperation", ".", "equals", "(", "first", "[", "i", "]", ",", "second", "[", "i", "]", ")", ")", "return", "false", ";", "return", "true", ";", "}", "private", "void", "findAdditions", "(", "IJavaElement", "newElement", ",", "int", "depth", ")", "{", "JavaElementInfo", "oldInfo", "=", "getElementInfo", "(", "newElement", ")", ";", "if", "(", "oldInfo", "==", "null", "&&", "depth", "<", "this", ".", "maxDepth", ")", "{", "this", ".", "delta", ".", "added", "(", "newElement", ")", ";", "added", "(", "newElement", ")", ";", "}", "else", "{", "removeElementInfo", "(", "newElement", ")", ";", "}", "if", "(", "depth", ">=", "this", ".", "maxDepth", ")", "{", "this", ".", "delta", ".", "changed", "(", "newElement", ",", "IJavaElementDelta", ".", "F_CONTENT", ")", ";", "return", ";", "}", "JavaElementInfo", "newInfo", "=", "null", ";", "try", "{", "newInfo", "=", "(", "JavaElementInfo", ")", "(", "(", "JavaElement", ")", "newElement", ")", ".", "getElementInfo", "(", ")", ";", "}", "catch", "(", "JavaModelException", "npe", ")", "{", "return", ";", "}", "findContentChange", "(", "oldInfo", ",", "newInfo", ",", "newElement", ")", ";", "if", "(", "oldInfo", "!=", "null", "&&", "newElement", "instanceof", "IParent", ")", "{", "IJavaElement", "[", "]", "children", "=", "newInfo", ".", "getChildren", "(", ")", ";", "if", "(", "children", "!=", "null", ")", "{", "int", "length", "=", "children", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "findAdditions", "(", "children", "[", "i", "]", ",", "depth", "+", "1", ")", ";", "}", "}", "}", "}", "private", "void", "findChangesInPositioning", "(", "IJavaElement", "element", ",", "int", "depth", ")", "{", "if", "(", "depth", ">=", "this", ".", "maxDepth", "||", "this", ".", "added", ".", "contains", "(", "element", ")", "||", "this", ".", "removed", ".", "contains", "(", "element", ")", ")", "return", ";", "if", "(", "!", "isPositionedCorrectly", "(", "element", ")", ")", "{", "this", ".", "delta", ".", "changed", "(", "element", ",", "IJavaElementDelta", ".", "F_REORDER", ")", ";", "}", "if", "(", "element", "instanceof", "IParent", ")", "{", "JavaElementInfo", "info", "=", "null", ";", "try", "{", "info", "=", "(", "JavaElementInfo", ")", "(", "(", "JavaElement", ")", "element", ")", ".", "getElementInfo", "(", ")", ";", "}", "catch", "(", "JavaModelException", "npe", ")", "{", "return", ";", "}", "IJavaElement", "[", "]", "children", "=", "info", ".", "getChildren", "(", ")", ";", "if", "(", "children", "!=", "null", ")", "{", "int", "length", "=", "children", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "findChangesInPositioning", "(", "children", "[", "i", "]", ",", "depth", "+", "1", ")", ";", "}", "}", "}", "}", "private", "void", "findAnnotationChanges", "(", "IAnnotation", "[", "]", "oldAnnotations", ",", "IAnnotation", "[", "]", "newAnnotations", ",", "IJavaElement", "parent", ")", "{", "ArrayList", "annotationDeltas", "=", "null", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "newAnnotations", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IAnnotation", "newAnnotation", "=", "newAnnotations", "[", "i", "]", ";", "Object", "oldInfo", "=", "this", ".", "annotationInfos", ".", "remove", "(", "newAnnotation", ")", ";", "if", "(", "oldInfo", "==", "null", ")", "{", "JavaElementDelta", "annotationDelta", "=", "new", "JavaElementDelta", "(", "newAnnotation", ")", ";", "annotationDelta", ".", "added", "(", ")", ";", "if", "(", "annotationDeltas", "==", "null", ")", "annotationDeltas", "=", "new", "ArrayList", "(", ")", ";", "annotationDeltas", ".", "add", "(", "annotationDelta", ")", ";", "continue", ";", "}", "else", "{", "AnnotationInfo", "newInfo", "=", "null", ";", "try", "{", "newInfo", "=", "(", "AnnotationInfo", ")", "(", "(", "JavaElement", ")", "newAnnotation", ")", ".", "getElementInfo", "(", ")", ";", "}", "catch", "(", "JavaModelException", "npe", ")", "{", "return", ";", "}", "if", "(", "!", "Util", ".", "equalArraysOrNull", "(", "(", "(", "AnnotationInfo", ")", "oldInfo", ")", ".", "members", ",", "newInfo", ".", "members", ")", ")", "{", "JavaElementDelta", "annotationDelta", "=", "new", "JavaElementDelta", "(", "newAnnotation", ")", ";", "annotationDelta", ".", "changed", "(", "IJavaElementDelta", ".", "F_CONTENT", ")", ";", "if", "(", "annotationDeltas", "==", "null", ")", "annotationDeltas", "=", "new", "ArrayList", "(", ")", ";", "annotationDeltas", ".", "add", "(", "annotationDelta", ")", ";", "}", "}", "}", "for", "(", "int", "i", "=", "0", ",", "length", "=", "oldAnnotations", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IAnnotation", "oldAnnotation", "=", "oldAnnotations", "[", "i", "]", ";", "if", "(", "this", ".", "annotationInfos", ".", "remove", "(", "oldAnnotation", ")", "!=", "null", ")", "{", "JavaElementDelta", "annotationDelta", "=", "new", "JavaElementDelta", "(", "oldAnnotation", ")", ";", "annotationDelta", ".", "removed", "(", ")", ";", "if", "(", "annotationDeltas", "==", "null", ")", "annotationDeltas", "=", "new", "ArrayList", "(", ")", ";", "annotationDeltas", ".", "add", "(", "annotationDelta", ")", ";", "}", "}", "if", "(", "annotationDeltas", "==", "null", ")", "return", ";", "int", "size", "=", "annotationDeltas", ".", "size", "(", ")", ";", "if", "(", "size", ">", "0", ")", "{", "JavaElementDelta", "parentDelta", "=", "this", ".", "delta", ".", "changed", "(", "parent", ",", "IJavaElementDelta", ".", "F_ANNOTATIONS", ")", ";", "parentDelta", ".", "annotationDeltas", "=", "(", "IJavaElementDelta", "[", "]", ")", "annotationDeltas", ".", "toArray", "(", "new", "IJavaElementDelta", "[", "size", "]", ")", ";", "}", "}", "private", "void", "findContentChange", "(", "JavaElementInfo", "oldInfo", ",", "JavaElementInfo", "newInfo", ",", "IJavaElement", "newElement", ")", "{", "if", "(", "oldInfo", "instanceof", "MemberElementInfo", "&&", "newInfo", "instanceof", "MemberElementInfo", ")", "{", "if", "(", "(", "(", "MemberElementInfo", ")", "oldInfo", ")", ".", "getModifiers", "(", ")", "!=", "(", "(", "MemberElementInfo", ")", "newInfo", ")", ".", "getModifiers", "(", ")", ")", "{", "this", ".", "delta", ".", "changed", "(", "newElement", ",", "IJavaElementDelta", ".", "F_MODIFIERS", ")", ";", "}", "if", "(", "oldInfo", "instanceof", "AnnotatableInfo", "&&", "newInfo", "instanceof", "AnnotatableInfo", ")", "{", "findAnnotationChanges", "(", "(", "(", "AnnotatableInfo", ")", "oldInfo", ")", ".", "annotations", ",", "(", "(", "AnnotatableInfo", ")", "newInfo", ")", ".", "annotations", ",", "newElement", ")", ";", "}", "if", "(", "oldInfo", "instanceof", "SourceMethodElementInfo", "&&", "newInfo", "instanceof", "SourceMethodElementInfo", ")", "{", "SourceMethodElementInfo", "oldSourceMethodInfo", "=", "(", "SourceMethodElementInfo", ")", "oldInfo", ";", "SourceMethodElementInfo", "newSourceMethodInfo", "=", "(", "SourceMethodElementInfo", ")", "newInfo", ";", "if", "(", "!", "CharOperation", ".", "equals", "(", "oldSourceMethodInfo", ".", "getReturnTypeName", "(", ")", ",", "newSourceMethodInfo", ".", "getReturnTypeName", "(", ")", ")", "||", "!", "CharOperation", ".", "equals", "(", "oldSourceMethodInfo", ".", "getTypeParameterNames", "(", ")", ",", "newSourceMethodInfo", ".", "getTypeParameterNames", "(", ")", ")", "||", "!", "equals", "(", "oldSourceMethodInfo", ".", "getTypeParameterBounds", "(", ")", ",", "newSourceMethodInfo", ".", "getTypeParameterBounds", "(", ")", ")", ")", "{", "this", ".", "delta", ".", "changed", "(", "newElement", ",", "IJavaElementDelta", ".", "F_CONTENT", ")", ";", "}", "}", "else", "if", "(", "oldInfo", "instanceof", "SourceFieldElementInfo", "&&", "newInfo", "instanceof", "SourceFieldElementInfo", ")", "{", "if", "(", "!", "CharOperation", ".", "equals", "(", "(", "(", "SourceFieldElementInfo", ")", "oldInfo", ")", ".", "getTypeName", "(", ")", ",", "(", "(", "SourceFieldElementInfo", ")", "newInfo", ")", ".", "getTypeName", "(", ")", ")", ")", "{", "this", ".", "delta", ".", "changed", "(", "newElement", ",", "IJavaElementDelta", ".", "F_CONTENT", ")", ";", "}", "}", "else", "if", "(", "oldInfo", "instanceof", "SourceTypeElementInfo", "&&", "newInfo", "instanceof", "SourceTypeElementInfo", ")", "{", "SourceTypeElementInfo", "oldSourceTypeInfo", "=", "(", "SourceTypeElementInfo", ")", "oldInfo", ";", "SourceTypeElementInfo", "newSourceTypeInfo", "=", "(", "SourceTypeElementInfo", ")", "newInfo", ";", "if", "(", "!", "CharOperation", ".", "equals", "(", "oldSourceTypeInfo", ".", "getSuperclassName", "(", ")", ",", "newSourceTypeInfo", ".", "getSuperclassName", "(", ")", ")", "||", "!", "CharOperation", ".", "equals", "(", "oldSourceTypeInfo", ".", "getInterfaceNames", "(", ")", ",", "newSourceTypeInfo", ".", "getInterfaceNames", "(", ")", ")", ")", "{", "this", ".", "delta", ".", "changed", "(", "newElement", ",", "IJavaElementDelta", ".", "F_SUPER_TYPES", ")", ";", "}", "if", "(", "!", "CharOperation", ".", "equals", "(", "oldSourceTypeInfo", ".", "getTypeParameterNames", "(", ")", ",", "newSourceTypeInfo", ".", "getTypeParameterNames", "(", ")", ")", "||", "!", "equals", "(", "oldSourceTypeInfo", ".", "getTypeParameterBounds", "(", ")", ",", "newSourceTypeInfo", ".", "getTypeParameterBounds", "(", ")", ")", ")", "{", "this", ".", "delta", ".", "changed", "(", "newElement", ",", "IJavaElementDelta", ".", "F_CONTENT", ")", ";", "}", "HashMap", "oldTypeCategories", "=", "oldSourceTypeInfo", ".", "categories", ";", "HashMap", "newTypeCategories", "=", "newSourceTypeInfo", ".", "categories", ";", "if", "(", "oldTypeCategories", "!=", "null", ")", "{", "Set", "elements", ";", "if", "(", "newTypeCategories", "!=", "null", ")", "{", "elements", "=", "new", "HashSet", "(", "oldTypeCategories", ".", "keySet", "(", ")", ")", ";", "elements", ".", "addAll", "(", "newTypeCategories", ".", "keySet", "(", ")", ")", ";", "}", "else", "elements", "=", "oldTypeCategories", ".", "keySet", "(", ")", ";", "Iterator", "iterator", "=", "elements", ".", "iterator", "(", ")", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "IJavaElement", "element", "=", "(", "IJavaElement", ")", "iterator", ".", "next", "(", ")", ";", "String", "[", "]", "oldCategories", "=", "(", "String", "[", "]", ")", "oldTypeCategories", ".", "get", "(", "element", ")", ";", "String", "[", "]", "newCategories", "=", "newTypeCategories", "==", "null", "?", "null", ":", "(", "String", "[", "]", ")", "newTypeCategories", ".", "get", "(", "element", ")", ";", "if", "(", "!", "Util", ".", "equalArraysOrNull", "(", "oldCategories", ",", "newCategories", ")", ")", "{", "this", ".", "delta", ".", "changed", "(", "element", ",", "IJavaElementDelta", ".", "F_CATEGORIES", ")", ";", "}", "}", "}", "else", "if", "(", "newTypeCategories", "!=", "null", ")", "{", "Iterator", "elements", "=", "newTypeCategories", ".", "keySet", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "elements", ".", "hasNext", "(", ")", ")", "{", "IJavaElement", "element", "=", "(", "IJavaElement", ")", "elements", ".", "next", "(", ")", ";", "this", ".", "delta", ".", "changed", "(", "element", ",", "IJavaElementDelta", ".", "F_CATEGORIES", ")", ";", "}", "}", "}", "}", "}", "private", "void", "findDeletions", "(", ")", "{", "Iterator", "iter", "=", "this", ".", "infos", ".", "keySet", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "iter", ".", "hasNext", "(", ")", ")", "{", "IJavaElement", "element", "=", "(", "IJavaElement", ")", "iter", ".", "next", "(", ")", ";", "this", ".", "delta", ".", "removed", "(", "element", ")", ";", "removed", "(", "element", ")", ";", "}", "}", "private", "JavaElementInfo", "getElementInfo", "(", "IJavaElement", "element", ")", "{", "return", "(", "JavaElementInfo", ")", "this", ".", "infos", ".", "get", "(", "element", ")", ";", "}", "private", "ListItem", "getNewPosition", "(", "IJavaElement", "element", ")", "{", "return", "(", "ListItem", ")", "this", ".", "newPositions", ".", "get", "(", "element", ")", ";", "}", "private", "ListItem", "getOldPosition", "(", "IJavaElement", "element", ")", "{", "return", "(", "ListItem", ")", "this", ".", "oldPositions", ".", "get", "(", "element", ")", ";", "}", "private", "void", "initialize", "(", ")", "{", "this", ".", "infos", "=", "new", "HashMap", "(", "20", ")", ";", "this", ".", "oldPositions", "=", "new", "HashMap", "(", "20", ")", ";", "this", ".", "newPositions", "=", "new", "HashMap", "(", "20", ")", ";", "this", ".", "oldPositions", ".", "put", "(", "this", ".", "javaElement", ",", "new", "ListItem", "(", "null", ",", "null", ")", ")", ";", "this", ".", "newPositions", ".", "put", "(", "this", ".", "javaElement", ",", "new", "ListItem", "(", "null", ",", "null", ")", ")", ";", "this", ".", "added", "=", "new", "HashSet", "(", "5", ")", ";", "this", ".", "removed", "=", "new", "HashSet", "(", "5", ")", ";", "}", "private", "void", "insertPositions", "(", "IJavaElement", "[", "]", "elements", ",", "boolean", "isNew", ")", "{", "int", "length", "=", "elements", ".", "length", ";", "IJavaElement", "previous", "=", "null", ",", "current", "=", "null", ",", "next", "=", "(", "length", ">", "0", ")", "?", "elements", "[", "0", "]", ":", "null", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "previous", "=", "current", ";", "current", "=", "next", ";", "next", "=", "(", "i", "+", "1", "<", "length", ")", "?", "elements", "[", "i", "+", "1", "]", ":", "null", ";", "if", "(", "isNew", ")", "{", "this", ".", "newPositions", ".", "put", "(", "current", ",", "new", "ListItem", "(", "previous", ",", "next", ")", ")", ";", "}", "else", "{", "this", ".", "oldPositions", ".", "put", "(", "current", ",", "new", "ListItem", "(", "previous", ",", "next", ")", ")", ";", "}", "}", "}", "private", "boolean", "isPositionedCorrectly", "(", "IJavaElement", "element", ")", "{", "ListItem", "oldListItem", "=", "getOldPosition", "(", "element", ")", ";", "if", "(", "oldListItem", "==", "null", ")", "return", "false", ";", "ListItem", "newListItem", "=", "getNewPosition", "(", "element", ")", ";", "if", "(", "newListItem", "==", "null", ")", "return", "false", ";", "IJavaElement", "oldPrevious", "=", "oldListItem", ".", "previous", ";", "IJavaElement", "newPrevious", "=", "newListItem", ".", "previous", ";", "if", "(", "oldPrevious", "==", "null", ")", "{", "return", "newPrevious", "==", "null", ";", "}", "else", "{", "return", "oldPrevious", ".", "equals", "(", "newPrevious", ")", ";", "}", "}", "private", "void", "recordElementInfo", "(", "IJavaElement", "element", ",", "JavaModel", "model", ",", "int", "depth", ")", "{", "if", "(", "depth", ">=", "this", ".", "maxDepth", ")", "{", "return", ";", "}", "JavaElementInfo", "info", "=", "(", "JavaElementInfo", ")", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "getInfo", "(", "element", ")", ";", "if", "(", "info", "==", "null", ")", "return", ";", "this", ".", "infos", ".", "put", "(", "element", ",", "info", ")", ";", "if", "(", "element", "instanceof", "IParent", ")", "{", "IJavaElement", "[", "]", "children", "=", "info", ".", "getChildren", "(", ")", ";", "if", "(", "children", "!=", "null", ")", "{", "insertPositions", "(", "children", ",", "false", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "children", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "recordElementInfo", "(", "children", "[", "i", "]", ",", "model", ",", "depth", "+", "1", ")", ";", "}", "}", "IAnnotation", "[", "]", "annotations", "=", "null", ";", "if", "(", "info", "instanceof", "AnnotatableInfo", ")", "annotations", "=", "(", "(", "AnnotatableInfo", ")", "info", ")", ".", "annotations", ";", "if", "(", "annotations", "!=", "null", ")", "{", "if", "(", "this", ".", "annotationInfos", "==", "null", ")", "this", ".", "annotationInfos", "=", "new", "HashMap", "(", ")", ";", "JavaModelManager", "manager", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "annotations", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "this", ".", "annotationInfos", ".", "put", "(", "annotations", "[", "i", "]", ",", "manager", ".", "getInfo", "(", "annotations", "[", "i", "]", ")", ")", ";", "}", "}", "}", "private", "void", "recordNewPositions", "(", "IJavaElement", "newElement", ",", "int", "depth", ")", "{", "if", "(", "depth", "<", "this", ".", "maxDepth", "&&", "newElement", "instanceof", "IParent", ")", "{", "JavaElementInfo", "info", "=", "null", ";", "try", "{", "info", "=", "(", "JavaElementInfo", ")", "(", "(", "JavaElement", ")", "newElement", ")", ".", "getElementInfo", "(", ")", ";", "}", "catch", "(", "JavaModelException", "npe", ")", "{", "return", ";", "}", "IJavaElement", "[", "]", "children", "=", "info", ".", "getChildren", "(", ")", ";", "if", "(", "children", "!=", "null", ")", "{", "insertPositions", "(", "children", ",", "true", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "children", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "recordNewPositions", "(", "children", "[", "i", "]", ",", "depth", "+", "1", ")", ";", "}", "}", "}", "}", "private", "void", "removed", "(", "IJavaElement", "element", ")", "{", "this", ".", "removed", ".", "add", "(", "element", ")", ";", "ListItem", "current", "=", "getOldPosition", "(", "element", ")", ";", "ListItem", "previous", "=", "null", ",", "next", "=", "null", ";", "if", "(", "current", ".", "previous", "!=", "null", ")", "previous", "=", "getOldPosition", "(", "current", ".", "previous", ")", ";", "if", "(", "current", ".", "next", "!=", "null", ")", "next", "=", "getOldPosition", "(", "current", ".", "next", ")", ";", "if", "(", "previous", "!=", "null", ")", "previous", ".", "next", "=", "current", ".", "next", ";", "if", "(", "next", "!=", "null", ")", "next", ".", "previous", "=", "current", ".", "previous", ";", "}", "private", "void", "removeElementInfo", "(", "IJavaElement", "element", ")", "{", "this", ".", "infos", ".", "remove", "(", "element", ")", ";", "}", "public", "String", "toString", "(", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "buffer", ".", "append", "(", "\"\"", ")", ";", "buffer", ".", "append", "(", "this", ".", "delta", "==", "null", "?", "\"<null>\"", ":", "this", ".", "delta", ".", "toString", "(", ")", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "private", "void", "trimDelta", "(", "JavaElementDelta", "elementDelta", ")", "{", "if", "(", "elementDelta", ".", "getKind", "(", ")", "==", "IJavaElementDelta", ".", "REMOVED", ")", "{", "IJavaElementDelta", "[", "]", "children", "=", "elementDelta", ".", "getAffectedChildren", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "children", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "elementDelta", ".", "removeAffectedChild", "(", "(", "JavaElementDelta", ")", "children", "[", "i", "]", ")", ";", "}", "}", "else", "{", "IJavaElementDelta", "[", "]", "children", "=", "elementDelta", ".", "getAffectedChildren", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "children", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "trimDelta", "(", "(", "JavaElementDelta", ")", "children", "[", "i", "]", ")", ";", "}", "}", "}", "}", "</s>" ]
5,275
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "util", ".", "*", ";", "import", "java", ".", "util", ".", "zip", ".", "ZipEntry", ";", "import", "java", ".", "util", ".", "zip", ".", "ZipException", ";", "import", "java", ".", "util", ".", "zip", ".", "ZipFile", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "HashtableOfArrayToObject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "JarPackageFragmentRoot", "extends", "PackageFragmentRoot", "{", "private", "final", "static", "ArrayList", "EMPTY_LIST", "=", "new", "ArrayList", "(", ")", ";", "protected", "final", "IPath", "jarPath", ";", "protected", "JarPackageFragmentRoot", "(", "IPath", "externalJarPath", ",", "JavaProject", "project", ")", "{", "super", "(", "null", ",", "project", ")", ";", "this", ".", "jarPath", "=", "externalJarPath", ";", "}", "protected", "JarPackageFragmentRoot", "(", "IResource", "resource", ",", "JavaProject", "project", ")", "{", "super", "(", "resource", ",", "project", ")", ";", "this", ".", "jarPath", "=", "resource", ".", "getFullPath", "(", ")", ";", "}", "protected", "boolean", "computeChildren", "(", "OpenableElementInfo", "info", ",", "IResource", "underlyingResource", ")", "throws", "JavaModelException", "{", "HashtableOfArrayToObject", "rawPackageInfo", "=", "new", "HashtableOfArrayToObject", "(", ")", ";", "IJavaElement", "[", "]", "children", ";", "ZipFile", "jar", "=", "null", ";", "try", "{", "IJavaProject", "project", "=", "getJavaProject", "(", ")", ";", "String", "sourceLevel", "=", "project", ".", "getOption", "(", "JavaCore", ".", "COMPILER_SOURCE", ",", "true", ")", ";", "String", "compliance", "=", "project", ".", "getOption", "(", "JavaCore", ".", "COMPILER_COMPLIANCE", ",", "true", ")", ";", "jar", "=", "getJar", "(", ")", ";", "rawPackageInfo", ".", "put", "(", "CharOperation", ".", "NO_STRINGS", ",", "new", "ArrayList", "[", "]", "{", "EMPTY_LIST", ",", "EMPTY_LIST", "}", ")", ";", "for", "(", "Enumeration", "e", "=", "jar", ".", "entries", "(", ")", ";", "e", ".", "hasMoreElements", "(", ")", ";", ")", "{", "ZipEntry", "member", "=", "(", "ZipEntry", ")", "e", ".", "nextElement", "(", ")", ";", "initRawPackageInfo", "(", "rawPackageInfo", ",", "member", ".", "getName", "(", ")", ",", "member", ".", "isDirectory", "(", ")", ",", "sourceLevel", ",", "compliance", ")", ";", "}", "children", "=", "new", "IJavaElement", "[", "rawPackageInfo", ".", "size", "(", ")", "]", ";", "int", "index", "=", "0", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "rawPackageInfo", ".", "keyTable", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "String", "[", "]", "pkgName", "=", "(", "String", "[", "]", ")", "rawPackageInfo", ".", "keyTable", "[", "i", "]", ";", "if", "(", "pkgName", "==", "null", ")", "continue", ";", "children", "[", "index", "++", "]", "=", "getPackageFragment", "(", "pkgName", ")", ";", "}", "}", "catch", "(", "CoreException", "e", ")", "{", "if", "(", "e", ".", "getCause", "(", ")", "instanceof", "ZipException", ")", "{", "Util", ".", "log", "(", "e", ",", "\"\"", "+", "toStringWithAncestors", "(", ")", ")", ";", "children", "=", "NO_ELEMENTS", ";", "}", "else", "if", "(", "e", "instanceof", "JavaModelException", ")", "{", "throw", "(", "JavaModelException", ")", "e", ";", "}", "else", "{", "throw", "new", "JavaModelException", "(", "e", ")", ";", "}", "}", "finally", "{", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "closeZipFile", "(", "jar", ")", ";", "}", "info", ".", "setChildren", "(", "children", ")", ";", "(", "(", "JarPackageFragmentRootInfo", ")", "info", ")", ".", "rawPackageInfo", "=", "rawPackageInfo", ";", "return", "true", ";", "}", "protected", "Object", "createElementInfo", "(", ")", "{", "return", "new", "JarPackageFragmentRootInfo", "(", ")", ";", "}", "protected", "int", "determineKind", "(", "IResource", "underlyingResource", ")", "{", "return", "IPackageFragmentRoot", ".", "K_BINARY", ";", "}", "public", "boolean", "equals", "(", "Object", "o", ")", "{", "if", "(", "this", "==", "o", ")", "return", "true", ";", "if", "(", "o", "instanceof", "JarPackageFragmentRoot", ")", "{", "JarPackageFragmentRoot", "other", "=", "(", "JarPackageFragmentRoot", ")", "o", ";", "return", "this", ".", "jarPath", ".", "equals", "(", "other", ".", "jarPath", ")", ";", "}", "return", "false", ";", "}", "public", "String", "getElementName", "(", ")", "{", "return", "this", ".", "jarPath", ".", "lastSegment", "(", ")", ";", "}", "public", "ZipFile", "getJar", "(", ")", "throws", "CoreException", "{", "return", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "getZipFile", "(", "getPath", "(", ")", ")", ";", "}", "public", "int", "getKind", "(", ")", "{", "return", "IPackageFragmentRoot", ".", "K_BINARY", ";", "}", "int", "internalKind", "(", ")", "throws", "JavaModelException", "{", "return", "IPackageFragmentRoot", ".", "K_BINARY", ";", "}", "public", "Object", "[", "]", "getNonJavaResources", "(", ")", "throws", "JavaModelException", "{", "Object", "[", "]", "defaultPkgResources", "=", "(", "(", "JarPackageFragment", ")", "getPackageFragment", "(", "CharOperation", ".", "NO_STRINGS", ")", ")", ".", "storedNonJavaResources", "(", ")", ";", "int", "length", "=", "defaultPkgResources", ".", "length", ";", "if", "(", "length", "==", "0", ")", "return", "defaultPkgResources", ";", "Object", "[", "]", "nonJavaResources", "=", "new", "Object", "[", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "JarEntryResource", "nonJavaResource", "=", "(", "JarEntryResource", ")", "defaultPkgResources", "[", "i", "]", ";", "nonJavaResources", "[", "i", "]", "=", "nonJavaResource", ".", "clone", "(", "this", ")", ";", "}", "return", "nonJavaResources", ";", "}", "public", "PackageFragment", "getPackageFragment", "(", "String", "[", "]", "pkgName", ")", "{", "return", "new", "JarPackageFragment", "(", "this", ",", "pkgName", ")", ";", "}", "public", "IPath", "internalPath", "(", ")", "{", "if", "(", "isExternal", "(", ")", ")", "{", "return", "this", ".", "jarPath", ";", "}", "else", "{", "return", "super", ".", "internalPath", "(", ")", ";", "}", "}", "public", "IResource", "resource", "(", "PackageFragmentRoot", "root", ")", "{", "if", "(", "this", ".", "resource", "==", "null", ")", "{", "return", "null", ";", "}", "return", "super", ".", "resource", "(", "root", ")", ";", "}", "public", "IResource", "getUnderlyingResource", "(", ")", "throws", "JavaModelException", "{", "if", "(", "isExternal", "(", ")", ")", "{", "if", "(", "!", "exists", "(", ")", ")", "throw", "newNotPresentException", "(", ")", ";", "return", "null", ";", "}", "else", "{", "return", "super", ".", "getUnderlyingResource", "(", ")", ";", "}", "}", "public", "int", "hashCode", "(", ")", "{", "return", "this", ".", "jarPath", ".", "hashCode", "(", ")", ";", "}", "private", "void", "initRawPackageInfo", "(", "HashtableOfArrayToObject", "rawPackageInfo", ",", "String", "entryName", ",", "boolean", "isDirectory", ",", "String", "sourceLevel", ",", "String", "compliance", ")", "{", "int", "lastSeparator", "=", "isDirectory", "?", "entryName", ".", "length", "(", ")", "-", "1", ":", "entryName", ".", "lastIndexOf", "(", "'/'", ")", ";", "String", "[", "]", "pkgName", "=", "Util", ".", "splitOn", "(", "'/'", ",", "entryName", ",", "0", ",", "lastSeparator", ")", ";", "String", "[", "]", "existing", "=", "null", ";", "int", "length", "=", "pkgName", ".", "length", ";", "int", "existingLength", "=", "length", ";", "while", "(", "existingLength", ">=", "0", ")", "{", "existing", "=", "(", "String", "[", "]", ")", "rawPackageInfo", ".", "getKey", "(", "pkgName", ",", "existingLength", ")", ";", "if", "(", "existing", "!=", "null", ")", "break", ";", "existingLength", "--", ";", "}", "JavaModelManager", "manager", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ";", "for", "(", "int", "i", "=", "existingLength", ";", "i", "<", "length", ";", "i", "++", ")", "{", "if", "(", "Util", ".", "isValidFolderNameForPackage", "(", "pkgName", "[", "i", "]", ",", "sourceLevel", ",", "compliance", ")", ")", "{", "System", ".", "arraycopy", "(", "existing", ",", "0", ",", "existing", "=", "new", "String", "[", "i", "+", "1", "]", ",", "0", ",", "i", ")", ";", "existing", "[", "i", "]", "=", "manager", ".", "intern", "(", "pkgName", "[", "i", "]", ")", ";", "rawPackageInfo", ".", "put", "(", "existing", ",", "new", "ArrayList", "[", "]", "{", "EMPTY_LIST", ",", "EMPTY_LIST", "}", ")", ";", "}", "else", "{", "if", "(", "!", "isDirectory", ")", "{", "ArrayList", "[", "]", "children", "=", "(", "ArrayList", "[", "]", ")", "rawPackageInfo", ".", "get", "(", "existing", ")", ";", "if", "(", "children", "[", "1", "]", "==", "EMPTY_LIST", ")", "children", "[", "1", "]", "=", "new", "ArrayList", "(", ")", ";", "children", "[", "1", "]", ".", "add", "(", "entryName", ")", ";", "}", "return", ";", "}", "}", "if", "(", "isDirectory", ")", "return", ";", "ArrayList", "[", "]", "children", "=", "(", "ArrayList", "[", "]", ")", "rawPackageInfo", ".", "get", "(", "pkgName", ")", ";", "if", "(", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "isClassFileName", "(", "entryName", ")", ")", "{", "if", "(", "children", "[", "0", "]", "==", "EMPTY_LIST", ")", "children", "[", "0", "]", "=", "new", "ArrayList", "(", ")", ";", "String", "nameWithoutExtension", "=", "entryName", ".", "substring", "(", "lastSeparator", "+", "1", ",", "entryName", ".", "length", "(", ")", "-", "6", ")", ";", "children", "[", "0", "]", ".", "add", "(", "nameWithoutExtension", ")", ";", "}", "else", "{", "if", "(", "children", "[", "1", "]", "==", "EMPTY_LIST", ")", "children", "[", "1", "]", "=", "new", "ArrayList", "(", ")", ";", "children", "[", "1", "]", ".", "add", "(", "entryName", ")", ";", "}", "}", "public", "boolean", "isArchive", "(", ")", "{", "return", "true", ";", "}", "public", "boolean", "isExternal", "(", ")", "{", "return", "resource", "(", ")", "==", "null", ";", "}", "public", "boolean", "isReadOnly", "(", ")", "{", "return", "true", ";", "}", "protected", "boolean", "resourceExists", "(", "IResource", "underlyingResource", ")", "{", "if", "(", "underlyingResource", "==", "null", ")", "{", "return", "JavaModel", ".", "getExternalTarget", "(", "getPath", "(", ")", ",", "true", ")", "!=", "null", ";", "}", "else", "{", "return", "super", ".", "resourceExists", "(", "underlyingResource", ")", ";", "}", "}", "protected", "void", "toStringAncestors", "(", "StringBuffer", "buffer", ")", "{", "if", "(", "isExternal", "(", ")", ")", "return", ";", "super", ".", "toStringAncestors", "(", "buffer", ")", ";", "}", "}", "</s>" ]
5,276
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "public", "class", "BecomeWorkingCopyOperation", "extends", "JavaModelOperation", "{", "IProblemRequestor", "problemRequestor", ";", "public", "BecomeWorkingCopyOperation", "(", "CompilationUnit", "workingCopy", ",", "IProblemRequestor", "problemRequestor", ")", "{", "super", "(", "new", "IJavaElement", "[", "]", "{", "workingCopy", "}", ")", ";", "this", ".", "problemRequestor", "=", "problemRequestor", ";", "}", "protected", "void", "executeOperation", "(", ")", "throws", "JavaModelException", "{", "CompilationUnit", "workingCopy", "=", "getWorkingCopy", "(", ")", ";", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "getPerWorkingCopyInfo", "(", "workingCopy", ",", "true", ",", "true", ",", "this", ".", "problemRequestor", ")", ";", "workingCopy", ".", "openWhenClosed", "(", "workingCopy", ".", "createElementInfo", "(", ")", ",", "this", ".", "progressMonitor", ")", ";", "if", "(", "!", "workingCopy", ".", "isPrimary", "(", ")", ")", "{", "JavaElementDelta", "delta", "=", "new", "JavaElementDelta", "(", "getJavaModel", "(", ")", ")", ";", "delta", ".", "added", "(", "workingCopy", ")", ";", "addDelta", "(", "delta", ")", ";", "}", "else", "{", "if", "(", "workingCopy", ".", "getResource", "(", ")", ".", "isAccessible", "(", ")", ")", "{", "JavaElementDelta", "delta", "=", "new", "JavaElementDelta", "(", "getJavaModel", "(", ")", ")", ";", "delta", ".", "changed", "(", "workingCopy", ",", "IJavaElementDelta", ".", "F_PRIMARY_WORKING_COPY", ")", ";", "addDelta", "(", "delta", ")", ";", "}", "else", "{", "JavaElementDelta", "delta", "=", "new", "JavaElementDelta", "(", "getJavaModel", "(", ")", ")", ";", "delta", ".", "added", "(", "workingCopy", ",", "IJavaElementDelta", ".", "F_PRIMARY_WORKING_COPY", ")", ";", "addDelta", "(", "delta", ")", ";", "}", "}", "this", ".", "resultElements", "=", "new", "IJavaElement", "[", "]", "{", "workingCopy", "}", ";", "}", "protected", "CompilationUnit", "getWorkingCopy", "(", ")", "{", "return", "(", "CompilationUnit", ")", "getElementToProcess", "(", ")", ";", "}", "public", "boolean", "isReadOnly", "(", ")", "{", "return", "true", ";", "}", "}", "</s>" ]
5,277
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "ResourcesPlugin", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IClasspathContainer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IClasspathEntry", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "SetContainerOperation", "extends", "ChangeClasspathOperation", "{", "IPath", "containerPath", ";", "IJavaProject", "[", "]", "affectedProjects", ";", "IClasspathContainer", "[", "]", "respectiveContainers", ";", "public", "SetContainerOperation", "(", "IPath", "containerPath", ",", "IJavaProject", "[", "]", "affectedProjects", ",", "IClasspathContainer", "[", "]", "respectiveContainers", ")", "{", "super", "(", "new", "IJavaElement", "[", "]", "{", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "getJavaModel", "(", ")", "}", ",", "!", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "isTreeLocked", "(", ")", ")", ";", "this", ".", "containerPath", "=", "containerPath", ";", "this", ".", "affectedProjects", "=", "affectedProjects", ";", "this", ".", "respectiveContainers", "=", "respectiveContainers", ";", "}", "protected", "void", "executeOperation", "(", ")", "throws", "JavaModelException", "{", "checkCanceled", "(", ")", ";", "try", "{", "beginTask", "(", "\"\"", ",", "1", ")", ";", "if", "(", "JavaModelManager", ".", "CP_RESOLVE_VERBOSE", ")", "verbose_set_container", "(", ")", ";", "if", "(", "JavaModelManager", ".", "CP_RESOLVE_VERBOSE_ADVANCED", ")", "verbose_set_container_invocation_trace", "(", ")", ";", "JavaModelManager", "manager", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ";", "if", "(", "manager", ".", "containerPutIfInitializingWithSameEntries", "(", "this", ".", "containerPath", ",", "this", ".", "affectedProjects", ",", "this", ".", "respectiveContainers", ")", ")", "return", ";", "final", "int", "projectLength", "=", "this", ".", "affectedProjects", ".", "length", ";", "final", "IJavaProject", "[", "]", "modifiedProjects", ";", "System", ".", "arraycopy", "(", "this", ".", "affectedProjects", ",", "0", ",", "modifiedProjects", "=", "new", "IJavaProject", "[", "projectLength", "]", ",", "0", ",", "projectLength", ")", ";", "int", "remaining", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "projectLength", ";", "i", "++", ")", "{", "if", "(", "isCanceled", "(", ")", ")", "return", ";", "JavaProject", "affectedProject", "=", "(", "JavaProject", ")", "this", ".", "affectedProjects", "[", "i", "]", ";", "IClasspathContainer", "newContainer", "=", "this", ".", "respectiveContainers", "[", "i", "]", ";", "if", "(", "newContainer", "==", "null", ")", "newContainer", "=", "JavaModelManager", ".", "CONTAINER_INITIALIZATION_IN_PROGRESS", ";", "boolean", "found", "=", "false", ";", "if", "(", "JavaProject", ".", "hasJavaNature", "(", "affectedProject", ".", "getProject", "(", ")", ")", ")", "{", "IClasspathEntry", "[", "]", "rawClasspath", "=", "affectedProject", ".", "getRawClasspath", "(", ")", ";", "for", "(", "int", "j", "=", "0", ",", "cpLength", "=", "rawClasspath", ".", "length", ";", "j", "<", "cpLength", ";", "j", "++", ")", "{", "IClasspathEntry", "entry", "=", "rawClasspath", "[", "j", "]", ";", "if", "(", "entry", ".", "getEntryKind", "(", ")", "==", "IClasspathEntry", ".", "CPE_CONTAINER", "&&", "entry", ".", "getPath", "(", ")", ".", "equals", "(", "this", ".", "containerPath", ")", ")", "{", "found", "=", "true", ";", "break", ";", "}", "}", "}", "if", "(", "!", "found", ")", "{", "modifiedProjects", "[", "i", "]", "=", "null", ";", "manager", ".", "containerPut", "(", "affectedProject", ",", "this", ".", "containerPath", ",", "newContainer", ")", ";", "continue", ";", "}", "IClasspathContainer", "oldContainer", "=", "manager", ".", "containerGet", "(", "affectedProject", ",", "this", ".", "containerPath", ")", ";", "if", "(", "oldContainer", "==", "JavaModelManager", ".", "CONTAINER_INITIALIZATION_IN_PROGRESS", ")", "{", "oldContainer", "=", "null", ";", "}", "if", "(", "(", "oldContainer", "!=", "null", "&&", "oldContainer", ".", "equals", "(", "this", ".", "respectiveContainers", "[", "i", "]", ")", ")", "||", "(", "oldContainer", "==", "this", ".", "respectiveContainers", "[", "i", "]", ")", ")", "{", "modifiedProjects", "[", "i", "]", "=", "null", ";", "continue", ";", "}", "remaining", "++", ";", "manager", ".", "containerPut", "(", "affectedProject", ",", "this", ".", "containerPath", ",", "newContainer", ")", ";", "}", "if", "(", "remaining", "==", "0", ")", "return", ";", "try", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "projectLength", ";", "i", "++", ")", "{", "if", "(", "isCanceled", "(", ")", ")", "return", ";", "JavaProject", "affectedProject", "=", "(", "JavaProject", ")", "modifiedProjects", "[", "i", "]", ";", "if", "(", "affectedProject", "==", "null", ")", "continue", ";", "if", "(", "JavaModelManager", ".", "CP_RESOLVE_VERBOSE_ADVANCED", ")", "verbose_update_project", "(", "affectedProject", ")", ";", "ClasspathChange", "classpathChange", "=", "affectedProject", ".", "getPerProjectInfo", "(", ")", ".", "resetResolvedClasspath", "(", ")", ";", "classpathChanged", "(", "classpathChange", ",", "i", "==", "0", ")", ";", "if", "(", "this", ".", "canChangeResources", ")", "{", "try", "{", "affectedProject", ".", "getProject", "(", ")", ".", "touch", "(", "this", ".", "progressMonitor", ")", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "if", "(", "!", "ExternalJavaProject", ".", "EXTERNAL_PROJECT_NAME", ".", "equals", "(", "affectedProject", ".", "getElementName", "(", ")", ")", ")", "throw", "e", ";", "}", "}", "}", "}", "catch", "(", "CoreException", "e", ")", "{", "if", "(", "JavaModelManager", ".", "CP_RESOLVE_VERBOSE", "||", "JavaModelManager", ".", "CP_RESOLVE_VERBOSE_FAILURE", ")", "verbose_failure", "(", "e", ")", ";", "if", "(", "e", "instanceof", "JavaModelException", ")", "{", "throw", "(", "JavaModelException", ")", "e", ";", "}", "else", "{", "throw", "new", "JavaModelException", "(", "e", ")", ";", "}", "}", "finally", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "projectLength", ";", "i", "++", ")", "{", "if", "(", "this", ".", "respectiveContainers", "[", "i", "]", "==", "null", ")", "{", "manager", ".", "containerPut", "(", "this", ".", "affectedProjects", "[", "i", "]", ",", "this", ".", "containerPath", ",", "null", ")", ";", "}", "}", "}", "}", "finally", "{", "done", "(", ")", ";", "}", "}", "private", "void", "verbose_failure", "(", "CoreException", "e", ")", "{", "Util", ".", "verbose", "(", "\"\"", "+", "\"\"", "+", "this", ".", "containerPath", ",", "System", ".", "err", ")", ";", "e", ".", "printStackTrace", "(", ")", ";", "}", "private", "void", "verbose_update_project", "(", "JavaProject", "affectedProject", ")", "{", "Util", ".", "verbose", "(", "\"\"", "+", "\"tproject:", "\"", "+", "affectedProject", ".", "getElementName", "(", ")", "+", "'\\n'", "+", "\"\"", "+", "this", ".", "containerPath", ")", ";", "}", "private", "void", "verbose_set_container", "(", ")", "{", "Util", ".", "verbose", "(", "\"\"", "+", "\"\"", "+", "this", ".", "containerPath", "+", "'\\n'", "+", "\"tprojects:", "{\"", "+", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "toString", "(", "this", ".", "affectedProjects", ",", "new", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "Displayable", "(", ")", "{", "public", "String", "displayString", "(", "Object", "o", ")", "{", "return", "(", "(", "IJavaProject", ")", "o", ")", ".", "getElementName", "(", ")", ";", "}", "}", ")", "+", "\"\"", "+", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "toString", "(", "this", ".", "respectiveContainers", ",", "new", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "Displayable", "(", ")", "{", "public", "String", "displayString", "(", "Object", "o", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", "\"tt\"", ")", ";", "if", "(", "o", "==", "null", ")", "{", "buffer", ".", "append", "(", "\"<null>\"", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "IClasspathContainer", "container", "=", "(", "IClasspathContainer", ")", "o", ";", "buffer", ".", "append", "(", "container", ".", "getDescription", "(", ")", ")", ";", "buffer", ".", "append", "(", "\"", "{n\"", ")", ";", "IClasspathEntry", "[", "]", "entries", "=", "container", ".", "getClasspathEntries", "(", ")", ";", "if", "(", "entries", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "entries", ".", "length", ";", "i", "++", ")", "{", "buffer", ".", "append", "(", "\"", "ttt\"", ")", ";", "buffer", ".", "append", "(", "entries", "[", "i", "]", ")", ";", "buffer", ".", "append", "(", "'\\n'", ")", ";", "}", "}", "buffer", ".", "append", "(", "\"", "tt}\"", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "}", ")", "+", "\"nt}\"", ")", ";", "}", "private", "void", "verbose_set_container_invocation_trace", "(", ")", "{", "Util", ".", "verbose", "(", "\"\"", "+", "\"\"", ")", ";", "new", "Exception", "(", "\"\"", ")", ".", "printStackTrace", "(", "System", ".", "out", ")", ";", "}", "}", "</s>" ]
5,278
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "public", "class", "InitializerWithChildrenInfo", "extends", "InitializerElementInfo", "{", "protected", "IJavaElement", "[", "]", "children", ";", "public", "InitializerWithChildrenInfo", "(", "IJavaElement", "[", "]", "children", ")", "{", "this", ".", "children", "=", "children", ";", "}", "public", "IJavaElement", "[", "]", "getChildren", "(", ")", "{", "return", "this", ".", "children", ";", "}", "}", "</s>" ]
5,279
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "LRUCache", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "JavaModelCache", "{", "public", "static", "boolean", "VERBOSE", "=", "false", ";", "public", "static", "final", "int", "DEFAULT_PROJECT_SIZE", "=", "5", ";", "public", "static", "final", "int", "DEFAULT_ROOT_SIZE", "=", "50", ";", "public", "static", "final", "int", "DEFAULT_PKG_SIZE", "=", "500", ";", "public", "static", "final", "int", "DEFAULT_OPENABLE_SIZE", "=", "250", ";", "public", "static", "final", "int", "DEFAULT_CHILDREN_SIZE", "=", "250", "*", "20", ";", "public", "static", "final", "String", "RATIO_PROPERTY", "=", "\"\"", ";", "public", "static", "final", "Object", "NON_EXISTING_JAR_TYPE_INFO", "=", "new", "Object", "(", ")", ";", "protected", "double", "memoryRatio", "=", "-", "1", ";", "protected", "Object", "modelInfo", ";", "protected", "HashMap", "projectCache", ";", "protected", "ElementCache", "rootCache", ";", "protected", "ElementCache", "pkgCache", ";", "protected", "ElementCache", "openableCache", ";", "protected", "Map", "childrenCache", ";", "protected", "LRUCache", "jarTypeCache", ";", "public", "JavaModelCache", "(", ")", "{", "double", "ratio", "=", "getMemoryRatio", "(", ")", ";", "double", "openableRatio", "=", "getOpenableRatio", "(", ")", ";", "this", ".", "projectCache", "=", "new", "HashMap", "(", "DEFAULT_PROJECT_SIZE", ")", ";", "if", "(", "VERBOSE", ")", "{", "this", ".", "rootCache", "=", "new", "VerboseElementCache", "(", "(", "int", ")", "(", "DEFAULT_ROOT_SIZE", "*", "ratio", ")", ",", "\"Root", "cache\"", ")", ";", "this", ".", "pkgCache", "=", "new", "VerboseElementCache", "(", "(", "int", ")", "(", "DEFAULT_PKG_SIZE", "*", "ratio", ")", ",", "\"\"", ")", ";", "this", ".", "openableCache", "=", "new", "VerboseElementCache", "(", "(", "int", ")", "(", "DEFAULT_OPENABLE_SIZE", "*", "ratio", "*", "openableRatio", ")", ",", "\"\"", ")", ";", "}", "else", "{", "this", ".", "rootCache", "=", "new", "ElementCache", "(", "(", "int", ")", "(", "DEFAULT_ROOT_SIZE", "*", "ratio", ")", ")", ";", "this", ".", "pkgCache", "=", "new", "ElementCache", "(", "(", "int", ")", "(", "DEFAULT_PKG_SIZE", "*", "ratio", ")", ")", ";", "this", ".", "openableCache", "=", "new", "ElementCache", "(", "(", "int", ")", "(", "DEFAULT_OPENABLE_SIZE", "*", "ratio", "*", "openableRatio", ")", ")", ";", "}", "this", ".", "childrenCache", "=", "new", "HashMap", "(", "(", "int", ")", "(", "DEFAULT_CHILDREN_SIZE", "*", "ratio", "*", "openableRatio", ")", ")", ";", "resetJarTypeCache", "(", ")", ";", "}", "private", "double", "getOpenableRatio", "(", ")", "{", "String", "property", "=", "System", ".", "getProperty", "(", "RATIO_PROPERTY", ")", ";", "if", "(", "property", "!=", "null", ")", "{", "try", "{", "return", "Double", ".", "parseDouble", "(", "property", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "Util", ".", "log", "(", "e", ",", "\"\"", "+", "RATIO_PROPERTY", "+", "\":", "\"", "+", "property", ")", ";", "}", "}", "return", "1.0", ";", "}", "public", "Object", "getInfo", "(", "IJavaElement", "element", ")", "{", "switch", "(", "element", ".", "getElementType", "(", ")", ")", "{", "case", "IJavaElement", ".", "JAVA_MODEL", ":", "return", "this", ".", "modelInfo", ";", "case", "IJavaElement", ".", "JAVA_PROJECT", ":", "return", "this", ".", "projectCache", ".", "get", "(", "element", ")", ";", "case", "IJavaElement", ".", "PACKAGE_FRAGMENT_ROOT", ":", "return", "this", ".", "rootCache", ".", "get", "(", "element", ")", ";", "case", "IJavaElement", ".", "PACKAGE_FRAGMENT", ":", "return", "this", ".", "pkgCache", ".", "get", "(", "element", ")", ";", "case", "IJavaElement", ".", "COMPILATION_UNIT", ":", "case", "IJavaElement", ".", "CLASS_FILE", ":", "return", "this", ".", "openableCache", ".", "get", "(", "element", ")", ";", "case", "IJavaElement", ".", "TYPE", ":", "Object", "result", "=", "this", ".", "jarTypeCache", ".", "get", "(", "element", ")", ";", "if", "(", "result", "!=", "null", ")", "return", "result", ";", "else", "return", "this", ".", "childrenCache", ".", "get", "(", "element", ")", ";", "default", ":", "return", "this", ".", "childrenCache", ".", "get", "(", "element", ")", ";", "}", "}", "public", "IJavaElement", "getExistingElement", "(", "IJavaElement", "element", ")", "{", "switch", "(", "element", ".", "getElementType", "(", ")", ")", "{", "case", "IJavaElement", ".", "JAVA_MODEL", ":", "return", "element", ";", "case", "IJavaElement", ".", "JAVA_PROJECT", ":", "return", "element", ";", "case", "IJavaElement", ".", "PACKAGE_FRAGMENT_ROOT", ":", "return", "(", "IJavaElement", ")", "this", ".", "rootCache", ".", "getKey", "(", "element", ")", ";", "case", "IJavaElement", ".", "PACKAGE_FRAGMENT", ":", "return", "(", "IJavaElement", ")", "this", ".", "pkgCache", ".", "getKey", "(", "element", ")", ";", "case", "IJavaElement", ".", "COMPILATION_UNIT", ":", "case", "IJavaElement", ".", "CLASS_FILE", ":", "return", "(", "IJavaElement", ")", "this", ".", "openableCache", ".", "getKey", "(", "element", ")", ";", "case", "IJavaElement", ".", "TYPE", ":", "return", "element", ";", "default", ":", "return", "element", ";", "}", "}", "protected", "double", "getMemoryRatio", "(", ")", "{", "if", "(", "(", "int", ")", "this", ".", "memoryRatio", "==", "-", "1", ")", "{", "long", "maxMemory", "=", "Runtime", ".", "getRuntime", "(", ")", ".", "maxMemory", "(", ")", ";", "this", ".", "memoryRatio", "=", "maxMemory", "==", "Long", ".", "MAX_VALUE", "?", "4d", ":", "(", "(", "double", ")", "maxMemory", ")", "/", "(", "64", "*", "0x100000", ")", ";", "}", "return", "this", ".", "memoryRatio", ";", "}", "protected", "Object", "peekAtInfo", "(", "IJavaElement", "element", ")", "{", "switch", "(", "element", ".", "getElementType", "(", ")", ")", "{", "case", "IJavaElement", ".", "JAVA_MODEL", ":", "return", "this", ".", "modelInfo", ";", "case", "IJavaElement", ".", "JAVA_PROJECT", ":", "return", "this", ".", "projectCache", ".", "get", "(", "element", ")", ";", "case", "IJavaElement", ".", "PACKAGE_FRAGMENT_ROOT", ":", "return", "this", ".", "rootCache", ".", "peek", "(", "element", ")", ";", "case", "IJavaElement", ".", "PACKAGE_FRAGMENT", ":", "return", "this", ".", "pkgCache", ".", "peek", "(", "element", ")", ";", "case", "IJavaElement", ".", "COMPILATION_UNIT", ":", "case", "IJavaElement", ".", "CLASS_FILE", ":", "return", "this", ".", "openableCache", ".", "peek", "(", "element", ")", ";", "case", "IJavaElement", ".", "TYPE", ":", "Object", "result", "=", "this", ".", "jarTypeCache", ".", "peek", "(", "element", ")", ";", "if", "(", "result", "!=", "null", ")", "return", "result", ";", "else", "return", "this", ".", "childrenCache", ".", "get", "(", "element", ")", ";", "default", ":", "return", "this", ".", "childrenCache", ".", "get", "(", "element", ")", ";", "}", "}", "protected", "void", "putInfo", "(", "IJavaElement", "element", ",", "Object", "info", ")", "{", "switch", "(", "element", ".", "getElementType", "(", ")", ")", "{", "case", "IJavaElement", ".", "JAVA_MODEL", ":", "this", ".", "modelInfo", "=", "info", ";", "break", ";", "case", "IJavaElement", ".", "JAVA_PROJECT", ":", "this", ".", "projectCache", ".", "put", "(", "element", ",", "info", ")", ";", "this", ".", "rootCache", ".", "ensureSpaceLimit", "(", "info", ",", "element", ")", ";", "break", ";", "case", "IJavaElement", ".", "PACKAGE_FRAGMENT_ROOT", ":", "this", ".", "rootCache", ".", "put", "(", "element", ",", "info", ")", ";", "this", ".", "pkgCache", ".", "ensureSpaceLimit", "(", "info", ",", "element", ")", ";", "break", ";", "case", "IJavaElement", ".", "PACKAGE_FRAGMENT", ":", "this", ".", "pkgCache", ".", "put", "(", "element", ",", "info", ")", ";", "this", ".", "openableCache", ".", "ensureSpaceLimit", "(", "info", ",", "element", ")", ";", "break", ";", "case", "IJavaElement", ".", "COMPILATION_UNIT", ":", "case", "IJavaElement", ".", "CLASS_FILE", ":", "this", ".", "openableCache", ".", "put", "(", "element", ",", "info", ")", ";", "break", ";", "default", ":", "this", ".", "childrenCache", ".", "put", "(", "element", ",", "info", ")", ";", "}", "}", "protected", "void", "removeInfo", "(", "JavaElement", "element", ")", "{", "switch", "(", "element", ".", "getElementType", "(", ")", ")", "{", "case", "IJavaElement", ".", "JAVA_MODEL", ":", "this", ".", "modelInfo", "=", "null", ";", "break", ";", "case", "IJavaElement", ".", "JAVA_PROJECT", ":", "this", ".", "projectCache", ".", "remove", "(", "element", ")", ";", "this", ".", "rootCache", ".", "resetSpaceLimit", "(", "(", "int", ")", "(", "DEFAULT_ROOT_SIZE", "*", "getMemoryRatio", "(", ")", ")", ",", "element", ")", ";", "break", ";", "case", "IJavaElement", ".", "PACKAGE_FRAGMENT_ROOT", ":", "this", ".", "rootCache", ".", "remove", "(", "element", ")", ";", "this", ".", "pkgCache", ".", "resetSpaceLimit", "(", "(", "int", ")", "(", "DEFAULT_PKG_SIZE", "*", "getMemoryRatio", "(", ")", ")", ",", "element", ")", ";", "break", ";", "case", "IJavaElement", ".", "PACKAGE_FRAGMENT", ":", "this", ".", "pkgCache", ".", "remove", "(", "element", ")", ";", "this", ".", "openableCache", ".", "resetSpaceLimit", "(", "(", "int", ")", "(", "DEFAULT_OPENABLE_SIZE", "*", "getMemoryRatio", "(", ")", "*", "getOpenableRatio", "(", ")", ")", ",", "element", ")", ";", "break", ";", "case", "IJavaElement", ".", "COMPILATION_UNIT", ":", "case", "IJavaElement", ".", "CLASS_FILE", ":", "this", ".", "openableCache", ".", "remove", "(", "element", ")", ";", "break", ";", "default", ":", "this", ".", "childrenCache", ".", "remove", "(", "element", ")", ";", "}", "}", "protected", "void", "resetJarTypeCache", "(", ")", "{", "this", ".", "jarTypeCache", "=", "new", "LRUCache", "(", "(", "int", ")", "(", "DEFAULT_OPENABLE_SIZE", "*", "getMemoryRatio", "(", ")", ")", ")", ";", "}", "public", "String", "toString", "(", ")", "{", "return", "toStringFillingRation", "(", "\"\"", ")", ";", "}", "public", "String", "toStringFillingRation", "(", "String", "prefix", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "buffer", ".", "append", "(", "prefix", ")", ";", "buffer", ".", "append", "(", "\"\"", ")", ";", "buffer", ".", "append", "(", "this", ".", "projectCache", ".", "size", "(", ")", ")", ";", "buffer", ".", "append", "(", "\"", "projectsn\"", ")", ";", "buffer", ".", "append", "(", "prefix", ")", ";", "buffer", ".", "append", "(", "this", ".", "rootCache", ".", "toStringFillingRation", "(", "\"Root", "cache\"", ")", ")", ";", "buffer", ".", "append", "(", "'\\n'", ")", ";", "buffer", ".", "append", "(", "prefix", ")", ";", "buffer", ".", "append", "(", "this", ".", "pkgCache", ".", "toStringFillingRation", "(", "\"\"", ")", ")", ";", "buffer", ".", "append", "(", "'\\n'", ")", ";", "buffer", ".", "append", "(", "prefix", ")", ";", "buffer", ".", "append", "(", "this", ".", "openableCache", ".", "toStringFillingRation", "(", "\"\"", ")", ")", ";", "buffer", ".", "append", "(", "'\\n'", ")", ";", "buffer", ".", "append", "(", "prefix", ")", ";", "buffer", ".", "append", "(", "this", ".", "jarTypeCache", ".", "toStringFillingRation", "(", "\"\"", ")", ")", ";", "buffer", ".", "append", "(", "'\\n'", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "}", "</s>" ]
5,280
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "abstract", "class", "MemberElementInfo", "extends", "SourceRefElementInfo", "{", "protected", "int", "flags", ";", "public", "int", "getNameSourceEnd", "(", ")", "{", "return", "-", "1", ";", "}", "public", "int", "getNameSourceStart", "(", ")", "{", "return", "-", "1", ";", "}", "public", "int", "getModifiers", "(", ")", "{", "return", "this", ".", "flags", ";", "}", "protected", "void", "setFlags", "(", "int", "flags", ")", "{", "this", ".", "flags", "=", "flags", ";", "}", "}", "</s>" ]
5,281
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IWorkspace", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "jobs", ".", "ISchedulingRule", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaModelStatus", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaModelStatusConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "AST", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "ASTNode", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "ASTParser", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "ChildListPropertyDescriptor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "CompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "StructuralPropertyDescriptor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "rewrite", ".", "ASTRewrite", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "rewrite", ".", "ListRewrite", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "import", "org", ".", "eclipse", ".", "text", ".", "edits", ".", "TextEdit", ";", "public", "abstract", "class", "CreateElementInCUOperation", "extends", "JavaModelOperation", "{", "protected", "CompilationUnit", "cuAST", ";", "protected", "static", "final", "int", "INSERT_LAST", "=", "1", ";", "protected", "static", "final", "int", "INSERT_AFTER", "=", "2", ";", "protected", "static", "final", "int", "INSERT_BEFORE", "=", "3", ";", "protected", "int", "insertionPolicy", "=", "INSERT_LAST", ";", "protected", "IJavaElement", "anchorElement", "=", "null", ";", "protected", "boolean", "creationOccurred", "=", "true", ";", "public", "CreateElementInCUOperation", "(", "IJavaElement", "parentElement", ")", "{", "super", "(", "null", ",", "new", "IJavaElement", "[", "]", "{", "parentElement", "}", ")", ";", "initializeDefaultPosition", "(", ")", ";", "}", "protected", "void", "checkCanceled", "(", ")", "{", "if", "(", "!", "this", ".", "isNested", ")", "{", "super", ".", "checkCanceled", "(", ")", ";", "}", "}", "public", "void", "createAfter", "(", "IJavaElement", "sibling", ")", "{", "setRelativePosition", "(", "sibling", ",", "INSERT_AFTER", ")", ";", "}", "public", "void", "createBefore", "(", "IJavaElement", "sibling", ")", "{", "setRelativePosition", "(", "sibling", ",", "INSERT_BEFORE", ")", ";", "}", "protected", "void", "executeOperation", "(", ")", "throws", "JavaModelException", "{", "try", "{", "beginTask", "(", "getMainTaskName", "(", ")", ",", "getMainAmountOfWork", "(", ")", ")", ";", "JavaElementDelta", "delta", "=", "newJavaElementDelta", "(", ")", ";", "ICompilationUnit", "unit", "=", "getCompilationUnit", "(", ")", ";", "generateNewCompilationUnitAST", "(", "unit", ")", ";", "if", "(", "this", ".", "creationOccurred", ")", "{", "unit", ".", "save", "(", "null", ",", "false", ")", ";", "boolean", "isWorkingCopy", "=", "unit", ".", "isWorkingCopy", "(", ")", ";", "if", "(", "!", "isWorkingCopy", ")", "setAttribute", "(", "HAS_MODIFIED_RESOURCE_ATTR", ",", "TRUE", ")", ";", "worked", "(", "1", ")", ";", "this", ".", "resultElements", "=", "generateResultHandles", "(", ")", ";", "if", "(", "!", "isWorkingCopy", "&&", "!", "Util", ".", "isExcluded", "(", "unit", ")", "&&", "unit", ".", "getParent", "(", ")", ".", "exists", "(", ")", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "resultElements", ".", "length", ";", "i", "++", ")", "{", "delta", ".", "added", "(", "this", ".", "resultElements", "[", "i", "]", ")", ";", "}", "addDelta", "(", "delta", ")", ";", "}", "}", "}", "finally", "{", "done", "(", ")", ";", "}", "}", "protected", "abstract", "StructuralPropertyDescriptor", "getChildPropertyDescriptor", "(", "ASTNode", "parent", ")", ";", "protected", "abstract", "ASTNode", "generateElementAST", "(", "ASTRewrite", "rewriter", ",", "ICompilationUnit", "cu", ")", "throws", "JavaModelException", ";", "protected", "void", "generateNewCompilationUnitAST", "(", "ICompilationUnit", "cu", ")", "throws", "JavaModelException", "{", "this", ".", "cuAST", "=", "parse", "(", "cu", ")", ";", "AST", "ast", "=", "this", ".", "cuAST", ".", "getAST", "(", ")", ";", "ASTRewrite", "rewriter", "=", "ASTRewrite", ".", "create", "(", "ast", ")", ";", "ASTNode", "child", "=", "generateElementAST", "(", "rewriter", ",", "cu", ")", ";", "if", "(", "child", "!=", "null", ")", "{", "ASTNode", "parent", "=", "(", "(", "JavaElement", ")", "getParentElement", "(", ")", ")", ".", "findNode", "(", "this", ".", "cuAST", ")", ";", "if", "(", "parent", "==", "null", ")", "parent", "=", "this", ".", "cuAST", ";", "insertASTNode", "(", "rewriter", ",", "parent", ",", "child", ")", ";", "TextEdit", "edits", "=", "rewriter", ".", "rewriteAST", "(", ")", ";", "applyTextEdit", "(", "cu", ",", "edits", ")", ";", "}", "worked", "(", "1", ")", ";", "}", "protected", "abstract", "IJavaElement", "generateResultHandle", "(", ")", ";", "protected", "IJavaElement", "[", "]", "generateResultHandles", "(", ")", "{", "return", "new", "IJavaElement", "[", "]", "{", "generateResultHandle", "(", ")", "}", ";", "}", "protected", "ICompilationUnit", "getCompilationUnit", "(", ")", "{", "return", "getCompilationUnitFor", "(", "getParentElement", "(", ")", ")", ";", "}", "protected", "int", "getMainAmountOfWork", "(", ")", "{", "return", "2", ";", "}", "public", "abstract", "String", "getMainTaskName", "(", ")", ";", "protected", "ISchedulingRule", "getSchedulingRule", "(", ")", "{", "IResource", "resource", "=", "getCompilationUnit", "(", ")", ".", "getResource", "(", ")", ";", "IWorkspace", "workspace", "=", "resource", ".", "getWorkspace", "(", ")", ";", "return", "workspace", ".", "getRuleFactory", "(", ")", ".", "modifyRule", "(", "resource", ")", ";", "}", "protected", "void", "initializeDefaultPosition", "(", ")", "{", "}", "protected", "void", "insertASTNode", "(", "ASTRewrite", "rewriter", ",", "ASTNode", "parent", ",", "ASTNode", "child", ")", "throws", "JavaModelException", "{", "StructuralPropertyDescriptor", "propertyDescriptor", "=", "getChildPropertyDescriptor", "(", "parent", ")", ";", "if", "(", "propertyDescriptor", "instanceof", "ChildListPropertyDescriptor", ")", "{", "ChildListPropertyDescriptor", "childListPropertyDescriptor", "=", "(", "ChildListPropertyDescriptor", ")", "propertyDescriptor", ";", "ListRewrite", "rewrite", "=", "rewriter", ".", "getListRewrite", "(", "parent", ",", "childListPropertyDescriptor", ")", ";", "switch", "(", "this", ".", "insertionPolicy", ")", "{", "case", "INSERT_BEFORE", ":", "ASTNode", "element", "=", "(", "(", "JavaElement", ")", "this", ".", "anchorElement", ")", ".", "findNode", "(", "this", ".", "cuAST", ")", ";", "if", "(", "childListPropertyDescriptor", ".", "getElementType", "(", ")", ".", "isAssignableFrom", "(", "element", ".", "getClass", "(", ")", ")", ")", "rewrite", ".", "insertBefore", "(", "child", ",", "element", ",", "null", ")", ";", "else", "rewrite", ".", "insertLast", "(", "child", ",", "null", ")", ";", "break", ";", "case", "INSERT_AFTER", ":", "element", "=", "(", "(", "JavaElement", ")", "this", ".", "anchorElement", ")", ".", "findNode", "(", "this", ".", "cuAST", ")", ";", "if", "(", "childListPropertyDescriptor", ".", "getElementType", "(", ")", ".", "isAssignableFrom", "(", "element", ".", "getClass", "(", ")", ")", ")", "rewrite", ".", "insertAfter", "(", "child", ",", "element", ",", "null", ")", ";", "else", "rewrite", ".", "insertLast", "(", "child", ",", "null", ")", ";", "break", ";", "case", "INSERT_LAST", ":", "rewrite", ".", "insertLast", "(", "child", ",", "null", ")", ";", "break", ";", "}", "}", "else", "{", "rewriter", ".", "set", "(", "parent", ",", "propertyDescriptor", ",", "child", ",", "null", ")", ";", "}", "}", "protected", "CompilationUnit", "parse", "(", "ICompilationUnit", "cu", ")", "throws", "JavaModelException", "{", "cu", ".", "makeConsistent", "(", "this", ".", "progressMonitor", ")", ";", "ASTParser", "parser", "=", "ASTParser", ".", "newParser", "(", "AST", ".", "JLS3", ")", ";", "parser", ".", "setSource", "(", "cu", ")", ";", "return", "(", "CompilationUnit", ")", "parser", ".", "createAST", "(", "this", ".", "progressMonitor", ")", ";", "}", "protected", "void", "setAlteredName", "(", "String", "newName", ")", "{", "}", "protected", "void", "setRelativePosition", "(", "IJavaElement", "sibling", ",", "int", "policy", ")", "throws", "IllegalArgumentException", "{", "if", "(", "sibling", "==", "null", ")", "{", "this", ".", "anchorElement", "=", "null", ";", "this", ".", "insertionPolicy", "=", "INSERT_LAST", ";", "}", "else", "{", "this", ".", "anchorElement", "=", "sibling", ";", "this", ".", "insertionPolicy", "=", "policy", ";", "}", "}", "public", "IJavaModelStatus", "verify", "(", ")", "{", "if", "(", "getParentElement", "(", ")", "==", "null", ")", "{", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "NO_ELEMENTS_TO_PROCESS", ")", ";", "}", "if", "(", "this", ".", "anchorElement", "!=", "null", ")", "{", "IJavaElement", "domPresentParent", "=", "this", ".", "anchorElement", ".", "getParent", "(", ")", ";", "if", "(", "domPresentParent", ".", "getElementType", "(", ")", "==", "IJavaElement", ".", "IMPORT_CONTAINER", ")", "{", "domPresentParent", "=", "domPresentParent", ".", "getParent", "(", ")", ";", "}", "if", "(", "!", "domPresentParent", ".", "equals", "(", "getParentElement", "(", ")", ")", ")", "{", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INVALID_SIBLING", ",", "this", ".", "anchorElement", ")", ";", "}", "}", "return", "JavaModelStatus", ".", "VERIFIED_OK", ";", "}", "}", "</s>" ]
5,282
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "public", "class", "TypeParameterElementInfo", "extends", "SourceRefElementInfo", "{", "public", "int", "nameStart", "=", "-", "1", ";", "public", "int", "nameEnd", "=", "-", "1", ";", "public", "char", "[", "]", "[", "]", "bounds", ";", "public", "char", "[", "]", "[", "]", "boundsSignatures", ";", "}", "</s>" ]
5,283
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IContainer", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "HashSetOfArray", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "HashtableOfArrayToObject", ";", "class", "JavaProjectElementInfo", "extends", "OpenableElementInfo", "{", "static", "final", "IPackageFragmentRoot", "[", "]", "NO_ROOTS", "=", "new", "IPackageFragmentRoot", "[", "0", "]", ";", "static", "class", "ProjectCache", "{", "ProjectCache", "(", "IPackageFragmentRoot", "[", "]", "allPkgFragmentRootsCache", ",", "Map", "rootToResolvedEntries", ",", "Map", "pkgFragmentsCaches", ")", "{", "this", ".", "allPkgFragmentRootsCache", "=", "allPkgFragmentRootsCache", ";", "this", ".", "rootToResolvedEntries", "=", "rootToResolvedEntries", ";", "this", ".", "pkgFragmentsCaches", "=", "pkgFragmentsCaches", ";", "}", "public", "IPackageFragmentRoot", "[", "]", "allPkgFragmentRootsCache", ";", "public", "HashtableOfArrayToObject", "allPkgFragmentsCache", ";", "public", "Map", "pkgFragmentsCaches", ";", "public", "Map", "rootToResolvedEntries", ";", "}", "private", "Object", "[", "]", "nonJavaResources", ";", "ProjectCache", "projectCache", ";", "static", "void", "addSuperPackageNames", "(", "String", "[", "]", "pkgName", ",", "HashtableOfArrayToObject", "packageFragments", ")", "{", "for", "(", "int", "i", "=", "pkgName", ".", "length", "-", "1", ";", "i", ">", "0", ";", "i", "--", ")", "{", "if", "(", "packageFragments", ".", "getKey", "(", "pkgName", ",", "i", ")", "==", "null", ")", "{", "System", ".", "arraycopy", "(", "pkgName", ",", "0", ",", "pkgName", "=", "new", "String", "[", "i", "]", ",", "0", ",", "i", ")", ";", "packageFragments", ".", "put", "(", "pkgName", ",", "NO_ROOTS", ")", ";", "}", "}", "}", "public", "JavaProjectElementInfo", "(", ")", "{", "this", ".", "nonJavaResources", "=", "null", ";", "}", "private", "Object", "[", "]", "computeNonJavaResources", "(", "JavaProject", "project", ")", "{", "IPath", "projectPath", "=", "project", ".", "getProject", "(", ")", ".", "getFullPath", "(", ")", ";", "boolean", "srcIsProject", "=", "false", ";", "boolean", "binIsProject", "=", "false", ";", "char", "[", "]", "[", "]", "inclusionPatterns", "=", "null", ";", "char", "[", "]", "[", "]", "exclusionPatterns", "=", "null", ";", "IPath", "projectOutput", "=", "null", ";", "boolean", "isClasspathResolved", "=", "true", ";", "try", "{", "IClasspathEntry", "entry", "=", "project", ".", "getClasspathEntryFor", "(", "projectPath", ")", ";", "if", "(", "entry", "!=", "null", ")", "{", "srcIsProject", "=", "true", ";", "inclusionPatterns", "=", "(", "(", "ClasspathEntry", ")", "entry", ")", ".", "fullInclusionPatternChars", "(", ")", ";", "exclusionPatterns", "=", "(", "(", "ClasspathEntry", ")", "entry", ")", ".", "fullExclusionPatternChars", "(", ")", ";", "}", "projectOutput", "=", "project", ".", "getOutputLocation", "(", ")", ";", "binIsProject", "=", "projectPath", ".", "equals", "(", "projectOutput", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "isClasspathResolved", "=", "false", ";", "}", "Object", "[", "]", "resources", "=", "new", "IResource", "[", "5", "]", ";", "int", "resourcesCounter", "=", "0", ";", "try", "{", "IResource", "[", "]", "members", "=", "(", "(", "IContainer", ")", "project", ".", "getResource", "(", ")", ")", ".", "members", "(", ")", ";", "int", "length", "=", "members", ".", "length", ";", "if", "(", "length", ">", "0", ")", "{", "String", "sourceLevel", "=", "project", ".", "getOption", "(", "JavaCore", ".", "COMPILER_SOURCE", ",", "true", ")", ";", "String", "complianceLevel", "=", "project", ".", "getOption", "(", "JavaCore", ".", "COMPILER_COMPLIANCE", ",", "true", ")", ";", "IClasspathEntry", "[", "]", "classpath", "=", "project", ".", "getResolvedClasspath", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IResource", "res", "=", "members", "[", "i", "]", ";", "switch", "(", "res", ".", "getType", "(", ")", ")", "{", "case", "IResource", ".", "FILE", ":", "IPath", "resFullPath", "=", "res", ".", "getFullPath", "(", ")", ";", "String", "resName", "=", "res", ".", "getName", "(", ")", ";", "if", "(", "isClasspathResolved", "&&", "isClasspathEntryOrOutputLocation", "(", "resFullPath", ",", "res", ".", "getLocation", "(", ")", ",", "classpath", ",", "projectOutput", ")", ")", "{", "break", ";", "}", "if", "(", "srcIsProject", "&&", "Util", ".", "isValidCompilationUnitName", "(", "resName", ",", "sourceLevel", ",", "complianceLevel", ")", "&&", "!", "Util", ".", "isExcluded", "(", "res", ",", "inclusionPatterns", ",", "exclusionPatterns", ")", ")", "{", "break", ";", "}", "if", "(", "binIsProject", "&&", "Util", ".", "isValidClassFileName", "(", "resName", ",", "sourceLevel", ",", "complianceLevel", ")", ")", "{", "break", ";", "}", "if", "(", "resources", ".", "length", "==", "resourcesCounter", ")", "{", "System", ".", "arraycopy", "(", "resources", ",", "0", ",", "(", "resources", "=", "new", "IResource", "[", "resourcesCounter", "*", "2", "]", ")", ",", "0", ",", "resourcesCounter", ")", ";", "}", "resources", "[", "resourcesCounter", "++", "]", "=", "res", ";", "break", ";", "case", "IResource", ".", "FOLDER", ":", "resFullPath", "=", "res", ".", "getFullPath", "(", ")", ";", "if", "(", "(", "srcIsProject", "&&", "!", "Util", ".", "isExcluded", "(", "res", ",", "inclusionPatterns", ",", "exclusionPatterns", ")", "&&", "Util", ".", "isValidFolderNameForPackage", "(", "res", ".", "getName", "(", ")", ",", "sourceLevel", ",", "complianceLevel", ")", ")", "||", "(", "isClasspathResolved", "&&", "isClasspathEntryOrOutputLocation", "(", "resFullPath", ",", "res", ".", "getLocation", "(", ")", ",", "classpath", ",", "projectOutput", ")", ")", ")", "{", "break", ";", "}", "if", "(", "resources", ".", "length", "==", "resourcesCounter", ")", "{", "System", ".", "arraycopy", "(", "resources", ",", "0", ",", "(", "resources", "=", "new", "IResource", "[", "resourcesCounter", "*", "2", "]", ")", ",", "0", ",", "resourcesCounter", ")", ";", "}", "resources", "[", "resourcesCounter", "++", "]", "=", "res", ";", "}", "}", "}", "if", "(", "resources", ".", "length", "!=", "resourcesCounter", ")", "{", "System", ".", "arraycopy", "(", "resources", ",", "0", ",", "(", "resources", "=", "new", "IResource", "[", "resourcesCounter", "]", ")", ",", "0", ",", "resourcesCounter", ")", ";", "}", "}", "catch", "(", "CoreException", "e", ")", "{", "resources", "=", "NO_NON_JAVA_RESOURCES", ";", "resourcesCounter", "=", "0", ";", "}", "return", "resources", ";", "}", "ProjectCache", "getProjectCache", "(", "JavaProject", "project", ")", "{", "ProjectCache", "cache", "=", "this", ".", "projectCache", ";", "if", "(", "cache", "==", "null", ")", "{", "IPackageFragmentRoot", "[", "]", "roots", ";", "Map", "reverseMap", "=", "new", "HashMap", "(", "3", ")", ";", "try", "{", "roots", "=", "project", ".", "getAllPackageFragmentRoots", "(", "reverseMap", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "roots", "=", "new", "IPackageFragmentRoot", "[", "0", "]", ";", "reverseMap", ".", "clear", "(", ")", ";", "}", "HashMap", "rootInfos", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "deltaState", ".", "roots", ";", "HashMap", "pkgFragmentsCaches", "=", "new", "HashMap", "(", ")", ";", "int", "length", "=", "roots", ".", "length", ";", "JavaModelManager", "manager", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IPackageFragmentRoot", "root", "=", "roots", "[", "i", "]", ";", "DeltaProcessor", ".", "RootInfo", "rootInfo", "=", "(", "DeltaProcessor", ".", "RootInfo", ")", "rootInfos", ".", "get", "(", "root", ".", "getPath", "(", ")", ")", ";", "if", "(", "rootInfo", "==", "null", "||", "rootInfo", ".", "project", ".", "equals", "(", "project", ")", ")", "{", "roots", "[", "i", "]", "=", "root", "=", "(", "IPackageFragmentRoot", ")", "manager", ".", "getExistingElement", "(", "root", ")", ";", "HashSetOfArray", "fragmentsCache", "=", "new", "HashSetOfArray", "(", ")", ";", "initializePackageNames", "(", "root", ",", "fragmentsCache", ")", ";", "pkgFragmentsCaches", ".", "put", "(", "root", ",", "fragmentsCache", ")", ";", "}", "}", "cache", "=", "new", "ProjectCache", "(", "roots", ",", "reverseMap", ",", "pkgFragmentsCaches", ")", ";", "this", ".", "projectCache", "=", "cache", ";", "}", "return", "cache", ";", "}", "Object", "[", "]", "getNonJavaResources", "(", "JavaProject", "project", ")", "{", "if", "(", "this", ".", "nonJavaResources", "==", "null", ")", "{", "this", ".", "nonJavaResources", "=", "computeNonJavaResources", "(", "project", ")", ";", "}", "return", "this", ".", "nonJavaResources", ";", "}", "private", "void", "initializePackageNames", "(", "IPackageFragmentRoot", "root", ",", "HashSetOfArray", "fragmentsCache", ")", "{", "IJavaElement", "[", "]", "frags", "=", "null", ";", "try", "{", "if", "(", "!", "root", ".", "isOpen", "(", ")", ")", "{", "PackageFragmentRootInfo", "info", "=", "root", ".", "isArchive", "(", ")", "?", "new", "JarPackageFragmentRootInfo", "(", ")", ":", "new", "PackageFragmentRootInfo", "(", ")", ";", "(", "(", "PackageFragmentRoot", ")", "root", ")", ".", "computeChildren", "(", "info", ",", "(", "(", "JavaElement", ")", "root", ")", ".", "resource", "(", ")", ")", ";", "frags", "=", "info", ".", "children", ";", "}", "else", "frags", "=", "root", ".", "getChildren", "(", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "return", ";", "}", "for", "(", "int", "j", "=", "0", ",", "length", "=", "frags", ".", "length", ";", "j", "<", "length", ";", "j", "++", ")", "{", "fragmentsCache", ".", "add", "(", "(", "(", "PackageFragment", ")", "frags", "[", "j", "]", ")", ".", "names", ")", ";", "}", "}", "private", "boolean", "isClasspathEntryOrOutputLocation", "(", "IPath", "path", ",", "IPath", "location", ",", "IClasspathEntry", "[", "]", "resolvedClasspath", ",", "IPath", "projectOutput", ")", "{", "if", "(", "projectOutput", ".", "equals", "(", "path", ")", ")", "return", "true", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "resolvedClasspath", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IClasspathEntry", "entry", "=", "resolvedClasspath", "[", "i", "]", ";", "IPath", "entryPath", ";", "if", "(", "(", "entryPath", "=", "entry", ".", "getPath", "(", ")", ")", ".", "equals", "(", "path", ")", "||", "entryPath", ".", "equals", "(", "location", ")", ")", "{", "return", "true", ";", "}", "IPath", "output", ";", "if", "(", "(", "output", "=", "entry", ".", "getOutputLocation", "(", ")", ")", "!=", "null", "&&", "output", ".", "equals", "(", "path", ")", ")", "{", "return", "true", ";", "}", "}", "return", "false", ";", "}", "NameLookup", "newNameLookup", "(", "JavaProject", "project", ",", "ICompilationUnit", "[", "]", "workingCopies", ")", "{", "ProjectCache", "cache", "=", "getProjectCache", "(", "project", ")", ";", "HashtableOfArrayToObject", "allPkgFragmentsCache", "=", "cache", ".", "allPkgFragmentsCache", ";", "if", "(", "allPkgFragmentsCache", "==", "null", ")", "{", "HashMap", "rootInfos", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "deltaState", ".", "roots", ";", "IPackageFragmentRoot", "[", "]", "allRoots", "=", "cache", ".", "allPkgFragmentRootsCache", ";", "int", "length", "=", "allRoots", ".", "length", ";", "allPkgFragmentsCache", "=", "new", "HashtableOfArrayToObject", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IPackageFragmentRoot", "root", "=", "allRoots", "[", "i", "]", ";", "DeltaProcessor", ".", "RootInfo", "rootInfo", "=", "(", "DeltaProcessor", ".", "RootInfo", ")", "rootInfos", ".", "get", "(", "root", ".", "getPath", "(", ")", ")", ";", "JavaProject", "rootProject", "=", "rootInfo", "==", "null", "?", "project", ":", "rootInfo", ".", "project", ";", "HashSetOfArray", "fragmentsCache", ";", "if", "(", "rootProject", ".", "equals", "(", "project", ")", ")", "{", "fragmentsCache", "=", "(", "HashSetOfArray", ")", "cache", ".", "pkgFragmentsCaches", ".", "get", "(", "root", ")", ";", "}", "else", "{", "ProjectCache", "rootProjectCache", ";", "try", "{", "rootProjectCache", "=", "rootProject", ".", "getProjectCache", "(", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "continue", ";", "}", "fragmentsCache", "=", "(", "HashSetOfArray", ")", "rootProjectCache", ".", "pkgFragmentsCaches", ".", "get", "(", "root", ")", ";", "}", "if", "(", "fragmentsCache", "==", "null", ")", "{", "fragmentsCache", "=", "new", "HashSetOfArray", "(", ")", ";", "initializePackageNames", "(", "root", ",", "fragmentsCache", ")", ";", "}", "Object", "[", "]", "[", "]", "set", "=", "fragmentsCache", ".", "set", ";", "for", "(", "int", "j", "=", "0", ",", "length2", "=", "set", ".", "length", ";", "j", "<", "length2", ";", "j", "++", ")", "{", "String", "[", "]", "pkgName", "=", "(", "String", "[", "]", ")", "set", "[", "j", "]", ";", "if", "(", "pkgName", "==", "null", ")", "continue", ";", "Object", "existing", "=", "allPkgFragmentsCache", ".", "get", "(", "pkgName", ")", ";", "if", "(", "existing", "==", "null", "||", "existing", "==", "NO_ROOTS", ")", "{", "allPkgFragmentsCache", ".", "put", "(", "pkgName", ",", "root", ")", ";", "addSuperPackageNames", "(", "pkgName", ",", "allPkgFragmentsCache", ")", ";", "}", "else", "{", "if", "(", "existing", "instanceof", "PackageFragmentRoot", ")", "{", "allPkgFragmentsCache", ".", "put", "(", "pkgName", ",", "new", "IPackageFragmentRoot", "[", "]", "{", "(", "PackageFragmentRoot", ")", "existing", ",", "root", "}", ")", ";", "}", "else", "{", "IPackageFragmentRoot", "[", "]", "roots", "=", "(", "IPackageFragmentRoot", "[", "]", ")", "existing", ";", "int", "rootLength", "=", "roots", ".", "length", ";", "System", ".", "arraycopy", "(", "roots", ",", "0", ",", "roots", "=", "new", "IPackageFragmentRoot", "[", "rootLength", "+", "1", "]", ",", "0", ",", "rootLength", ")", ";", "roots", "[", "rootLength", "]", "=", "root", ";", "allPkgFragmentsCache", ".", "put", "(", "pkgName", ",", "roots", ")", ";", "}", "}", "}", "}", "cache", ".", "allPkgFragmentsCache", "=", "allPkgFragmentsCache", ";", "}", "return", "new", "NameLookup", "(", "cache", ".", "allPkgFragmentRootsCache", ",", "cache", ".", "allPkgFragmentsCache", ",", "workingCopies", ",", "cache", ".", "rootToResolvedEntries", ")", ";", "}", "void", "resetCaches", "(", ")", "{", "this", ".", "projectCache", "=", "null", ";", "}", "void", "setNonJavaResources", "(", "Object", "[", "]", "resources", ")", "{", "this", ".", "nonJavaResources", "=", "resources", ";", "}", "}", "</s>" ]
5,284
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "Signature", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "ISourceField", ";", "public", "class", "SourceFieldElementInfo", "extends", "AnnotatableInfo", "implements", "ISourceField", "{", "protected", "char", "[", "]", "typeName", ";", "protected", "char", "[", "]", "initializationSource", ";", "public", "char", "[", "]", "getInitializationSource", "(", ")", "{", "return", "this", ".", "initializationSource", ";", "}", "public", "char", "[", "]", "getTypeName", "(", ")", "{", "return", "this", ".", "typeName", ";", "}", "protected", "String", "getTypeSignature", "(", ")", "{", "return", "Signature", ".", "createTypeSignature", "(", "this", ".", "typeName", ",", "false", ")", ";", "}", "protected", "void", "setTypeName", "(", "char", "[", "]", "typeName", ")", "{", "this", ".", "typeName", "=", "typeName", ";", "}", "}", "</s>" ]
5,285
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaModelStatus", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaModelStatusConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ISourceReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Messages", ";", "public", "class", "RenameElementsOperation", "extends", "MoveElementsOperation", "{", "public", "RenameElementsOperation", "(", "IJavaElement", "[", "]", "elements", ",", "IJavaElement", "[", "]", "destinations", ",", "String", "[", "]", "newNames", ",", "boolean", "force", ")", "{", "super", "(", "elements", ",", "destinations", ",", "force", ")", ";", "setRenamings", "(", "newNames", ")", ";", "}", "protected", "String", "getMainTaskName", "(", ")", "{", "return", "Messages", ".", "operation_renameElementProgress", ";", "}", "protected", "boolean", "isRename", "(", ")", "{", "return", "true", ";", "}", "protected", "IJavaModelStatus", "verify", "(", ")", "{", "IJavaModelStatus", "status", "=", "super", ".", "verify", "(", ")", ";", "if", "(", "!", "status", ".", "isOK", "(", ")", ")", "return", "status", ";", "if", "(", "this", ".", "renamingsList", "==", "null", "||", "this", ".", "renamingsList", ".", "length", "==", "0", ")", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "NULL_NAME", ")", ";", "return", "JavaModelStatus", ".", "VERIFIED_OK", ";", "}", "protected", "void", "verify", "(", "IJavaElement", "element", ")", "throws", "JavaModelException", "{", "if", "(", "element", "==", "null", "||", "!", "element", ".", "exists", "(", ")", ")", "error", "(", "IJavaModelStatusConstants", ".", "ELEMENT_DOES_NOT_EXIST", ",", "element", ")", ";", "if", "(", "element", ".", "isReadOnly", "(", ")", ")", "error", "(", "IJavaModelStatusConstants", ".", "READ_ONLY", ",", "element", ")", ";", "if", "(", "!", "(", "element", "instanceof", "ISourceReference", ")", ")", "error", "(", "IJavaModelStatusConstants", ".", "INVALID_ELEMENT_TYPES", ",", "element", ")", ";", "int", "elementType", "=", "element", ".", "getElementType", "(", ")", ";", "if", "(", "elementType", "<", "IJavaElement", ".", "TYPE", "||", "elementType", "==", "IJavaElement", ".", "INITIALIZER", ")", "error", "(", "IJavaModelStatusConstants", ".", "INVALID_ELEMENT_TYPES", ",", "element", ")", ";", "verifyRenaming", "(", "element", ")", ";", "}", "}", "</s>" ]
5,286
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "hierarchy", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "Signature", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TypeDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "IBinaryAnnotation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "IBinaryField", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "IBinaryMethod", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "IBinaryNestedType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "IBinaryType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "indexing", ".", "IIndexConstants", ";", "public", "class", "HierarchyBinaryType", "implements", "IBinaryType", "{", "private", "int", "modifiers", ";", "private", "char", "[", "]", "sourceName", ";", "private", "char", "[", "]", "name", ";", "private", "char", "[", "]", "enclosingTypeName", ";", "private", "char", "[", "]", "superclass", ";", "private", "char", "[", "]", "[", "]", "superInterfaces", "=", "NoInterface", ";", "private", "char", "[", "]", "[", "]", "typeParameterSignatures", ";", "private", "char", "[", "]", "genericSignature", ";", "public", "HierarchyBinaryType", "(", "int", "modifiers", ",", "char", "[", "]", "qualification", ",", "char", "[", "]", "sourceName", ",", "char", "[", "]", "enclosingTypeName", ",", "char", "[", "]", "[", "]", "typeParameterSignatures", ",", "char", "typeSuffix", ")", "{", "this", ".", "modifiers", "=", "modifiers", ";", "this", ".", "sourceName", "=", "sourceName", ";", "if", "(", "enclosingTypeName", "==", "null", ")", "{", "this", ".", "name", "=", "CharOperation", ".", "concat", "(", "qualification", ",", "sourceName", ",", "'/'", ")", ";", "}", "else", "{", "this", ".", "name", "=", "CharOperation", ".", "concat", "(", "qualification", ",", "'/'", ",", "enclosingTypeName", ",", "'$'", ",", "sourceName", ")", ";", "this", ".", "enclosingTypeName", "=", "CharOperation", ".", "concat", "(", "qualification", ",", "enclosingTypeName", ",", "'/'", ")", ";", "CharOperation", ".", "replace", "(", "this", ".", "enclosingTypeName", ",", "'.'", ",", "'/'", ")", ";", "}", "this", ".", "typeParameterSignatures", "=", "typeParameterSignatures", ";", "CharOperation", ".", "replace", "(", "this", ".", "name", ",", "'.'", ",", "'/'", ")", ";", "}", "public", "IBinaryAnnotation", "[", "]", "getAnnotations", "(", ")", "{", "return", "null", ";", "}", "public", "char", "[", "]", "getEnclosingMethod", "(", ")", "{", "return", "null", ";", "}", "public", "char", "[", "]", "getEnclosingTypeName", "(", ")", "{", "return", "this", ".", "enclosingTypeName", ";", "}", "public", "IBinaryField", "[", "]", "getFields", "(", ")", "{", "return", "null", ";", "}", "public", "char", "[", "]", "getFileName", "(", ")", "{", "return", "null", ";", "}", "public", "char", "[", "]", "getGenericSignature", "(", ")", "{", "if", "(", "this", ".", "typeParameterSignatures", "!=", "null", "&&", "this", ".", "genericSignature", "==", "null", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "buffer", ".", "append", "(", "'<'", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "this", ".", "typeParameterSignatures", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "buffer", ".", "append", "(", "this", ".", "typeParameterSignatures", "[", "i", "]", ")", ";", "}", "buffer", ".", "append", "(", "'>'", ")", ";", "if", "(", "this", ".", "superclass", "==", "null", ")", "buffer", ".", "append", "(", "Signature", ".", "createTypeSignature", "(", "\"\"", ",", "true", ")", ")", ";", "else", "buffer", ".", "append", "(", "Signature", ".", "createTypeSignature", "(", "this", ".", "superclass", ",", "true", ")", ")", ";", "if", "(", "this", ".", "superInterfaces", "!=", "null", ")", "for", "(", "int", "i", "=", "0", ",", "length", "=", "this", ".", "superInterfaces", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "buffer", ".", "append", "(", "Signature", ".", "createTypeSignature", "(", "this", ".", "superInterfaces", "[", "i", "]", ",", "true", ")", ")", ";", "this", ".", "genericSignature", "=", "buffer", ".", "toString", "(", ")", ".", "toCharArray", "(", ")", ";", "CharOperation", ".", "replace", "(", "this", ".", "genericSignature", ",", "'.'", ",", "'/'", ")", ";", "}", "return", "this", ".", "genericSignature", ";", "}", "public", "char", "[", "]", "[", "]", "getInterfaceNames", "(", ")", "{", "return", "this", ".", "superInterfaces", ";", "}", "public", "IBinaryNestedType", "[", "]", "getMemberTypes", "(", ")", "{", "return", "null", ";", "}", "public", "IBinaryMethod", "[", "]", "getMethods", "(", ")", "{", "return", "null", ";", "}", "public", "char", "[", "]", "[", "]", "[", "]", "getMissingTypeNames", "(", ")", "{", "return", "null", ";", "}", "public", "int", "getModifiers", "(", ")", "{", "return", "this", ".", "modifiers", ";", "}", "public", "char", "[", "]", "getName", "(", ")", "{", "return", "this", ".", "name", ";", "}", "public", "char", "[", "]", "getSourceName", "(", ")", "{", "return", "this", ".", "sourceName", ";", "}", "public", "char", "[", "]", "getSuperclassName", "(", ")", "{", "return", "this", ".", "superclass", ";", "}", "public", "long", "getTagBits", "(", ")", "{", "return", "0", ";", "}", "public", "boolean", "isAnonymous", "(", ")", "{", "return", "false", ";", "}", "public", "boolean", "isBinaryType", "(", ")", "{", "return", "true", ";", "}", "public", "boolean", "isLocal", "(", ")", "{", "return", "false", ";", "}", "public", "boolean", "isMember", "(", ")", "{", "return", "false", ";", "}", "public", "void", "recordSuperType", "(", "char", "[", "]", "superTypeName", ",", "char", "[", "]", "superQualification", ",", "char", "superClassOrInterface", ")", "{", "if", "(", "superQualification", "!=", "null", ")", "{", "int", "length", "=", "superQualification", ".", "length", ";", "if", "(", "superQualification", "[", "length", "-", "1", "]", "==", "'$'", ")", "{", "char", "[", "]", "enclosingSuperName", "=", "CharOperation", ".", "lastSegment", "(", "superQualification", ",", "'.'", ")", ";", "superTypeName", "=", "CharOperation", ".", "concat", "(", "enclosingSuperName", ",", "superTypeName", ")", ";", "superQualification", "=", "CharOperation", ".", "subarray", "(", "superQualification", ",", "0", ",", "length", "-", "enclosingSuperName", ".", "length", "-", "1", ")", ";", "}", "}", "if", "(", "superClassOrInterface", "==", "IIndexConstants", ".", "CLASS_SUFFIX", ")", "{", "if", "(", "TypeDeclaration", ".", "kind", "(", "this", ".", "modifiers", ")", "==", "TypeDeclaration", ".", "INTERFACE_DECL", ")", "return", ";", "char", "[", "]", "encodedName", "=", "CharOperation", ".", "concat", "(", "superQualification", ",", "superTypeName", ",", "'/'", ")", ";", "CharOperation", ".", "replace", "(", "encodedName", ",", "'.'", ",", "'/'", ")", ";", "this", ".", "superclass", "=", "encodedName", ";", "}", "else", "{", "char", "[", "]", "encodedName", "=", "CharOperation", ".", "concat", "(", "superQualification", ",", "superTypeName", ",", "'/'", ")", ";", "CharOperation", ".", "replace", "(", "encodedName", ",", "'.'", ",", "'/'", ")", ";", "if", "(", "this", ".", "superInterfaces", "==", "NoInterface", ")", "{", "this", ".", "superInterfaces", "=", "new", "char", "[", "]", "[", "]", "{", "encodedName", "}", ";", "}", "else", "{", "int", "length", "=", "this", ".", "superInterfaces", ".", "length", ";", "System", ".", "arraycopy", "(", "this", ".", "superInterfaces", ",", "0", ",", "this", ".", "superInterfaces", "=", "new", "char", "[", "length", "+", "1", "]", "[", "]", ",", "0", ",", "length", ")", ";", "this", ".", "superInterfaces", "[", "length", "]", "=", "encodedName", ";", "}", "}", "}", "public", "char", "[", "]", "sourceFileName", "(", ")", "{", "return", "null", ";", "}", "public", "String", "toString", "(", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "if", "(", "this", ".", "modifiers", "==", "ClassFileConstants", ".", "AccPublic", ")", "{", "buffer", ".", "append", "(", "\"public", "\"", ")", ";", "}", "switch", "(", "TypeDeclaration", ".", "kind", "(", "this", ".", "modifiers", ")", ")", "{", "case", "TypeDeclaration", ".", "CLASS_DECL", ":", "buffer", ".", "append", "(", "\"class", "\"", ")", ";", "break", ";", "case", "TypeDeclaration", ".", "INTERFACE_DECL", ":", "buffer", ".", "append", "(", "\"interface", "\"", ")", ";", "break", ";", "case", "TypeDeclaration", ".", "ENUM_DECL", ":", "buffer", ".", "append", "(", "\"enum", "\"", ")", ";", "break", ";", "}", "if", "(", "this", ".", "name", "!=", "null", ")", "{", "buffer", ".", "append", "(", "this", ".", "name", ")", ";", "}", "if", "(", "this", ".", "superclass", "!=", "null", ")", "{", "buffer", ".", "append", "(", "\"n", "extends", "\"", ")", ";", "buffer", ".", "append", "(", "this", ".", "superclass", ")", ";", "}", "int", "length", ";", "if", "(", "this", ".", "superInterfaces", "!=", "null", "&&", "(", "length", "=", "this", ".", "superInterfaces", ".", "length", ")", "!=", "0", ")", "{", "buffer", ".", "append", "(", "\"\"", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "buffer", ".", "append", "(", "this", ".", "superInterfaces", "[", "i", "]", ")", ";", "if", "(", "i", "!=", "length", "-", "1", ")", "{", "buffer", ".", "append", "(", "\",", "\"", ")", ";", "}", "}", "}", "return", "buffer", ".", "toString", "(", ")", ";", "}", "}", "</s>" ]
5,287
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "hierarchy", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "InputStream", ";", "import", "java", ".", "io", ".", "OutputStream", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Hashtable", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "ISafeRunnable", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IStatus", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "OperationCanceledException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "SafeRunner", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "search", ".", "IJavaSearchScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "search", ".", "SearchEngine", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Messages", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "TypeHierarchy", "implements", "ITypeHierarchy", ",", "IElementChangedListener", "{", "public", "static", "boolean", "DEBUG", "=", "false", ";", "static", "final", "byte", "VERSION", "=", "0x0000", ";", "static", "final", "byte", "SEPARATOR1", "=", "'\\n'", ";", "static", "final", "byte", "SEPARATOR2", "=", "','", ";", "static", "final", "byte", "SEPARATOR3", "=", "'>'", ";", "static", "final", "byte", "SEPARATOR4", "=", "'\\r'", ";", "static", "final", "byte", "COMPUTE_SUBTYPES", "=", "0x0001", ";", "static", "final", "byte", "CLASS", "=", "0x0000", ";", "static", "final", "byte", "INTERFACE", "=", "0x0001", ";", "static", "final", "byte", "COMPUTED_FOR", "=", "0x0002", ";", "static", "final", "byte", "ROOT", "=", "0x0004", ";", "static", "final", "byte", "[", "]", "NO_FLAGS", "=", "new", "byte", "[", "]", "{", "}", ";", "static", "final", "int", "SIZE", "=", "10", ";", "protected", "IJavaProject", "project", ";", "protected", "IType", "focusType", ";", "protected", "ICompilationUnit", "[", "]", "workingCopies", ";", "protected", "Map", "classToSuperclass", ";", "protected", "Map", "typeToSuperInterfaces", ";", "protected", "Map", "typeToSubtypes", ";", "protected", "Map", "typeFlags", ";", "protected", "TypeVector", "rootClasses", "=", "new", "TypeVector", "(", ")", ";", "protected", "ArrayList", "interfaces", "=", "new", "ArrayList", "(", "10", ")", ";", "public", "ArrayList", "missingTypes", "=", "new", "ArrayList", "(", "4", ")", ";", "protected", "static", "final", "IType", "[", "]", "NO_TYPE", "=", "new", "IType", "[", "0", "]", ";", "protected", "IProgressMonitor", "progressMonitor", "=", "null", ";", "protected", "ArrayList", "changeListeners", "=", "null", ";", "public", "Map", "files", "=", "null", ";", "protected", "Region", "packageRegion", "=", "null", ";", "protected", "Region", "projectRegion", "=", "null", ";", "protected", "boolean", "computeSubtypes", ";", "IJavaSearchScope", "scope", ";", "public", "boolean", "needsRefresh", "=", "true", ";", "protected", "ChangeCollector", "changeCollector", ";", "public", "TypeHierarchy", "(", ")", "{", "}", "public", "TypeHierarchy", "(", "IType", "type", ",", "ICompilationUnit", "[", "]", "workingCopies", ",", "IJavaProject", "project", ",", "boolean", "computeSubtypes", ")", "{", "this", "(", "type", ",", "workingCopies", ",", "SearchEngine", ".", "createJavaSearchScope", "(", "new", "IJavaElement", "[", "]", "{", "project", "}", ")", ",", "computeSubtypes", ")", ";", "this", ".", "project", "=", "project", ";", "}", "public", "TypeHierarchy", "(", "IType", "type", ",", "ICompilationUnit", "[", "]", "workingCopies", ",", "IJavaSearchScope", "scope", ",", "boolean", "computeSubtypes", ")", "{", "this", ".", "focusType", "=", "type", "==", "null", "?", "null", ":", "(", "IType", ")", "(", "(", "JavaElement", ")", "type", ")", ".", "unresolved", "(", ")", ";", "this", ".", "workingCopies", "=", "workingCopies", ";", "this", ".", "computeSubtypes", "=", "computeSubtypes", ";", "this", ".", "scope", "=", "scope", ";", "}", "protected", "void", "initializeRegions", "(", ")", "{", "IType", "[", "]", "allTypes", "=", "getAllTypes", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "allTypes", ".", "length", ";", "i", "++", ")", "{", "IType", "type", "=", "allTypes", "[", "i", "]", ";", "Openable", "o", "=", "(", "Openable", ")", "(", "(", "JavaElement", ")", "type", ")", ".", "getOpenableParent", "(", ")", ";", "if", "(", "o", "!=", "null", ")", "{", "ArrayList", "types", "=", "(", "ArrayList", ")", "this", ".", "files", ".", "get", "(", "o", ")", ";", "if", "(", "types", "==", "null", ")", "{", "types", "=", "new", "ArrayList", "(", ")", ";", "this", ".", "files", ".", "put", "(", "o", ",", "types", ")", ";", "}", "types", ".", "add", "(", "type", ")", ";", "}", "IPackageFragment", "pkg", "=", "type", ".", "getPackageFragment", "(", ")", ";", "this", ".", "packageRegion", ".", "add", "(", "pkg", ")", ";", "IJavaProject", "declaringProject", "=", "type", ".", "getJavaProject", "(", ")", ";", "if", "(", "declaringProject", "!=", "null", ")", "{", "this", ".", "projectRegion", ".", "add", "(", "declaringProject", ")", ";", "}", "checkCanceled", "(", ")", ";", "}", "}", "private", "void", "addAllCheckingDuplicates", "(", "ArrayList", "list", ",", "IType", "[", "]", "collection", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "collection", ".", "length", ";", "i", "++", ")", "{", "IType", "element", "=", "collection", "[", "i", "]", ";", "if", "(", "!", "list", ".", "contains", "(", "element", ")", ")", "{", "list", ".", "add", "(", "element", ")", ";", "}", "}", "}", "protected", "void", "addInterface", "(", "IType", "type", ")", "{", "this", ".", "interfaces", ".", "add", "(", "type", ")", ";", "}", "protected", "void", "addRootClass", "(", "IType", "type", ")", "{", "if", "(", "this", ".", "rootClasses", ".", "contains", "(", "type", ")", ")", "return", ";", "this", ".", "rootClasses", ".", "add", "(", "type", ")", ";", "}", "protected", "void", "addSubtype", "(", "IType", "type", ",", "IType", "subtype", ")", "{", "TypeVector", "subtypes", "=", "(", "TypeVector", ")", "this", ".", "typeToSubtypes", ".", "get", "(", "type", ")", ";", "if", "(", "subtypes", "==", "null", ")", "{", "subtypes", "=", "new", "TypeVector", "(", ")", ";", "this", ".", "typeToSubtypes", ".", "put", "(", "type", ",", "subtypes", ")", ";", "}", "if", "(", "!", "subtypes", ".", "contains", "(", "subtype", ")", ")", "{", "subtypes", ".", "add", "(", "subtype", ")", ";", "}", "}", "public", "synchronized", "void", "addTypeHierarchyChangedListener", "(", "ITypeHierarchyChangedListener", "listener", ")", "{", "ArrayList", "listeners", "=", "this", ".", "changeListeners", ";", "if", "(", "listeners", "==", "null", ")", "{", "this", ".", "changeListeners", "=", "listeners", "=", "new", "ArrayList", "(", ")", ";", "}", "if", "(", "listeners", ".", "size", "(", ")", "==", "0", ")", "{", "JavaCore", ".", "addElementChangedListener", "(", "this", ")", ";", "}", "if", "(", "listeners", ".", "indexOf", "(", "listener", ")", "==", "-", "1", ")", "{", "listeners", ".", "add", "(", "listener", ")", ";", "}", "}", "private", "static", "Integer", "bytesToFlags", "(", "byte", "[", "]", "bytes", ")", "{", "if", "(", "bytes", "!=", "null", "&&", "bytes", ".", "length", ">", "0", ")", "{", "return", "new", "Integer", "(", "new", "String", "(", "bytes", ")", ")", ";", "}", "else", "{", "return", "null", ";", "}", "}", "public", "void", "cacheFlags", "(", "IType", "type", ",", "int", "flags", ")", "{", "this", ".", "typeFlags", ".", "put", "(", "type", ",", "new", "Integer", "(", "flags", ")", ")", ";", "}", "protected", "void", "cacheSuperclass", "(", "IType", "type", ",", "IType", "superclass", ")", "{", "if", "(", "superclass", "!=", "null", ")", "{", "this", ".", "classToSuperclass", ".", "put", "(", "type", ",", "superclass", ")", ";", "addSubtype", "(", "superclass", ",", "type", ")", ";", "}", "}", "protected", "void", "cacheSuperInterfaces", "(", "IType", "type", ",", "IType", "[", "]", "superinterfaces", ")", "{", "this", ".", "typeToSuperInterfaces", ".", "put", "(", "type", ",", "superinterfaces", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "superinterfaces", ".", "length", ";", "i", "++", ")", "{", "IType", "superinterface", "=", "superinterfaces", "[", "i", "]", ";", "if", "(", "superinterface", "!=", "null", ")", "{", "addSubtype", "(", "superinterface", ",", "type", ")", ";", "}", "}", "}", "protected", "void", "checkCanceled", "(", ")", "{", "if", "(", "this", ".", "progressMonitor", "!=", "null", "&&", "this", ".", "progressMonitor", ".", "isCanceled", "(", ")", ")", "{", "throw", "new", "OperationCanceledException", "(", ")", ";", "}", "}", "protected", "void", "compute", "(", ")", "throws", "JavaModelException", ",", "CoreException", "{", "if", "(", "this", ".", "focusType", "!=", "null", ")", "{", "HierarchyBuilder", "builder", "=", "new", "IndexBasedHierarchyBuilder", "(", "this", ",", "this", ".", "scope", ")", ";", "builder", ".", "build", "(", "this", ".", "computeSubtypes", ")", ";", "}", "}", "public", "boolean", "contains", "(", "IType", "type", ")", "{", "if", "(", "this", ".", "classToSuperclass", ".", "get", "(", "type", ")", "!=", "null", ")", "{", "return", "true", ";", "}", "if", "(", "this", ".", "rootClasses", ".", "contains", "(", "type", ")", ")", "return", "true", ";", "if", "(", "this", ".", "interfaces", ".", "contains", "(", "type", ")", ")", "return", "true", ";", "return", "false", ";", "}", "public", "void", "elementChanged", "(", "ElementChangedEvent", "event", ")", "{", "if", "(", "this", ".", "needsRefresh", ")", "return", ";", "if", "(", "isAffected", "(", "event", ".", "getDelta", "(", ")", ",", "event", ".", "getType", "(", ")", ")", ")", "{", "this", ".", "needsRefresh", "=", "true", ";", "fireChange", "(", ")", ";", "}", "}", "public", "boolean", "exists", "(", ")", "{", "if", "(", "!", "this", ".", "needsRefresh", ")", "return", "true", ";", "return", "(", "this", ".", "focusType", "==", "null", "||", "this", ".", "focusType", ".", "exists", "(", ")", ")", "&&", "javaProject", "(", ")", ".", "exists", "(", ")", ";", "}", "public", "void", "fireChange", "(", ")", "{", "ArrayList", "listeners", "=", "getClonedChangeListeners", "(", ")", ";", "if", "(", "listeners", "==", "null", ")", "{", "return", ";", "}", "if", "(", "DEBUG", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "Thread", ".", "currentThread", "(", ")", "+", "\"]\"", ")", ";", "if", "(", "this", ".", "focusType", "!=", "null", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "(", "(", "JavaElement", ")", "this", ".", "focusType", ")", ".", "toStringWithAncestors", "(", ")", ")", ";", "}", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "listeners", ".", "size", "(", ")", ";", "i", "++", ")", "{", "final", "ITypeHierarchyChangedListener", "listener", "=", "(", "ITypeHierarchyChangedListener", ")", "listeners", ".", "get", "(", "i", ")", ";", "SafeRunner", ".", "run", "(", "new", "ISafeRunnable", "(", ")", "{", "public", "void", "handleException", "(", "Throwable", "exception", ")", "{", "Util", ".", "log", "(", "exception", ",", "\"\"", ")", ";", "}", "public", "void", "run", "(", ")", "throws", "Exception", "{", "listener", ".", "typeHierarchyChanged", "(", "TypeHierarchy", ".", "this", ")", ";", "}", "}", ")", ";", "}", "}", "private", "synchronized", "ArrayList", "getClonedChangeListeners", "(", ")", "{", "ArrayList", "listeners", "=", "this", ".", "changeListeners", ";", "if", "(", "listeners", "==", "null", ")", "{", "return", "null", ";", "}", "return", "(", "ArrayList", ")", "listeners", ".", "clone", "(", ")", ";", "}", "private", "static", "byte", "[", "]", "flagsToBytes", "(", "Integer", "flags", ")", "{", "if", "(", "flags", "!=", "null", ")", "{", "return", "flags", ".", "toString", "(", ")", ".", "getBytes", "(", ")", ";", "}", "else", "{", "return", "NO_FLAGS", ";", "}", "}", "public", "IType", "[", "]", "getAllClasses", "(", ")", "{", "TypeVector", "classes", "=", "this", ".", "rootClasses", ".", "copy", "(", ")", ";", "for", "(", "Iterator", "iter", "=", "this", ".", "classToSuperclass", ".", "keySet", "(", ")", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "classes", ".", "add", "(", "(", "IType", ")", "iter", ".", "next", "(", ")", ")", ";", "}", "return", "classes", ".", "elements", "(", ")", ";", "}", "public", "IType", "[", "]", "getAllInterfaces", "(", ")", "{", "IType", "[", "]", "collection", "=", "new", "IType", "[", "this", ".", "interfaces", ".", "size", "(", ")", "]", ";", "this", ".", "interfaces", ".", "toArray", "(", "collection", ")", ";", "return", "collection", ";", "}", "public", "IType", "[", "]", "getAllSubtypes", "(", "IType", "type", ")", "{", "return", "getAllSubtypesForType", "(", "type", ")", ";", "}", "private", "IType", "[", "]", "getAllSubtypesForType", "(", "IType", "type", ")", "{", "ArrayList", "subTypes", "=", "new", "ArrayList", "(", ")", ";", "getAllSubtypesForType0", "(", "type", ",", "subTypes", ")", ";", "IType", "[", "]", "subClasses", "=", "new", "IType", "[", "subTypes", ".", "size", "(", ")", "]", ";", "subTypes", ".", "toArray", "(", "subClasses", ")", ";", "return", "subClasses", ";", "}", "private", "void", "getAllSubtypesForType0", "(", "IType", "type", ",", "ArrayList", "subs", ")", "{", "IType", "[", "]", "subTypes", "=", "getSubtypesForType", "(", "type", ")", ";", "if", "(", "subTypes", ".", "length", "!=", "0", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "subTypes", ".", "length", ";", "i", "++", ")", "{", "IType", "subType", "=", "subTypes", "[", "i", "]", ";", "subs", ".", "add", "(", "subType", ")", ";", "getAllSubtypesForType0", "(", "subType", ",", "subs", ")", ";", "}", "}", "}", "public", "IType", "[", "]", "getAllSuperclasses", "(", "IType", "type", ")", "{", "IType", "superclass", "=", "getSuperclass", "(", "type", ")", ";", "TypeVector", "supers", "=", "new", "TypeVector", "(", ")", ";", "while", "(", "superclass", "!=", "null", ")", "{", "supers", ".", "add", "(", "superclass", ")", ";", "superclass", "=", "getSuperclass", "(", "superclass", ")", ";", "}", "return", "supers", ".", "elements", "(", ")", ";", "}", "public", "IType", "[", "]", "getAllSuperInterfaces", "(", "IType", "type", ")", "{", "ArrayList", "supers", "=", "getAllSuperInterfaces0", "(", "type", ",", "null", ")", ";", "if", "(", "supers", "==", "null", ")", "return", "NO_TYPE", ";", "IType", "[", "]", "superinterfaces", "=", "new", "IType", "[", "supers", ".", "size", "(", ")", "]", ";", "supers", ".", "toArray", "(", "superinterfaces", ")", ";", "return", "superinterfaces", ";", "}", "private", "ArrayList", "getAllSuperInterfaces0", "(", "IType", "type", ",", "ArrayList", "supers", ")", "{", "IType", "[", "]", "superinterfaces", "=", "(", "IType", "[", "]", ")", "this", ".", "typeToSuperInterfaces", ".", "get", "(", "type", ")", ";", "if", "(", "superinterfaces", "==", "null", ")", "return", "supers", ";", "if", "(", "superinterfaces", ".", "length", "!=", "0", ")", "{", "if", "(", "supers", "==", "null", ")", "supers", "=", "new", "ArrayList", "(", ")", ";", "addAllCheckingDuplicates", "(", "supers", ",", "superinterfaces", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "superinterfaces", ".", "length", ";", "i", "++", ")", "{", "supers", "=", "getAllSuperInterfaces0", "(", "superinterfaces", "[", "i", "]", ",", "supers", ")", ";", "}", "}", "IType", "superclass", "=", "(", "IType", ")", "this", ".", "classToSuperclass", ".", "get", "(", "type", ")", ";", "if", "(", "superclass", "!=", "null", ")", "{", "supers", "=", "getAllSuperInterfaces0", "(", "superclass", ",", "supers", ")", ";", "}", "return", "supers", ";", "}", "public", "IType", "[", "]", "getAllSupertypes", "(", "IType", "type", ")", "{", "ArrayList", "supers", "=", "getAllSupertypes0", "(", "type", ",", "null", ")", ";", "if", "(", "supers", "==", "null", ")", "return", "NO_TYPE", ";", "IType", "[", "]", "supertypes", "=", "new", "IType", "[", "supers", ".", "size", "(", ")", "]", ";", "supers", ".", "toArray", "(", "supertypes", ")", ";", "return", "supertypes", ";", "}", "private", "ArrayList", "getAllSupertypes0", "(", "IType", "type", ",", "ArrayList", "supers", ")", "{", "IType", "[", "]", "superinterfaces", "=", "(", "IType", "[", "]", ")", "this", ".", "typeToSuperInterfaces", ".", "get", "(", "type", ")", ";", "if", "(", "superinterfaces", "==", "null", ")", "return", "supers", ";", "if", "(", "superinterfaces", ".", "length", "!=", "0", ")", "{", "if", "(", "supers", "==", "null", ")", "supers", "=", "new", "ArrayList", "(", ")", ";", "addAllCheckingDuplicates", "(", "supers", ",", "superinterfaces", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "superinterfaces", ".", "length", ";", "i", "++", ")", "{", "supers", "=", "getAllSuperInterfaces0", "(", "superinterfaces", "[", "i", "]", ",", "supers", ")", ";", "}", "}", "IType", "superclass", "=", "(", "IType", ")", "this", ".", "classToSuperclass", ".", "get", "(", "type", ")", ";", "if", "(", "superclass", "!=", "null", ")", "{", "if", "(", "supers", "==", "null", ")", "supers", "=", "new", "ArrayList", "(", ")", ";", "supers", ".", "add", "(", "superclass", ")", ";", "supers", "=", "getAllSupertypes0", "(", "superclass", ",", "supers", ")", ";", "}", "return", "supers", ";", "}", "public", "IType", "[", "]", "getAllTypes", "(", ")", "{", "IType", "[", "]", "classes", "=", "getAllClasses", "(", ")", ";", "int", "classesLength", "=", "classes", ".", "length", ";", "IType", "[", "]", "allInterfaces", "=", "getAllInterfaces", "(", ")", ";", "int", "interfacesLength", "=", "allInterfaces", ".", "length", ";", "IType", "[", "]", "all", "=", "new", "IType", "[", "classesLength", "+", "interfacesLength", "]", ";", "System", ".", "arraycopy", "(", "classes", ",", "0", ",", "all", ",", "0", ",", "classesLength", ")", ";", "System", ".", "arraycopy", "(", "allInterfaces", ",", "0", ",", "all", ",", "classesLength", ",", "interfacesLength", ")", ";", "return", "all", ";", "}", "public", "int", "getCachedFlags", "(", "IType", "type", ")", "{", "Integer", "flagObject", "=", "(", "Integer", ")", "this", ".", "typeFlags", ".", "get", "(", "type", ")", ";", "if", "(", "flagObject", "!=", "null", ")", "{", "return", "flagObject", ".", "intValue", "(", ")", ";", "}", "return", "-", "1", ";", "}", "public", "IType", "[", "]", "getExtendingInterfaces", "(", "IType", "type", ")", "{", "if", "(", "!", "isInterface", "(", "type", ")", ")", "return", "NO_TYPE", ";", "return", "getExtendingInterfaces0", "(", "type", ")", ";", "}", "private", "IType", "[", "]", "getExtendingInterfaces0", "(", "IType", "extendedInterface", ")", "{", "Iterator", "iter", "=", "this", ".", "typeToSuperInterfaces", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "ArrayList", "interfaceList", "=", "new", "ArrayList", "(", ")", ";", "while", "(", "iter", ".", "hasNext", "(", ")", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "iter", ".", "next", "(", ")", ";", "IType", "type", "=", "(", "IType", ")", "entry", ".", "getKey", "(", ")", ";", "if", "(", "!", "isInterface", "(", "type", ")", ")", "{", "continue", ";", "}", "IType", "[", "]", "superInterfaces", "=", "(", "IType", "[", "]", ")", "entry", ".", "getValue", "(", ")", ";", "if", "(", "superInterfaces", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "superInterfaces", ".", "length", ";", "i", "++", ")", "{", "IType", "superInterface", "=", "superInterfaces", "[", "i", "]", ";", "if", "(", "superInterface", ".", "equals", "(", "extendedInterface", ")", ")", "{", "interfaceList", ".", "add", "(", "type", ")", ";", "}", "}", "}", "}", "IType", "[", "]", "extendingInterfaces", "=", "new", "IType", "[", "interfaceList", ".", "size", "(", ")", "]", ";", "interfaceList", ".", "toArray", "(", "extendingInterfaces", ")", ";", "return", "extendingInterfaces", ";", "}", "public", "IType", "[", "]", "getImplementingClasses", "(", "IType", "type", ")", "{", "if", "(", "!", "isInterface", "(", "type", ")", ")", "{", "return", "NO_TYPE", ";", "}", "return", "getImplementingClasses0", "(", "type", ")", ";", "}", "private", "IType", "[", "]", "getImplementingClasses0", "(", "IType", "interfce", ")", "{", "Iterator", "iter", "=", "this", ".", "typeToSuperInterfaces", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "ArrayList", "iMenters", "=", "new", "ArrayList", "(", ")", ";", "while", "(", "iter", ".", "hasNext", "(", ")", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "iter", ".", "next", "(", ")", ";", "IType", "type", "=", "(", "IType", ")", "entry", ".", "getKey", "(", ")", ";", "if", "(", "isInterface", "(", "type", ")", ")", "{", "continue", ";", "}", "IType", "[", "]", "types", "=", "(", "IType", "[", "]", ")", "entry", ".", "getValue", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "types", ".", "length", ";", "i", "++", ")", "{", "IType", "iFace", "=", "types", "[", "i", "]", ";", "if", "(", "iFace", ".", "equals", "(", "interfce", ")", ")", "{", "iMenters", ".", "add", "(", "type", ")", ";", "}", "}", "}", "IType", "[", "]", "implementers", "=", "new", "IType", "[", "iMenters", ".", "size", "(", ")", "]", ";", "iMenters", ".", "toArray", "(", "implementers", ")", ";", "return", "implementers", ";", "}", "public", "IType", "[", "]", "getRootClasses", "(", ")", "{", "return", "this", ".", "rootClasses", ".", "elements", "(", ")", ";", "}", "public", "IType", "[", "]", "getRootInterfaces", "(", ")", "{", "IType", "[", "]", "allInterfaces", "=", "getAllInterfaces", "(", ")", ";", "IType", "[", "]", "roots", "=", "new", "IType", "[", "allInterfaces", ".", "length", "]", ";", "int", "rootNumber", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "allInterfaces", ".", "length", ";", "i", "++", ")", "{", "IType", "[", "]", "superInterfaces", "=", "getSuperInterfaces", "(", "allInterfaces", "[", "i", "]", ")", ";", "if", "(", "superInterfaces", "==", "null", "||", "superInterfaces", ".", "length", "==", "0", ")", "{", "roots", "[", "rootNumber", "++", "]", "=", "allInterfaces", "[", "i", "]", ";", "}", "}", "IType", "[", "]", "result", "=", "new", "IType", "[", "rootNumber", "]", ";", "if", "(", "result", ".", "length", ">", "0", ")", "{", "System", ".", "arraycopy", "(", "roots", ",", "0", ",", "result", ",", "0", ",", "rootNumber", ")", ";", "}", "return", "result", ";", "}", "public", "IType", "[", "]", "getSubclasses", "(", "IType", "type", ")", "{", "if", "(", "isInterface", "(", "type", ")", ")", "{", "return", "NO_TYPE", ";", "}", "TypeVector", "vector", "=", "(", "TypeVector", ")", "this", ".", "typeToSubtypes", ".", "get", "(", "type", ")", ";", "if", "(", "vector", "==", "null", ")", "return", "NO_TYPE", ";", "else", "return", "vector", ".", "elements", "(", ")", ";", "}", "public", "IType", "[", "]", "getSubtypes", "(", "IType", "type", ")", "{", "return", "getSubtypesForType", "(", "type", ")", ";", "}", "private", "IType", "[", "]", "getSubtypesForType", "(", "IType", "type", ")", "{", "TypeVector", "vector", "=", "(", "TypeVector", ")", "this", ".", "typeToSubtypes", ".", "get", "(", "type", ")", ";", "if", "(", "vector", "==", "null", ")", "return", "NO_TYPE", ";", "else", "return", "vector", ".", "elements", "(", ")", ";", "}", "public", "IType", "getSuperclass", "(", "IType", "type", ")", "{", "if", "(", "isInterface", "(", "type", ")", ")", "{", "return", "null", ";", "}", "return", "(", "IType", ")", "this", ".", "classToSuperclass", ".", "get", "(", "type", ")", ";", "}", "public", "IType", "[", "]", "getSuperInterfaces", "(", "IType", "type", ")", "{", "IType", "[", "]", "types", "=", "(", "IType", "[", "]", ")", "this", ".", "typeToSuperInterfaces", ".", "get", "(", "type", ")", ";", "if", "(", "types", "==", "null", ")", "{", "return", "NO_TYPE", ";", "}", "return", "types", ";", "}", "public", "IType", "[", "]", "getSupertypes", "(", "IType", "type", ")", "{", "IType", "superclass", "=", "getSuperclass", "(", "type", ")", ";", "if", "(", "superclass", "==", "null", ")", "{", "return", "getSuperInterfaces", "(", "type", ")", ";", "}", "else", "{", "TypeVector", "superTypes", "=", "new", "TypeVector", "(", "getSuperInterfaces", "(", "type", ")", ")", ";", "superTypes", ".", "add", "(", "superclass", ")", ";", "return", "superTypes", ".", "elements", "(", ")", ";", "}", "}", "public", "IType", "getType", "(", ")", "{", "return", "this", ".", "focusType", ";", "}", "protected", "IType", "[", "]", "growAndAddToArray", "(", "IType", "[", "]", "array", ",", "IType", "[", "]", "additions", ")", "{", "if", "(", "array", "==", "null", "||", "array", ".", "length", "==", "0", ")", "{", "return", "additions", ";", "}", "IType", "[", "]", "old", "=", "array", ";", "array", "=", "new", "IType", "[", "old", ".", "length", "+", "additions", ".", "length", "]", ";", "System", ".", "arraycopy", "(", "old", ",", "0", ",", "array", ",", "0", ",", "old", ".", "length", ")", ";", "System", ".", "arraycopy", "(", "additions", ",", "0", ",", "array", ",", "old", ".", "length", ",", "additions", ".", "length", ")", ";", "return", "array", ";", "}", "protected", "IType", "[", "]", "growAndAddToArray", "(", "IType", "[", "]", "array", ",", "IType", "addition", ")", "{", "if", "(", "array", "==", "null", "||", "array", ".", "length", "==", "0", ")", "{", "return", "new", "IType", "[", "]", "{", "addition", "}", ";", "}", "IType", "[", "]", "old", "=", "array", ";", "array", "=", "new", "IType", "[", "old", ".", "length", "+", "1", "]", ";", "System", ".", "arraycopy", "(", "old", ",", "0", ",", "array", ",", "0", ",", "old", ".", "length", ")", ";", "array", "[", "old", ".", "length", "]", "=", "addition", ";", "return", "array", ";", "}", "public", "boolean", "hasFineGrainChanges", "(", ")", "{", "ChangeCollector", "collector", "=", "this", ".", "changeCollector", ";", "return", "collector", "!=", "null", "&&", "collector", ".", "needsRefresh", "(", ")", ";", "}", "private", "boolean", "hasSubtypeNamed", "(", "String", "simpleName", ")", "{", "if", "(", "this", ".", "focusType", "!=", "null", "&&", "this", ".", "focusType", ".", "getElementName", "(", ")", ".", "equals", "(", "simpleName", ")", ")", "{", "return", "true", ";", "}", "IType", "[", "]", "types", "=", "this", ".", "focusType", "==", "null", "?", "getAllTypes", "(", ")", ":", "getAllSubtypes", "(", "this", ".", "focusType", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "types", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "if", "(", "types", "[", "i", "]", ".", "getElementName", "(", ")", ".", "equals", "(", "simpleName", ")", ")", "{", "return", "true", ";", "}", "}", "return", "false", ";", "}", "private", "boolean", "hasTypeNamed", "(", "String", "simpleName", ")", "{", "IType", "[", "]", "types", "=", "getAllTypes", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "types", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "if", "(", "types", "[", "i", "]", ".", "getElementName", "(", ")", ".", "equals", "(", "simpleName", ")", ")", "{", "return", "true", ";", "}", "}", "return", "false", ";", "}", "boolean", "includesTypeOrSupertype", "(", "IType", "type", ")", "{", "try", "{", "if", "(", "hasTypeNamed", "(", "type", ".", "getElementName", "(", ")", ")", ")", "return", "true", ";", "String", "superclassName", "=", "type", ".", "getSuperclassName", "(", ")", ";", "if", "(", "superclassName", "!=", "null", ")", "{", "int", "lastSeparator", "=", "superclassName", ".", "lastIndexOf", "(", "'.'", ")", ";", "String", "simpleName", "=", "superclassName", ".", "substring", "(", "lastSeparator", "+", "1", ")", ";", "if", "(", "hasTypeNamed", "(", "simpleName", ")", ")", "return", "true", ";", "}", "String", "[", "]", "superinterfaceNames", "=", "type", ".", "getSuperInterfaceNames", "(", ")", ";", "if", "(", "superinterfaceNames", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ",", "length", "=", "superinterfaceNames", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "String", "superinterfaceName", "=", "superinterfaceNames", "[", "i", "]", ";", "int", "lastSeparator", "=", "superinterfaceName", ".", "lastIndexOf", "(", "'.'", ")", ";", "String", "simpleName", "=", "superinterfaceName", ".", "substring", "(", "lastSeparator", "+", "1", ")", ";", "if", "(", "hasTypeNamed", "(", "simpleName", ")", ")", "return", "true", ";", "}", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "return", "false", ";", "}", "protected", "void", "initialize", "(", "int", "size", ")", "{", "if", "(", "size", "<", "10", ")", "{", "size", "=", "10", ";", "}", "int", "smallSize", "=", "(", "size", "/", "2", ")", ";", "this", ".", "classToSuperclass", "=", "new", "HashMap", "(", "size", ")", ";", "this", ".", "interfaces", "=", "new", "ArrayList", "(", "smallSize", ")", ";", "this", ".", "missingTypes", "=", "new", "ArrayList", "(", "smallSize", ")", ";", "this", ".", "rootClasses", "=", "new", "TypeVector", "(", ")", ";", "this", ".", "typeToSubtypes", "=", "new", "HashMap", "(", "smallSize", ")", ";", "this", ".", "typeToSuperInterfaces", "=", "new", "HashMap", "(", "smallSize", ")", ";", "this", ".", "typeFlags", "=", "new", "HashMap", "(", "smallSize", ")", ";", "this", ".", "projectRegion", "=", "new", "Region", "(", ")", ";", "this", ".", "packageRegion", "=", "new", "Region", "(", ")", ";", "this", ".", "files", "=", "new", "HashMap", "(", "5", ")", ";", "}", "public", "synchronized", "boolean", "isAffected", "(", "IJavaElementDelta", "delta", ",", "int", "eventType", ")", "{", "IJavaElement", "element", "=", "delta", ".", "getElement", "(", ")", ";", "switch", "(", "element", ".", "getElementType", "(", ")", ")", "{", "case", "IJavaElement", ".", "JAVA_MODEL", ":", "return", "isAffectedByJavaModel", "(", "delta", ",", "element", ",", "eventType", ")", ";", "case", "IJavaElement", ".", "JAVA_PROJECT", ":", "return", "isAffectedByJavaProject", "(", "delta", ",", "element", ",", "eventType", ")", ";", "case", "IJavaElement", ".", "PACKAGE_FRAGMENT_ROOT", ":", "return", "isAffectedByPackageFragmentRoot", "(", "delta", ",", "element", ",", "eventType", ")", ";", "case", "IJavaElement", ".", "PACKAGE_FRAGMENT", ":", "return", "isAffectedByPackageFragment", "(", "delta", ",", "(", "PackageFragment", ")", "element", ",", "eventType", ")", ";", "case", "IJavaElement", ".", "CLASS_FILE", ":", "case", "IJavaElement", ".", "COMPILATION_UNIT", ":", "return", "isAffectedByOpenable", "(", "delta", ",", "element", ",", "eventType", ")", ";", "}", "return", "false", ";", "}", "private", "boolean", "isAffectedByChildren", "(", "IJavaElementDelta", "delta", ",", "int", "eventType", ")", "{", "if", "(", "(", "delta", ".", "getFlags", "(", ")", "&", "IJavaElementDelta", ".", "F_CHILDREN", ")", ">", "0", ")", "{", "IJavaElementDelta", "[", "]", "children", "=", "delta", ".", "getAffectedChildren", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "children", ".", "length", ";", "i", "++", ")", "{", "if", "(", "isAffected", "(", "children", "[", "i", "]", ",", "eventType", ")", ")", "{", "return", "true", ";", "}", "}", "}", "return", "false", ";", "}", "private", "boolean", "isAffectedByJavaModel", "(", "IJavaElementDelta", "delta", ",", "IJavaElement", "element", ",", "int", "eventType", ")", "{", "switch", "(", "delta", ".", "getKind", "(", ")", ")", "{", "case", "IJavaElementDelta", ".", "ADDED", ":", "case", "IJavaElementDelta", ".", "REMOVED", ":", "return", "element", ".", "equals", "(", "javaProject", "(", ")", ".", "getJavaModel", "(", ")", ")", ";", "case", "IJavaElementDelta", ".", "CHANGED", ":", "return", "isAffectedByChildren", "(", "delta", ",", "eventType", ")", ";", "}", "return", "false", ";", "}", "private", "boolean", "isAffectedByJavaProject", "(", "IJavaElementDelta", "delta", ",", "IJavaElement", "element", ",", "int", "eventType", ")", "{", "int", "kind", "=", "delta", ".", "getKind", "(", ")", ";", "int", "flags", "=", "delta", ".", "getFlags", "(", ")", ";", "if", "(", "(", "flags", "&", "IJavaElementDelta", ".", "F_OPENED", ")", "!=", "0", ")", "{", "kind", "=", "IJavaElementDelta", ".", "ADDED", ";", "}", "if", "(", "(", "flags", "&", "IJavaElementDelta", ".", "F_CLOSED", ")", "!=", "0", ")", "{", "kind", "=", "IJavaElementDelta", ".", "REMOVED", ";", "}", "switch", "(", "kind", ")", "{", "case", "IJavaElementDelta", ".", "ADDED", ":", "try", "{", "IClasspathEntry", "[", "]", "classpath", "=", "(", "(", "JavaProject", ")", "javaProject", "(", ")", ")", ".", "getExpandedClasspath", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "classpath", ".", "length", ";", "i", "++", ")", "{", "if", "(", "classpath", "[", "i", "]", ".", "getEntryKind", "(", ")", "==", "IClasspathEntry", ".", "CPE_PROJECT", "&&", "classpath", "[", "i", "]", ".", "getPath", "(", ")", ".", "equals", "(", "element", ".", "getPath", "(", ")", ")", ")", "{", "return", "true", ";", "}", "}", "if", "(", "this", ".", "focusType", "!=", "null", ")", "{", "classpath", "=", "(", "(", "JavaProject", ")", "element", ")", ".", "getExpandedClasspath", "(", ")", ";", "IPath", "hierarchyProject", "=", "javaProject", "(", ")", ".", "getPath", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "classpath", ".", "length", ";", "i", "++", ")", "{", "if", "(", "classpath", "[", "i", "]", ".", "getEntryKind", "(", ")", "==", "IClasspathEntry", ".", "CPE_PROJECT", "&&", "classpath", "[", "i", "]", ".", "getPath", "(", ")", ".", "equals", "(", "hierarchyProject", ")", ")", "{", "return", "true", ";", "}", "}", "}", "return", "false", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "return", "false", ";", "}", "case", "IJavaElementDelta", ".", "REMOVED", ":", "IJavaElement", "[", "]", "pkgs", "=", "this", ".", "packageRegion", ".", "getElements", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "pkgs", ".", "length", ";", "i", "++", ")", "{", "IJavaProject", "javaProject", "=", "pkgs", "[", "i", "]", ".", "getJavaProject", "(", ")", ";", "if", "(", "javaProject", "!=", "null", "&&", "javaProject", ".", "equals", "(", "element", ")", ")", "{", "return", "true", ";", "}", "}", "return", "false", ";", "case", "IJavaElementDelta", ".", "CHANGED", ":", "return", "isAffectedByChildren", "(", "delta", ",", "eventType", ")", ";", "}", "return", "false", ";", "}", "private", "boolean", "isAffectedByPackageFragment", "(", "IJavaElementDelta", "delta", ",", "PackageFragment", "element", ",", "int", "eventType", ")", "{", "switch", "(", "delta", ".", "getKind", "(", ")", ")", "{", "case", "IJavaElementDelta", ".", "ADDED", ":", "return", "this", ".", "projectRegion", ".", "contains", "(", "element", ")", ";", "case", "IJavaElementDelta", ".", "REMOVED", ":", "return", "packageRegionContainsSamePackageFragment", "(", "element", ")", ";", "case", "IJavaElementDelta", ".", "CHANGED", ":", "return", "isAffectedByChildren", "(", "delta", ",", "eventType", ")", ";", "}", "return", "false", ";", "}", "private", "boolean", "isAffectedByPackageFragmentRoot", "(", "IJavaElementDelta", "delta", ",", "IJavaElement", "element", ",", "int", "eventType", ")", "{", "switch", "(", "delta", ".", "getKind", "(", ")", ")", "{", "case", "IJavaElementDelta", ".", "ADDED", ":", "return", "this", ".", "projectRegion", ".", "contains", "(", "element", ")", ";", "case", "IJavaElementDelta", ".", "REMOVED", ":", "case", "IJavaElementDelta", ".", "CHANGED", ":", "int", "flags", "=", "delta", ".", "getFlags", "(", ")", ";", "if", "(", "(", "flags", "&", "IJavaElementDelta", ".", "F_ADDED_TO_CLASSPATH", ")", ">", "0", ")", "{", "if", "(", "this", ".", "projectRegion", "!=", "null", ")", "{", "IPackageFragmentRoot", "root", "=", "(", "IPackageFragmentRoot", ")", "element", ";", "IPath", "rootPath", "=", "root", ".", "getPath", "(", ")", ";", "IJavaElement", "[", "]", "elements", "=", "this", ".", "projectRegion", ".", "getElements", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "elements", ".", "length", ";", "i", "++", ")", "{", "JavaProject", "javaProject", "=", "(", "JavaProject", ")", "elements", "[", "i", "]", ";", "try", "{", "IClasspathEntry", "entry", "=", "javaProject", ".", "getClasspathEntryFor", "(", "rootPath", ")", ";", "if", "(", "entry", "!=", "null", ")", "{", "return", "true", ";", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "}", "}", "}", "if", "(", "(", "flags", "&", "IJavaElementDelta", ".", "F_REMOVED_FROM_CLASSPATH", ")", ">", "0", "||", "(", "flags", "&", "IJavaElementDelta", ".", "F_CONTENT", ")", ">", "0", ")", "{", "IJavaElement", "[", "]", "pkgs", "=", "this", ".", "packageRegion", ".", "getElements", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "pkgs", ".", "length", ";", "i", "++", ")", "{", "if", "(", "pkgs", "[", "i", "]", ".", "getParent", "(", ")", ".", "equals", "(", "element", ")", ")", "{", "return", "true", ";", "}", "}", "return", "false", ";", "}", "}", "return", "isAffectedByChildren", "(", "delta", ",", "eventType", ")", ";", "}", "protected", "boolean", "isAffectedByOpenable", "(", "IJavaElementDelta", "delta", ",", "IJavaElement", "element", ",", "int", "eventType", ")", "{", "if", "(", "element", "instanceof", "CompilationUnit", ")", "{", "CompilationUnit", "cu", "=", "(", "CompilationUnit", ")", "element", ";", "ICompilationUnit", "focusCU", "=", "this", ".", "focusType", "!=", "null", "?", "this", ".", "focusType", ".", "getCompilationUnit", "(", ")", ":", "null", ";", "if", "(", "focusCU", "!=", "null", "&&", "focusCU", ".", "getOwner", "(", ")", "!=", "cu", ".", "getOwner", "(", ")", ")", "return", "false", ";", "if", "(", "eventType", "!=", "ElementChangedEvent", ".", "POST_RECONCILE", "&&", "!", "cu", ".", "isPrimary", "(", ")", "&&", "delta", ".", "getKind", "(", ")", "==", "IJavaElementDelta", ".", "ADDED", ")", "return", "false", ";", "ChangeCollector", "collector", "=", "this", ".", "changeCollector", ";", "if", "(", "collector", "==", "null", ")", "{", "collector", "=", "new", "ChangeCollector", "(", "this", ")", ";", "}", "try", "{", "collector", ".", "addChange", "(", "cu", ",", "delta", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "if", "(", "DEBUG", ")", "e", ".", "printStackTrace", "(", ")", ";", "}", "if", "(", "cu", ".", "isWorkingCopy", "(", ")", "&&", "eventType", "==", "ElementChangedEvent", ".", "POST_RECONCILE", ")", "{", "this", ".", "changeCollector", "=", "collector", ";", "return", "false", ";", "}", "else", "{", "return", "collector", ".", "needsRefresh", "(", ")", ";", "}", "}", "else", "if", "(", "element", "instanceof", "ClassFile", ")", "{", "switch", "(", "delta", ".", "getKind", "(", ")", ")", "{", "case", "IJavaElementDelta", ".", "REMOVED", ":", "return", "this", ".", "files", ".", "get", "(", "element", ")", "!=", "null", ";", "case", "IJavaElementDelta", ".", "ADDED", ":", "IType", "type", "=", "(", "(", "ClassFile", ")", "element", ")", ".", "getType", "(", ")", ";", "String", "typeName", "=", "type", ".", "getElementName", "(", ")", ";", "if", "(", "hasSupertype", "(", "typeName", ")", "||", "subtypesIncludeSupertypeOf", "(", "type", ")", "||", "this", ".", "missingTypes", ".", "contains", "(", "typeName", ")", ")", "{", "return", "true", ";", "}", "break", ";", "case", "IJavaElementDelta", ".", "CHANGED", ":", "IJavaElementDelta", "[", "]", "children", "=", "delta", ".", "getAffectedChildren", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "children", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IJavaElementDelta", "child", "=", "children", "[", "i", "]", ";", "IJavaElement", "childElement", "=", "child", ".", "getElement", "(", ")", ";", "if", "(", "childElement", "instanceof", "IType", ")", "{", "type", "=", "(", "IType", ")", "childElement", ";", "boolean", "hasVisibilityChange", "=", "(", "delta", ".", "getFlags", "(", ")", "&", "IJavaElementDelta", ".", "F_MODIFIERS", ")", ">", "0", ";", "boolean", "hasSupertypeChange", "=", "(", "delta", ".", "getFlags", "(", ")", "&", "IJavaElementDelta", ".", "F_SUPER_TYPES", ")", ">", "0", ";", "if", "(", "(", "hasVisibilityChange", "&&", "hasSupertype", "(", "type", ".", "getElementName", "(", ")", ")", ")", "||", "(", "hasSupertypeChange", "&&", "includesTypeOrSupertype", "(", "type", ")", ")", ")", "{", "return", "true", ";", "}", "}", "}", "break", ";", "}", "}", "return", "false", ";", "}", "private", "boolean", "isInterface", "(", "IType", "type", ")", "{", "int", "flags", "=", "getCachedFlags", "(", "type", ")", ";", "if", "(", "flags", "==", "-", "1", ")", "{", "try", "{", "return", "type", ".", "isInterface", "(", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "return", "false", ";", "}", "}", "else", "{", "return", "Flags", ".", "isInterface", "(", "flags", ")", ";", "}", "}", "public", "IJavaProject", "javaProject", "(", ")", "{", "return", "this", ".", "focusType", ".", "getJavaProject", "(", ")", ";", "}", "protected", "static", "byte", "[", "]", "readUntil", "(", "InputStream", "input", ",", "byte", "separator", ")", "throws", "JavaModelException", ",", "IOException", "{", "return", "readUntil", "(", "input", ",", "separator", ",", "0", ")", ";", "}", "protected", "static", "byte", "[", "]", "readUntil", "(", "InputStream", "input", ",", "byte", "separator", ",", "int", "offset", ")", "throws", "IOException", ",", "JavaModelException", "{", "int", "length", "=", "0", ";", "byte", "[", "]", "bytes", "=", "new", "byte", "[", "SIZE", "]", ";", "byte", "b", ";", "while", "(", "(", "b", "=", "(", "byte", ")", "input", ".", "read", "(", ")", ")", "!=", "separator", "&&", "b", "!=", "-", "1", ")", "{", "if", "(", "bytes", ".", "length", "==", "length", ")", "{", "System", ".", "arraycopy", "(", "bytes", ",", "0", ",", "bytes", "=", "new", "byte", "[", "length", "*", "2", "]", ",", "0", ",", "length", ")", ";", "}", "bytes", "[", "length", "++", "]", "=", "b", ";", "}", "if", "(", "b", "==", "-", "1", ")", "{", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IStatus", ".", "ERROR", ")", ")", ";", "}", "System", ".", "arraycopy", "(", "bytes", ",", "0", ",", "bytes", "=", "new", "byte", "[", "length", "+", "offset", "]", ",", "offset", ",", "length", ")", ";", "return", "bytes", ";", "}", "public", "static", "ITypeHierarchy", "load", "(", "IType", "type", ",", "InputStream", "input", ",", "WorkingCopyOwner", "owner", ")", "throws", "JavaModelException", "{", "try", "{", "TypeHierarchy", "typeHierarchy", "=", "new", "TypeHierarchy", "(", ")", ";", "typeHierarchy", ".", "initialize", "(", "1", ")", ";", "IType", "[", "]", "types", "=", "new", "IType", "[", "SIZE", "]", ";", "int", "typeCount", "=", "0", ";", "byte", "version", "=", "(", "byte", ")", "input", ".", "read", "(", ")", ";", "if", "(", "version", "!=", "VERSION", ")", "{", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IStatus", ".", "ERROR", ")", ")", ";", "}", "byte", "generalInfo", "=", "(", "byte", ")", "input", ".", "read", "(", ")", ";", "if", "(", "(", "generalInfo", "&", "COMPUTE_SUBTYPES", ")", "!=", "0", ")", "{", "typeHierarchy", ".", "computeSubtypes", "=", "true", ";", "}", "byte", "b", ";", "byte", "[", "]", "bytes", ";", "bytes", "=", "readUntil", "(", "input", ",", "SEPARATOR1", ")", ";", "if", "(", "bytes", ".", "length", ">", "0", ")", "{", "typeHierarchy", ".", "project", "=", "(", "IJavaProject", ")", "JavaCore", ".", "create", "(", "new", "String", "(", "bytes", ")", ")", ";", "typeHierarchy", ".", "scope", "=", "SearchEngine", ".", "createJavaSearchScope", "(", "new", "IJavaElement", "[", "]", "{", "typeHierarchy", ".", "project", "}", ")", ";", "}", "else", "{", "typeHierarchy", ".", "project", "=", "null", ";", "typeHierarchy", ".", "scope", "=", "SearchEngine", ".", "createWorkspaceScope", "(", ")", ";", "}", "{", "bytes", "=", "readUntil", "(", "input", ",", "SEPARATOR1", ")", ";", "byte", "[", "]", "missing", ";", "int", "j", "=", "0", ";", "int", "length", "=", "bytes", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "b", "=", "bytes", "[", "i", "]", ";", "if", "(", "b", "==", "SEPARATOR2", ")", "{", "missing", "=", "new", "byte", "[", "i", "-", "j", "]", ";", "System", ".", "arraycopy", "(", "bytes", ",", "j", ",", "missing", ",", "0", ",", "i", "-", "j", ")", ";", "typeHierarchy", ".", "missingTypes", ".", "add", "(", "new", "String", "(", "missing", ")", ")", ";", "j", "=", "i", "+", "1", ";", "}", "}", "System", ".", "arraycopy", "(", "bytes", ",", "j", ",", "missing", "=", "new", "byte", "[", "length", "-", "j", "]", ",", "0", ",", "length", "-", "j", ")", ";", "typeHierarchy", ".", "missingTypes", ".", "add", "(", "new", "String", "(", "missing", ")", ")", ";", "}", "while", "(", "(", "b", "=", "(", "byte", ")", "input", ".", "read", "(", ")", ")", "!=", "SEPARATOR1", "&&", "b", "!=", "-", "1", ")", "{", "bytes", "=", "readUntil", "(", "input", ",", "SEPARATOR4", ",", "1", ")", ";", "bytes", "[", "0", "]", "=", "b", ";", "IType", "element", "=", "(", "IType", ")", "JavaCore", ".", "create", "(", "new", "String", "(", "bytes", ")", ",", "owner", ")", ";", "if", "(", "types", ".", "length", "==", "typeCount", ")", "{", "System", ".", "arraycopy", "(", "types", ",", "0", ",", "types", "=", "new", "IType", "[", "typeCount", "*", "2", "]", ",", "0", ",", "typeCount", ")", ";", "}", "types", "[", "typeCount", "++", "]", "=", "element", ";", "bytes", "=", "readUntil", "(", "input", ",", "SEPARATOR4", ")", ";", "Integer", "flags", "=", "bytesToFlags", "(", "bytes", ")", ";", "if", "(", "flags", "!=", "null", ")", "{", "typeHierarchy", ".", "cacheFlags", "(", "element", ",", "flags", ".", "intValue", "(", ")", ")", ";", "}", "byte", "info", "=", "(", "byte", ")", "input", ".", "read", "(", ")", ";", "if", "(", "(", "info", "&", "INTERFACE", ")", "!=", "0", ")", "{", "typeHierarchy", ".", "addInterface", "(", "element", ")", ";", "}", "if", "(", "(", "info", "&", "COMPUTED_FOR", ")", "!=", "0", ")", "{", "if", "(", "!", "element", ".", "equals", "(", "type", ")", ")", "{", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IStatus", ".", "ERROR", ")", ")", ";", "}", "typeHierarchy", ".", "focusType", "=", "element", ";", "}", "if", "(", "(", "info", "&", "ROOT", ")", "!=", "0", ")", "{", "typeHierarchy", ".", "addRootClass", "(", "element", ")", ";", "}", "}", "while", "(", "(", "b", "=", "(", "byte", ")", "input", ".", "read", "(", ")", ")", "!=", "SEPARATOR1", "&&", "b", "!=", "-", "1", ")", "{", "bytes", "=", "readUntil", "(", "input", ",", "SEPARATOR3", ",", "1", ")", ";", "bytes", "[", "0", "]", "=", "b", ";", "int", "subClass", "=", "new", "Integer", "(", "new", "String", "(", "bytes", ")", ")", ".", "intValue", "(", ")", ";", "bytes", "=", "readUntil", "(", "input", ",", "SEPARATOR1", ")", ";", "int", "superClass", "=", "new", "Integer", "(", "new", "String", "(", "bytes", ")", ")", ".", "intValue", "(", ")", ";", "typeHierarchy", ".", "cacheSuperclass", "(", "types", "[", "subClass", "]", ",", "types", "[", "superClass", "]", ")", ";", "}", "while", "(", "(", "b", "=", "(", "byte", ")", "input", ".", "read", "(", ")", ")", "!=", "SEPARATOR1", "&&", "b", "!=", "-", "1", ")", "{", "bytes", "=", "readUntil", "(", "input", ",", "SEPARATOR3", ",", "1", ")", ";", "bytes", "[", "0", "]", "=", "b", ";", "int", "subClass", "=", "new", "Integer", "(", "new", "String", "(", "bytes", ")", ")", ".", "intValue", "(", ")", ";", "bytes", "=", "readUntil", "(", "input", ",", "SEPARATOR1", ")", ";", "IType", "[", "]", "superInterfaces", "=", "new", "IType", "[", "(", "bytes", ".", "length", "/", "2", ")", "+", "1", "]", ";", "int", "interfaceCount", "=", "0", ";", "int", "j", "=", "0", ";", "byte", "[", "]", "b2", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "bytes", ".", "length", ";", "i", "++", ")", "{", "if", "(", "bytes", "[", "i", "]", "==", "SEPARATOR2", ")", "{", "b2", "=", "new", "byte", "[", "i", "-", "j", "]", ";", "System", ".", "arraycopy", "(", "bytes", ",", "j", ",", "b2", ",", "0", ",", "i", "-", "j", ")", ";", "j", "=", "i", "+", "1", ";", "superInterfaces", "[", "interfaceCount", "++", "]", "=", "types", "[", "new", "Integer", "(", "new", "String", "(", "b2", ")", ")", ".", "intValue", "(", ")", "]", ";", "}", "}", "b2", "=", "new", "byte", "[", "bytes", ".", "length", "-", "j", "]", ";", "System", ".", "arraycopy", "(", "bytes", ",", "j", ",", "b2", ",", "0", ",", "bytes", ".", "length", "-", "j", ")", ";", "superInterfaces", "[", "interfaceCount", "++", "]", "=", "types", "[", "new", "Integer", "(", "new", "String", "(", "b2", ")", ")", ".", "intValue", "(", ")", "]", ";", "System", ".", "arraycopy", "(", "superInterfaces", ",", "0", ",", "superInterfaces", "=", "new", "IType", "[", "interfaceCount", "]", ",", "0", ",", "interfaceCount", ")", ";", "typeHierarchy", ".", "cacheSuperInterfaces", "(", "types", "[", "subClass", "]", ",", "superInterfaces", ")", ";", "}", "if", "(", "b", "==", "-", "1", ")", "{", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IStatus", ".", "ERROR", ")", ")", ";", "}", "return", "typeHierarchy", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "JavaModelException", "(", "e", ",", "IJavaModelStatusConstants", ".", "IO_EXCEPTION", ")", ";", "}", "}", "protected", "boolean", "packageRegionContainsSamePackageFragment", "(", "PackageFragment", "element", ")", "{", "IJavaElement", "[", "]", "pkgs", "=", "this", ".", "packageRegion", ".", "getElements", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "pkgs", ".", "length", ";", "i", "++", ")", "{", "PackageFragment", "pkg", "=", "(", "PackageFragment", ")", "pkgs", "[", "i", "]", ";", "if", "(", "Util", ".", "equalArraysOrNull", "(", "pkg", ".", "names", ",", "element", ".", "names", ")", ")", "return", "true", ";", "}", "return", "false", ";", "}", "public", "synchronized", "void", "refresh", "(", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "try", "{", "this", ".", "progressMonitor", "=", "monitor", ";", "if", "(", "monitor", "!=", "null", ")", "{", "monitor", ".", "beginTask", "(", "this", ".", "focusType", "!=", "null", "?", "Messages", ".", "bind", "(", "Messages", ".", "hierarchy_creatingOnType", ",", "this", ".", "focusType", ".", "getFullyQualifiedName", "(", ")", ")", ":", "Messages", ".", "hierarchy_creating", ",", "100", ")", ";", "}", "long", "start", "=", "-", "1", ";", "if", "(", "DEBUG", ")", "{", "start", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "if", "(", "this", ".", "computeSubtypes", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "Thread", ".", "currentThread", "(", ")", "+", "\"]\"", ")", ";", "}", "else", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "Thread", ".", "currentThread", "(", ")", "+", "\"]\"", ")", ";", "}", "if", "(", "this", ".", "focusType", "!=", "null", ")", "{", "System", ".", "out", ".", "println", "(", "\"", "on", "type", "\"", "+", "(", "(", "JavaElement", ")", "this", ".", "focusType", ")", ".", "toStringWithAncestors", "(", ")", ")", ";", "}", "}", "compute", "(", ")", ";", "initializeRegions", "(", ")", ";", "this", ".", "needsRefresh", "=", "false", ";", "this", ".", "changeCollector", "=", "null", ";", "if", "(", "DEBUG", ")", "{", "if", "(", "this", ".", "computeSubtypes", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "(", "System", ".", "currentTimeMillis", "(", ")", "-", "start", ")", "+", "\"ms\"", ")", ";", "}", "else", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "(", "System", ".", "currentTimeMillis", "(", ")", "-", "start", ")", "+", "\"ms\"", ")", ";", "}", "System", ".", "out", ".", "println", "(", "this", ".", "toString", "(", ")", ")", ";", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "throw", "e", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "throw", "new", "JavaModelException", "(", "e", ")", ";", "}", "finally", "{", "if", "(", "monitor", "!=", "null", ")", "{", "monitor", ".", "done", "(", ")", ";", "}", "this", ".", "progressMonitor", "=", "null", ";", "}", "}", "public", "synchronized", "void", "removeTypeHierarchyChangedListener", "(", "ITypeHierarchyChangedListener", "listener", ")", "{", "ArrayList", "listeners", "=", "this", ".", "changeListeners", ";", "if", "(", "listeners", "==", "null", ")", "{", "return", ";", "}", "listeners", ".", "remove", "(", "listener", ")", ";", "if", "(", "listeners", ".", "isEmpty", "(", ")", ")", "{", "JavaCore", ".", "removeElementChangedListener", "(", "this", ")", ";", "}", "}", "public", "void", "store", "(", "OutputStream", "output", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "try", "{", "Hashtable", "hashtable", "=", "new", "Hashtable", "(", ")", ";", "Hashtable", "hashtable2", "=", "new", "Hashtable", "(", ")", ";", "int", "count", "=", "0", ";", "if", "(", "this", ".", "focusType", "!=", "null", ")", "{", "Integer", "index", "=", "new", "Integer", "(", "count", "++", ")", ";", "hashtable", ".", "put", "(", "this", ".", "focusType", ",", "index", ")", ";", "hashtable2", ".", "put", "(", "index", ",", "this", ".", "focusType", ")", ";", "}", "Object", "[", "]", "types", "=", "this", ".", "classToSuperclass", ".", "entrySet", "(", ")", ".", "toArray", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "types", ".", "length", ";", "i", "++", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "types", "[", "i", "]", ";", "Object", "t", "=", "entry", ".", "getKey", "(", ")", ";", "if", "(", "hashtable", ".", "get", "(", "t", ")", "==", "null", ")", "{", "Integer", "index", "=", "new", "Integer", "(", "count", "++", ")", ";", "hashtable", ".", "put", "(", "t", ",", "index", ")", ";", "hashtable2", ".", "put", "(", "index", ",", "t", ")", ";", "}", "Object", "superClass", "=", "entry", ".", "getValue", "(", ")", ";", "if", "(", "superClass", "!=", "null", "&&", "hashtable", ".", "get", "(", "superClass", ")", "==", "null", ")", "{", "Integer", "index", "=", "new", "Integer", "(", "count", "++", ")", ";", "hashtable", ".", "put", "(", "superClass", ",", "index", ")", ";", "hashtable2", ".", "put", "(", "index", ",", "superClass", ")", ";", "}", "}", "types", "=", "this", ".", "typeToSuperInterfaces", ".", "entrySet", "(", ")", ".", "toArray", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "types", ".", "length", ";", "i", "++", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "types", "[", "i", "]", ";", "Object", "t", "=", "entry", ".", "getKey", "(", ")", ";", "if", "(", "hashtable", ".", "get", "(", "t", ")", "==", "null", ")", "{", "Integer", "index", "=", "new", "Integer", "(", "count", "++", ")", ";", "hashtable", ".", "put", "(", "t", ",", "index", ")", ";", "hashtable2", ".", "put", "(", "index", ",", "t", ")", ";", "}", "Object", "[", "]", "sp", "=", "(", "Object", "[", "]", ")", "entry", ".", "getValue", "(", ")", ";", "if", "(", "sp", "!=", "null", ")", "{", "for", "(", "int", "j", "=", "0", ";", "j", "<", "sp", ".", "length", ";", "j", "++", ")", "{", "Object", "superInterface", "=", "sp", "[", "j", "]", ";", "if", "(", "sp", "[", "j", "]", "!=", "null", "&&", "hashtable", ".", "get", "(", "superInterface", ")", "==", "null", ")", "{", "Integer", "index", "=", "new", "Integer", "(", "count", "++", ")", ";", "hashtable", ".", "put", "(", "superInterface", ",", "index", ")", ";", "hashtable2", ".", "put", "(", "index", ",", "superInterface", ")", ";", "}", "}", "}", "}", "output", ".", "write", "(", "VERSION", ")", ";", "byte", "generalInfo", "=", "0", ";", "if", "(", "this", ".", "computeSubtypes", ")", "{", "generalInfo", "|=", "COMPUTE_SUBTYPES", ";", "}", "output", ".", "write", "(", "generalInfo", ")", ";", "if", "(", "this", ".", "project", "!=", "null", ")", "{", "output", ".", "write", "(", "this", ".", "project", ".", "getHandleIdentifier", "(", ")", ".", "getBytes", "(", ")", ")", ";", "}", "output", ".", "write", "(", "SEPARATOR1", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "missingTypes", ".", "size", "(", ")", ";", "i", "++", ")", "{", "if", "(", "i", "!=", "0", ")", "{", "output", ".", "write", "(", "SEPARATOR2", ")", ";", "}", "output", ".", "write", "(", "(", "(", "String", ")", "this", ".", "missingTypes", ".", "get", "(", "i", ")", ")", ".", "getBytes", "(", ")", ")", ";", "}", "output", ".", "write", "(", "SEPARATOR1", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "count", ";", "i", "++", ")", "{", "IType", "t", "=", "(", "IType", ")", "hashtable2", ".", "get", "(", "new", "Integer", "(", "i", ")", ")", ";", "output", ".", "write", "(", "t", ".", "getHandleIdentifier", "(", ")", ".", "getBytes", "(", ")", ")", ";", "output", ".", "write", "(", "SEPARATOR4", ")", ";", "output", ".", "write", "(", "flagsToBytes", "(", "(", "Integer", ")", "this", ".", "typeFlags", ".", "get", "(", "t", ")", ")", ")", ";", "output", ".", "write", "(", "SEPARATOR4", ")", ";", "byte", "info", "=", "CLASS", ";", "if", "(", "this", ".", "focusType", "!=", "null", "&&", "this", ".", "focusType", ".", "equals", "(", "t", ")", ")", "{", "info", "|=", "COMPUTED_FOR", ";", "}", "if", "(", "this", ".", "interfaces", ".", "contains", "(", "t", ")", ")", "{", "info", "|=", "INTERFACE", ";", "}", "if", "(", "this", ".", "rootClasses", ".", "contains", "(", "t", ")", ")", "{", "info", "|=", "ROOT", ";", "}", "output", ".", "write", "(", "info", ")", ";", "}", "output", ".", "write", "(", "SEPARATOR1", ")", ";", "types", "=", "this", ".", "classToSuperclass", ".", "entrySet", "(", ")", ".", "toArray", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "types", ".", "length", ";", "i", "++", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "types", "[", "i", "]", ";", "IJavaElement", "key", "=", "(", "IJavaElement", ")", "entry", ".", "getKey", "(", ")", ";", "IJavaElement", "value", "=", "(", "IJavaElement", ")", "entry", ".", "getValue", "(", ")", ";", "output", ".", "write", "(", "(", "(", "Integer", ")", "hashtable", ".", "get", "(", "key", ")", ")", ".", "toString", "(", ")", ".", "getBytes", "(", ")", ")", ";", "output", ".", "write", "(", "'>'", ")", ";", "output", ".", "write", "(", "(", "(", "Integer", ")", "hashtable", ".", "get", "(", "value", ")", ")", ".", "toString", "(", ")", ".", "getBytes", "(", ")", ")", ";", "output", ".", "write", "(", "SEPARATOR1", ")", ";", "}", "output", ".", "write", "(", "SEPARATOR1", ")", ";", "types", "=", "this", ".", "typeToSuperInterfaces", ".", "entrySet", "(", ")", ".", "toArray", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "types", ".", "length", ";", "i", "++", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "types", "[", "i", "]", ";", "IJavaElement", "key", "=", "(", "IJavaElement", ")", "entry", ".", "getKey", "(", ")", ";", "IJavaElement", "[", "]", "values", "=", "(", "IJavaElement", "[", "]", ")", "entry", ".", "getValue", "(", ")", ";", "if", "(", "values", ".", "length", ">", "0", ")", "{", "output", ".", "write", "(", "(", "(", "Integer", ")", "hashtable", ".", "get", "(", "key", ")", ")", ".", "toString", "(", ")", ".", "getBytes", "(", ")", ")", ";", "output", ".", "write", "(", "SEPARATOR3", ")", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "values", ".", "length", ";", "j", "++", ")", "{", "IJavaElement", "value", "=", "values", "[", "j", "]", ";", "if", "(", "j", "!=", "0", ")", "output", ".", "write", "(", "SEPARATOR2", ")", ";", "output", ".", "write", "(", "(", "(", "Integer", ")", "hashtable", ".", "get", "(", "value", ")", ")", ".", "toString", "(", ")", ".", "getBytes", "(", ")", ")", ";", "}", "output", ".", "write", "(", "SEPARATOR1", ")", ";", "}", "}", "output", ".", "write", "(", "SEPARATOR1", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "JavaModelException", "(", "e", ",", "IJavaModelStatusConstants", ".", "IO_EXCEPTION", ")", ";", "}", "}", "boolean", "subtypesIncludeSupertypeOf", "(", "IType", "type", ")", "{", "String", "superclassName", "=", "null", ";", "try", "{", "superclassName", "=", "type", ".", "getSuperclassName", "(", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "if", "(", "DEBUG", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "return", "false", ";", "}", "if", "(", "superclassName", "==", "null", ")", "{", "superclassName", "=", "\"Object\"", ";", "}", "int", "dot", "=", "-", "1", ";", "String", "simpleSuper", "=", "(", "dot", "=", "superclassName", ".", "lastIndexOf", "(", "'.'", ")", ")", ">", "-", "1", "?", "superclassName", ".", "substring", "(", "dot", "+", "1", ")", ":", "superclassName", ";", "if", "(", "hasSubtypeNamed", "(", "simpleSuper", ")", ")", "{", "return", "true", ";", "}", "String", "[", "]", "interfaceNames", "=", "null", ";", "try", "{", "interfaceNames", "=", "type", ".", "getSuperInterfaceNames", "(", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "if", "(", "DEBUG", ")", "e", ".", "printStackTrace", "(", ")", ";", "return", "false", ";", "}", "for", "(", "int", "i", "=", "0", ",", "length", "=", "interfaceNames", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "dot", "=", "-", "1", ";", "String", "interfaceName", "=", "interfaceNames", "[", "i", "]", ";", "String", "simpleInterface", "=", "(", "dot", "=", "interfaceName", ".", "lastIndexOf", "(", "'.'", ")", ")", ">", "-", "1", "?", "interfaceName", ".", "substring", "(", "dot", ")", ":", "interfaceName", ";", "if", "(", "hasSubtypeNamed", "(", "simpleInterface", ")", ")", "{", "return", "true", ";", "}", "}", "return", "false", ";", "}", "public", "String", "toString", "(", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "buffer", ".", "append", "(", "\"Focus:", "\"", ")", ";", "if", "(", "this", ".", "focusType", "==", "null", ")", "{", "buffer", ".", "append", "(", "\"<NONE>n\"", ")", ";", "}", "else", "{", "toString", "(", "buffer", ",", "this", ".", "focusType", ",", "0", ")", ";", "}", "if", "(", "exists", "(", ")", ")", "{", "if", "(", "this", ".", "focusType", "!=", "null", ")", "{", "buffer", ".", "append", "(", "\"\"", ")", ";", "toString", "(", "buffer", ",", "this", ".", "focusType", ",", "0", ",", "true", ")", ";", "buffer", ".", "append", "(", "\"Sub", "types:n\"", ")", ";", "toString", "(", "buffer", ",", "this", ".", "focusType", ",", "0", ",", "false", ")", ";", "}", "else", "{", "if", "(", "this", ".", "rootClasses", ".", "size", ">", "0", ")", "{", "IJavaElement", "[", "]", "roots", "=", "Util", ".", "sortCopy", "(", "getRootClasses", "(", ")", ")", ";", "buffer", ".", "append", "(", "\"\"", ")", ";", "int", "length", "=", "roots", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IJavaElement", "root", "=", "roots", "[", "i", "]", ";", "toString", "(", "buffer", ",", "root", ",", "1", ")", ";", "toString", "(", "buffer", ",", "root", ",", "1", ",", "true", ")", ";", "}", "buffer", ".", "append", "(", "\"\"", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IJavaElement", "root", "=", "roots", "[", "i", "]", ";", "toString", "(", "buffer", ",", "root", ",", "1", ")", ";", "toString", "(", "buffer", ",", "root", ",", "1", ",", "false", ")", ";", "}", "}", "else", "if", "(", "this", ".", "rootClasses", ".", "size", "==", "0", ")", "{", "buffer", ".", "append", "(", "\"\"", ")", ";", "}", "}", "}", "else", "{", "buffer", ".", "append", "(", "\"\"", ")", ";", "}", "return", "buffer", ".", "toString", "(", ")", ";", "}", "private", "void", "toString", "(", "StringBuffer", "buffer", ",", "IJavaElement", "type", ",", "int", "indent", ",", "boolean", "ascendant", ")", "{", "IType", "[", "]", "types", "=", "ascendant", "?", "getSupertypes", "(", "(", "IType", ")", "type", ")", ":", "getSubtypes", "(", "(", "IType", ")", "type", ")", ";", "IJavaElement", "[", "]", "sortedTypes", "=", "Util", ".", "sortCopy", "(", "types", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "sortedTypes", ".", "length", ";", "i", "++", ")", "{", "toString", "(", "buffer", ",", "sortedTypes", "[", "i", "]", ",", "indent", "+", "1", ")", ";", "toString", "(", "buffer", ",", "sortedTypes", "[", "i", "]", ",", "indent", "+", "1", ",", "ascendant", ")", ";", "}", "}", "private", "void", "toString", "(", "StringBuffer", "buffer", ",", "IJavaElement", "type", ",", "int", "indent", ")", "{", "for", "(", "int", "j", "=", "0", ";", "j", "<", "indent", ";", "j", "++", ")", "{", "buffer", ".", "append", "(", "\"", "\"", ")", ";", "}", "buffer", ".", "append", "(", "(", "(", "JavaElement", ")", "type", ")", ".", "toStringWithAncestors", "(", "false", ")", ")", ";", "buffer", ".", "append", "(", "'\\n'", ")", ";", "}", "boolean", "hasSupertype", "(", "String", "simpleName", ")", "{", "for", "(", "Iterator", "iter", "=", "this", ".", "classToSuperclass", ".", "values", "(", ")", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "IType", "superType", "=", "(", "IType", ")", "iter", ".", "next", "(", ")", ";", "if", "(", "superType", ".", "getElementName", "(", ")", ".", "equals", "(", "simpleName", ")", ")", "{", "return", "true", ";", "}", "}", "return", "false", ";", "}", "protected", "void", "worked", "(", "int", "work", ")", "{", "if", "(", "this", ".", "progressMonitor", "!=", "null", ")", "{", "this", ".", "progressMonitor", ".", "worked", "(", "work", ")", ";", "checkCanceled", "(", ")", ";", "}", "}", "}", "</s>" ]
5,288
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "hierarchy", ";", "import", "java", ".", "util", ".", "*", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElementDelta", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "JavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "SimpleDelta", ";", "public", "class", "ChangeCollector", "{", "HashMap", "changes", "=", "new", "HashMap", "(", ")", ";", "TypeHierarchy", "hierarchy", ";", "public", "ChangeCollector", "(", "TypeHierarchy", "hierarchy", ")", "{", "this", ".", "hierarchy", "=", "hierarchy", ";", "}", "private", "void", "addAffectedChildren", "(", "IJavaElementDelta", "delta", ")", "throws", "JavaModelException", "{", "IJavaElementDelta", "[", "]", "children", "=", "delta", ".", "getAffectedChildren", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "children", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IJavaElementDelta", "child", "=", "children", "[", "i", "]", ";", "IJavaElement", "childElement", "=", "child", ".", "getElement", "(", ")", ";", "switch", "(", "childElement", ".", "getElementType", "(", ")", ")", "{", "case", "IJavaElement", ".", "IMPORT_CONTAINER", ":", "addChange", "(", "(", "IImportContainer", ")", "childElement", ",", "child", ")", ";", "break", ";", "case", "IJavaElement", ".", "IMPORT_DECLARATION", ":", "addChange", "(", "(", "IImportDeclaration", ")", "childElement", ",", "child", ")", ";", "break", ";", "case", "IJavaElement", ".", "TYPE", ":", "addChange", "(", "(", "IType", ")", "childElement", ",", "child", ")", ";", "break", ";", "case", "IJavaElement", ".", "INITIALIZER", ":", "case", "IJavaElement", ".", "FIELD", ":", "case", "IJavaElement", ".", "METHOD", ":", "addChange", "(", "(", "IMember", ")", "childElement", ",", "child", ")", ";", "break", ";", "}", "}", "}", "public", "void", "addChange", "(", "ICompilationUnit", "cu", ",", "IJavaElementDelta", "newDelta", ")", "throws", "JavaModelException", "{", "int", "newKind", "=", "newDelta", ".", "getKind", "(", ")", ";", "switch", "(", "newKind", ")", "{", "case", "IJavaElementDelta", ".", "ADDED", ":", "ArrayList", "allTypes", "=", "new", "ArrayList", "(", ")", ";", "getAllTypesFromElement", "(", "cu", ",", "allTypes", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "allTypes", ".", "size", "(", ")", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IType", "type", "=", "(", "IType", ")", "allTypes", ".", "get", "(", "i", ")", ";", "addTypeAddition", "(", "type", ",", "(", "SimpleDelta", ")", "this", ".", "changes", ".", "get", "(", "type", ")", ")", ";", "}", "break", ";", "case", "IJavaElementDelta", ".", "REMOVED", ":", "allTypes", "=", "new", "ArrayList", "(", ")", ";", "getAllTypesFromHierarchy", "(", "(", "JavaElement", ")", "cu", ",", "allTypes", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "allTypes", ".", "size", "(", ")", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IType", "type", "=", "(", "IType", ")", "allTypes", ".", "get", "(", "i", ")", ";", "addTypeRemoval", "(", "type", ",", "(", "SimpleDelta", ")", "this", ".", "changes", ".", "get", "(", "type", ")", ")", ";", "}", "break", ";", "case", "IJavaElementDelta", ".", "CHANGED", ":", "addAffectedChildren", "(", "newDelta", ")", ";", "break", ";", "}", "}", "private", "void", "addChange", "(", "IImportContainer", "importContainer", ",", "IJavaElementDelta", "newDelta", ")", "throws", "JavaModelException", "{", "int", "newKind", "=", "newDelta", ".", "getKind", "(", ")", ";", "if", "(", "newKind", "==", "IJavaElementDelta", ".", "CHANGED", ")", "{", "addAffectedChildren", "(", "newDelta", ")", ";", "return", ";", "}", "SimpleDelta", "existingDelta", "=", "(", "SimpleDelta", ")", "this", ".", "changes", ".", "get", "(", "importContainer", ")", ";", "if", "(", "existingDelta", "!=", "null", ")", "{", "switch", "(", "newKind", ")", "{", "case", "IJavaElementDelta", ".", "ADDED", ":", "if", "(", "existingDelta", ".", "getKind", "(", ")", "==", "IJavaElementDelta", ".", "REMOVED", ")", "{", "this", ".", "changes", ".", "remove", "(", "importContainer", ")", ";", "}", "break", ";", "case", "IJavaElementDelta", ".", "REMOVED", ":", "if", "(", "existingDelta", ".", "getKind", "(", ")", "==", "IJavaElementDelta", ".", "ADDED", ")", "{", "this", ".", "changes", ".", "remove", "(", "importContainer", ")", ";", "}", "break", ";", "}", "}", "else", "{", "SimpleDelta", "delta", "=", "new", "SimpleDelta", "(", ")", ";", "switch", "(", "newKind", ")", "{", "case", "IJavaElementDelta", ".", "ADDED", ":", "delta", ".", "added", "(", ")", ";", "break", ";", "case", "IJavaElementDelta", ".", "REMOVED", ":", "delta", ".", "removed", "(", ")", ";", "break", ";", "}", "this", ".", "changes", ".", "put", "(", "importContainer", ",", "delta", ")", ";", "}", "}", "private", "void", "addChange", "(", "IImportDeclaration", "importDecl", ",", "IJavaElementDelta", "newDelta", ")", "{", "SimpleDelta", "existingDelta", "=", "(", "SimpleDelta", ")", "this", ".", "changes", ".", "get", "(", "importDecl", ")", ";", "int", "newKind", "=", "newDelta", ".", "getKind", "(", ")", ";", "if", "(", "existingDelta", "!=", "null", ")", "{", "switch", "(", "newKind", ")", "{", "case", "IJavaElementDelta", ".", "ADDED", ":", "if", "(", "existingDelta", ".", "getKind", "(", ")", "==", "IJavaElementDelta", ".", "REMOVED", ")", "{", "this", ".", "changes", ".", "remove", "(", "importDecl", ")", ";", "}", "break", ";", "case", "IJavaElementDelta", ".", "REMOVED", ":", "if", "(", "existingDelta", ".", "getKind", "(", ")", "==", "IJavaElementDelta", ".", "ADDED", ")", "{", "this", ".", "changes", ".", "remove", "(", "importDecl", ")", ";", "}", "break", ";", "}", "}", "else", "{", "SimpleDelta", "delta", "=", "new", "SimpleDelta", "(", ")", ";", "switch", "(", "newKind", ")", "{", "case", "IJavaElementDelta", ".", "ADDED", ":", "delta", ".", "added", "(", ")", ";", "break", ";", "case", "IJavaElementDelta", ".", "REMOVED", ":", "delta", ".", "removed", "(", ")", ";", "break", ";", "}", "this", ".", "changes", ".", "put", "(", "importDecl", ",", "delta", ")", ";", "}", "}", "private", "void", "addChange", "(", "IMember", "member", ",", "IJavaElementDelta", "newDelta", ")", "throws", "JavaModelException", "{", "int", "newKind", "=", "newDelta", ".", "getKind", "(", ")", ";", "switch", "(", "newKind", ")", "{", "case", "IJavaElementDelta", ".", "ADDED", ":", "ArrayList", "allTypes", "=", "new", "ArrayList", "(", ")", ";", "getAllTypesFromElement", "(", "member", ",", "allTypes", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "allTypes", ".", "size", "(", ")", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IType", "innerType", "=", "(", "IType", ")", "allTypes", ".", "get", "(", "i", ")", ";", "addTypeAddition", "(", "innerType", ",", "(", "SimpleDelta", ")", "this", ".", "changes", ".", "get", "(", "innerType", ")", ")", ";", "}", "break", ";", "case", "IJavaElementDelta", ".", "REMOVED", ":", "allTypes", "=", "new", "ArrayList", "(", ")", ";", "getAllTypesFromHierarchy", "(", "(", "JavaElement", ")", "member", ",", "allTypes", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "allTypes", ".", "size", "(", ")", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IType", "type", "=", "(", "IType", ")", "allTypes", ".", "get", "(", "i", ")", ";", "addTypeRemoval", "(", "type", ",", "(", "SimpleDelta", ")", "this", ".", "changes", ".", "get", "(", "type", ")", ")", ";", "}", "break", ";", "case", "IJavaElementDelta", ".", "CHANGED", ":", "addAffectedChildren", "(", "newDelta", ")", ";", "break", ";", "}", "}", "private", "void", "addChange", "(", "IType", "type", ",", "IJavaElementDelta", "newDelta", ")", "throws", "JavaModelException", "{", "int", "newKind", "=", "newDelta", ".", "getKind", "(", ")", ";", "SimpleDelta", "existingDelta", "=", "(", "SimpleDelta", ")", "this", ".", "changes", ".", "get", "(", "type", ")", ";", "switch", "(", "newKind", ")", "{", "case", "IJavaElementDelta", ".", "ADDED", ":", "addTypeAddition", "(", "type", ",", "existingDelta", ")", ";", "ArrayList", "allTypes", "=", "new", "ArrayList", "(", ")", ";", "getAllTypesFromElement", "(", "type", ",", "allTypes", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "allTypes", ".", "size", "(", ")", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IType", "innerType", "=", "(", "IType", ")", "allTypes", ".", "get", "(", "i", ")", ";", "addTypeAddition", "(", "innerType", ",", "(", "SimpleDelta", ")", "this", ".", "changes", ".", "get", "(", "innerType", ")", ")", ";", "}", "break", ";", "case", "IJavaElementDelta", ".", "REMOVED", ":", "addTypeRemoval", "(", "type", ",", "existingDelta", ")", ";", "allTypes", "=", "new", "ArrayList", "(", ")", ";", "getAllTypesFromHierarchy", "(", "(", "JavaElement", ")", "type", ",", "allTypes", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "allTypes", ".", "size", "(", ")", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IType", "innerType", "=", "(", "IType", ")", "allTypes", ".", "get", "(", "i", ")", ";", "addTypeRemoval", "(", "innerType", ",", "(", "SimpleDelta", ")", "this", ".", "changes", ".", "get", "(", "innerType", ")", ")", ";", "}", "break", ";", "case", "IJavaElementDelta", ".", "CHANGED", ":", "addTypeChange", "(", "type", ",", "newDelta", ".", "getFlags", "(", ")", ",", "existingDelta", ")", ";", "addAffectedChildren", "(", "newDelta", ")", ";", "break", ";", "}", "}", "private", "void", "addTypeAddition", "(", "IType", "type", ",", "SimpleDelta", "existingDelta", ")", "throws", "JavaModelException", "{", "if", "(", "existingDelta", "!=", "null", ")", "{", "switch", "(", "existingDelta", ".", "getKind", "(", ")", ")", "{", "case", "IJavaElementDelta", ".", "REMOVED", ":", "boolean", "hasChange", "=", "false", ";", "if", "(", "hasSuperTypeChange", "(", "type", ")", ")", "{", "existingDelta", ".", "superTypes", "(", ")", ";", "hasChange", "=", "true", ";", "}", "if", "(", "hasVisibilityChange", "(", "type", ")", ")", "{", "existingDelta", ".", "modifiers", "(", ")", ";", "hasChange", "=", "true", ";", "}", "if", "(", "!", "hasChange", ")", "{", "this", ".", "changes", ".", "remove", "(", "type", ")", ";", "}", "break", ";", "}", "}", "else", "{", "String", "typeName", "=", "type", ".", "getElementName", "(", ")", ";", "if", "(", "this", ".", "hierarchy", ".", "hasSupertype", "(", "typeName", ")", "||", "this", ".", "hierarchy", ".", "subtypesIncludeSupertypeOf", "(", "type", ")", "||", "this", ".", "hierarchy", ".", "missingTypes", ".", "contains", "(", "typeName", ")", ")", "{", "SimpleDelta", "delta", "=", "new", "SimpleDelta", "(", ")", ";", "delta", ".", "added", "(", ")", ";", "this", ".", "changes", ".", "put", "(", "type", ",", "delta", ")", ";", "}", "}", "}", "private", "void", "addTypeChange", "(", "IType", "type", ",", "int", "newFlags", ",", "SimpleDelta", "existingDelta", ")", "throws", "JavaModelException", "{", "if", "(", "existingDelta", "!=", "null", ")", "{", "switch", "(", "existingDelta", ".", "getKind", "(", ")", ")", "{", "case", "IJavaElementDelta", ".", "CHANGED", ":", "int", "existingFlags", "=", "existingDelta", ".", "getFlags", "(", ")", ";", "boolean", "hasChange", "=", "false", ";", "if", "(", "(", "existingFlags", "&", "IJavaElementDelta", ".", "F_SUPER_TYPES", ")", "!=", "0", "&&", "hasSuperTypeChange", "(", "type", ")", ")", "{", "existingDelta", ".", "superTypes", "(", ")", ";", "hasChange", "=", "true", ";", "}", "if", "(", "(", "existingFlags", "&", "IJavaElementDelta", ".", "F_MODIFIERS", ")", "!=", "0", "&&", "hasVisibilityChange", "(", "type", ")", ")", "{", "existingDelta", ".", "modifiers", "(", ")", ";", "hasChange", "=", "true", ";", "}", "if", "(", "!", "hasChange", ")", "{", "this", ".", "changes", ".", "remove", "(", "type", ")", ";", "}", "break", ";", "}", "}", "else", "{", "SimpleDelta", "typeDelta", "=", "null", ";", "if", "(", "(", "newFlags", "&", "IJavaElementDelta", ".", "F_SUPER_TYPES", ")", "!=", "0", "&&", "this", ".", "hierarchy", ".", "includesTypeOrSupertype", "(", "type", ")", ")", "{", "typeDelta", "=", "new", "SimpleDelta", "(", ")", ";", "typeDelta", ".", "superTypes", "(", ")", ";", "}", "if", "(", "(", "newFlags", "&", "IJavaElementDelta", ".", "F_MODIFIERS", ")", "!=", "0", "&&", "(", "this", ".", "hierarchy", ".", "hasSupertype", "(", "type", ".", "getElementName", "(", ")", ")", "||", "type", ".", "equals", "(", "this", ".", "hierarchy", ".", "focusType", ")", ")", ")", "{", "if", "(", "typeDelta", "==", "null", ")", "{", "typeDelta", "=", "new", "SimpleDelta", "(", ")", ";", "}", "typeDelta", ".", "modifiers", "(", ")", ";", "}", "if", "(", "typeDelta", "!=", "null", ")", "{", "this", ".", "changes", ".", "put", "(", "type", ",", "typeDelta", ")", ";", "}", "}", "}", "private", "void", "addTypeRemoval", "(", "IType", "type", ",", "SimpleDelta", "existingDelta", ")", "{", "if", "(", "existingDelta", "!=", "null", ")", "{", "switch", "(", "existingDelta", ".", "getKind", "(", ")", ")", "{", "case", "IJavaElementDelta", ".", "ADDED", ":", "this", ".", "changes", ".", "remove", "(", "type", ")", ";", "break", ";", "case", "IJavaElementDelta", ".", "CHANGED", ":", "existingDelta", ".", "removed", "(", ")", ";", "break", ";", "}", "}", "else", "{", "if", "(", "this", ".", "hierarchy", ".", "contains", "(", "type", ")", ")", "{", "SimpleDelta", "typeDelta", "=", "new", "SimpleDelta", "(", ")", ";", "typeDelta", ".", "removed", "(", ")", ";", "this", ".", "changes", ".", "put", "(", "type", ",", "typeDelta", ")", ";", "}", "}", "}", "private", "void", "getAllTypesFromElement", "(", "IJavaElement", "element", ",", "ArrayList", "allTypes", ")", "throws", "JavaModelException", "{", "switch", "(", "element", ".", "getElementType", "(", ")", ")", "{", "case", "IJavaElement", ".", "COMPILATION_UNIT", ":", "IType", "[", "]", "types", "=", "(", "(", "ICompilationUnit", ")", "element", ")", ".", "getTypes", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "types", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IType", "type", "=", "types", "[", "i", "]", ";", "allTypes", ".", "add", "(", "type", ")", ";", "getAllTypesFromElement", "(", "type", ",", "allTypes", ")", ";", "}", "break", ";", "case", "IJavaElement", ".", "TYPE", ":", "types", "=", "(", "(", "IType", ")", "element", ")", ".", "getTypes", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "types", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IType", "type", "=", "types", "[", "i", "]", ";", "allTypes", ".", "add", "(", "type", ")", ";", "getAllTypesFromElement", "(", "type", ",", "allTypes", ")", ";", "}", "break", ";", "case", "IJavaElement", ".", "INITIALIZER", ":", "case", "IJavaElement", ".", "FIELD", ":", "case", "IJavaElement", ".", "METHOD", ":", "IJavaElement", "[", "]", "children", "=", "(", "(", "IMember", ")", "element", ")", ".", "getChildren", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "children", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IType", "type", "=", "(", "IType", ")", "children", "[", "i", "]", ";", "allTypes", ".", "add", "(", "type", ")", ";", "getAllTypesFromElement", "(", "type", ",", "allTypes", ")", ";", "}", "break", ";", "}", "}", "private", "void", "getAllTypesFromHierarchy", "(", "JavaElement", "element", ",", "ArrayList", "allTypes", ")", "{", "switch", "(", "element", ".", "getElementType", "(", ")", ")", "{", "case", "IJavaElement", ".", "COMPILATION_UNIT", ":", "ArrayList", "types", "=", "(", "ArrayList", ")", "this", ".", "hierarchy", ".", "files", ".", "get", "(", "element", ")", ";", "if", "(", "types", "!=", "null", ")", "{", "allTypes", ".", "addAll", "(", "types", ")", ";", "}", "break", ";", "case", "IJavaElement", ".", "TYPE", ":", "case", "IJavaElement", ".", "INITIALIZER", ":", "case", "IJavaElement", ".", "FIELD", ":", "case", "IJavaElement", ".", "METHOD", ":", "types", "=", "(", "ArrayList", ")", "this", ".", "hierarchy", ".", "files", ".", "get", "(", "(", "(", "IMember", ")", "element", ")", ".", "getCompilationUnit", "(", ")", ")", ";", "if", "(", "types", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ",", "length", "=", "types", ".", "size", "(", ")", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IType", "type", "=", "(", "IType", ")", "types", ".", "get", "(", "i", ")", ";", "if", "(", "element", ".", "isAncestorOf", "(", "type", ")", ")", "{", "allTypes", ".", "add", "(", "type", ")", ";", "}", "}", "}", "break", ";", "}", "}", "private", "boolean", "hasSuperTypeChange", "(", "IType", "type", ")", "throws", "JavaModelException", "{", "IType", "superclass", "=", "this", ".", "hierarchy", ".", "getSuperclass", "(", "type", ")", ";", "String", "existingSuperclassName", "=", "superclass", "==", "null", "?", "null", ":", "superclass", ".", "getElementName", "(", ")", ";", "String", "newSuperclassName", "=", "type", ".", "getSuperclassName", "(", ")", ";", "if", "(", "existingSuperclassName", "!=", "null", "&&", "!", "existingSuperclassName", ".", "equals", "(", "newSuperclassName", ")", ")", "{", "return", "true", ";", "}", "IType", "[", "]", "existingSuperInterfaces", "=", "this", ".", "hierarchy", ".", "getSuperInterfaces", "(", "type", ")", ";", "String", "[", "]", "newSuperInterfaces", "=", "type", ".", "getSuperInterfaceNames", "(", ")", ";", "if", "(", "existingSuperInterfaces", ".", "length", "!=", "newSuperInterfaces", ".", "length", ")", "{", "return", "true", ";", "}", "for", "(", "int", "i", "=", "0", ",", "length", "=", "newSuperInterfaces", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "String", "superInterfaceName", "=", "newSuperInterfaces", "[", "i", "]", ";", "if", "(", "!", "superInterfaceName", ".", "equals", "(", "newSuperInterfaces", "[", "i", "]", ")", ")", "{", "return", "true", ";", "}", "}", "return", "false", ";", "}", "private", "boolean", "hasVisibilityChange", "(", "IType", "type", ")", "throws", "JavaModelException", "{", "int", "existingFlags", "=", "this", ".", "hierarchy", ".", "getCachedFlags", "(", "type", ")", ";", "int", "newFlags", "=", "type", ".", "getFlags", "(", ")", ";", "return", "existingFlags", "!=", "newFlags", ";", "}", "public", "boolean", "needsRefresh", "(", ")", "{", "return", "this", ".", "changes", ".", "size", "(", ")", "!=", "0", ";", "}", "public", "String", "toString", "(", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "Iterator", "iterator", "=", "this", ".", "changes", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "iterator", ".", "next", "(", ")", ";", "buffer", ".", "append", "(", "(", "(", "JavaElement", ")", "entry", ".", "getKey", "(", ")", ")", ".", "toDebugString", "(", ")", ")", ";", "buffer", ".", "append", "(", "entry", ".", "getValue", "(", ")", ")", ";", "if", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "buffer", ".", "append", "(", "'\\n'", ")", ";", "}", "}", "return", "buffer", ".", "toString", "(", ")", ";", "}", "}", "</s>" ]
5,289
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "hierarchy", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IFile", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "OperationCanceledException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ".", "CompilerUtils", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TypeDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "IBinaryType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "IGenericType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ReferenceBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "problem", ".", "DefaultProblemFactory", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "ResourceCompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "abstract", "class", "HierarchyBuilder", "{", "protected", "TypeHierarchy", "hierarchy", ";", "protected", "NameLookup", "nameLookup", ";", "protected", "HierarchyResolver", "hierarchyResolver", ";", "protected", "Map", "infoToHandle", ";", "protected", "String", "focusQualifiedName", ";", "public", "HierarchyBuilder", "(", "TypeHierarchy", "hierarchy", ")", "throws", "JavaModelException", "{", "this", ".", "hierarchy", "=", "hierarchy", ";", "JavaProject", "project", "=", "(", "JavaProject", ")", "hierarchy", ".", "javaProject", "(", ")", ";", "IType", "focusType", "=", "hierarchy", ".", "getType", "(", ")", ";", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", "unitToLookInside", "=", "focusType", "==", "null", "?", "null", ":", "focusType", ".", "getCompilationUnit", "(", ")", ";", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", "[", "]", "workingCopies", "=", "this", ".", "hierarchy", ".", "workingCopies", ";", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", "[", "]", "unitsToLookInside", ";", "if", "(", "unitToLookInside", "!=", "null", ")", "{", "int", "wcLength", "=", "workingCopies", "==", "null", "?", "0", ":", "workingCopies", ".", "length", ";", "if", "(", "wcLength", "==", "0", ")", "{", "unitsToLookInside", "=", "new", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", "[", "]", "{", "unitToLookInside", "}", ";", "}", "else", "{", "unitsToLookInside", "=", "new", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", "[", "wcLength", "+", "1", "]", ";", "unitsToLookInside", "[", "0", "]", "=", "unitToLookInside", ";", "System", ".", "arraycopy", "(", "workingCopies", ",", "0", ",", "unitsToLookInside", ",", "1", ",", "wcLength", ")", ";", "}", "}", "else", "{", "unitsToLookInside", "=", "workingCopies", ";", "}", "if", "(", "project", "!=", "null", ")", "{", "Map", "optionMap", "=", "project", ".", "getOptions", "(", "true", ")", ";", "CompilerUtils", ".", "configureOptionsBasedOnNature", "(", "optionMap", ",", "project", ")", ";", "SearchableEnvironment", "searchableEnvironment", "=", "project", ".", "newSearchableNameEnvironment", "(", "unitsToLookInside", ")", ";", "this", ".", "nameLookup", "=", "searchableEnvironment", ".", "nameLookup", ";", "this", ".", "hierarchyResolver", "=", "new", "HierarchyResolver", "(", "searchableEnvironment", ",", "optionMap", ",", "this", ",", "new", "DefaultProblemFactory", "(", ")", ")", ";", "}", "this", ".", "infoToHandle", "=", "new", "HashMap", "(", "5", ")", ";", "this", ".", "focusQualifiedName", "=", "focusType", "==", "null", "?", "null", ":", "focusType", ".", "getFullyQualifiedName", "(", ")", ";", "}", "public", "abstract", "void", "build", "(", "boolean", "computeSubtypes", ")", "throws", "JavaModelException", ",", "CoreException", ";", "protected", "void", "buildSupertypes", "(", ")", "{", "IType", "focusType", "=", "getType", "(", ")", ";", "if", "(", "focusType", "==", "null", ")", "return", ";", "IGenericType", "type", ";", "try", "{", "type", "=", "(", "IGenericType", ")", "(", "(", "JavaElement", ")", "focusType", ")", ".", "getElementInfo", "(", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "return", ";", "}", "this", ".", "hierarchyResolver", ".", "resolve", "(", "type", ")", ";", "if", "(", "!", "this", ".", "hierarchy", ".", "contains", "(", "focusType", ")", ")", "{", "this", ".", "hierarchy", ".", "addRootClass", "(", "focusType", ")", ";", "}", "}", "public", "void", "connect", "(", "IGenericType", "type", ",", "IType", "typeHandle", ",", "IType", "superclassHandle", ",", "IType", "[", "]", "superinterfaceHandles", ")", "{", "if", "(", "typeHandle", "==", "null", ")", "return", ";", "if", "(", "TypeHierarchy", ".", "DEBUG", ")", "{", "System", ".", "out", ".", "println", "(", "\"Connecting:", "\"", "+", "(", "(", "JavaElement", ")", "typeHandle", ")", ".", "toStringWithAncestors", "(", ")", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", "+", "(", "superclassHandle", "==", "null", "?", "\"<None>\"", ":", "(", "(", "JavaElement", ")", "superclassHandle", ")", ".", "toStringWithAncestors", "(", ")", ")", ")", ";", "System", ".", "out", ".", "print", "(", "\"\"", ")", ";", "if", "(", "superinterfaceHandles", "==", "null", "||", "superinterfaceHandles", ".", "length", "==", "0", ")", "{", "System", ".", "out", ".", "println", "(", "\"", "<None>\"", ")", ";", "}", "else", "{", "System", ".", "out", ".", "println", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "superinterfaceHandles", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "if", "(", "superinterfaceHandles", "[", "i", "]", "==", "null", ")", "continue", ";", "System", ".", "out", ".", "println", "(", "\"", "\"", "+", "(", "(", "JavaElement", ")", "superinterfaceHandles", "[", "i", "]", ")", ".", "toStringWithAncestors", "(", ")", ")", ";", "}", "}", "}", "switch", "(", "TypeDeclaration", ".", "kind", "(", "type", ".", "getModifiers", "(", ")", ")", ")", "{", "case", "TypeDeclaration", ".", "CLASS_DECL", ":", "case", "TypeDeclaration", ".", "ENUM_DECL", ":", "if", "(", "superclassHandle", "==", "null", ")", "{", "this", ".", "hierarchy", ".", "addRootClass", "(", "typeHandle", ")", ";", "}", "else", "{", "this", ".", "hierarchy", ".", "cacheSuperclass", "(", "typeHandle", ",", "superclassHandle", ")", ";", "}", "break", ";", "case", "TypeDeclaration", ".", "INTERFACE_DECL", ":", "case", "TypeDeclaration", ".", "ANNOTATION_TYPE_DECL", ":", "this", ".", "hierarchy", ".", "addInterface", "(", "typeHandle", ")", ";", "break", ";", "}", "if", "(", "superinterfaceHandles", "==", "null", ")", "{", "superinterfaceHandles", "=", "TypeHierarchy", ".", "NO_TYPE", ";", "}", "this", ".", "hierarchy", ".", "cacheSuperInterfaces", "(", "typeHandle", ",", "superinterfaceHandles", ")", ";", "this", ".", "hierarchy", ".", "cacheFlags", "(", "typeHandle", ",", "type", ".", "getModifiers", "(", ")", ")", ";", "}", "protected", "IType", "getHandle", "(", "IGenericType", "genericType", ",", "ReferenceBinding", "binding", ")", "{", "if", "(", "genericType", "==", "null", ")", "return", "null", ";", "if", "(", "genericType", "instanceof", "HierarchyType", ")", "{", "IType", "handle", "=", "(", "IType", ")", "this", ".", "infoToHandle", ".", "get", "(", "genericType", ")", ";", "if", "(", "handle", "==", "null", ")", "{", "handle", "=", "(", "(", "HierarchyType", ")", "genericType", ")", ".", "typeHandle", ";", "handle", "=", "(", "IType", ")", "(", "(", "JavaElement", ")", "handle", ")", ".", "resolved", "(", "binding", ")", ";", "this", ".", "infoToHandle", ".", "put", "(", "genericType", ",", "handle", ")", ";", "}", "return", "handle", ";", "}", "else", "if", "(", "genericType", ".", "isBinaryType", "(", ")", ")", "{", "ClassFile", "classFile", "=", "(", "ClassFile", ")", "this", ".", "infoToHandle", ".", "get", "(", "genericType", ")", ";", "if", "(", "classFile", "==", "null", ")", "{", "IType", "handle", "=", "lookupBinaryHandle", "(", "(", "IBinaryType", ")", "genericType", ")", ";", "if", "(", "handle", "==", "null", ")", "return", "null", ";", "classFile", "=", "(", "ClassFile", ")", "handle", ".", "getParent", "(", ")", ";", "this", ".", "infoToHandle", ".", "put", "(", "genericType", ",", "classFile", ")", ";", "}", "return", "new", "ResolvedBinaryType", "(", "classFile", ",", "classFile", ".", "getTypeName", "(", ")", ",", "new", "String", "(", "binding", ".", "computeUniqueKey", "(", ")", ")", ")", ";", "}", "else", "if", "(", "genericType", "instanceof", "SourceTypeElementInfo", ")", "{", "IType", "handle", "=", "(", "(", "SourceTypeElementInfo", ")", "genericType", ")", ".", "getHandle", "(", ")", ";", "return", "(", "IType", ")", "(", "(", "JavaElement", ")", "handle", ")", ".", "resolved", "(", "binding", ")", ";", "}", "else", "return", "null", ";", "}", "protected", "IType", "getType", "(", ")", "{", "return", "this", ".", "hierarchy", ".", "getType", "(", ")", ";", "}", "protected", "IType", "lookupBinaryHandle", "(", "IBinaryType", "typeInfo", ")", "{", "int", "flag", ";", "String", "qualifiedName", ";", "switch", "(", "TypeDeclaration", ".", "kind", "(", "typeInfo", ".", "getModifiers", "(", ")", ")", ")", "{", "case", "TypeDeclaration", ".", "CLASS_DECL", ":", "flag", "=", "NameLookup", ".", "ACCEPT_CLASSES", ";", "break", ";", "case", "TypeDeclaration", ".", "INTERFACE_DECL", ":", "flag", "=", "NameLookup", ".", "ACCEPT_INTERFACES", ";", "break", ";", "case", "TypeDeclaration", ".", "ENUM_DECL", ":", "flag", "=", "NameLookup", ".", "ACCEPT_ENUMS", ";", "break", ";", "default", ":", "flag", "=", "NameLookup", ".", "ACCEPT_ANNOTATIONS", ";", "break", ";", "}", "char", "[", "]", "bName", "=", "typeInfo", ".", "getName", "(", ")", ";", "qualifiedName", "=", "new", "String", "(", "ClassFile", ".", "translatedName", "(", "bName", ")", ")", ";", "if", "(", "qualifiedName", ".", "equals", "(", "this", ".", "focusQualifiedName", ")", ")", "return", "getType", "(", ")", ";", "NameLookup", ".", "Answer", "answer", "=", "this", ".", "nameLookup", ".", "findType", "(", "qualifiedName", ",", "false", ",", "flag", ",", "true", ",", "false", ",", "false", ",", "null", ")", ";", "return", "answer", "==", "null", "||", "answer", ".", "type", "==", "null", "||", "!", "answer", ".", "type", ".", "isBinary", "(", ")", "?", "null", ":", "answer", ".", "type", ";", "}", "protected", "void", "worked", "(", "IProgressMonitor", "monitor", ",", "int", "work", ")", "{", "if", "(", "monitor", "!=", "null", ")", "{", "if", "(", "monitor", ".", "isCanceled", "(", ")", ")", "{", "throw", "new", "OperationCanceledException", "(", ")", ";", "}", "else", "{", "monitor", ".", "worked", "(", "work", ")", ";", "}", "}", "}", "protected", "ICompilationUnit", "createCompilationUnitFromPath", "(", "Openable", "handle", ",", "IFile", "file", ")", "{", "final", "char", "[", "]", "elementName", "=", "handle", ".", "getElementName", "(", ")", ".", "toCharArray", "(", ")", ";", "return", "new", "ResourceCompilationUnit", "(", "file", ",", "file", ".", "getLocationURI", "(", ")", ")", "{", "public", "char", "[", "]", "getFileName", "(", ")", "{", "return", "elementName", ";", "}", "}", ";", "}", "protected", "IBinaryType", "createInfoFromClassFile", "(", "Openable", "handle", ",", "IResource", "file", ")", "{", "IBinaryType", "info", "=", "null", ";", "try", "{", "info", "=", "Util", ".", "newClassFileReader", "(", "file", ")", ";", "}", "catch", "(", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFormatException", "e", ")", "{", "if", "(", "TypeHierarchy", ".", "DEBUG", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "return", "null", ";", "}", "catch", "(", "java", ".", "io", ".", "IOException", "e", ")", "{", "if", "(", "TypeHierarchy", ".", "DEBUG", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "return", "null", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "if", "(", "TypeHierarchy", ".", "DEBUG", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "return", "null", ";", "}", "this", ".", "infoToHandle", ".", "put", "(", "info", ",", "handle", ")", ";", "return", "info", ";", "}", "protected", "IBinaryType", "createInfoFromClassFileInJar", "(", "Openable", "classFile", ")", "{", "PackageFragment", "pkg", "=", "(", "PackageFragment", ")", "classFile", ".", "getParent", "(", ")", ";", "String", "classFilePath", "=", "Util", ".", "concatWith", "(", "pkg", ".", "names", ",", "classFile", ".", "getElementName", "(", ")", ",", "'/'", ")", ";", "IBinaryType", "info", "=", "null", ";", "java", ".", "util", ".", "zip", ".", "ZipFile", "zipFile", "=", "null", ";", "try", "{", "zipFile", "=", "(", "(", "JarPackageFragmentRoot", ")", "pkg", ".", "getParent", "(", ")", ")", ".", "getJar", "(", ")", ";", "info", "=", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileReader", ".", "read", "(", "zipFile", ",", "classFilePath", ")", ";", "}", "catch", "(", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFormatException", "e", ")", "{", "if", "(", "TypeHierarchy", ".", "DEBUG", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "return", "null", ";", "}", "catch", "(", "java", ".", "io", ".", "IOException", "e", ")", "{", "if", "(", "TypeHierarchy", ".", "DEBUG", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "return", "null", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "if", "(", "TypeHierarchy", ".", "DEBUG", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "return", "null", ";", "}", "finally", "{", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "closeZipFile", "(", "zipFile", ")", ";", "}", "this", ".", "infoToHandle", ".", "put", "(", "info", ",", "classFile", ")", ";", "return", "info", ";", "}", "}", "</s>" ]
5,290
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "hierarchy", ";", "import", "java", ".", "util", ".", "*", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IFile", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "NullProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "SubProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "search", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "AccessRuleSet", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "IBinaryType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "problem", ".", "DefaultProblemFactory", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "HashtableOfObject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "HashtableOfObjectToInt", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "SuffixConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "IndexQueryRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "JavaSearchParticipant", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "SubTypeSearchJob", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "indexing", ".", "IIndexConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "indexing", ".", "IndexManager", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "matching", ".", "MatchLocator", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "matching", ".", "SuperTypeReferencePattern", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "HandleFactory", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "IndexBasedHierarchyBuilder", "extends", "HierarchyBuilder", "implements", "SuffixConstants", "{", "public", "static", "final", "int", "MAXTICKS", "=", "800", ";", "protected", "Map", "cuToHandle", ";", "protected", "IJavaSearchScope", "scope", ";", "protected", "Map", "binariesFromIndexMatches", ";", "static", "class", "Queue", "{", "public", "char", "[", "]", "[", "]", "names", "=", "new", "char", "[", "10", "]", "[", "]", ";", "public", "int", "start", "=", "0", ";", "public", "int", "end", "=", "-", "1", ";", "public", "void", "add", "(", "char", "[", "]", "name", ")", "{", "if", "(", "++", "this", ".", "end", "==", "this", ".", "names", ".", "length", ")", "{", "this", ".", "end", "-=", "this", ".", "start", ";", "System", ".", "arraycopy", "(", "this", ".", "names", ",", "this", ".", "start", ",", "this", ".", "names", "=", "new", "char", "[", "this", ".", "end", "*", "2", "]", "[", "]", ",", "0", ",", "this", ".", "end", ")", ";", "this", ".", "start", "=", "0", ";", "}", "this", ".", "names", "[", "this", ".", "end", "]", "=", "name", ";", "}", "public", "char", "[", "]", "retrieve", "(", ")", "{", "if", "(", "this", ".", "start", ">", "this", ".", "end", ")", "return", "null", ";", "char", "[", "]", "name", "=", "this", ".", "names", "[", "this", ".", "start", "++", "]", ";", "if", "(", "this", ".", "start", ">", "this", ".", "end", ")", "{", "this", ".", "start", "=", "0", ";", "this", ".", "end", "=", "-", "1", ";", "}", "return", "name", ";", "}", "public", "String", "toString", "(", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", "\"Queue:n\"", ")", ";", "for", "(", "int", "i", "=", "this", ".", "start", ";", "i", "<=", "this", ".", "end", ";", "i", "++", ")", "{", "buffer", ".", "append", "(", "this", ".", "names", "[", "i", "]", ")", ".", "append", "(", "'\\n'", ")", ";", "}", "return", "buffer", ".", "toString", "(", ")", ";", "}", "}", "public", "IndexBasedHierarchyBuilder", "(", "TypeHierarchy", "hierarchy", ",", "IJavaSearchScope", "scope", ")", "throws", "JavaModelException", "{", "super", "(", "hierarchy", ")", ";", "this", ".", "cuToHandle", "=", "new", "HashMap", "(", "5", ")", ";", "this", ".", "binariesFromIndexMatches", "=", "new", "HashMap", "(", "10", ")", ";", "this", ".", "scope", "=", "scope", ";", "}", "public", "void", "build", "(", "boolean", "computeSubtypes", ")", "{", "JavaModelManager", "manager", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ";", "try", "{", "manager", ".", "cacheZipFiles", "(", "this", ")", ";", "if", "(", "computeSubtypes", ")", "{", "IType", "focusType", "=", "getType", "(", ")", ";", "boolean", "focusIsObject", "=", "focusType", ".", "getElementName", "(", ")", ".", "equals", "(", "new", "String", "(", "IIndexConstants", ".", "OBJECT", ")", ")", ";", "int", "amountOfWorkForSubtypes", "=", "focusIsObject", "?", "5", ":", "80", ";", "IProgressMonitor", "possibleSubtypesMonitor", "=", "this", ".", "hierarchy", ".", "progressMonitor", "==", "null", "?", "null", ":", "new", "SubProgressMonitor", "(", "this", ".", "hierarchy", ".", "progressMonitor", ",", "amountOfWorkForSubtypes", ")", ";", "HashSet", "localTypes", "=", "new", "HashSet", "(", "10", ")", ";", "String", "[", "]", "allPossibleSubtypes", ";", "if", "(", "(", "(", "Member", ")", "focusType", ")", ".", "getOuterMostLocalContext", "(", ")", "==", "null", ")", "{", "allPossibleSubtypes", "=", "determinePossibleSubTypes", "(", "localTypes", ",", "possibleSubtypesMonitor", ")", ";", "}", "else", "{", "allPossibleSubtypes", "=", "CharOperation", ".", "NO_STRINGS", ";", "}", "if", "(", "allPossibleSubtypes", "!=", "null", ")", "{", "IProgressMonitor", "buildMonitor", "=", "this", ".", "hierarchy", ".", "progressMonitor", "==", "null", "?", "null", ":", "new", "SubProgressMonitor", "(", "this", ".", "hierarchy", ".", "progressMonitor", ",", "100", "-", "amountOfWorkForSubtypes", ")", ";", "this", ".", "hierarchy", ".", "initialize", "(", "allPossibleSubtypes", ".", "length", ")", ";", "buildFromPotentialSubtypes", "(", "allPossibleSubtypes", ",", "localTypes", ",", "buildMonitor", ")", ";", "}", "}", "else", "{", "this", ".", "hierarchy", ".", "initialize", "(", "1", ")", ";", "buildSupertypes", "(", ")", ";", "}", "}", "finally", "{", "manager", ".", "flushZipFiles", "(", "this", ")", ";", "}", "}", "private", "void", "buildForProject", "(", "JavaProject", "project", ",", "ArrayList", "potentialSubtypes", ",", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", "[", "]", "workingCopies", ",", "HashSet", "localTypes", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "int", "openablesLength", "=", "potentialSubtypes", ".", "size", "(", ")", ";", "if", "(", "openablesLength", ">", "0", ")", "{", "Openable", "[", "]", "openables", "=", "new", "Openable", "[", "openablesLength", "]", ";", "potentialSubtypes", ".", "toArray", "(", "openables", ")", ";", "IPackageFragmentRoot", "[", "]", "roots", "=", "project", ".", "getPackageFragmentRoots", "(", ")", ";", "int", "rootsLength", "=", "roots", ".", "length", ";", "final", "HashtableOfObjectToInt", "indexes", "=", "new", "HashtableOfObjectToInt", "(", "openablesLength", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "openablesLength", ";", "i", "++", ")", "{", "IJavaElement", "root", "=", "openables", "[", "i", "]", ".", "getAncestor", "(", "IJavaElement", ".", "PACKAGE_FRAGMENT_ROOT", ")", ";", "int", "index", ";", "for", "(", "index", "=", "0", ";", "index", "<", "rootsLength", ";", "index", "++", ")", "{", "if", "(", "roots", "[", "index", "]", ".", "equals", "(", "root", ")", ")", "break", ";", "}", "indexes", ".", "put", "(", "openables", "[", "i", "]", ",", "index", ")", ";", "}", "Arrays", ".", "sort", "(", "openables", ",", "new", "Comparator", "(", ")", "{", "public", "int", "compare", "(", "Object", "a", ",", "Object", "b", ")", "{", "int", "aIndex", "=", "indexes", ".", "get", "(", "a", ")", ";", "int", "bIndex", "=", "indexes", ".", "get", "(", "b", ")", ";", "if", "(", "aIndex", "!=", "bIndex", ")", "return", "aIndex", "-", "bIndex", ";", "return", "(", "(", "Openable", ")", "b", ")", ".", "getElementName", "(", ")", ".", "compareTo", "(", "(", "(", "Openable", ")", "a", ")", ".", "getElementName", "(", ")", ")", ";", "}", "}", ")", ";", "IType", "focusType", "=", "getType", "(", ")", ";", "boolean", "inProjectOfFocusType", "=", "focusType", "!=", "null", "&&", "focusType", ".", "getJavaProject", "(", ")", ".", "equals", "(", "project", ")", ";", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", "[", "]", "unitsToLookInside", "=", "null", ";", "if", "(", "inProjectOfFocusType", ")", "{", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", "unitToLookInside", "=", "focusType", ".", "getCompilationUnit", "(", ")", ";", "if", "(", "unitToLookInside", "!=", "null", ")", "{", "int", "wcLength", "=", "workingCopies", "==", "null", "?", "0", ":", "workingCopies", ".", "length", ";", "if", "(", "wcLength", "==", "0", ")", "{", "unitsToLookInside", "=", "new", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", "[", "]", "{", "unitToLookInside", "}", ";", "}", "else", "{", "unitsToLookInside", "=", "new", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", "[", "wcLength", "+", "1", "]", ";", "unitsToLookInside", "[", "0", "]", "=", "unitToLookInside", ";", "System", ".", "arraycopy", "(", "workingCopies", ",", "0", ",", "unitsToLookInside", ",", "1", ",", "wcLength", ")", ";", "}", "}", "else", "{", "unitsToLookInside", "=", "workingCopies", ";", "}", "}", "SearchableEnvironment", "searchableEnvironment", "=", "project", ".", "newSearchableNameEnvironment", "(", "unitsToLookInside", ")", ";", "this", ".", "nameLookup", "=", "searchableEnvironment", ".", "nameLookup", ";", "Map", "options", "=", "project", ".", "getOptions", "(", "true", ")", ";", "options", ".", "put", "(", "JavaCore", ".", "COMPILER_TASK_TAGS", ",", "\"\"", ")", ";", "this", ".", "hierarchyResolver", "=", "new", "HierarchyResolver", "(", "searchableEnvironment", ",", "options", ",", "this", ",", "new", "DefaultProblemFactory", "(", ")", ")", ";", "if", "(", "focusType", "!=", "null", ")", "{", "Member", "declaringMember", "=", "(", "(", "Member", ")", "focusType", ")", ".", "getOuterMostLocalContext", "(", ")", ";", "if", "(", "declaringMember", "==", "null", ")", "{", "if", "(", "!", "inProjectOfFocusType", ")", "{", "char", "[", "]", "typeQualifiedName", "=", "focusType", ".", "getTypeQualifiedName", "(", "'.'", ")", ".", "toCharArray", "(", ")", ";", "String", "[", "]", "packageName", "=", "(", "(", "PackageFragment", ")", "focusType", ".", "getPackageFragment", "(", ")", ")", ".", "names", ";", "if", "(", "searchableEnvironment", ".", "findType", "(", "typeQualifiedName", ",", "Util", ".", "toCharArrays", "(", "packageName", ")", ")", "==", "null", ")", "{", "return", ";", "}", "}", "}", "else", "{", "Openable", "openable", ";", "if", "(", "declaringMember", ".", "isBinary", "(", ")", ")", "{", "openable", "=", "(", "Openable", ")", "declaringMember", ".", "getClassFile", "(", ")", ";", "}", "else", "{", "openable", "=", "(", "Openable", ")", "declaringMember", ".", "getCompilationUnit", "(", ")", ";", "}", "localTypes", "=", "new", "HashSet", "(", ")", ";", "localTypes", ".", "add", "(", "openable", ".", "getPath", "(", ")", ".", "toString", "(", ")", ")", ";", "this", ".", "hierarchyResolver", ".", "resolve", "(", "new", "Openable", "[", "]", "{", "openable", "}", ",", "localTypes", ",", "monitor", ")", ";", "return", ";", "}", "}", "this", ".", "hierarchyResolver", ".", "resolve", "(", "openables", ",", "localTypes", ",", "monitor", ")", ";", "}", "}", "private", "void", "buildFromPotentialSubtypes", "(", "String", "[", "]", "allPotentialSubTypes", ",", "HashSet", "localTypes", ",", "IProgressMonitor", "monitor", ")", "{", "IType", "focusType", "=", "getType", "(", ")", ";", "HashMap", "wcPaths", "=", "new", "HashMap", "(", ")", ";", "int", "wcLength", ";", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", "[", "]", "workingCopies", "=", "this", ".", "hierarchy", ".", "workingCopies", ";", "if", "(", "workingCopies", "!=", "null", "&&", "(", "wcLength", "=", "workingCopies", ".", "length", ")", ">", "0", ")", "{", "String", "[", "]", "newPaths", "=", "new", "String", "[", "wcLength", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "wcLength", ";", "i", "++", ")", "{", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", "workingCopy", "=", "workingCopies", "[", "i", "]", ";", "String", "path", "=", "workingCopy", ".", "getPath", "(", ")", ".", "toString", "(", ")", ";", "wcPaths", ".", "put", "(", "path", ",", "workingCopy", ")", ";", "newPaths", "[", "i", "]", "=", "path", ";", "}", "int", "potentialSubtypesLength", "=", "allPotentialSubTypes", ".", "length", ";", "System", ".", "arraycopy", "(", "allPotentialSubTypes", ",", "0", ",", "allPotentialSubTypes", "=", "new", "String", "[", "potentialSubtypesLength", "+", "wcLength", "]", ",", "0", ",", "potentialSubtypesLength", ")", ";", "System", ".", "arraycopy", "(", "newPaths", ",", "0", ",", "allPotentialSubTypes", ",", "potentialSubtypesLength", ",", "wcLength", ")", ";", "}", "int", "length", "=", "allPotentialSubTypes", ".", "length", ";", "Openable", "focusCU", "=", "(", "Openable", ")", "focusType", ".", "getCompilationUnit", "(", ")", ";", "String", "focusPath", "=", "null", ";", "if", "(", "focusCU", "!=", "null", ")", "{", "focusPath", "=", "focusCU", ".", "getPath", "(", ")", ".", "toString", "(", ")", ";", "if", "(", "length", ">", "0", ")", "{", "System", ".", "arraycopy", "(", "allPotentialSubTypes", ",", "0", ",", "allPotentialSubTypes", "=", "new", "String", "[", "length", "+", "1", "]", ",", "0", ",", "length", ")", ";", "allPotentialSubTypes", "[", "length", "]", "=", "focusPath", ";", "}", "else", "{", "allPotentialSubTypes", "=", "new", "String", "[", "]", "{", "focusPath", "}", ";", "}", "length", "++", ";", "}", "Arrays", ".", "sort", "(", "allPotentialSubTypes", ")", ";", "ArrayList", "potentialSubtypes", "=", "new", "ArrayList", "(", ")", ";", "try", "{", "HandleFactory", "factory", "=", "new", "HandleFactory", "(", ")", ";", "IJavaProject", "currentProject", "=", "null", ";", "if", "(", "monitor", "!=", "null", ")", "monitor", ".", "beginTask", "(", "\"\"", ",", "length", "*", "2", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "try", "{", "String", "resourcePath", "=", "allPotentialSubTypes", "[", "i", "]", ";", "if", "(", "i", ">", "0", "&&", "resourcePath", ".", "equals", "(", "allPotentialSubTypes", "[", "i", "-", "1", "]", ")", ")", "continue", ";", "Openable", "handle", ";", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", "workingCopy", "=", "(", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ")", "wcPaths", ".", "get", "(", "resourcePath", ")", ";", "if", "(", "workingCopy", "!=", "null", ")", "{", "handle", "=", "(", "Openable", ")", "workingCopy", ";", "}", "else", "{", "handle", "=", "resourcePath", ".", "equals", "(", "focusPath", ")", "?", "focusCU", ":", "factory", ".", "createOpenable", "(", "resourcePath", ",", "this", ".", "scope", ")", ";", "if", "(", "handle", "==", "null", ")", "continue", ";", "}", "IJavaProject", "project", "=", "handle", ".", "getJavaProject", "(", ")", ";", "if", "(", "currentProject", "==", "null", ")", "{", "currentProject", "=", "project", ";", "potentialSubtypes", "=", "new", "ArrayList", "(", "5", ")", ";", "}", "else", "if", "(", "!", "currentProject", ".", "equals", "(", "project", ")", ")", "{", "buildForProject", "(", "(", "JavaProject", ")", "currentProject", ",", "potentialSubtypes", ",", "workingCopies", ",", "localTypes", ",", "monitor", ")", ";", "currentProject", "=", "project", ";", "potentialSubtypes", "=", "new", "ArrayList", "(", "5", ")", ";", "}", "potentialSubtypes", ".", "add", "(", "handle", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "continue", ";", "}", "}", "try", "{", "if", "(", "currentProject", "==", "null", ")", "{", "currentProject", "=", "focusType", ".", "getJavaProject", "(", ")", ";", "if", "(", "focusType", ".", "isBinary", "(", ")", ")", "{", "potentialSubtypes", ".", "add", "(", "focusType", ".", "getClassFile", "(", ")", ")", ";", "}", "else", "{", "potentialSubtypes", ".", "add", "(", "focusType", ".", "getCompilationUnit", "(", ")", ")", ";", "}", "}", "buildForProject", "(", "(", "JavaProject", ")", "currentProject", ",", "potentialSubtypes", ",", "workingCopies", ",", "localTypes", ",", "monitor", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "if", "(", "!", "this", ".", "hierarchy", ".", "contains", "(", "focusType", ")", ")", "{", "try", "{", "currentProject", "=", "focusType", ".", "getJavaProject", "(", ")", ";", "potentialSubtypes", "=", "new", "ArrayList", "(", ")", ";", "if", "(", "focusType", ".", "isBinary", "(", ")", ")", "{", "potentialSubtypes", ".", "add", "(", "focusType", ".", "getClassFile", "(", ")", ")", ";", "}", "else", "{", "potentialSubtypes", ".", "add", "(", "focusType", ".", "getCompilationUnit", "(", ")", ")", ";", "}", "buildForProject", "(", "(", "JavaProject", ")", "currentProject", ",", "potentialSubtypes", ",", "workingCopies", ",", "localTypes", ",", "monitor", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "}", "if", "(", "!", "this", ".", "hierarchy", ".", "contains", "(", "focusType", ")", ")", "{", "this", ".", "hierarchy", ".", "addRootClass", "(", "focusType", ")", ";", "}", "}", "finally", "{", "if", "(", "monitor", "!=", "null", ")", "monitor", ".", "done", "(", ")", ";", "}", "}", "protected", "ICompilationUnit", "createCompilationUnitFromPath", "(", "Openable", "handle", ",", "IFile", "file", ")", "{", "ICompilationUnit", "unit", "=", "super", ".", "createCompilationUnitFromPath", "(", "handle", ",", "file", ")", ";", "this", ".", "cuToHandle", ".", "put", "(", "unit", ",", "handle", ")", ";", "return", "unit", ";", "}", "protected", "IBinaryType", "createInfoFromClassFile", "(", "Openable", "classFile", ",", "IResource", "file", ")", "{", "String", "documentPath", "=", "classFile", ".", "getPath", "(", ")", ".", "toString", "(", ")", ";", "IBinaryType", "binaryType", "=", "(", "IBinaryType", ")", "this", ".", "binariesFromIndexMatches", ".", "get", "(", "documentPath", ")", ";", "if", "(", "binaryType", "!=", "null", ")", "{", "this", ".", "infoToHandle", ".", "put", "(", "binaryType", ",", "classFile", ")", ";", "return", "binaryType", ";", "}", "else", "{", "return", "super", ".", "createInfoFromClassFile", "(", "classFile", ",", "file", ")", ";", "}", "}", "protected", "IBinaryType", "createInfoFromClassFileInJar", "(", "Openable", "classFile", ")", "{", "String", "filePath", "=", "(", "(", "(", "ClassFile", ")", "classFile", ")", ".", "getType", "(", ")", ".", "getFullyQualifiedName", "(", "'$'", ")", ")", ".", "replace", "(", "'.'", ",", "'/'", ")", "+", "SuffixConstants", ".", "SUFFIX_STRING_class", ";", "IPackageFragmentRoot", "root", "=", "classFile", ".", "getPackageFragmentRoot", "(", ")", ";", "IPath", "path", "=", "root", ".", "getPath", "(", ")", ";", "String", "rootPath", "=", "path", ".", "getDevice", "(", ")", "==", "null", "?", "path", ".", "toString", "(", ")", ":", "path", ".", "toOSString", "(", ")", ";", "String", "documentPath", "=", "rootPath", "+", "IJavaSearchScope", ".", "JAR_FILE_ENTRY_SEPARATOR", "+", "filePath", ";", "IBinaryType", "binaryType", "=", "(", "IBinaryType", ")", "this", ".", "binariesFromIndexMatches", ".", "get", "(", "documentPath", ")", ";", "if", "(", "binaryType", "!=", "null", ")", "{", "this", ".", "infoToHandle", ".", "put", "(", "binaryType", ",", "classFile", ")", ";", "return", "binaryType", ";", "}", "else", "{", "return", "super", ".", "createInfoFromClassFileInJar", "(", "classFile", ")", ";", "}", "}", "private", "String", "[", "]", "determinePossibleSubTypes", "(", "final", "HashSet", "localTypes", ",", "IProgressMonitor", "monitor", ")", "{", "class", "PathCollector", "implements", "IPathRequestor", "{", "HashSet", "paths", "=", "new", "HashSet", "(", "10", ")", ";", "public", "void", "acceptPath", "(", "String", "path", ",", "boolean", "containsLocalTypes", ")", "{", "this", ".", "paths", ".", "add", "(", "path", ")", ";", "if", "(", "containsLocalTypes", ")", "{", "localTypes", ".", "add", "(", "path", ")", ";", "}", "}", "}", "PathCollector", "collector", "=", "new", "PathCollector", "(", ")", ";", "try", "{", "if", "(", "monitor", "!=", "null", ")", "monitor", ".", "beginTask", "(", "\"\"", ",", "MAXTICKS", ")", ";", "searchAllPossibleSubTypes", "(", "getType", "(", ")", ",", "this", ".", "scope", ",", "this", ".", "binariesFromIndexMatches", ",", "collector", ",", "IJavaSearchConstants", ".", "WAIT_UNTIL_READY_TO_SEARCH", ",", "monitor", ")", ";", "}", "finally", "{", "if", "(", "monitor", "!=", "null", ")", "monitor", ".", "done", "(", ")", ";", "}", "HashSet", "paths", "=", "collector", ".", "paths", ";", "int", "length", "=", "paths", ".", "size", "(", ")", ";", "String", "[", "]", "result", "=", "new", "String", "[", "length", "]", ";", "int", "count", "=", "0", ";", "for", "(", "Iterator", "iter", "=", "paths", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "result", "[", "count", "++", "]", "=", "(", "String", ")", "iter", ".", "next", "(", ")", ";", "}", "return", "result", ";", "}", "public", "static", "void", "searchAllPossibleSubTypes", "(", "IType", "type", ",", "IJavaSearchScope", "scope", ",", "final", "Map", "binariesFromIndexMatches", ",", "final", "IPathRequestor", "pathRequestor", ",", "int", "waitingPolicy", ",", "final", "IProgressMonitor", "progressMonitor", ")", "{", "final", "Queue", "queue", "=", "new", "Queue", "(", ")", ";", "final", "HashtableOfObject", "foundSuperNames", "=", "new", "HashtableOfObject", "(", "5", ")", ";", "IndexManager", "indexManager", "=", "JavaModelManager", ".", "getIndexManager", "(", ")", ";", "IndexQueryRequestor", "searchRequestor", "=", "new", "IndexQueryRequestor", "(", ")", "{", "public", "boolean", "acceptIndexMatch", "(", "String", "documentPath", ",", "SearchPattern", "indexRecord", ",", "SearchParticipant", "participant", ",", "AccessRuleSet", "access", ")", "{", "SuperTypeReferencePattern", "record", "=", "(", "SuperTypeReferencePattern", ")", "indexRecord", ";", "boolean", "isLocalOrAnonymous", "=", "record", ".", "enclosingTypeName", "==", "IIndexConstants", ".", "ONE_ZERO", ";", "pathRequestor", ".", "acceptPath", "(", "documentPath", ",", "isLocalOrAnonymous", ")", ";", "char", "[", "]", "typeName", "=", "record", ".", "simpleName", ";", "if", "(", "documentPath", ".", "toLowerCase", "(", ")", ".", "endsWith", "(", "SUFFIX_STRING_class", ")", ")", "{", "int", "suffix", "=", "documentPath", ".", "length", "(", ")", "-", "SUFFIX_STRING_class", ".", "length", "(", ")", ";", "HierarchyBinaryType", "binaryType", "=", "(", "HierarchyBinaryType", ")", "binariesFromIndexMatches", ".", "get", "(", "documentPath", ")", ";", "if", "(", "binaryType", "==", "null", ")", "{", "char", "[", "]", "enclosingTypeName", "=", "record", ".", "enclosingTypeName", ";", "if", "(", "isLocalOrAnonymous", ")", "{", "int", "lastSlash", "=", "documentPath", ".", "lastIndexOf", "(", "'/'", ")", ";", "int", "lastDollar", "=", "documentPath", ".", "lastIndexOf", "(", "'$'", ")", ";", "if", "(", "lastDollar", "==", "-", "1", ")", "{", "enclosingTypeName", "=", "null", ";", "typeName", "=", "documentPath", ".", "substring", "(", "lastSlash", "+", "1", ",", "suffix", ")", ".", "toCharArray", "(", ")", ";", "}", "else", "{", "enclosingTypeName", "=", "documentPath", ".", "substring", "(", "lastSlash", "+", "1", ",", "lastDollar", ")", ".", "toCharArray", "(", ")", ";", "typeName", "=", "documentPath", ".", "substring", "(", "lastDollar", "+", "1", ",", "suffix", ")", ".", "toCharArray", "(", ")", ";", "}", "}", "binaryType", "=", "new", "HierarchyBinaryType", "(", "record", ".", "modifiers", ",", "record", ".", "pkgName", ",", "typeName", ",", "enclosingTypeName", ",", "record", ".", "typeParameterSignatures", ",", "record", ".", "classOrInterface", ")", ";", "binariesFromIndexMatches", ".", "put", "(", "documentPath", ",", "binaryType", ")", ";", "}", "binaryType", ".", "recordSuperType", "(", "record", ".", "superSimpleName", ",", "record", ".", "superQualification", ",", "record", ".", "superClassOrInterface", ")", ";", "}", "if", "(", "!", "isLocalOrAnonymous", "&&", "!", "foundSuperNames", ".", "containsKey", "(", "typeName", ")", ")", "{", "foundSuperNames", ".", "put", "(", "typeName", ",", "typeName", ")", ";", "queue", ".", "add", "(", "typeName", ")", ";", "}", "return", "true", ";", "}", "}", ";", "int", "superRefKind", ";", "try", "{", "superRefKind", "=", "type", ".", "isClass", "(", ")", "?", "SuperTypeReferencePattern", ".", "ONLY_SUPER_CLASSES", ":", "SuperTypeReferencePattern", ".", "ALL_SUPER_TYPES", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "superRefKind", "=", "SuperTypeReferencePattern", ".", "ALL_SUPER_TYPES", ";", "}", "SuperTypeReferencePattern", "pattern", "=", "new", "SuperTypeReferencePattern", "(", "null", ",", "null", ",", "superRefKind", ",", "SearchPattern", ".", "R_EXACT_MATCH", "|", "SearchPattern", ".", "R_CASE_SENSITIVE", ")", ";", "MatchLocator", ".", "setFocus", "(", "pattern", ",", "type", ")", ";", "SubTypeSearchJob", "job", "=", "new", "SubTypeSearchJob", "(", "pattern", ",", "new", "JavaSearchParticipant", "(", ")", ",", "scope", ",", "searchRequestor", ")", ";", "int", "ticks", "=", "0", ";", "queue", ".", "add", "(", "type", ".", "getElementName", "(", ")", ".", "toCharArray", "(", ")", ")", ";", "try", "{", "while", "(", "queue", ".", "start", "<=", "queue", ".", "end", ")", "{", "if", "(", "progressMonitor", "!=", "null", "&&", "progressMonitor", ".", "isCanceled", "(", ")", ")", "return", ";", "char", "[", "]", "currentTypeName", "=", "queue", ".", "retrieve", "(", ")", ";", "if", "(", "CharOperation", ".", "equals", "(", "currentTypeName", ",", "IIndexConstants", ".", "OBJECT", ")", ")", "currentTypeName", "=", "null", ";", "pattern", ".", "superSimpleName", "=", "currentTypeName", ";", "indexManager", ".", "performConcurrentJob", "(", "job", ",", "waitingPolicy", ",", "progressMonitor", "==", "null", "?", "null", ":", "new", "NullProgressMonitor", "(", ")", "{", "public", "void", "setCanceled", "(", "boolean", "value", ")", "{", "progressMonitor", ".", "setCanceled", "(", "value", ")", ";", "}", "public", "boolean", "isCanceled", "(", ")", "{", "return", "progressMonitor", ".", "isCanceled", "(", ")", ";", "}", "public", "void", "subTask", "(", "String", "name", ")", "{", "progressMonitor", ".", "subTask", "(", "name", ")", ";", "}", "}", ")", ";", "if", "(", "progressMonitor", "!=", "null", "&&", "++", "ticks", "<=", "MAXTICKS", ")", "progressMonitor", ".", "worked", "(", "1", ")", ";", "if", "(", "currentTypeName", "==", "null", ")", "break", ";", "}", "}", "finally", "{", "job", ".", "finished", "(", ")", ";", "}", "}", "}", "</s>" ]
5,291
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "hierarchy", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "IGenericType", ";", "public", "class", "HierarchyType", "implements", "IGenericType", "{", "public", "IType", "typeHandle", ";", "public", "char", "[", "]", "name", ";", "public", "int", "modifiers", ";", "public", "char", "[", "]", "superclassName", ";", "public", "char", "[", "]", "[", "]", "superInterfaceNames", ";", "public", "HierarchyType", "(", "IType", "typeHandle", ",", "char", "[", "]", "name", ",", "int", "modifiers", ",", "char", "[", "]", "superclassName", ",", "char", "[", "]", "[", "]", "superInterfaceNames", ")", "{", "this", ".", "typeHandle", "=", "typeHandle", ";", "this", ".", "name", "=", "name", ";", "this", ".", "modifiers", "=", "modifiers", ";", "this", ".", "superclassName", "=", "superclassName", ";", "this", ".", "superInterfaceNames", "=", "superInterfaceNames", ";", "}", "public", "char", "[", "]", "getFileName", "(", ")", "{", "return", "this", ".", "typeHandle", ".", "getCompilationUnit", "(", ")", ".", "getElementName", "(", ")", ".", "toCharArray", "(", ")", ";", "}", "public", "int", "getModifiers", "(", ")", "{", "return", "this", ".", "modifiers", ";", "}", "public", "boolean", "isBinaryType", "(", ")", "{", "return", "false", ";", "}", "}", "</s>" ]
5,292
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "hierarchy", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "HashSet", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "codehaus", ".", "jdt", ".", "groovy", ".", "integration", ".", "LanguageSupportFactory", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IFile", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "OperationCanceledException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "Signature", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "CompilationResult", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "DefaultErrorHandlingPolicies", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "IErrorHandlingPolicy", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "IProblemFactory", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ASTNode", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "CompilationUnitDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "QualifiedAllocationExpression", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TypeDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TypeReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "AccessRestriction", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "IBinaryType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "IGenericType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "INameEnvironment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "ISourceType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "impl", ".", "CompilerOptions", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "impl", ".", "ITypeRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "BinaryTypeBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ClassScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "LocalTypeBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "LookupEnvironment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "PackageBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ProblemReasons", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ReferenceBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "SourceTypeBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TagBits", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TypeBinding", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TypeConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TypeIds", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "Parser", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "SourceTypeConverter", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "problem", ".", "AbortCompilation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "problem", ".", "DefaultProblemFactory", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "problem", ".", "ProblemReporter", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Messages", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "ClassFile", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "CompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "JavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "JavaModelManager", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "Member", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "Openable", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "SourceTypeElementInfo", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "ASTNodeFinder", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "HandleFactory", ";", "public", "class", "HierarchyResolver", "implements", "ITypeRequestor", "{", "private", "ReferenceBinding", "focusType", ";", "private", "boolean", "superTypesOnly", ";", "private", "boolean", "hasMissingSuperClass", ";", "LookupEnvironment", "lookupEnvironment", ";", "private", "CompilerOptions", "options", ";", "HierarchyBuilder", "builder", ";", "private", "ReferenceBinding", "[", "]", "typeBindings", ";", "private", "int", "typeIndex", ";", "private", "IGenericType", "[", "]", "typeModels", ";", "private", "static", "final", "CompilationUnitDeclaration", "FakeUnit", ";", "static", "{", "IErrorHandlingPolicy", "policy", "=", "DefaultErrorHandlingPolicies", ".", "exitAfterAllProblems", "(", ")", ";", "ProblemReporter", "problemReporter", "=", "new", "ProblemReporter", "(", "policy", ",", "new", "CompilerOptions", "(", ")", ",", "new", "DefaultProblemFactory", "(", ")", ")", ";", "CompilationResult", "result", "=", "new", "CompilationResult", "(", "CharOperation", ".", "NO_CHAR", ",", "0", ",", "0", ",", "0", ")", ";", "FakeUnit", "=", "new", "CompilationUnitDeclaration", "(", "problemReporter", ",", "result", ",", "0", ")", ";", "}", "public", "HierarchyResolver", "(", "INameEnvironment", "nameEnvironment", ",", "Map", "settings", ",", "HierarchyBuilder", "builder", ",", "IProblemFactory", "problemFactory", ")", "{", "this", ".", "options", "=", "new", "CompilerOptions", "(", "settings", ")", ";", "IErrorHandlingPolicy", "policy", "=", "DefaultErrorHandlingPolicies", ".", "exitAfterAllProblems", "(", ")", ";", "ProblemReporter", "problemReporter", "=", "new", "ProblemReporter", "(", "policy", ",", "this", ".", "options", ",", "problemFactory", ")", ";", "setEnvironment", "(", "new", "LookupEnvironment", "(", "this", ",", "this", ".", "options", ",", "problemReporter", ",", "nameEnvironment", ")", ",", "builder", ")", ";", "}", "public", "HierarchyResolver", "(", "LookupEnvironment", "lookupEnvironment", ",", "HierarchyBuilder", "builder", ")", "{", "setEnvironment", "(", "lookupEnvironment", ",", "builder", ")", ";", "}", "public", "void", "accept", "(", "IBinaryType", "binaryType", ",", "PackageBinding", "packageBinding", ",", "AccessRestriction", "accessRestriction", ")", "{", "IProgressMonitor", "progressMonitor", "=", "this", ".", "builder", ".", "hierarchy", ".", "progressMonitor", ";", "if", "(", "progressMonitor", "!=", "null", "&&", "progressMonitor", ".", "isCanceled", "(", ")", ")", "throw", "new", "OperationCanceledException", "(", ")", ";", "BinaryTypeBinding", "typeBinding", "=", "this", ".", "lookupEnvironment", ".", "createBinaryTypeFrom", "(", "binaryType", ",", "packageBinding", ",", "accessRestriction", ")", ";", "try", "{", "this", ".", "remember", "(", "binaryType", ",", "typeBinding", ")", ";", "}", "catch", "(", "AbortCompilation", "e", ")", "{", "}", "}", "public", "void", "accept", "(", "ICompilationUnit", "sourceUnit", ",", "AccessRestriction", "accessRestriction", ")", "{", "this", ".", "lookupEnvironment", ".", "problemReporter", ".", "abortDueToInternalError", "(", "new", "StringBuffer", "(", "Messages", ".", "accept_cannot", ")", ".", "append", "(", "sourceUnit", ".", "getFileName", "(", ")", ")", ".", "toString", "(", ")", ")", ";", "}", "public", "void", "accept", "(", "ISourceType", "[", "]", "sourceTypes", ",", "PackageBinding", "packageBinding", ",", "AccessRestriction", "accessRestriction", ")", "{", "IProgressMonitor", "progressMonitor", "=", "this", ".", "builder", ".", "hierarchy", ".", "progressMonitor", ";", "if", "(", "progressMonitor", "!=", "null", "&&", "progressMonitor", ".", "isCanceled", "(", ")", ")", "throw", "new", "OperationCanceledException", "(", ")", ";", "ISourceType", "sourceType", "=", "sourceTypes", "[", "0", "]", ";", "while", "(", "sourceType", ".", "getEnclosingType", "(", ")", "!=", "null", ")", "sourceType", "=", "sourceType", ".", "getEnclosingType", "(", ")", ";", "CompilationResult", "result", "=", "new", "CompilationResult", "(", "sourceType", ".", "getFileName", "(", ")", ",", "1", ",", "1", ",", "this", ".", "options", ".", "maxProblemsPerUnit", ")", ";", "CompilationUnitDeclaration", "unit", "=", "SourceTypeConverter", ".", "buildCompilationUnit", "(", "new", "ISourceType", "[", "]", "{", "sourceType", "}", ",", "SourceTypeConverter", ".", "MEMBER_TYPE", ",", "this", ".", "lookupEnvironment", ".", "problemReporter", ",", "result", ")", ";", "if", "(", "unit", "!=", "null", ")", "{", "try", "{", "this", ".", "lookupEnvironment", ".", "buildTypeBindings", "(", "unit", ",", "accessRestriction", ")", ";", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", "cu", "=", "(", "(", "SourceTypeElementInfo", ")", "sourceType", ")", ".", "getHandle", "(", ")", ".", "getCompilationUnit", "(", ")", ";", "rememberAllTypes", "(", "unit", ",", "cu", ",", "false", ")", ";", "this", ".", "lookupEnvironment", ".", "completeTypeBindings", "(", "unit", ",", "true", ")", ";", "}", "catch", "(", "AbortCompilation", "e", ")", "{", "}", "}", "}", "private", "IType", "findSuperClass", "(", "IGenericType", "type", ",", "ReferenceBinding", "typeBinding", ")", "{", "ReferenceBinding", "superBinding", "=", "typeBinding", ".", "superclass", "(", ")", ";", "if", "(", "superBinding", "!=", "null", ")", "{", "superBinding", "=", "(", "ReferenceBinding", ")", "superBinding", ".", "erasure", "(", ")", ";", "if", "(", "typeBinding", ".", "isHierarchyInconsistent", "(", ")", ")", "{", "if", "(", "superBinding", ".", "problemId", "(", ")", "==", "ProblemReasons", ".", "NotFound", ")", "{", "this", ".", "hasMissingSuperClass", "=", "true", ";", "this", ".", "builder", ".", "hierarchy", ".", "missingTypes", ".", "add", "(", "new", "String", "(", "superBinding", ".", "sourceName", ")", ")", ";", "return", "null", ";", "}", "else", "if", "(", "(", "superBinding", ".", "id", "==", "TypeIds", ".", "T_JavaLangObject", ")", ")", "{", "char", "[", "]", "superclassName", ";", "char", "separator", ";", "if", "(", "type", "instanceof", "IBinaryType", ")", "{", "superclassName", "=", "(", "(", "IBinaryType", ")", "type", ")", ".", "getSuperclassName", "(", ")", ";", "separator", "=", "'/'", ";", "}", "else", "if", "(", "type", "instanceof", "ISourceType", ")", "{", "superclassName", "=", "(", "(", "ISourceType", ")", "type", ")", ".", "getSuperclassName", "(", ")", ";", "separator", "=", "'.'", ";", "}", "else", "if", "(", "type", "instanceof", "HierarchyType", ")", "{", "superclassName", "=", "(", "(", "HierarchyType", ")", "type", ")", ".", "superclassName", ";", "separator", "=", "'.'", ";", "}", "else", "{", "return", "null", ";", "}", "if", "(", "superclassName", "!=", "null", ")", "{", "int", "lastSeparator", "=", "CharOperation", ".", "lastIndexOf", "(", "separator", ",", "superclassName", ")", ";", "char", "[", "]", "simpleName", "=", "lastSeparator", "==", "-", "1", "?", "superclassName", ":", "CharOperation", ".", "subarray", "(", "superclassName", ",", "lastSeparator", "+", "1", ",", "superclassName", ".", "length", ")", ";", "if", "(", "!", "CharOperation", ".", "equals", "(", "simpleName", ",", "TypeConstants", ".", "OBJECT", ")", ")", "{", "this", ".", "hasMissingSuperClass", "=", "true", ";", "this", ".", "builder", ".", "hierarchy", ".", "missingTypes", ".", "add", "(", "new", "String", "(", "simpleName", ")", ")", ";", "return", "null", ";", "}", "}", "}", "}", "for", "(", "int", "t", "=", "this", ".", "typeIndex", ";", "t", ">=", "0", ";", "t", "--", ")", "{", "if", "(", "this", ".", "typeBindings", "[", "t", "]", "==", "superBinding", ")", "{", "return", "this", ".", "builder", ".", "getHandle", "(", "this", ".", "typeModels", "[", "t", "]", ",", "superBinding", ")", ";", "}", "}", "}", "return", "null", ";", "}", "private", "IType", "[", "]", "findSuperInterfaces", "(", "IGenericType", "type", ",", "ReferenceBinding", "typeBinding", ")", "{", "char", "[", "]", "[", "]", "superInterfaceNames", ";", "char", "separator", ";", "if", "(", "type", "instanceof", "IBinaryType", ")", "{", "superInterfaceNames", "=", "(", "(", "IBinaryType", ")", "type", ")", ".", "getInterfaceNames", "(", ")", ";", "separator", "=", "'/'", ";", "}", "else", "if", "(", "type", "instanceof", "ISourceType", ")", "{", "ISourceType", "sourceType", "=", "(", "ISourceType", ")", "type", ";", "if", "(", "sourceType", ".", "getName", "(", ")", ".", "length", "==", "0", ")", "{", "if", "(", "typeBinding", ".", "superInterfaces", "(", ")", "!=", "null", "&&", "typeBinding", ".", "superInterfaces", "(", ")", ".", "length", ">", "0", ")", "{", "superInterfaceNames", "=", "new", "char", "[", "]", "[", "]", "{", "sourceType", ".", "getSuperclassName", "(", ")", "}", ";", "}", "else", "{", "superInterfaceNames", "=", "sourceType", ".", "getInterfaceNames", "(", ")", ";", "}", "}", "else", "{", "if", "(", "TypeDeclaration", ".", "kind", "(", "sourceType", ".", "getModifiers", "(", ")", ")", "==", "TypeDeclaration", ".", "ANNOTATION_TYPE_DECL", ")", "superInterfaceNames", "=", "new", "char", "[", "]", "[", "]", "{", "TypeConstants", ".", "CharArray_JAVA_LANG_ANNOTATION_ANNOTATION", "}", ";", "else", "superInterfaceNames", "=", "sourceType", ".", "getInterfaceNames", "(", ")", ";", "}", "separator", "=", "'.'", ";", "}", "else", "if", "(", "type", "instanceof", "HierarchyType", ")", "{", "HierarchyType", "hierarchyType", "=", "(", "HierarchyType", ")", "type", ";", "if", "(", "hierarchyType", ".", "name", ".", "length", "==", "0", ")", "{", "if", "(", "typeBinding", ".", "superInterfaces", "(", ")", "!=", "null", "&&", "typeBinding", ".", "superInterfaces", "(", ")", ".", "length", ">", "0", ")", "{", "superInterfaceNames", "=", "new", "char", "[", "]", "[", "]", "{", "hierarchyType", ".", "superclassName", "}", ";", "}", "else", "{", "superInterfaceNames", "=", "hierarchyType", ".", "superInterfaceNames", ";", "}", "}", "else", "{", "superInterfaceNames", "=", "hierarchyType", ".", "superInterfaceNames", ";", "}", "separator", "=", "'.'", ";", "}", "else", "{", "return", "null", ";", "}", "ReferenceBinding", "[", "]", "interfaceBindings", "=", "typeBinding", ".", "superInterfaces", "(", ")", ";", "int", "bindingIndex", "=", "0", ";", "int", "bindingLength", "=", "interfaceBindings", "==", "null", "?", "0", ":", "interfaceBindings", ".", "length", ";", "int", "length", "=", "superInterfaceNames", "==", "null", "?", "0", ":", "superInterfaceNames", ".", "length", ";", "IType", "[", "]", "superinterfaces", "=", "new", "IType", "[", "length", "]", ";", "int", "index", "=", "0", ";", "next", ":", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "char", "[", "]", "superInterfaceName", "=", "superInterfaceNames", "[", "i", "]", ";", "int", "end", "=", "superInterfaceName", ".", "length", ";", "int", "genericStart", "=", "CharOperation", ".", "indexOf", "(", "Signature", ".", "C_GENERIC_START", ",", "superInterfaceName", ")", ";", "if", "(", "genericStart", "!=", "-", "1", ")", "end", "=", "genericStart", ";", "int", "lastSeparator", "=", "CharOperation", ".", "lastIndexOf", "(", "separator", ",", "superInterfaceName", ",", "0", ",", "end", ")", ";", "int", "start", "=", "lastSeparator", "+", "1", ";", "int", "lastDollar", "=", "CharOperation", ".", "lastIndexOf", "(", "'$'", ",", "superInterfaceName", ",", "start", ")", ";", "if", "(", "lastDollar", "!=", "-", "1", ")", "start", "=", "lastDollar", "+", "1", ";", "char", "[", "]", "simpleName", "=", "CharOperation", ".", "subarray", "(", "superInterfaceName", ",", "start", ",", "end", ")", ";", "if", "(", "bindingIndex", "<", "bindingLength", ")", "{", "ReferenceBinding", "interfaceBinding", "=", "(", "ReferenceBinding", ")", "interfaceBindings", "[", "bindingIndex", "]", ".", "erasure", "(", ")", ";", "if", "(", "CharOperation", ".", "equals", "(", "simpleName", ",", "interfaceBinding", ".", "sourceName", ")", ")", "{", "bindingIndex", "++", ";", "for", "(", "int", "t", "=", "this", ".", "typeIndex", ";", "t", ">=", "0", ";", "t", "--", ")", "{", "if", "(", "this", ".", "typeBindings", "[", "t", "]", "==", "interfaceBinding", ")", "{", "IType", "handle", "=", "this", ".", "builder", ".", "getHandle", "(", "this", ".", "typeModels", "[", "t", "]", ",", "interfaceBinding", ")", ";", "if", "(", "handle", "!=", "null", ")", "{", "superinterfaces", "[", "index", "++", "]", "=", "handle", ";", "continue", "next", ";", "}", "}", "}", "}", "}", "this", ".", "builder", ".", "hierarchy", ".", "missingTypes", ".", "add", "(", "new", "String", "(", "simpleName", ")", ")", ";", "}", "if", "(", "index", "!=", "length", ")", "System", ".", "arraycopy", "(", "superinterfaces", ",", "0", ",", "superinterfaces", "=", "new", "IType", "[", "index", "]", ",", "0", ",", "index", ")", ";", "return", "superinterfaces", ";", "}", "private", "void", "fixSupertypeBindings", "(", ")", "{", "for", "(", "int", "current", "=", "this", ".", "typeIndex", ";", "current", ">=", "0", ";", "current", "--", ")", "{", "ReferenceBinding", "typeBinding", "=", "this", ".", "typeBindings", "[", "current", "]", ";", "if", "(", "(", "typeBinding", ".", "tagBits", "&", "TagBits", ".", "HierarchyHasProblems", ")", "==", "0", ")", "continue", ";", "if", "(", "typeBinding", "instanceof", "SourceTypeBinding", ")", "{", "if", "(", "typeBinding", "instanceof", "LocalTypeBinding", ")", "{", "LocalTypeBinding", "localTypeBinding", "=", "(", "LocalTypeBinding", ")", "typeBinding", ";", "QualifiedAllocationExpression", "allocationExpression", "=", "localTypeBinding", ".", "scope", ".", "referenceContext", ".", "allocation", ";", "TypeReference", "type", ";", "if", "(", "allocationExpression", "!=", "null", "&&", "(", "type", "=", "allocationExpression", ".", "type", ")", "!=", "null", "&&", "type", ".", "resolvedType", "!=", "null", ")", "{", "localTypeBinding", ".", "superclass", "=", "(", "ReferenceBinding", ")", "type", ".", "resolvedType", ";", "continue", ";", "}", "}", "ClassScope", "scope", "=", "(", "(", "SourceTypeBinding", ")", "typeBinding", ")", ".", "scope", ";", "if", "(", "scope", "!=", "null", ")", "{", "TypeDeclaration", "typeDeclaration", "=", "scope", ".", "referenceContext", ";", "TypeReference", "superclassRef", "=", "typeDeclaration", "==", "null", "?", "null", ":", "typeDeclaration", ".", "superclass", ";", "TypeBinding", "superclass", "=", "superclassRef", "==", "null", "?", "null", ":", "superclassRef", ".", "resolvedType", ";", "if", "(", "superclass", "!=", "null", ")", "{", "superclass", "=", "superclass", ".", "closestMatch", "(", ")", ";", "}", "if", "(", "superclass", "instanceof", "ReferenceBinding", ")", "{", "if", "(", "!", "(", "subTypeOfType", "(", "(", "ReferenceBinding", ")", "superclass", ",", "typeBinding", ")", ")", ")", "{", "(", "(", "SourceTypeBinding", ")", "typeBinding", ")", ".", "superclass", "=", "(", "ReferenceBinding", ")", "superclass", ";", "}", "}", "TypeReference", "[", "]", "superInterfaces", "=", "typeDeclaration", "==", "null", "?", "null", ":", "typeDeclaration", ".", "superInterfaces", ";", "int", "length", ";", "ReferenceBinding", "[", "]", "interfaceBindings", "=", "typeBinding", ".", "superInterfaces", "(", ")", ";", "if", "(", "superInterfaces", "!=", "null", "&&", "(", "length", "=", "superInterfaces", ".", "length", ")", ">", "(", "interfaceBindings", "==", "null", "?", "0", ":", "interfaceBindings", ".", "length", ")", ")", "{", "interfaceBindings", "=", "new", "ReferenceBinding", "[", "length", "]", ";", "int", "index", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "TypeBinding", "superInterface", "=", "superInterfaces", "[", "i", "]", ".", "resolvedType", ";", "if", "(", "superInterface", "!=", "null", ")", "{", "superInterface", "=", "superInterface", ".", "closestMatch", "(", ")", ";", "}", "if", "(", "superInterface", "instanceof", "ReferenceBinding", ")", "{", "if", "(", "!", "(", "subTypeOfType", "(", "(", "ReferenceBinding", ")", "superInterface", ",", "typeBinding", ")", ")", ")", "{", "interfaceBindings", "[", "index", "++", "]", "=", "(", "ReferenceBinding", ")", "superInterface", ";", "}", "}", "}", "if", "(", "index", "<", "length", ")", "System", ".", "arraycopy", "(", "interfaceBindings", ",", "0", ",", "interfaceBindings", "=", "new", "ReferenceBinding", "[", "index", "]", ",", "0", ",", "index", ")", ";", "(", "(", "SourceTypeBinding", ")", "typeBinding", ")", ".", "superInterfaces", "=", "interfaceBindings", ";", "}", "}", "}", "else", "if", "(", "typeBinding", "instanceof", "BinaryTypeBinding", ")", "{", "try", "{", "typeBinding", ".", "superclass", "(", ")", ";", "}", "catch", "(", "AbortCompilation", "e", ")", "{", "(", "(", "BinaryTypeBinding", ")", "typeBinding", ")", ".", "tagBits", "&=", "~", "TagBits", ".", "HasUnresolvedSuperclass", ";", "this", ".", "builder", ".", "hierarchy", ".", "missingTypes", ".", "add", "(", "new", "String", "(", "typeBinding", ".", "superclass", "(", ")", ".", "sourceName", "(", ")", ")", ")", ";", "this", ".", "hasMissingSuperClass", "=", "true", ";", "}", "try", "{", "typeBinding", ".", "superInterfaces", "(", ")", ";", "}", "catch", "(", "AbortCompilation", "e", ")", "{", "(", "(", "BinaryTypeBinding", ")", "typeBinding", ")", ".", "tagBits", "&=", "~", "TagBits", ".", "HasUnresolvedSuperinterfaces", ";", "}", "}", "}", "}", "private", "void", "remember", "(", "IGenericType", "suppliedType", ",", "ReferenceBinding", "typeBinding", ")", "{", "if", "(", "typeBinding", "==", "null", ")", "return", ";", "if", "(", "++", "this", ".", "typeIndex", "==", "this", ".", "typeModels", ".", "length", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "typeModels", ",", "0", ",", "this", ".", "typeModels", "=", "new", "IGenericType", "[", "this", ".", "typeIndex", "*", "2", "]", ",", "0", ",", "this", ".", "typeIndex", ")", ";", "System", ".", "arraycopy", "(", "this", ".", "typeBindings", ",", "0", ",", "this", ".", "typeBindings", "=", "new", "ReferenceBinding", "[", "this", ".", "typeIndex", "*", "2", "]", ",", "0", ",", "this", ".", "typeIndex", ")", ";", "}", "this", ".", "typeModels", "[", "this", ".", "typeIndex", "]", "=", "suppliedType", ";", "this", ".", "typeBindings", "[", "this", ".", "typeIndex", "]", "=", "typeBinding", ";", "}", "private", "void", "remember", "(", "IType", "type", ",", "ReferenceBinding", "typeBinding", ")", "{", "if", "(", "(", "(", "CompilationUnit", ")", "type", ".", "getCompilationUnit", "(", ")", ")", ".", "isOpen", "(", ")", ")", "{", "try", "{", "IGenericType", "genericType", "=", "(", "IGenericType", ")", "(", "(", "JavaElement", ")", "type", ")", ".", "getElementInfo", "(", ")", ";", "remember", "(", "genericType", ",", "typeBinding", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "return", ";", "}", "}", "else", "{", "if", "(", "typeBinding", "==", "null", ")", "return", ";", "TypeDeclaration", "typeDeclaration", "=", "(", "(", "SourceTypeBinding", ")", "typeBinding", ")", ".", "scope", ".", "referenceType", "(", ")", ";", "char", "[", "]", "superclassName", "=", "null", ";", "TypeReference", "superclass", ";", "if", "(", "(", "typeDeclaration", ".", "bits", "&", "ASTNode", ".", "IsAnonymousType", ")", "!=", "0", ")", "{", "superclass", "=", "typeDeclaration", ".", "allocation", ".", "type", ";", "}", "else", "{", "superclass", "=", "typeDeclaration", ".", "superclass", ";", "}", "if", "(", "superclass", "!=", "null", ")", "{", "char", "[", "]", "[", "]", "typeName", "=", "superclass", ".", "getTypeName", "(", ")", ";", "superclassName", "=", "typeName", "==", "null", "?", "null", ":", "typeName", "[", "typeName", ".", "length", "-", "1", "]", ";", "}", "char", "[", "]", "[", "]", "superInterfaceNames", "=", "null", ";", "TypeReference", "[", "]", "superInterfaces", "=", "typeDeclaration", ".", "superInterfaces", ";", "if", "(", "superInterfaces", "!=", "null", ")", "{", "int", "length", "=", "superInterfaces", ".", "length", ";", "superInterfaceNames", "=", "new", "char", "[", "length", "]", "[", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "TypeReference", "superInterface", "=", "superInterfaces", "[", "i", "]", ";", "char", "[", "]", "[", "]", "typeName", "=", "superInterface", ".", "getTypeName", "(", ")", ";", "superInterfaceNames", "[", "i", "]", "=", "typeName", "[", "typeName", ".", "length", "-", "1", "]", ";", "}", "}", "HierarchyType", "hierarchyType", "=", "new", "HierarchyType", "(", "type", ",", "typeDeclaration", ".", "name", ",", "typeDeclaration", ".", "binding", ".", "modifiers", ",", "superclassName", ",", "superInterfaceNames", ")", ";", "remember", "(", "hierarchyType", ",", "typeDeclaration", ".", "binding", ")", ";", "}", "}", "private", "void", "rememberAllTypes", "(", "CompilationUnitDeclaration", "parsedUnit", ",", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", "cu", ",", "boolean", "includeLocalTypes", ")", "{", "TypeDeclaration", "[", "]", "types", "=", "parsedUnit", ".", "types", ";", "if", "(", "types", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ",", "length", "=", "types", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "TypeDeclaration", "type", "=", "types", "[", "i", "]", ";", "rememberWithMemberTypes", "(", "type", ",", "cu", ".", "getType", "(", "new", "String", "(", "type", ".", "name", ")", ")", ")", ";", "}", "}", "if", "(", "includeLocalTypes", "&&", "parsedUnit", ".", "localTypes", "!=", "null", ")", "{", "HandleFactory", "factory", "=", "new", "HandleFactory", "(", ")", ";", "HashSet", "existingElements", "=", "new", "HashSet", "(", "parsedUnit", ".", "localTypeCount", ")", ";", "HashMap", "knownScopes", "=", "new", "HashMap", "(", "parsedUnit", ".", "localTypeCount", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "parsedUnit", ".", "localTypeCount", ";", "i", "++", ")", "{", "LocalTypeBinding", "localType", "=", "parsedUnit", ".", "localTypes", "[", "i", "]", ";", "ClassScope", "classScope", "=", "localType", ".", "scope", ";", "TypeDeclaration", "typeDecl", "=", "classScope", ".", "referenceType", "(", ")", ";", "IType", "typeHandle", "=", "(", "IType", ")", "factory", ".", "createElement", "(", "classScope", ",", "cu", ",", "existingElements", ",", "knownScopes", ")", ";", "rememberWithMemberTypes", "(", "typeDecl", ",", "typeHandle", ")", ";", "}", "}", "}", "private", "void", "rememberWithMemberTypes", "(", "TypeDeclaration", "typeDecl", ",", "IType", "typeHandle", ")", "{", "remember", "(", "typeHandle", ",", "typeDecl", ".", "binding", ")", ";", "TypeDeclaration", "[", "]", "memberTypes", "=", "typeDecl", ".", "memberTypes", ";", "if", "(", "memberTypes", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ",", "length", "=", "memberTypes", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "TypeDeclaration", "memberType", "=", "memberTypes", "[", "i", "]", ";", "rememberWithMemberTypes", "(", "memberType", ",", "typeHandle", ".", "getType", "(", "new", "String", "(", "memberType", ".", "name", ")", ")", ")", ";", "}", "}", "}", "private", "void", "reportHierarchy", "(", "IType", "focus", ",", "TypeDeclaration", "focusLocalType", ",", "ReferenceBinding", "binaryTypeBinding", ")", "{", "if", "(", "focus", "!=", "null", ")", "{", "if", "(", "binaryTypeBinding", "!=", "null", ")", "{", "this", ".", "focusType", "=", "binaryTypeBinding", ";", "}", "else", "{", "if", "(", "focusLocalType", "!=", "null", ")", "{", "this", ".", "focusType", "=", "focusLocalType", ".", "binding", ";", "}", "else", "{", "char", "[", "]", "fullyQualifiedName", "=", "focus", ".", "getFullyQualifiedName", "(", ")", ".", "toCharArray", "(", ")", ";", "setFocusType", "(", "CharOperation", ".", "splitOn", "(", "'.'", ",", "fullyQualifiedName", ")", ")", ";", "}", "}", "}", "fixSupertypeBindings", "(", ")", ";", "int", "objectIndex", "=", "-", "1", ";", "IProgressMonitor", "progressMonitor", "=", "this", ".", "builder", ".", "hierarchy", ".", "progressMonitor", ";", "for", "(", "int", "current", "=", "this", ".", "typeIndex", ";", "current", ">=", "0", ";", "current", "--", ")", "{", "if", "(", "progressMonitor", "!=", "null", "&&", "progressMonitor", ".", "isCanceled", "(", ")", ")", "throw", "new", "OperationCanceledException", "(", ")", ";", "ReferenceBinding", "typeBinding", "=", "this", ".", "typeBindings", "[", "current", "]", ";", "if", "(", "typeBinding", ".", "id", "==", "TypeIds", ".", "T_JavaLangObject", ")", "{", "objectIndex", "=", "current", ";", "continue", ";", "}", "IGenericType", "suppliedType", "=", "this", ".", "typeModels", "[", "current", "]", ";", "if", "(", "!", "subOrSuperOfFocus", "(", "typeBinding", ")", ")", "{", "continue", ";", "}", "IType", "superclass", ";", "if", "(", "typeBinding", ".", "isInterface", "(", ")", ")", "{", "superclass", "=", "null", ";", "}", "else", "{", "superclass", "=", "findSuperClass", "(", "suppliedType", ",", "typeBinding", ")", ";", "}", "IType", "[", "]", "superinterfaces", "=", "findSuperInterfaces", "(", "suppliedType", ",", "typeBinding", ")", ";", "this", ".", "builder", ".", "connect", "(", "suppliedType", ",", "this", ".", "builder", ".", "getHandle", "(", "suppliedType", ",", "typeBinding", ")", ",", "superclass", ",", "superinterfaces", ")", ";", "}", "if", "(", "objectIndex", ">", "-", "1", "&&", "(", "!", "this", ".", "hasMissingSuperClass", "||", "this", ".", "focusType", "==", "null", ")", ")", "{", "IGenericType", "objectType", "=", "this", ".", "typeModels", "[", "objectIndex", "]", ";", "this", ".", "builder", ".", "connect", "(", "objectType", ",", "this", ".", "builder", ".", "getHandle", "(", "objectType", ",", "this", ".", "typeBindings", "[", "objectIndex", "]", ")", ",", "null", ",", "null", ")", ";", "}", "}", "private", "void", "reset", "(", ")", "{", "this", ".", "lookupEnvironment", ".", "reset", "(", ")", ";", "this", ".", "focusType", "=", "null", ";", "this", ".", "superTypesOnly", "=", "false", ";", "this", ".", "typeIndex", "=", "-", "1", ";", "this", ".", "typeModels", "=", "new", "IGenericType", "[", "5", "]", ";", "this", ".", "typeBindings", "=", "new", "ReferenceBinding", "[", "5", "]", ";", "}", "public", "void", "resolve", "(", "IGenericType", "suppliedType", ")", "{", "try", "{", "if", "(", "suppliedType", ".", "isBinaryType", "(", ")", ")", "{", "BinaryTypeBinding", "binaryTypeBinding", "=", "this", ".", "lookupEnvironment", ".", "cacheBinaryType", "(", "(", "IBinaryType", ")", "suppliedType", ",", "false", ",", "null", ")", ";", "remember", "(", "suppliedType", ",", "binaryTypeBinding", ")", ";", "int", "startIndex", "=", "this", ".", "typeIndex", ";", "for", "(", "int", "i", "=", "startIndex", ";", "i", "<=", "this", ".", "typeIndex", ";", "i", "++", ")", "{", "IGenericType", "igType", "=", "this", ".", "typeModels", "[", "i", "]", ";", "if", "(", "igType", "!=", "null", "&&", "igType", ".", "isBinaryType", "(", ")", ")", "{", "CompilationUnitDeclaration", "previousUnitBeingCompleted", "=", "this", ".", "lookupEnvironment", ".", "unitBeingCompleted", ";", "try", "{", "if", "(", "previousUnitBeingCompleted", "==", "null", ")", "{", "this", ".", "lookupEnvironment", ".", "unitBeingCompleted", "=", "FakeUnit", ";", "}", "ReferenceBinding", "typeBinding", "=", "this", ".", "typeBindings", "[", "i", "]", ";", "typeBinding", ".", "superclass", "(", ")", ";", "typeBinding", ".", "superInterfaces", "(", ")", ";", "}", "catch", "(", "AbortCompilation", "e", ")", "{", "}", "finally", "{", "this", ".", "lookupEnvironment", ".", "unitBeingCompleted", "=", "previousUnitBeingCompleted", ";", "}", "}", "}", "this", ".", "superTypesOnly", "=", "true", ";", "reportHierarchy", "(", "this", ".", "builder", ".", "getType", "(", ")", ",", "null", ",", "binaryTypeBinding", ")", ";", "}", "else", "{", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", "cu", "=", "(", "(", "SourceTypeElementInfo", ")", "suppliedType", ")", ".", "getHandle", "(", ")", ".", "getCompilationUnit", "(", ")", ";", "HashSet", "localTypes", "=", "new", "HashSet", "(", ")", ";", "localTypes", ".", "add", "(", "cu", ".", "getPath", "(", ")", ".", "toString", "(", ")", ")", ";", "this", ".", "superTypesOnly", "=", "true", ";", "resolve", "(", "new", "Openable", "[", "]", "{", "(", "Openable", ")", "cu", "}", ",", "localTypes", ",", "null", ")", ";", "}", "}", "catch", "(", "AbortCompilation", "e", ")", "{", "}", "finally", "{", "reset", "(", ")", ";", "}", "}", "public", "void", "resolve", "(", "Openable", "[", "]", "openables", ",", "HashSet", "localTypes", ",", "IProgressMonitor", "monitor", ")", "{", "try", "{", "int", "openablesLength", "=", "openables", ".", "length", ";", "CompilationUnitDeclaration", "[", "]", "parsedUnits", "=", "new", "CompilationUnitDeclaration", "[", "openablesLength", "]", ";", "boolean", "[", "]", "hasLocalType", "=", "new", "boolean", "[", "openablesLength", "]", ";", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", "[", "]", "cus", "=", "new", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", "[", "openablesLength", "]", ";", "int", "unitsIndex", "=", "0", ";", "CompilationUnitDeclaration", "focusUnit", "=", "null", ";", "ReferenceBinding", "focusBinaryBinding", "=", "null", ";", "IType", "focus", "=", "this", ".", "builder", ".", "getType", "(", ")", ";", "Openable", "focusOpenable", "=", "null", ";", "if", "(", "focus", "!=", "null", ")", "{", "if", "(", "focus", ".", "isBinary", "(", ")", ")", "{", "focusOpenable", "=", "(", "Openable", ")", "focus", ".", "getClassFile", "(", ")", ";", "}", "else", "{", "focusOpenable", "=", "(", "Openable", ")", "focus", ".", "getCompilationUnit", "(", ")", ";", "}", "}", "Parser", "parser", "=", "LanguageSupportFactory", ".", "getParser", "(", "this", ",", "this", ".", "lookupEnvironment", ".", "globalOptions", ",", "this", ".", "lookupEnvironment", ".", "problemReporter", ",", "true", ",", "1", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "openablesLength", ";", "i", "++", ")", "{", "Openable", "openable", "=", "openables", "[", "i", "]", ";", "if", "(", "openable", "instanceof", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ")", "{", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", "cu", "=", "(", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ")", "openable", ";", "boolean", "containsLocalType", "=", "false", ";", "if", "(", "localTypes", "==", "null", ")", "{", "containsLocalType", "=", "true", ";", "}", "else", "{", "IPath", "path", "=", "cu", ".", "getPath", "(", ")", ";", "containsLocalType", "=", "localTypes", ".", "contains", "(", "path", ".", "toString", "(", ")", ")", ";", "}", "CompilationUnitDeclaration", "parsedUnit", "=", "null", ";", "if", "(", "cu", ".", "isOpen", "(", ")", ")", "{", "CompilationResult", "result", "=", "new", "CompilationResult", "(", "(", "ICompilationUnit", ")", "cu", ",", "i", ",", "openablesLength", ",", "this", ".", "options", ".", "maxProblemsPerUnit", ")", ";", "SourceTypeElementInfo", "[", "]", "typeInfos", "=", "null", ";", "try", "{", "IType", "[", "]", "topLevelTypes", "=", "cu", ".", "getTypes", "(", ")", ";", "int", "topLevelLength", "=", "topLevelTypes", ".", "length", ";", "if", "(", "topLevelLength", "==", "0", ")", "continue", ";", "typeInfos", "=", "new", "SourceTypeElementInfo", "[", "topLevelLength", "]", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "topLevelLength", ";", "j", "++", ")", "{", "IType", "topLevelType", "=", "topLevelTypes", "[", "j", "]", ";", "typeInfos", "[", "j", "]", "=", "(", "SourceTypeElementInfo", ")", "(", "(", "JavaElement", ")", "topLevelType", ")", ".", "getElementInfo", "(", ")", ";", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "int", "flags", "=", "!", "containsLocalType", "?", "SourceTypeConverter", ".", "MEMBER_TYPE", ":", "SourceTypeConverter", ".", "FIELD_AND_METHOD", "|", "SourceTypeConverter", ".", "MEMBER_TYPE", "|", "SourceTypeConverter", ".", "LOCAL_TYPE", ";", "parsedUnit", "=", "SourceTypeConverter", ".", "buildCompilationUnit", "(", "typeInfos", ",", "flags", ",", "this", ".", "lookupEnvironment", ".", "problemReporter", ",", "result", ")", ";", "if", "(", "containsLocalType", ")", "parsedUnit", ".", "bits", "|=", "ASTNode", ".", "HasAllMethodBodies", ";", "}", "else", "{", "IFile", "file", "=", "(", "IFile", ")", "cu", ".", "getResource", "(", ")", ";", "ICompilationUnit", "sourceUnit", "=", "this", ".", "builder", ".", "createCompilationUnitFromPath", "(", "openable", ",", "file", ")", ";", "CompilationResult", "unitResult", "=", "new", "CompilationResult", "(", "sourceUnit", ",", "i", ",", "openablesLength", ",", "this", ".", "options", ".", "maxProblemsPerUnit", ")", ";", "parsedUnit", "=", "parser", ".", "dietParse", "(", "sourceUnit", ",", "unitResult", ")", ";", "}", "if", "(", "parsedUnit", "!=", "null", ")", "{", "hasLocalType", "[", "unitsIndex", "]", "=", "containsLocalType", ";", "cus", "[", "unitsIndex", "]", "=", "cu", ";", "parsedUnits", "[", "unitsIndex", "++", "]", "=", "parsedUnit", ";", "try", "{", "this", ".", "lookupEnvironment", ".", "buildTypeBindings", "(", "parsedUnit", ",", "null", ")", ";", "if", "(", "openable", ".", "equals", "(", "focusOpenable", ")", ")", "{", "focusUnit", "=", "parsedUnit", ";", "}", "}", "catch", "(", "AbortCompilation", "e", ")", "{", "}", "}", "}", "else", "{", "ClassFile", "classFile", "=", "(", "ClassFile", ")", "openable", ";", "IBinaryType", "binaryType", "=", "(", "IBinaryType", ")", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "getInfo", "(", "classFile", ".", "getType", "(", ")", ")", ";", "if", "(", "binaryType", "==", "null", ")", "{", "if", "(", "classFile", ".", "getPackageFragmentRoot", "(", ")", ".", "isArchive", "(", ")", ")", "{", "binaryType", "=", "this", ".", "builder", ".", "createInfoFromClassFileInJar", "(", "classFile", ")", ";", "}", "else", "{", "IResource", "file", "=", "classFile", ".", "resource", "(", ")", ";", "binaryType", "=", "this", ".", "builder", ".", "createInfoFromClassFile", "(", "classFile", ",", "file", ")", ";", "}", "}", "if", "(", "binaryType", "!=", "null", ")", "{", "try", "{", "BinaryTypeBinding", "binaryTypeBinding", "=", "this", ".", "lookupEnvironment", ".", "cacheBinaryType", "(", "binaryType", ",", "false", ",", "null", ")", ";", "remember", "(", "binaryType", ",", "binaryTypeBinding", ")", ";", "if", "(", "openable", ".", "equals", "(", "focusOpenable", ")", ")", "{", "focusBinaryBinding", "=", "binaryTypeBinding", ";", "}", "}", "catch", "(", "AbortCompilation", "e", ")", "{", "}", "}", "}", "}", "TypeDeclaration", "focusLocalType", "=", "null", ";", "if", "(", "focus", "!=", "null", "&&", "focusBinaryBinding", "==", "null", "&&", "focusUnit", "!=", "null", "&&", "(", "(", "Member", ")", "focus", ")", ".", "getOuterMostLocalContext", "(", ")", "!=", "null", ")", "{", "focusLocalType", "=", "new", "ASTNodeFinder", "(", "focusUnit", ")", ".", "findType", "(", "focus", ")", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<=", "this", ".", "typeIndex", ";", "i", "++", ")", "{", "IGenericType", "suppliedType", "=", "this", ".", "typeModels", "[", "i", "]", ";", "if", "(", "suppliedType", "!=", "null", "&&", "suppliedType", ".", "isBinaryType", "(", ")", ")", "{", "CompilationUnitDeclaration", "previousUnitBeingCompleted", "=", "this", ".", "lookupEnvironment", ".", "unitBeingCompleted", ";", "try", "{", "if", "(", "previousUnitBeingCompleted", "==", "null", ")", "{", "this", ".", "lookupEnvironment", ".", "unitBeingCompleted", "=", "FakeUnit", ";", "}", "ReferenceBinding", "typeBinding", "=", "this", ".", "typeBindings", "[", "i", "]", ";", "typeBinding", ".", "superclass", "(", ")", ";", "typeBinding", ".", "superInterfaces", "(", ")", ";", "}", "catch", "(", "AbortCompilation", "e", ")", "{", "}", "finally", "{", "this", ".", "lookupEnvironment", ".", "unitBeingCompleted", "=", "previousUnitBeingCompleted", ";", "}", "}", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "unitsIndex", ";", "i", "++", ")", "{", "CompilationUnitDeclaration", "parsedUnit", "=", "parsedUnits", "[", "i", "]", ";", "if", "(", "parsedUnit", "!=", "null", ")", "{", "try", "{", "if", "(", "hasLocalType", "[", "i", "]", ")", "{", "if", "(", "monitor", "!=", "null", "&&", "monitor", ".", "isCanceled", "(", ")", ")", "throw", "new", "OperationCanceledException", "(", ")", ";", "parser", ".", "getMethodBodies", "(", "parsedUnit", ")", ";", "}", "}", "catch", "(", "AbortCompilation", "e", ")", "{", "hasLocalType", "[", "i", "]", "=", "false", ";", "}", "}", "}", "try", "{", "this", ".", "lookupEnvironment", ".", "completeTypeBindings", "(", "parsedUnits", ",", "hasLocalType", ",", "unitsIndex", ")", ";", "}", "catch", "(", "AbortCompilation", "e", ")", "{", "}", "worked", "(", "monitor", ",", "1", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "unitsIndex", ";", "i", "++", ")", "{", "CompilationUnitDeclaration", "parsedUnit", "=", "parsedUnits", "[", "i", "]", ";", "if", "(", "parsedUnit", "!=", "null", ")", "{", "boolean", "containsLocalType", "=", "hasLocalType", "[", "i", "]", ";", "if", "(", "containsLocalType", ")", "{", "if", "(", "monitor", "!=", "null", "&&", "monitor", ".", "isCanceled", "(", ")", ")", "throw", "new", "OperationCanceledException", "(", ")", ";", "parsedUnit", ".", "scope", ".", "faultInTypes", "(", ")", ";", "parsedUnit", ".", "resolve", "(", ")", ";", "}", "rememberAllTypes", "(", "parsedUnit", ",", "cus", "[", "i", "]", ",", "containsLocalType", ")", ";", "}", "}", "if", "(", "focusBinaryBinding", "==", "null", "&&", "focus", "!=", "null", "&&", "focus", ".", "isBinary", "(", ")", ")", "{", "char", "[", "]", "fullyQualifiedName", "=", "focus", ".", "getFullyQualifiedName", "(", ")", ".", "toCharArray", "(", ")", ";", "focusBinaryBinding", "=", "this", ".", "lookupEnvironment", ".", "getCachedType", "(", "CharOperation", ".", "splitOn", "(", "'.'", ",", "fullyQualifiedName", ")", ")", ";", "if", "(", "focusBinaryBinding", "==", "null", ")", "return", ";", "}", "reportHierarchy", "(", "focus", ",", "focusLocalType", ",", "focusBinaryBinding", ")", ";", "}", "catch", "(", "ClassCastException", "e", ")", "{", "}", "catch", "(", "AbortCompilation", "e", ")", "{", "if", "(", "TypeHierarchy", ".", "DEBUG", ")", "e", ".", "printStackTrace", "(", ")", ";", "}", "finally", "{", "reset", "(", ")", ";", "}", "}", "private", "void", "setEnvironment", "(", "LookupEnvironment", "lookupEnvironment", ",", "HierarchyBuilder", "builder", ")", "{", "this", ".", "lookupEnvironment", "=", "lookupEnvironment", ";", "this", ".", "builder", "=", "builder", ";", "this", ".", "typeIndex", "=", "-", "1", ";", "this", ".", "typeModels", "=", "new", "IGenericType", "[", "5", "]", ";", "this", ".", "typeBindings", "=", "new", "ReferenceBinding", "[", "5", "]", ";", "}", "public", "ReferenceBinding", "setFocusType", "(", "char", "[", "]", "[", "]", "compoundName", ")", "{", "if", "(", "compoundName", "==", "null", "||", "this", ".", "lookupEnvironment", "==", "null", ")", "return", "null", ";", "this", ".", "focusType", "=", "this", ".", "lookupEnvironment", ".", "getCachedType", "(", "compoundName", ")", ";", "if", "(", "this", ".", "focusType", "==", "null", ")", "{", "this", ".", "focusType", "=", "this", ".", "lookupEnvironment", ".", "askForType", "(", "compoundName", ")", ";", "if", "(", "this", ".", "focusType", "==", "null", ")", "{", "int", "length", "=", "compoundName", ".", "length", ";", "char", "[", "]", "typeName", "=", "compoundName", "[", "length", "-", "1", "]", ";", "int", "firstDollar", "=", "CharOperation", ".", "indexOf", "(", "'$'", ",", "typeName", ")", ";", "if", "(", "firstDollar", "!=", "-", "1", ")", "{", "compoundName", "[", "length", "-", "1", "]", "=", "CharOperation", ".", "subarray", "(", "typeName", ",", "0", ",", "firstDollar", ")", ";", "this", ".", "focusType", "=", "this", ".", "lookupEnvironment", ".", "askForType", "(", "compoundName", ")", ";", "if", "(", "this", ".", "focusType", "!=", "null", ")", "{", "char", "[", "]", "[", "]", "memberTypeNames", "=", "CharOperation", ".", "splitOn", "(", "'$'", ",", "typeName", ",", "firstDollar", "+", "1", ",", "typeName", ".", "length", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "memberTypeNames", ".", "length", ";", "i", "++", ")", "{", "this", ".", "focusType", "=", "this", ".", "focusType", ".", "getMemberType", "(", "memberTypeNames", "[", "i", "]", ")", ";", "}", "}", "}", "}", "}", "return", "this", ".", "focusType", ";", "}", "public", "boolean", "subOrSuperOfFocus", "(", "ReferenceBinding", "typeBinding", ")", "{", "if", "(", "this", ".", "focusType", "==", "null", ")", "return", "true", ";", "try", "{", "if", "(", "subTypeOfType", "(", "this", ".", "focusType", ",", "typeBinding", ")", ")", "return", "true", ";", "if", "(", "!", "this", ".", "superTypesOnly", "&&", "subTypeOfType", "(", "typeBinding", ",", "this", ".", "focusType", ")", ")", "return", "true", ";", "}", "catch", "(", "AbortCompilation", "e", ")", "{", "}", "return", "false", ";", "}", "private", "boolean", "subTypeOfType", "(", "ReferenceBinding", "subType", ",", "ReferenceBinding", "typeBinding", ")", "{", "if", "(", "typeBinding", "==", "null", "||", "subType", "==", "null", ")", "return", "false", ";", "if", "(", "subType", "==", "typeBinding", ")", "return", "true", ";", "ReferenceBinding", "superclass", "=", "subType", ".", "superclass", "(", ")", ";", "if", "(", "superclass", "!=", "null", ")", "superclass", "=", "(", "ReferenceBinding", ")", "superclass", ".", "erasure", "(", ")", ";", "if", "(", "subTypeOfType", "(", "superclass", ",", "typeBinding", ")", ")", "return", "true", ";", "ReferenceBinding", "[", "]", "superInterfaces", "=", "subType", ".", "superInterfaces", "(", ")", ";", "if", "(", "superInterfaces", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ",", "length", "=", "superInterfaces", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "ReferenceBinding", "superInterface", "=", "(", "ReferenceBinding", ")", "superInterfaces", "[", "i", "]", ".", "erasure", "(", ")", ";", "if", "(", "subTypeOfType", "(", "superInterface", ",", "typeBinding", ")", ")", "return", "true", ";", "}", "}", "return", "false", ";", "}", "protected", "void", "worked", "(", "IProgressMonitor", "monitor", ",", "int", "work", ")", "{", "if", "(", "monitor", "!=", "null", ")", "{", "if", "(", "monitor", ".", "isCanceled", "(", ")", ")", "{", "throw", "new", "OperationCanceledException", "(", ")", ";", "}", "else", "{", "monitor", ".", "worked", "(", "work", ")", ";", "}", "}", "}", "}", "</s>" ]
5,293
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "hierarchy", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "SubProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IClassFile", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IPackageFragment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IPackageFragmentRoot", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "JavaModelManager", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "JavaProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "Openable", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "SearchableEnvironment", ";", "public", "class", "RegionBasedHierarchyBuilder", "extends", "HierarchyBuilder", "{", "public", "RegionBasedHierarchyBuilder", "(", "TypeHierarchy", "hierarchy", ")", "throws", "JavaModelException", "{", "super", "(", "hierarchy", ")", ";", "}", "public", "void", "build", "(", "boolean", "computeSubtypes", ")", "{", "JavaModelManager", "manager", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ";", "try", "{", "manager", ".", "cacheZipFiles", "(", "this", ")", ";", "if", "(", "this", ".", "hierarchy", ".", "focusType", "==", "null", "||", "computeSubtypes", ")", "{", "IProgressMonitor", "typeInRegionMonitor", "=", "this", ".", "hierarchy", ".", "progressMonitor", "==", "null", "?", "null", ":", "new", "SubProgressMonitor", "(", "this", ".", "hierarchy", ".", "progressMonitor", ",", "30", ")", ";", "HashMap", "allOpenablesInRegion", "=", "determineOpenablesInRegion", "(", "typeInRegionMonitor", ")", ";", "this", ".", "hierarchy", ".", "initialize", "(", "allOpenablesInRegion", ".", "size", "(", ")", ")", ";", "IProgressMonitor", "buildMonitor", "=", "this", ".", "hierarchy", ".", "progressMonitor", "==", "null", "?", "null", ":", "new", "SubProgressMonitor", "(", "this", ".", "hierarchy", ".", "progressMonitor", ",", "70", ")", ";", "createTypeHierarchyBasedOnRegion", "(", "allOpenablesInRegion", ",", "buildMonitor", ")", ";", "(", "(", "RegionBasedTypeHierarchy", ")", "this", ".", "hierarchy", ")", ".", "pruneDeadBranches", "(", ")", ";", "}", "else", "{", "this", ".", "hierarchy", ".", "initialize", "(", "1", ")", ";", "buildSupertypes", "(", ")", ";", "}", "}", "finally", "{", "manager", ".", "flushZipFiles", "(", "this", ")", ";", "}", "}", "private", "void", "createTypeHierarchyBasedOnRegion", "(", "HashMap", "allOpenablesInRegion", ",", "IProgressMonitor", "monitor", ")", "{", "try", "{", "int", "size", "=", "allOpenablesInRegion", ".", "size", "(", ")", ";", "if", "(", "monitor", "!=", "null", ")", "monitor", ".", "beginTask", "(", "\"\"", ",", "size", "*", "2", ")", ";", "this", ".", "infoToHandle", "=", "new", "HashMap", "(", "size", ")", ";", "Iterator", "javaProjects", "=", "allOpenablesInRegion", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "javaProjects", ".", "hasNext", "(", ")", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "javaProjects", ".", "next", "(", ")", ";", "JavaProject", "project", "=", "(", "JavaProject", ")", "entry", ".", "getKey", "(", ")", ";", "ArrayList", "allOpenables", "=", "(", "ArrayList", ")", "entry", ".", "getValue", "(", ")", ";", "Openable", "[", "]", "openables", "=", "new", "Openable", "[", "allOpenables", ".", "size", "(", ")", "]", ";", "allOpenables", ".", "toArray", "(", "openables", ")", ";", "try", "{", "SearchableEnvironment", "searchableEnvironment", "=", "project", ".", "newSearchableNameEnvironment", "(", "this", ".", "hierarchy", ".", "workingCopies", ")", ";", "this", ".", "nameLookup", "=", "searchableEnvironment", ".", "nameLookup", ";", "this", ".", "hierarchyResolver", ".", "resolve", "(", "openables", ",", "null", ",", "monitor", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "}", "}", "finally", "{", "if", "(", "monitor", "!=", "null", ")", "monitor", ".", "done", "(", ")", ";", "}", "}", "private", "HashMap", "determineOpenablesInRegion", "(", "IProgressMonitor", "monitor", ")", "{", "try", "{", "HashMap", "allOpenables", "=", "new", "HashMap", "(", ")", ";", "IJavaElement", "[", "]", "roots", "=", "(", "(", "RegionBasedTypeHierarchy", ")", "this", ".", "hierarchy", ")", ".", "region", ".", "getElements", "(", ")", ";", "int", "length", "=", "roots", ".", "length", ";", "if", "(", "monitor", "!=", "null", ")", "monitor", ".", "beginTask", "(", "\"\"", ",", "length", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IJavaElement", "root", "=", "roots", "[", "i", "]", ";", "IJavaProject", "javaProject", "=", "root", ".", "getJavaProject", "(", ")", ";", "ArrayList", "openables", "=", "(", "ArrayList", ")", "allOpenables", ".", "get", "(", "javaProject", ")", ";", "if", "(", "openables", "==", "null", ")", "{", "openables", "=", "new", "ArrayList", "(", ")", ";", "allOpenables", ".", "put", "(", "javaProject", ",", "openables", ")", ";", "}", "switch", "(", "root", ".", "getElementType", "(", ")", ")", "{", "case", "IJavaElement", ".", "JAVA_PROJECT", ":", "injectAllOpenablesForJavaProject", "(", "(", "IJavaProject", ")", "root", ",", "openables", ")", ";", "break", ";", "case", "IJavaElement", ".", "PACKAGE_FRAGMENT_ROOT", ":", "injectAllOpenablesForPackageFragmentRoot", "(", "(", "IPackageFragmentRoot", ")", "root", ",", "openables", ")", ";", "break", ";", "case", "IJavaElement", ".", "PACKAGE_FRAGMENT", ":", "injectAllOpenablesForPackageFragment", "(", "(", "IPackageFragment", ")", "root", ",", "openables", ")", ";", "break", ";", "case", "IJavaElement", ".", "CLASS_FILE", ":", "case", "IJavaElement", ".", "COMPILATION_UNIT", ":", "openables", ".", "add", "(", "root", ")", ";", "break", ";", "case", "IJavaElement", ".", "TYPE", ":", "IType", "type", "=", "(", "IType", ")", "root", ";", "if", "(", "type", ".", "isBinary", "(", ")", ")", "{", "openables", ".", "add", "(", "type", ".", "getClassFile", "(", ")", ")", ";", "}", "else", "{", "openables", ".", "add", "(", "type", ".", "getCompilationUnit", "(", ")", ")", ";", "}", "break", ";", "default", ":", "break", ";", "}", "worked", "(", "monitor", ",", "1", ")", ";", "}", "return", "allOpenables", ";", "}", "finally", "{", "if", "(", "monitor", "!=", "null", ")", "monitor", ".", "done", "(", ")", ";", "}", "}", "private", "void", "injectAllOpenablesForJavaProject", "(", "IJavaProject", "project", ",", "ArrayList", "openables", ")", "{", "try", "{", "IPackageFragmentRoot", "[", "]", "devPathRoots", "=", "(", "(", "JavaProject", ")", "project", ")", ".", "getPackageFragmentRoots", "(", ")", ";", "if", "(", "devPathRoots", "==", "null", ")", "{", "return", ";", "}", "for", "(", "int", "j", "=", "0", ";", "j", "<", "devPathRoots", ".", "length", ";", "j", "++", ")", "{", "IPackageFragmentRoot", "root", "=", "devPathRoots", "[", "j", "]", ";", "injectAllOpenablesForPackageFragmentRoot", "(", "root", ",", "openables", ")", ";", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "}", "private", "void", "injectAllOpenablesForPackageFragment", "(", "IPackageFragment", "packFrag", ",", "ArrayList", "openables", ")", "{", "try", "{", "IPackageFragmentRoot", "root", "=", "(", "IPackageFragmentRoot", ")", "packFrag", ".", "getParent", "(", ")", ";", "int", "kind", "=", "root", ".", "getKind", "(", ")", ";", "if", "(", "kind", "!=", "0", ")", "{", "boolean", "isSourcePackageFragment", "=", "(", "kind", "==", "IPackageFragmentRoot", ".", "K_SOURCE", ")", ";", "if", "(", "isSourcePackageFragment", ")", "{", "ICompilationUnit", "[", "]", "cus", "=", "packFrag", ".", "getCompilationUnits", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "cus", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "openables", ".", "add", "(", "cus", "[", "i", "]", ")", ";", "}", "}", "else", "{", "IClassFile", "[", "]", "classFiles", "=", "packFrag", ".", "getClassFiles", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "classFiles", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "openables", ".", "add", "(", "classFiles", "[", "i", "]", ")", ";", "}", "}", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "}", "private", "void", "injectAllOpenablesForPackageFragmentRoot", "(", "IPackageFragmentRoot", "root", ",", "ArrayList", "openables", ")", "{", "try", "{", "IJavaElement", "[", "]", "packFrags", "=", "root", ".", "getChildren", "(", ")", ";", "for", "(", "int", "k", "=", "0", ";", "k", "<", "packFrags", ".", "length", ";", "k", "++", ")", "{", "IPackageFragment", "packFrag", "=", "(", "IPackageFragment", ")", "packFrags", "[", "k", "]", ";", "injectAllOpenablesForPackageFragment", "(", "packFrag", ",", "openables", ")", ";", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "return", ";", "}", "}", "}", "</s>" ]
5,294
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "hierarchy", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "search", ".", "IJavaSearchScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "CompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "JavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "Openable", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "Region", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "TypeVector", ";", "public", "class", "RegionBasedTypeHierarchy", "extends", "TypeHierarchy", "{", "protected", "IRegion", "region", ";", "public", "RegionBasedTypeHierarchy", "(", "IRegion", "region", ",", "ICompilationUnit", "[", "]", "workingCopies", ",", "IType", "type", ",", "boolean", "computeSubtypes", ")", "{", "super", "(", "type", ",", "workingCopies", ",", "(", "IJavaSearchScope", ")", "null", ",", "computeSubtypes", ")", ";", "Region", "newRegion", "=", "new", "Region", "(", ")", "{", "public", "void", "add", "(", "IJavaElement", "element", ")", "{", "if", "(", "!", "contains", "(", "element", ")", ")", "{", "removeAllChildren", "(", "element", ")", ";", "this", ".", "rootElements", ".", "add", "(", "element", ")", ";", "if", "(", "element", ".", "getElementType", "(", ")", "==", "IJavaElement", ".", "JAVA_PROJECT", ")", "{", "try", "{", "IPackageFragmentRoot", "[", "]", "roots", "=", "(", "(", "IJavaProject", ")", "element", ")", ".", "getPackageFragmentRoots", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "roots", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "if", "(", "roots", "[", "i", "]", ".", "isArchive", "(", ")", "&&", "!", "this", ".", "rootElements", ".", "contains", "(", "roots", "[", "i", "]", ")", ")", "this", ".", "rootElements", ".", "add", "(", "roots", "[", "i", "]", ")", ";", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "}", "this", ".", "rootElements", ".", "trimToSize", "(", ")", ";", "}", "}", "}", ";", "IJavaElement", "[", "]", "elements", "=", "region", ".", "getElements", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "elements", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "newRegion", ".", "add", "(", "elements", "[", "i", "]", ")", ";", "}", "this", ".", "region", "=", "newRegion", ";", "if", "(", "elements", ".", "length", ">", "0", ")", "this", ".", "project", "=", "elements", "[", "0", "]", ".", "getJavaProject", "(", ")", ";", "}", "protected", "void", "initializeRegions", "(", ")", "{", "super", ".", "initializeRegions", "(", ")", ";", "IJavaElement", "[", "]", "roots", "=", "this", ".", "region", ".", "getElements", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "roots", ".", "length", ";", "i", "++", ")", "{", "IJavaElement", "root", "=", "roots", "[", "i", "]", ";", "if", "(", "root", "instanceof", "IOpenable", ")", "{", "this", ".", "files", ".", "put", "(", "root", ",", "new", "ArrayList", "(", ")", ")", ";", "}", "else", "{", "Openable", "o", "=", "(", "Openable", ")", "(", "(", "JavaElement", ")", "root", ")", ".", "getOpenableParent", "(", ")", ";", "if", "(", "o", "!=", "null", ")", "{", "this", ".", "files", ".", "put", "(", "o", ",", "new", "ArrayList", "(", ")", ")", ";", "}", "}", "checkCanceled", "(", ")", ";", "}", "}", "protected", "void", "compute", "(", ")", "throws", "JavaModelException", ",", "CoreException", "{", "HierarchyBuilder", "builder", "=", "new", "RegionBasedHierarchyBuilder", "(", "this", ")", ";", "builder", ".", "build", "(", "this", ".", "computeSubtypes", ")", ";", "}", "protected", "boolean", "isAffectedByOpenable", "(", "IJavaElementDelta", "delta", ",", "IJavaElement", "element", ",", "int", "eventType", ")", "{", "if", "(", "element", "instanceof", "CompilationUnit", "&&", "(", "(", "CompilationUnit", ")", "element", ")", ".", "isWorkingCopy", "(", ")", ")", "{", "return", "super", ".", "isAffectedByOpenable", "(", "delta", ",", "element", ",", "eventType", ")", ";", "}", "if", "(", "this", ".", "focusType", "==", "null", ")", "{", "return", "this", ".", "region", ".", "contains", "(", "element", ")", ";", "}", "else", "{", "return", "super", ".", "isAffectedByOpenable", "(", "delta", ",", "element", ",", "eventType", ")", ";", "}", "}", "public", "IJavaProject", "javaProject", "(", ")", "{", "return", "this", ".", "project", ";", "}", "public", "void", "pruneDeadBranches", "(", ")", "{", "pruneDeadBranches", "(", "getRootClasses", "(", ")", ")", ";", "pruneDeadBranches", "(", "getRootInterfaces", "(", ")", ")", ";", "}", "private", "boolean", "pruneDeadBranches", "(", "IType", "type", ")", "{", "TypeVector", "subtypes", "=", "(", "TypeVector", ")", "this", ".", "typeToSubtypes", ".", "get", "(", "type", ")", ";", "if", "(", "subtypes", "==", "null", ")", "return", "true", ";", "pruneDeadBranches", "(", "subtypes", ".", "copy", "(", ")", ".", "elements", "(", ")", ")", ";", "subtypes", "=", "(", "TypeVector", ")", "this", ".", "typeToSubtypes", ".", "get", "(", "type", ")", ";", "return", "(", "subtypes", "==", "null", "||", "subtypes", ".", "size", "==", "0", ")", ";", "}", "private", "void", "pruneDeadBranches", "(", "IType", "[", "]", "types", ")", "{", "for", "(", "int", "i", "=", "0", ",", "length", "=", "types", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IType", "type", "=", "types", "[", "i", "]", ";", "if", "(", "pruneDeadBranches", "(", "type", ")", "&&", "!", "this", ".", "region", ".", "contains", "(", "type", ")", ")", "{", "removeType", "(", "type", ")", ";", "}", "}", "}", "protected", "void", "removeType", "(", "IType", "type", ")", "{", "IType", "[", "]", "subtypes", "=", "getSubtypes", "(", "type", ")", ";", "this", ".", "typeToSubtypes", ".", "remove", "(", "type", ")", ";", "if", "(", "subtypes", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "subtypes", ".", "length", ";", "i", "++", ")", "{", "removeType", "(", "subtypes", "[", "i", "]", ")", ";", "}", "}", "IType", "superclass", "=", "(", "IType", ")", "this", ".", "classToSuperclass", ".", "remove", "(", "type", ")", ";", "if", "(", "superclass", "!=", "null", ")", "{", "TypeVector", "types", "=", "(", "TypeVector", ")", "this", ".", "typeToSubtypes", ".", "get", "(", "superclass", ")", ";", "if", "(", "types", "!=", "null", ")", "types", ".", "remove", "(", "type", ")", ";", "}", "IType", "[", "]", "superinterfaces", "=", "(", "IType", "[", "]", ")", "this", ".", "typeToSuperInterfaces", ".", "remove", "(", "type", ")", ";", "if", "(", "superinterfaces", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ",", "length", "=", "superinterfaces", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IType", "superinterface", "=", "superinterfaces", "[", "i", "]", ";", "TypeVector", "types", "=", "(", "TypeVector", ")", "this", ".", "typeToSubtypes", ".", "get", "(", "superinterface", ")", ";", "if", "(", "types", "!=", "null", ")", "types", ".", "remove", "(", "type", ")", ";", "}", "}", "this", ".", "interfaces", ".", "remove", "(", "type", ")", ";", "}", "}", "</s>" ]
5,295
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IMemberValuePair", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "MemberValuePair", "implements", "IMemberValuePair", "{", "String", "memberName", ";", "public", "Object", "value", ";", "public", "int", "valueKind", "=", "K_UNKNOWN", ";", "public", "MemberValuePair", "(", "String", "memberName", ")", "{", "this", ".", "memberName", "=", "memberName", ";", "}", "public", "MemberValuePair", "(", "String", "memberName", ",", "Object", "value", ",", "int", "valueKind", ")", "{", "this", "(", "memberName", ")", ";", "this", ".", "value", "=", "value", ";", "this", ".", "valueKind", "=", "valueKind", ";", "}", "public", "boolean", "equals", "(", "Object", "obj", ")", "{", "if", "(", "!", "(", "obj", "instanceof", "MemberValuePair", ")", ")", "{", "return", "false", ";", "}", "MemberValuePair", "other", "=", "(", "MemberValuePair", ")", "obj", ";", "return", "this", ".", "valueKind", "==", "other", ".", "valueKind", "&&", "this", ".", "memberName", ".", "equals", "(", "other", ".", "memberName", ")", "&&", "(", "this", ".", "value", "==", "other", ".", "value", "||", "(", "this", ".", "value", "!=", "null", "&&", "this", ".", "value", ".", "equals", "(", "other", ".", "value", ")", ")", "||", "(", "this", ".", "value", "instanceof", "Object", "[", "]", "&&", "other", ".", "value", "instanceof", "Object", "[", "]", "&&", "Util", ".", "equalArraysOrNull", "(", "(", "Object", "[", "]", ")", "this", ".", "value", ",", "(", "Object", "[", "]", ")", "other", ".", "value", ")", ")", ")", ";", "}", "public", "String", "getMemberName", "(", ")", "{", "return", "this", ".", "memberName", ";", "}", "public", "Object", "getValue", "(", ")", "{", "return", "this", ".", "value", ";", "}", "public", "int", "getValueKind", "(", ")", "{", "return", "this", ".", "valueKind", ";", "}", "public", "int", "hashCode", "(", ")", "{", "final", "int", "prime", "=", "31", ";", "int", "result", "=", "1", ";", "result", "=", "prime", "*", "result", "+", "(", "(", "this", ".", "memberName", "==", "null", ")", "?", "0", ":", "this", ".", "memberName", ".", "hashCode", "(", ")", ")", ";", "result", "=", "prime", "*", "result", "+", "(", "(", "this", ".", "value", "==", "null", ")", "?", "0", ":", "this", ".", "value", ".", "hashCode", "(", ")", ")", ";", "result", "=", "prime", "*", "result", "+", "this", ".", "valueKind", ";", "return", "result", ";", "}", "}", "</s>" ]
5,296
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElementDelta", ";", "public", "class", "SimpleDelta", "{", "protected", "int", "kind", "=", "0", ";", "protected", "int", "changeFlags", "=", "0", ";", "public", "void", "added", "(", ")", "{", "this", ".", "kind", "=", "IJavaElementDelta", ".", "ADDED", ";", "}", "public", "void", "changed", "(", "int", "flags", ")", "{", "this", ".", "kind", "=", "IJavaElementDelta", ".", "CHANGED", ";", "this", ".", "changeFlags", "|=", "flags", ";", "}", "public", "int", "getFlags", "(", ")", "{", "return", "this", ".", "changeFlags", ";", "}", "public", "int", "getKind", "(", ")", "{", "return", "this", ".", "kind", ";", "}", "public", "void", "modifiers", "(", ")", "{", "changed", "(", "IJavaElementDelta", ".", "F_MODIFIERS", ")", ";", "}", "public", "void", "removed", "(", ")", "{", "this", ".", "kind", "=", "IJavaElementDelta", ".", "REMOVED", ";", "this", ".", "changeFlags", "=", "0", ";", "}", "public", "void", "superTypes", "(", ")", "{", "changed", "(", "IJavaElementDelta", ".", "F_SUPER_TYPES", ")", ";", "}", "protected", "void", "toDebugString", "(", "StringBuffer", "buffer", ")", "{", "buffer", ".", "append", "(", "\"[\"", ")", ";", "switch", "(", "getKind", "(", ")", ")", "{", "case", "IJavaElementDelta", ".", "ADDED", ":", "buffer", ".", "append", "(", "'+'", ")", ";", "break", ";", "case", "IJavaElementDelta", ".", "REMOVED", ":", "buffer", ".", "append", "(", "'-'", ")", ";", "break", ";", "case", "IJavaElementDelta", ".", "CHANGED", ":", "buffer", ".", "append", "(", "'*'", ")", ";", "break", ";", "default", ":", "buffer", ".", "append", "(", "'?'", ")", ";", "break", ";", "}", "buffer", ".", "append", "(", "\"]:", "{\"", ")", ";", "toDebugString", "(", "buffer", ",", "getFlags", "(", ")", ")", ";", "buffer", ".", "append", "(", "\"}\"", ")", ";", "}", "protected", "boolean", "toDebugString", "(", "StringBuffer", "buffer", ",", "int", "flags", ")", "{", "boolean", "prev", "=", "false", ";", "if", "(", "(", "flags", "&", "IJavaElementDelta", ".", "F_MODIFIERS", ")", "!=", "0", ")", "{", "if", "(", "prev", ")", "buffer", ".", "append", "(", "\"", "|", "\"", ")", ";", "buffer", ".", "append", "(", "\"\"", ")", ";", "prev", "=", "true", ";", "}", "if", "(", "(", "flags", "&", "IJavaElementDelta", ".", "F_SUPER_TYPES", ")", "!=", "0", ")", "{", "if", "(", "prev", ")", "buffer", ".", "append", "(", "\"", "|", "\"", ")", ";", "buffer", ".", "append", "(", "\"\"", ")", ";", "prev", "=", "true", ";", "}", "return", "prev", ";", "}", "public", "String", "toString", "(", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "toDebugString", "(", "buffer", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "}", "</s>" ]
5,297
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "io", ".", "*", ";", "import", "java", ".", "net", ".", "URI", ";", "import", "java", ".", "text", ".", "MessageFormat", ";", "import", "java", ".", "util", ".", "*", ";", "import", "java", ".", "util", ".", "Map", ".", "Entry", ";", "import", "java", ".", "util", ".", "zip", ".", "ZipFile", ";", "import", "javax", ".", "xml", ".", "parsers", ".", "DocumentBuilder", ";", "import", "javax", ".", "xml", ".", "parsers", ".", "DocumentBuilderFactory", ";", "import", "javax", ".", "xml", ".", "parsers", ".", "ParserConfigurationException", ";", "import", "org", ".", "codehaus", ".", "jdt", ".", "groovy", ".", "integration", ".", "LanguageSupportFactory", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "*", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "*", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "content", ".", "IContentTypeManager", ".", "ContentTypeChangeEvent", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "content", ".", "IContentTypeManager", ".", "IContentTypeChangeListener", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "jobs", ".", "Job", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "preferences", ".", "DefaultScope", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "preferences", ".", "IEclipsePreferences", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "preferences", ".", "IPreferencesService", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "preferences", ".", "IScopeContext", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "preferences", ".", "InstanceScope", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "preferences", ".", "IEclipsePreferences", ".", "PreferenceChangeEvent", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CompilationParticipant", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "IProblem", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "formatter", ".", "DefaultCodeFormatterConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "codeassist", ".", "CompletionEngine", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "codeassist", ".", "SelectionEngine", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "AbstractAnnotationProcessorManager", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "Compiler", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "AccessRestriction", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "impl", ".", "CompilerOptions", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "HashtableOfObjectToInt", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "JavaProjectElementInfo", ".", "ProjectCache", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "builder", ".", "JavaBuilder", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "hierarchy", ".", "TypeHierarchy", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "AbstractSearchScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "BasicSearchEngine", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "IRestrictedAccessTypeRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "JavaWorkspaceScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "indexing", ".", "IndexManager", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "processing", ".", "JobManager", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "HashtableOfArrayToObject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "LRUCache", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Messages", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "WeakHashSet", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "WeakHashSetOfCharArray", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "LRUCache", ".", "Stats", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ".", "DefaultCodeFormatter", ";", "import", "org", ".", "osgi", ".", "service", ".", "prefs", ".", "BackingStoreException", ";", "import", "org", ".", "w3c", ".", "dom", ".", "Element", ";", "import", "org", ".", "w3c", ".", "dom", ".", "Node", ";", "import", "org", ".", "w3c", ".", "dom", ".", "NodeList", ";", "import", "org", ".", "xml", ".", "sax", ".", "InputSource", ";", "import", "org", ".", "xml", ".", "sax", ".", "SAXException", ";", "public", "class", "JavaModelManager", "implements", "ISaveParticipant", ",", "IContentTypeChangeListener", "{", "static", "class", "ZipCache", "{", "private", "Map", "map", ";", "Object", "owner", ";", "ZipCache", "(", "Object", "owner", ")", "{", "this", ".", "map", "=", "new", "HashMap", "(", ")", ";", "this", ".", "owner", "=", "owner", ";", "}", "public", "void", "flush", "(", ")", "{", "Thread", "currentThread", "=", "Thread", ".", "currentThread", "(", ")", ";", "Iterator", "iterator", "=", "this", ".", "map", ".", "values", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "try", "{", "ZipFile", "zipFile", "=", "(", "ZipFile", ")", "iterator", ".", "next", "(", ")", ";", "if", "(", "JavaModelManager", ".", "ZIP_ACCESS_VERBOSE", ")", "{", "System", ".", "out", ".", "println", "(", "\"(\"", "+", "currentThread", "+", "\"\"", "+", "zipFile", ".", "getName", "(", ")", ")", ";", "}", "zipFile", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "}", "}", "}", "public", "ZipFile", "getCache", "(", "IPath", "path", ")", "{", "return", "(", "ZipFile", ")", "this", ".", "map", ".", "get", "(", "path", ")", ";", "}", "public", "void", "setCache", "(", "IPath", "path", ",", "ZipFile", "zipFile", ")", "{", "this", ".", "map", ".", "put", "(", "path", ",", "zipFile", ")", ";", "}", "}", "final", "JavaModel", "javaModel", "=", "new", "JavaModel", "(", ")", ";", "public", "HashMap", "variables", "=", "new", "HashMap", "(", "5", ")", ";", "public", "HashSet", "variablesWithInitializer", "=", "new", "HashSet", "(", "5", ")", ";", "public", "HashMap", "deprecatedVariables", "=", "new", "HashMap", "(", "5", ")", ";", "public", "HashSet", "readOnlyVariables", "=", "new", "HashSet", "(", "5", ")", ";", "public", "HashMap", "previousSessionVariables", "=", "new", "HashMap", "(", "5", ")", ";", "private", "ThreadLocal", "variableInitializationInProgress", "=", "new", "ThreadLocal", "(", ")", ";", "public", "HashMap", "containers", "=", "new", "HashMap", "(", "5", ")", ";", "public", "HashMap", "previousSessionContainers", "=", "new", "HashMap", "(", "5", ")", ";", "private", "ThreadLocal", "containerInitializationInProgress", "=", "new", "ThreadLocal", "(", ")", ";", "ThreadLocal", "containersBeingInitialized", "=", "new", "ThreadLocal", "(", ")", ";", "public", "static", "final", "int", "NO_BATCH_INITIALIZATION", "=", "0", ";", "public", "static", "final", "int", "NEED_BATCH_INITIALIZATION", "=", "1", ";", "public", "static", "final", "int", "BATCH_INITIALIZATION_IN_PROGRESS", "=", "2", ";", "public", "static", "final", "int", "BATCH_INITIALIZATION_FINISHED", "=", "3", ";", "public", "int", "batchContainerInitializations", "=", "NO_BATCH_INITIALIZATION", ";", "public", "BatchInitializationMonitor", "batchContainerInitializationsProgress", "=", "new", "BatchInitializationMonitor", "(", ")", ";", "public", "Hashtable", "containerInitializersCache", "=", "new", "Hashtable", "(", "5", ")", ";", "private", "ThreadLocal", "classpathsBeingResolved", "=", "new", "ThreadLocal", "(", ")", ";", "public", "JavaWorkspaceScope", "workspaceScope", ";", "private", "WeakHashSet", "stringSymbols", "=", "new", "WeakHashSet", "(", "5", ")", ";", "private", "WeakHashSetOfCharArray", "charArraySymbols", "=", "new", "WeakHashSetOfCharArray", "(", "5", ")", ";", "private", "IConfigurationElement", "annotationProcessorManagerFactory", "=", "null", ";", "public", "Map", "rootPathToAttachments", "=", "new", "Hashtable", "(", ")", ";", "public", "final", "static", "String", "CP_VARIABLE_PREFERENCES_PREFIX", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "final", "static", "String", "CP_CONTAINER_PREFERENCES_PREFIX", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "final", "static", "String", "CP_USERLIBRARY_PREFERENCES_PREFIX", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "final", "static", "String", "CP_ENTRY_IGNORE", "=", "\"\"", ";", "public", "final", "static", "IPath", "CP_ENTRY_IGNORE_PATH", "=", "new", "Path", "(", "CP_ENTRY_IGNORE", ")", ";", "public", "final", "static", "String", "TRUE", "=", "\"true\"", ";", "private", "final", "static", "int", "VARIABLES_AND_CONTAINERS_FILE_VERSION", "=", "2", ";", "public", "static", "final", "String", "CPVARIABLE_INITIALIZER_EXTPOINT_ID", "=", "\"\"", ";", "public", "static", "final", "String", "CPCONTAINER_INITIALIZER_EXTPOINT_ID", "=", "\"\"", ";", "public", "static", "final", "String", "FORMATTER_EXTPOINT_ID", "=", "\"\"", ";", "public", "static", "final", "String", "COMPILATION_PARTICIPANT_EXTPOINT_ID", "=", "\"\"", ";", "public", "static", "final", "String", "ANNOTATION_PROCESSOR_MANAGER_EXTPOINT_ID", "=", "\"\"", ";", "private", "static", "final", "String", "RESOLVE_REFERENCED_LIBRARIES_FOR_CONTAINERS", "=", "\"\"", ";", "public", "final", "static", "IPath", "VARIABLE_INITIALIZATION_IN_PROGRESS", "=", "new", "Path", "(", "\"\"", ")", ";", "public", "final", "static", "IClasspathContainer", "CONTAINER_INITIALIZATION_IN_PROGRESS", "=", "new", "IClasspathContainer", "(", ")", "{", "public", "IClasspathEntry", "[", "]", "getClasspathEntries", "(", ")", "{", "return", "null", ";", "}", "public", "String", "getDescription", "(", ")", "{", "return", "\"\"", ";", "}", "public", "int", "getKind", "(", ")", "{", "return", "0", ";", "}", "public", "IPath", "getPath", "(", ")", "{", "return", "null", ";", "}", "public", "String", "toString", "(", ")", "{", "return", "getDescription", "(", ")", ";", "}", "}", ";", "private", "static", "final", "String", "BUFFER_MANAGER_DEBUG", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "private", "static", "final", "String", "INDEX_MANAGER_DEBUG", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "private", "static", "final", "String", "INDEX_MANAGER_ADVANCED_DEBUG", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "private", "static", "final", "String", "COMPILER_DEBUG", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "private", "static", "final", "String", "JAVAMODEL_DEBUG", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "private", "static", "final", "String", "JAVAMODELCACHE_DEBUG", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "private", "static", "final", "String", "CP_RESOLVE_DEBUG", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "private", "static", "final", "String", "CP_RESOLVE_ADVANCED_DEBUG", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "private", "static", "final", "String", "CP_RESOLVE_FAILURE_DEBUG", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "private", "static", "final", "String", "ZIP_ACCESS_DEBUG", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "private", "static", "final", "String", "DELTA_DEBUG", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "private", "static", "final", "String", "DELTA_DEBUG_VERBOSE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "private", "static", "final", "String", "HIERARCHY_DEBUG", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "private", "static", "final", "String", "POST_ACTION_DEBUG", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "private", "static", "final", "String", "BUILDER_DEBUG", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "private", "static", "final", "String", "BUILDER_STATS_DEBUG", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "private", "static", "final", "String", "COMPLETION_DEBUG", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "private", "static", "final", "String", "RESOLUTION_DEBUG", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "private", "static", "final", "String", "SELECTION_DEBUG", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "private", "static", "final", "String", "SEARCH_DEBUG", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "private", "static", "final", "String", "SOURCE_MAPPER_DEBUG_VERBOSE", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "private", "static", "final", "String", "FORMATTER_DEBUG", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "COMPLETION_PERF", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "SELECTION_PERF", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "DELTA_LISTENER_PERF", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "VARIABLE_INITIALIZER_PERF", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "CONTAINER_INITIALIZER_PERF", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "public", "static", "final", "String", "RECONCILE_PERF", "=", "JavaCore", ".", "PLUGIN_ID", "+", "\"\"", ";", "private", "final", "static", "String", "INDEXED_SECONDARY_TYPES", "=", "\"\"", ";", "public", "static", "boolean", "PERF_VARIABLE_INITIALIZER", "=", "false", ";", "public", "static", "boolean", "PERF_CONTAINER_INITIALIZER", "=", "false", ";", "boolean", "resolveReferencedLibrariesForContainers", "=", "false", ";", "public", "final", "static", "ICompilationUnit", "[", "]", "NO_WORKING_COPY", "=", "new", "ICompilationUnit", "[", "0", "]", ";", "HashSet", "optionNames", "=", "new", "HashSet", "(", "20", ")", ";", "Hashtable", "optionsCache", ";", "public", "final", "IEclipsePreferences", "[", "]", "preferencesLookup", "=", "new", "IEclipsePreferences", "[", "2", "]", ";", "static", "final", "int", "PREF_INSTANCE", "=", "0", ";", "static", "final", "int", "PREF_DEFAULT", "=", "1", ";", "static", "final", "Object", "[", "]", "[", "]", "NO_PARTICIPANTS", "=", "new", "Object", "[", "0", "]", "[", "]", ";", "public", "static", "class", "CompilationParticipants", "{", "private", "final", "static", "int", "MAX_SOURCE_LEVEL", "=", "7", ";", "private", "Object", "[", "]", "[", "]", "registeredParticipants", "=", "null", ";", "private", "HashSet", "managedMarkerTypes", ";", "public", "CompilationParticipant", "[", "]", "getCompilationParticipants", "(", "IJavaProject", "project", ")", "{", "final", "Object", "[", "]", "[", "]", "participantsPerSource", "=", "getRegisteredParticipants", "(", ")", ";", "if", "(", "participantsPerSource", "==", "NO_PARTICIPANTS", ")", "return", "null", ";", "String", "sourceLevel", "=", "project", ".", "getOption", "(", "JavaCore", ".", "COMPILER_SOURCE", ",", "true", ")", ";", "final", "int", "sourceLevelIndex", "=", "indexForSourceLevel", "(", "sourceLevel", ")", ";", "final", "Object", "[", "]", "participants", "=", "participantsPerSource", "[", "sourceLevelIndex", "]", ";", "int", "length", "=", "participants", ".", "length", ";", "CompilationParticipant", "[", "]", "result", "=", "new", "CompilationParticipant", "[", "length", "]", ";", "int", "index", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "if", "(", "participants", "[", "i", "]", "instanceof", "IConfigurationElement", ")", "{", "final", "IConfigurationElement", "configElement", "=", "(", "IConfigurationElement", ")", "participants", "[", "i", "]", ";", "final", "int", "participantIndex", "=", "i", ";", "SafeRunner", ".", "run", "(", "new", "ISafeRunnable", "(", ")", "{", "public", "void", "handleException", "(", "Throwable", "exception", ")", "{", "Util", ".", "log", "(", "exception", ",", "\"\"", ")", ";", "}", "public", "void", "run", "(", ")", "throws", "Exception", "{", "Object", "executableExtension", "=", "configElement", ".", "createExecutableExtension", "(", "\"class\"", ")", ";", "for", "(", "int", "j", "=", "sourceLevelIndex", ";", "j", "<", "MAX_SOURCE_LEVEL", ";", "j", "++", ")", "participantsPerSource", "[", "j", "]", "[", "participantIndex", "]", "=", "executableExtension", ";", "}", "}", ")", ";", "}", "CompilationParticipant", "participant", ";", "if", "(", "(", "participants", "[", "i", "]", "instanceof", "CompilationParticipant", ")", "&&", "(", "participant", "=", "(", "CompilationParticipant", ")", "participants", "[", "i", "]", ")", ".", "isActive", "(", "project", ")", ")", "result", "[", "index", "++", "]", "=", "participant", ";", "}", "if", "(", "index", "==", "0", ")", "return", "null", ";", "if", "(", "index", "<", "length", ")", "System", ".", "arraycopy", "(", "result", ",", "0", ",", "result", "=", "new", "CompilationParticipant", "[", "index", "]", ",", "0", ",", "index", ")", ";", "return", "result", ";", "}", "public", "HashSet", "managedMarkerTypes", "(", ")", "{", "if", "(", "this", ".", "managedMarkerTypes", "==", "null", ")", "{", "getRegisteredParticipants", "(", ")", ";", "}", "return", "this", ".", "managedMarkerTypes", ";", "}", "private", "synchronized", "Object", "[", "]", "[", "]", "getRegisteredParticipants", "(", ")", "{", "if", "(", "this", ".", "registeredParticipants", "!=", "null", ")", "{", "return", "this", ".", "registeredParticipants", ";", "}", "this", ".", "managedMarkerTypes", "=", "new", "HashSet", "(", ")", ";", "IExtensionPoint", "extension", "=", "Platform", ".", "getExtensionRegistry", "(", ")", ".", "getExtensionPoint", "(", "JavaCore", ".", "PLUGIN_ID", ",", "COMPILATION_PARTICIPANT_EXTPOINT_ID", ")", ";", "if", "(", "extension", "==", "null", ")", "return", "this", ".", "registeredParticipants", "=", "NO_PARTICIPANTS", ";", "final", "ArrayList", "modifyingEnv", "=", "new", "ArrayList", "(", ")", ";", "final", "ArrayList", "creatingProblems", "=", "new", "ArrayList", "(", ")", ";", "final", "ArrayList", "others", "=", "new", "ArrayList", "(", ")", ";", "IExtension", "[", "]", "extensions", "=", "extension", ".", "getExtensions", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "extensions", ".", "length", ";", "i", "++", ")", "{", "IConfigurationElement", "[", "]", "configElements", "=", "extensions", "[", "i", "]", ".", "getConfigurationElements", "(", ")", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "configElements", ".", "length", ";", "j", "++", ")", "{", "final", "IConfigurationElement", "configElement", "=", "configElements", "[", "j", "]", ";", "String", "elementName", "=", "configElement", ".", "getName", "(", ")", ";", "if", "(", "!", "(", "\"\"", ".", "equals", "(", "elementName", ")", ")", ")", "{", "continue", ";", "}", "if", "(", "TRUE", ".", "equals", "(", "configElement", ".", "getAttribute", "(", "\"\"", ")", ")", ")", "modifyingEnv", ".", "add", "(", "configElement", ")", ";", "else", "if", "(", "TRUE", ".", "equals", "(", "configElement", ".", "getAttribute", "(", "\"\"", ")", ")", ")", "creatingProblems", ".", "add", "(", "configElement", ")", ";", "else", "others", ".", "add", "(", "configElement", ")", ";", "IConfigurationElement", "[", "]", "managedMarkers", "=", "configElement", ".", "getChildren", "(", "\"\"", ")", ";", "for", "(", "int", "k", "=", "0", ",", "length", "=", "managedMarkers", ".", "length", ";", "k", "<", "length", ";", "k", "++", ")", "{", "IConfigurationElement", "element", "=", "managedMarkers", "[", "k", "]", ";", "String", "markerType", "=", "element", ".", "getAttribute", "(", "\"markerType\"", ")", ";", "if", "(", "markerType", "!=", "null", ")", "this", ".", "managedMarkerTypes", ".", "add", "(", "markerType", ")", ";", "}", "}", "}", "int", "size", "=", "modifyingEnv", ".", "size", "(", ")", "+", "creatingProblems", ".", "size", "(", ")", "+", "others", ".", "size", "(", ")", ";", "if", "(", "size", "==", "0", ")", "return", "this", ".", "registeredParticipants", "=", "NO_PARTICIPANTS", ";", "IConfigurationElement", "[", "]", "configElements", "=", "new", "IConfigurationElement", "[", "size", "]", ";", "int", "index", "=", "0", ";", "index", "=", "sortParticipants", "(", "modifyingEnv", ",", "configElements", ",", "index", ")", ";", "index", "=", "sortParticipants", "(", "creatingProblems", ",", "configElements", ",", "index", ")", ";", "index", "=", "sortParticipants", "(", "others", ",", "configElements", ",", "index", ")", ";", "Object", "[", "]", "[", "]", "result", "=", "new", "Object", "[", "MAX_SOURCE_LEVEL", "]", "[", "]", ";", "int", "length", "=", "configElements", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "MAX_SOURCE_LEVEL", ";", "i", "++", ")", "{", "result", "[", "i", "]", "=", "new", "Object", "[", "length", "]", ";", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "String", "sourceLevel", "=", "configElements", "[", "i", "]", ".", "getAttribute", "(", "\"\"", ")", ";", "int", "sourceLevelIndex", "=", "indexForSourceLevel", "(", "sourceLevel", ")", ";", "for", "(", "int", "j", "=", "sourceLevelIndex", ";", "j", "<", "MAX_SOURCE_LEVEL", ";", "j", "++", ")", "{", "result", "[", "j", "]", "[", "i", "]", "=", "configElements", "[", "i", "]", ";", "}", "}", "return", "this", ".", "registeredParticipants", "=", "result", ";", "}", "private", "int", "indexForSourceLevel", "(", "String", "sourceLevel", ")", "{", "if", "(", "sourceLevel", "==", "null", ")", "return", "0", ";", "int", "majVersion", "=", "(", "int", ")", "(", "CompilerOptions", ".", "versionToJdkLevel", "(", "sourceLevel", ")", ">>>", "16", ")", ";", "switch", "(", "majVersion", ")", "{", "case", "ClassFileConstants", ".", "MAJOR_VERSION_1_2", ":", "return", "1", ";", "case", "ClassFileConstants", ".", "MAJOR_VERSION_1_3", ":", "return", "2", ";", "case", "ClassFileConstants", ".", "MAJOR_VERSION_1_4", ":", "return", "3", ";", "case", "ClassFileConstants", ".", "MAJOR_VERSION_1_5", ":", "return", "4", ";", "case", "ClassFileConstants", ".", "MAJOR_VERSION_1_6", ":", "return", "5", ";", "case", "ClassFileConstants", ".", "MAJOR_VERSION_1_7", ":", "return", "6", ";", "default", ":", "return", "0", ";", "}", "}", "private", "int", "sortParticipants", "(", "ArrayList", "group", ",", "IConfigurationElement", "[", "]", "configElements", ",", "int", "index", ")", "{", "int", "size", "=", "group", ".", "size", "(", ")", ";", "if", "(", "size", "==", "0", ")", "return", "index", ";", "Object", "[", "]", "elements", "=", "group", ".", "toArray", "(", ")", ";", "Util", ".", "sort", "(", "elements", ",", "new", "Util", ".", "Comparer", "(", ")", "{", "public", "int", "compare", "(", "Object", "a", ",", "Object", "b", ")", "{", "if", "(", "a", "==", "b", ")", "return", "0", ";", "String", "id", "=", "(", "(", "IConfigurationElement", ")", "a", ")", ".", "getAttribute", "(", "\"id\"", ")", ";", "if", "(", "id", "==", "null", ")", "return", "-", "1", ";", "IConfigurationElement", "[", "]", "requiredElements", "=", "(", "(", "IConfigurationElement", ")", "b", ")", ".", "getChildren", "(", "\"requires\"", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "requiredElements", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IConfigurationElement", "required", "=", "requiredElements", "[", "i", "]", ";", "if", "(", "id", ".", "equals", "(", "required", ".", "getAttribute", "(", "\"id\"", ")", ")", ")", "return", "1", ";", "}", "return", "-", "1", ";", "}", "}", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "configElements", "[", "index", "+", "i", "]", "=", "(", "IConfigurationElement", ")", "elements", "[", "i", "]", ";", "return", "index", "+", "size", ";", "}", "}", "public", "final", "CompilationParticipants", "compilationParticipants", "=", "new", "CompilationParticipants", "(", ")", ";", "public", "ThreadLocal", "abortOnMissingSource", "=", "new", "ThreadLocal", "(", ")", ";", "private", "ExternalFoldersManager", "externalFoldersManager", "=", "ExternalFoldersManager", ".", "getExternalFoldersManager", "(", ")", ";", "public", "static", "boolean", "conflictsWithOutputLocation", "(", "IPath", "folderPath", ",", "JavaProject", "project", ")", "{", "try", "{", "IPath", "outputLocation", "=", "project", ".", "getOutputLocation", "(", ")", ";", "if", "(", "outputLocation", "==", "null", ")", "{", "return", "true", ";", "}", "if", "(", "outputLocation", ".", "isPrefixOf", "(", "folderPath", ")", ")", "{", "IClasspathEntry", "[", "]", "classpath", "=", "project", ".", "getResolvedClasspath", "(", ")", ";", "boolean", "isOutputUsed", "=", "false", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "classpath", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IClasspathEntry", "entry", "=", "classpath", "[", "i", "]", ";", "if", "(", "entry", ".", "getEntryKind", "(", ")", "==", "IClasspathEntry", ".", "CPE_SOURCE", ")", "{", "if", "(", "entry", ".", "getPath", "(", ")", ".", "equals", "(", "outputLocation", ")", ")", "{", "return", "false", ";", "}", "if", "(", "entry", ".", "getOutputLocation", "(", ")", "==", "null", ")", "{", "isOutputUsed", "=", "true", ";", "}", "}", "}", "return", "isOutputUsed", ";", "}", "return", "false", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "return", "true", ";", "}", "}", "public", "synchronized", "IClasspathContainer", "containerGet", "(", "IJavaProject", "project", ",", "IPath", "containerPath", ")", "{", "if", "(", "containerIsInitializationInProgress", "(", "project", ",", "containerPath", ")", ")", "{", "return", "CONTAINER_INITIALIZATION_IN_PROGRESS", ";", "}", "Map", "projectContainers", "=", "(", "Map", ")", "this", ".", "containers", ".", "get", "(", "project", ")", ";", "if", "(", "projectContainers", "==", "null", ")", "{", "return", "null", ";", "}", "IClasspathContainer", "container", "=", "(", "IClasspathContainer", ")", "projectContainers", ".", "get", "(", "containerPath", ")", ";", "return", "container", ";", "}", "public", "synchronized", "IClasspathContainer", "containerGetDefaultToPreviousSession", "(", "IJavaProject", "project", ",", "IPath", "containerPath", ")", "{", "Map", "projectContainers", "=", "(", "Map", ")", "this", ".", "containers", ".", "get", "(", "project", ")", ";", "if", "(", "projectContainers", "==", "null", ")", "return", "getPreviousSessionContainer", "(", "containerPath", ",", "project", ")", ";", "IClasspathContainer", "container", "=", "(", "IClasspathContainer", ")", "projectContainers", ".", "get", "(", "containerPath", ")", ";", "if", "(", "container", "==", "null", ")", "return", "getPreviousSessionContainer", "(", "containerPath", ",", "project", ")", ";", "return", "container", ";", "}", "private", "boolean", "containerIsInitializationInProgress", "(", "IJavaProject", "project", ",", "IPath", "containerPath", ")", "{", "Map", "initializations", "=", "(", "Map", ")", "this", ".", "containerInitializationInProgress", ".", "get", "(", ")", ";", "if", "(", "initializations", "==", "null", ")", "return", "false", ";", "HashSet", "projectInitializations", "=", "(", "HashSet", ")", "initializations", ".", "get", "(", "project", ")", ";", "if", "(", "projectInitializations", "==", "null", ")", "return", "false", ";", "return", "projectInitializations", ".", "contains", "(", "containerPath", ")", ";", "}", "private", "void", "containerAddInitializationInProgress", "(", "IJavaProject", "project", ",", "IPath", "containerPath", ")", "{", "Map", "initializations", "=", "(", "Map", ")", "this", ".", "containerInitializationInProgress", ".", "get", "(", ")", ";", "if", "(", "initializations", "==", "null", ")", "this", ".", "containerInitializationInProgress", ".", "set", "(", "initializations", "=", "new", "HashMap", "(", ")", ")", ";", "HashSet", "projectInitializations", "=", "(", "HashSet", ")", "initializations", ".", "get", "(", "project", ")", ";", "if", "(", "projectInitializations", "==", "null", ")", "initializations", ".", "put", "(", "project", ",", "projectInitializations", "=", "new", "HashSet", "(", ")", ")", ";", "projectInitializations", ".", "add", "(", "containerPath", ")", ";", "}", "public", "void", "containerBeingInitializedPut", "(", "IJavaProject", "project", ",", "IPath", "containerPath", ",", "IClasspathContainer", "container", ")", "{", "Map", "perProjectContainers", "=", "(", "Map", ")", "this", ".", "containersBeingInitialized", ".", "get", "(", ")", ";", "if", "(", "perProjectContainers", "==", "null", ")", "this", ".", "containersBeingInitialized", ".", "set", "(", "perProjectContainers", "=", "new", "HashMap", "(", ")", ")", ";", "HashMap", "perPathContainers", "=", "(", "HashMap", ")", "perProjectContainers", ".", "get", "(", "project", ")", ";", "if", "(", "perPathContainers", "==", "null", ")", "perProjectContainers", ".", "put", "(", "project", ",", "perPathContainers", "=", "new", "HashMap", "(", ")", ")", ";", "perPathContainers", ".", "put", "(", "containerPath", ",", "container", ")", ";", "}", "public", "IClasspathContainer", "containerBeingInitializedGet", "(", "IJavaProject", "project", ",", "IPath", "containerPath", ")", "{", "Map", "perProjectContainers", "=", "(", "Map", ")", "this", ".", "containersBeingInitialized", ".", "get", "(", ")", ";", "if", "(", "perProjectContainers", "==", "null", ")", "return", "null", ";", "HashMap", "perPathContainers", "=", "(", "HashMap", ")", "perProjectContainers", ".", "get", "(", "project", ")", ";", "if", "(", "perPathContainers", "==", "null", ")", "return", "null", ";", "return", "(", "IClasspathContainer", ")", "perPathContainers", ".", "get", "(", "containerPath", ")", ";", "}", "public", "IClasspathContainer", "containerBeingInitializedRemove", "(", "IJavaProject", "project", ",", "IPath", "containerPath", ")", "{", "Map", "perProjectContainers", "=", "(", "Map", ")", "this", ".", "containersBeingInitialized", ".", "get", "(", ")", ";", "if", "(", "perProjectContainers", "==", "null", ")", "return", "null", ";", "HashMap", "perPathContainers", "=", "(", "HashMap", ")", "perProjectContainers", ".", "get", "(", "project", ")", ";", "if", "(", "perPathContainers", "==", "null", ")", "return", "null", ";", "IClasspathContainer", "container", "=", "(", "IClasspathContainer", ")", "perPathContainers", ".", "remove", "(", "containerPath", ")", ";", "if", "(", "perPathContainers", ".", "size", "(", ")", "==", "0", ")", "perPathContainers", ".", "remove", "(", "project", ")", ";", "if", "(", "perProjectContainers", ".", "size", "(", ")", "==", "0", ")", "this", ".", "containersBeingInitialized", ".", "set", "(", "null", ")", ";", "return", "container", ";", "}", "public", "synchronized", "void", "containerPut", "(", "IJavaProject", "project", ",", "IPath", "containerPath", ",", "IClasspathContainer", "container", ")", "{", "if", "(", "container", "==", "CONTAINER_INITIALIZATION_IN_PROGRESS", ")", "{", "containerAddInitializationInProgress", "(", "project", ",", "containerPath", ")", ";", "return", ";", "}", "else", "{", "containerRemoveInitializationInProgress", "(", "project", ",", "containerPath", ")", ";", "Map", "projectContainers", "=", "(", "Map", ")", "this", ".", "containers", ".", "get", "(", "project", ")", ";", "if", "(", "projectContainers", "==", "null", ")", "{", "projectContainers", "=", "new", "HashMap", "(", "1", ")", ";", "this", ".", "containers", ".", "put", "(", "project", ",", "projectContainers", ")", ";", "}", "if", "(", "container", "==", "null", ")", "{", "projectContainers", ".", "remove", "(", "containerPath", ")", ";", "}", "else", "{", "projectContainers", ".", "put", "(", "containerPath", ",", "container", ")", ";", "}", "Map", "previousContainers", "=", "(", "Map", ")", "this", ".", "previousSessionContainers", ".", "get", "(", "project", ")", ";", "if", "(", "previousContainers", "!=", "null", ")", "{", "previousContainers", ".", "remove", "(", "containerPath", ")", ";", "}", "}", "}", "public", "synchronized", "void", "containerRemove", "(", "IJavaProject", "project", ")", "{", "Map", "initializations", "=", "(", "Map", ")", "this", ".", "containerInitializationInProgress", ".", "get", "(", ")", ";", "if", "(", "initializations", "!=", "null", ")", "{", "initializations", ".", "remove", "(", "project", ")", ";", "}", "this", ".", "containers", ".", "remove", "(", "project", ")", ";", "}", "public", "boolean", "containerPutIfInitializingWithSameEntries", "(", "IPath", "containerPath", ",", "IJavaProject", "[", "]", "projects", ",", "IClasspathContainer", "[", "]", "respectiveContainers", ")", "{", "int", "projectLength", "=", "projects", ".", "length", ";", "if", "(", "projectLength", "!=", "1", ")", "return", "false", ";", "final", "IClasspathContainer", "container", "=", "respectiveContainers", "[", "0", "]", ";", "IJavaProject", "project", "=", "projects", "[", "0", "]", ";", "if", "(", "!", "containerIsInitializationInProgress", "(", "project", ",", "containerPath", ")", ")", "return", "false", ";", "IClasspathContainer", "previousContainer", "=", "containerGetDefaultToPreviousSession", "(", "project", ",", "containerPath", ")", ";", "if", "(", "container", "==", "null", ")", "{", "if", "(", "previousContainer", "==", "null", ")", "{", "containerPut", "(", "project", ",", "containerPath", ",", "null", ")", ";", "return", "true", ";", "}", "return", "false", ";", "}", "final", "IClasspathEntry", "[", "]", "newEntries", "=", "container", ".", "getClasspathEntries", "(", ")", ";", "if", "(", "previousContainer", "==", "null", ")", "if", "(", "newEntries", ".", "length", "==", "0", ")", "{", "containerPut", "(", "project", ",", "containerPath", ",", "container", ")", ";", "return", "true", ";", "}", "else", "{", "if", "(", "CP_RESOLVE_VERBOSE", "||", "CP_RESOLVE_VERBOSE_FAILURE", ")", "verbose_missbehaving_container", "(", "containerPath", ",", "projects", ",", "respectiveContainers", ",", "container", ",", "newEntries", ",", "null", ")", ";", "return", "false", ";", "}", "final", "IClasspathEntry", "[", "]", "oldEntries", "=", "previousContainer", ".", "getClasspathEntries", "(", ")", ";", "if", "(", "oldEntries", ".", "length", "!=", "newEntries", ".", "length", ")", "{", "if", "(", "CP_RESOLVE_VERBOSE", "||", "CP_RESOLVE_VERBOSE_FAILURE", ")", "verbose_missbehaving_container", "(", "containerPath", ",", "projects", ",", "respectiveContainers", ",", "container", ",", "newEntries", ",", "oldEntries", ")", ";", "return", "false", ";", "}", "for", "(", "int", "i", "=", "0", ",", "length", "=", "newEntries", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "if", "(", "newEntries", "[", "i", "]", "==", "null", ")", "{", "if", "(", "CP_RESOLVE_VERBOSE", "||", "CP_RESOLVE_VERBOSE_FAILURE", ")", "verbose_missbehaving_container", "(", "project", ",", "containerPath", ",", "newEntries", ")", ";", "return", "false", ";", "}", "if", "(", "!", "newEntries", "[", "i", "]", ".", "equals", "(", "oldEntries", "[", "i", "]", ")", ")", "{", "if", "(", "CP_RESOLVE_VERBOSE", "||", "CP_RESOLVE_VERBOSE_FAILURE", ")", "verbose_missbehaving_container", "(", "containerPath", ",", "projects", ",", "respectiveContainers", ",", "container", ",", "newEntries", ",", "oldEntries", ")", ";", "return", "false", ";", "}", "}", "containerPut", "(", "project", ",", "containerPath", ",", "container", ")", ";", "return", "true", ";", "}", "private", "void", "verbose_missbehaving_container", "(", "IPath", "containerPath", ",", "IJavaProject", "[", "]", "projects", ",", "IClasspathContainer", "[", "]", "respectiveContainers", ",", "final", "IClasspathContainer", "container", ",", "final", "IClasspathEntry", "[", "]", "newEntries", ",", "final", "IClasspathEntry", "[", "]", "oldEntries", ")", "{", "Util", ".", "verbose", "(", "\"\"", "+", "\"\"", "+", "containerPath", "+", "'\\n'", "+", "\"tprojects:", "{\"", "+", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "toString", "(", "projects", ",", "new", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "Displayable", "(", ")", "{", "public", "String", "displayString", "(", "Object", "o", ")", "{", "return", "(", "(", "IJavaProject", ")", "o", ")", ".", "getElementName", "(", ")", ";", "}", "}", ")", "+", "\"\"", "+", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "toString", "(", "respectiveContainers", ",", "new", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "Displayable", "(", ")", "{", "public", "String", "displayString", "(", "Object", "o", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", "\"tt\"", ")", ";", "if", "(", "o", "==", "null", ")", "{", "buffer", ".", "append", "(", "\"<null>\"", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "buffer", ".", "append", "(", "container", ".", "getDescription", "(", ")", ")", ";", "buffer", ".", "append", "(", "\"", "{n\"", ")", ";", "if", "(", "oldEntries", "==", "null", ")", "{", "buffer", ".", "append", "(", "\"", "ttt\"", ")", ";", "buffer", ".", "append", "(", "\"<null>n\"", ")", ";", "}", "else", "{", "for", "(", "int", "j", "=", "0", ";", "j", "<", "oldEntries", ".", "length", ";", "j", "++", ")", "{", "buffer", ".", "append", "(", "\"", "ttt\"", ")", ";", "buffer", ".", "append", "(", "oldEntries", "[", "j", "]", ")", ";", "buffer", ".", "append", "(", "'\\n'", ")", ";", "}", "}", "buffer", ".", "append", "(", "\"", "tt}\"", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "}", ")", "+", "\"\"", "+", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "toString", "(", "respectiveContainers", ",", "new", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "Displayable", "(", ")", "{", "public", "String", "displayString", "(", "Object", "o", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", "\"tt\"", ")", ";", "if", "(", "o", "==", "null", ")", "{", "buffer", ".", "append", "(", "\"<null>\"", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "buffer", ".", "append", "(", "container", ".", "getDescription", "(", ")", ")", ";", "buffer", ".", "append", "(", "\"", "{n\"", ")", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "newEntries", ".", "length", ";", "j", "++", ")", "{", "buffer", ".", "append", "(", "\"", "ttt\"", ")", ";", "buffer", ".", "append", "(", "newEntries", "[", "j", "]", ")", ";", "buffer", ".", "append", "(", "'\\n'", ")", ";", "}", "buffer", ".", "append", "(", "\"", "tt}\"", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "}", ")", "+", "\"nt}\"", ")", ";", "}", "void", "verbose_missbehaving_container", "(", "IJavaProject", "project", ",", "IPath", "containerPath", ",", "IClasspathEntry", "[", "]", "classpathEntries", ")", "{", "Util", ".", "verbose", "(", "\"\"", "+", "\"tproject:", "\"", "+", "project", ".", "getElementName", "(", ")", "+", "'\\n'", "+", "\"\"", "+", "containerPath", "+", "'\\n'", "+", "\"\"", "+", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "toString", "(", "classpathEntries", ",", "new", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "Displayable", "(", ")", "{", "public", "String", "displayString", "(", "Object", "o", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", "\"tt\"", ")", ";", "if", "(", "o", "==", "null", ")", "{", "buffer", ".", "append", "(", "\"<null>\"", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "buffer", ".", "append", "(", "o", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "}", ")", "+", "\"nt}\"", ")", ";", "}", "void", "verbose_missbehaving_container_null_entries", "(", "IJavaProject", "project", ",", "IPath", "containerPath", ")", "{", "Util", ".", "verbose", "(", "\"\"", "+", "\"tproject:", "\"", "+", "project", ".", "getElementName", "(", ")", "+", "'\\n'", "+", "\"\"", "+", "containerPath", "+", "'\\n'", "+", "\"\"", ")", ";", "}", "private", "void", "containerRemoveInitializationInProgress", "(", "IJavaProject", "project", ",", "IPath", "containerPath", ")", "{", "Map", "initializations", "=", "(", "Map", ")", "this", ".", "containerInitializationInProgress", ".", "get", "(", ")", ";", "if", "(", "initializations", "==", "null", ")", "return", ";", "HashSet", "projectInitializations", "=", "(", "HashSet", ")", "initializations", ".", "get", "(", "project", ")", ";", "if", "(", "projectInitializations", "==", "null", ")", "return", ";", "projectInitializations", ".", "remove", "(", "containerPath", ")", ";", "if", "(", "projectInitializations", ".", "size", "(", ")", "==", "0", ")", "initializations", ".", "remove", "(", "project", ")", ";", "if", "(", "initializations", ".", "size", "(", ")", "==", "0", ")", "this", ".", "containerInitializationInProgress", ".", "set", "(", "null", ")", ";", "}", "private", "synchronized", "void", "containersReset", "(", "String", "[", "]", "containerIDs", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "containerIDs", ".", "length", ";", "i", "++", ")", "{", "String", "containerID", "=", "containerIDs", "[", "i", "]", ";", "Iterator", "projectIterator", "=", "this", ".", "containers", ".", "values", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "projectIterator", ".", "hasNext", "(", ")", ")", "{", "Map", "projectContainers", "=", "(", "Map", ")", "projectIterator", ".", "next", "(", ")", ";", "if", "(", "projectContainers", "!=", "null", ")", "{", "Iterator", "containerIterator", "=", "projectContainers", ".", "keySet", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "containerIterator", ".", "hasNext", "(", ")", ")", "{", "IPath", "containerPath", "=", "(", "IPath", ")", "containerIterator", ".", "next", "(", ")", ";", "if", "(", "containerID", ".", "equals", "(", "containerPath", ".", "segment", "(", "0", ")", ")", ")", "{", "projectContainers", ".", "put", "(", "containerPath", ",", "null", ")", ";", "}", "}", "}", "}", "}", "}", "public", "static", "IJavaElement", "create", "(", "IResource", "resource", ",", "IJavaProject", "project", ")", "{", "if", "(", "resource", "==", "null", ")", "{", "return", "null", ";", "}", "int", "type", "=", "resource", ".", "getType", "(", ")", ";", "switch", "(", "type", ")", "{", "case", "IResource", ".", "PROJECT", ":", "return", "JavaCore", ".", "create", "(", "(", "IProject", ")", "resource", ")", ";", "case", "IResource", ".", "FILE", ":", "return", "create", "(", "(", "IFile", ")", "resource", ",", "project", ")", ";", "case", "IResource", ".", "FOLDER", ":", "return", "create", "(", "(", "IFolder", ")", "resource", ",", "project", ")", ";", "case", "IResource", ".", "ROOT", ":", "return", "JavaCore", ".", "create", "(", "(", "IWorkspaceRoot", ")", "resource", ")", ";", "default", ":", "return", "null", ";", "}", "}", "public", "static", "IJavaElement", "create", "(", "IFile", "file", ",", "IJavaProject", "project", ")", "{", "if", "(", "file", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "project", "==", "null", ")", "{", "project", "=", "JavaCore", ".", "create", "(", "file", ".", "getProject", "(", ")", ")", ";", "}", "if", "(", "file", ".", "getFileExtension", "(", ")", "!=", "null", ")", "{", "String", "name", "=", "file", ".", "getName", "(", ")", ";", "if", "(", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ".", "isJavaLikeFileName", "(", "name", ")", ")", "return", "createCompilationUnitFrom", "(", "file", ",", "project", ")", ";", "if", "(", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "isClassFileName", "(", "name", ")", ")", "return", "createClassFileFrom", "(", "file", ",", "project", ")", ";", "return", "createJarPackageFragmentRootFrom", "(", "file", ",", "project", ")", ";", "}", "return", "null", ";", "}", "public", "static", "IJavaElement", "create", "(", "IFolder", "folder", ",", "IJavaProject", "project", ")", "{", "if", "(", "folder", "==", "null", ")", "{", "return", "null", ";", "}", "IJavaElement", "element", ";", "if", "(", "project", "==", "null", ")", "{", "project", "=", "JavaCore", ".", "create", "(", "folder", ".", "getProject", "(", ")", ")", ";", "element", "=", "determineIfOnClasspath", "(", "folder", ",", "project", ")", ";", "if", "(", "element", "==", "null", ")", "{", "IJavaProject", "[", "]", "projects", ";", "try", "{", "projects", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "getJavaModel", "(", ")", ".", "getJavaProjects", "(", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "return", "null", ";", "}", "for", "(", "int", "i", "=", "0", ",", "length", "=", "projects", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "project", "=", "projects", "[", "i", "]", ";", "element", "=", "determineIfOnClasspath", "(", "folder", ",", "project", ")", ";", "if", "(", "element", "!=", "null", ")", "break", ";", "}", "}", "}", "else", "{", "element", "=", "determineIfOnClasspath", "(", "folder", ",", "project", ")", ";", "}", "return", "element", ";", "}", "public", "static", "IClassFile", "createClassFileFrom", "(", "IFile", "file", ",", "IJavaProject", "project", ")", "{", "if", "(", "file", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "project", "==", "null", ")", "{", "project", "=", "JavaCore", ".", "create", "(", "file", ".", "getProject", "(", ")", ")", ";", "}", "IPackageFragment", "pkg", "=", "(", "IPackageFragment", ")", "determineIfOnClasspath", "(", "file", ",", "project", ")", ";", "if", "(", "pkg", "==", "null", ")", "{", "PackageFragmentRoot", "root", "=", "(", "PackageFragmentRoot", ")", "project", ".", "getPackageFragmentRoot", "(", "file", ".", "getParent", "(", ")", ")", ";", "pkg", "=", "root", ".", "getPackageFragment", "(", "CharOperation", ".", "NO_STRINGS", ")", ";", "}", "return", "pkg", ".", "getClassFile", "(", "file", ".", "getName", "(", ")", ")", ";", "}", "public", "static", "ICompilationUnit", "createCompilationUnitFrom", "(", "IFile", "file", ",", "IJavaProject", "project", ")", "{", "if", "(", "file", "==", "null", ")", "return", "null", ";", "if", "(", "project", "==", "null", ")", "{", "project", "=", "JavaCore", ".", "create", "(", "file", ".", "getProject", "(", ")", ")", ";", "}", "IPackageFragment", "pkg", "=", "(", "IPackageFragment", ")", "determineIfOnClasspath", "(", "file", ",", "project", ")", ";", "if", "(", "pkg", "==", "null", ")", "{", "PackageFragmentRoot", "root", "=", "(", "PackageFragmentRoot", ")", "project", ".", "getPackageFragmentRoot", "(", "file", ".", "getParent", "(", ")", ")", ";", "pkg", "=", "root", ".", "getPackageFragment", "(", "CharOperation", ".", "NO_STRINGS", ")", ";", "if", "(", "VERBOSE", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "Thread", ".", "currentThread", "(", ")", "+", "\"):", "\"", "+", "file", ".", "getFullPath", "(", ")", ")", ";", "}", "}", "return", "pkg", ".", "getCompilationUnit", "(", "file", ".", "getName", "(", ")", ")", ";", "}", "public", "static", "IPackageFragmentRoot", "createJarPackageFragmentRootFrom", "(", "IFile", "file", ",", "IJavaProject", "project", ")", "{", "if", "(", "file", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "project", "==", "null", ")", "{", "project", "=", "JavaCore", ".", "create", "(", "file", ".", "getProject", "(", ")", ")", ";", "}", "IPath", "resourcePath", "=", "file", ".", "getFullPath", "(", ")", ";", "try", "{", "IClasspathEntry", "entry", "=", "(", "(", "JavaProject", ")", "project", ")", ".", "getClasspathEntryFor", "(", "resourcePath", ")", ";", "if", "(", "entry", "!=", "null", ")", "{", "return", "project", ".", "getPackageFragmentRoot", "(", "file", ")", ";", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "return", "null", ";", "}", "public", "static", "IJavaElement", "determineIfOnClasspath", "(", "IResource", "resource", ",", "IJavaProject", "project", ")", "{", "IPath", "resourcePath", "=", "resource", ".", "getFullPath", "(", ")", ";", "boolean", "isExternal", "=", "ExternalFoldersManager", ".", "isInternalPathForExternalFolder", "(", "resourcePath", ")", ";", "if", "(", "isExternal", ")", "resourcePath", "=", "resource", ".", "getLocation", "(", ")", ";", "try", "{", "JavaProjectElementInfo", "projectInfo", "=", "(", "JavaProjectElementInfo", ")", "getJavaModelManager", "(", ")", ".", "getInfo", "(", "project", ")", ";", "ProjectCache", "projectCache", "=", "projectInfo", "==", "null", "?", "null", ":", "projectInfo", ".", "projectCache", ";", "HashtableOfArrayToObject", "allPkgFragmentsCache", "=", "projectCache", "==", "null", "?", "null", ":", "projectCache", ".", "allPkgFragmentsCache", ";", "IClasspathEntry", "[", "]", "entries", "=", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ".", "isJavaLikeFileName", "(", "resourcePath", ".", "lastSegment", "(", ")", ")", "?", "project", ".", "getRawClasspath", "(", ")", ":", "(", "(", "JavaProject", ")", "project", ")", ".", "getResolvedClasspath", "(", ")", ";", "int", "length", "=", "entries", ".", "length", ";", "if", "(", "length", ">", "0", ")", "{", "String", "sourceLevel", "=", "project", ".", "getOption", "(", "JavaCore", ".", "COMPILER_SOURCE", ",", "true", ")", ";", "String", "complianceLevel", "=", "project", ".", "getOption", "(", "JavaCore", ".", "COMPILER_COMPLIANCE", ",", "true", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IClasspathEntry", "entry", "=", "entries", "[", "i", "]", ";", "if", "(", "entry", ".", "getEntryKind", "(", ")", "==", "IClasspathEntry", ".", "CPE_PROJECT", ")", "continue", ";", "IPath", "rootPath", "=", "entry", ".", "getPath", "(", ")", ";", "if", "(", "rootPath", ".", "equals", "(", "resourcePath", ")", ")", "{", "return", "project", ".", "getPackageFragmentRoot", "(", "resource", ")", ";", "}", "else", "if", "(", "rootPath", ".", "isPrefixOf", "(", "resourcePath", ")", ")", "{", "if", "(", "!", "Util", ".", "isExcluded", "(", "resource", ",", "(", "(", "ClasspathEntry", ")", "entry", ")", ".", "fullInclusionPatternChars", "(", ")", ",", "(", "(", "ClasspathEntry", ")", "entry", ")", ".", "fullExclusionPatternChars", "(", ")", ")", ")", "{", "PackageFragmentRoot", "root", "=", "isExternal", "?", "new", "ExternalPackageFragmentRoot", "(", "rootPath", ",", "(", "JavaProject", ")", "project", ")", ":", "(", "PackageFragmentRoot", ")", "(", "(", "JavaProject", ")", "project", ")", ".", "getFolderPackageFragmentRoot", "(", "rootPath", ")", ";", "if", "(", "root", "==", "null", ")", "return", "null", ";", "IPath", "pkgPath", "=", "resourcePath", ".", "removeFirstSegments", "(", "rootPath", ".", "segmentCount", "(", ")", ")", ";", "if", "(", "resource", ".", "getType", "(", ")", "==", "IResource", ".", "FILE", ")", "{", "pkgPath", "=", "pkgPath", ".", "removeLastSegments", "(", "1", ")", ";", "}", "String", "[", "]", "pkgName", "=", "pkgPath", ".", "segments", "(", ")", ";", "if", "(", "allPkgFragmentsCache", "!=", "null", "&&", "allPkgFragmentsCache", ".", "containsKey", "(", "pkgName", ")", ")", "return", "root", ".", "getPackageFragment", "(", "pkgName", ")", ";", "if", "(", "pkgName", ".", "length", "!=", "0", "&&", "JavaConventions", ".", "validatePackageName", "(", "Util", ".", "packageName", "(", "pkgPath", ",", "sourceLevel", ",", "complianceLevel", ")", ",", "sourceLevel", ",", "complianceLevel", ")", ".", "getSeverity", "(", ")", "==", "IStatus", ".", "ERROR", ")", "{", "return", "null", ";", "}", "return", "root", ".", "getPackageFragment", "(", "pkgName", ")", ";", "}", "}", "}", "}", "}", "catch", "(", "JavaModelException", "npe", ")", "{", "return", "null", ";", "}", "return", "null", ";", "}", "private", "static", "JavaModelManager", "MANAGER", "=", "new", "JavaModelManager", "(", ")", ";", "private", "JavaModelCache", "cache", ";", "private", "ThreadLocal", "temporaryCache", "=", "new", "ThreadLocal", "(", ")", ";", "protected", "HashSet", "elementsOutOfSynchWithBuffers", "=", "new", "HashSet", "(", "11", ")", ";", "public", "DeltaProcessingState", "deltaState", "=", "new", "DeltaProcessingState", "(", ")", ";", "public", "IndexManager", "indexManager", "=", "null", ";", "protected", "Map", "perProjectInfos", "=", "new", "HashMap", "(", "5", ")", ";", "protected", "Map", "perWorkingCopyInfos", "=", "new", "HashMap", "(", "5", ")", ";", "protected", "WeakHashMap", "searchScopes", "=", "new", "WeakHashMap", "(", ")", ";", "public", "static", "class", "PerProjectInfo", "{", "private", "static", "final", "int", "JAVADOC_CACHE_INITIAL_SIZE", "=", "10", ";", "static", "final", "IJavaModelStatus", "NEED_RESOLUTION", "=", "new", "JavaModelStatus", "(", ")", ";", "public", "IProject", "project", ";", "public", "Object", "savedState", ";", "public", "boolean", "triedRead", ";", "public", "IClasspathEntry", "[", "]", "rawClasspath", ";", "public", "IClasspathEntry", "[", "]", "referencedEntries", ";", "public", "IJavaModelStatus", "rawClasspathStatus", ";", "public", "int", "rawTimeStamp", "=", "0", ";", "public", "boolean", "writtingRawClasspath", "=", "false", ";", "public", "IClasspathEntry", "[", "]", "resolvedClasspath", ";", "public", "IJavaModelStatus", "unresolvedEntryStatus", ";", "public", "Map", "rootPathToRawEntries", ";", "public", "Map", "rootPathToResolvedEntries", ";", "public", "IPath", "outputLocation", ";", "public", "IEclipsePreferences", "preferences", ";", "public", "Hashtable", "options", ";", "public", "Hashtable", "secondaryTypes", ";", "public", "LRUCache", "javadocCache", ";", "public", "PerProjectInfo", "(", "IProject", "project", ")", "{", "this", ".", "triedRead", "=", "false", ";", "this", ".", "savedState", "=", "null", ";", "this", ".", "project", "=", "project", ";", "this", ".", "javadocCache", "=", "new", "LRUCache", "(", "JAVADOC_CACHE_INITIAL_SIZE", ")", ";", "}", "public", "synchronized", "IClasspathEntry", "[", "]", "getResolvedClasspath", "(", ")", "{", "if", "(", "this", ".", "unresolvedEntryStatus", "==", "NEED_RESOLUTION", ")", "return", "null", ";", "return", "this", ".", "resolvedClasspath", ";", "}", "public", "void", "forgetExternalTimestampsAndIndexes", "(", ")", "{", "IClasspathEntry", "[", "]", "classpath", "=", "this", ".", "resolvedClasspath", ";", "if", "(", "classpath", "==", "null", ")", "return", ";", "JavaModelManager", "manager", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ";", "IndexManager", "indexManager", "=", "manager", ".", "indexManager", ";", "Map", "externalTimeStamps", "=", "manager", ".", "deltaState", ".", "getExternalLibTimeStamps", "(", ")", ";", "HashMap", "rootInfos", "=", "JavaModelManager", ".", "getDeltaState", "(", ")", ".", "otherRoots", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "classpath", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IClasspathEntry", "entry", "=", "classpath", "[", "i", "]", ";", "if", "(", "entry", ".", "getEntryKind", "(", ")", "==", "IClasspathEntry", ".", "CPE_LIBRARY", ")", "{", "IPath", "path", "=", "entry", ".", "getPath", "(", ")", ";", "if", "(", "rootInfos", ".", "get", "(", "path", ")", "==", "null", ")", "{", "externalTimeStamps", ".", "remove", "(", "path", ")", ";", "indexManager", ".", "removeIndex", "(", "path", ")", ";", "}", "}", "}", "}", "public", "void", "rememberExternalLibTimestamps", "(", ")", "{", "IClasspathEntry", "[", "]", "classpath", "=", "this", ".", "resolvedClasspath", ";", "if", "(", "classpath", "==", "null", ")", "return", ";", "Map", "externalTimeStamps", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "deltaState", ".", "getExternalLibTimeStamps", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "classpath", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IClasspathEntry", "entry", "=", "classpath", "[", "i", "]", ";", "if", "(", "entry", ".", "getEntryKind", "(", ")", "==", "IClasspathEntry", ".", "CPE_LIBRARY", ")", "{", "IPath", "path", "=", "entry", ".", "getPath", "(", ")", ";", "if", "(", "externalTimeStamps", ".", "get", "(", "path", ")", "==", "null", ")", "{", "Object", "target", "=", "JavaModel", ".", "getExternalTarget", "(", "path", ",", "true", ")", ";", "if", "(", "target", "instanceof", "File", ")", "{", "long", "timestamp", "=", "DeltaProcessor", ".", "getTimeStamp", "(", "(", "java", ".", "io", ".", "File", ")", "target", ")", ";", "externalTimeStamps", ".", "put", "(", "path", ",", "new", "Long", "(", "timestamp", ")", ")", ";", "}", "}", "}", "}", "}", "public", "synchronized", "ClasspathChange", "resetResolvedClasspath", "(", ")", "{", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "resetNonChainingJarsCache", "(", ")", ";", "return", "setResolvedClasspath", "(", "null", ",", "null", ",", "null", ",", "null", ",", "this", ".", "rawTimeStamp", ",", "true", ")", ";", "}", "private", "ClasspathChange", "setClasspath", "(", "IClasspathEntry", "[", "]", "newRawClasspath", ",", "IClasspathEntry", "[", "]", "referencedEntries", ",", "IPath", "newOutputLocation", ",", "IJavaModelStatus", "newRawClasspathStatus", ",", "IClasspathEntry", "[", "]", "newResolvedClasspath", ",", "Map", "newRootPathToRawEntries", ",", "Map", "newRootPathToResolvedEntries", ",", "IJavaModelStatus", "newUnresolvedEntryStatus", ",", "boolean", "addClasspathChange", ")", "{", "ClasspathChange", "classpathChange", "=", "addClasspathChange", "?", "addClasspathChange", "(", ")", ":", "null", ";", "if", "(", "referencedEntries", "!=", "null", ")", "this", ".", "referencedEntries", "=", "referencedEntries", ";", "if", "(", "this", ".", "referencedEntries", "==", "null", ")", "this", ".", "referencedEntries", "=", "ClasspathEntry", ".", "NO_ENTRIES", ";", "this", ".", "rawClasspath", "=", "newRawClasspath", ";", "this", ".", "outputLocation", "=", "newOutputLocation", ";", "this", ".", "rawClasspathStatus", "=", "newRawClasspathStatus", ";", "this", ".", "resolvedClasspath", "=", "newResolvedClasspath", ";", "this", ".", "rootPathToRawEntries", "=", "newRootPathToRawEntries", ";", "this", ".", "rootPathToResolvedEntries", "=", "newRootPathToResolvedEntries", ";", "this", ".", "unresolvedEntryStatus", "=", "newUnresolvedEntryStatus", ";", "this", ".", "javadocCache", "=", "new", "LRUCache", "(", "JAVADOC_CACHE_INITIAL_SIZE", ")", ";", "return", "classpathChange", ";", "}", "protected", "ClasspathChange", "addClasspathChange", "(", ")", "{", "JavaModelManager", "manager", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ";", "ClasspathChange", "classpathChange", "=", "manager", ".", "deltaState", ".", "addClasspathChange", "(", "this", ".", "project", ",", "this", ".", "rawClasspath", ",", "this", ".", "outputLocation", ",", "this", ".", "resolvedClasspath", ")", ";", "return", "classpathChange", ";", "}", "public", "ClasspathChange", "setRawClasspath", "(", "IClasspathEntry", "[", "]", "newRawClasspath", ",", "IPath", "newOutputLocation", ",", "IJavaModelStatus", "newRawClasspathStatus", ")", "{", "return", "setRawClasspath", "(", "newRawClasspath", ",", "null", ",", "newOutputLocation", ",", "newRawClasspathStatus", ")", ";", "}", "public", "synchronized", "ClasspathChange", "setRawClasspath", "(", "IClasspathEntry", "[", "]", "newRawClasspath", ",", "IClasspathEntry", "[", "]", "referencedEntries", ",", "IPath", "newOutputLocation", ",", "IJavaModelStatus", "newRawClasspathStatus", ")", "{", "this", ".", "rawTimeStamp", "++", ";", "return", "setClasspath", "(", "newRawClasspath", ",", "referencedEntries", ",", "newOutputLocation", ",", "newRawClasspathStatus", ",", "null", ",", "null", ",", "null", ",", "null", ",", "true", ")", ";", "}", "public", "ClasspathChange", "setResolvedClasspath", "(", "IClasspathEntry", "[", "]", "newResolvedClasspath", ",", "Map", "newRootPathToRawEntries", ",", "Map", "newRootPathToResolvedEntries", ",", "IJavaModelStatus", "newUnresolvedEntryStatus", ",", "int", "timeStamp", ",", "boolean", "addClasspathChange", ")", "{", "return", "setResolvedClasspath", "(", "newResolvedClasspath", ",", "null", ",", "newRootPathToRawEntries", ",", "newRootPathToResolvedEntries", ",", "newUnresolvedEntryStatus", ",", "timeStamp", ",", "addClasspathChange", ")", ";", "}", "public", "synchronized", "ClasspathChange", "setResolvedClasspath", "(", "IClasspathEntry", "[", "]", "newResolvedClasspath", ",", "IClasspathEntry", "[", "]", "referencedEntries", ",", "Map", "newRootPathToRawEntries", ",", "Map", "newRootPathToResolvedEntries", ",", "IJavaModelStatus", "newUnresolvedEntryStatus", ",", "int", "timeStamp", ",", "boolean", "addClasspathChange", ")", "{", "if", "(", "this", ".", "rawTimeStamp", "!=", "timeStamp", ")", "return", "null", ";", "return", "setClasspath", "(", "this", ".", "rawClasspath", ",", "referencedEntries", ",", "this", ".", "outputLocation", ",", "this", ".", "rawClasspathStatus", ",", "newResolvedClasspath", ",", "newRootPathToRawEntries", ",", "newRootPathToResolvedEntries", ",", "newUnresolvedEntryStatus", ",", "addClasspathChange", ")", ";", "}", "public", "synchronized", "IClasspathEntry", "[", "]", "[", "]", "readAndCacheClasspath", "(", "JavaProject", "javaProject", ")", "{", "IClasspathEntry", "[", "]", "[", "]", "classpath", ";", "IJavaModelStatus", "status", ";", "try", "{", "classpath", "=", "javaProject", ".", "readFileEntriesWithException", "(", "null", ")", ";", "status", "=", "JavaModelStatus", ".", "VERIFIED_OK", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "classpath", "=", "new", "IClasspathEntry", "[", "]", "[", "]", "{", "JavaProject", ".", "INVALID_CLASSPATH", ",", "ClasspathEntry", ".", "NO_ENTRIES", "}", ";", "status", "=", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INVALID_CLASSPATH_FILE_FORMAT", ",", "Messages", ".", "bind", "(", "Messages", ".", "classpath_cannotReadClasspathFile", ",", "javaProject", ".", "getElementName", "(", ")", ")", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "classpath", "=", "new", "IClasspathEntry", "[", "]", "[", "]", "{", "JavaProject", ".", "INVALID_CLASSPATH", ",", "ClasspathEntry", ".", "NO_ENTRIES", "}", ";", "if", "(", "Messages", ".", "file_badFormat", ".", "equals", "(", "e", ".", "getMessage", "(", ")", ")", ")", "status", "=", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INVALID_CLASSPATH_FILE_FORMAT", ",", "Messages", ".", "bind", "(", "Messages", ".", "classpath_xmlFormatError", ",", "javaProject", ".", "getElementName", "(", ")", ",", "Messages", ".", "file_badFormat", ")", ")", ";", "else", "status", "=", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INVALID_CLASSPATH_FILE_FORMAT", ",", "Messages", ".", "bind", "(", "Messages", ".", "classpath_cannotReadClasspathFile", ",", "javaProject", ".", "getElementName", "(", ")", ")", ")", ";", "}", "catch", "(", "ClasspathEntry", ".", "AssertionFailedException", "e", ")", "{", "classpath", "=", "new", "IClasspathEntry", "[", "]", "[", "]", "{", "JavaProject", ".", "INVALID_CLASSPATH", ",", "ClasspathEntry", ".", "NO_ENTRIES", "}", ";", "status", "=", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INVALID_CLASSPATH_FILE_FORMAT", ",", "Messages", ".", "bind", "(", "Messages", ".", "classpath_illegalEntryInClasspathFile", ",", "new", "String", "[", "]", "{", "javaProject", ".", "getElementName", "(", ")", ",", "e", ".", "getMessage", "(", ")", "}", ")", ")", ";", "}", "int", "rawClasspathLength", "=", "classpath", "[", "0", "]", ".", "length", ";", "IPath", "output", "=", "null", ";", "if", "(", "rawClasspathLength", ">", "0", ")", "{", "IClasspathEntry", "entry", "=", "classpath", "[", "0", "]", "[", "rawClasspathLength", "-", "1", "]", ";", "if", "(", "entry", ".", "getContentKind", "(", ")", "==", "ClasspathEntry", ".", "K_OUTPUT", ")", "{", "output", "=", "entry", ".", "getPath", "(", ")", ";", "IClasspathEntry", "[", "]", "copy", "=", "new", "IClasspathEntry", "[", "rawClasspathLength", "-", "1", "]", ";", "System", ".", "arraycopy", "(", "classpath", "[", "0", "]", ",", "0", ",", "copy", ",", "0", ",", "copy", ".", "length", ")", ";", "classpath", "[", "0", "]", "=", "copy", ";", "}", "}", "setRawClasspath", "(", "classpath", "[", "0", "]", ",", "classpath", "[", "1", "]", ",", "output", ",", "status", ")", ";", "return", "classpath", ";", "}", "public", "String", "toString", "(", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "buffer", ".", "append", "(", "\"Info", "for", "\"", ")", ";", "buffer", ".", "append", "(", "this", ".", "project", ".", "getFullPath", "(", ")", ")", ";", "buffer", ".", "append", "(", "\"\"", ")", ";", "if", "(", "this", ".", "rawClasspath", "==", "null", ")", "{", "buffer", ".", "append", "(", "\"", "<null>n\"", ")", ";", "}", "else", "{", "for", "(", "int", "i", "=", "0", ",", "length", "=", "this", ".", "rawClasspath", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "buffer", ".", "append", "(", "\"", "\"", ")", ";", "buffer", ".", "append", "(", "this", ".", "rawClasspath", "[", "i", "]", ")", ";", "buffer", ".", "append", "(", "'\\n'", ")", ";", "}", "}", "buffer", ".", "append", "(", "\"\"", ")", ";", "IClasspathEntry", "[", "]", "resolvedCP", "=", "this", ".", "resolvedClasspath", ";", "if", "(", "resolvedCP", "==", "null", ")", "{", "buffer", ".", "append", "(", "\"", "<null>n\"", ")", ";", "}", "else", "{", "for", "(", "int", "i", "=", "0", ",", "length", "=", "resolvedCP", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "buffer", ".", "append", "(", "\"", "\"", ")", ";", "buffer", ".", "append", "(", "resolvedCP", "[", "i", "]", ")", ";", "buffer", ".", "append", "(", "'\\n'", ")", ";", "}", "}", "buffer", ".", "append", "(", "\"\"", ")", ";", "if", "(", "this", ".", "unresolvedEntryStatus", "==", "NEED_RESOLUTION", ")", "buffer", ".", "append", "(", "\"\"", ")", ";", "else", "buffer", ".", "append", "(", "this", ".", "unresolvedEntryStatus", "==", "null", "?", "\"<null>n\"", ":", "this", ".", "unresolvedEntryStatus", ".", "toString", "(", ")", ")", ";", "buffer", ".", "append", "(", "\"\"", ")", ";", "if", "(", "this", ".", "outputLocation", "==", "null", ")", "{", "buffer", ".", "append", "(", "\"<null>\"", ")", ";", "}", "else", "{", "buffer", ".", "append", "(", "this", ".", "outputLocation", ")", ";", "}", "return", "buffer", ".", "toString", "(", ")", ";", "}", "public", "boolean", "writeAndCacheClasspath", "(", "JavaProject", "javaProject", ",", "final", "IClasspathEntry", "[", "]", "newRawClasspath", ",", "IClasspathEntry", "[", "]", "newReferencedEntries", ",", "final", "IPath", "newOutputLocation", ")", "throws", "JavaModelException", "{", "try", "{", "this", ".", "writtingRawClasspath", "=", "true", ";", "if", "(", "newReferencedEntries", "==", "null", ")", "newReferencedEntries", "=", "this", ".", "referencedEntries", ";", "if", "(", "!", "javaProject", ".", "writeFileEntries", "(", "newRawClasspath", ",", "newReferencedEntries", ",", "newOutputLocation", ")", ")", "{", "return", "false", ";", "}", "setRawClasspath", "(", "newRawClasspath", ",", "newReferencedEntries", ",", "newOutputLocation", ",", "JavaModelStatus", ".", "VERIFIED_OK", ")", ";", "}", "finally", "{", "this", ".", "writtingRawClasspath", "=", "false", ";", "}", "return", "true", ";", "}", "public", "boolean", "writeAndCacheClasspath", "(", "JavaProject", "javaProject", ",", "final", "IClasspathEntry", "[", "]", "newRawClasspath", ",", "final", "IPath", "newOutputLocation", ")", "throws", "JavaModelException", "{", "return", "writeAndCacheClasspath", "(", "javaProject", ",", "newRawClasspath", ",", "null", ",", "newOutputLocation", ")", ";", "}", "}", "public", "static", "class", "PerWorkingCopyInfo", "implements", "IProblemRequestor", "{", "int", "useCount", "=", "0", ";", "IProblemRequestor", "problemRequestor", ";", "CompilationUnit", "workingCopy", ";", "public", "PerWorkingCopyInfo", "(", "CompilationUnit", "workingCopy", ",", "IProblemRequestor", "problemRequestor", ")", "{", "this", ".", "workingCopy", "=", "workingCopy", ";", "this", ".", "problemRequestor", "=", "problemRequestor", ";", "}", "public", "void", "acceptProblem", "(", "IProblem", "problem", ")", "{", "IProblemRequestor", "requestor", "=", "getProblemRequestor", "(", ")", ";", "if", "(", "requestor", "==", "null", ")", "return", ";", "requestor", ".", "acceptProblem", "(", "problem", ")", ";", "}", "public", "void", "beginReporting", "(", ")", "{", "IProblemRequestor", "requestor", "=", "getProblemRequestor", "(", ")", ";", "if", "(", "requestor", "==", "null", ")", "return", ";", "requestor", ".", "beginReporting", "(", ")", ";", "}", "public", "void", "endReporting", "(", ")", "{", "IProblemRequestor", "requestor", "=", "getProblemRequestor", "(", ")", ";", "if", "(", "requestor", "==", "null", ")", "return", ";", "requestor", ".", "endReporting", "(", ")", ";", "}", "public", "IProblemRequestor", "getProblemRequestor", "(", ")", "{", "if", "(", "this", ".", "problemRequestor", "==", "null", "&&", "this", ".", "workingCopy", ".", "owner", "!=", "null", ")", "{", "return", "this", ".", "workingCopy", ".", "owner", ".", "getProblemRequestor", "(", "this", ".", "workingCopy", ")", ";", "}", "return", "this", ".", "problemRequestor", ";", "}", "public", "ICompilationUnit", "getWorkingCopy", "(", ")", "{", "return", "this", ".", "workingCopy", ";", "}", "public", "boolean", "isActive", "(", ")", "{", "IProblemRequestor", "requestor", "=", "getProblemRequestor", "(", ")", ";", "return", "requestor", "!=", "null", "&&", "requestor", ".", "isActive", "(", ")", ";", "}", "public", "String", "toString", "(", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "buffer", ".", "append", "(", "\"Info", "for", "\"", ")", ";", "buffer", ".", "append", "(", "(", "(", "JavaElement", ")", "this", ".", "workingCopy", ")", ".", "toStringWithAncestors", "(", ")", ")", ";", "buffer", ".", "append", "(", "\"\"", ")", ";", "buffer", ".", "append", "(", "this", ".", "useCount", ")", ";", "buffer", ".", "append", "(", "\"\"", ")", ";", "buffer", ".", "append", "(", "this", ".", "problemRequestor", ")", ";", "if", "(", "this", ".", "problemRequestor", "==", "null", ")", "{", "IProblemRequestor", "requestor", "=", "getProblemRequestor", "(", ")", ";", "buffer", ".", "append", "(", "\"\"", ")", ";", "buffer", ".", "append", "(", "requestor", ")", ";", "}", "return", "buffer", ".", "toString", "(", ")", ";", "}", "}", "public", "static", "boolean", "VERBOSE", "=", "false", ";", "public", "static", "boolean", "CP_RESOLVE_VERBOSE", "=", "false", ";", "public", "static", "boolean", "CP_RESOLVE_VERBOSE_ADVANCED", "=", "false", ";", "public", "static", "boolean", "CP_RESOLVE_VERBOSE_FAILURE", "=", "false", ";", "public", "static", "boolean", "ZIP_ACCESS_VERBOSE", "=", "false", ";", "private", "ThreadLocal", "zipFiles", "=", "new", "ThreadLocal", "(", ")", ";", "private", "UserLibraryManager", "userLibraryManager", ";", "private", "Set", "nonChainingJars", ";", "public", "static", "class", "EclipsePreferencesListener", "implements", "IEclipsePreferences", ".", "IPreferenceChangeListener", "{", "public", "void", "preferenceChange", "(", "IEclipsePreferences", ".", "PreferenceChangeEvent", "event", ")", "{", "String", "propertyName", "=", "event", ".", "getKey", "(", ")", ";", "if", "(", "propertyName", ".", "startsWith", "(", "JavaCore", ".", "PLUGIN_ID", ")", ")", "{", "if", "(", "propertyName", ".", "startsWith", "(", "CP_VARIABLE_PREFERENCES_PREFIX", ")", ")", "{", "String", "varName", "=", "propertyName", ".", "substring", "(", "CP_VARIABLE_PREFERENCES_PREFIX", ".", "length", "(", ")", ")", ";", "JavaModelManager", "manager", "=", "getJavaModelManager", "(", ")", ";", "if", "(", "manager", ".", "variablesWithInitializer", ".", "contains", "(", "varName", ")", ")", "{", "String", "oldValue", "=", "(", "String", ")", "event", ".", "getOldValue", "(", ")", ";", "if", "(", "oldValue", "==", "null", ")", "{", "manager", ".", "variablesWithInitializer", ".", "remove", "(", "varName", ")", ";", "}", "else", "{", "manager", ".", "getInstancePreferences", "(", ")", ".", "put", "(", "varName", ",", "oldValue", ")", ";", "}", "}", "else", "{", "String", "newValue", "=", "(", "String", ")", "event", ".", "getNewValue", "(", ")", ";", "IPath", "newPath", ";", "if", "(", "newValue", "!=", "null", "&&", "!", "(", "newValue", "=", "newValue", ".", "trim", "(", ")", ")", ".", "equals", "(", "CP_ENTRY_IGNORE", ")", ")", "{", "newPath", "=", "new", "Path", "(", "newValue", ")", ";", "}", "else", "{", "newPath", "=", "null", ";", "}", "try", "{", "SetVariablesOperation", "operation", "=", "new", "SetVariablesOperation", "(", "new", "String", "[", "]", "{", "varName", "}", ",", "new", "IPath", "[", "]", "{", "newPath", "}", ",", "false", ")", ";", "operation", ".", "runOperation", "(", "null", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "Util", ".", "log", "(", "e", ",", "\"\"", "+", "varName", "+", "\"", "to", "\"", "+", "newPath", ")", ";", "}", "}", "}", "else", "if", "(", "propertyName", ".", "startsWith", "(", "CP_CONTAINER_PREFERENCES_PREFIX", ")", ")", "{", "recreatePersistedContainer", "(", "propertyName", ",", "(", "String", ")", "event", ".", "getNewValue", "(", ")", ",", "false", ")", ";", "}", "else", "if", "(", "propertyName", ".", "equals", "(", "JavaCore", ".", "CORE_JAVA_BUILD_CLEAN_OUTPUT_FOLDER", ")", "||", "propertyName", ".", "equals", "(", "JavaCore", ".", "CORE_JAVA_BUILD_RESOURCE_COPY_FILTER", ")", "||", "propertyName", ".", "equals", "(", "JavaCore", ".", "CORE_JAVA_BUILD_DUPLICATE_RESOURCE", ")", "||", "propertyName", ".", "equals", "(", "JavaCore", ".", "CORE_JAVA_BUILD_RECREATE_MODIFIED_CLASS_FILES_IN_OUTPUT_FOLDER", ")", "||", "propertyName", ".", "equals", "(", "JavaCore", ".", "CORE_JAVA_BUILD_INVALID_CLASSPATH", ")", "||", "propertyName", ".", "equals", "(", "JavaCore", ".", "CORE_ENABLE_CLASSPATH_EXCLUSION_PATTERNS", ")", "||", "propertyName", ".", "equals", "(", "JavaCore", ".", "CORE_ENABLE_CLASSPATH_MULTIPLE_OUTPUT_LOCATIONS", ")", "||", "propertyName", ".", "equals", "(", "JavaCore", ".", "CORE_INCOMPLETE_CLASSPATH", ")", "||", "propertyName", ".", "equals", "(", "JavaCore", ".", "CORE_CIRCULAR_CLASSPATH", ")", "||", "propertyName", ".", "equals", "(", "JavaCore", ".", "CORE_INCOMPATIBLE_JDK_LEVEL", ")", ")", "{", "JavaModelManager", "manager", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ";", "IJavaModel", "model", "=", "manager", ".", "getJavaModel", "(", ")", ";", "IJavaProject", "[", "]", "projects", ";", "try", "{", "projects", "=", "model", ".", "getJavaProjects", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "pl", "=", "projects", ".", "length", ";", "i", "<", "pl", ";", "i", "++", ")", "{", "JavaProject", "javaProject", "=", "(", "JavaProject", ")", "projects", "[", "i", "]", ";", "manager", ".", "deltaState", ".", "addClasspathValidation", "(", "javaProject", ")", ";", "try", "{", "javaProject", ".", "getProject", "(", ")", ".", "touch", "(", "null", ")", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "}", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "}", "else", "if", "(", "propertyName", ".", "startsWith", "(", "CP_USERLIBRARY_PREFERENCES_PREFIX", ")", ")", "{", "String", "libName", "=", "propertyName", ".", "substring", "(", "CP_USERLIBRARY_PREFERENCES_PREFIX", ".", "length", "(", ")", ")", ";", "UserLibraryManager", "manager", "=", "JavaModelManager", ".", "getUserLibraryManager", "(", ")", ";", "manager", ".", "updateUserLibrary", "(", "libName", ",", "(", "String", ")", "event", ".", "getNewValue", "(", ")", ")", ";", "}", "}", "try", "{", "IJavaProject", "[", "]", "projects", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "getJavaModel", "(", ")", ".", "getJavaProjects", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "projects", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "(", "(", "JavaProject", ")", "projects", "[", "i", "]", ")", ".", "resetCaches", "(", ")", ";", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "}", "}", "EclipsePreferencesListener", "instancePreferencesListener", "=", "new", "EclipsePreferencesListener", "(", ")", ";", "IEclipsePreferences", ".", "INodeChangeListener", "instanceNodeListener", "=", "new", "IEclipsePreferences", ".", "INodeChangeListener", "(", ")", "{", "public", "void", "added", "(", "IEclipsePreferences", ".", "NodeChangeEvent", "event", ")", "{", "}", "public", "void", "removed", "(", "IEclipsePreferences", ".", "NodeChangeEvent", "event", ")", "{", "if", "(", "event", ".", "getChild", "(", ")", "==", "JavaModelManager", ".", "this", ".", "preferencesLookup", "[", "PREF_INSTANCE", "]", ")", "{", "JavaModelManager", ".", "this", ".", "preferencesLookup", "[", "PREF_INSTANCE", "]", "=", "(", "(", "IScopeContext", ")", "new", "InstanceScope", "(", ")", ")", ".", "getNode", "(", "JavaCore", ".", "PLUGIN_ID", ")", ";", "JavaModelManager", ".", "this", ".", "preferencesLookup", "[", "PREF_INSTANCE", "]", ".", "addPreferenceChangeListener", "(", "new", "EclipsePreferencesListener", "(", ")", ")", ";", "}", "}", "}", ";", "IEclipsePreferences", ".", "INodeChangeListener", "defaultNodeListener", "=", "new", "IEclipsePreferences", ".", "INodeChangeListener", "(", ")", "{", "public", "void", "added", "(", "IEclipsePreferences", ".", "NodeChangeEvent", "event", ")", "{", "}", "public", "void", "removed", "(", "IEclipsePreferences", ".", "NodeChangeEvent", "event", ")", "{", "if", "(", "event", ".", "getChild", "(", ")", "==", "JavaModelManager", ".", "this", ".", "preferencesLookup", "[", "PREF_DEFAULT", "]", ")", "{", "JavaModelManager", ".", "this", ".", "preferencesLookup", "[", "PREF_DEFAULT", "]", "=", "(", "(", "IScopeContext", ")", "new", "DefaultScope", "(", ")", ")", ".", "getNode", "(", "JavaCore", ".", "PLUGIN_ID", ")", ";", "}", "}", "}", ";", "IEclipsePreferences", ".", "IPreferenceChangeListener", "propertyListener", ";", "IEclipsePreferences", ".", "IPreferenceChangeListener", "resourcesPropertyListener", ";", "private", "JavaModelManager", "(", ")", "{", "if", "(", "Platform", ".", "isRunning", "(", ")", ")", "{", "this", ".", "indexManager", "=", "new", "IndexManager", "(", ")", ";", "this", ".", "nonChainingJars", "=", "loadNonChainingJarsCache", "(", ")", ";", "String", "includeContainerReferencedLib", "=", "System", ".", "getProperty", "(", "RESOLVE_REFERENCED_LIBRARIES_FOR_CONTAINERS", ")", ";", "this", ".", "resolveReferencedLibrariesForContainers", "=", "TRUE", ".", "equalsIgnoreCase", "(", "includeContainerReferencedLib", ")", ";", "}", "}", "private", "void", "addDeprecatedOptions", "(", "Hashtable", "options", ")", "{", "options", ".", "put", "(", "JavaCore", ".", "COMPILER_PB_INVALID_IMPORT", ",", "JavaCore", ".", "ERROR", ")", ";", "options", ".", "put", "(", "JavaCore", ".", "COMPILER_PB_UNREACHABLE_CODE", ",", "JavaCore", ".", "ERROR", ")", ";", "}", "public", "void", "addNonChainingJar", "(", "IPath", "path", ")", "{", "if", "(", "this", ".", "nonChainingJars", "!=", "null", ")", "this", ".", "nonChainingJars", ".", "add", "(", "path", ")", ";", "}", "public", "void", "cacheZipFiles", "(", "Object", "owner", ")", "{", "ZipCache", "zipCache", "=", "(", "ZipCache", ")", "this", ".", "zipFiles", ".", "get", "(", ")", ";", "if", "(", "zipCache", "!=", "null", ")", "{", "return", ";", "}", "this", ".", "zipFiles", ".", "set", "(", "new", "ZipCache", "(", "owner", ")", ")", ";", "}", "public", "void", "closeZipFile", "(", "ZipFile", "zipFile", ")", "{", "if", "(", "zipFile", "==", "null", ")", "return", ";", "if", "(", "this", ".", "zipFiles", ".", "get", "(", ")", "!=", "null", ")", "{", "return", ";", "}", "try", "{", "if", "(", "JavaModelManager", ".", "ZIP_ACCESS_VERBOSE", ")", "{", "System", ".", "out", ".", "println", "(", "\"(\"", "+", "Thread", ".", "currentThread", "(", ")", "+", "\"\"", "+", "zipFile", ".", "getName", "(", ")", ")", ";", "}", "zipFile", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "}", "}", "public", "void", "configurePluginDebugOptions", "(", ")", "{", "if", "(", "JavaCore", ".", "getPlugin", "(", ")", ".", "isDebugging", "(", ")", ")", "{", "String", "option", "=", "Platform", ".", "getDebugOption", "(", "BUFFER_MANAGER_DEBUG", ")", ";", "if", "(", "option", "!=", "null", ")", "BufferManager", ".", "VERBOSE", "=", "option", ".", "equalsIgnoreCase", "(", "TRUE", ")", ";", "option", "=", "Platform", ".", "getDebugOption", "(", "BUILDER_DEBUG", ")", ";", "if", "(", "option", "!=", "null", ")", "JavaBuilder", ".", "DEBUG", "=", "option", ".", "equalsIgnoreCase", "(", "TRUE", ")", ";", "option", "=", "Platform", ".", "getDebugOption", "(", "COMPILER_DEBUG", ")", ";", "if", "(", "option", "!=", "null", ")", "Compiler", ".", "DEBUG", "=", "option", ".", "equalsIgnoreCase", "(", "TRUE", ")", ";", "option", "=", "Platform", ".", "getDebugOption", "(", "BUILDER_STATS_DEBUG", ")", ";", "if", "(", "option", "!=", "null", ")", "JavaBuilder", ".", "SHOW_STATS", "=", "option", ".", "equalsIgnoreCase", "(", "TRUE", ")", ";", "option", "=", "Platform", ".", "getDebugOption", "(", "COMPLETION_DEBUG", ")", ";", "if", "(", "option", "!=", "null", ")", "CompletionEngine", ".", "DEBUG", "=", "option", ".", "equalsIgnoreCase", "(", "TRUE", ")", ";", "option", "=", "Platform", ".", "getDebugOption", "(", "CP_RESOLVE_DEBUG", ")", ";", "if", "(", "option", "!=", "null", ")", "JavaModelManager", ".", "CP_RESOLVE_VERBOSE", "=", "option", ".", "equalsIgnoreCase", "(", "TRUE", ")", ";", "option", "=", "Platform", ".", "getDebugOption", "(", "CP_RESOLVE_ADVANCED_DEBUG", ")", ";", "if", "(", "option", "!=", "null", ")", "JavaModelManager", ".", "CP_RESOLVE_VERBOSE_ADVANCED", "=", "option", ".", "equalsIgnoreCase", "(", "TRUE", ")", ";", "option", "=", "Platform", ".", "getDebugOption", "(", "CP_RESOLVE_FAILURE_DEBUG", ")", ";", "if", "(", "option", "!=", "null", ")", "JavaModelManager", ".", "CP_RESOLVE_VERBOSE_FAILURE", "=", "option", ".", "equalsIgnoreCase", "(", "TRUE", ")", ";", "option", "=", "Platform", ".", "getDebugOption", "(", "DELTA_DEBUG", ")", ";", "if", "(", "option", "!=", "null", ")", "DeltaProcessor", ".", "DEBUG", "=", "option", ".", "equalsIgnoreCase", "(", "TRUE", ")", ";", "option", "=", "Platform", ".", "getDebugOption", "(", "DELTA_DEBUG_VERBOSE", ")", ";", "if", "(", "option", "!=", "null", ")", "DeltaProcessor", ".", "VERBOSE", "=", "option", ".", "equalsIgnoreCase", "(", "TRUE", ")", ";", "option", "=", "Platform", ".", "getDebugOption", "(", "HIERARCHY_DEBUG", ")", ";", "if", "(", "option", "!=", "null", ")", "TypeHierarchy", ".", "DEBUG", "=", "option", ".", "equalsIgnoreCase", "(", "TRUE", ")", ";", "option", "=", "Platform", ".", "getDebugOption", "(", "INDEX_MANAGER_DEBUG", ")", ";", "if", "(", "option", "!=", "null", ")", "JobManager", ".", "VERBOSE", "=", "option", ".", "equalsIgnoreCase", "(", "TRUE", ")", ";", "option", "=", "Platform", ".", "getDebugOption", "(", "INDEX_MANAGER_ADVANCED_DEBUG", ")", ";", "if", "(", "option", "!=", "null", ")", "IndexManager", ".", "DEBUG", "=", "option", ".", "equalsIgnoreCase", "(", "TRUE", ")", ";", "option", "=", "Platform", ".", "getDebugOption", "(", "JAVAMODEL_DEBUG", ")", ";", "if", "(", "option", "!=", "null", ")", "JavaModelManager", ".", "VERBOSE", "=", "option", ".", "equalsIgnoreCase", "(", "TRUE", ")", ";", "option", "=", "Platform", ".", "getDebugOption", "(", "JAVAMODELCACHE_DEBUG", ")", ";", "if", "(", "option", "!=", "null", ")", "JavaModelCache", ".", "VERBOSE", "=", "option", ".", "equalsIgnoreCase", "(", "TRUE", ")", ";", "option", "=", "Platform", ".", "getDebugOption", "(", "POST_ACTION_DEBUG", ")", ";", "if", "(", "option", "!=", "null", ")", "JavaModelOperation", ".", "POST_ACTION_VERBOSE", "=", "option", ".", "equalsIgnoreCase", "(", "TRUE", ")", ";", "option", "=", "Platform", ".", "getDebugOption", "(", "RESOLUTION_DEBUG", ")", ";", "if", "(", "option", "!=", "null", ")", "NameLookup", ".", "VERBOSE", "=", "option", ".", "equalsIgnoreCase", "(", "TRUE", ")", ";", "option", "=", "Platform", ".", "getDebugOption", "(", "SEARCH_DEBUG", ")", ";", "if", "(", "option", "!=", "null", ")", "BasicSearchEngine", ".", "VERBOSE", "=", "option", ".", "equalsIgnoreCase", "(", "TRUE", ")", ";", "option", "=", "Platform", ".", "getDebugOption", "(", "SELECTION_DEBUG", ")", ";", "if", "(", "option", "!=", "null", ")", "SelectionEngine", ".", "DEBUG", "=", "option", ".", "equalsIgnoreCase", "(", "TRUE", ")", ";", "option", "=", "Platform", ".", "getDebugOption", "(", "ZIP_ACCESS_DEBUG", ")", ";", "if", "(", "option", "!=", "null", ")", "JavaModelManager", ".", "ZIP_ACCESS_VERBOSE", "=", "option", ".", "equalsIgnoreCase", "(", "TRUE", ")", ";", "option", "=", "Platform", ".", "getDebugOption", "(", "SOURCE_MAPPER_DEBUG_VERBOSE", ")", ";", "if", "(", "option", "!=", "null", ")", "SourceMapper", ".", "VERBOSE", "=", "option", ".", "equalsIgnoreCase", "(", "TRUE", ")", ";", "option", "=", "Platform", ".", "getDebugOption", "(", "FORMATTER_DEBUG", ")", ";", "if", "(", "option", "!=", "null", ")", "DefaultCodeFormatter", ".", "DEBUG", "=", "option", ".", "equalsIgnoreCase", "(", "TRUE", ")", ";", "}", "if", "(", "PerformanceStats", ".", "ENABLED", ")", "{", "CompletionEngine", ".", "PERF", "=", "PerformanceStats", ".", "isEnabled", "(", "COMPLETION_PERF", ")", ";", "SelectionEngine", ".", "PERF", "=", "PerformanceStats", ".", "isEnabled", "(", "SELECTION_PERF", ")", ";", "DeltaProcessor", ".", "PERF", "=", "PerformanceStats", ".", "isEnabled", "(", "DELTA_LISTENER_PERF", ")", ";", "JavaModelManager", ".", "PERF_VARIABLE_INITIALIZER", "=", "PerformanceStats", ".", "isEnabled", "(", "VARIABLE_INITIALIZER_PERF", ")", ";", "JavaModelManager", ".", "PERF_CONTAINER_INITIALIZER", "=", "PerformanceStats", ".", "isEnabled", "(", "CONTAINER_INITIALIZER_PERF", ")", ";", "ReconcileWorkingCopyOperation", ".", "PERF", "=", "PerformanceStats", ".", "isEnabled", "(", "RECONCILE_PERF", ")", ";", "}", "}", "public", "AbstractAnnotationProcessorManager", "createAnnotationProcessorManager", "(", ")", "{", "synchronized", "(", "this", ")", "{", "if", "(", "this", ".", "annotationProcessorManagerFactory", "==", "null", ")", "{", "IExtensionPoint", "extension", "=", "Platform", ".", "getExtensionRegistry", "(", ")", ".", "getExtensionPoint", "(", "JavaCore", ".", "PLUGIN_ID", ",", "ANNOTATION_PROCESSOR_MANAGER_EXTPOINT_ID", ")", ";", "if", "(", "extension", "==", "null", ")", "return", "null", ";", "IExtension", "[", "]", "extensions", "=", "extension", ".", "getExtensions", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "extensions", ".", "length", ";", "i", "++", ")", "{", "if", "(", "i", ">", "0", ")", "{", "Util", ".", "log", "(", "null", ",", "\"\"", "+", "extensions", "[", "i", "]", ".", "getUniqueIdentifier", "(", ")", ")", ";", "break", ";", "}", "IConfigurationElement", "[", "]", "configElements", "=", "extensions", "[", "i", "]", ".", "getConfigurationElements", "(", ")", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "configElements", ".", "length", ";", "j", "++", ")", "{", "final", "IConfigurationElement", "configElement", "=", "configElements", "[", "j", "]", ";", "if", "(", "\"\"", ".", "equals", "(", "configElement", ".", "getName", "(", ")", ")", ")", "{", "this", ".", "annotationProcessorManagerFactory", "=", "configElement", ";", "break", ";", "}", "}", "}", "}", "}", "if", "(", "this", ".", "annotationProcessorManagerFactory", "==", "null", ")", "{", "return", "null", ";", "}", "final", "AbstractAnnotationProcessorManager", "[", "]", "apm", "=", "new", "AbstractAnnotationProcessorManager", "[", "1", "]", ";", "apm", "[", "0", "]", "=", "null", ";", "final", "IConfigurationElement", "factory", "=", "this", ".", "annotationProcessorManagerFactory", ";", "SafeRunner", ".", "run", "(", "new", "ISafeRunnable", "(", ")", "{", "public", "void", "handleException", "(", "Throwable", "exception", ")", "{", "Util", ".", "log", "(", "exception", ",", "\"\"", ")", ";", "}", "public", "void", "run", "(", ")", "throws", "Exception", "{", "Object", "executableExtension", "=", "factory", ".", "createExecutableExtension", "(", "\"class\"", ")", ";", "if", "(", "executableExtension", "instanceof", "AbstractAnnotationProcessorManager", ")", "{", "apm", "[", "0", "]", "=", "(", "AbstractAnnotationProcessorManager", ")", "executableExtension", ";", "}", "}", "}", ")", ";", "return", "apm", "[", "0", "]", ";", "}", "public", "int", "discardPerWorkingCopyInfo", "(", "CompilationUnit", "workingCopy", ")", "throws", "JavaModelException", "{", "JavaElementDeltaBuilder", "deltaBuilder", "=", "null", ";", "if", "(", "workingCopy", ".", "isPrimary", "(", ")", "&&", "workingCopy", ".", "hasUnsavedChanges", "(", ")", ")", "{", "deltaBuilder", "=", "new", "JavaElementDeltaBuilder", "(", "workingCopy", ")", ";", "}", "PerWorkingCopyInfo", "info", "=", "null", ";", "synchronized", "(", "this", ".", "perWorkingCopyInfos", ")", "{", "WorkingCopyOwner", "owner", "=", "workingCopy", ".", "owner", ";", "Map", "workingCopyToInfos", "=", "(", "Map", ")", "this", ".", "perWorkingCopyInfos", ".", "get", "(", "owner", ")", ";", "if", "(", "workingCopyToInfos", "==", "null", ")", "return", "-", "1", ";", "info", "=", "(", "PerWorkingCopyInfo", ")", "workingCopyToInfos", ".", "get", "(", "workingCopy", ")", ";", "if", "(", "info", "==", "null", ")", "return", "-", "1", ";", "if", "(", "--", "info", ".", "useCount", "==", "0", ")", "{", "workingCopyToInfos", ".", "remove", "(", "workingCopy", ")", ";", "if", "(", "workingCopyToInfos", ".", "isEmpty", "(", ")", ")", "{", "this", ".", "perWorkingCopyInfos", ".", "remove", "(", "owner", ")", ";", "}", "}", "}", "if", "(", "info", ".", "useCount", "==", "0", ")", "{", "removeInfoAndChildren", "(", "workingCopy", ")", ";", "workingCopy", ".", "closeBuffer", "(", ")", ";", "if", "(", "deltaBuilder", "!=", "null", ")", "{", "deltaBuilder", ".", "buildDeltas", "(", ")", ";", "if", "(", "deltaBuilder", ".", "delta", "!=", "null", ")", "{", "getDeltaProcessor", "(", ")", ".", "registerJavaModelDelta", "(", "deltaBuilder", ".", "delta", ")", ";", "}", "}", "}", "return", "info", ".", "useCount", ";", "}", "public", "void", "doneSaving", "(", "ISaveContext", "context", ")", "{", "}", "public", "void", "flushZipFiles", "(", "Object", "owner", ")", "{", "ZipCache", "zipCache", "=", "(", "ZipCache", ")", "this", ".", "zipFiles", ".", "get", "(", ")", ";", "if", "(", "zipCache", "==", "null", ")", "{", "return", ";", "}", "if", "(", "zipCache", ".", "owner", "==", "owner", ")", "{", "this", ".", "zipFiles", ".", "set", "(", "null", ")", ";", "zipCache", ".", "flush", "(", ")", ";", "}", "}", "public", "synchronized", "boolean", "forceBatchInitializations", "(", "boolean", "initAfterLoad", ")", "{", "switch", "(", "this", ".", "batchContainerInitializations", ")", "{", "case", "NO_BATCH_INITIALIZATION", ":", "this", ".", "batchContainerInitializations", "=", "NEED_BATCH_INITIALIZATION", ";", "return", "true", ";", "case", "BATCH_INITIALIZATION_FINISHED", ":", "if", "(", "initAfterLoad", ")", "return", "false", ";", "this", ".", "batchContainerInitializations", "=", "NEED_BATCH_INITIALIZATION", ";", "return", "true", ";", "}", "return", "false", ";", "}", "private", "synchronized", "boolean", "batchContainerInitializations", "(", ")", "{", "switch", "(", "this", ".", "batchContainerInitializations", ")", "{", "case", "NEED_BATCH_INITIALIZATION", ":", "this", ".", "batchContainerInitializations", "=", "BATCH_INITIALIZATION_IN_PROGRESS", ";", "return", "true", ";", "case", "BATCH_INITIALIZATION_IN_PROGRESS", ":", "return", "true", ";", "}", "return", "false", ";", "}", "private", "synchronized", "void", "batchInitializationFinished", "(", ")", "{", "this", ".", "batchContainerInitializations", "=", "BATCH_INITIALIZATION_FINISHED", ";", "}", "public", "IClasspathContainer", "getClasspathContainer", "(", "final", "IPath", "containerPath", ",", "final", "IJavaProject", "project", ")", "throws", "JavaModelException", "{", "IClasspathContainer", "container", "=", "containerGet", "(", "project", ",", "containerPath", ")", ";", "if", "(", "container", "==", "null", ")", "{", "if", "(", "batchContainerInitializations", "(", ")", ")", "{", "try", "{", "container", "=", "initializeAllContainers", "(", "project", ",", "containerPath", ")", ";", "}", "finally", "{", "batchInitializationFinished", "(", ")", ";", "}", "}", "else", "{", "container", "=", "initializeContainer", "(", "project", ",", "containerPath", ")", ";", "containerBeingInitializedRemove", "(", "project", ",", "containerPath", ")", ";", "SetContainerOperation", "operation", "=", "new", "SetContainerOperation", "(", "containerPath", ",", "new", "IJavaProject", "[", "]", "{", "project", "}", ",", "new", "IClasspathContainer", "[", "]", "{", "container", "}", ")", ";", "operation", ".", "runOperation", "(", "null", ")", ";", "}", "}", "return", "container", ";", "}", "public", "IClasspathEntry", "[", "]", "getReferencedClasspathEntries", "(", "IClasspathEntry", "libraryEntry", ",", "IJavaProject", "project", ")", "{", "IClasspathEntry", "[", "]", "referencedEntries", "=", "(", "(", "ClasspathEntry", ")", "libraryEntry", ")", ".", "resolvedChainedLibraries", "(", ")", ";", "if", "(", "project", "==", "null", ")", "return", "referencedEntries", ";", "PerProjectInfo", "perProjectInfo", "=", "getPerProjectInfo", "(", "project", ".", "getProject", "(", ")", ",", "false", ")", ";", "if", "(", "perProjectInfo", "==", "null", ")", "return", "referencedEntries", ";", "List", "pathToReferencedEntries", "=", "new", "ArrayList", "(", "referencedEntries", ".", "length", ")", ";", "for", "(", "int", "index", "=", "0", ";", "index", "<", "referencedEntries", ".", "length", ";", "index", "++", ")", "{", "if", "(", "pathToReferencedEntries", ".", "contains", "(", "referencedEntries", "[", "index", "]", ".", "getPath", "(", ")", ")", ")", "continue", ";", "IClasspathEntry", "persistedEntry", "=", "null", ";", "if", "(", "(", "persistedEntry", "=", "(", "IClasspathEntry", ")", "perProjectInfo", ".", "rootPathToResolvedEntries", ".", "get", "(", "referencedEntries", "[", "index", "]", ".", "getPath", "(", ")", ")", ")", "!=", "null", ")", "{", "referencedEntries", "[", "index", "]", "=", "persistedEntry", ";", "}", "pathToReferencedEntries", ".", "add", "(", "referencedEntries", "[", "index", "]", ".", "getPath", "(", ")", ")", ";", "}", "return", "referencedEntries", ";", "}", "public", "DeltaProcessor", "getDeltaProcessor", "(", ")", "{", "return", "this", ".", "deltaState", ".", "getDeltaProcessor", "(", ")", ";", "}", "public", "static", "DeltaProcessingState", "getDeltaState", "(", ")", "{", "return", "MANAGER", ".", "deltaState", ";", "}", "protected", "HashSet", "getElementsOutOfSynchWithBuffers", "(", ")", "{", "return", "this", ".", "elementsOutOfSynchWithBuffers", ";", "}", "public", "static", "ExternalFoldersManager", "getExternalManager", "(", ")", "{", "return", "MANAGER", ".", "externalFoldersManager", ";", "}", "public", "static", "IndexManager", "getIndexManager", "(", ")", "{", "return", "MANAGER", ".", "indexManager", ";", "}", "public", "synchronized", "Object", "getInfo", "(", "IJavaElement", "element", ")", "{", "HashMap", "tempCache", "=", "(", "HashMap", ")", "this", ".", "temporaryCache", ".", "get", "(", ")", ";", "if", "(", "tempCache", "!=", "null", ")", "{", "Object", "result", "=", "tempCache", ".", "get", "(", "element", ")", ";", "if", "(", "result", "!=", "null", ")", "{", "return", "result", ";", "}", "}", "return", "this", ".", "cache", ".", "getInfo", "(", "element", ")", ";", "}", "public", "synchronized", "IJavaElement", "getExistingElement", "(", "IJavaElement", "element", ")", "{", "return", "this", ".", "cache", ".", "getExistingElement", "(", "element", ")", ";", "}", "public", "HashSet", "getExternalWorkingCopyProjects", "(", ")", "{", "synchronized", "(", "this", ".", "perWorkingCopyInfos", ")", "{", "HashSet", "result", "=", "null", ";", "Iterator", "values", "=", "this", ".", "perWorkingCopyInfos", ".", "values", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "values", ".", "hasNext", "(", ")", ")", "{", "Map", "ownerCopies", "=", "(", "Map", ")", "values", ".", "next", "(", ")", ";", "Iterator", "workingCopies", "=", "ownerCopies", ".", "keySet", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "workingCopies", ".", "hasNext", "(", ")", ")", "{", "ICompilationUnit", "workingCopy", "=", "(", "ICompilationUnit", ")", "workingCopies", ".", "next", "(", ")", ";", "IJavaProject", "project", "=", "workingCopy", ".", "getJavaProject", "(", ")", ";", "if", "(", "project", ".", "getElementName", "(", ")", ".", "equals", "(", "ExternalJavaProject", ".", "EXTERNAL_PROJECT_NAME", ")", ")", "{", "if", "(", "result", "==", "null", ")", "result", "=", "new", "HashSet", "(", ")", ";", "result", ".", "add", "(", "project", ")", ";", "}", "}", "}", "return", "result", ";", "}", "}", "public", "IEclipsePreferences", "getInstancePreferences", "(", ")", "{", "return", "this", ".", "preferencesLookup", "[", "PREF_INSTANCE", "]", ";", "}", "public", "Hashtable", "getDefaultOptions", "(", ")", "{", "Hashtable", "defaultOptions", "=", "new", "Hashtable", "(", "10", ")", ";", "IEclipsePreferences", "defaultPreferences", "=", "getDefaultPreferences", "(", ")", ";", "Iterator", "iterator", "=", "this", ".", "optionNames", ".", "iterator", "(", ")", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "String", "propertyName", "=", "(", "String", ")", "iterator", ".", "next", "(", ")", ";", "String", "value", "=", "defaultPreferences", ".", "get", "(", "propertyName", ",", "null", ")", ";", "if", "(", "value", "!=", "null", ")", "defaultOptions", ".", "put", "(", "propertyName", ",", "value", ")", ";", "}", "defaultOptions", ".", "put", "(", "JavaCore", ".", "CORE_ENCODING", ",", "JavaCore", ".", "getEncoding", "(", ")", ")", ";", "addDeprecatedOptions", "(", "defaultOptions", ")", ";", "return", "defaultOptions", ";", "}", "public", "IEclipsePreferences", "getDefaultPreferences", "(", ")", "{", "return", "this", ".", "preferencesLookup", "[", "PREF_DEFAULT", "]", ";", "}", "public", "final", "JavaModel", "getJavaModel", "(", ")", "{", "return", "this", ".", "javaModel", ";", "}", "public", "final", "static", "JavaModelManager", "getJavaModelManager", "(", ")", "{", "return", "MANAGER", ";", "}", "public", "Object", "getLastBuiltState", "(", "IProject", "project", ",", "IProgressMonitor", "monitor", ")", "{", "if", "(", "!", "JavaProject", ".", "hasJavaNature", "(", "project", ")", ")", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "project", "+", "\"\"", ")", ";", "return", "null", ";", "}", "PerProjectInfo", "info", "=", "getPerProjectInfo", "(", "project", ",", "true", ")", ";", "if", "(", "!", "info", ".", "triedRead", ")", "{", "info", ".", "triedRead", "=", "true", ";", "try", "{", "if", "(", "monitor", "!=", "null", ")", "monitor", ".", "subTask", "(", "Messages", ".", "bind", "(", "Messages", ".", "build_readStateProgress", ",", "project", ".", "getName", "(", ")", ")", ")", ";", "info", ".", "savedState", "=", "readState", "(", "project", ")", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "}", "return", "info", ".", "savedState", ";", "}", "public", "String", "getOption", "(", "String", "optionName", ")", "{", "if", "(", "JavaCore", ".", "CORE_ENCODING", ".", "equals", "(", "optionName", ")", ")", "{", "return", "JavaCore", ".", "getEncoding", "(", ")", ";", "}", "if", "(", "isDeprecatedOption", "(", "optionName", ")", ")", "{", "return", "JavaCore", ".", "ERROR", ";", "}", "String", "propertyName", "=", "optionName", ";", "if", "(", "this", ".", "optionNames", ".", "contains", "(", "propertyName", ")", ")", "{", "IPreferencesService", "service", "=", "Platform", ".", "getPreferencesService", "(", ")", ";", "String", "value", "=", "service", ".", "get", "(", "optionName", ",", "null", ",", "this", ".", "preferencesLookup", ")", ";", "return", "value", "==", "null", "?", "null", ":", "value", ".", "trim", "(", ")", ";", "}", "return", "null", ";", "}", "public", "Hashtable", "getOptions", "(", ")", "{", "Hashtable", "cachedOptions", ";", "if", "(", "(", "cachedOptions", "=", "this", ".", "optionsCache", ")", "!=", "null", ")", "return", "new", "Hashtable", "(", "cachedOptions", ")", ";", "if", "(", "!", "Platform", ".", "isRunning", "(", ")", ")", "{", "return", "this", ".", "optionsCache", "=", "getDefaultOptionsNoInitialization", "(", ")", ";", "}", "Hashtable", "options", "=", "new", "Hashtable", "(", "10", ")", ";", "IPreferencesService", "service", "=", "Platform", ".", "getPreferencesService", "(", ")", ";", "Iterator", "iterator", "=", "this", ".", "optionNames", ".", "iterator", "(", ")", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "String", "propertyName", "=", "(", "String", ")", "iterator", ".", "next", "(", ")", ";", "String", "propertyValue", "=", "service", ".", "get", "(", "propertyName", ",", "null", ",", "this", ".", "preferencesLookup", ")", ";", "if", "(", "propertyValue", "!=", "null", ")", "{", "options", ".", "put", "(", "propertyName", ",", "propertyValue", ")", ";", "}", "}", "options", ".", "put", "(", "JavaCore", ".", "CORE_ENCODING", ",", "JavaCore", ".", "getEncoding", "(", ")", ")", ";", "addDeprecatedOptions", "(", "options", ")", ";", "Util", ".", "fixTaskTags", "(", "options", ")", ";", "this", ".", "optionsCache", "=", "new", "Hashtable", "(", "options", ")", ";", "return", "options", ";", "}", "private", "Hashtable", "getDefaultOptionsNoInitialization", "(", ")", "{", "Map", "defaultOptionsMap", "=", "new", "CompilerOptions", "(", ")", ".", "getMap", "(", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "COMPILER_LOCAL_VARIABLE_ATTR", ",", "JavaCore", ".", "GENERATE", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "COMPILER_CODEGEN_UNUSED_LOCAL", ",", "JavaCore", ".", "PRESERVE", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "COMPILER_TASK_TAGS", ",", "JavaCore", ".", "DEFAULT_TASK_TAGS", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "COMPILER_TASK_PRIORITIES", ",", "JavaCore", ".", "DEFAULT_TASK_PRIORITIES", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "COMPILER_TASK_CASE_SENSITIVE", ",", "JavaCore", ".", "ENABLED", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "COMPILER_DOC_COMMENT_SUPPORT", ",", "JavaCore", ".", "ENABLED", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "COMPILER_PB_FORBIDDEN_REFERENCE", ",", "JavaCore", ".", "ERROR", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "CORE_JAVA_BUILD_RESOURCE_COPY_FILTER", ",", "\"\"", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "CORE_JAVA_BUILD_INVALID_CLASSPATH", ",", "JavaCore", ".", "ABORT", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "CORE_JAVA_BUILD_DUPLICATE_RESOURCE", ",", "JavaCore", ".", "WARNING", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "CORE_JAVA_BUILD_CLEAN_OUTPUT_FOLDER", ",", "JavaCore", ".", "CLEAN", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "CORE_JAVA_BUILD_ORDER", ",", "JavaCore", ".", "IGNORE", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "CORE_INCOMPLETE_CLASSPATH", ",", "JavaCore", ".", "ERROR", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "CORE_CIRCULAR_CLASSPATH", ",", "JavaCore", ".", "ERROR", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "CORE_INCOMPATIBLE_JDK_LEVEL", ",", "JavaCore", ".", "IGNORE", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "CORE_ENABLE_CLASSPATH_EXCLUSION_PATTERNS", ",", "JavaCore", ".", "ENABLED", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "CORE_ENABLE_CLASSPATH_MULTIPLE_OUTPUT_LOCATIONS", ",", "JavaCore", ".", "ENABLED", ")", ";", "defaultOptionsMap", ".", "putAll", "(", "DefaultCodeFormatterConstants", ".", "getEclipseDefaultSettings", "(", ")", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "CODEASSIST_VISIBILITY_CHECK", ",", "JavaCore", ".", "DISABLED", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "CODEASSIST_DEPRECATION_CHECK", ",", "JavaCore", ".", "DISABLED", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "CODEASSIST_IMPLICIT_QUALIFICATION", ",", "JavaCore", ".", "DISABLED", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "CODEASSIST_FIELD_PREFIXES", ",", "\"\"", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "CODEASSIST_STATIC_FIELD_PREFIXES", ",", "\"\"", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "CODEASSIST_STATIC_FINAL_FIELD_PREFIXES", ",", "\"\"", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "CODEASSIST_LOCAL_PREFIXES", ",", "\"\"", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "CODEASSIST_ARGUMENT_PREFIXES", ",", "\"\"", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "CODEASSIST_FIELD_SUFFIXES", ",", "\"\"", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "CODEASSIST_STATIC_FIELD_SUFFIXES", ",", "\"\"", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "CODEASSIST_STATIC_FINAL_FIELD_SUFFIXES", ",", "\"\"", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "CODEASSIST_LOCAL_SUFFIXES", ",", "\"\"", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "CODEASSIST_ARGUMENT_SUFFIXES", ",", "\"\"", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "CODEASSIST_FORBIDDEN_REFERENCE_CHECK", ",", "JavaCore", ".", "ENABLED", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "CODEASSIST_DISCOURAGED_REFERENCE_CHECK", ",", "JavaCore", ".", "DISABLED", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "CODEASSIST_CAMEL_CASE_MATCH", ",", "JavaCore", ".", "ENABLED", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "CODEASSIST_SUGGEST_STATIC_IMPORTS", ",", "JavaCore", ".", "ENABLED", ")", ";", "defaultOptionsMap", ".", "put", "(", "JavaCore", ".", "TIMEOUT_FOR_PARAMETER_NAME_FROM_ATTACHED_JAVADOC", ",", "\"50\"", ")", ";", "return", "new", "Hashtable", "(", "defaultOptionsMap", ")", ";", "}", "public", "PerProjectInfo", "getPerProjectInfo", "(", "IProject", "project", ",", "boolean", "create", ")", "{", "synchronized", "(", "this", ".", "perProjectInfos", ")", "{", "PerProjectInfo", "info", "=", "(", "PerProjectInfo", ")", "this", ".", "perProjectInfos", ".", "get", "(", "project", ")", ";", "if", "(", "info", "==", "null", "&&", "create", ")", "{", "info", "=", "new", "PerProjectInfo", "(", "project", ")", ";", "this", ".", "perProjectInfos", ".", "put", "(", "project", ",", "info", ")", ";", "}", "return", "info", ";", "}", "}", "public", "PerProjectInfo", "getPerProjectInfoCheckExistence", "(", "IProject", "project", ")", "throws", "JavaModelException", "{", "JavaModelManager", ".", "PerProjectInfo", "info", "=", "getPerProjectInfo", "(", "project", ",", "false", ")", ";", "if", "(", "info", "==", "null", ")", "{", "if", "(", "!", "JavaProject", ".", "hasJavaNature", "(", "project", ")", ")", "{", "throw", "(", "(", "JavaProject", ")", "JavaCore", ".", "create", "(", "project", ")", ")", ".", "newNotPresentException", "(", ")", ";", "}", "info", "=", "getPerProjectInfo", "(", "project", ",", "true", ")", ";", "}", "return", "info", ";", "}", "public", "PerWorkingCopyInfo", "getPerWorkingCopyInfo", "(", "CompilationUnit", "workingCopy", ",", "boolean", "create", ",", "boolean", "recordUsage", ",", "IProblemRequestor", "problemRequestor", ")", "{", "synchronized", "(", "this", ".", "perWorkingCopyInfos", ")", "{", "WorkingCopyOwner", "owner", "=", "workingCopy", ".", "owner", ";", "Map", "workingCopyToInfos", "=", "(", "Map", ")", "this", ".", "perWorkingCopyInfos", ".", "get", "(", "owner", ")", ";", "if", "(", "workingCopyToInfos", "==", "null", "&&", "create", ")", "{", "workingCopyToInfos", "=", "new", "HashMap", "(", ")", ";", "this", ".", "perWorkingCopyInfos", ".", "put", "(", "owner", ",", "workingCopyToInfos", ")", ";", "}", "PerWorkingCopyInfo", "info", "=", "workingCopyToInfos", "==", "null", "?", "null", ":", "(", "PerWorkingCopyInfo", ")", "workingCopyToInfos", ".", "get", "(", "workingCopy", ")", ";", "if", "(", "info", "==", "null", "&&", "create", ")", "{", "info", "=", "new", "PerWorkingCopyInfo", "(", "workingCopy", ",", "problemRequestor", ")", ";", "workingCopyToInfos", ".", "put", "(", "workingCopy", ",", "info", ")", ";", "}", "if", "(", "info", "!=", "null", "&&", "recordUsage", ")", "info", ".", "useCount", "++", ";", "return", "info", ";", "}", "}", "public", "IClasspathContainer", "getPreviousSessionContainer", "(", "IPath", "containerPath", ",", "IJavaProject", "project", ")", "{", "Map", "previousContainerValues", "=", "(", "Map", ")", "this", ".", "previousSessionContainers", ".", "get", "(", "project", ")", ";", "if", "(", "previousContainerValues", "!=", "null", ")", "{", "IClasspathContainer", "previousContainer", "=", "(", "IClasspathContainer", ")", "previousContainerValues", ".", "get", "(", "containerPath", ")", ";", "if", "(", "previousContainer", "!=", "null", ")", "{", "if", "(", "JavaModelManager", ".", "CP_RESOLVE_VERBOSE_ADVANCED", ")", "verbose_reentering_project_container_access", "(", "containerPath", ",", "project", ",", "previousContainer", ")", ";", "return", "previousContainer", ";", "}", "}", "return", "null", ";", "}", "private", "void", "verbose_reentering_project_container_access", "(", "IPath", "containerPath", ",", "IJavaProject", "project", ",", "IClasspathContainer", "previousContainer", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "buffer", ".", "append", "(", "\"\"", ")", ";", "buffer", ".", "append", "(", "\"tproject:", "\"", "+", "project", ".", "getElementName", "(", ")", "+", "'\\n'", ")", ";", "buffer", ".", "append", "(", "\"\"", "+", "containerPath", "+", "'\\n'", ")", ";", "buffer", ".", "append", "(", "\"\"", ")", ";", "buffer", ".", "append", "(", "previousContainer", ".", "getDescription", "(", ")", ")", ";", "buffer", ".", "append", "(", "\"", "{n\"", ")", ";", "IClasspathEntry", "[", "]", "entries", "=", "previousContainer", ".", "getClasspathEntries", "(", ")", ";", "if", "(", "entries", "!=", "null", ")", "{", "for", "(", "int", "j", "=", "0", ";", "j", "<", "entries", ".", "length", ";", "j", "++", ")", "{", "buffer", ".", "append", "(", "\"", "tt\"", ")", ";", "buffer", ".", "append", "(", "entries", "[", "j", "]", ")", ";", "buffer", ".", "append", "(", "'\\n'", ")", ";", "}", "}", "buffer", ".", "append", "(", "\"", "t}\"", ")", ";", "Util", ".", "verbose", "(", "buffer", ".", "toString", "(", ")", ")", ";", "new", "Exception", "(", "\"\"", ")", ".", "printStackTrace", "(", "System", ".", "out", ")", ";", "}", "public", "IPath", "getPreviousSessionVariable", "(", "String", "variableName", ")", "{", "IPath", "previousPath", "=", "(", "IPath", ")", "this", ".", "previousSessionVariables", ".", "get", "(", "variableName", ")", ";", "if", "(", "previousPath", "!=", "null", ")", "{", "if", "(", "CP_RESOLVE_VERBOSE_ADVANCED", ")", "verbose_reentering_variable_access", "(", "variableName", ",", "previousPath", ")", ";", "return", "previousPath", ";", "}", "return", "null", ";", "}", "private", "void", "verbose_reentering_variable_access", "(", "String", "variableName", ",", "IPath", "previousPath", ")", "{", "Util", ".", "verbose", "(", "\"\"", "+", "\"tvariable:", "\"", "+", "variableName", "+", "'\\n'", "+", "\"\"", "+", "previousPath", ")", ";", "new", "Exception", "(", "\"\"", ")", ".", "printStackTrace", "(", "System", ".", "out", ")", ";", "}", "public", "HashMap", "getTemporaryCache", "(", ")", "{", "HashMap", "result", "=", "(", "HashMap", ")", "this", ".", "temporaryCache", ".", "get", "(", ")", ";", "if", "(", "result", "==", "null", ")", "{", "result", "=", "new", "HashMap", "(", ")", ";", "this", ".", "temporaryCache", ".", "set", "(", "result", ")", ";", "}", "return", "result", ";", "}", "private", "File", "getVariableAndContainersFile", "(", ")", "{", "return", "JavaCore", ".", "getPlugin", "(", ")", ".", "getStateLocation", "(", ")", ".", "append", "(", "\"\"", ")", ".", "toFile", "(", ")", ";", "}", "public", "static", "String", "[", "]", "getRegisteredVariableNames", "(", ")", "{", "Plugin", "jdtCorePlugin", "=", "JavaCore", ".", "getPlugin", "(", ")", ";", "if", "(", "jdtCorePlugin", "==", "null", ")", "return", "null", ";", "ArrayList", "variableList", "=", "new", "ArrayList", "(", "5", ")", ";", "IExtensionPoint", "extension", "=", "Platform", ".", "getExtensionRegistry", "(", ")", ".", "getExtensionPoint", "(", "JavaCore", ".", "PLUGIN_ID", ",", "JavaModelManager", ".", "CPVARIABLE_INITIALIZER_EXTPOINT_ID", ")", ";", "if", "(", "extension", "!=", "null", ")", "{", "IExtension", "[", "]", "extensions", "=", "extension", ".", "getExtensions", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "extensions", ".", "length", ";", "i", "++", ")", "{", "IConfigurationElement", "[", "]", "configElements", "=", "extensions", "[", "i", "]", ".", "getConfigurationElements", "(", ")", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "configElements", ".", "length", ";", "j", "++", ")", "{", "String", "varAttribute", "=", "configElements", "[", "j", "]", ".", "getAttribute", "(", "\"variable\"", ")", ";", "if", "(", "varAttribute", "!=", "null", ")", "variableList", ".", "add", "(", "varAttribute", ")", ";", "}", "}", "}", "String", "[", "]", "variableNames", "=", "new", "String", "[", "variableList", ".", "size", "(", ")", "]", ";", "variableList", ".", "toArray", "(", "variableNames", ")", ";", "return", "variableNames", ";", "}", "public", "static", "String", "[", "]", "getRegisteredContainerIDs", "(", ")", "{", "Plugin", "jdtCorePlugin", "=", "JavaCore", ".", "getPlugin", "(", ")", ";", "if", "(", "jdtCorePlugin", "==", "null", ")", "return", "null", ";", "ArrayList", "containerIDList", "=", "new", "ArrayList", "(", "5", ")", ";", "IExtensionPoint", "extension", "=", "Platform", ".", "getExtensionRegistry", "(", ")", ".", "getExtensionPoint", "(", "JavaCore", ".", "PLUGIN_ID", ",", "JavaModelManager", ".", "CPCONTAINER_INITIALIZER_EXTPOINT_ID", ")", ";", "if", "(", "extension", "!=", "null", ")", "{", "IExtension", "[", "]", "extensions", "=", "extension", ".", "getExtensions", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "extensions", ".", "length", ";", "i", "++", ")", "{", "IConfigurationElement", "[", "]", "configElements", "=", "extensions", "[", "i", "]", ".", "getConfigurationElements", "(", ")", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "configElements", ".", "length", ";", "j", "++", ")", "{", "String", "idAttribute", "=", "configElements", "[", "j", "]", ".", "getAttribute", "(", "\"id\"", ")", ";", "if", "(", "idAttribute", "!=", "null", ")", "containerIDList", ".", "add", "(", "idAttribute", ")", ";", "}", "}", "}", "String", "[", "]", "containerIDs", "=", "new", "String", "[", "containerIDList", ".", "size", "(", ")", "]", ";", "containerIDList", ".", "toArray", "(", "containerIDs", ")", ";", "return", "containerIDs", ";", "}", "public", "IClasspathEntry", "resolveVariableEntry", "(", "IClasspathEntry", "entry", ",", "boolean", "usePreviousSession", ")", "{", "if", "(", "entry", ".", "getEntryKind", "(", ")", "!=", "IClasspathEntry", ".", "CPE_VARIABLE", ")", "return", "entry", ";", "IPath", "resolvedPath", "=", "getResolvedVariablePath", "(", "entry", ".", "getPath", "(", ")", ",", "usePreviousSession", ")", ";", "if", "(", "resolvedPath", "==", "null", ")", "return", "null", ";", "resolvedPath", "=", "ClasspathEntry", ".", "resolveDotDot", "(", "resolvedPath", ")", ";", "Object", "target", "=", "JavaModel", ".", "getTarget", "(", "resolvedPath", ",", "false", ")", ";", "if", "(", "target", "==", "null", ")", "return", "null", ";", "if", "(", "target", "instanceof", "IResource", ")", "{", "IResource", "resolvedResource", "=", "(", "IResource", ")", "target", ";", "switch", "(", "resolvedResource", ".", "getType", "(", ")", ")", "{", "case", "IResource", ".", "PROJECT", ":", "return", "JavaCore", ".", "newProjectEntry", "(", "resolvedPath", ",", "entry", ".", "getAccessRules", "(", ")", ",", "entry", ".", "combineAccessRules", "(", ")", ",", "entry", ".", "getExtraAttributes", "(", ")", ",", "entry", ".", "isExported", "(", ")", ")", ";", "case", "IResource", ".", "FILE", ":", "return", "JavaCore", ".", "newLibraryEntry", "(", "resolvedPath", ",", "getResolvedVariablePath", "(", "entry", ".", "getSourceAttachmentPath", "(", ")", ",", "usePreviousSession", ")", ",", "getResolvedVariablePath", "(", "entry", ".", "getSourceAttachmentRootPath", "(", ")", ",", "usePreviousSession", ")", ",", "entry", ".", "getAccessRules", "(", ")", ",", "entry", ".", "getExtraAttributes", "(", ")", ",", "entry", ".", "isExported", "(", ")", ")", ";", "case", "IResource", ".", "FOLDER", ":", "return", "JavaCore", ".", "newLibraryEntry", "(", "resolvedPath", ",", "getResolvedVariablePath", "(", "entry", ".", "getSourceAttachmentPath", "(", ")", ",", "usePreviousSession", ")", ",", "getResolvedVariablePath", "(", "entry", ".", "getSourceAttachmentRootPath", "(", ")", ",", "usePreviousSession", ")", ",", "entry", ".", "getAccessRules", "(", ")", ",", "entry", ".", "getExtraAttributes", "(", ")", ",", "entry", ".", "isExported", "(", ")", ")", ";", "}", "}", "if", "(", "target", "instanceof", "File", ")", "{", "File", "externalFile", "=", "JavaModel", ".", "getFile", "(", "target", ")", ";", "if", "(", "externalFile", "!=", "null", ")", "{", "return", "JavaCore", ".", "newLibraryEntry", "(", "resolvedPath", ",", "getResolvedVariablePath", "(", "entry", ".", "getSourceAttachmentPath", "(", ")", ",", "usePreviousSession", ")", ",", "getResolvedVariablePath", "(", "entry", ".", "getSourceAttachmentRootPath", "(", ")", ",", "usePreviousSession", ")", ",", "entry", ".", "getAccessRules", "(", ")", ",", "entry", ".", "getExtraAttributes", "(", ")", ",", "entry", ".", "isExported", "(", ")", ")", ";", "}", "else", "{", "if", "(", "resolvedPath", ".", "isAbsolute", "(", ")", ")", "{", "return", "JavaCore", ".", "newLibraryEntry", "(", "resolvedPath", ",", "getResolvedVariablePath", "(", "entry", ".", "getSourceAttachmentPath", "(", ")", ",", "usePreviousSession", ")", ",", "getResolvedVariablePath", "(", "entry", ".", "getSourceAttachmentRootPath", "(", ")", ",", "usePreviousSession", ")", ",", "entry", ".", "getAccessRules", "(", ")", ",", "entry", ".", "getExtraAttributes", "(", ")", ",", "entry", ".", "isExported", "(", ")", ")", ";", "}", "}", "}", "return", "null", ";", "}", "public", "IPath", "getResolvedVariablePath", "(", "IPath", "variablePath", ",", "boolean", "usePreviousSession", ")", "{", "if", "(", "variablePath", "==", "null", ")", "return", "null", ";", "int", "count", "=", "variablePath", ".", "segmentCount", "(", ")", ";", "if", "(", "count", "==", "0", ")", "return", "null", ";", "String", "variableName", "=", "variablePath", ".", "segment", "(", "0", ")", ";", "IPath", "resolvedPath", "=", "usePreviousSession", "?", "getPreviousSessionVariable", "(", "variableName", ")", ":", "JavaCore", ".", "getClasspathVariable", "(", "variableName", ")", ";", "if", "(", "resolvedPath", "==", "null", ")", "return", "null", ";", "if", "(", "count", ">", "1", ")", "{", "resolvedPath", "=", "resolvedPath", ".", "append", "(", "variablePath", ".", "removeFirstSegments", "(", "1", ")", ")", ";", "}", "return", "resolvedPath", ";", "}", "private", "File", "getSerializationFile", "(", "IProject", "project", ")", "{", "if", "(", "!", "project", ".", "exists", "(", ")", ")", "return", "null", ";", "IPath", "workingLocation", "=", "project", ".", "getWorkingLocation", "(", "JavaCore", ".", "PLUGIN_ID", ")", ";", "return", "workingLocation", ".", "append", "(", "\"state.dat\"", ")", ".", "toFile", "(", ")", ";", "}", "public", "static", "UserLibraryManager", "getUserLibraryManager", "(", ")", "{", "if", "(", "MANAGER", ".", "userLibraryManager", "==", "null", ")", "{", "UserLibraryManager", "libraryManager", "=", "new", "UserLibraryManager", "(", ")", ";", "synchronized", "(", "MANAGER", ")", "{", "if", "(", "MANAGER", ".", "userLibraryManager", "==", "null", ")", "{", "MANAGER", ".", "userLibraryManager", "=", "libraryManager", ";", "}", "}", "}", "return", "MANAGER", ".", "userLibraryManager", ";", "}", "public", "ICompilationUnit", "[", "]", "getWorkingCopies", "(", "WorkingCopyOwner", "owner", ",", "boolean", "addPrimary", ")", "{", "synchronized", "(", "this", ".", "perWorkingCopyInfos", ")", "{", "ICompilationUnit", "[", "]", "primaryWCs", "=", "addPrimary", "&&", "owner", "!=", "DefaultWorkingCopyOwner", ".", "PRIMARY", "?", "getWorkingCopies", "(", "DefaultWorkingCopyOwner", ".", "PRIMARY", ",", "false", ")", ":", "null", ";", "Map", "workingCopyToInfos", "=", "(", "Map", ")", "this", ".", "perWorkingCopyInfos", ".", "get", "(", "owner", ")", ";", "if", "(", "workingCopyToInfos", "==", "null", ")", "return", "primaryWCs", ";", "int", "primaryLength", "=", "primaryWCs", "==", "null", "?", "0", ":", "primaryWCs", ".", "length", ";", "int", "size", "=", "workingCopyToInfos", ".", "size", "(", ")", ";", "ICompilationUnit", "[", "]", "result", "=", "new", "ICompilationUnit", "[", "primaryLength", "+", "size", "]", ";", "int", "index", "=", "0", ";", "if", "(", "primaryWCs", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "primaryLength", ";", "i", "++", ")", "{", "ICompilationUnit", "primaryWorkingCopy", "=", "primaryWCs", "[", "i", "]", ";", "ICompilationUnit", "workingCopy", "=", "LanguageSupportFactory", ".", "newCompilationUnit", "(", "(", "PackageFragment", ")", "primaryWorkingCopy", ".", "getParent", "(", ")", ",", "primaryWorkingCopy", ".", "getElementName", "(", ")", ",", "owner", ")", ";", "if", "(", "!", "workingCopyToInfos", ".", "containsKey", "(", "workingCopy", ")", ")", "result", "[", "index", "++", "]", "=", "primaryWorkingCopy", ";", "}", "if", "(", "index", "!=", "primaryLength", ")", "System", ".", "arraycopy", "(", "result", ",", "0", ",", "result", "=", "new", "ICompilationUnit", "[", "index", "+", "size", "]", ",", "0", ",", "index", ")", ";", "}", "Iterator", "iterator", "=", "workingCopyToInfos", ".", "values", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "result", "[", "index", "++", "]", "=", "(", "(", "JavaModelManager", ".", "PerWorkingCopyInfo", ")", "iterator", ".", "next", "(", ")", ")", ".", "getWorkingCopy", "(", ")", ";", "}", "return", "result", ";", "}", "}", "public", "JavaWorkspaceScope", "getWorkspaceScope", "(", ")", "{", "if", "(", "this", ".", "workspaceScope", "==", "null", ")", "{", "this", ".", "workspaceScope", "=", "new", "JavaWorkspaceScope", "(", ")", ";", "}", "return", "this", ".", "workspaceScope", ";", "}", "public", "ZipFile", "getZipFile", "(", "IPath", "path", ")", "throws", "CoreException", "{", "ZipCache", "zipCache", ";", "ZipFile", "zipFile", ";", "if", "(", "(", "zipCache", "=", "(", "ZipCache", ")", "this", ".", "zipFiles", ".", "get", "(", ")", ")", "!=", "null", "&&", "(", "zipFile", "=", "zipCache", ".", "getCache", "(", "path", ")", ")", "!=", "null", ")", "{", "return", "zipFile", ";", "}", "File", "localFile", "=", "null", ";", "IWorkspaceRoot", "root", "=", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ";", "IResource", "file", "=", "root", ".", "findMember", "(", "path", ")", ";", "if", "(", "file", "!=", "null", ")", "{", "URI", "location", ";", "if", "(", "file", ".", "getType", "(", ")", "!=", "IResource", ".", "FILE", "||", "(", "location", "=", "file", ".", "getLocationURI", "(", ")", ")", "==", "null", ")", "{", "throw", "new", "CoreException", "(", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "JavaCore", ".", "PLUGIN_ID", ",", "-", "1", ",", "Messages", ".", "bind", "(", "Messages", ".", "file_notFound", ",", "path", ".", "toString", "(", ")", ")", ",", "null", ")", ")", ";", "}", "localFile", "=", "Util", ".", "toLocalFile", "(", "location", ",", "null", ")", ";", "if", "(", "localFile", "==", "null", ")", "throw", "new", "CoreException", "(", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "JavaCore", ".", "PLUGIN_ID", ",", "-", "1", ",", "Messages", ".", "bind", "(", "Messages", ".", "file_notFound", ",", "path", ".", "toString", "(", ")", ")", ",", "null", ")", ")", ";", "}", "else", "{", "localFile", "=", "path", ".", "toFile", "(", ")", ";", "}", "try", "{", "if", "(", "ZIP_ACCESS_VERBOSE", ")", "{", "System", ".", "out", ".", "println", "(", "\"(\"", "+", "Thread", ".", "currentThread", "(", ")", "+", "\"\"", "+", "localFile", ")", ";", "}", "zipFile", "=", "new", "ZipFile", "(", "localFile", ")", ";", "if", "(", "zipCache", "!=", "null", ")", "{", "zipCache", ".", "setCache", "(", "path", ",", "zipFile", ")", ";", "}", "return", "zipFile", ";", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "CoreException", "(", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "JavaCore", ".", "PLUGIN_ID", ",", "-", "1", ",", "Messages", ".", "status_IOException", ",", "e", ")", ")", ";", "}", "}", "public", "boolean", "hasTemporaryCache", "(", ")", "{", "return", "this", ".", "temporaryCache", ".", "get", "(", ")", "!=", "null", ";", "}", "private", "IClasspathContainer", "initializeAllContainers", "(", "IJavaProject", "javaProjectToInit", ",", "IPath", "containerToInit", ")", "throws", "JavaModelException", "{", "if", "(", "CP_RESOLVE_VERBOSE_ADVANCED", ")", "verbose_batching_containers_initialization", "(", "javaProjectToInit", ",", "containerToInit", ")", ";", "final", "HashMap", "allContainerPaths", "=", "new", "HashMap", "(", ")", ";", "IProject", "[", "]", "projects", "=", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ".", "getProjects", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "projects", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IProject", "project", "=", "projects", "[", "i", "]", ";", "if", "(", "!", "JavaProject", ".", "hasJavaNature", "(", "project", ")", ")", "continue", ";", "IJavaProject", "javaProject", "=", "new", "JavaProject", "(", "project", ",", "getJavaModel", "(", ")", ")", ";", "HashSet", "paths", "=", "(", "HashSet", ")", "allContainerPaths", ".", "get", "(", "javaProject", ")", ";", "IClasspathEntry", "[", "]", "rawClasspath", "=", "javaProject", ".", "getRawClasspath", "(", ")", ";", "for", "(", "int", "j", "=", "0", ",", "length2", "=", "rawClasspath", ".", "length", ";", "j", "<", "length2", ";", "j", "++", ")", "{", "IClasspathEntry", "entry", "=", "rawClasspath", "[", "j", "]", ";", "IPath", "path", "=", "entry", ".", "getPath", "(", ")", ";", "if", "(", "entry", ".", "getEntryKind", "(", ")", "==", "IClasspathEntry", ".", "CPE_CONTAINER", "&&", "containerGet", "(", "javaProject", ",", "path", ")", "==", "null", ")", "{", "if", "(", "paths", "==", "null", ")", "{", "paths", "=", "new", "HashSet", "(", ")", ";", "allContainerPaths", ".", "put", "(", "javaProject", ",", "paths", ")", ";", "}", "paths", ".", "add", "(", "path", ")", ";", "}", "}", "}", "if", "(", "javaProjectToInit", "!=", "null", ")", "{", "HashSet", "containerPaths", "=", "(", "HashSet", ")", "allContainerPaths", ".", "get", "(", "javaProjectToInit", ")", ";", "if", "(", "containerPaths", "==", "null", ")", "{", "containerPaths", "=", "new", "HashSet", "(", ")", ";", "allContainerPaths", ".", "put", "(", "javaProjectToInit", ",", "containerPaths", ")", ";", "}", "containerPaths", ".", "add", "(", "containerToInit", ")", ";", "}", "boolean", "ok", "=", "false", ";", "try", "{", "IWorkspaceRunnable", "runnable", "=", "new", "IWorkspaceRunnable", "(", ")", "{", "public", "void", "run", "(", "IProgressMonitor", "monitor", ")", "throws", "CoreException", "{", "try", "{", "Set", "entrySet", "=", "allContainerPaths", ".", "entrySet", "(", ")", ";", "int", "length", "=", "entrySet", ".", "size", "(", ")", ";", "if", "(", "monitor", "!=", "null", ")", "monitor", ".", "beginTask", "(", "\"\"", ",", "length", ")", ";", "Map", ".", "Entry", "[", "]", "entries", "=", "new", "Map", ".", "Entry", "[", "length", "]", ";", "entrySet", ".", "toArray", "(", "entries", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "Map", ".", "Entry", "entry", "=", "entries", "[", "i", "]", ";", "IJavaProject", "javaProject", "=", "(", "IJavaProject", ")", "entry", ".", "getKey", "(", ")", ";", "HashSet", "pathSet", "=", "(", "HashSet", ")", "entry", ".", "getValue", "(", ")", ";", "if", "(", "pathSet", "==", "null", ")", "continue", ";", "int", "length2", "=", "pathSet", ".", "size", "(", ")", ";", "IPath", "[", "]", "paths", "=", "new", "IPath", "[", "length2", "]", ";", "pathSet", ".", "toArray", "(", "paths", ")", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "length2", ";", "j", "++", ")", "{", "IPath", "path", "=", "paths", "[", "j", "]", ";", "initializeContainer", "(", "javaProject", ",", "path", ")", ";", "IClasspathContainer", "container", "=", "containerBeingInitializedGet", "(", "javaProject", ",", "path", ")", ";", "if", "(", "container", "!=", "null", ")", "{", "containerPut", "(", "javaProject", ",", "path", ",", "container", ")", ";", "}", "}", "if", "(", "monitor", "!=", "null", ")", "monitor", ".", "worked", "(", "1", ")", ";", "}", "Map", "perProjectContainers", "=", "(", "Map", ")", "JavaModelManager", ".", "this", ".", "containersBeingInitialized", ".", "get", "(", ")", ";", "if", "(", "perProjectContainers", "!=", "null", ")", "{", "Iterator", "entriesIterator", "=", "perProjectContainers", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "entriesIterator", ".", "hasNext", "(", ")", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "entriesIterator", ".", "next", "(", ")", ";", "IJavaProject", "project", "=", "(", "IJavaProject", ")", "entry", ".", "getKey", "(", ")", ";", "HashMap", "perPathContainers", "=", "(", "HashMap", ")", "entry", ".", "getValue", "(", ")", ";", "Iterator", "containersIterator", "=", "perPathContainers", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "containersIterator", ".", "hasNext", "(", ")", ")", "{", "Map", ".", "Entry", "containerEntry", "=", "(", "Map", ".", "Entry", ")", "containersIterator", ".", "next", "(", ")", ";", "IPath", "containerPath", "=", "(", "IPath", ")", "containerEntry", ".", "getKey", "(", ")", ";", "IClasspathContainer", "container", "=", "(", "IClasspathContainer", ")", "containerEntry", ".", "getValue", "(", ")", ";", "SetContainerOperation", "operation", "=", "new", "SetContainerOperation", "(", "containerPath", ",", "new", "IJavaProject", "[", "]", "{", "project", "}", ",", "new", "IClasspathContainer", "[", "]", "{", "container", "}", ")", ";", "operation", ".", "runOperation", "(", "monitor", ")", ";", "}", "}", "JavaModelManager", ".", "this", ".", "containersBeingInitialized", ".", "set", "(", "null", ")", ";", "}", "}", "finally", "{", "if", "(", "monitor", "!=", "null", ")", "monitor", ".", "done", "(", ")", ";", "}", "}", "}", ";", "IProgressMonitor", "monitor", "=", "this", ".", "batchContainerInitializationsProgress", ";", "IWorkspace", "workspace", "=", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ";", "if", "(", "workspace", ".", "isTreeLocked", "(", ")", ")", "runnable", ".", "run", "(", "monitor", ")", ";", "else", "workspace", ".", "run", "(", "runnable", ",", "null", ",", "IWorkspace", ".", "AVOID_UPDATE", ",", "monitor", ")", ";", "ok", "=", "true", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "Util", ".", "log", "(", "e", ",", "\"\"", ")", ";", "}", "finally", "{", "if", "(", "!", "ok", ")", "{", "this", ".", "containerInitializationInProgress", ".", "set", "(", "null", ")", ";", "}", "}", "return", "containerGet", "(", "javaProjectToInit", ",", "containerToInit", ")", ";", "}", "private", "void", "verbose_batching_containers_initialization", "(", "IJavaProject", "javaProjectToInit", ",", "IPath", "containerToInit", ")", "{", "Util", ".", "verbose", "(", "\"\"", "+", "\"\"", "+", "(", "javaProjectToInit", "==", "null", "?", "\"null\"", ":", "javaProjectToInit", ".", "getElementName", "(", ")", ")", "+", "'\\n'", "+", "\"\"", "+", "containerToInit", ")", ";", "}", "IClasspathContainer", "initializeContainer", "(", "IJavaProject", "project", ",", "IPath", "containerPath", ")", "throws", "JavaModelException", "{", "IProgressMonitor", "monitor", "=", "this", ".", "batchContainerInitializationsProgress", ";", "if", "(", "monitor", "!=", "null", "&&", "monitor", ".", "isCanceled", "(", ")", ")", "throw", "new", "OperationCanceledException", "(", ")", ";", "IClasspathContainer", "container", "=", "null", ";", "final", "ClasspathContainerInitializer", "initializer", "=", "JavaCore", ".", "getClasspathContainerInitializer", "(", "containerPath", ".", "segment", "(", "0", ")", ")", ";", "if", "(", "initializer", "!=", "null", ")", "{", "if", "(", "CP_RESOLVE_VERBOSE", ")", "verbose_triggering_container_initialization", "(", "project", ",", "containerPath", ",", "initializer", ")", ";", "if", "(", "CP_RESOLVE_VERBOSE_ADVANCED", ")", "verbose_triggering_container_initialization_invocation_trace", "(", ")", ";", "PerformanceStats", "stats", "=", "null", ";", "if", "(", "JavaModelManager", ".", "PERF_CONTAINER_INITIALIZER", ")", "{", "stats", "=", "PerformanceStats", ".", "getStats", "(", "JavaModelManager", ".", "CONTAINER_INITIALIZER_PERF", ",", "this", ")", ";", "stats", ".", "startRun", "(", "containerPath", "+", "\"", "of", "\"", "+", "project", ".", "getPath", "(", ")", ")", ";", "}", "containerPut", "(", "project", ",", "containerPath", ",", "CONTAINER_INITIALIZATION_IN_PROGRESS", ")", ";", "boolean", "ok", "=", "false", ";", "try", "{", "if", "(", "monitor", "!=", "null", ")", "monitor", ".", "subTask", "(", "Messages", ".", "bind", "(", "Messages", ".", "javamodel_configuring", ",", "initializer", ".", "getDescription", "(", "containerPath", ",", "project", ")", ")", ")", ";", "initializer", ".", "initialize", "(", "containerPath", ",", "project", ")", ";", "if", "(", "monitor", "!=", "null", ")", "monitor", ".", "subTask", "(", "\"\"", ")", ";", "container", "=", "containerBeingInitializedGet", "(", "project", ",", "containerPath", ")", ";", "if", "(", "container", "==", "null", "&&", "containerGet", "(", "project", ",", "containerPath", ")", "==", "CONTAINER_INITIALIZATION_IN_PROGRESS", ")", "{", "container", "=", "initializer", ".", "getFailureContainer", "(", "containerPath", ",", "project", ")", ";", "if", "(", "container", "==", "null", ")", "{", "if", "(", "CP_RESOLVE_VERBOSE", "||", "CP_RESOLVE_VERBOSE_FAILURE", ")", "verbose_container_null_failure_container", "(", "project", ",", "containerPath", ",", "initializer", ")", ";", "return", "null", ";", "}", "if", "(", "CP_RESOLVE_VERBOSE", "||", "CP_RESOLVE_VERBOSE_FAILURE", ")", "verbose_container_using_failure_container", "(", "project", ",", "containerPath", ",", "initializer", ")", ";", "containerPut", "(", "project", ",", "containerPath", ",", "container", ")", ";", "}", "ok", "=", "true", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "if", "(", "e", "instanceof", "JavaModelException", ")", "{", "throw", "(", "JavaModelException", ")", "e", ";", "}", "else", "{", "throw", "new", "JavaModelException", "(", "e", ")", ";", "}", "}", "catch", "(", "RuntimeException", "e", ")", "{", "if", "(", "JavaModelManager", ".", "CP_RESOLVE_VERBOSE", "||", "CP_RESOLVE_VERBOSE_FAILURE", ")", "e", ".", "printStackTrace", "(", ")", ";", "throw", "e", ";", "}", "catch", "(", "Error", "e", ")", "{", "if", "(", "JavaModelManager", ".", "CP_RESOLVE_VERBOSE", "||", "CP_RESOLVE_VERBOSE_FAILURE", ")", "e", ".", "printStackTrace", "(", ")", ";", "throw", "e", ";", "}", "finally", "{", "if", "(", "JavaModelManager", ".", "PERF_CONTAINER_INITIALIZER", ")", "{", "stats", ".", "endRun", "(", ")", ";", "}", "if", "(", "!", "ok", ")", "{", "containerRemoveInitializationInProgress", "(", "project", ",", "containerPath", ")", ";", "if", "(", "CP_RESOLVE_VERBOSE", "||", "CP_RESOLVE_VERBOSE_FAILURE", ")", "verbose_container_initialization_failed", "(", "project", ",", "containerPath", ",", "container", ",", "initializer", ")", ";", "}", "}", "if", "(", "CP_RESOLVE_VERBOSE_ADVANCED", ")", "verbose_container_value_after_initialization", "(", "project", ",", "containerPath", ",", "container", ")", ";", "}", "else", "{", "container", "=", "(", "new", "ClasspathContainerInitializer", "(", ")", "{", "public", "void", "initialize", "(", "IPath", "path", ",", "IJavaProject", "javaProject", ")", "throws", "CoreException", "{", "}", "}", ")", ".", "getFailureContainer", "(", "containerPath", ",", "project", ")", ";", "if", "(", "CP_RESOLVE_VERBOSE_ADVANCED", "||", "CP_RESOLVE_VERBOSE_FAILURE", ")", "verbose_no_container_initializer_found", "(", "project", ",", "containerPath", ")", ";", "}", "return", "container", ";", "}", "private", "void", "verbose_no_container_initializer_found", "(", "IJavaProject", "project", ",", "IPath", "containerPath", ")", "{", "Util", ".", "verbose", "(", "\"\"", "+", "\"tproject:", "\"", "+", "project", ".", "getElementName", "(", ")", "+", "'\\n'", "+", "\"\"", "+", "containerPath", ")", ";", "}", "private", "void", "verbose_container_value_after_initialization", "(", "IJavaProject", "project", ",", "IPath", "containerPath", ",", "IClasspathContainer", "container", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "buffer", ".", "append", "(", "\"\"", ")", ";", "buffer", ".", "append", "(", "\"tproject:", "\"", "+", "project", ".", "getElementName", "(", ")", "+", "'\\n'", ")", ";", "buffer", ".", "append", "(", "\"\"", "+", "containerPath", "+", "'\\n'", ")", ";", "if", "(", "container", "!=", "null", ")", "{", "buffer", ".", "append", "(", "\"tcontainer:", "\"", "+", "container", ".", "getDescription", "(", ")", "+", "\"", "{n\"", ")", ";", "IClasspathEntry", "[", "]", "entries", "=", "container", ".", "getClasspathEntries", "(", ")", ";", "if", "(", "entries", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "entries", ".", "length", ";", "i", "++", ")", "{", "buffer", ".", "append", "(", "\"tt\"", "+", "entries", "[", "i", "]", "+", "'\\n'", ")", ";", "}", "}", "buffer", ".", "append", "(", "\"t}\"", ")", ";", "}", "else", "{", "buffer", ".", "append", "(", "\"\"", ")", ";", "}", "Util", ".", "verbose", "(", "buffer", ".", "toString", "(", ")", ")", ";", "}", "private", "void", "verbose_container_initialization_failed", "(", "IJavaProject", "project", ",", "IPath", "containerPath", ",", "IClasspathContainer", "container", ",", "ClasspathContainerInitializer", "initializer", ")", "{", "if", "(", "container", "==", "CONTAINER_INITIALIZATION_IN_PROGRESS", ")", "{", "Util", ".", "verbose", "(", "\"\"", "+", "\"tproject:", "\"", "+", "project", ".", "getElementName", "(", ")", "+", "'\\n'", "+", "\"\"", "+", "containerPath", "+", "'\\n'", "+", "\"\"", "+", "initializer", ")", ";", "}", "else", "{", "Util", ".", "verbose", "(", "\"\"", "+", "\"tproject:", "\"", "+", "project", ".", "getElementName", "(", ")", "+", "'\\n'", "+", "\"\"", "+", "containerPath", "+", "'\\n'", "+", "\"\"", "+", "initializer", ")", ";", "}", "}", "private", "void", "verbose_container_null_failure_container", "(", "IJavaProject", "project", ",", "IPath", "containerPath", ",", "ClasspathContainerInitializer", "initializer", ")", "{", "Util", ".", "verbose", "(", "\"\"", "+", "\"tproject:", "\"", "+", "project", ".", "getElementName", "(", ")", "+", "'\\n'", "+", "\"\"", "+", "containerPath", "+", "'\\n'", "+", "\"\"", "+", "initializer", ")", ";", "}", "private", "void", "verbose_container_using_failure_container", "(", "IJavaProject", "project", ",", "IPath", "containerPath", ",", "ClasspathContainerInitializer", "initializer", ")", "{", "Util", ".", "verbose", "(", "\"\"", "+", "\"tproject:", "\"", "+", "project", ".", "getElementName", "(", ")", "+", "'\\n'", "+", "\"\"", "+", "containerPath", "+", "'\\n'", "+", "\"\"", "+", "initializer", ")", ";", "}", "private", "void", "verbose_triggering_container_initialization", "(", "IJavaProject", "project", ",", "IPath", "containerPath", ",", "ClasspathContainerInitializer", "initializer", ")", "{", "Util", ".", "verbose", "(", "\"\"", "+", "\"tproject:", "\"", "+", "project", ".", "getElementName", "(", ")", "+", "'\\n'", "+", "\"\"", "+", "containerPath", "+", "'\\n'", "+", "\"\"", "+", "initializer", ")", ";", "}", "private", "void", "verbose_triggering_container_initialization_invocation_trace", "(", ")", "{", "Util", ".", "verbose", "(", "\"\"", "+", "\"\"", ")", ";", "new", "Exception", "(", "\"\"", ")", ".", "printStackTrace", "(", "System", ".", "out", ")", ";", "}", "public", "void", "initializePreferences", "(", ")", "{", "this", ".", "preferencesLookup", "[", "PREF_INSTANCE", "]", "=", "(", "(", "IScopeContext", ")", "new", "InstanceScope", "(", ")", ")", ".", "getNode", "(", "JavaCore", ".", "PLUGIN_ID", ")", ";", "this", ".", "preferencesLookup", "[", "PREF_DEFAULT", "]", "=", "(", "(", "IScopeContext", ")", "new", "DefaultScope", "(", ")", ")", ".", "getNode", "(", "JavaCore", ".", "PLUGIN_ID", ")", ";", "this", ".", "instanceNodeListener", "=", "new", "IEclipsePreferences", ".", "INodeChangeListener", "(", ")", "{", "public", "void", "added", "(", "IEclipsePreferences", ".", "NodeChangeEvent", "event", ")", "{", "}", "public", "void", "removed", "(", "IEclipsePreferences", ".", "NodeChangeEvent", "event", ")", "{", "if", "(", "event", ".", "getChild", "(", ")", "==", "JavaModelManager", ".", "this", ".", "preferencesLookup", "[", "PREF_INSTANCE", "]", ")", "{", "JavaModelManager", ".", "this", ".", "preferencesLookup", "[", "PREF_INSTANCE", "]", "=", "(", "(", "IScopeContext", ")", "new", "InstanceScope", "(", ")", ")", ".", "getNode", "(", "JavaCore", ".", "PLUGIN_ID", ")", ";", "JavaModelManager", ".", "this", ".", "preferencesLookup", "[", "PREF_INSTANCE", "]", ".", "addPreferenceChangeListener", "(", "new", "EclipsePreferencesListener", "(", ")", ")", ";", "}", "}", "}", ";", "(", "(", "IEclipsePreferences", ")", "this", ".", "preferencesLookup", "[", "PREF_INSTANCE", "]", ".", "parent", "(", ")", ")", ".", "addNodeChangeListener", "(", "this", ".", "instanceNodeListener", ")", ";", "this", ".", "preferencesLookup", "[", "PREF_INSTANCE", "]", ".", "addPreferenceChangeListener", "(", "this", ".", "instancePreferencesListener", "=", "new", "EclipsePreferencesListener", "(", ")", ")", ";", "this", ".", "defaultNodeListener", "=", "new", "IEclipsePreferences", ".", "INodeChangeListener", "(", ")", "{", "public", "void", "added", "(", "IEclipsePreferences", ".", "NodeChangeEvent", "event", ")", "{", "}", "public", "void", "removed", "(", "IEclipsePreferences", ".", "NodeChangeEvent", "event", ")", "{", "if", "(", "event", ".", "getChild", "(", ")", "==", "JavaModelManager", ".", "this", ".", "preferencesLookup", "[", "PREF_DEFAULT", "]", ")", "{", "JavaModelManager", ".", "this", ".", "preferencesLookup", "[", "PREF_DEFAULT", "]", "=", "(", "(", "IScopeContext", ")", "new", "DefaultScope", "(", ")", ")", ".", "getNode", "(", "JavaCore", ".", "PLUGIN_ID", ")", ";", "}", "}", "}", ";", "(", "(", "IEclipsePreferences", ")", "this", ".", "preferencesLookup", "[", "PREF_DEFAULT", "]", ".", "parent", "(", ")", ")", ".", "addNodeChangeListener", "(", "this", ".", "defaultNodeListener", ")", ";", "}", "public", "synchronized", "char", "[", "]", "intern", "(", "char", "[", "]", "array", ")", "{", "return", "this", ".", "charArraySymbols", ".", "add", "(", "array", ")", ";", "}", "public", "synchronized", "String", "intern", "(", "String", "s", ")", "{", "return", "(", "String", ")", "this", ".", "stringSymbols", ".", "add", "(", "new", "String", "(", "s", ")", ")", ";", "}", "private", "HashSet", "getClasspathBeingResolved", "(", ")", "{", "HashSet", "result", "=", "(", "HashSet", ")", "this", ".", "classpathsBeingResolved", ".", "get", "(", ")", ";", "if", "(", "result", "==", "null", ")", "{", "result", "=", "new", "HashSet", "(", ")", ";", "this", ".", "classpathsBeingResolved", ".", "set", "(", "result", ")", ";", "}", "return", "result", ";", "}", "public", "boolean", "isClasspathBeingResolved", "(", "IJavaProject", "project", ")", "{", "return", "getClasspathBeingResolved", "(", ")", ".", "contains", "(", "project", ")", ";", "}", "private", "boolean", "isDeprecatedOption", "(", "String", "optionName", ")", "{", "return", "JavaCore", ".", "COMPILER_PB_INVALID_IMPORT", ".", "equals", "(", "optionName", ")", "||", "JavaCore", ".", "COMPILER_PB_UNREACHABLE_CODE", ".", "equals", "(", "optionName", ")", ";", "}", "public", "boolean", "isNonChainingJar", "(", "IPath", "path", ")", "{", "return", "this", ".", "nonChainingJars", "!=", "null", "&&", "this", ".", "nonChainingJars", ".", "contains", "(", "path", ")", ";", "}", "public", "void", "setClasspathBeingResolved", "(", "IJavaProject", "project", ",", "boolean", "classpathIsResolved", ")", "{", "if", "(", "classpathIsResolved", ")", "{", "getClasspathBeingResolved", "(", ")", ".", "add", "(", "project", ")", ";", "}", "else", "{", "getClasspathBeingResolved", "(", ")", ".", "remove", "(", "project", ")", ";", "}", "}", "private", "Set", "loadNonChainingJarsCache", "(", ")", "{", "Set", "nonChainingJarsCache", "=", "new", "HashSet", "(", ")", ";", "File", "nonChainingJarsFile", "=", "getNonChainingJarsFile", "(", ")", ";", "DataInputStream", "in", "=", "null", ";", "try", "{", "in", "=", "new", "DataInputStream", "(", "new", "BufferedInputStream", "(", "new", "FileInputStream", "(", "nonChainingJarsFile", ")", ")", ")", ";", "int", "size", "=", "in", ".", "readInt", "(", ")", ";", "while", "(", "size", "--", ">", "0", ")", "{", "String", "path", "=", "in", ".", "readUTF", "(", ")", ";", "nonChainingJarsCache", ".", "add", "(", "Path", ".", "fromPortableString", "(", "path", ")", ")", ";", "}", "}", "catch", "(", "IOException", "e", ")", "{", "if", "(", "nonChainingJarsFile", ".", "exists", "(", ")", ")", "Util", ".", "log", "(", "e", ",", "\"\"", ")", ";", "}", "finally", "{", "if", "(", "in", "!=", "null", ")", "{", "try", "{", "in", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "}", "}", "}", "return", "Collections", ".", "synchronizedSet", "(", "nonChainingJarsCache", ")", ";", "}", "private", "File", "getNonChainingJarsFile", "(", ")", "{", "return", "JavaCore", ".", "getPlugin", "(", ")", ".", "getStateLocation", "(", ")", ".", "append", "(", "\"\"", ")", ".", "toFile", "(", ")", ";", "}", "private", "Set", "getNonChainingJarsCache", "(", ")", "throws", "CoreException", "{", "if", "(", "this", ".", "nonChainingJars", "!=", "null", "&&", "this", ".", "nonChainingJars", ".", "size", "(", ")", ">", "0", ")", "{", "return", "this", ".", "nonChainingJars", ";", "}", "Set", "result", "=", "new", "HashSet", "(", ")", ";", "IJavaProject", "[", "]", "projects", "=", "getJavaModel", "(", ")", ".", "getJavaProjects", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "projects", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IJavaProject", "javaProject", "=", "projects", "[", "i", "]", ";", "IClasspathEntry", "[", "]", "classpath", "=", "(", "(", "JavaProject", ")", "javaProject", ")", ".", "getResolvedClasspath", "(", ")", ";", "for", "(", "int", "j", "=", "0", ",", "length2", "=", "classpath", ".", "length", ";", "j", "<", "length2", ";", "j", "++", ")", "{", "IClasspathEntry", "entry", "=", "classpath", "[", "j", "]", ";", "IPath", "path", ";", "if", "(", "entry", ".", "getEntryKind", "(", ")", "==", "IClasspathEntry", ".", "CPE_LIBRARY", "&&", "!", "result", ".", "contains", "(", "path", "=", "entry", ".", "getPath", "(", ")", ")", "&&", "ClasspathEntry", ".", "resolvedChainedLibraries", "(", "path", ")", ".", "length", "==", "0", ")", "{", "result", ".", "add", "(", "path", ")", ";", "}", "}", "}", "this", ".", "nonChainingJars", "=", "Collections", ".", "synchronizedSet", "(", "result", ")", ";", "return", "this", ".", "nonChainingJars", ";", "}", "public", "void", "loadVariablesAndContainers", "(", ")", "throws", "CoreException", "{", "QualifiedName", "qName", "=", "new", "QualifiedName", "(", "JavaCore", ".", "PLUGIN_ID", ",", "\"variables\"", ")", ";", "String", "xmlString", "=", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ".", "getPersistentProperty", "(", "qName", ")", ";", "try", "{", "if", "(", "xmlString", "!=", "null", ")", "{", "StringReader", "reader", "=", "new", "StringReader", "(", "xmlString", ")", ";", "Element", "cpElement", ";", "try", "{", "DocumentBuilder", "parser", "=", "DocumentBuilderFactory", ".", "newInstance", "(", ")", ".", "newDocumentBuilder", "(", ")", ";", "cpElement", "=", "parser", ".", "parse", "(", "new", "InputSource", "(", "reader", ")", ")", ".", "getDocumentElement", "(", ")", ";", "}", "catch", "(", "SAXException", "e", ")", "{", "return", ";", "}", "catch", "(", "ParserConfigurationException", "e", ")", "{", "return", ";", "}", "finally", "{", "reader", ".", "close", "(", ")", ";", "}", "if", "(", "cpElement", "==", "null", ")", "return", ";", "if", "(", "!", "cpElement", ".", "getNodeName", "(", ")", ".", "equalsIgnoreCase", "(", "\"variables\"", ")", ")", "{", "return", ";", "}", "NodeList", "list", "=", "cpElement", ".", "getChildNodes", "(", ")", ";", "int", "length", "=", "list", ".", "getLength", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "++", "i", ")", "{", "Node", "node", "=", "list", ".", "item", "(", "i", ")", ";", "short", "type", "=", "node", ".", "getNodeType", "(", ")", ";", "if", "(", "type", "==", "Node", ".", "ELEMENT_NODE", ")", "{", "Element", "element", "=", "(", "Element", ")", "node", ";", "if", "(", "element", ".", "getNodeName", "(", ")", ".", "equalsIgnoreCase", "(", "\"variable\"", ")", ")", "{", "variablePut", "(", "element", ".", "getAttribute", "(", "\"name\"", ")", ",", "new", "Path", "(", "element", ".", "getAttribute", "(", "\"path\"", ")", ")", ")", ";", "}", "}", "}", "}", "}", "catch", "(", "IOException", "e", ")", "{", "}", "finally", "{", "if", "(", "xmlString", "!=", "null", ")", "{", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ".", "setPersistentProperty", "(", "qName", ",", "null", ")", ";", "}", "}", "loadVariablesAndContainers", "(", "getDefaultPreferences", "(", ")", ")", ";", "loadVariablesAndContainers", "(", "getInstancePreferences", "(", ")", ")", ";", "File", "file", "=", "getVariableAndContainersFile", "(", ")", ";", "DataInputStream", "in", "=", "null", ";", "try", "{", "in", "=", "new", "DataInputStream", "(", "new", "BufferedInputStream", "(", "new", "FileInputStream", "(", "file", ")", ")", ")", ";", "switch", "(", "in", ".", "readInt", "(", ")", ")", "{", "case", "2", ":", "new", "VariablesAndContainersLoadHelper", "(", "in", ")", ".", "load", "(", ")", ";", "break", ";", "case", "1", ":", "int", "size", "=", "in", ".", "readInt", "(", ")", ";", "while", "(", "size", "--", ">", "0", ")", "{", "String", "varName", "=", "in", ".", "readUTF", "(", ")", ";", "String", "pathString", "=", "in", ".", "readUTF", "(", ")", ";", "if", "(", "CP_ENTRY_IGNORE", ".", "equals", "(", "pathString", ")", ")", "continue", ";", "IPath", "varPath", "=", "Path", ".", "fromPortableString", "(", "pathString", ")", ";", "this", ".", "variables", ".", "put", "(", "varName", ",", "varPath", ")", ";", "this", ".", "previousSessionVariables", ".", "put", "(", "varName", ",", "varPath", ")", ";", "}", "IJavaModel", "model", "=", "getJavaModel", "(", ")", ";", "int", "projectSize", "=", "in", ".", "readInt", "(", ")", ";", "while", "(", "projectSize", "--", ">", "0", ")", "{", "String", "projectName", "=", "in", ".", "readUTF", "(", ")", ";", "IJavaProject", "project", "=", "model", ".", "getJavaProject", "(", "projectName", ")", ";", "int", "containerSize", "=", "in", ".", "readInt", "(", ")", ";", "while", "(", "containerSize", "--", ">", "0", ")", "{", "IPath", "containerPath", "=", "Path", ".", "fromPortableString", "(", "in", ".", "readUTF", "(", ")", ")", ";", "int", "length", "=", "in", ".", "readInt", "(", ")", ";", "byte", "[", "]", "containerString", "=", "new", "byte", "[", "length", "]", ";", "in", ".", "readFully", "(", "containerString", ")", ";", "recreatePersistedContainer", "(", "project", ",", "containerPath", ",", "new", "String", "(", "containerString", ")", ",", "true", ")", ";", "}", "}", "break", ";", "}", "}", "catch", "(", "IOException", "e", ")", "{", "if", "(", "file", ".", "exists", "(", ")", ")", "Util", ".", "log", "(", "e", ",", "\"\"", ")", ";", "}", "catch", "(", "RuntimeException", "e", ")", "{", "if", "(", "file", ".", "exists", "(", ")", ")", "Util", ".", "log", "(", "e", ",", "\"\"", ")", ";", "}", "finally", "{", "if", "(", "in", "!=", "null", ")", "{", "try", "{", "in", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "}", "}", "}", "String", "[", "]", "registeredVariables", "=", "getRegisteredVariableNames", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "registeredVariables", ".", "length", ";", "i", "++", ")", "{", "String", "varName", "=", "registeredVariables", "[", "i", "]", ";", "this", ".", "variables", ".", "put", "(", "varName", ",", "null", ")", ";", "}", "containersReset", "(", "getRegisteredContainerIDs", "(", ")", ")", ";", "}", "private", "void", "loadVariablesAndContainers", "(", "IEclipsePreferences", "preferences", ")", "{", "try", "{", "String", "[", "]", "propertyNames", "=", "preferences", ".", "keys", "(", ")", ";", "int", "variablePrefixLength", "=", "CP_VARIABLE_PREFERENCES_PREFIX", ".", "length", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "propertyNames", ".", "length", ";", "i", "++", ")", "{", "String", "propertyName", "=", "propertyNames", "[", "i", "]", ";", "if", "(", "propertyName", ".", "startsWith", "(", "CP_VARIABLE_PREFERENCES_PREFIX", ")", ")", "{", "String", "varName", "=", "propertyName", ".", "substring", "(", "variablePrefixLength", ")", ";", "String", "propertyValue", "=", "preferences", ".", "get", "(", "propertyName", ",", "null", ")", ";", "if", "(", "propertyValue", "!=", "null", ")", "{", "String", "pathString", "=", "propertyValue", ".", "trim", "(", ")", ";", "if", "(", "CP_ENTRY_IGNORE", ".", "equals", "(", "pathString", ")", ")", "{", "preferences", ".", "remove", "(", "propertyName", ")", ";", "continue", ";", "}", "IPath", "varPath", "=", "new", "Path", "(", "pathString", ")", ";", "this", ".", "variables", ".", "put", "(", "varName", ",", "varPath", ")", ";", "this", ".", "previousSessionVariables", ".", "put", "(", "varName", ",", "varPath", ")", ";", "}", "}", "else", "if", "(", "propertyName", ".", "startsWith", "(", "CP_CONTAINER_PREFERENCES_PREFIX", ")", ")", "{", "String", "propertyValue", "=", "preferences", ".", "get", "(", "propertyName", ",", "null", ")", ";", "if", "(", "propertyValue", "!=", "null", ")", "{", "preferences", ".", "remove", "(", "propertyName", ")", ";", "recreatePersistedContainer", "(", "propertyName", ",", "propertyValue", ",", "true", ")", ";", "}", "}", "}", "}", "catch", "(", "BackingStoreException", "e1", ")", "{", "}", "}", "private", "static", "final", "class", "PersistedClasspathContainer", "implements", "IClasspathContainer", "{", "private", "final", "IPath", "containerPath", ";", "private", "final", "IClasspathEntry", "[", "]", "entries", ";", "private", "final", "IJavaProject", "project", ";", "PersistedClasspathContainer", "(", "IJavaProject", "project", ",", "IPath", "containerPath", ",", "IClasspathEntry", "[", "]", "entries", ")", "{", "super", "(", ")", ";", "this", ".", "containerPath", "=", "containerPath", ";", "this", ".", "entries", "=", "entries", ";", "this", ".", "project", "=", "project", ";", "}", "public", "IClasspathEntry", "[", "]", "getClasspathEntries", "(", ")", "{", "return", "this", ".", "entries", ";", "}", "public", "String", "getDescription", "(", ")", "{", "return", "\"\"", "+", "this", ".", "containerPath", "+", "\"\"", "+", "this", ".", "project", ".", "getElementName", "(", ")", "+", "\"]]\"", ";", "}", "public", "int", "getKind", "(", ")", "{", "return", "0", ";", "}", "public", "IPath", "getPath", "(", ")", "{", "return", "this", ".", "containerPath", ";", "}", "public", "String", "toString", "(", ")", "{", "return", "getDescription", "(", ")", ";", "}", "}", "private", "final", "class", "VariablesAndContainersLoadHelper", "{", "private", "static", "final", "int", "ARRAY_INCREMENT", "=", "200", ";", "private", "IClasspathEntry", "[", "]", "allClasspathEntries", ";", "private", "int", "allClasspathEntryCount", ";", "private", "final", "Map", "allPaths", ";", "private", "String", "[", "]", "allStrings", ";", "private", "int", "allStringsCount", ";", "private", "final", "DataInputStream", "in", ";", "VariablesAndContainersLoadHelper", "(", "DataInputStream", "in", ")", "{", "super", "(", ")", ";", "this", ".", "allClasspathEntries", "=", "null", ";", "this", ".", "allClasspathEntryCount", "=", "0", ";", "this", ".", "allPaths", "=", "new", "HashMap", "(", ")", ";", "this", ".", "allStrings", "=", "null", ";", "this", ".", "allStringsCount", "=", "0", ";", "this", ".", "in", "=", "in", ";", "}", "void", "load", "(", ")", "throws", "IOException", "{", "loadProjects", "(", "getJavaModel", "(", ")", ")", ";", "loadVariables", "(", ")", ";", "}", "private", "IAccessRule", "loadAccessRule", "(", ")", "throws", "IOException", "{", "int", "problemId", "=", "loadInt", "(", ")", ";", "IPath", "pattern", "=", "loadPath", "(", ")", ";", "return", "new", "ClasspathAccessRule", "(", "pattern", ".", "toString", "(", ")", ".", "toCharArray", "(", ")", ",", "problemId", ")", ";", "}", "private", "IAccessRule", "[", "]", "loadAccessRules", "(", ")", "throws", "IOException", "{", "int", "count", "=", "loadInt", "(", ")", ";", "if", "(", "count", "==", "0", ")", "return", "ClasspathEntry", ".", "NO_ACCESS_RULES", ";", "IAccessRule", "[", "]", "rules", "=", "new", "IAccessRule", "[", "count", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "count", ";", "++", "i", ")", "rules", "[", "i", "]", "=", "loadAccessRule", "(", ")", ";", "return", "rules", ";", "}", "private", "IClasspathAttribute", "loadAttribute", "(", ")", "throws", "IOException", "{", "String", "name", "=", "loadString", "(", ")", ";", "String", "value", "=", "loadString", "(", ")", ";", "return", "new", "ClasspathAttribute", "(", "name", ",", "value", ")", ";", "}", "private", "IClasspathAttribute", "[", "]", "loadAttributes", "(", ")", "throws", "IOException", "{", "int", "count", "=", "loadInt", "(", ")", ";", "if", "(", "count", "==", "0", ")", "return", "ClasspathEntry", ".", "NO_EXTRA_ATTRIBUTES", ";", "IClasspathAttribute", "[", "]", "attributes", "=", "new", "IClasspathAttribute", "[", "count", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "count", ";", "++", "i", ")", "attributes", "[", "i", "]", "=", "loadAttribute", "(", ")", ";", "return", "attributes", ";", "}", "private", "boolean", "loadBoolean", "(", ")", "throws", "IOException", "{", "return", "this", ".", "in", ".", "readBoolean", "(", ")", ";", "}", "private", "IClasspathEntry", "[", "]", "loadClasspathEntries", "(", ")", "throws", "IOException", "{", "int", "count", "=", "loadInt", "(", ")", ";", "IClasspathEntry", "[", "]", "entries", "=", "new", "IClasspathEntry", "[", "count", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "count", ";", "++", "i", ")", "entries", "[", "i", "]", "=", "loadClasspathEntry", "(", ")", ";", "return", "entries", ";", "}", "private", "IClasspathEntry", "loadClasspathEntry", "(", ")", "throws", "IOException", "{", "int", "id", "=", "loadInt", "(", ")", ";", "if", "(", "id", "<", "0", "||", "id", ">", "this", ".", "allClasspathEntryCount", ")", "throw", "new", "IOException", "(", "\"\"", ")", ";", "if", "(", "id", "<", "this", ".", "allClasspathEntryCount", ")", "return", "this", ".", "allClasspathEntries", "[", "id", "]", ";", "int", "contentKind", "=", "loadInt", "(", ")", ";", "int", "entryKind", "=", "loadInt", "(", ")", ";", "IPath", "path", "=", "loadPath", "(", ")", ";", "IPath", "[", "]", "inclusionPatterns", "=", "loadPaths", "(", ")", ";", "IPath", "[", "]", "exclusionPatterns", "=", "loadPaths", "(", ")", ";", "IPath", "sourceAttachmentPath", "=", "loadPath", "(", ")", ";", "IPath", "sourceAttachmentRootPath", "=", "loadPath", "(", ")", ";", "IPath", "specificOutputLocation", "=", "loadPath", "(", ")", ";", "boolean", "isExported", "=", "loadBoolean", "(", ")", ";", "IAccessRule", "[", "]", "accessRules", "=", "loadAccessRules", "(", ")", ";", "boolean", "combineAccessRules", "=", "loadBoolean", "(", ")", ";", "IClasspathAttribute", "[", "]", "extraAttributes", "=", "loadAttributes", "(", ")", ";", "IClasspathEntry", "entry", "=", "new", "ClasspathEntry", "(", "contentKind", ",", "entryKind", ",", "path", ",", "inclusionPatterns", ",", "exclusionPatterns", ",", "sourceAttachmentPath", ",", "sourceAttachmentRootPath", ",", "specificOutputLocation", ",", "isExported", ",", "accessRules", ",", "combineAccessRules", ",", "extraAttributes", ")", ";", "IClasspathEntry", "[", "]", "array", "=", "this", ".", "allClasspathEntries", ";", "if", "(", "array", "==", "null", "||", "id", "==", "array", ".", "length", ")", "{", "array", "=", "new", "IClasspathEntry", "[", "id", "+", "ARRAY_INCREMENT", "]", ";", "if", "(", "id", "!=", "0", ")", "System", ".", "arraycopy", "(", "this", ".", "allClasspathEntries", ",", "0", ",", "array", ",", "0", ",", "id", ")", ";", "this", ".", "allClasspathEntries", "=", "array", ";", "}", "array", "[", "id", "]", "=", "entry", ";", "this", ".", "allClasspathEntryCount", "=", "id", "+", "1", ";", "return", "entry", ";", "}", "private", "void", "loadContainers", "(", "IJavaProject", "project", ")", "throws", "IOException", "{", "boolean", "projectIsAccessible", "=", "project", ".", "getProject", "(", ")", ".", "isAccessible", "(", ")", ";", "int", "count", "=", "loadInt", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "count", ";", "++", "i", ")", "{", "IPath", "path", "=", "loadPath", "(", ")", ";", "IClasspathEntry", "[", "]", "entries", "=", "loadClasspathEntries", "(", ")", ";", "if", "(", "!", "projectIsAccessible", ")", "continue", ";", "IClasspathContainer", "container", "=", "new", "PersistedClasspathContainer", "(", "project", ",", "path", ",", "entries", ")", ";", "containerPut", "(", "project", ",", "path", ",", "container", ")", ";", "Map", "oldContainers", "=", "(", "Map", ")", "JavaModelManager", ".", "this", ".", "previousSessionContainers", ".", "get", "(", "project", ")", ";", "if", "(", "oldContainers", "==", "null", ")", "{", "oldContainers", "=", "new", "HashMap", "(", ")", ";", "JavaModelManager", ".", "this", ".", "previousSessionContainers", ".", "put", "(", "project", ",", "oldContainers", ")", ";", "}", "oldContainers", ".", "put", "(", "path", ",", "container", ")", ";", "}", "}", "private", "int", "loadInt", "(", ")", "throws", "IOException", "{", "return", "this", ".", "in", ".", "readInt", "(", ")", ";", "}", "private", "IPath", "loadPath", "(", ")", "throws", "IOException", "{", "if", "(", "loadBoolean", "(", ")", ")", "return", "null", ";", "String", "portableString", "=", "loadString", "(", ")", ";", "IPath", "path", "=", "(", "IPath", ")", "this", ".", "allPaths", ".", "get", "(", "portableString", ")", ";", "if", "(", "path", "==", "null", ")", "{", "path", "=", "Path", ".", "fromPortableString", "(", "portableString", ")", ";", "this", ".", "allPaths", ".", "put", "(", "portableString", ",", "path", ")", ";", "}", "return", "path", ";", "}", "private", "IPath", "[", "]", "loadPaths", "(", ")", "throws", "IOException", "{", "int", "count", "=", "loadInt", "(", ")", ";", "IPath", "[", "]", "pathArray", "=", "new", "IPath", "[", "count", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "count", ";", "++", "i", ")", "pathArray", "[", "i", "]", "=", "loadPath", "(", ")", ";", "return", "pathArray", ";", "}", "private", "void", "loadProjects", "(", "IJavaModel", "model", ")", "throws", "IOException", "{", "int", "count", "=", "loadInt", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "count", ";", "++", "i", ")", "{", "String", "projectName", "=", "loadString", "(", ")", ";", "loadContainers", "(", "model", ".", "getJavaProject", "(", "projectName", ")", ")", ";", "}", "}", "private", "String", "loadString", "(", ")", "throws", "IOException", "{", "int", "id", "=", "loadInt", "(", ")", ";", "if", "(", "id", "<", "0", "||", "id", ">", "this", ".", "allStringsCount", ")", "throw", "new", "IOException", "(", "\"\"", ")", ";", "if", "(", "id", "<", "this", ".", "allStringsCount", ")", "return", "this", ".", "allStrings", "[", "id", "]", ";", "String", "string", "=", "this", ".", "in", ".", "readUTF", "(", ")", ";", "String", "[", "]", "array", "=", "this", ".", "allStrings", ";", "if", "(", "array", "==", "null", "||", "id", "==", "array", ".", "length", ")", "{", "array", "=", "new", "String", "[", "id", "+", "ARRAY_INCREMENT", "]", ";", "if", "(", "id", "!=", "0", ")", "System", ".", "arraycopy", "(", "this", ".", "allStrings", ",", "0", ",", "array", ",", "0", ",", "id", ")", ";", "this", ".", "allStrings", "=", "array", ";", "}", "array", "[", "id", "]", "=", "string", ";", "this", ".", "allStringsCount", "=", "id", "+", "1", ";", "return", "string", ";", "}", "private", "void", "loadVariables", "(", ")", "throws", "IOException", "{", "int", "size", "=", "loadInt", "(", ")", ";", "Map", "loadedVars", "=", "new", "HashMap", "(", "size", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "++", "i", ")", "{", "String", "varName", "=", "loadString", "(", ")", ";", "IPath", "varPath", "=", "loadPath", "(", ")", ";", "if", "(", "varPath", "!=", "null", ")", "loadedVars", ".", "put", "(", "varName", ",", "varPath", ")", ";", "}", "JavaModelManager", ".", "this", ".", "previousSessionVariables", ".", "putAll", "(", "loadedVars", ")", ";", "JavaModelManager", ".", "this", ".", "variables", ".", "putAll", "(", "loadedVars", ")", ";", "}", "}", "protected", "synchronized", "Object", "peekAtInfo", "(", "IJavaElement", "element", ")", "{", "HashMap", "tempCache", "=", "(", "HashMap", ")", "this", ".", "temporaryCache", ".", "get", "(", ")", ";", "if", "(", "tempCache", "!=", "null", ")", "{", "Object", "result", "=", "tempCache", ".", "get", "(", "element", ")", ";", "if", "(", "result", "!=", "null", ")", "{", "return", "result", ";", "}", "}", "return", "this", ".", "cache", ".", "peekAtInfo", "(", "element", ")", ";", "}", "public", "void", "prepareToSave", "(", "ISaveContext", "context", ")", "{", "}", "protected", "synchronized", "void", "putInfos", "(", "IJavaElement", "openedElement", ",", "Map", "newElements", ")", "{", "Object", "existingInfo", "=", "this", ".", "cache", ".", "peekAtInfo", "(", "openedElement", ")", ";", "if", "(", "openedElement", "instanceof", "IParent", ")", "{", "closeChildren", "(", "existingInfo", ")", ";", "}", "for", "(", "Iterator", "it", "=", "newElements", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "it", ".", "hasNext", "(", ")", ";", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "it", ".", "next", "(", ")", ";", "IJavaElement", "element", "=", "(", "IJavaElement", ")", "entry", ".", "getKey", "(", ")", ";", "if", "(", "element", "instanceof", "JarPackageFragmentRoot", ")", "{", "Object", "info", "=", "entry", ".", "getValue", "(", ")", ";", "it", ".", "remove", "(", ")", ";", "this", ".", "cache", ".", "putInfo", "(", "element", ",", "info", ")", ";", "}", "}", "Iterator", "iterator", "=", "newElements", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "iterator", ".", "next", "(", ")", ";", "this", ".", "cache", ".", "putInfo", "(", "(", "IJavaElement", ")", "entry", ".", "getKey", "(", ")", ",", "entry", ".", "getValue", "(", ")", ")", ";", "}", "}", "private", "void", "closeChildren", "(", "Object", "info", ")", "{", "if", "(", "info", "instanceof", "JavaElementInfo", ")", "{", "IJavaElement", "[", "]", "children", "=", "(", "(", "JavaElementInfo", ")", "info", ")", ".", "getChildren", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "size", "=", "children", ".", "length", ";", "i", "<", "size", ";", "++", "i", ")", "{", "JavaElement", "child", "=", "(", "JavaElement", ")", "children", "[", "i", "]", ";", "try", "{", "child", ".", "close", "(", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "}", "}", "}", "protected", "synchronized", "void", "putJarTypeInfo", "(", "IJavaElement", "type", ",", "Object", "info", ")", "{", "this", ".", "cache", ".", "jarTypeCache", ".", "put", "(", "type", ",", "info", ")", ";", "}", "protected", "Object", "readState", "(", "IProject", "project", ")", "throws", "CoreException", "{", "File", "file", "=", "getSerializationFile", "(", "project", ")", ";", "if", "(", "file", "!=", "null", "&&", "file", ".", "exists", "(", ")", ")", "{", "try", "{", "DataInputStream", "in", "=", "new", "DataInputStream", "(", "new", "BufferedInputStream", "(", "new", "FileInputStream", "(", "file", ")", ")", ")", ";", "try", "{", "String", "pluginID", "=", "in", ".", "readUTF", "(", ")", ";", "if", "(", "!", "pluginID", ".", "equals", "(", "JavaCore", ".", "PLUGIN_ID", ")", ")", "throw", "new", "IOException", "(", "Messages", ".", "build_wrongFileFormat", ")", ";", "String", "kind", "=", "in", ".", "readUTF", "(", ")", ";", "if", "(", "!", "kind", ".", "equals", "(", "\"STATE\"", ")", ")", "throw", "new", "IOException", "(", "Messages", ".", "build_wrongFileFormat", ")", ";", "if", "(", "in", ".", "readBoolean", "(", ")", ")", "return", "JavaBuilder", ".", "readState", "(", "project", ",", "in", ")", ";", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "project", ".", "getName", "(", ")", ")", ";", "}", "finally", "{", "in", ".", "close", "(", ")", ";", "}", "}", "catch", "(", "Exception", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "throw", "new", "CoreException", "(", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "JavaCore", ".", "PLUGIN_ID", ",", "Platform", ".", "PLUGIN_ERROR", ",", "\"\"", "+", "project", ".", "getName", "(", ")", ",", "e", ")", ")", ";", "}", "}", "else", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "{", "if", "(", "file", "==", "null", ")", "System", ".", "out", ".", "println", "(", "\"\"", "+", "project", ")", ";", "else", "System", ".", "out", ".", "println", "(", "\"\"", "+", "file", ".", "getPath", "(", ")", "+", "\"\"", ")", ";", "}", "return", "null", ";", "}", "public", "static", "void", "recreatePersistedContainer", "(", "String", "propertyName", ",", "String", "containerString", ",", "boolean", "addToContainerValues", ")", "{", "int", "containerPrefixLength", "=", "CP_CONTAINER_PREFERENCES_PREFIX", ".", "length", "(", ")", ";", "int", "index", "=", "propertyName", ".", "indexOf", "(", "'|'", ",", "containerPrefixLength", ")", ";", "if", "(", "containerString", "!=", "null", ")", "containerString", "=", "containerString", ".", "trim", "(", ")", ";", "if", "(", "index", ">", "0", ")", "{", "String", "projectName", "=", "propertyName", ".", "substring", "(", "containerPrefixLength", ",", "index", ")", ".", "trim", "(", ")", ";", "IJavaProject", "project", "=", "getJavaModelManager", "(", ")", ".", "getJavaModel", "(", ")", ".", "getJavaProject", "(", "projectName", ")", ";", "IPath", "containerPath", "=", "new", "Path", "(", "propertyName", ".", "substring", "(", "index", "+", "1", ")", ".", "trim", "(", ")", ")", ";", "recreatePersistedContainer", "(", "project", ",", "containerPath", ",", "containerString", ",", "addToContainerValues", ")", ";", "}", "}", "private", "static", "void", "recreatePersistedContainer", "(", "final", "IJavaProject", "project", ",", "final", "IPath", "containerPath", ",", "String", "containerString", ",", "boolean", "addToContainerValues", ")", "{", "if", "(", "!", "project", ".", "getProject", "(", ")", ".", "isAccessible", "(", ")", ")", "return", ";", "if", "(", "containerString", "==", "null", ")", "{", "getJavaModelManager", "(", ")", ".", "containerPut", "(", "project", ",", "containerPath", ",", "null", ")", ";", "}", "else", "{", "IClasspathEntry", "[", "]", "entries", ";", "try", "{", "entries", "=", "(", "(", "JavaProject", ")", "project", ")", ".", "decodeClasspath", "(", "containerString", ",", "null", ")", "[", "0", "]", ";", "}", "catch", "(", "IOException", "e", ")", "{", "Util", ".", "log", "(", "e", ",", "\"\"", "+", "containerString", ")", ";", "entries", "=", "JavaProject", ".", "INVALID_CLASSPATH", ";", "}", "if", "(", "entries", "!=", "JavaProject", ".", "INVALID_CLASSPATH", ")", "{", "final", "IClasspathEntry", "[", "]", "containerEntries", "=", "entries", ";", "IClasspathContainer", "container", "=", "new", "IClasspathContainer", "(", ")", "{", "public", "IClasspathEntry", "[", "]", "getClasspathEntries", "(", ")", "{", "return", "containerEntries", ";", "}", "public", "String", "getDescription", "(", ")", "{", "return", "\"\"", "+", "containerPath", "+", "\"\"", "+", "project", ".", "getElementName", "(", ")", "+", "\"]\"", ";", "}", "public", "int", "getKind", "(", ")", "{", "return", "0", ";", "}", "public", "IPath", "getPath", "(", ")", "{", "return", "containerPath", ";", "}", "public", "String", "toString", "(", ")", "{", "return", "getDescription", "(", ")", ";", "}", "}", ";", "if", "(", "addToContainerValues", ")", "{", "getJavaModelManager", "(", ")", ".", "containerPut", "(", "project", ",", "containerPath", ",", "container", ")", ";", "}", "Map", "projectContainers", "=", "(", "Map", ")", "getJavaModelManager", "(", ")", ".", "previousSessionContainers", ".", "get", "(", "project", ")", ";", "if", "(", "projectContainers", "==", "null", ")", "{", "projectContainers", "=", "new", "HashMap", "(", "1", ")", ";", "getJavaModelManager", "(", ")", ".", "previousSessionContainers", ".", "put", "(", "project", ",", "projectContainers", ")", ";", "}", "projectContainers", ".", "put", "(", "containerPath", ",", "container", ")", ";", "}", "}", "}", "public", "void", "rememberScope", "(", "AbstractSearchScope", "scope", ")", "{", "this", ".", "searchScopes", ".", "put", "(", "scope", ",", "null", ")", ";", "}", "public", "synchronized", "Object", "removeInfoAndChildren", "(", "JavaElement", "element", ")", "throws", "JavaModelException", "{", "Object", "info", "=", "this", ".", "cache", ".", "peekAtInfo", "(", "element", ")", ";", "if", "(", "info", "!=", "null", ")", "{", "boolean", "wasVerbose", "=", "false", ";", "try", "{", "if", "(", "JavaModelCache", ".", "VERBOSE", ")", "{", "String", "elementType", ";", "switch", "(", "element", ".", "getElementType", "(", ")", ")", "{", "case", "IJavaElement", ".", "JAVA_PROJECT", ":", "elementType", "=", "\"project\"", ";", "break", ";", "case", "IJavaElement", ".", "PACKAGE_FRAGMENT_ROOT", ":", "elementType", "=", "\"root\"", ";", "break", ";", "case", "IJavaElement", ".", "PACKAGE_FRAGMENT", ":", "elementType", "=", "\"package\"", ";", "break", ";", "case", "IJavaElement", ".", "CLASS_FILE", ":", "elementType", "=", "\"class", "file\"", ";", "break", ";", "case", "IJavaElement", ".", "COMPILATION_UNIT", ":", "elementType", "=", "\"\"", ";", "break", ";", "default", ":", "elementType", "=", "\"element\"", ";", "}", "System", ".", "out", ".", "println", "(", "Thread", ".", "currentThread", "(", ")", "+", "\"", "CLOSING", "\"", "+", "elementType", "+", "\"", "\"", "+", "element", ".", "toStringWithAncestors", "(", ")", ")", ";", "wasVerbose", "=", "true", ";", "JavaModelCache", ".", "VERBOSE", "=", "false", ";", "}", "element", ".", "closing", "(", "info", ")", ";", "if", "(", "element", "instanceof", "IParent", ")", "{", "closeChildren", "(", "info", ")", ";", "}", "this", ".", "cache", ".", "removeInfo", "(", "element", ")", ";", "if", "(", "wasVerbose", ")", "{", "System", ".", "out", ".", "println", "(", "this", ".", "cache", ".", "toStringFillingRation", "(", "\"->", "\"", ")", ")", ";", "}", "}", "finally", "{", "JavaModelCache", ".", "VERBOSE", "=", "wasVerbose", ";", "}", "return", "info", ";", "}", "return", "null", ";", "}", "public", "void", "removePerProjectInfo", "(", "JavaProject", "javaProject", ",", "boolean", "removeExtJarInfo", ")", "{", "synchronized", "(", "this", ".", "perProjectInfos", ")", "{", "IProject", "project", "=", "javaProject", ".", "getProject", "(", ")", ";", "PerProjectInfo", "info", "=", "(", "PerProjectInfo", ")", "this", ".", "perProjectInfos", ".", "get", "(", "project", ")", ";", "if", "(", "info", "!=", "null", ")", "{", "this", ".", "perProjectInfos", ".", "remove", "(", "project", ")", ";", "if", "(", "removeExtJarInfo", ")", "{", "info", ".", "forgetExternalTimestampsAndIndexes", "(", ")", ";", "}", "}", "}", "resetNonChainingJarsCache", "(", ")", ";", "}", "public", "void", "resetProjectOptions", "(", "JavaProject", "javaProject", ")", "{", "synchronized", "(", "this", ".", "perProjectInfos", ")", "{", "IProject", "project", "=", "javaProject", ".", "getProject", "(", ")", ";", "PerProjectInfo", "info", "=", "(", "PerProjectInfo", ")", "this", ".", "perProjectInfos", ".", "get", "(", "project", ")", ";", "if", "(", "info", "!=", "null", ")", "{", "info", ".", "options", "=", "null", ";", "}", "}", "}", "public", "void", "resetProjectPreferences", "(", "JavaProject", "javaProject", ")", "{", "synchronized", "(", "this", ".", "perProjectInfos", ")", "{", "IProject", "project", "=", "javaProject", ".", "getProject", "(", ")", ";", "PerProjectInfo", "info", "=", "(", "PerProjectInfo", ")", "this", ".", "perProjectInfos", ".", "get", "(", "project", ")", ";", "if", "(", "info", "!=", "null", ")", "{", "info", ".", "preferences", "=", "null", ";", "}", "}", "}", "public", "static", "final", "void", "doNotUse", "(", ")", "{", "MANAGER", ".", "deltaState", ".", "doNotUse", "(", ")", ";", "MANAGER", "=", "new", "JavaModelManager", "(", ")", ";", "}", "protected", "synchronized", "void", "resetJarTypeCache", "(", ")", "{", "this", ".", "cache", ".", "resetJarTypeCache", "(", ")", ";", "}", "public", "void", "resetNonChainingJarsCache", "(", ")", "{", "if", "(", "this", ".", "nonChainingJars", "!=", "null", ")", "this", ".", "nonChainingJars", ".", "clear", "(", ")", ";", "}", "public", "void", "resetTemporaryCache", "(", ")", "{", "this", ".", "temporaryCache", ".", "set", "(", "null", ")", ";", "}", "public", "void", "rollback", "(", "ISaveContext", "context", ")", "{", "}", "private", "void", "saveState", "(", "PerProjectInfo", "info", ",", "ISaveContext", "context", ")", "throws", "CoreException", "{", "if", "(", "context", ".", "getKind", "(", ")", "==", "ISaveContext", ".", "SNAPSHOT", ")", "return", ";", "if", "(", "info", ".", "triedRead", ")", "saveBuiltState", "(", "info", ")", ";", "}", "private", "void", "saveBuiltState", "(", "PerProjectInfo", "info", ")", "throws", "CoreException", "{", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "System", ".", "out", ".", "println", "(", "Messages", ".", "bind", "(", "Messages", ".", "build_saveStateProgress", ",", "info", ".", "project", ".", "getName", "(", ")", ")", ")", ";", "File", "file", "=", "getSerializationFile", "(", "info", ".", "project", ")", ";", "if", "(", "file", "==", "null", ")", "return", ";", "long", "t", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "try", "{", "DataOutputStream", "out", "=", "new", "DataOutputStream", "(", "new", "BufferedOutputStream", "(", "new", "FileOutputStream", "(", "file", ")", ")", ")", ";", "try", "{", "out", ".", "writeUTF", "(", "JavaCore", ".", "PLUGIN_ID", ")", ";", "out", ".", "writeUTF", "(", "\"STATE\"", ")", ";", "if", "(", "info", ".", "savedState", "==", "null", ")", "{", "out", ".", "writeBoolean", "(", "false", ")", ";", "}", "else", "{", "out", ".", "writeBoolean", "(", "true", ")", ";", "JavaBuilder", ".", "writeState", "(", "info", ".", "savedState", ",", "out", ")", ";", "}", "}", "finally", "{", "out", ".", "close", "(", ")", ";", "}", "}", "catch", "(", "RuntimeException", "e", ")", "{", "try", "{", "file", ".", "delete", "(", ")", ";", "}", "catch", "(", "SecurityException", "se", ")", "{", "}", "throw", "new", "CoreException", "(", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "JavaCore", ".", "PLUGIN_ID", ",", "Platform", ".", "PLUGIN_ERROR", ",", "Messages", ".", "bind", "(", "Messages", ".", "build_cannotSaveState", ",", "info", ".", "project", ".", "getName", "(", ")", ")", ",", "e", ")", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "try", "{", "file", ".", "delete", "(", ")", ";", "}", "catch", "(", "SecurityException", "se", ")", "{", "}", "throw", "new", "CoreException", "(", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "JavaCore", ".", "PLUGIN_ID", ",", "Platform", ".", "PLUGIN_ERROR", ",", "Messages", ".", "bind", "(", "Messages", ".", "build_cannotSaveState", ",", "info", ".", "project", ".", "getName", "(", ")", ")", ",", "e", ")", ")", ";", "}", "if", "(", "JavaBuilder", ".", "DEBUG", ")", "{", "t", "=", "System", ".", "currentTimeMillis", "(", ")", "-", "t", ";", "System", ".", "out", ".", "println", "(", "Messages", ".", "bind", "(", "Messages", ".", "build_saveStateComplete", ",", "String", ".", "valueOf", "(", "t", ")", ")", ")", ";", "}", "}", "private", "void", "saveNonChainingJarsCache", "(", ")", "throws", "CoreException", "{", "File", "file", "=", "getNonChainingJarsFile", "(", ")", ";", "DataOutputStream", "out", "=", "null", ";", "try", "{", "out", "=", "new", "DataOutputStream", "(", "new", "BufferedOutputStream", "(", "new", "FileOutputStream", "(", "file", ")", ")", ")", ";", "Set", "nonChainingJarsCache", "=", "getNonChainingJarsCache", "(", ")", ";", "synchronized", "(", "nonChainingJarsCache", ")", "{", "out", ".", "writeInt", "(", "nonChainingJarsCache", ".", "size", "(", ")", ")", ";", "Iterator", "entries", "=", "nonChainingJarsCache", ".", "iterator", "(", ")", ";", "while", "(", "entries", ".", "hasNext", "(", ")", ")", "{", "IPath", "path", "=", "(", "IPath", ")", "entries", ".", "next", "(", ")", ";", "out", ".", "writeUTF", "(", "path", ".", "toPortableString", "(", ")", ")", ";", "}", "}", "}", "catch", "(", "IOException", "e", ")", "{", "IStatus", "status", "=", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "JavaCore", ".", "PLUGIN_ID", ",", "IStatus", ".", "ERROR", ",", "\"\"", ",", "e", ")", ";", "throw", "new", "CoreException", "(", "status", ")", ";", "}", "finally", "{", "if", "(", "out", "!=", "null", ")", "{", "try", "{", "out", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "}", "}", "}", "}", "private", "void", "saveVariablesAndContainers", "(", "ISaveContext", "context", ")", "throws", "CoreException", "{", "File", "file", "=", "getVariableAndContainersFile", "(", ")", ";", "DataOutputStream", "out", "=", "null", ";", "try", "{", "out", "=", "new", "DataOutputStream", "(", "new", "BufferedOutputStream", "(", "new", "FileOutputStream", "(", "file", ")", ")", ")", ";", "out", ".", "writeInt", "(", "VARIABLES_AND_CONTAINERS_FILE_VERSION", ")", ";", "new", "VariablesAndContainersSaveHelper", "(", "out", ")", ".", "save", "(", "context", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "IStatus", "status", "=", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "JavaCore", ".", "PLUGIN_ID", ",", "IStatus", ".", "ERROR", ",", "\"\"", ",", "e", ")", ";", "throw", "new", "CoreException", "(", "status", ")", ";", "}", "finally", "{", "if", "(", "out", "!=", "null", ")", "{", "try", "{", "out", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "}", "}", "}", "}", "private", "final", "class", "VariablesAndContainersSaveHelper", "{", "private", "final", "HashtableOfObjectToInt", "classpathEntryIds", ";", "private", "final", "DataOutputStream", "out", ";", "private", "final", "HashtableOfObjectToInt", "stringIds", ";", "VariablesAndContainersSaveHelper", "(", "DataOutputStream", "out", ")", "{", "super", "(", ")", ";", "this", ".", "classpathEntryIds", "=", "new", "HashtableOfObjectToInt", "(", ")", ";", "this", ".", "out", "=", "out", ";", "this", ".", "stringIds", "=", "new", "HashtableOfObjectToInt", "(", ")", ";", "}", "void", "save", "(", "ISaveContext", "context", ")", "throws", "IOException", ",", "JavaModelException", "{", "IProject", "project", "=", "context", ".", "getProject", "(", ")", ";", "if", "(", "project", "==", "null", ")", "{", "saveProjects", "(", "getJavaModel", "(", ")", ".", "getJavaProjects", "(", ")", ")", ";", "}", "else", "{", "saveProjects", "(", "new", "IJavaProject", "[", "]", "{", "JavaCore", ".", "create", "(", "project", ")", "}", ")", ";", "}", "switch", "(", "context", ".", "getKind", "(", ")", ")", "{", "case", "ISaveContext", ".", "FULL_SAVE", ":", "case", "ISaveContext", ".", "SNAPSHOT", ":", "HashMap", "varsToSave", "=", "null", ";", "Iterator", "iterator", "=", "JavaModelManager", ".", "this", ".", "variables", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "IEclipsePreferences", "defaultPreferences", "=", "getDefaultPreferences", "(", ")", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "iterator", ".", "next", "(", ")", ";", "String", "varName", "=", "(", "String", ")", "entry", ".", "getKey", "(", ")", ";", "if", "(", "defaultPreferences", ".", "get", "(", "CP_VARIABLE_PREFERENCES_PREFIX", "+", "varName", ",", "null", ")", "!=", "null", "||", "CP_ENTRY_IGNORE_PATH", ".", "equals", "(", "entry", ".", "getValue", "(", ")", ")", ")", "{", "if", "(", "varsToSave", "==", "null", ")", "varsToSave", "=", "new", "HashMap", "(", "JavaModelManager", ".", "this", ".", "variables", ")", ";", "varsToSave", ".", "remove", "(", "varName", ")", ";", "}", "}", "saveVariables", "(", "varsToSave", "!=", "null", "?", "varsToSave", ":", "JavaModelManager", ".", "this", ".", "variables", ")", ";", "break", ";", "default", ":", "}", "}", "private", "void", "saveAccessRule", "(", "ClasspathAccessRule", "rule", ")", "throws", "IOException", "{", "saveInt", "(", "rule", ".", "problemId", ")", ";", "savePath", "(", "rule", ".", "getPattern", "(", ")", ")", ";", "}", "private", "void", "saveAccessRules", "(", "IAccessRule", "[", "]", "rules", ")", "throws", "IOException", "{", "int", "count", "=", "rules", "==", "null", "?", "0", ":", "rules", ".", "length", ";", "saveInt", "(", "count", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "count", ";", "++", "i", ")", "saveAccessRule", "(", "(", "ClasspathAccessRule", ")", "rules", "[", "i", "]", ")", ";", "}", "private", "void", "saveAttribute", "(", "IClasspathAttribute", "attribute", ")", "throws", "IOException", "{", "saveString", "(", "attribute", ".", "getName", "(", ")", ")", ";", "saveString", "(", "attribute", ".", "getValue", "(", ")", ")", ";", "}", "private", "void", "saveAttributes", "(", "IClasspathAttribute", "[", "]", "attributes", ")", "throws", "IOException", "{", "int", "count", "=", "attributes", "==", "null", "?", "0", ":", "attributes", ".", "length", ";", "saveInt", "(", "count", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "count", ";", "++", "i", ")", "saveAttribute", "(", "attributes", "[", "i", "]", ")", ";", "}", "private", "void", "saveClasspathEntries", "(", "IClasspathEntry", "[", "]", "entries", ")", "throws", "IOException", "{", "int", "count", "=", "entries", "==", "null", "?", "0", ":", "entries", ".", "length", ";", "saveInt", "(", "count", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "count", ";", "++", "i", ")", "saveClasspathEntry", "(", "entries", "[", "i", "]", ")", ";", "}", "private", "void", "saveClasspathEntry", "(", "IClasspathEntry", "entry", ")", "throws", "IOException", "{", "if", "(", "saveNewId", "(", "entry", ",", "this", ".", "classpathEntryIds", ")", ")", "{", "saveInt", "(", "entry", ".", "getContentKind", "(", ")", ")", ";", "saveInt", "(", "entry", ".", "getEntryKind", "(", ")", ")", ";", "savePath", "(", "entry", ".", "getPath", "(", ")", ")", ";", "savePaths", "(", "entry", ".", "getInclusionPatterns", "(", ")", ")", ";", "savePaths", "(", "entry", ".", "getExclusionPatterns", "(", ")", ")", ";", "savePath", "(", "entry", ".", "getSourceAttachmentPath", "(", ")", ")", ";", "savePath", "(", "entry", ".", "getSourceAttachmentRootPath", "(", ")", ")", ";", "savePath", "(", "entry", ".", "getOutputLocation", "(", ")", ")", ";", "this", ".", "out", ".", "writeBoolean", "(", "entry", ".", "isExported", "(", ")", ")", ";", "saveAccessRules", "(", "entry", ".", "getAccessRules", "(", ")", ")", ";", "this", ".", "out", ".", "writeBoolean", "(", "entry", ".", "combineAccessRules", "(", ")", ")", ";", "saveAttributes", "(", "entry", ".", "getExtraAttributes", "(", ")", ")", ";", "}", "}", "private", "void", "saveContainers", "(", "IJavaProject", "project", ",", "Map", "containerMap", ")", "throws", "IOException", "{", "saveInt", "(", "containerMap", ".", "size", "(", ")", ")", ";", "for", "(", "Iterator", "i", "=", "containerMap", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "i", ".", "hasNext", "(", ")", ";", ")", "{", "Entry", "entry", "=", "(", "Entry", ")", "i", ".", "next", "(", ")", ";", "IPath", "path", "=", "(", "IPath", ")", "entry", ".", "getKey", "(", ")", ";", "IClasspathContainer", "container", "=", "(", "IClasspathContainer", ")", "entry", ".", "getValue", "(", ")", ";", "IClasspathEntry", "[", "]", "cpEntries", "=", "null", ";", "if", "(", "container", "==", "null", ")", "{", "container", "=", "getPreviousSessionContainer", "(", "path", ",", "project", ")", ";", "}", "if", "(", "container", "!=", "null", ")", "cpEntries", "=", "container", ".", "getClasspathEntries", "(", ")", ";", "savePath", "(", "path", ")", ";", "saveClasspathEntries", "(", "cpEntries", ")", ";", "}", "}", "private", "void", "saveInt", "(", "int", "value", ")", "throws", "IOException", "{", "this", ".", "out", ".", "writeInt", "(", "value", ")", ";", "}", "private", "boolean", "saveNewId", "(", "Object", "key", ",", "HashtableOfObjectToInt", "map", ")", "throws", "IOException", "{", "int", "id", "=", "map", ".", "get", "(", "key", ")", ";", "if", "(", "id", "==", "-", "1", ")", "{", "int", "newId", "=", "map", ".", "size", "(", ")", ";", "map", ".", "put", "(", "key", ",", "newId", ")", ";", "saveInt", "(", "newId", ")", ";", "return", "true", ";", "}", "else", "{", "saveInt", "(", "id", ")", ";", "return", "false", ";", "}", "}", "private", "void", "savePath", "(", "IPath", "path", ")", "throws", "IOException", "{", "if", "(", "path", "==", "null", ")", "{", "this", ".", "out", ".", "writeBoolean", "(", "true", ")", ";", "}", "else", "{", "this", ".", "out", ".", "writeBoolean", "(", "false", ")", ";", "saveString", "(", "path", ".", "toPortableString", "(", ")", ")", ";", "}", "}", "private", "void", "savePaths", "(", "IPath", "[", "]", "paths", ")", "throws", "IOException", "{", "int", "count", "=", "paths", "==", "null", "?", "0", ":", "paths", ".", "length", ";", "saveInt", "(", "count", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "count", ";", "++", "i", ")", "savePath", "(", "paths", "[", "i", "]", ")", ";", "}", "private", "void", "saveProjects", "(", "IJavaProject", "[", "]", "projects", ")", "throws", "IOException", ",", "JavaModelException", "{", "int", "count", "=", "projects", ".", "length", ";", "saveInt", "(", "count", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "count", ";", "++", "i", ")", "{", "IJavaProject", "project", "=", "projects", "[", "i", "]", ";", "saveString", "(", "project", ".", "getElementName", "(", ")", ")", ";", "Map", "containerMap", "=", "(", "Map", ")", "JavaModelManager", ".", "this", ".", "containers", ".", "get", "(", "project", ")", ";", "if", "(", "containerMap", "==", "null", ")", "{", "containerMap", "=", "Collections", ".", "EMPTY_MAP", ";", "}", "else", "{", "containerMap", "=", "new", "HashMap", "(", "containerMap", ")", ";", "}", "saveContainers", "(", "project", ",", "containerMap", ")", ";", "}", "}", "private", "void", "saveString", "(", "String", "string", ")", "throws", "IOException", "{", "if", "(", "saveNewId", "(", "string", ",", "this", ".", "stringIds", ")", ")", "this", ".", "out", ".", "writeUTF", "(", "string", ")", ";", "}", "private", "void", "saveVariables", "(", "Map", "map", ")", "throws", "IOException", "{", "saveInt", "(", "map", ".", "size", "(", ")", ")", ";", "for", "(", "Iterator", "i", "=", "map", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "i", ".", "hasNext", "(", ")", ";", ")", "{", "Entry", "entry", "=", "(", "Entry", ")", "i", ".", "next", "(", ")", ";", "String", "varName", "=", "(", "String", ")", "entry", ".", "getKey", "(", ")", ";", "IPath", "varPath", "=", "(", "IPath", ")", "entry", ".", "getValue", "(", ")", ";", "saveString", "(", "varName", ")", ";", "savePath", "(", "varPath", ")", ";", "}", "}", "}", "private", "void", "traceVariableAndContainers", "(", "String", "action", ",", "long", "start", ")", "{", "Long", "delta", "=", "new", "Long", "(", "System", ".", "currentTimeMillis", "(", ")", "-", "start", ")", ";", "Long", "length", "=", "new", "Long", "(", "getVariableAndContainersFile", "(", ")", ".", "length", "(", ")", ")", ";", "String", "pattern", "=", "\"\"", ";", "String", "message", "=", "MessageFormat", ".", "format", "(", "pattern", ",", "new", "Object", "[", "]", "{", "action", ",", "length", ",", "delta", "}", ")", ";", "System", ".", "out", ".", "println", "(", "message", ")", ";", "}", "public", "void", "saving", "(", "ISaveContext", "context", ")", "throws", "CoreException", "{", "long", "start", "=", "-", "1", ";", "if", "(", "VERBOSE", ")", "start", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "saveVariablesAndContainers", "(", "context", ")", ";", "if", "(", "VERBOSE", ")", "traceVariableAndContainers", "(", "\"Saved\"", ",", "start", ")", ";", "switch", "(", "context", ".", "getKind", "(", ")", ")", "{", "case", "ISaveContext", ".", "FULL_SAVE", ":", "{", "saveNonChainingJarsCache", "(", ")", ";", "context", ".", "needDelta", "(", ")", ";", "IndexManager", "manager", "=", "this", ".", "indexManager", ";", "if", "(", "manager", "!=", "null", "&&", "this", ".", "workspaceScope", "!=", "null", ")", "{", "manager", ".", "cleanUpIndexes", "(", ")", ";", "}", "}", "case", "ISaveContext", ".", "SNAPSHOT", ":", "{", "this", ".", "externalFoldersManager", ".", "cleanUp", "(", "null", ")", ";", "}", "}", "IProject", "savedProject", "=", "context", ".", "getProject", "(", ")", ";", "if", "(", "savedProject", "!=", "null", ")", "{", "if", "(", "!", "JavaProject", ".", "hasJavaNature", "(", "savedProject", ")", ")", "return", ";", "PerProjectInfo", "info", "=", "getPerProjectInfo", "(", "savedProject", ",", "true", ")", ";", "saveState", "(", "info", ",", "context", ")", ";", "return", ";", "}", "ArrayList", "vStats", "=", "null", ";", "ArrayList", "values", "=", "null", ";", "synchronized", "(", "this", ".", "perProjectInfos", ")", "{", "values", "=", "new", "ArrayList", "(", "this", ".", "perProjectInfos", ".", "values", "(", ")", ")", ";", "}", "Iterator", "iterator", "=", "values", ".", "iterator", "(", ")", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "try", "{", "PerProjectInfo", "info", "=", "(", "PerProjectInfo", ")", "iterator", ".", "next", "(", ")", ";", "saveState", "(", "info", ",", "context", ")", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "if", "(", "vStats", "==", "null", ")", "vStats", "=", "new", "ArrayList", "(", ")", ";", "vStats", ".", "add", "(", "e", ".", "getStatus", "(", ")", ")", ";", "}", "}", "if", "(", "vStats", "!=", "null", ")", "{", "IStatus", "[", "]", "stats", "=", "new", "IStatus", "[", "vStats", ".", "size", "(", ")", "]", ";", "vStats", ".", "toArray", "(", "stats", ")", ";", "throw", "new", "CoreException", "(", "new", "MultiStatus", "(", "JavaCore", ".", "PLUGIN_ID", ",", "IStatus", ".", "ERROR", ",", "stats", ",", "Messages", ".", "build_cannotSaveStates", ",", "null", ")", ")", ";", "}", "this", ".", "deltaState", ".", "saveExternalLibTimeStamps", "(", ")", ";", "}", "public", "void", "secondaryTypeAdding", "(", "String", "path", ",", "char", "[", "]", "typeName", ",", "char", "[", "]", "packageName", ")", "{", "if", "(", "VERBOSE", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", "\"\"", ")", ";", "buffer", ".", "append", "(", "path", ")", ";", "buffer", ".", "append", "(", "','", ")", ";", "buffer", ".", "append", "(", "'['", ")", ";", "buffer", ".", "append", "(", "new", "String", "(", "packageName", ")", ")", ";", "buffer", ".", "append", "(", "'.'", ")", ";", "buffer", ".", "append", "(", "new", "String", "(", "typeName", ")", ")", ";", "buffer", ".", "append", "(", "']'", ")", ";", "buffer", ".", "append", "(", "')'", ")", ";", "Util", ".", "verbose", "(", "buffer", ".", "toString", "(", ")", ")", ";", "}", "IWorkspaceRoot", "wRoot", "=", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ";", "IResource", "resource", "=", "wRoot", ".", "findMember", "(", "path", ")", ";", "if", "(", "resource", "!=", "null", ")", "{", "if", "(", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ".", "isJavaLikeFileName", "(", "path", ")", "&&", "resource", ".", "getType", "(", ")", "==", "IResource", ".", "FILE", ")", "{", "IProject", "project", "=", "resource", ".", "getProject", "(", ")", ";", "try", "{", "PerProjectInfo", "projectInfo", "=", "getPerProjectInfoCheckExistence", "(", "project", ")", ";", "HashMap", "indexedSecondaryTypes", "=", "null", ";", "if", "(", "projectInfo", ".", "secondaryTypes", "==", "null", ")", "{", "projectInfo", ".", "secondaryTypes", "=", "new", "Hashtable", "(", "3", ")", ";", "indexedSecondaryTypes", "=", "new", "HashMap", "(", "3", ")", ";", "projectInfo", ".", "secondaryTypes", ".", "put", "(", "INDEXED_SECONDARY_TYPES", ",", "indexedSecondaryTypes", ")", ";", "}", "else", "{", "indexedSecondaryTypes", "=", "(", "HashMap", ")", "projectInfo", ".", "secondaryTypes", ".", "get", "(", "INDEXED_SECONDARY_TYPES", ")", ";", "if", "(", "indexedSecondaryTypes", "==", "null", ")", "{", "indexedSecondaryTypes", "=", "new", "HashMap", "(", "3", ")", ";", "projectInfo", ".", "secondaryTypes", ".", "put", "(", "INDEXED_SECONDARY_TYPES", ",", "indexedSecondaryTypes", ")", ";", "}", "}", "HashMap", "allTypes", "=", "(", "HashMap", ")", "indexedSecondaryTypes", ".", "get", "(", "resource", ")", ";", "if", "(", "allTypes", "==", "null", ")", "{", "allTypes", "=", "new", "HashMap", "(", "3", ")", ";", "indexedSecondaryTypes", ".", "put", "(", "resource", ",", "allTypes", ")", ";", "}", "ICompilationUnit", "unit", "=", "JavaModelManager", ".", "createCompilationUnitFrom", "(", "(", "IFile", ")", "resource", ",", "null", ")", ";", "if", "(", "unit", "!=", "null", ")", "{", "String", "typeString", "=", "new", "String", "(", "typeName", ")", ";", "IType", "type", "=", "unit", ".", "getType", "(", "typeString", ")", ";", "String", "packageString", "=", "type", ".", "getPackageFragment", "(", ")", ".", "getElementName", "(", ")", ";", "HashMap", "packageTypes", "=", "(", "HashMap", ")", "allTypes", ".", "get", "(", "packageString", ")", ";", "if", "(", "packageTypes", "==", "null", ")", "{", "packageTypes", "=", "new", "HashMap", "(", "3", ")", ";", "allTypes", ".", "put", "(", "packageString", ",", "packageTypes", ")", ";", "}", "packageTypes", ".", "put", "(", "typeString", ",", "type", ")", ";", "}", "if", "(", "VERBOSE", ")", "{", "Util", ".", "verbose", "(", "\"\"", ")", ";", "Iterator", "entries", "=", "indexedSecondaryTypes", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "entries", ".", "hasNext", "(", ")", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "entries", ".", "next", "(", ")", ";", "IFile", "file", "=", "(", "IFile", ")", "entry", ".", "getKey", "(", ")", ";", "Util", ".", "verbose", "(", "\"tt+", "\"", "+", "file", ".", "getFullPath", "(", ")", "+", "':'", "+", "entry", ".", "getValue", "(", ")", ")", ";", "}", "}", "}", "catch", "(", "JavaModelException", "jme", ")", "{", "}", "}", "}", "}", "public", "Map", "secondaryTypes", "(", "IJavaProject", "project", ",", "boolean", "waitForIndexes", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "if", "(", "VERBOSE", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", "\"\"", ")", ";", "buffer", ".", "append", "(", "project", ".", "getElementName", "(", ")", ")", ";", "buffer", ".", "append", "(", "','", ")", ";", "buffer", ".", "append", "(", "waitForIndexes", ")", ";", "buffer", ".", "append", "(", "')'", ")", ";", "Util", ".", "verbose", "(", "buffer", ".", "toString", "(", ")", ")", ";", "}", "final", "PerProjectInfo", "projectInfo", "=", "getPerProjectInfoCheckExistence", "(", "project", ".", "getProject", "(", ")", ")", ";", "Map", "indexingSecondaryCache", "=", "projectInfo", ".", "secondaryTypes", "==", "null", "?", "null", ":", "(", "Map", ")", "projectInfo", ".", "secondaryTypes", ".", "get", "(", "INDEXED_SECONDARY_TYPES", ")", ";", "if", "(", "projectInfo", ".", "secondaryTypes", "!=", "null", "&&", "indexingSecondaryCache", "==", "null", ")", "{", "return", "projectInfo", ".", "secondaryTypes", ";", "}", "if", "(", "projectInfo", ".", "secondaryTypes", "==", "null", ")", "{", "return", "secondaryTypesSearching", "(", "project", ",", "waitForIndexes", ",", "monitor", ",", "projectInfo", ")", ";", "}", "boolean", "indexing", "=", "this", ".", "indexManager", ".", "awaitingJobsCount", "(", ")", ">", "0", ";", "if", "(", "indexing", ")", "{", "if", "(", "!", "waitForIndexes", ")", "{", "return", "projectInfo", ".", "secondaryTypes", ";", "}", "while", "(", "this", ".", "indexManager", ".", "awaitingJobsCount", "(", ")", ">", "0", ")", "{", "if", "(", "monitor", "!=", "null", "&&", "monitor", ".", "isCanceled", "(", ")", ")", "{", "return", "projectInfo", ".", "secondaryTypes", ";", "}", "try", "{", "Thread", ".", "sleep", "(", "10", ")", ";", "}", "catch", "(", "InterruptedException", "e", ")", "{", "return", "projectInfo", ".", "secondaryTypes", ";", "}", "}", "}", "return", "secondaryTypesMerging", "(", "projectInfo", ".", "secondaryTypes", ")", ";", "}", "private", "Hashtable", "secondaryTypesMerging", "(", "Hashtable", "secondaryTypes", ")", "{", "if", "(", "VERBOSE", ")", "{", "Util", ".", "verbose", "(", "\"\"", ")", ";", "Util", ".", "verbose", "(", "\"\"", ")", ";", "Iterator", "entries", "=", "secondaryTypes", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "entries", ".", "hasNext", "(", ")", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "entries", ".", "next", "(", ")", ";", "String", "packName", "=", "(", "String", ")", "entry", ".", "getKey", "(", ")", ";", "Util", ".", "verbose", "(", "\"tt+", "\"", "+", "packName", "+", "':'", "+", "entry", ".", "getValue", "(", ")", ")", ";", "}", "}", "HashMap", "indexedSecondaryTypes", "=", "(", "HashMap", ")", "secondaryTypes", ".", "remove", "(", "INDEXED_SECONDARY_TYPES", ")", ";", "if", "(", "indexedSecondaryTypes", "==", "null", ")", "{", "return", "secondaryTypes", ";", "}", "Iterator", "entries", "=", "indexedSecondaryTypes", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "entries", ".", "hasNext", "(", ")", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "entries", ".", "next", "(", ")", ";", "IFile", "file", "=", "(", "IFile", ")", "entry", ".", "getKey", "(", ")", ";", "secondaryTypesRemoving", "(", "secondaryTypes", ",", "file", ")", ";", "HashMap", "fileSecondaryTypes", "=", "(", "HashMap", ")", "entry", ".", "getValue", "(", ")", ";", "Iterator", "entries2", "=", "fileSecondaryTypes", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "entries2", ".", "hasNext", "(", ")", ")", "{", "Map", ".", "Entry", "entry2", "=", "(", "Map", ".", "Entry", ")", "entries2", ".", "next", "(", ")", ";", "String", "packageName", "=", "(", "String", ")", "entry2", ".", "getKey", "(", ")", ";", "HashMap", "cachedTypes", "=", "(", "HashMap", ")", "secondaryTypes", ".", "get", "(", "packageName", ")", ";", "if", "(", "cachedTypes", "==", "null", ")", "{", "secondaryTypes", ".", "put", "(", "packageName", ",", "entry2", ".", "getValue", "(", ")", ")", ";", "}", "else", "{", "HashMap", "types", "=", "(", "HashMap", ")", "entry2", ".", "getValue", "(", ")", ";", "Iterator", "entries3", "=", "types", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "entries3", ".", "hasNext", "(", ")", ")", "{", "Map", ".", "Entry", "entry3", "=", "(", "Map", ".", "Entry", ")", "entries3", ".", "next", "(", ")", ";", "String", "typeName", "=", "(", "String", ")", "entry3", ".", "getKey", "(", ")", ";", "cachedTypes", ".", "put", "(", "typeName", ",", "entry3", ".", "getValue", "(", ")", ")", ";", "}", "}", "}", "}", "if", "(", "VERBOSE", ")", "{", "Util", ".", "verbose", "(", "\"\"", ")", ";", "entries", "=", "secondaryTypes", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "entries", ".", "hasNext", "(", ")", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "entries", ".", "next", "(", ")", ";", "String", "packName", "=", "(", "String", ")", "entry", ".", "getKey", "(", ")", ";", "Util", ".", "verbose", "(", "\"tt+", "\"", "+", "packName", "+", "':'", "+", "entry", ".", "getValue", "(", ")", ")", ";", "}", "}", "return", "secondaryTypes", ";", "}", "private", "Map", "secondaryTypesSearching", "(", "IJavaProject", "project", ",", "boolean", "waitForIndexes", ",", "IProgressMonitor", "monitor", ",", "final", "PerProjectInfo", "projectInfo", ")", "throws", "JavaModelException", "{", "if", "(", "VERBOSE", "||", "BasicSearchEngine", ".", "VERBOSE", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", "\"\"", ")", ";", "buffer", ".", "append", "(", "project", ".", "getElementName", "(", ")", ")", ";", "buffer", ".", "append", "(", "','", ")", ";", "buffer", ".", "append", "(", "waitForIndexes", ")", ";", "buffer", ".", "append", "(", "')'", ")", ";", "Util", ".", "verbose", "(", "buffer", ".", "toString", "(", ")", ")", ";", "}", "final", "Hashtable", "secondaryTypes", "=", "new", "Hashtable", "(", "3", ")", ";", "IRestrictedAccessTypeRequestor", "nameRequestor", "=", "new", "IRestrictedAccessTypeRequestor", "(", ")", "{", "public", "void", "acceptType", "(", "int", "modifiers", ",", "char", "[", "]", "packageName", ",", "char", "[", "]", "simpleTypeName", ",", "char", "[", "]", "[", "]", "enclosingTypeNames", ",", "String", "path", ",", "AccessRestriction", "access", ")", "{", "String", "key", "=", "packageName", "==", "null", "?", "\"\"", ":", "new", "String", "(", "packageName", ")", ";", "HashMap", "types", "=", "(", "HashMap", ")", "secondaryTypes", ".", "get", "(", "key", ")", ";", "if", "(", "types", "==", "null", ")", "types", "=", "new", "HashMap", "(", "3", ")", ";", "types", ".", "put", "(", "new", "String", "(", "simpleTypeName", ")", ",", "path", ")", ";", "secondaryTypes", ".", "put", "(", "key", ",", "types", ")", ";", "}", "}", ";", "IPackageFragmentRoot", "[", "]", "allRoots", "=", "project", ".", "getAllPackageFragmentRoots", "(", ")", ";", "int", "length", "=", "allRoots", ".", "length", ",", "size", "=", "0", ";", "IPackageFragmentRoot", "[", "]", "allSourceFolders", "=", "new", "IPackageFragmentRoot", "[", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "if", "(", "allRoots", "[", "i", "]", ".", "getKind", "(", ")", "==", "IPackageFragmentRoot", ".", "K_SOURCE", ")", "{", "allSourceFolders", "[", "size", "++", "]", "=", "allRoots", "[", "i", "]", ";", "}", "}", "if", "(", "size", "<", "length", ")", "{", "System", ".", "arraycopy", "(", "allSourceFolders", ",", "0", ",", "allSourceFolders", "=", "new", "IPackageFragmentRoot", "[", "size", "]", ",", "0", ",", "size", ")", ";", "}", "new", "BasicSearchEngine", "(", ")", ".", "searchAllSecondaryTypeNames", "(", "allSourceFolders", ",", "nameRequestor", ",", "waitForIndexes", ",", "monitor", ")", ";", "Iterator", "packages", "=", "secondaryTypes", ".", "values", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "packages", ".", "hasNext", "(", ")", ")", "{", "HashMap", "types", "=", "(", "HashMap", ")", "packages", ".", "next", "(", ")", ";", "Iterator", "names", "=", "types", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "names", ".", "hasNext", "(", ")", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "names", ".", "next", "(", ")", ";", "String", "typeName", "=", "(", "String", ")", "entry", ".", "getKey", "(", ")", ";", "String", "path", "=", "(", "String", ")", "entry", ".", "getValue", "(", ")", ";", "if", "(", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ".", "isJavaLikeFileName", "(", "path", ")", ")", "{", "IFile", "file", "=", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ".", "getFile", "(", "new", "Path", "(", "path", ")", ")", ";", "ICompilationUnit", "unit", "=", "JavaModelManager", ".", "createCompilationUnitFrom", "(", "file", ",", "null", ")", ";", "IType", "type", "=", "unit", ".", "getType", "(", "typeName", ")", ";", "types", ".", "put", "(", "typeName", ",", "type", ")", ";", "}", "else", "{", "types", ".", "remove", "(", "typeName", ")", ";", "}", "}", "}", "if", "(", "projectInfo", ".", "secondaryTypes", "==", "null", "||", "projectInfo", ".", "secondaryTypes", ".", "get", "(", "INDEXED_SECONDARY_TYPES", ")", "!=", "null", ")", "{", "projectInfo", ".", "secondaryTypes", "=", "secondaryTypes", ";", "if", "(", "VERBOSE", "||", "BasicSearchEngine", ".", "VERBOSE", ")", "{", "System", ".", "out", ".", "print", "(", "Thread", ".", "currentThread", "(", ")", "+", "\"\"", ")", ";", "System", ".", "out", ".", "println", "(", ")", ";", "Iterator", "entries", "=", "secondaryTypes", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "entries", ".", "hasNext", "(", ")", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "entries", ".", "next", "(", ")", ";", "String", "qualifiedName", "=", "(", "String", ")", "entry", ".", "getKey", "(", ")", ";", "Util", ".", "verbose", "(", "\"tt-", "\"", "+", "qualifiedName", "+", "'-'", "+", "entry", ".", "getValue", "(", ")", ")", ";", "}", "}", "}", "return", "projectInfo", ".", "secondaryTypes", ";", "}", "public", "void", "secondaryTypesRemoving", "(", "IFile", "file", ",", "boolean", "cleanIndexCache", ")", "{", "if", "(", "VERBOSE", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", "\"\"", ")", ";", "buffer", ".", "append", "(", "file", ".", "getName", "(", ")", ")", ";", "buffer", ".", "append", "(", "')'", ")", ";", "Util", ".", "verbose", "(", "buffer", ".", "toString", "(", ")", ")", ";", "}", "if", "(", "file", "!=", "null", ")", "{", "PerProjectInfo", "projectInfo", "=", "getPerProjectInfo", "(", "file", ".", "getProject", "(", ")", ",", "false", ")", ";", "if", "(", "projectInfo", "!=", "null", "&&", "projectInfo", ".", "secondaryTypes", "!=", "null", ")", "{", "if", "(", "VERBOSE", ")", "{", "Util", ".", "verbose", "(", "\"\"", "+", "file", ".", "getProject", "(", ")", ".", "getName", "(", ")", ")", ";", "}", "secondaryTypesRemoving", "(", "projectInfo", ".", "secondaryTypes", ",", "file", ")", ";", "HashMap", "indexingCache", "=", "(", "HashMap", ")", "projectInfo", ".", "secondaryTypes", ".", "get", "(", "INDEXED_SECONDARY_TYPES", ")", ";", "if", "(", "!", "cleanIndexCache", ")", "{", "if", "(", "indexingCache", "==", "null", ")", "{", "projectInfo", ".", "secondaryTypes", ".", "put", "(", "INDEXED_SECONDARY_TYPES", ",", "new", "HashMap", "(", ")", ")", ";", "}", "return", ";", "}", "if", "(", "indexingCache", "!=", "null", ")", "{", "Set", "keys", "=", "indexingCache", ".", "keySet", "(", ")", ";", "int", "filesSize", "=", "keys", ".", "size", "(", ")", ",", "filesCount", "=", "0", ";", "IFile", "[", "]", "removed", "=", "null", ";", "Iterator", "cachedFiles", "=", "keys", ".", "iterator", "(", ")", ";", "while", "(", "cachedFiles", ".", "hasNext", "(", ")", ")", "{", "IFile", "cachedFile", "=", "(", "IFile", ")", "cachedFiles", ".", "next", "(", ")", ";", "if", "(", "file", ".", "equals", "(", "cachedFile", ")", ")", "{", "if", "(", "removed", "==", "null", ")", "removed", "=", "new", "IFile", "[", "filesSize", "]", ";", "filesSize", "--", ";", "removed", "[", "filesCount", "++", "]", "=", "cachedFile", ";", "}", "}", "if", "(", "removed", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "filesCount", ";", "i", "++", ")", "{", "indexingCache", ".", "remove", "(", "removed", "[", "i", "]", ")", ";", "}", "}", "}", "}", "}", "}", "private", "void", "secondaryTypesRemoving", "(", "Hashtable", "secondaryTypesMap", ",", "IFile", "file", ")", "{", "if", "(", "VERBOSE", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", "\"\"", ")", ";", "Iterator", "entries", "=", "secondaryTypesMap", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "entries", ".", "hasNext", "(", ")", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "entries", ".", "next", "(", ")", ";", "String", "qualifiedName", "=", "(", "String", ")", "entry", ".", "getKey", "(", ")", ";", "buffer", ".", "append", "(", "qualifiedName", "+", "':'", "+", "entry", ".", "getValue", "(", ")", ")", ";", "}", "buffer", ".", "append", "(", "','", ")", ";", "buffer", ".", "append", "(", "file", ".", "getFullPath", "(", ")", ")", ";", "buffer", ".", "append", "(", "')'", ")", ";", "Util", ".", "verbose", "(", "buffer", ".", "toString", "(", ")", ")", ";", "}", "Set", "packageEntries", "=", "secondaryTypesMap", ".", "entrySet", "(", ")", ";", "int", "packagesSize", "=", "packageEntries", ".", "size", "(", ")", ",", "removedPackagesCount", "=", "0", ";", "String", "[", "]", "removedPackages", "=", "null", ";", "Iterator", "packages", "=", "packageEntries", ".", "iterator", "(", ")", ";", "while", "(", "packages", ".", "hasNext", "(", ")", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "packages", ".", "next", "(", ")", ";", "String", "packName", "=", "(", "String", ")", "entry", ".", "getKey", "(", ")", ";", "if", "(", "packName", "!=", "INDEXED_SECONDARY_TYPES", ")", "{", "HashMap", "types", "=", "(", "HashMap", ")", "entry", ".", "getValue", "(", ")", ";", "Set", "nameEntries", "=", "types", ".", "entrySet", "(", ")", ";", "int", "namesSize", "=", "nameEntries", ".", "size", "(", ")", ",", "removedNamesCount", "=", "0", ";", "String", "[", "]", "removedNames", "=", "null", ";", "Iterator", "names", "=", "nameEntries", ".", "iterator", "(", ")", ";", "while", "(", "names", ".", "hasNext", "(", ")", ")", "{", "Map", ".", "Entry", "entry2", "=", "(", "Map", ".", "Entry", ")", "names", ".", "next", "(", ")", ";", "String", "typeName", "=", "(", "String", ")", "entry2", ".", "getKey", "(", ")", ";", "JavaElement", "type", "=", "(", "JavaElement", ")", "entry2", ".", "getValue", "(", ")", ";", "if", "(", "file", ".", "equals", "(", "type", ".", "resource", "(", ")", ")", ")", "{", "if", "(", "removedNames", "==", "null", ")", "removedNames", "=", "new", "String", "[", "namesSize", "]", ";", "namesSize", "--", ";", "removedNames", "[", "removedNamesCount", "++", "]", "=", "typeName", ";", "}", "}", "if", "(", "removedNames", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "removedNamesCount", ";", "i", "++", ")", "{", "types", ".", "remove", "(", "removedNames", "[", "i", "]", ")", ";", "}", "}", "if", "(", "types", ".", "size", "(", ")", "==", "0", ")", "{", "if", "(", "removedPackages", "==", "null", ")", "removedPackages", "=", "new", "String", "[", "packagesSize", "]", ";", "packagesSize", "--", ";", "removedPackages", "[", "removedPackagesCount", "++", "]", "=", "packName", ";", "}", "}", "}", "if", "(", "removedPackages", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "removedPackagesCount", ";", "i", "++", ")", "{", "secondaryTypesMap", ".", "remove", "(", "removedPackages", "[", "i", "]", ")", ";", "}", "}", "if", "(", "VERBOSE", ")", "{", "Util", ".", "verbose", "(", "\"\"", ")", ";", "Iterator", "entries", "=", "secondaryTypesMap", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "entries", ".", "hasNext", "(", ")", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "entries", ".", "next", "(", ")", ";", "String", "qualifiedName", "=", "(", "String", ")", "entry", ".", "getKey", "(", ")", ";", "Util", ".", "verbose", "(", "\"tt+", "\"", "+", "qualifiedName", "+", "':'", "+", "entry", ".", "getValue", "(", ")", ")", ";", "}", "}", "}", "protected", "void", "setBuildOrder", "(", "String", "[", "]", "javaBuildOrder", ")", "throws", "JavaModelException", "{", "if", "(", "!", "JavaCore", ".", "COMPUTE", ".", "equals", "(", "JavaCore", ".", "getOption", "(", "JavaCore", ".", "CORE_JAVA_BUILD_ORDER", ")", ")", ")", "return", ";", "if", "(", "javaBuildOrder", "==", "null", "||", "javaBuildOrder", ".", "length", "<=", "1", ")", "return", ";", "IWorkspace", "workspace", "=", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ";", "IWorkspaceDescription", "description", "=", "workspace", ".", "getDescription", "(", ")", ";", "String", "[", "]", "wksBuildOrder", "=", "description", ".", "getBuildOrder", "(", ")", ";", "String", "[", "]", "newOrder", ";", "if", "(", "wksBuildOrder", "==", "null", ")", "{", "newOrder", "=", "javaBuildOrder", ";", "}", "else", "{", "int", "javaCount", "=", "javaBuildOrder", ".", "length", ";", "HashMap", "newSet", "=", "new", "HashMap", "(", "javaCount", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "javaCount", ";", "i", "++", ")", "{", "newSet", ".", "put", "(", "javaBuildOrder", "[", "i", "]", ",", "javaBuildOrder", "[", "i", "]", ")", ";", "}", "int", "removed", "=", "0", ";", "int", "oldCount", "=", "wksBuildOrder", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "oldCount", ";", "i", "++", ")", "{", "if", "(", "newSet", ".", "containsKey", "(", "wksBuildOrder", "[", "i", "]", ")", ")", "{", "wksBuildOrder", "[", "i", "]", "=", "null", ";", "removed", "++", ";", "}", "}", "newOrder", "=", "new", "String", "[", "oldCount", "-", "removed", "+", "javaCount", "]", ";", "System", ".", "arraycopy", "(", "javaBuildOrder", ",", "0", ",", "newOrder", ",", "0", ",", "javaCount", ")", ";", "int", "index", "=", "javaCount", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "oldCount", ";", "i", "++", ")", "{", "if", "(", "wksBuildOrder", "[", "i", "]", "!=", "null", ")", "{", "newOrder", "[", "index", "++", "]", "=", "wksBuildOrder", "[", "i", "]", ";", "}", "}", "}", "description", ".", "setBuildOrder", "(", "newOrder", ")", ";", "try", "{", "workspace", ".", "setDescription", "(", "description", ")", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "throw", "new", "JavaModelException", "(", "e", ")", ";", "}", "}", "public", "void", "setLastBuiltState", "(", "IProject", "project", ",", "Object", "state", ")", "{", "if", "(", "JavaProject", ".", "hasJavaNature", "(", "project", ")", ")", "{", "PerProjectInfo", "info", "=", "getPerProjectInfo", "(", "project", ",", "true", ")", ";", "info", ".", "triedRead", "=", "true", ";", "info", ".", "savedState", "=", "state", ";", "}", "if", "(", "state", "==", "null", ")", "{", "try", "{", "File", "file", "=", "getSerializationFile", "(", "project", ")", ";", "if", "(", "file", "!=", "null", "&&", "file", ".", "exists", "(", ")", ")", "file", ".", "delete", "(", ")", ";", "}", "catch", "(", "SecurityException", "se", ")", "{", "}", "}", "}", "public", "void", "setOptions", "(", "Hashtable", "newOptions", ")", "{", "try", "{", "Hashtable", "cachedValue", "=", "newOptions", "==", "null", "?", "null", ":", "new", "Hashtable", "(", "newOptions", ")", ";", "IEclipsePreferences", "defaultPreferences", "=", "getDefaultPreferences", "(", ")", ";", "IEclipsePreferences", "instancePreferences", "=", "getInstancePreferences", "(", ")", ";", "if", "(", "newOptions", "==", "null", ")", "{", "instancePreferences", ".", "clear", "(", ")", ";", "}", "else", "{", "Enumeration", "keys", "=", "newOptions", ".", "keys", "(", ")", ";", "while", "(", "keys", ".", "hasMoreElements", "(", ")", ")", "{", "String", "key", "=", "(", "String", ")", "keys", ".", "nextElement", "(", ")", ";", "if", "(", "!", "this", ".", "optionNames", ".", "contains", "(", "key", ")", ")", "continue", ";", "if", "(", "key", ".", "equals", "(", "JavaCore", ".", "CORE_ENCODING", ")", ")", "{", "if", "(", "cachedValue", "!=", "null", ")", "{", "cachedValue", ".", "put", "(", "key", ",", "JavaCore", ".", "getEncoding", "(", ")", ")", ";", "}", "continue", ";", "}", "String", "value", "=", "(", "String", ")", "newOptions", ".", "get", "(", "key", ")", ";", "String", "defaultValue", "=", "defaultPreferences", ".", "get", "(", "key", ",", "null", ")", ";", "if", "(", "defaultValue", "!=", "null", "&&", "defaultValue", ".", "equals", "(", "value", ")", ")", "{", "instancePreferences", ".", "remove", "(", "key", ")", ";", "}", "else", "{", "instancePreferences", ".", "put", "(", "key", ",", "value", ")", ";", "}", "}", "}", "instancePreferences", ".", "flush", "(", ")", ";", "Util", ".", "fixTaskTags", "(", "cachedValue", ")", ";", "this", ".", "optionsCache", "=", "cachedValue", ";", "}", "catch", "(", "BackingStoreException", "e", ")", "{", "}", "}", "public", "void", "startup", "(", ")", "throws", "CoreException", "{", "try", "{", "configurePluginDebugOptions", "(", ")", ";", "this", ".", "cache", "=", "new", "JavaModelCache", "(", ")", ";", "JavaCore", ".", "getPlugin", "(", ")", ".", "getStateLocation", "(", ")", ";", "initializePreferences", "(", ")", ";", "this", ".", "propertyListener", "=", "new", "IEclipsePreferences", ".", "IPreferenceChangeListener", "(", ")", "{", "public", "void", "preferenceChange", "(", "PreferenceChangeEvent", "event", ")", "{", "JavaModelManager", ".", "this", ".", "optionsCache", "=", "null", ";", "}", "}", ";", "new", "InstanceScope", "(", ")", ".", "getNode", "(", "JavaCore", ".", "PLUGIN_ID", ")", ".", "addPreferenceChangeListener", "(", "this", ".", "propertyListener", ")", ";", "this", ".", "resourcesPropertyListener", "=", "new", "IEclipsePreferences", ".", "IPreferenceChangeListener", "(", ")", "{", "public", "void", "preferenceChange", "(", "PreferenceChangeEvent", "event", ")", "{", "if", "(", "ResourcesPlugin", ".", "PREF_ENCODING", ".", "equals", "(", "event", ".", "getKey", "(", ")", ")", ")", "{", "JavaModelManager", ".", "this", ".", "optionsCache", "=", "null", ";", "}", "}", "}", ";", "String", "resourcesPluginId", "=", "ResourcesPlugin", ".", "getPlugin", "(", ")", ".", "getBundle", "(", ")", ".", "getSymbolicName", "(", ")", ";", "new", "InstanceScope", "(", ")", ".", "getNode", "(", "resourcesPluginId", ")", ".", "addPreferenceChangeListener", "(", "this", ".", "resourcesPropertyListener", ")", ";", "Platform", ".", "getContentTypeManager", "(", ")", ".", "addContentTypeChangeListener", "(", "this", ")", ";", "long", "start", "=", "-", "1", ";", "if", "(", "VERBOSE", ")", "start", "=", "System", ".", "currentTimeMillis", "(", ")", ";", "loadVariablesAndContainers", "(", ")", ";", "if", "(", "VERBOSE", ")", "traceVariableAndContainers", "(", "\"Loaded\"", ",", "start", ")", ";", "this", ".", "deltaState", ".", "initializeRootsWithPreviousSession", "(", ")", ";", "final", "IWorkspace", "workspace", "=", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ";", "workspace", ".", "addResourceChangeListener", "(", "this", ".", "deltaState", ",", "IResourceChangeEvent", ".", "PRE_BUILD", "|", "IResourceChangeEvent", ".", "POST_BUILD", "|", "IResourceChangeEvent", ".", "POST_CHANGE", "|", "IResourceChangeEvent", ".", "PRE_DELETE", "|", "IResourceChangeEvent", ".", "PRE_CLOSE", "|", "IResourceChangeEvent", ".", "PRE_REFRESH", ")", ";", "startIndexing", "(", ")", ";", "Job", "processSavedState", "=", "new", "Job", "(", "Messages", ".", "savedState_jobName", ")", "{", "protected", "IStatus", "run", "(", "IProgressMonitor", "monitor", ")", "{", "try", "{", "workspace", ".", "run", "(", "new", "IWorkspaceRunnable", "(", ")", "{", "public", "void", "run", "(", "IProgressMonitor", "progress", ")", "throws", "CoreException", "{", "ISavedState", "savedState", "=", "workspace", ".", "addSaveParticipant", "(", "JavaCore", ".", "PLUGIN_ID", ",", "JavaModelManager", ".", "this", ")", ";", "if", "(", "savedState", "!=", "null", ")", "{", "JavaModelManager", ".", "this", ".", "deltaState", ".", "getDeltaProcessor", "(", ")", ".", "overridenEventType", "=", "IResourceChangeEvent", ".", "POST_CHANGE", ";", "savedState", ".", "processResourceChangeEvents", "(", "JavaModelManager", ".", "this", ".", "deltaState", ")", ";", "}", "}", "}", ",", "monitor", ")", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "return", "e", ".", "getStatus", "(", ")", ";", "}", "return", "Status", ".", "OK_STATUS", ";", "}", "}", ";", "processSavedState", ".", "setSystem", "(", "true", ")", ";", "processSavedState", ".", "setPriority", "(", "Job", ".", "SHORT", ")", ";", "processSavedState", ".", "schedule", "(", ")", ";", "}", "catch", "(", "RuntimeException", "e", ")", "{", "shutdown", "(", ")", ";", "throw", "e", ";", "}", "}", "private", "void", "startIndexing", "(", ")", "{", "if", "(", "this", ".", "indexManager", "!=", "null", ")", "this", ".", "indexManager", ".", "reset", "(", ")", ";", "}", "public", "void", "shutdown", "(", ")", "{", "IEclipsePreferences", "preferences", "=", "new", "InstanceScope", "(", ")", ".", "getNode", "(", "JavaCore", ".", "PLUGIN_ID", ")", ";", "try", "{", "preferences", ".", "flush", "(", ")", ";", "}", "catch", "(", "BackingStoreException", "e", ")", "{", "Util", ".", "log", "(", "e", ",", "\"\"", ")", ";", "}", "IWorkspace", "workspace", "=", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ";", "workspace", ".", "removeResourceChangeListener", "(", "this", ".", "deltaState", ")", ";", "workspace", ".", "removeSaveParticipant", "(", "JavaCore", ".", "PLUGIN_ID", ")", ";", "Platform", ".", "getContentTypeManager", "(", ")", ".", "removeContentTypeChangeListener", "(", "this", ")", ";", "if", "(", "this", ".", "indexManager", "!=", "null", ")", "{", "this", ".", "indexManager", ".", "shutdown", "(", ")", ";", "}", "preferences", ".", "removePreferenceChangeListener", "(", "this", ".", "propertyListener", ")", ";", "(", "(", "IEclipsePreferences", ")", "this", ".", "preferencesLookup", "[", "PREF_DEFAULT", "]", ".", "parent", "(", ")", ")", ".", "removeNodeChangeListener", "(", "this", ".", "defaultNodeListener", ")", ";", "this", ".", "preferencesLookup", "[", "PREF_DEFAULT", "]", "=", "null", ";", "(", "(", "IEclipsePreferences", ")", "this", ".", "preferencesLookup", "[", "PREF_INSTANCE", "]", ".", "parent", "(", ")", ")", ".", "removeNodeChangeListener", "(", "this", ".", "instanceNodeListener", ")", ";", "this", ".", "preferencesLookup", "[", "PREF_INSTANCE", "]", ".", "removePreferenceChangeListener", "(", "this", ".", "instancePreferencesListener", ")", ";", "this", ".", "preferencesLookup", "[", "PREF_INSTANCE", "]", "=", "null", ";", "String", "resourcesPluginId", "=", "ResourcesPlugin", ".", "getPlugin", "(", ")", ".", "getBundle", "(", ")", ".", "getSymbolicName", "(", ")", ";", "new", "InstanceScope", "(", ")", ".", "getNode", "(", "resourcesPluginId", ")", ".", "removePreferenceChangeListener", "(", "this", ".", "resourcesPropertyListener", ")", ";", "try", "{", "Job", ".", "getJobManager", "(", ")", ".", "join", "(", "JavaCore", ".", "PLUGIN_ID", ",", "null", ")", ";", "}", "catch", "(", "InterruptedException", "e", ")", "{", "}", "}", "public", "synchronized", "IPath", "variableGet", "(", "String", "variableName", ")", "{", "HashSet", "initializations", "=", "variableInitializationInProgress", "(", ")", ";", "if", "(", "initializations", ".", "contains", "(", "variableName", ")", ")", "{", "return", "VARIABLE_INITIALIZATION_IN_PROGRESS", ";", "}", "return", "(", "IPath", ")", "this", ".", "variables", ".", "get", "(", "variableName", ")", ";", "}", "private", "synchronized", "IPath", "variableGetDefaultToPreviousSession", "(", "String", "variableName", ")", "{", "IPath", "variablePath", "=", "(", "IPath", ")", "this", ".", "variables", ".", "get", "(", "variableName", ")", ";", "if", "(", "variablePath", "==", "null", ")", "return", "getPreviousSessionVariable", "(", "variableName", ")", ";", "return", "variablePath", ";", "}", "private", "HashSet", "variableInitializationInProgress", "(", ")", "{", "HashSet", "initializations", "=", "(", "HashSet", ")", "this", ".", "variableInitializationInProgress", ".", "get", "(", ")", ";", "if", "(", "initializations", "==", "null", ")", "{", "initializations", "=", "new", "HashSet", "(", ")", ";", "this", ".", "variableInitializationInProgress", ".", "set", "(", "initializations", ")", ";", "}", "return", "initializations", ";", "}", "public", "synchronized", "String", "[", "]", "variableNames", "(", ")", "{", "int", "length", "=", "this", ".", "variables", ".", "size", "(", ")", ";", "String", "[", "]", "result", "=", "new", "String", "[", "length", "]", ";", "Iterator", "vars", "=", "this", ".", "variables", ".", "keySet", "(", ")", ".", "iterator", "(", ")", ";", "int", "index", "=", "0", ";", "while", "(", "vars", ".", "hasNext", "(", ")", ")", "{", "result", "[", "index", "++", "]", "=", "(", "String", ")", "vars", ".", "next", "(", ")", ";", "}", "return", "result", ";", "}", "public", "synchronized", "void", "variablePut", "(", "String", "variableName", ",", "IPath", "variablePath", ")", "{", "HashSet", "initializations", "=", "variableInitializationInProgress", "(", ")", ";", "if", "(", "variablePath", "==", "VARIABLE_INITIALIZATION_IN_PROGRESS", ")", "{", "initializations", ".", "add", "(", "variableName", ")", ";", "return", ";", "}", "else", "{", "initializations", ".", "remove", "(", "variableName", ")", ";", "if", "(", "variablePath", "==", "null", ")", "{", "this", ".", "variables", ".", "put", "(", "variableName", ",", "CP_ENTRY_IGNORE_PATH", ")", ";", "this", ".", "variablesWithInitializer", ".", "remove", "(", "variableName", ")", ";", "this", ".", "deprecatedVariables", ".", "remove", "(", "variableName", ")", ";", "}", "else", "{", "this", ".", "variables", ".", "put", "(", "variableName", ",", "variablePath", ")", ";", "}", "this", ".", "previousSessionVariables", ".", "remove", "(", "variableName", ")", ";", "}", "}", "public", "void", "variablePreferencesPut", "(", "String", "variableName", ",", "IPath", "variablePath", ")", "{", "String", "variableKey", "=", "CP_VARIABLE_PREFERENCES_PREFIX", "+", "variableName", ";", "if", "(", "variablePath", "==", "null", ")", "{", "getInstancePreferences", "(", ")", ".", "remove", "(", "variableKey", ")", ";", "}", "else", "{", "getInstancePreferences", "(", ")", ".", "put", "(", "variableKey", ",", "variablePath", ".", "toString", "(", ")", ")", ";", "}", "try", "{", "getInstancePreferences", "(", ")", ".", "flush", "(", ")", ";", "}", "catch", "(", "BackingStoreException", "e", ")", "{", "}", "}", "public", "boolean", "variablePutIfInitializingWithSameValue", "(", "String", "[", "]", "variableNames", ",", "IPath", "[", "]", "variablePaths", ")", "{", "if", "(", "variableNames", ".", "length", "!=", "1", ")", "return", "false", ";", "String", "variableName", "=", "variableNames", "[", "0", "]", ";", "IPath", "oldPath", "=", "variableGetDefaultToPreviousSession", "(", "variableName", ")", ";", "if", "(", "oldPath", "==", "null", ")", "return", "false", ";", "IPath", "newPath", "=", "variablePaths", "[", "0", "]", ";", "if", "(", "!", "oldPath", ".", "equals", "(", "newPath", ")", ")", "return", "false", ";", "variablePut", "(", "variableName", ",", "newPath", ")", ";", "return", "true", ";", "}", "public", "void", "contentTypeChanged", "(", "ContentTypeChangeEvent", "event", ")", "{", "Util", ".", "resetJavaLikeExtensions", "(", ")", ";", "IJavaProject", "[", "]", "projects", ";", "try", "{", "projects", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "getJavaModel", "(", ")", ".", "getJavaProjects", "(", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "return", ";", "}", "for", "(", "int", "i", "=", "0", ",", "length", "=", "projects", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IJavaProject", "project", "=", "projects", "[", "i", "]", ";", "final", "PerProjectInfo", "projectInfo", "=", "getPerProjectInfo", "(", "project", ".", "getProject", "(", ")", ",", "false", ")", ";", "if", "(", "projectInfo", "!=", "null", ")", "{", "projectInfo", ".", "secondaryTypes", "=", "null", ";", "}", "}", "}", "public", "synchronized", "String", "cacheToString", "(", "String", "prefix", ")", "{", "return", "this", ".", "cache", ".", "toStringFillingRation", "(", "prefix", ")", ";", "}", "public", "Stats", "debugNewOpenableCacheStats", "(", ")", "{", "return", "this", ".", "cache", ".", "openableCache", ".", "new", "Stats", "(", ")", ";", "}", "public", "int", "getOpenableCacheSize", "(", ")", "{", "return", "this", ".", "cache", ".", "openableCache", ".", "getSpaceLimit", "(", ")", ";", "}", "}", "</s>" ]
5,298
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "eval", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "eval", ".", "IGlobalVariable", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "eval", ".", "GlobalVariable", ";", "class", "GlobalVariableWrapper", "implements", "IGlobalVariable", "{", "GlobalVariable", "variable", ";", "GlobalVariableWrapper", "(", "GlobalVariable", "variable", ")", "{", "this", ".", "variable", "=", "variable", ";", "}", "public", "String", "getInitializer", "(", ")", "{", "char", "[", "]", "initializer", "=", "this", ".", "variable", ".", "getInitializer", "(", ")", ";", "if", "(", "initializer", "!=", "null", ")", "{", "return", "new", "String", "(", "initializer", ")", ";", "}", "else", "{", "return", "null", ";", "}", "}", "public", "String", "getName", "(", ")", "{", "return", "new", "String", "(", "this", ".", "variable", ".", "getName", "(", ")", ")", ";", "}", "public", "String", "getTypeName", "(", ")", "{", "return", "new", "String", "(", "this", ".", "variable", ".", "getTypeName", "(", ")", ")", ";", "}", "}", "</s>" ]
5,299
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "eval", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IMarker", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "ResourcesPlugin", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaModelMarker", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CategorizedProblem", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "eval", ".", "ICodeSnippetRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ClassFile", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "builder", ".", "JavaBuilder", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "eval", ".", "IRequestor", ";", "public", "class", "RequestorWrapper", "implements", "IRequestor", "{", "ICodeSnippetRequestor", "requestor", ";", "public", "RequestorWrapper", "(", "ICodeSnippetRequestor", "requestor", ")", "{", "this", ".", "requestor", "=", "requestor", ";", "}", "public", "boolean", "acceptClassFiles", "(", "ClassFile", "[", "]", "classFiles", ",", "char", "[", "]", "codeSnippetClassName", ")", "{", "int", "length", "=", "classFiles", ".", "length", ";", "byte", "[", "]", "[", "]", "classFileBytes", "=", "new", "byte", "[", "length", "]", "[", "]", ";", "String", "[", "]", "[", "]", "compoundNames", "=", "new", "String", "[", "length", "]", "[", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "ClassFile", "classFile", "=", "classFiles", "[", "i", "]", ";", "classFileBytes", "[", "i", "]", "=", "classFile", ".", "getBytes", "(", ")", ";", "char", "[", "]", "[", "]", "classFileCompundName", "=", "classFile", ".", "getCompoundName", "(", ")", ";", "int", "length2", "=", "classFileCompundName", ".", "length", ";", "String", "[", "]", "compoundName", "=", "new", "String", "[", "length2", "]", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "length2", ";", "j", "++", ")", "{", "compoundName", "[", "j", "]", "=", "new", "String", "(", "classFileCompundName", "[", "j", "]", ")", ";", "}", "compoundNames", "[", "i", "]", "=", "compoundName", ";", "}", "return", "this", ".", "requestor", ".", "acceptClassFiles", "(", "classFileBytes", ",", "compoundNames", ",", "codeSnippetClassName", "==", "null", "?", "null", ":", "new", "String", "(", "codeSnippetClassName", ")", ")", ";", "}", "public", "void", "acceptProblem", "(", "CategorizedProblem", "problem", ",", "char", "[", "]", "fragmentSource", ",", "int", "fragmentKind", ")", "{", "try", "{", "IMarker", "marker", "=", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ".", "createMarker", "(", "IJavaModelMarker", ".", "TRANSIENT_PROBLEM", ")", ";", "marker", ".", "setAttribute", "(", "IJavaModelMarker", ".", "ID", ",", "problem", ".", "getID", "(", ")", ")", ";", "marker", ".", "setAttribute", "(", "IMarker", ".", "CHAR_START", ",", "problem", ".", "getSourceStart", "(", ")", ")", ";", "marker", ".", "setAttribute", "(", "IMarker", ".", "CHAR_END", ",", "problem", ".", "getSourceEnd", "(", ")", "+", "1", ")", ";", "marker", ".", "setAttribute", "(", "IMarker", ".", "LINE_NUMBER", ",", "problem", ".", "getSourceLineNumber", "(", ")", ")", ";", "marker", ".", "setAttribute", "(", "IMarker", ".", "MESSAGE", ",", "problem", ".", "getMessage", "(", ")", ")", ";", "marker", ".", "setAttribute", "(", "IMarker", ".", "SEVERITY", ",", "(", "problem", ".", "isWarning", "(", ")", "?", "IMarker", ".", "SEVERITY_WARNING", ":", "IMarker", ".", "SEVERITY_ERROR", ")", ")", ";", "marker", ".", "setAttribute", "(", "IMarker", ".", "SOURCE_ID", ",", "JavaBuilder", ".", "SOURCE_ID", ")", ";", "this", ".", "requestor", ".", "acceptProblem", "(", "marker", ",", "new", "String", "(", "fragmentSource", ")", ",", "fragmentKind", ")", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "}", "}", "}", "</s>" ]