id
int32
0
12.9k
code
sequencelengths
2
264k
3,600
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "IMethodInfo", "{", "char", "[", "]", "getDescriptor", "(", ")", ";", "int", "getDescriptorIndex", "(", ")", ";", "int", "getAccessFlags", "(", ")", ";", "char", "[", "]", "getName", "(", ")", ";", "int", "getNameIndex", "(", ")", ";", "boolean", "isClinit", "(", ")", ";", "boolean", "isConstructor", "(", ")", ";", "boolean", "isSynthetic", "(", ")", ";", "boolean", "isDeprecated", "(", ")", ";", "ICodeAttribute", "getCodeAttribute", "(", ")", ";", "IExceptionAttribute", "getExceptionAttribute", "(", ")", ";", "int", "getAttributeCount", "(", ")", ";", "IClassFileAttribute", "[", "]", "getAttributes", "(", ")", ";", "}", "</s>" ]
3,601
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "util", ".", "Enumeration", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "LinkedHashSet", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "java", ".", "util", ".", "PropertyResourceBundle", ";", "import", "java", ".", "util", ".", "Set", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IFile", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IFolder", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IProject", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IClasspathEntry", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "impl", ".", "CompilerOptions", ";", "public", "class", "CompilerUtils", "{", "public", "static", "final", "int", "IsGrails", "=", "0x0001", ";", "public", "static", "void", "configureOptionsBasedOnNature", "(", "CompilerOptions", "compilerOptions", ",", "IJavaProject", "javaProject", ")", "{", "if", "(", "javaProject", "==", "null", ")", "{", "compilerOptions", ".", "buildGroovyFiles", "=", "1", ";", "compilerOptions", ".", "groovyFlags", "=", "0", ";", "return", ";", "}", "IProject", "project", "=", "javaProject", ".", "getProject", "(", ")", ";", "try", "{", "if", "(", "isGroovyNaturedProject", "(", "project", ")", ")", "{", "compilerOptions", ".", "storeAnnotations", "=", "true", ";", "compilerOptions", ".", "buildGroovyFiles", "=", "2", ";", "setGroovyClasspath", "(", "compilerOptions", ",", "javaProject", ")", ";", "if", "(", "isProbablyGrailsProject", "(", "project", ")", ")", "{", "compilerOptions", ".", "groovyFlags", "=", "IsGrails", ";", "}", "else", "{", "compilerOptions", ".", "groovyFlags", "=", "0", ";", "}", "}", "else", "{", "compilerOptions", ".", "buildGroovyFiles", "=", "1", ";", "compilerOptions", ".", "groovyFlags", "=", "0", ";", "}", "}", "catch", "(", "CoreException", "e", ")", "{", "compilerOptions", ".", "buildGroovyFiles", "=", "1", ";", "compilerOptions", ".", "groovyFlags", "=", "0", ";", "}", "}", "public", "static", "void", "configureOptionsBasedOnNature", "(", "Map", "optionMap", ",", "IJavaProject", "javaProject", ")", "{", "IProject", "project", "=", "javaProject", ".", "getProject", "(", ")", ";", "try", "{", "if", "(", "isGroovyNaturedProject", "(", "project", ")", ")", "{", "optionMap", ".", "put", "(", "CompilerOptions", ".", "OPTIONG_BuildGroovyFiles", ",", "CompilerOptions", ".", "ENABLED", ")", ";", "setGroovyClasspath", "(", "optionMap", ",", "javaProject", ")", ";", "if", "(", "isProbablyGrailsProject", "(", "project", ")", ")", "{", "optionMap", ".", "put", "(", "CompilerOptions", ".", "OPTIONG_GroovyFlags", ",", "Integer", ".", "toString", "(", "IsGrails", ")", ")", ";", "}", "else", "{", "optionMap", ".", "put", "(", "CompilerOptions", ".", "OPTIONG_GroovyFlags", ",", "\"0\"", ")", ";", "}", "}", "else", "{", "optionMap", ".", "put", "(", "CompilerOptions", ".", "OPTIONG_BuildGroovyFiles", ",", "CompilerOptions", ".", "DISABLED", ")", ";", "optionMap", ".", "put", "(", "CompilerOptions", ".", "OPTIONG_GroovyFlags", ",", "\"0\"", ")", ";", "}", "}", "catch", "(", "CoreException", "e", ")", "{", "e", ".", "printStackTrace", "(", ")", ";", "optionMap", ".", "put", "(", "CompilerOptions", ".", "OPTIONG_BuildGroovyFiles", ",", "CompilerOptions", ".", "DISABLED", ")", ";", "optionMap", ".", "put", "(", "CompilerOptions", ".", "OPTIONG_GroovyFlags", ",", "\"0\"", ")", ";", "}", "}", "private", "static", "boolean", "isProbablyGrailsProject", "(", "IProject", "project", ")", "{", "try", "{", "IFolder", "folder", "=", "project", ".", "getFolder", "(", "\"grails-app\"", ")", ";", "return", "folder", ".", "exists", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "return", "false", ";", "}", "}", "public", "static", "void", "setGroovyClasspath", "(", "CompilerOptions", "compilerOptions", ",", "IJavaProject", "javaProject", ")", "{", "Map", "newOptions", "=", "new", "HashMap", "(", ")", ";", "setGroovyClasspath", "(", "newOptions", ",", "javaProject", ")", ";", "compilerOptions", ".", "groovyProjectName", "=", "javaProject", ".", "getProject", "(", ")", ".", "getName", "(", ")", ";", "if", "(", "!", "newOptions", ".", "isEmpty", "(", ")", ")", "{", "compilerOptions", ".", "set", "(", "newOptions", ")", ";", "}", "}", "public", "static", "void", "setGroovyClasspath", "(", "Map", "optionMap", ",", "IJavaProject", "javaProject", ")", "{", "IFile", "file", "=", "javaProject", ".", "getProject", "(", ")", ".", "getFile", "(", "\"\"", ")", ";", "if", "(", "file", ".", "exists", "(", ")", ")", "{", "try", "{", "PropertyResourceBundle", "prb", "=", "new", "PropertyResourceBundle", "(", "file", ".", "getContents", "(", ")", ")", ";", "Enumeration", "e", "=", "prb", ".", "getKeys", "(", ")", ";", "while", "(", "e", ".", "hasMoreElements", "(", ")", ")", "{", "String", "k", "=", "(", "String", ")", "e", ".", "nextElement", "(", ")", ";", "String", "v", "=", "(", "String", ")", "prb", ".", "getObject", "(", "k", ")", ";", "v", "=", "fixup", "(", "v", ",", "javaProject", ")", ";", "if", "(", "k", ".", "equals", "(", "CompilerOptions", ".", "OPTIONG_GroovyClassLoaderPath", ")", ")", "{", "optionMap", ".", "put", "(", "CompilerOptions", ".", "OPTIONG_GroovyClassLoaderPath", ",", "v", ")", ";", "}", "}", "}", "catch", "(", "IOException", "ioe", ")", "{", "System", ".", "err", ".", "println", "(", "\"\"", ")", ";", "ioe", ".", "printStackTrace", "(", ")", ";", "}", "catch", "(", "CoreException", "ce", ")", "{", "System", ".", "err", ".", "println", "(", "\"\"", ")", ";", "ce", ".", "printStackTrace", "(", ")", ";", "}", "catch", "(", "Throwable", "t", ")", "{", "System", ".", "err", ".", "println", "(", "\"\"", ")", ";", "t", ".", "printStackTrace", "(", ")", ";", "}", "}", "else", "{", "try", "{", "String", "classpath", "=", "calculateClasspath", "(", "javaProject", ")", ";", "optionMap", ".", "put", "(", "CompilerOptions", ".", "OPTIONG_GroovyClassLoaderPath", ",", "classpath", ")", ";", "}", "catch", "(", "Throwable", "t", ")", "{", "System", ".", "err", ".", "println", "(", "\"\"", ")", ";", "t", ".", "printStackTrace", "(", ")", ";", "}", "}", "optionMap", ".", "put", "(", "CompilerOptions", ".", "OPTIONG_GroovyProjectName", ",", "javaProject", ".", "getProject", "(", ")", ".", "getName", "(", ")", ")", ";", "}", "private", "static", "String", "fixup", "(", "String", "someString", ",", "IJavaProject", "javaProject", ")", "{", "if", "(", "someString", ".", "startsWith", "(", "\"%projhome%\"", ")", ")", "{", "someString", "=", "javaProject", ".", "getProject", "(", ")", ".", "getLocation", "(", ")", ".", "toOSString", "(", ")", "+", "File", ".", "separator", "+", "someString", ".", "substring", "(", "\"%projhome%\"", ".", "length", "(", ")", ")", ";", "}", "if", "(", "someString", ".", "equals", "(", "\"\"", ")", ")", "{", "someString", "=", "calculateClasspath", "(", "javaProject", ")", ";", "}", "return", "someString", ";", "}", "private", "static", "boolean", "isGroovyNaturedProject", "(", "IProject", "project", ")", "throws", "CoreException", "{", "return", "project", ".", "hasNature", "(", "\"\"", ")", ";", "}", "private", "static", "String", "pathToString", "(", "IPath", "path", ",", "IProject", "project", ")", "{", "String", "realLocation", "=", "null", ";", "if", "(", "path", "!=", "null", ")", "{", "String", "prefix", "=", "path", ".", "segment", "(", "0", ")", ";", "if", "(", "prefix", ".", "equals", "(", "project", ".", "getName", "(", ")", ")", ")", "{", "if", "(", "path", ".", "segmentCount", "(", ")", "==", "1", ")", "{", "IPath", "rawPath", "=", "project", ".", "getRawLocation", "(", ")", ";", "if", "(", "rawPath", "==", "null", ")", "{", "System", ".", "err", ".", "println", "(", "\"\"", "+", "project", ")", ";", "}", "else", "{", "realLocation", "=", "project", ".", "getRawLocation", "(", ")", ".", "toOSString", "(", ")", ";", "}", "}", "else", "{", "IPath", "rawLocation", "=", "project", ".", "getFile", "(", "path", ".", "removeFirstSegments", "(", "1", ")", ")", ".", "getRawLocation", "(", ")", ";", "if", "(", "rawLocation", "!=", "null", ")", "{", "realLocation", "=", "rawLocation", ".", "toOSString", "(", ")", ";", "}", "}", "}", "else", "{", "realLocation", "=", "path", ".", "toOSString", "(", ")", ";", "}", "}", "return", "realLocation", ";", "}", "public", "static", "String", "calculateClasspath", "(", "IJavaProject", "javaProject", ")", "{", "try", "{", "Set", "accumulatedPathEntries", "=", "new", "LinkedHashSet", "(", ")", ";", "IProject", "project", "=", "javaProject", ".", "getProject", "(", ")", ";", "String", "projectName", "=", "project", ".", "getName", "(", ")", ";", "IPath", "defaultOutputPath", "=", "javaProject", ".", "getOutputLocation", "(", ")", ";", "String", "defaultOutputLocation", "=", "pathToString", "(", "defaultOutputPath", ",", "project", ")", ";", "IClasspathEntry", "[", "]", "cpes", "=", "javaProject", ".", "getResolvedClasspath", "(", "true", ")", ";", "if", "(", "cpes", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ",", "max", "=", "cpes", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "IClasspathEntry", "cpe", "=", "cpes", "[", "i", "]", ";", "if", "(", "cpe", ".", "getEntryKind", "(", ")", "==", "IClasspathEntry", ".", "CPE_SOURCE", ")", "{", "continue", ";", "}", "IPath", "cpePath", "=", "cpe", ".", "getPath", "(", ")", ";", "String", "pathElement", "=", "null", ";", "String", "segmentZero", "=", "cpePath", ".", "segment", "(", "0", ")", ";", "if", "(", "segmentZero", ".", "equals", "(", "projectName", ")", ")", "{", "pathElement", "=", "project", ".", "getFile", "(", "cpePath", ".", "removeFirstSegments", "(", "1", ")", ")", ".", "getRawLocation", "(", ")", ".", "toOSString", "(", ")", ";", "}", "else", "{", "if", "(", "cpe", ".", "getEntryKind", "(", ")", "==", "IClasspathEntry", ".", "CPE_LIBRARY", ")", "{", "try", "{", "IProject", "iproject", "=", "project", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ".", "getProject", "(", "segmentZero", ")", ";", "if", "(", "iproject", "!=", "null", ")", "{", "IFile", "ifile", "=", "iproject", ".", "getFile", "(", "cpePath", ".", "removeFirstSegments", "(", "1", ")", ")", ";", "IPath", "ipath", "=", "(", "ifile", "==", "null", "?", "null", ":", "ifile", ".", "getRawLocation", "(", ")", ")", ";", "pathElement", "=", "(", "ipath", "==", "null", "?", "null", ":", "ipath", ".", "toOSString", "(", ")", ")", ";", "}", "}", "catch", "(", "Throwable", "t", ")", "{", "t", ".", "printStackTrace", "(", ")", ";", "}", "}", "if", "(", "cpe", ".", "getEntryKind", "(", ")", "==", "IClasspathEntry", ".", "CPE_PROJECT", ")", "{", "computeDependenciesFromProject", "(", "project", ",", "segmentZero", ",", "accumulatedPathEntries", ")", ";", "}", "else", "{", "if", "(", "pathElement", "==", "null", ")", "{", "pathElement", "=", "cpe", ".", "getPath", "(", ")", ".", "toOSString", "(", ")", ";", "}", "}", "}", "if", "(", "pathElement", "!=", "null", ")", "{", "accumulatedPathEntries", ".", "add", "(", "pathElement", ")", ";", "}", "}", "accumulatedPathEntries", ".", "add", "(", "defaultOutputLocation", ")", ";", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "Iterator", "iter", "=", "accumulatedPathEntries", ".", "iterator", "(", ")", ";", "while", "(", "iter", ".", "hasNext", "(", ")", ")", "{", "sb", ".", "append", "(", "(", "String", ")", "iter", ".", "next", "(", ")", ")", ";", "sb", ".", "append", "(", "File", ".", "pathSeparator", ")", ";", "}", "String", "classpath", "=", "sb", ".", "toString", "(", ")", ";", "return", "classpath", ";", "}", "}", "catch", "(", "JavaModelException", "jme", ")", "{", "System", ".", "err", ".", "println", "(", "\"\"", "+", "javaProject", ".", "getProject", "(", ")", ".", "getName", "(", ")", "+", "\":\"", ")", ";", "jme", ".", "printStackTrace", "(", ")", ";", "}", "return", "\"\"", ";", "}", "private", "static", "void", "computeDependenciesFromProject", "(", "IProject", "baseProject", ",", "String", "otherProject", ",", "Set", "accumulatedPathEntries", ")", "throws", "JavaModelException", "{", "IProject", "iproject", "=", "baseProject", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ".", "getProject", "(", "otherProject", ")", ";", "IJavaProject", "ijp", "=", "JavaCore", ".", "create", "(", "iproject", ")", ";", "accumulatedPathEntries", ".", "add", "(", "pathToString", "(", "ijp", ".", "getOutputLocation", "(", ")", ",", "iproject", ")", ")", ";", "IClasspathEntry", "[", "]", "cpes", "=", "ijp", ".", "getResolvedClasspath", "(", "true", ")", ";", "if", "(", "cpes", "!=", "null", ")", "{", "for", "(", "int", "j", "=", "0", ";", "j", "<", "cpes", ".", "length", ";", "j", "++", ")", "{", "IClasspathEntry", "cpe", "=", "cpes", "[", "j", "]", ";", "if", "(", "cpe", ".", "getEntryKind", "(", ")", "==", "IClasspathEntry", ".", "CPE_SOURCE", ")", "{", "continue", ";", "}", "if", "(", "cpe", ".", "isExported", "(", ")", ")", "{", "IPath", "cpePath", "=", "cpes", "[", "j", "]", ".", "getPath", "(", ")", ";", "String", "segmentZero", "=", "cpePath", ".", "segment", "(", "0", ")", ";", "if", "(", "segmentZero", "!=", "null", "&&", "segmentZero", ".", "equals", "(", "otherProject", ")", ")", "{", "accumulatedPathEntries", ".", "add", "(", "iproject", ".", "getFile", "(", "cpePath", ".", "removeFirstSegments", "(", "1", ")", ")", ".", "getRawLocation", "(", ")", ".", "toOSString", "(", ")", ")", ";", "}", "else", "{", "if", "(", "cpe", ".", "getEntryKind", "(", ")", "==", "IClasspathEntry", ".", "CPE_PROJECT", ")", "{", "computeDependenciesFromProject", "(", "baseProject", ",", "segmentZero", ",", "accumulatedPathEntries", ")", ";", "}", "else", "{", "String", "otherPathElement", "=", "null", ";", "if", "(", "segmentZero", "!=", "null", "&&", "segmentZero", ".", "equals", "(", "iproject", ".", "getName", "(", ")", ")", ")", "{", "otherPathElement", "=", "iproject", ".", "getFile", "(", "cpePath", ".", "removeFirstSegments", "(", "1", ")", ")", ".", "getRawLocation", "(", ")", ".", "toOSString", "(", ")", ";", "}", "else", "{", "otherPathElement", "=", "cpePath", ".", "toOSString", "(", ")", ";", "}", "accumulatedPathEntries", ".", "add", "(", "otherPathElement", ")", ";", "}", "}", "}", "}", "}", "}", "}", "</s>" ]
3,602
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "IClassFileDisassembler", "{", "int", "DETAILED", "=", "1", ";", "int", "DEFAULT", "=", "2", ";", "String", "disassemble", "(", "IClassFileReader", "classFileReader", ",", "String", "lineSeparator", ")", ";", "String", "disassemble", "(", "IClassFileReader", "classFileReader", ",", "String", "lineSeparator", ",", "int", "mode", ")", ";", "}", "</s>" ]
3,603
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "IVerificationTypeInfo", "{", "public", "static", "final", "int", "ITEM_TOP", "=", "0", ";", "public", "static", "final", "int", "ITEM_INTEGER", "=", "1", ";", "public", "static", "final", "int", "ITEM_FLOAT", "=", "2", ";", "public", "static", "final", "int", "ITEM_DOUBLE", "=", "3", ";", "public", "static", "final", "int", "ITEM_LONG", "=", "4", ";", "public", "static", "final", "int", "ITEM_NULL", "=", "5", ";", "public", "static", "final", "int", "ITEM_UNINITIALIZED_THIS", "=", "6", ";", "public", "static", "final", "int", "ITEM_OBJECT", "=", "7", ";", "public", "static", "final", "int", "ITEM_UNINITIALIZED", "=", "8", ";", "int", "getTag", "(", ")", ";", "int", "getOffset", "(", ")", ";", "int", "getConstantPoolIndex", "(", ")", ";", "char", "[", "]", "getClassTypeName", "(", ")", ";", "}", "</s>" ]
3,604
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "IRuntimeInvisibleAnnotationsAttribute", "extends", "IClassFileAttribute", "{", "int", "getAnnotationsNumber", "(", ")", ";", "IAnnotation", "[", "]", "getAnnotations", "(", ")", ";", "}", "</s>" ]
3,605
[ "<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>" ]
3,606
[ "<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>" ]
3,607
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "IClassFileAttribute", "{", "int", "getAttributeNameIndex", "(", ")", ";", "char", "[", "]", "getAttributeName", "(", ")", ";", "long", "getAttributeLength", "(", ")", ";", "}", "</s>" ]
3,608
[ "<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>" ]
3,609
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ";", "public", "interface", "IExceptionTableEntry", "{", "int", "getStartPC", "(", ")", ";", "int", "getEndPC", "(", ")", ";", "int", "getHandlerPC", "(", ")", ";", "int", "getCatchTypeIndex", "(", ")", ";", "char", "[", "]", "getCatchType", "(", ")", ";", "}", "</s>" ]
3,610
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "import", "java", ".", "util", ".", "Hashtable", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "impl", ".", "CompilerOptions", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "problem", ".", "ProblemReporter", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Messages", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "CorrectionEngine", "{", "protected", "int", "correctionStart", ";", "protected", "int", "correctionEnd", ";", "protected", "int", "prefixLength", ";", "protected", "ICompilationUnit", "compilationUnit", ";", "protected", "ICorrectionRequestor", "correctionRequestor", ";", "protected", "static", "final", "int", "CLASSES", "=", "0x00000001", ";", "protected", "static", "final", "int", "INTERFACES", "=", "0x00000002", ";", "protected", "static", "final", "int", "IMPORT", "=", "0x00000004", ";", "protected", "static", "final", "int", "METHOD", "=", "0x00000008", ";", "protected", "static", "final", "int", "FIELD", "=", "0x00000010", ";", "protected", "static", "final", "int", "LOCAL", "=", "0x00000020", ";", "protected", "int", "filter", ";", "public", "CorrectionEngine", "(", "Map", "setting", ")", "{", "}", "public", "void", "computeCorrections", "(", "IMarker", "marker", ",", "ICompilationUnit", "targetUnit", ",", "int", "positionOffset", ",", "ICorrectionRequestor", "requestor", ")", "throws", "JavaModelException", "{", "IJavaElement", "element", "=", "targetUnit", "==", "null", "?", "JavaCore", ".", "create", "(", "marker", ".", "getResource", "(", ")", ")", ":", "targetUnit", ";", "if", "(", "!", "(", "element", "instanceof", "ICompilationUnit", ")", ")", "return", ";", "ICompilationUnit", "unit", "=", "(", "ICompilationUnit", ")", "element", ";", "int", "id", "=", "marker", ".", "getAttribute", "(", "IJavaModelMarker", ".", "ID", ",", "-", "1", ")", ";", "String", "[", "]", "args", "=", "Util", ".", "getProblemArgumentsFromMarker", "(", "marker", ".", "getAttribute", "(", "IJavaModelMarker", ".", "ARGUMENTS", ",", "\"\"", ")", ")", ";", "int", "start", "=", "marker", ".", "getAttribute", "(", "IMarker", ".", "CHAR_START", ",", "-", "1", ")", ";", "int", "end", "=", "marker", ".", "getAttribute", "(", "IMarker", ".", "CHAR_END", ",", "-", "1", ")", ";", "computeCorrections", "(", "unit", ",", "id", ",", "start", "+", "positionOffset", ",", "end", "+", "positionOffset", ",", "args", ",", "requestor", ")", ";", "}", "public", "void", "computeCorrections", "(", "IProblem", "problem", ",", "ICompilationUnit", "targetUnit", ",", "ICorrectionRequestor", "requestor", ")", "throws", "JavaModelException", "{", "if", "(", "requestor", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "Messages", ".", "correction_nullUnit", ")", ";", "}", "this", ".", "computeCorrections", "(", "targetUnit", ",", "problem", ".", "getID", "(", ")", ",", "problem", ".", "getSourceStart", "(", ")", ",", "problem", ".", "getSourceEnd", "(", ")", ",", "problem", ".", "getArguments", "(", ")", ",", "requestor", ")", ";", "}", "private", "void", "computeCorrections", "(", "ICompilationUnit", "unit", ",", "int", "id", ",", "int", "start", ",", "int", "end", ",", "String", "[", "]", "arguments", ",", "ICorrectionRequestor", "requestor", ")", "{", "if", "(", "id", "==", "-", "1", "||", "arguments", "==", "null", "||", "start", "==", "-", "1", "||", "end", "==", "-", "1", ")", "return", ";", "if", "(", "requestor", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "Messages", ".", "correction_nullRequestor", ")", ";", "}", "this", ".", "correctionRequestor", "=", "requestor", ";", "this", ".", "correctionStart", "=", "start", ";", "this", ".", "correctionEnd", "=", "end", ";", "this", ".", "compilationUnit", "=", "unit", ";", "String", "argument", "=", "null", ";", "try", "{", "switch", "(", "id", ")", "{", "case", "IProblem", ".", "ImportNotFound", ":", "this", ".", "filter", "=", "IMPORT", ";", "argument", "=", "arguments", "[", "0", "]", ";", "break", ";", "case", "IProblem", ".", "UndefinedType", ":", "this", ".", "filter", "=", "CLASSES", "|", "INTERFACES", ";", "argument", "=", "arguments", "[", "0", "]", ";", "break", ";", "case", "IProblem", ".", "UndefinedMethod", ":", "this", ".", "filter", "=", "METHOD", ";", "argument", "=", "arguments", "[", "1", "]", ";", "break", ";", "case", "IProblem", ".", "UndefinedField", ":", "this", ".", "filter", "=", "FIELD", ";", "argument", "=", "arguments", "[", "0", "]", ";", "break", ";", "case", "IProblem", ".", "UndefinedName", ":", "case", "IProblem", ".", "UnresolvedVariable", ":", "this", ".", "filter", "=", "FIELD", "|", "LOCAL", ";", "argument", "=", "arguments", "[", "0", "]", ";", "break", ";", "}", "}", "catch", "(", "ArrayIndexOutOfBoundsException", "e", ")", "{", "return", ";", "}", "if", "(", "argument", "!=", "null", ")", "{", "correct", "(", "argument", ".", "toCharArray", "(", ")", ")", ";", "}", "}", "private", "void", "correct", "(", "char", "[", "]", "argument", ")", "{", "try", "{", "String", "source", "=", "this", ".", "compilationUnit", ".", "getSource", "(", ")", ";", "Map", "currentProjectOptions", "=", "this", ".", "compilationUnit", ".", "getJavaProject", "(", ")", ".", "getOptions", "(", "true", ")", ";", "long", "sourceLevel", "=", "CompilerOptions", ".", "versionToJdkLevel", "(", "currentProjectOptions", ".", "get", "(", "JavaCore", ".", "COMPILER_SOURCE", ")", ")", ";", "long", "complianceLevel", "=", "CompilerOptions", ".", "versionToJdkLevel", "(", "currentProjectOptions", ".", "get", "(", "JavaCore", ".", "COMPILER_COMPLIANCE", ")", ")", ";", "Scanner", "scanner", "=", "new", "Scanner", "(", "false", ",", "false", ",", "false", ",", "sourceLevel", ",", "complianceLevel", ",", "null", ",", "null", ",", "true", ")", ";", "scanner", ".", "setSource", "(", "source", ".", "toCharArray", "(", ")", ")", ";", "scanner", ".", "resetTo", "(", "this", ".", "correctionStart", ",", "this", ".", "correctionEnd", ")", ";", "int", "token", "=", "0", ";", "char", "[", "]", "argumentSource", "=", "CharOperation", ".", "NO_CHAR", ";", "while", "(", "true", ")", "{", "token", "=", "scanner", ".", "getNextToken", "(", ")", ";", "if", "(", "token", "==", "TerminalTokens", ".", "TokenNameEOF", ")", "return", ";", "char", "[", "]", "tokenSource", "=", "scanner", ".", "getCurrentTokenSource", "(", ")", ";", "argumentSource", "=", "CharOperation", ".", "concat", "(", "argumentSource", ",", "tokenSource", ")", ";", "if", "(", "!", "CharOperation", ".", "prefixEquals", "(", "argumentSource", ",", "argument", ")", ")", "return", ";", "if", "(", "CharOperation", ".", "equals", "(", "argument", ",", "argumentSource", ")", ")", "{", "this", ".", "correctionStart", "=", "scanner", ".", "startPosition", ";", "this", ".", "correctionEnd", "=", "scanner", ".", "currentPosition", ";", "this", ".", "prefixLength", "=", "CharOperation", ".", "lastIndexOf", "(", "'.'", ",", "argument", ")", "+", "1", ";", "break", ";", "}", "}", "int", "completionPosition", "=", "this", ".", "correctionStart", ";", "scanner", ".", "resetTo", "(", "completionPosition", ",", "this", ".", "correctionEnd", ")", ";", "int", "position", "=", "completionPosition", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "4", ";", "i", "++", ")", "{", "if", "(", "scanner", ".", "getNextCharAsJavaIdentifierPart", "(", ")", ")", "{", "completionPosition", "=", "position", ";", "position", "=", "scanner", ".", "currentPosition", ";", "}", "else", "{", "break", ";", "}", "}", "Hashtable", "oldOptions", "=", "JavaCore", ".", "getOptions", "(", ")", ";", "try", "{", "Hashtable", "options", "=", "new", "Hashtable", "(", "oldOptions", ")", ";", "options", ".", "put", "(", "JavaCore", ".", "CODEASSIST_CAMEL_CASE_MATCH", ",", "JavaCore", ".", "DISABLED", ")", ";", "JavaCore", ".", "setOptions", "(", "options", ")", ";", "this", ".", "compilationUnit", ".", "codeComplete", "(", "completionPosition", ",", "this", ".", "completionRequestor", ")", ";", "}", "finally", "{", "JavaCore", ".", "setOptions", "(", "oldOptions", ")", ";", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "return", ";", "}", "catch", "(", "InvalidInputException", "e", ")", "{", "return", ";", "}", "}", "protected", "CompletionRequestor", "completionRequestor", "=", "new", "CompletionRequestor", "(", ")", "{", "public", "void", "accept", "(", "CompletionProposal", "proposal", ")", "{", "switch", "(", "proposal", ".", "getKind", "(", ")", ")", "{", "case", "CompletionProposal", ".", "TYPE_REF", ":", "int", "flags", "=", "proposal", ".", "getFlags", "(", ")", ";", "if", "(", "!", "(", "Flags", ".", "isEnum", "(", "flags", ")", "||", "Flags", ".", "isAnnotation", "(", "flags", ")", ")", ")", "{", "if", "(", "(", "CorrectionEngine", ".", "this", ".", "filter", "&", "(", "CLASSES", "|", "INTERFACES", ")", ")", "!=", "0", ")", "{", "char", "[", "]", "completionName", "=", "proposal", ".", "getCompletion", "(", ")", ";", "CorrectionEngine", ".", "this", ".", "correctionRequestor", ".", "acceptClass", "(", "proposal", ".", "getDeclarationSignature", "(", ")", ",", "Signature", ".", "getSignatureSimpleName", "(", "proposal", ".", "getSignature", "(", ")", ")", ",", "CharOperation", ".", "subarray", "(", "completionName", ",", "CorrectionEngine", ".", "this", ".", "prefixLength", ",", "completionName", ".", "length", ")", ",", "proposal", ".", "getFlags", "(", ")", ",", "CorrectionEngine", ".", "this", ".", "correctionStart", ",", "CorrectionEngine", ".", "this", ".", "correctionEnd", ")", ";", "}", "else", "if", "(", "(", "CorrectionEngine", ".", "this", ".", "filter", "&", "IMPORT", ")", "!=", "0", ")", "{", "char", "[", "]", "packageName", "=", "proposal", ".", "getDeclarationSignature", "(", ")", ";", "char", "[", "]", "className", "=", "Signature", ".", "getSignatureSimpleName", "(", "proposal", ".", "getSignature", "(", ")", ")", ";", "char", "[", "]", "fullName", "=", "CharOperation", ".", "concat", "(", "packageName", ",", "className", ",", "'.'", ")", ";", "CorrectionEngine", ".", "this", ".", "correctionRequestor", ".", "acceptClass", "(", "packageName", ",", "className", ",", "CharOperation", ".", "subarray", "(", "fullName", ",", "CorrectionEngine", ".", "this", ".", "prefixLength", ",", "fullName", ".", "length", ")", ",", "proposal", ".", "getFlags", "(", ")", ",", "CorrectionEngine", ".", "this", ".", "correctionStart", ",", "CorrectionEngine", ".", "this", ".", "correctionEnd", ")", ";", "}", "}", "break", ";", "case", "CompletionProposal", ".", "FIELD_REF", ":", "if", "(", "(", "CorrectionEngine", ".", "this", ".", "filter", "&", "FIELD", ")", "!=", "0", ")", "{", "char", "[", "]", "declaringSignature", "=", "proposal", ".", "getDeclarationSignature", "(", ")", ";", "char", "[", "]", "signature", "=", "proposal", ".", "getSignature", "(", ")", ";", "CorrectionEngine", ".", "this", ".", "correctionRequestor", ".", "acceptField", "(", "Signature", ".", "getSignatureQualifier", "(", "declaringSignature", ")", ",", "Signature", ".", "getSignatureSimpleName", "(", "declaringSignature", ")", ",", "proposal", ".", "getName", "(", ")", ",", "Signature", ".", "getSignatureQualifier", "(", "signature", ")", ",", "Signature", ".", "getSignatureSimpleName", "(", "signature", ")", ",", "proposal", ".", "getName", "(", ")", ",", "proposal", ".", "getFlags", "(", ")", ",", "CorrectionEngine", ".", "this", ".", "correctionStart", ",", "CorrectionEngine", ".", "this", ".", "correctionEnd", ")", ";", "}", "break", ";", "case", "CompletionProposal", ".", "LOCAL_VARIABLE_REF", ":", "if", "(", "(", "CorrectionEngine", ".", "this", ".", "filter", "&", "LOCAL", ")", "!=", "0", ")", "{", "char", "[", "]", "signature", "=", "proposal", ".", "getSignature", "(", ")", ";", "CorrectionEngine", ".", "this", ".", "correctionRequestor", ".", "acceptLocalVariable", "(", "proposal", ".", "getName", "(", ")", ",", "Signature", ".", "getSignatureQualifier", "(", "signature", ")", ",", "Signature", ".", "getSignatureSimpleName", "(", "signature", ")", ",", "proposal", ".", "getFlags", "(", ")", ",", "CorrectionEngine", ".", "this", ".", "correctionStart", ",", "CorrectionEngine", ".", "this", ".", "correctionEnd", ")", ";", "}", "break", ";", "case", "CompletionProposal", ".", "METHOD_REF", ":", "if", "(", "(", "CorrectionEngine", ".", "this", ".", "filter", "&", "METHOD", ")", "!=", "0", ")", "{", "char", "[", "]", "declaringSignature", "=", "proposal", ".", "getDeclarationSignature", "(", ")", ";", "char", "[", "]", "signature", "=", "proposal", ".", "getSignature", "(", ")", ";", "char", "[", "]", "[", "]", "parameterTypeSignatures", "=", "Signature", ".", "getParameterTypes", "(", "signature", ")", ";", "int", "length", "=", "parameterTypeSignatures", ".", "length", ";", "char", "[", "]", "[", "]", "parameterPackageNames", "=", "new", "char", "[", "length", "]", "[", "]", ";", "char", "[", "]", "[", "]", "parameterTypeNames", "=", "new", "char", "[", "length", "]", "[", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "parameterPackageNames", "[", "i", "]", "=", "Signature", ".", "getSignatureQualifier", "(", "parameterTypeSignatures", "[", "i", "]", ")", ";", "parameterTypeNames", "[", "i", "]", "=", "Signature", ".", "getSignatureSimpleName", "(", "parameterTypeSignatures", "[", "i", "]", ")", ";", "}", "char", "[", "]", "returnTypeSignature", "=", "Signature", ".", "getReturnType", "(", "signature", ")", ";", "CorrectionEngine", ".", "this", ".", "correctionRequestor", ".", "acceptMethod", "(", "Signature", ".", "getSignatureQualifier", "(", "declaringSignature", ")", ",", "Signature", ".", "getSignatureSimpleName", "(", "declaringSignature", ")", ",", "proposal", ".", "getName", "(", ")", ",", "parameterPackageNames", ",", "parameterTypeNames", ",", "proposal", ".", "findParameterNames", "(", "null", ")", ",", "Signature", ".", "getSignatureQualifier", "(", "returnTypeSignature", ")", ",", "Signature", ".", "getSignatureSimpleName", "(", "returnTypeSignature", ")", ",", "proposal", ".", "getName", "(", ")", ",", "proposal", ".", "getFlags", "(", ")", ",", "CorrectionEngine", ".", "this", ".", "correctionStart", ",", "CorrectionEngine", ".", "this", ".", "correctionEnd", ")", ";", "}", "break", ";", "case", "CompletionProposal", ".", "PACKAGE_REF", ":", "if", "(", "(", "CorrectionEngine", ".", "this", ".", "filter", "&", "(", "CLASSES", "|", "INTERFACES", "|", "IMPORT", ")", ")", "!=", "0", ")", "{", "char", "[", "]", "packageName", "=", "proposal", ".", "getDeclarationSignature", "(", ")", ";", "CorrectionEngine", ".", "this", ".", "correctionRequestor", ".", "acceptPackage", "(", "packageName", ",", "CharOperation", ".", "subarray", "(", "packageName", ",", "CorrectionEngine", ".", "this", ".", "prefixLength", ",", "packageName", ".", "length", ")", ",", "CorrectionEngine", ".", "this", ".", "correctionStart", ",", "CorrectionEngine", ".", "this", ".", "correctionEnd", ")", ";", "}", "break", ";", "}", "}", "}", ";", "public", "static", "String", "[", "]", "getAllWarningTokens", "(", ")", "{", "return", "CompilerOptions", ".", "warningTokens", ";", "}", "public", "static", "String", "[", "]", "getProblemArguments", "(", "IMarker", "problemMarker", ")", "{", "String", "argumentsString", "=", "problemMarker", ".", "getAttribute", "(", "IJavaModelMarker", ".", "ARGUMENTS", ",", "null", ")", ";", "return", "Util", ".", "getProblemArgumentsFromMarker", "(", "argumentsString", ")", ";", "}", "public", "static", "String", "getWarningToken", "(", "int", "problemID", ")", "{", "int", "irritant", "=", "ProblemReporter", ".", "getIrritant", "(", "problemID", ")", ";", "if", "(", "irritant", "!=", "0", ")", "{", "return", "CompilerOptions", ".", "warningTokenFromIrritant", "(", "irritant", ")", ";", "}", "return", "null", ";", "}", "}", "</s>" ]
3,611
[ "<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>" ]
3,612
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "InputStream", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "java", ".", "util", ".", "zip", ".", "ZipEntry", ";", "import", "java", ".", "util", ".", "zip", ".", "ZipFile", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IFile", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "IScanner", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "ITerminalSymbols", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "formatter", ".", "CodeFormatter", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "formatter", ".", "DefaultCodeFormatterConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ".", "ClassFileBytesDisassembler", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ".", "ClassFormatException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ".", "IClassFileReader", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "impl", ".", "CompilerOptions", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "SuffixConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "JarPackageFragmentRoot", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "JavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "JavaModelManager", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "PackageFragment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "ClassFileReader", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Disassembler", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "PublicScanner", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ".", "DefaultCodeFormatter", ";", "public", "class", "ToolFactory", "{", "public", "static", "final", "int", "M_FORMAT_NEW", "=", "new", "Integer", "(", "0", ")", ".", "intValue", "(", ")", ";", "public", "static", "final", "int", "M_FORMAT_EXISTING", "=", "new", "Integer", "(", "1", ")", ".", "intValue", "(", ")", ";", "public", "static", "ICodeFormatter", "createCodeFormatter", "(", ")", "{", "Plugin", "jdtCorePlugin", "=", "JavaCore", ".", "getPlugin", "(", ")", ";", "if", "(", "jdtCorePlugin", "==", "null", ")", "return", "null", ";", "IExtensionPoint", "extension", "=", "jdtCorePlugin", ".", "getDescriptor", "(", ")", ".", "getExtensionPoint", "(", "JavaModelManager", ".", "FORMATTER_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", "++", ")", "{", "try", "{", "Object", "execExt", "=", "configElements", "[", "j", "]", ".", "createExecutableExtension", "(", "\"class\"", ")", ";", "if", "(", "execExt", "instanceof", "ICodeFormatter", ")", "{", "return", "(", "ICodeFormatter", ")", "execExt", ";", "}", "}", "catch", "(", "CoreException", "e", ")", "{", "}", "}", "}", "}", "return", "createDefaultCodeFormatter", "(", "null", ")", ";", "}", "public", "static", "CodeFormatter", "createCodeFormatter", "(", "Map", "options", ")", "{", "return", "createCodeFormatter", "(", "options", ",", "M_FORMAT_NEW", ")", ";", "}", "public", "static", "CodeFormatter", "createCodeFormatter", "(", "Map", "options", ",", "int", "mode", ")", "{", "if", "(", "options", "==", "null", ")", "options", "=", "JavaCore", ".", "getOptions", "(", ")", ";", "Map", "currentOptions", "=", "new", "HashMap", "(", "options", ")", ";", "if", "(", "mode", "==", "M_FORMAT_NEW", ")", "{", "currentOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_COMMENT_FORMAT_LINE_COMMENT_STARTING_ON_FIRST_COLUMN", ",", "DefaultCodeFormatterConstants", ".", "TRUE", ")", ";", "currentOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_NEVER_INDENT_BLOCK_COMMENTS_ON_FIRST_COLUMN", ",", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "currentOptions", ".", "put", "(", "DefaultCodeFormatterConstants", ".", "FORMATTER_NEVER_INDENT_LINE_COMMENTS_ON_FIRST_COLUMN", ",", "DefaultCodeFormatterConstants", ".", "FALSE", ")", ";", "}", "return", "new", "DefaultCodeFormatter", "(", "currentOptions", ")", ";", "}", "public", "static", "ClassFileBytesDisassembler", "createDefaultClassFileBytesDisassembler", "(", ")", "{", "return", "new", "Disassembler", "(", ")", ";", "}", "public", "static", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ".", "IClassFileDisassembler", "createDefaultClassFileDisassembler", "(", ")", "{", "class", "DeprecatedDisassembler", "extends", "Disassembler", "implements", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ".", "IClassFileDisassembler", "{", "}", "return", "new", "DeprecatedDisassembler", "(", ")", ";", "}", "public", "static", "IClassFileReader", "createDefaultClassFileReader", "(", "IClassFile", "classfile", ",", "int", "decodingFlag", ")", "{", "IPackageFragmentRoot", "root", "=", "(", "IPackageFragmentRoot", ")", "classfile", ".", "getAncestor", "(", "IJavaElement", ".", "PACKAGE_FRAGMENT_ROOT", ")", ";", "if", "(", "root", "!=", "null", ")", "{", "try", "{", "if", "(", "root", "instanceof", "JarPackageFragmentRoot", ")", "{", "String", "archiveName", "=", "null", ";", "ZipFile", "jar", "=", "null", ";", "try", "{", "jar", "=", "(", "(", "JarPackageFragmentRoot", ")", "root", ")", ".", "getJar", "(", ")", ";", "archiveName", "=", "jar", ".", "getName", "(", ")", ";", "}", "finally", "{", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "closeZipFile", "(", "jar", ")", ";", "}", "PackageFragment", "packageFragment", "=", "(", "PackageFragment", ")", "classfile", ".", "getParent", "(", ")", ";", "String", "classFileName", "=", "classfile", ".", "getElementName", "(", ")", ";", "String", "entryName", "=", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ".", "concatWith", "(", "packageFragment", ".", "names", ",", "classFileName", ",", "'/'", ")", ";", "return", "createDefaultClassFileReader", "(", "archiveName", ",", "entryName", ",", "decodingFlag", ")", ";", "}", "else", "{", "InputStream", "in", "=", "null", ";", "try", "{", "in", "=", "(", "(", "IFile", ")", "(", "(", "JavaElement", ")", "classfile", ")", ".", "resource", "(", ")", ")", ".", "getContents", "(", ")", ";", "return", "createDefaultClassFileReader", "(", "in", ",", "decodingFlag", ")", ";", "}", "finally", "{", "if", "(", "in", "!=", "null", ")", "try", "{", "in", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "}", "}", "}", "}", "catch", "(", "CoreException", "e", ")", "{", "}", "}", "return", "null", ";", "}", "public", "static", "IClassFileReader", "createDefaultClassFileReader", "(", "InputStream", "stream", ",", "int", "decodingFlag", ")", "{", "try", "{", "return", "new", "ClassFileReader", "(", "Util", ".", "getInputStreamAsByteArray", "(", "stream", ",", "-", "1", ")", ",", "decodingFlag", ")", ";", "}", "catch", "(", "ClassFormatException", "e", ")", "{", "return", "null", ";", "}", "catch", "(", "IOException", "e", ")", "{", "return", "null", ";", "}", "}", "public", "static", "IClassFileReader", "createDefaultClassFileReader", "(", "String", "fileName", ",", "int", "decodingFlag", ")", "{", "try", "{", "return", "new", "ClassFileReader", "(", "Util", ".", "getFileByteContent", "(", "new", "File", "(", "fileName", ")", ")", ",", "decodingFlag", ")", ";", "}", "catch", "(", "ClassFormatException", "e", ")", "{", "return", "null", ";", "}", "catch", "(", "IOException", "e", ")", "{", "return", "null", ";", "}", "}", "public", "static", "IClassFileReader", "createDefaultClassFileReader", "(", "String", "zipFileName", ",", "String", "zipEntryName", ",", "int", "decodingFlag", ")", "{", "ZipFile", "zipFile", "=", "null", ";", "try", "{", "if", "(", "JavaModelManager", ".", "ZIP_ACCESS_VERBOSE", ")", "{", "System", ".", "out", ".", "println", "(", "\"(\"", "+", "Thread", ".", "currentThread", "(", ")", "+", "\"\"", "+", "zipFileName", ")", ";", "}", "zipFile", "=", "new", "ZipFile", "(", "zipFileName", ")", ";", "ZipEntry", "zipEntry", "=", "zipFile", ".", "getEntry", "(", "zipEntryName", ")", ";", "if", "(", "zipEntry", "==", "null", ")", "{", "return", "null", ";", "}", "if", "(", "!", "zipEntryName", ".", "toLowerCase", "(", ")", ".", "endsWith", "(", "SuffixConstants", ".", "SUFFIX_STRING_class", ")", ")", "{", "return", "null", ";", "}", "byte", "classFileBytes", "[", "]", "=", "Util", ".", "getZipEntryByteContent", "(", "zipEntry", ",", "zipFile", ")", ";", "return", "new", "ClassFileReader", "(", "classFileBytes", ",", "decodingFlag", ")", ";", "}", "catch", "(", "ClassFormatException", "e", ")", "{", "return", "null", ";", "}", "catch", "(", "IOException", "e", ")", "{", "return", "null", ";", "}", "finally", "{", "if", "(", "zipFile", "!=", "null", ")", "{", "try", "{", "zipFile", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "}", "}", "}", "}", "public", "static", "ICodeFormatter", "createDefaultCodeFormatter", "(", "Map", "options", ")", "{", "if", "(", "options", "==", "null", ")", "options", "=", "JavaCore", ".", "getOptions", "(", ")", ";", "return", "new", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "formatter", ".", "old", ".", "CodeFormatter", "(", "options", ")", ";", "}", "public", "static", "IScanner", "createScanner", "(", "boolean", "tokenizeComments", ",", "boolean", "tokenizeWhiteSpace", ",", "boolean", "assertMode", ",", "boolean", "recordLineSeparator", ")", "{", "long", "complianceLevelValue", "=", "CompilerOptions", ".", "versionToJdkLevel", "(", "JavaCore", ".", "getOption", "(", "JavaCore", ".", "COMPILER_COMPLIANCE", ")", ")", ";", "if", "(", "complianceLevelValue", "==", "0", ")", "complianceLevelValue", "=", "ClassFileConstants", ".", "JDK1_4", ";", "PublicScanner", "scanner", "=", "new", "PublicScanner", "(", "tokenizeComments", ",", "tokenizeWhiteSpace", ",", "false", ",", "assertMode", "?", "ClassFileConstants", ".", "JDK1_4", ":", "ClassFileConstants", ".", "JDK1_3", ",", "complianceLevelValue", ",", "null", ",", "null", ",", "true", ")", ";", "scanner", ".", "recordLineSeparator", "=", "recordLineSeparator", ";", "return", "scanner", ";", "}", "public", "static", "IScanner", "createScanner", "(", "boolean", "tokenizeComments", ",", "boolean", "tokenizeWhiteSpace", ",", "boolean", "recordLineSeparator", ",", "String", "sourceLevel", ")", "{", "long", "complianceLevelValue", "=", "CompilerOptions", ".", "versionToJdkLevel", "(", "JavaCore", ".", "getOption", "(", "JavaCore", ".", "COMPILER_COMPLIANCE", ")", ")", ";", "if", "(", "complianceLevelValue", "==", "0", ")", "complianceLevelValue", "=", "ClassFileConstants", ".", "JDK1_4", ";", "long", "sourceLevelValue", "=", "CompilerOptions", ".", "versionToJdkLevel", "(", "sourceLevel", ")", ";", "if", "(", "sourceLevelValue", "==", "0", ")", "sourceLevelValue", "=", "ClassFileConstants", ".", "JDK1_3", ";", "PublicScanner", "scanner", "=", "new", "PublicScanner", "(", "tokenizeComments", ",", "tokenizeWhiteSpace", ",", "false", ",", "sourceLevelValue", ",", "complianceLevelValue", ",", "null", ",", "null", ",", "true", ")", ";", "scanner", ".", "recordLineSeparator", "=", "recordLineSeparator", ";", "return", "scanner", ";", "}", "public", "static", "IScanner", "createScanner", "(", "boolean", "tokenizeComments", ",", "boolean", "tokenizeWhiteSpace", ",", "boolean", "recordLineSeparator", ",", "String", "sourceLevel", ",", "String", "complianceLevel", ")", "{", "PublicScanner", "scanner", "=", "null", ";", "long", "sourceLevelValue", "=", "CompilerOptions", ".", "versionToJdkLevel", "(", "sourceLevel", ")", ";", "if", "(", "sourceLevelValue", "==", "0", ")", "sourceLevelValue", "=", "ClassFileConstants", ".", "JDK1_3", ";", "long", "complianceLevelValue", "=", "CompilerOptions", ".", "versionToJdkLevel", "(", "complianceLevel", ")", ";", "if", "(", "complianceLevelValue", "==", "0", ")", "complianceLevelValue", "=", "ClassFileConstants", ".", "JDK1_4", ";", "scanner", "=", "new", "PublicScanner", "(", "tokenizeComments", ",", "tokenizeWhiteSpace", ",", "false", ",", "sourceLevelValue", ",", "complianceLevelValue", ",", "null", ",", "null", ",", "true", ")", ";", "scanner", ".", "recordLineSeparator", "=", "recordLineSeparator", ";", "return", "scanner", ";", "}", "}", "</s>" ]
3,613
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "public", "final", "class", "SourceRange", "implements", "ISourceRange", "{", "public", "static", "boolean", "isAvailable", "(", "ISourceRange", "range", ")", "{", "return", "range", "!=", "null", "&&", "range", ".", "getOffset", "(", ")", "!=", "-", "1", ";", "}", "private", "int", "offset", ";", "private", "int", "length", ";", "public", "SourceRange", "(", "int", "offset", ",", "int", "length", ")", "{", "this", ".", "offset", "=", "offset", ";", "this", ".", "length", "=", "length", ";", "}", "public", "boolean", "equals", "(", "Object", "obj", ")", "{", "if", "(", "!", "(", "obj", "instanceof", "ISourceRange", ")", ")", "return", "false", ";", "ISourceRange", "sourceRange", "=", "(", "ISourceRange", ")", "obj", ";", "return", "sourceRange", ".", "getOffset", "(", ")", "==", "this", ".", "offset", "&&", "sourceRange", ".", "getLength", "(", ")", "==", "this", ".", "length", ";", "}", "public", "int", "getLength", "(", ")", "{", "return", "this", ".", "length", ";", "}", "public", "int", "getOffset", "(", ")", "{", "return", "this", ".", "offset", ";", "}", "public", "int", "hashCode", "(", ")", "{", "return", "this", ".", "length", "^", "this", ".", "offset", ";", "}", "public", "String", "toString", "(", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "buffer", ".", "append", "(", "\"[offset=\"", ")", ";", "buffer", ".", "append", "(", "this", ".", "offset", ")", ";", "buffer", ".", "append", "(", "\",", "length=\"", ")", ";", "buffer", ".", "append", "(", "this", ".", "length", ")", ";", "buffer", ".", "append", "(", "\"]\"", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "}", "</s>" ]
3,614
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IWorkspace", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "public", "interface", "IJavaModel", "extends", "IJavaElement", ",", "IOpenable", ",", "IParent", "{", "boolean", "contains", "(", "IResource", "resource", ")", ";", "void", "copy", "(", "IJavaElement", "[", "]", "elements", ",", "IJavaElement", "[", "]", "containers", ",", "IJavaElement", "[", "]", "siblings", ",", "String", "[", "]", "renamings", ",", "boolean", "replace", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "void", "delete", "(", "IJavaElement", "[", "]", "elements", ",", "boolean", "force", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "IJavaProject", "getJavaProject", "(", "String", "name", ")", ";", "IJavaProject", "[", "]", "getJavaProjects", "(", ")", "throws", "JavaModelException", ";", "Object", "[", "]", "getNonJavaResources", "(", ")", "throws", "JavaModelException", ";", "IWorkspace", "getWorkspace", "(", ")", ";", "void", "move", "(", "IJavaElement", "[", "]", "elements", ",", "IJavaElement", "[", "]", "containers", ",", "IJavaElement", "[", "]", "siblings", ",", "String", "[", "]", "renamings", ",", "boolean", "replace", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "void", "refreshExternalArchives", "(", "IJavaElement", "[", "]", "elementsScope", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "void", "rename", "(", "IJavaElement", "[", "]", "elements", ",", "IJavaElement", "[", "]", "destinations", ",", "String", "[", "]", "names", ",", "boolean", "replace", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "}", "</s>" ]
3,615
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "public", "interface", "IClasspathAttribute", "{", "String", "JAVADOC_LOCATION_ATTRIBUTE_NAME", "=", "\"\"", ";", "String", "OPTIONAL", "=", "\"optional\"", ";", "String", "getName", "(", ")", ";", "String", "getValue", "(", ")", ";", "}", "</s>" ]
3,616
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IMarker", ";", "public", "interface", "ICodeCompletionRequestor", "{", "void", "acceptClass", "(", "char", "[", "]", "packageName", ",", "char", "[", "]", "className", ",", "char", "[", "]", "completionName", ",", "int", "modifiers", ",", "int", "completionStart", ",", "int", "completionEnd", ")", ";", "void", "acceptError", "(", "IMarker", "marker", ")", ";", "void", "acceptField", "(", "char", "[", "]", "declaringTypePackageName", ",", "char", "[", "]", "declaringTypeName", ",", "char", "[", "]", "name", ",", "char", "[", "]", "typePackageName", ",", "char", "[", "]", "typeName", ",", "char", "[", "]", "completionName", ",", "int", "modifiers", ",", "int", "completionStart", ",", "int", "completionEnd", ")", ";", "void", "acceptInterface", "(", "char", "[", "]", "packageName", ",", "char", "[", "]", "interfaceName", ",", "char", "[", "]", "completionName", ",", "int", "modifiers", ",", "int", "completionStart", ",", "int", "completionEnd", ")", ";", "void", "acceptKeyword", "(", "char", "[", "]", "keywordName", ",", "int", "completionStart", ",", "int", "completionEnd", ")", ";", "void", "acceptLabel", "(", "char", "[", "]", "labelName", ",", "int", "completionStart", ",", "int", "completionEnd", ")", ";", "void", "acceptLocalVariable", "(", "char", "[", "]", "name", ",", "char", "[", "]", "typePackageName", ",", "char", "[", "]", "typeName", ",", "int", "modifiers", ",", "int", "completionStart", ",", "int", "completionEnd", ")", ";", "void", "acceptMethod", "(", "char", "[", "]", "declaringTypePackageName", ",", "char", "[", "]", "declaringTypeName", ",", "char", "[", "]", "selector", ",", "char", "[", "]", "[", "]", "parameterPackageNames", ",", "char", "[", "]", "[", "]", "parameterTypeNames", ",", "char", "[", "]", "returnTypePackageName", ",", "char", "[", "]", "returnTypeName", ",", "char", "[", "]", "completionName", ",", "int", "modifiers", ",", "int", "completionStart", ",", "int", "completionEnd", ")", ";", "void", "acceptModifier", "(", "char", "[", "]", "modifierName", ",", "int", "completionStart", ",", "int", "completionEnd", ")", ";", "void", "acceptPackage", "(", "char", "[", "]", "packageName", ",", "char", "[", "]", "completionName", ",", "int", "completionStart", ",", "int", "completionEnd", ")", ";", "void", "acceptType", "(", "char", "[", "]", "packageName", ",", "char", "[", "]", "typeName", ",", "char", "[", "]", "completionName", ",", "int", "completionStart", ",", "int", "completionEnd", ")", ";", "}", "</s>" ]
3,617
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "public", "interface", "IAnnotation", "extends", "IJavaElement", ",", "ISourceReference", "{", "String", "getElementName", "(", ")", ";", "IMemberValuePair", "[", "]", "getMemberValuePairs", "(", ")", "throws", "JavaModelException", ";", "int", "getOccurrenceCount", "(", ")", ";", "}", "</s>" ]
3,618
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "public", "interface", "IOpenable", "{", "public", "void", "close", "(", ")", "throws", "JavaModelException", ";", "public", "String", "findRecommendedLineSeparator", "(", ")", "throws", "JavaModelException", ";", "public", "IBuffer", "getBuffer", "(", ")", "throws", "JavaModelException", ";", "boolean", "hasUnsavedChanges", "(", ")", "throws", "JavaModelException", ";", "boolean", "isConsistent", "(", ")", "throws", "JavaModelException", ";", "boolean", "isOpen", "(", ")", ";", "void", "makeConsistent", "(", "IProgressMonitor", "progress", ")", "throws", "JavaModelException", ";", "public", "void", "open", "(", "IProgressMonitor", "progress", ")", "throws", "JavaModelException", ";", "public", "void", "save", "(", "IProgressMonitor", "progress", ",", "boolean", "force", ")", "throws", "JavaModelException", ";", "}", "</s>" ]
3,619
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "public", "interface", "ISourceRange", "{", "int", "getLength", "(", ")", ";", "int", "getOffset", "(", ")", ";", "}", "</s>" ]
3,620
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResourceDelta", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "CompilationUnit", ";", "public", "interface", "IJavaElementDelta", "{", "public", "int", "ADDED", "=", "1", ";", "public", "int", "REMOVED", "=", "2", ";", "public", "int", "CHANGED", "=", "4", ";", "public", "int", "F_CONTENT", "=", "0x000001", ";", "public", "int", "F_MODIFIERS", "=", "0x000002", ";", "public", "int", "F_CHILDREN", "=", "0x000008", ";", "public", "int", "F_MOVED_FROM", "=", "0x000010", ";", "public", "int", "F_MOVED_TO", "=", "0x000020", ";", "public", "int", "F_ADDED_TO_CLASSPATH", "=", "0x000040", ";", "public", "int", "F_REMOVED_FROM_CLASSPATH", "=", "0x000080", ";", "public", "int", "F_CLASSPATH_REORDER", "=", "0x000100", ";", "public", "int", "F_REORDER", "=", "0x000100", ";", "public", "int", "F_OPENED", "=", "0x000200", ";", "public", "int", "F_CLOSED", "=", "0x000400", ";", "public", "int", "F_SUPER_TYPES", "=", "0x000800", ";", "public", "int", "F_SOURCEATTACHED", "=", "0x001000", ";", "public", "int", "F_SOURCEDETACHED", "=", "0x002000", ";", "public", "int", "F_FINE_GRAINED", "=", "0x004000", ";", "public", "int", "F_ARCHIVE_CONTENT_CHANGED", "=", "0x008000", ";", "public", "int", "F_PRIMARY_WORKING_COPY", "=", "0x010000", ";", "public", "int", "F_CLASSPATH_CHANGED", "=", "0x020000", ";", "public", "int", "F_PRIMARY_RESOURCE", "=", "0x040000", ";", "public", "int", "F_AST_AFFECTED", "=", "0x080000", ";", "public", "int", "F_CATEGORIES", "=", "0x100000", ";", "public", "int", "F_RESOLVED_CLASSPATH_CHANGED", "=", "0x200000", ";", "public", "int", "F_ANNOTATIONS", "=", "0x400000", ";", "public", "IJavaElementDelta", "[", "]", "getAddedChildren", "(", ")", ";", "public", "IJavaElementDelta", "[", "]", "getAffectedChildren", "(", ")", ";", "public", "IJavaElementDelta", "[", "]", "getAnnotationDeltas", "(", ")", ";", "public", "CompilationUnit", "getCompilationUnitAST", "(", ")", ";", "public", "IJavaElementDelta", "[", "]", "getChangedChildren", "(", ")", ";", "public", "IJavaElement", "getElement", "(", ")", ";", "public", "int", "getFlags", "(", ")", ";", "public", "int", "getKind", "(", ")", ";", "public", "IJavaElement", "getMovedFromElement", "(", ")", ";", "public", "IJavaElement", "getMovedToElement", "(", ")", ";", "public", "IJavaElementDelta", "[", "]", "getRemovedChildren", "(", ")", ";", "public", "IResourceDelta", "[", "]", "getResourceDeltas", "(", ")", ";", "}", "</s>" ]
3,621
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "codeassist", ".", "InternalCompletionProposal", ";", "public", "class", "CompletionProposal", "{", "public", "static", "final", "int", "ANONYMOUS_CLASS_DECLARATION", "=", "1", ";", "public", "static", "final", "int", "FIELD_REF", "=", "2", ";", "public", "static", "final", "int", "KEYWORD", "=", "3", ";", "public", "static", "final", "int", "LABEL_REF", "=", "4", ";", "public", "static", "final", "int", "LOCAL_VARIABLE_REF", "=", "5", ";", "public", "static", "final", "int", "METHOD_REF", "=", "6", ";", "public", "static", "final", "int", "METHOD_DECLARATION", "=", "7", ";", "public", "static", "final", "int", "PACKAGE_REF", "=", "8", ";", "public", "static", "final", "int", "TYPE_REF", "=", "9", ";", "public", "static", "final", "int", "VARIABLE_DECLARATION", "=", "10", ";", "public", "static", "final", "int", "POTENTIAL_METHOD_DECLARATION", "=", "11", ";", "public", "static", "final", "int", "METHOD_NAME_REFERENCE", "=", "12", ";", "public", "static", "final", "int", "ANNOTATION_ATTRIBUTE_REF", "=", "13", ";", "public", "static", "final", "int", "JAVADOC_FIELD_REF", "=", "14", ";", "public", "static", "final", "int", "JAVADOC_METHOD_REF", "=", "15", ";", "public", "static", "final", "int", "JAVADOC_TYPE_REF", "=", "16", ";", "public", "static", "final", "int", "JAVADOC_VALUE_REF", "=", "17", ";", "public", "static", "final", "int", "JAVADOC_PARAM_REF", "=", "18", ";", "public", "static", "final", "int", "JAVADOC_BLOCK_TAG", "=", "19", ";", "public", "static", "final", "int", "JAVADOC_INLINE_TAG", "=", "20", ";", "public", "static", "final", "int", "FIELD_IMPORT", "=", "21", ";", "public", "static", "final", "int", "METHOD_IMPORT", "=", "22", ";", "public", "static", "final", "int", "TYPE_IMPORT", "=", "23", ";", "public", "static", "final", "int", "METHOD_REF_WITH_CASTED_RECEIVER", "=", "24", ";", "public", "static", "final", "int", "FIELD_REF_WITH_CASTED_RECEIVER", "=", "25", ";", "public", "static", "final", "int", "CONSTRUCTOR_INVOCATION", "=", "26", ";", "public", "static", "final", "int", "ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION", "=", "27", ";", "protected", "static", "final", "int", "FIRST_KIND", "=", "ANONYMOUS_CLASS_DECLARATION", ";", "protected", "static", "final", "int", "LAST_KIND", "=", "ANONYMOUS_CLASS_CONSTRUCTOR_INVOCATION", ";", "public", "static", "CompletionProposal", "create", "(", "int", "kind", ",", "int", "completionOffset", ")", "{", "return", "new", "InternalCompletionProposal", "(", "kind", ",", "completionOffset", ")", ";", "}", "public", "int", "getAdditionalFlags", "(", ")", "{", "return", "-", "1", ";", "}", "public", "void", "setAdditionalFlags", "(", "int", "additionalFlags", ")", "{", "}", "public", "int", "getKind", "(", ")", "{", "return", "-", "1", ";", "}", "public", "int", "getCompletionLocation", "(", ")", "{", "return", "-", "1", ";", "}", "public", "int", "getTokenStart", "(", ")", "{", "return", "-", "1", ";", "}", "public", "int", "getTokenEnd", "(", ")", "{", "return", "-", "1", ";", "}", "public", "void", "setTokenRange", "(", "int", "startIndex", ",", "int", "endIndex", ")", "{", "}", "public", "char", "[", "]", "getCompletion", "(", ")", "{", "return", "null", ";", "}", "public", "void", "setCompletion", "(", "char", "[", "]", "completion", ")", "{", "}", "public", "int", "getReplaceStart", "(", ")", "{", "return", "-", "1", ";", "}", "public", "int", "getReplaceEnd", "(", ")", "{", "return", "-", "1", ";", "}", "public", "void", "setReplaceRange", "(", "int", "startIndex", ",", "int", "endIndex", ")", "{", "}", "public", "int", "getRelevance", "(", ")", "{", "return", "-", "1", ";", "}", "public", "void", "setRelevance", "(", "int", "rating", ")", "{", "}", "public", "char", "[", "]", "getDeclarationSignature", "(", ")", "{", "return", "null", ";", "}", "public", "char", "[", "]", "getDeclarationKey", "(", ")", "{", "return", "null", ";", "}", "public", "void", "setDeclarationSignature", "(", "char", "[", "]", "signature", ")", "{", "}", "public", "void", "setDeclarationKey", "(", "char", "[", "]", "key", ")", "{", "}", "public", "char", "[", "]", "getName", "(", ")", "{", "return", "null", ";", "}", "public", "void", "setName", "(", "char", "[", "]", "name", ")", "{", "}", "public", "char", "[", "]", "getSignature", "(", ")", "{", "return", "null", ";", "}", "public", "char", "[", "]", "getKey", "(", ")", "{", "return", "null", ";", "}", "public", "void", "setSignature", "(", "char", "[", "]", "signature", ")", "{", "}", "public", "void", "setKey", "(", "char", "[", "]", "key", ")", "{", "}", "public", "int", "getFlags", "(", ")", "{", "return", "-", "1", ";", "}", "public", "void", "setFlags", "(", "int", "flags", ")", "{", "}", "public", "CompletionProposal", "[", "]", "getRequiredProposals", "(", ")", "{", "return", "null", ";", "}", "public", "void", "setRequiredProposals", "(", "CompletionProposal", "[", "]", "proposals", ")", "{", "}", "public", "char", "[", "]", "[", "]", "findParameterNames", "(", "IProgressMonitor", "monitor", ")", "{", "return", "null", ";", "}", "public", "void", "setParameterNames", "(", "char", "[", "]", "[", "]", "parameterNames", ")", "{", "}", "public", "int", "getAccessibility", "(", ")", "{", "return", "-", "1", ";", "}", "public", "boolean", "isConstructor", "(", ")", "{", "return", "false", ";", "}", "public", "char", "[", "]", "getReceiverSignature", "(", ")", "{", "return", "null", ";", "}", "public", "int", "getReceiverStart", "(", ")", "{", "return", "-", "1", ";", "}", "public", "int", "getReceiverEnd", "(", ")", "{", "return", "-", "1", ";", "}", "public", "void", "setReceiverSignature", "(", "char", "[", "]", "signature", ")", "{", "}", "public", "void", "setReceiverRange", "(", "int", "startIndex", ",", "int", "endIndex", ")", "{", "}", "public", "boolean", "canUseDiamond", "(", "CompletionContext", "coreContext", ")", "{", "return", "false", ";", "}", "}", "</s>" ]
3,622
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "public", "interface", "IImportDeclaration", "extends", "IJavaElement", ",", "ISourceReference", ",", "ISourceManipulation", "{", "String", "getElementName", "(", ")", ";", "int", "getFlags", "(", ")", "throws", "JavaModelException", ";", "boolean", "isOnDemand", "(", ")", ";", "}", "</s>" ]
3,623
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "public", "interface", "ITypeHierarchyChangedListener", "{", "void", "typeHierarchyChanged", "(", "ITypeHierarchy", "typeHierarchy", ")", ";", "}", "</s>" ]
3,624
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "IProblem", ";", "public", "abstract", "class", "CompletionRequestor", "{", "private", "int", "ignoreSet", "=", "0", ";", "private", "String", "[", "]", "favoriteReferences", ";", "private", "int", "requiredProposalAllowSet", "[", "]", "=", "null", ";", "private", "boolean", "requireExtendedContext", "=", "false", ";", "public", "CompletionRequestor", "(", ")", "{", "this", "(", "false", ")", ";", "}", "public", "CompletionRequestor", "(", "boolean", "ignoreAll", ")", "{", "this", ".", "ignoreSet", "=", "ignoreAll", "?", "0xffffffff", ":", "0x00000000", ";", "}", "public", "boolean", "isIgnored", "(", "int", "completionProposalKind", ")", "{", "if", "(", "completionProposalKind", "<", "CompletionProposal", ".", "FIRST_KIND", "||", "completionProposalKind", ">", "CompletionProposal", ".", "LAST_KIND", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"\"", "+", "completionProposalKind", ")", ";", "}", "return", "0", "!=", "(", "this", ".", "ignoreSet", "&", "(", "1", "<<", "completionProposalKind", ")", ")", ";", "}", "public", "void", "setIgnored", "(", "int", "completionProposalKind", ",", "boolean", "ignore", ")", "{", "if", "(", "completionProposalKind", "<", "CompletionProposal", ".", "FIRST_KIND", "||", "completionProposalKind", ">", "CompletionProposal", ".", "LAST_KIND", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"\"", "+", "completionProposalKind", ")", ";", "}", "if", "(", "ignore", ")", "{", "this", ".", "ignoreSet", "|=", "(", "1", "<<", "completionProposalKind", ")", ";", "}", "else", "{", "this", ".", "ignoreSet", "&=", "~", "(", "1", "<<", "completionProposalKind", ")", ";", "}", "}", "public", "boolean", "isAllowingRequiredProposals", "(", "int", "proposalKind", ",", "int", "requiredProposalKind", ")", "{", "if", "(", "proposalKind", "<", "CompletionProposal", ".", "FIRST_KIND", "||", "proposalKind", ">", "CompletionProposal", ".", "LAST_KIND", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"\"", "+", "requiredProposalKind", ")", ";", "}", "if", "(", "requiredProposalKind", "<", "CompletionProposal", ".", "FIRST_KIND", "||", "requiredProposalKind", ">", "CompletionProposal", ".", "LAST_KIND", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"\"", "+", "requiredProposalKind", ")", ";", "}", "if", "(", "this", ".", "requiredProposalAllowSet", "==", "null", ")", "return", "false", ";", "return", "0", "!=", "(", "this", ".", "requiredProposalAllowSet", "[", "proposalKind", "]", "&", "(", "1", "<<", "requiredProposalKind", ")", ")", ";", "}", "public", "void", "setAllowsRequiredProposals", "(", "int", "proposalKind", ",", "int", "requiredProposalKind", ",", "boolean", "allow", ")", "{", "if", "(", "proposalKind", "<", "CompletionProposal", ".", "FIRST_KIND", "||", "proposalKind", ">", "CompletionProposal", ".", "LAST_KIND", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"\"", "+", "requiredProposalKind", ")", ";", "}", "if", "(", "requiredProposalKind", "<", "CompletionProposal", ".", "FIRST_KIND", "||", "requiredProposalKind", ">", "CompletionProposal", ".", "LAST_KIND", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"\"", "+", "requiredProposalKind", ")", ";", "}", "if", "(", "this", ".", "requiredProposalAllowSet", "==", "null", ")", "{", "this", ".", "requiredProposalAllowSet", "=", "new", "int", "[", "CompletionProposal", ".", "LAST_KIND", "+", "1", "]", ";", "}", "if", "(", "allow", ")", "{", "this", ".", "requiredProposalAllowSet", "[", "proposalKind", "]", "|=", "(", "1", "<<", "requiredProposalKind", ")", ";", "}", "else", "{", "this", ".", "requiredProposalAllowSet", "[", "proposalKind", "]", "&=", "~", "(", "1", "<<", "requiredProposalKind", ")", ";", "}", "}", "public", "String", "[", "]", "getFavoriteReferences", "(", ")", "{", "return", "this", ".", "favoriteReferences", ";", "}", "public", "void", "setFavoriteReferences", "(", "String", "[", "]", "favoriteImports", ")", "{", "this", ".", "favoriteReferences", "=", "favoriteImports", ";", "}", "public", "void", "beginReporting", "(", ")", "{", "}", "public", "void", "endReporting", "(", ")", "{", "}", "public", "void", "completionFailure", "(", "IProblem", "problem", ")", "{", "}", "public", "abstract", "void", "accept", "(", "CompletionProposal", "proposal", ")", ";", "public", "void", "acceptContext", "(", "CompletionContext", "context", ")", "{", "}", "public", "boolean", "isExtendedContextRequired", "(", ")", "{", "return", "this", ".", "requireExtendedContext", ";", "}", "public", "void", "setRequireExtendedContext", "(", "boolean", "require", ")", "{", "this", ".", "requireExtendedContext", "=", "require", ";", "}", "}", "</s>" ]
3,625
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "public", "interface", "IMethod", "extends", "IMember", ",", "IAnnotatable", "{", "IMemberValuePair", "getDefaultValue", "(", ")", "throws", "JavaModelException", ";", "String", "getElementName", "(", ")", ";", "String", "[", "]", "getExceptionTypes", "(", ")", "throws", "JavaModelException", ";", "String", "[", "]", "getTypeParameterSignatures", "(", ")", "throws", "JavaModelException", ";", "ITypeParameter", "[", "]", "getTypeParameters", "(", ")", "throws", "JavaModelException", ";", "int", "getNumberOfParameters", "(", ")", ";", "ILocalVariable", "[", "]", "getParameters", "(", ")", "throws", "JavaModelException", ";", "String", "getKey", "(", ")", ";", "String", "[", "]", "getParameterNames", "(", ")", "throws", "JavaModelException", ";", "String", "[", "]", "getParameterTypes", "(", ")", ";", "String", "[", "]", "getRawParameterNames", "(", ")", "throws", "JavaModelException", ";", "String", "getReturnType", "(", ")", "throws", "JavaModelException", ";", "String", "getSignature", "(", ")", "throws", "JavaModelException", ";", "ITypeParameter", "getTypeParameter", "(", "String", "name", ")", ";", "boolean", "isConstructor", "(", ")", "throws", "JavaModelException", ";", "boolean", "isMainMethod", "(", ")", "throws", "JavaModelException", ";", "boolean", "isResolved", "(", ")", ";", "boolean", "isSimilar", "(", "IMethod", "method", ")", ";", "}", "</s>" ]
3,626
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "IProblem", ";", "public", "class", "CompletionRequestorAdapter", "implements", "ICompletionRequestor", "{", "public", "void", "acceptAnonymousType", "(", "char", "[", "]", "superTypePackageName", ",", "char", "[", "]", "superTypeName", ",", "char", "[", "]", "[", "]", "parameterPackageNames", ",", "char", "[", "]", "[", "]", "parameterTypeNames", ",", "char", "[", "]", "[", "]", "parameterNames", ",", "char", "[", "]", "completionName", ",", "int", "modifiers", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", "{", "}", "public", "void", "acceptClass", "(", "char", "[", "]", "packageName", ",", "char", "[", "]", "className", ",", "char", "[", "]", "completionName", ",", "int", "modifiers", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", "{", "}", "public", "void", "acceptError", "(", "IProblem", "error", ")", "{", "}", "public", "void", "acceptField", "(", "char", "[", "]", "declaringTypePackageName", ",", "char", "[", "]", "declaringTypeName", ",", "char", "[", "]", "name", ",", "char", "[", "]", "typePackageName", ",", "char", "[", "]", "typeName", ",", "char", "[", "]", "completionName", ",", "int", "modifiers", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", "{", "}", "public", "void", "acceptInterface", "(", "char", "[", "]", "packageName", ",", "char", "[", "]", "interfaceName", ",", "char", "[", "]", "completionName", ",", "int", "modifiers", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", "{", "}", "public", "void", "acceptKeyword", "(", "char", "[", "]", "keywordName", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", "{", "}", "public", "void", "acceptLabel", "(", "char", "[", "]", "labelName", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", "{", "}", "public", "void", "acceptLocalVariable", "(", "char", "[", "]", "name", ",", "char", "[", "]", "typePackageName", ",", "char", "[", "]", "typeName", ",", "int", "modifiers", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", "{", "}", "public", "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", ")", "{", "}", "public", "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", ")", "{", "}", "public", "void", "acceptModifier", "(", "char", "[", "]", "modifierName", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", "{", "}", "public", "void", "acceptPackage", "(", "char", "[", "]", "packageName", ",", "char", "[", "]", "completionName", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", "{", "}", "public", "void", "acceptType", "(", "char", "[", "]", "packageName", ",", "char", "[", "]", "typeName", ",", "char", "[", "]", "completionName", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", "{", "}", "public", "void", "acceptVariableName", "(", "char", "[", "]", "typePackageName", ",", "char", "[", "]", "typeName", ",", "char", "[", "]", "name", ",", "char", "[", "]", "completionName", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", "{", "}", "}", "</s>" ]
3,627
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IStorage", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "public", "interface", "IJarEntryResource", "extends", "IStorage", "{", "IJarEntryResource", "[", "]", "getChildren", "(", ")", ";", "IPath", "getFullPath", "(", ")", ";", "Object", "getParent", "(", ")", ";", "IPackageFragmentRoot", "getPackageFragmentRoot", "(", ")", ";", "boolean", "isFile", "(", ")", ";", "}", "</s>" ]
3,628
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "public", "interface", "ICorrectionRequestor", "{", "void", "acceptClass", "(", "char", "[", "]", "packageName", ",", "char", "[", "]", "className", ",", "char", "[", "]", "correctionName", ",", "int", "modifiers", ",", "int", "correctionStart", ",", "int", "correctionEnd", ")", ";", "void", "acceptField", "(", "char", "[", "]", "declaringTypePackageName", ",", "char", "[", "]", "declaringTypeName", ",", "char", "[", "]", "name", ",", "char", "[", "]", "typePackageName", ",", "char", "[", "]", "typeName", ",", "char", "[", "]", "correctionName", ",", "int", "modifiers", ",", "int", "correctionStart", ",", "int", "correctionEnd", ")", ";", "void", "acceptInterface", "(", "char", "[", "]", "packageName", ",", "char", "[", "]", "interfaceName", ",", "char", "[", "]", "correctionName", ",", "int", "modifiers", ",", "int", "correctionStart", ",", "int", "correctionEnd", ")", ";", "void", "acceptLocalVariable", "(", "char", "[", "]", "name", ",", "char", "[", "]", "typePackageName", ",", "char", "[", "]", "typeName", ",", "int", "modifiers", ",", "int", "correctionStart", ",", "int", "correctionEnd", ")", ";", "void", "acceptMethod", "(", "char", "[", "]", "declaringTypePackageName", ",", "char", "[", "]", "declaringTypeName", ",", "char", "[", "]", "selector", ",", "char", "[", "]", "[", "]", "parameterPackageNames", ",", "char", "[", "]", "[", "]", "parameterTypeNames", ",", "char", "[", "]", "[", "]", "parameterNames", ",", "char", "[", "]", "returnTypePackageName", ",", "char", "[", "]", "returnTypeName", ",", "char", "[", "]", "correctionName", ",", "int", "modifiers", ",", "int", "correctionStart", ",", "int", "correctionEnd", ")", ";", "void", "acceptPackage", "(", "char", "[", "]", "packageName", ",", "char", "[", "]", "correctionName", ",", "int", "correctionStart", ",", "int", "correctionEnd", ")", ";", "}", "</s>" ]
3,629
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "import", "java", ".", "util", ".", "StringTokenizer", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IWorkspace", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "ResourcesPlugin", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IStatus", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Status", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "impl", ".", "CompilerOptions", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TypeConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "Scanner", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "ScannerHelper", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "TerminalTokens", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Messages", ";", "public", "final", "class", "JavaConventions", "{", "private", "static", "final", "char", "DOT", "=", "'.'", ";", "private", "static", "final", "String", "PACKAGE_INFO", "=", "new", "String", "(", "TypeConstants", ".", "PACKAGE_INFO_NAME", ")", ";", "private", "static", "final", "Scanner", "SCANNER", "=", "new", "Scanner", "(", "false", ",", "true", ",", "false", ",", "ClassFileConstants", ".", "JDK1_3", ",", "null", ",", "null", ",", "true", ")", ";", "private", "JavaConventions", "(", ")", "{", "}", "public", "static", "boolean", "isOverlappingRoots", "(", "IPath", "rootPath1", ",", "IPath", "rootPath2", ")", "{", "if", "(", "rootPath1", "==", "null", "||", "rootPath2", "==", "null", ")", "{", "return", "false", ";", "}", "return", "rootPath1", ".", "isPrefixOf", "(", "rootPath2", ")", "||", "rootPath2", ".", "isPrefixOf", "(", "rootPath1", ")", ";", "}", "private", "static", "synchronized", "char", "[", "]", "scannedIdentifier", "(", "String", "id", ",", "String", "sourceLevel", ",", "String", "complianceLevel", ")", "{", "if", "(", "id", "==", "null", ")", "{", "return", "null", ";", "}", "SCANNER", ".", "sourceLevel", "=", "sourceLevel", "==", "null", "?", "ClassFileConstants", ".", "JDK1_3", ":", "CompilerOptions", ".", "versionToJdkLevel", "(", "sourceLevel", ")", ";", "SCANNER", ".", "complianceLevel", "=", "complianceLevel", "==", "null", "?", "ClassFileConstants", ".", "JDK1_3", ":", "CompilerOptions", ".", "versionToJdkLevel", "(", "complianceLevel", ")", ";", "try", "{", "SCANNER", ".", "setSource", "(", "id", ".", "toCharArray", "(", ")", ")", ";", "int", "token", "=", "SCANNER", ".", "scanIdentifier", "(", ")", ";", "if", "(", "token", "!=", "TerminalTokens", ".", "TokenNameIdentifier", ")", "return", "null", ";", "if", "(", "SCANNER", ".", "currentPosition", "==", "SCANNER", ".", "eofPosition", ")", "{", "try", "{", "return", "SCANNER", ".", "getCurrentIdentifierSource", "(", ")", ";", "}", "catch", "(", "ArrayIndexOutOfBoundsException", "e", ")", "{", "return", "null", ";", "}", "}", "else", "{", "return", "null", ";", "}", "}", "catch", "(", "InvalidInputException", "e", ")", "{", "return", "null", ";", "}", "}", "public", "static", "IStatus", "validateCompilationUnitName", "(", "String", "name", ")", "{", "return", "validateCompilationUnitName", "(", "name", ",", "CompilerOptions", ".", "VERSION_1_3", ",", "CompilerOptions", ".", "VERSION_1_3", ")", ";", "}", "public", "static", "IStatus", "validateCompilationUnitName", "(", "String", "name", ",", "String", "sourceLevel", ",", "String", "complianceLevel", ")", "{", "if", "(", "name", "==", "null", ")", "{", "return", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "JavaCore", ".", "PLUGIN_ID", ",", "-", "1", ",", "Messages", ".", "convention_unit_nullName", ",", "null", ")", ";", "}", "if", "(", "!", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ".", "isJavaLikeFileName", "(", "name", ")", ")", "{", "return", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "JavaCore", ".", "PLUGIN_ID", ",", "-", "1", ",", "Messages", ".", "convention_unit_notJavaName", ",", "null", ")", ";", "}", "String", "identifier", ";", "int", "index", ";", "index", "=", "name", ".", "lastIndexOf", "(", "'.'", ")", ";", "if", "(", "index", "==", "-", "1", ")", "{", "return", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "JavaCore", ".", "PLUGIN_ID", ",", "-", "1", ",", "Messages", ".", "convention_unit_notJavaName", ",", "null", ")", ";", "}", "identifier", "=", "name", ".", "substring", "(", "0", ",", "index", ")", ";", "if", "(", "!", "identifier", ".", "equals", "(", "PACKAGE_INFO", ")", ")", "{", "IStatus", "status", "=", "validateIdentifier", "(", "identifier", ",", "sourceLevel", ",", "complianceLevel", ")", ";", "if", "(", "!", "status", ".", "isOK", "(", ")", ")", "{", "return", "status", ";", "}", "}", "IStatus", "status", "=", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "validateName", "(", "name", ",", "IResource", ".", "FILE", ")", ";", "if", "(", "!", "status", ".", "isOK", "(", ")", ")", "{", "return", "status", ";", "}", "return", "JavaModelStatus", ".", "VERIFIED_OK", ";", "}", "public", "static", "IStatus", "validateClassFileName", "(", "String", "name", ")", "{", "return", "validateClassFileName", "(", "name", ",", "CompilerOptions", ".", "VERSION_1_3", ",", "CompilerOptions", ".", "VERSION_1_3", ")", ";", "}", "public", "static", "IStatus", "validateClassFileName", "(", "String", "name", ",", "String", "sourceLevel", ",", "String", "complianceLevel", ")", "{", "if", "(", "name", "==", "null", ")", "{", "return", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "JavaCore", ".", "PLUGIN_ID", ",", "-", "1", ",", "Messages", ".", "convention_classFile_nullName", ",", "null", ")", ";", "}", "if", "(", "!", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "isClassFileName", "(", "name", ")", ")", "{", "return", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "JavaCore", ".", "PLUGIN_ID", ",", "-", "1", ",", "Messages", ".", "convention_classFile_notClassFileName", ",", "null", ")", ";", "}", "String", "identifier", ";", "int", "index", ";", "index", "=", "name", ".", "lastIndexOf", "(", "'.'", ")", ";", "if", "(", "index", "==", "-", "1", ")", "{", "return", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "JavaCore", ".", "PLUGIN_ID", ",", "-", "1", ",", "Messages", ".", "convention_classFile_notClassFileName", ",", "null", ")", ";", "}", "identifier", "=", "name", ".", "substring", "(", "0", ",", "index", ")", ";", "if", "(", "!", "identifier", ".", "equals", "(", "PACKAGE_INFO", ")", ")", "{", "IStatus", "status", "=", "validateIdentifier", "(", "identifier", ",", "sourceLevel", ",", "complianceLevel", ")", ";", "if", "(", "!", "status", ".", "isOK", "(", ")", ")", "{", "return", "status", ";", "}", "}", "IStatus", "status", "=", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "validateName", "(", "name", ",", "IResource", ".", "FILE", ")", ";", "if", "(", "!", "status", ".", "isOK", "(", ")", ")", "{", "return", "status", ";", "}", "return", "JavaModelStatus", ".", "VERIFIED_OK", ";", "}", "public", "static", "IStatus", "validateFieldName", "(", "String", "name", ")", "{", "return", "validateIdentifier", "(", "name", ",", "CompilerOptions", ".", "VERSION_1_3", ",", "CompilerOptions", ".", "VERSION_1_3", ")", ";", "}", "public", "static", "IStatus", "validateFieldName", "(", "String", "name", ",", "String", "sourceLevel", ",", "String", "complianceLevel", ")", "{", "return", "validateIdentifier", "(", "name", ",", "sourceLevel", ",", "complianceLevel", ")", ";", "}", "public", "static", "IStatus", "validateIdentifier", "(", "String", "id", ")", "{", "return", "validateIdentifier", "(", "id", ",", "CompilerOptions", ".", "VERSION_1_3", ",", "CompilerOptions", ".", "VERSION_1_3", ")", ";", "}", "public", "static", "IStatus", "validateIdentifier", "(", "String", "id", ",", "String", "sourceLevel", ",", "String", "complianceLevel", ")", "{", "if", "(", "scannedIdentifier", "(", "id", ",", "sourceLevel", ",", "complianceLevel", ")", "!=", "null", ")", "{", "return", "JavaModelStatus", ".", "VERIFIED_OK", ";", "}", "else", "{", "return", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "JavaCore", ".", "PLUGIN_ID", ",", "-", "1", ",", "Messages", ".", "bind", "(", "Messages", ".", "convention_illegalIdentifier", ",", "id", ")", ",", "null", ")", ";", "}", "}", "public", "static", "IStatus", "validateImportDeclaration", "(", "String", "name", ")", "{", "return", "validateImportDeclaration", "(", "name", ",", "CompilerOptions", ".", "VERSION_1_3", ",", "CompilerOptions", ".", "VERSION_1_3", ")", ";", "}", "public", "static", "IStatus", "validateImportDeclaration", "(", "String", "name", ",", "String", "sourceLevel", ",", "String", "complianceLevel", ")", "{", "if", "(", "name", "==", "null", "||", "name", ".", "length", "(", ")", "==", "0", ")", "{", "return", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "JavaCore", ".", "PLUGIN_ID", ",", "-", "1", ",", "Messages", ".", "convention_import_nullImport", ",", "null", ")", ";", "}", "if", "(", "name", ".", "charAt", "(", "name", ".", "length", "(", ")", "-", "1", ")", "==", "'*'", ")", "{", "if", "(", "name", ".", "charAt", "(", "name", ".", "length", "(", ")", "-", "2", ")", "==", "'.'", ")", "{", "return", "validatePackageName", "(", "name", ".", "substring", "(", "0", ",", "name", ".", "length", "(", ")", "-", "2", ")", ",", "sourceLevel", ",", "complianceLevel", ")", ";", "}", "else", "{", "return", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "JavaCore", ".", "PLUGIN_ID", ",", "-", "1", ",", "Messages", ".", "convention_import_unqualifiedImport", ",", "null", ")", ";", "}", "}", "return", "validatePackageName", "(", "name", ",", "sourceLevel", ",", "complianceLevel", ")", ";", "}", "public", "static", "IStatus", "validateJavaTypeName", "(", "String", "name", ")", "{", "return", "validateJavaTypeName", "(", "name", ",", "JavaCore", ".", "VERSION_1_3", ",", "JavaCore", ".", "VERSION_1_3", ")", ";", "}", "public", "static", "IStatus", "validateJavaTypeName", "(", "String", "name", ",", "String", "sourceLevel", ",", "String", "complianceLevel", ")", "{", "if", "(", "name", "==", "null", ")", "{", "return", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "JavaCore", ".", "PLUGIN_ID", ",", "-", "1", ",", "Messages", ".", "convention_type_nullName", ",", "null", ")", ";", "}", "String", "trimmed", "=", "name", ".", "trim", "(", ")", ";", "if", "(", "!", "name", ".", "equals", "(", "trimmed", ")", ")", "{", "return", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "JavaCore", ".", "PLUGIN_ID", ",", "-", "1", ",", "Messages", ".", "convention_type_nameWithBlanks", ",", "null", ")", ";", "}", "int", "index", "=", "name", ".", "lastIndexOf", "(", "'.'", ")", ";", "char", "[", "]", "scannedID", ";", "if", "(", "index", "==", "-", "1", ")", "{", "scannedID", "=", "scannedIdentifier", "(", "name", ",", "sourceLevel", ",", "complianceLevel", ")", ";", "}", "else", "{", "String", "pkg", "=", "name", ".", "substring", "(", "0", ",", "index", ")", ".", "trim", "(", ")", ";", "IStatus", "status", "=", "validatePackageName", "(", "pkg", ",", "sourceLevel", ",", "complianceLevel", ")", ";", "if", "(", "!", "status", ".", "isOK", "(", ")", ")", "{", "return", "status", ";", "}", "String", "type", "=", "name", ".", "substring", "(", "index", "+", "1", ")", ".", "trim", "(", ")", ";", "scannedID", "=", "scannedIdentifier", "(", "type", ",", "sourceLevel", ",", "complianceLevel", ")", ";", "}", "if", "(", "scannedID", "!=", "null", ")", "{", "IStatus", "status", "=", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "validateName", "(", "new", "String", "(", "scannedID", ")", ",", "IResource", ".", "FILE", ")", ";", "if", "(", "!", "status", ".", "isOK", "(", ")", ")", "{", "return", "status", ";", "}", "if", "(", "CharOperation", ".", "contains", "(", "'$'", ",", "scannedID", ")", ")", "{", "return", "new", "Status", "(", "IStatus", ".", "WARNING", ",", "JavaCore", ".", "PLUGIN_ID", ",", "-", "1", ",", "Messages", ".", "convention_type_dollarName", ",", "null", ")", ";", "}", "if", "(", "(", "scannedID", ".", "length", ">", "0", "&&", "ScannerHelper", ".", "isLowerCase", "(", "scannedID", "[", "0", "]", ")", ")", ")", "{", "return", "new", "Status", "(", "IStatus", ".", "WARNING", ",", "JavaCore", ".", "PLUGIN_ID", ",", "-", "1", ",", "Messages", ".", "convention_type_lowercaseName", ",", "null", ")", ";", "}", "return", "JavaModelStatus", ".", "VERIFIED_OK", ";", "}", "else", "{", "return", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "JavaCore", ".", "PLUGIN_ID", ",", "-", "1", ",", "Messages", ".", "bind", "(", "Messages", ".", "convention_type_invalidName", ",", "name", ")", ",", "null", ")", ";", "}", "}", "public", "static", "IStatus", "validateMethodName", "(", "String", "name", ")", "{", "return", "validateMethodName", "(", "name", ",", "CompilerOptions", ".", "VERSION_1_3", ",", "CompilerOptions", ".", "VERSION_1_3", ")", ";", "}", "public", "static", "IStatus", "validateMethodName", "(", "String", "name", ",", "String", "sourceLevel", ",", "String", "complianceLevel", ")", "{", "return", "validateIdentifier", "(", "name", ",", "sourceLevel", ",", "complianceLevel", ")", ";", "}", "public", "static", "IStatus", "validatePackageName", "(", "String", "name", ")", "{", "return", "validatePackageName", "(", "name", ",", "CompilerOptions", ".", "VERSION_1_3", ",", "CompilerOptions", ".", "VERSION_1_3", ")", ";", "}", "public", "static", "IStatus", "validatePackageName", "(", "String", "name", ",", "String", "sourceLevel", ",", "String", "complianceLevel", ")", "{", "if", "(", "name", "==", "null", ")", "{", "return", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "JavaCore", ".", "PLUGIN_ID", ",", "-", "1", ",", "Messages", ".", "convention_package_nullName", ",", "null", ")", ";", "}", "int", "length", ";", "if", "(", "(", "length", "=", "name", ".", "length", "(", ")", ")", "==", "0", ")", "{", "return", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "JavaCore", ".", "PLUGIN_ID", ",", "-", "1", ",", "Messages", ".", "convention_package_emptyName", ",", "null", ")", ";", "}", "if", "(", "name", ".", "charAt", "(", "0", ")", "==", "DOT", "||", "name", ".", "charAt", "(", "length", "-", "1", ")", "==", "DOT", ")", "{", "return", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "JavaCore", ".", "PLUGIN_ID", ",", "-", "1", ",", "Messages", ".", "convention_package_dotName", ",", "null", ")", ";", "}", "if", "(", "CharOperation", ".", "isWhitespace", "(", "name", ".", "charAt", "(", "0", ")", ")", "||", "CharOperation", ".", "isWhitespace", "(", "name", ".", "charAt", "(", "name", ".", "length", "(", ")", "-", "1", ")", ")", ")", "{", "return", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "JavaCore", ".", "PLUGIN_ID", ",", "-", "1", ",", "Messages", ".", "convention_package_nameWithBlanks", ",", "null", ")", ";", "}", "int", "dot", "=", "0", ";", "while", "(", "dot", "!=", "-", "1", "&&", "dot", "<", "length", "-", "1", ")", "{", "if", "(", "(", "dot", "=", "name", ".", "indexOf", "(", "DOT", ",", "dot", "+", "1", ")", ")", "!=", "-", "1", "&&", "dot", "<", "length", "-", "1", "&&", "name", ".", "charAt", "(", "dot", "+", "1", ")", "==", "DOT", ")", "{", "return", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "JavaCore", ".", "PLUGIN_ID", ",", "-", "1", ",", "Messages", ".", "convention_package_consecutiveDotsName", ",", "null", ")", ";", "}", "}", "IWorkspace", "workspace", "=", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ";", "StringTokenizer", "st", "=", "new", "StringTokenizer", "(", "name", ",", "\".\"", ")", ";", "boolean", "firstToken", "=", "true", ";", "IStatus", "warningStatus", "=", "null", ";", "while", "(", "st", ".", "hasMoreTokens", "(", ")", ")", "{", "String", "typeName", "=", "st", ".", "nextToken", "(", ")", ";", "typeName", "=", "typeName", ".", "trim", "(", ")", ";", "char", "[", "]", "scannedID", "=", "scannedIdentifier", "(", "typeName", ",", "sourceLevel", ",", "complianceLevel", ")", ";", "if", "(", "scannedID", "==", "null", ")", "{", "return", "new", "Status", "(", "IStatus", ".", "ERROR", ",", "JavaCore", ".", "PLUGIN_ID", ",", "-", "1", ",", "Messages", ".", "bind", "(", "Messages", ".", "convention_illegalIdentifier", ",", "typeName", ")", ",", "null", ")", ";", "}", "IStatus", "status", "=", "workspace", ".", "validateName", "(", "new", "String", "(", "scannedID", ")", ",", "IResource", ".", "FOLDER", ")", ";", "if", "(", "!", "status", ".", "isOK", "(", ")", ")", "{", "return", "status", ";", "}", "if", "(", "firstToken", "&&", "scannedID", ".", "length", ">", "0", "&&", "ScannerHelper", ".", "isUpperCase", "(", "scannedID", "[", "0", "]", ")", ")", "{", "if", "(", "warningStatus", "==", "null", ")", "{", "warningStatus", "=", "new", "Status", "(", "IStatus", ".", "WARNING", ",", "JavaCore", ".", "PLUGIN_ID", ",", "-", "1", ",", "Messages", ".", "convention_package_uppercaseName", ",", "null", ")", ";", "}", "}", "firstToken", "=", "false", ";", "}", "if", "(", "warningStatus", "!=", "null", ")", "{", "return", "warningStatus", ";", "}", "return", "JavaModelStatus", ".", "VERIFIED_OK", ";", "}", "public", "static", "IJavaModelStatus", "validateClasspath", "(", "IJavaProject", "javaProject", ",", "IClasspathEntry", "[", "]", "rawClasspath", ",", "IPath", "projectOutputLocation", ")", "{", "return", "ClasspathEntry", ".", "validateClasspath", "(", "javaProject", ",", "rawClasspath", ",", "projectOutputLocation", ")", ";", "}", "public", "static", "IJavaModelStatus", "validateClasspathEntry", "(", "IJavaProject", "project", ",", "IClasspathEntry", "entry", ",", "boolean", "checkSourceAttachment", ")", "{", "return", "ClasspathEntry", ".", "validateClasspathEntry", "(", "project", ",", "entry", ",", "checkSourceAttachment", ",", "false", ")", ";", "}", "public", "static", "IStatus", "validateTypeVariableName", "(", "String", "name", ")", "{", "return", "validateIdentifier", "(", "name", ",", "CompilerOptions", ".", "VERSION_1_3", ",", "CompilerOptions", ".", "VERSION_1_3", ")", ";", "}", "public", "static", "IStatus", "validateTypeVariableName", "(", "String", "name", ",", "String", "sourceLevel", ",", "String", "complianceLevel", ")", "{", "return", "validateIdentifier", "(", "name", ",", "sourceLevel", ",", "complianceLevel", ")", ";", "}", "}", "</s>" ]
3,630
[ "<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>" ]
3,631
[ "<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>" ]
3,632
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "ScannerHelper", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "INamingRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "InternalNamingConventions", ";", "public", "final", "class", "NamingConventions", "{", "static", "class", "NamingRequestor", "implements", "INamingRequestor", "{", "private", "final", "static", "int", "SIZE", "=", "10", ";", "private", "char", "[", "]", "[", "]", "firstPrefixAndFirstSuffixResults", "=", "new", "char", "[", "SIZE", "]", "[", "]", ";", "private", "int", "firstPrefixAndFirstSuffixResultsCount", "=", "0", ";", "private", "char", "[", "]", "[", "]", "firstPrefixAndSuffixResults", "=", "new", "char", "[", "SIZE", "]", "[", "]", ";", "private", "int", "firstPrefixAndSuffixResultsCount", "=", "0", ";", "private", "char", "[", "]", "[", "]", "prefixAndFirstSuffixResults", "=", "new", "char", "[", "SIZE", "]", "[", "]", ";", "private", "int", "prefixAndFirstSuffixResultsCount", "=", "0", ";", "private", "char", "[", "]", "[", "]", "prefixAndSuffixResults", "=", "new", "char", "[", "SIZE", "]", "[", "]", ";", "private", "int", "prefixAndSuffixResultsCount", "=", "0", ";", "private", "char", "[", "]", "[", "]", "firstPrefixResults", "=", "new", "char", "[", "SIZE", "]", "[", "]", ";", "private", "int", "firstPrefixResultsCount", "=", "0", ";", "private", "char", "[", "]", "[", "]", "prefixResults", "=", "new", "char", "[", "SIZE", "]", "[", "]", ";", "private", "int", "prefixResultsCount", "=", "0", ";", "private", "char", "[", "]", "[", "]", "firstSuffixResults", "=", "new", "char", "[", "SIZE", "]", "[", "]", ";", "private", "int", "firstSuffixResultsCount", "=", "0", ";", "private", "char", "[", "]", "[", "]", "suffixResults", "=", "new", "char", "[", "SIZE", "]", "[", "]", ";", "private", "int", "suffixResultsCount", "=", "0", ";", "private", "char", "[", "]", "[", "]", "otherResults", "=", "new", "char", "[", "SIZE", "]", "[", "]", ";", "private", "int", "otherResultsCount", "=", "0", ";", "public", "void", "acceptNameWithoutPrefixAndSuffix", "(", "char", "[", "]", "name", ",", "int", "reusedCharacters", ")", "{", "int", "length", "=", "this", ".", "otherResults", ".", "length", ";", "if", "(", "length", "==", "this", ".", "otherResultsCount", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "otherResults", ",", "0", ",", "this", ".", "otherResults", "=", "new", "char", "[", "length", "*", "2", "]", "[", "]", ",", "0", ",", "length", ")", ";", "}", "this", ".", "otherResults", "[", "this", ".", "otherResultsCount", "++", "]", "=", "name", ";", "}", "public", "void", "acceptNameWithPrefix", "(", "char", "[", "]", "name", ",", "boolean", "isFirstPrefix", ",", "int", "reusedCharacters", ")", "{", "if", "(", "isFirstPrefix", ")", "{", "int", "length", "=", "this", ".", "firstPrefixResults", ".", "length", ";", "if", "(", "length", "==", "this", ".", "firstPrefixResultsCount", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "firstPrefixResults", ",", "0", ",", "this", ".", "firstPrefixResults", "=", "new", "char", "[", "length", "*", "2", "]", "[", "]", ",", "0", ",", "length", ")", ";", "}", "this", ".", "firstPrefixResults", "[", "this", ".", "firstPrefixResultsCount", "++", "]", "=", "name", ";", "}", "else", "{", "int", "length", "=", "this", ".", "prefixResults", ".", "length", ";", "if", "(", "length", "==", "this", ".", "prefixResultsCount", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "prefixResults", ",", "0", ",", "this", ".", "prefixResults", "=", "new", "char", "[", "length", "*", "2", "]", "[", "]", ",", "0", ",", "length", ")", ";", "}", "this", ".", "prefixResults", "[", "this", ".", "prefixResultsCount", "++", "]", "=", "name", ";", "}", "}", "public", "void", "acceptNameWithPrefixAndSuffix", "(", "char", "[", "]", "name", ",", "boolean", "isFirstPrefix", ",", "boolean", "isFirstSuffix", ",", "int", "reusedCharacters", ")", "{", "if", "(", "isFirstPrefix", "&&", "isFirstSuffix", ")", "{", "int", "length", "=", "this", ".", "firstPrefixAndFirstSuffixResults", ".", "length", ";", "if", "(", "length", "==", "this", ".", "firstPrefixAndFirstSuffixResultsCount", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "firstPrefixAndFirstSuffixResults", ",", "0", ",", "this", ".", "firstPrefixAndFirstSuffixResults", "=", "new", "char", "[", "length", "*", "2", "]", "[", "]", ",", "0", ",", "length", ")", ";", "}", "this", ".", "firstPrefixAndFirstSuffixResults", "[", "this", ".", "firstPrefixAndFirstSuffixResultsCount", "++", "]", "=", "name", ";", "}", "else", "if", "(", "isFirstPrefix", ")", "{", "int", "length", "=", "this", ".", "firstPrefixAndSuffixResults", ".", "length", ";", "if", "(", "length", "==", "this", ".", "firstPrefixAndSuffixResultsCount", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "firstPrefixAndSuffixResults", ",", "0", ",", "this", ".", "firstPrefixAndSuffixResults", "=", "new", "char", "[", "length", "*", "2", "]", "[", "]", ",", "0", ",", "length", ")", ";", "}", "this", ".", "firstPrefixAndSuffixResults", "[", "this", ".", "firstPrefixAndSuffixResultsCount", "++", "]", "=", "name", ";", "}", "else", "if", "(", "isFirstSuffix", ")", "{", "int", "length", "=", "this", ".", "prefixAndFirstSuffixResults", ".", "length", ";", "if", "(", "length", "==", "this", ".", "prefixAndFirstSuffixResultsCount", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "prefixAndFirstSuffixResults", ",", "0", ",", "this", ".", "prefixAndFirstSuffixResults", "=", "new", "char", "[", "length", "*", "2", "]", "[", "]", ",", "0", ",", "length", ")", ";", "}", "this", ".", "prefixAndFirstSuffixResults", "[", "this", ".", "prefixAndFirstSuffixResultsCount", "++", "]", "=", "name", ";", "}", "else", "{", "int", "length", "=", "this", ".", "prefixAndSuffixResults", ".", "length", ";", "if", "(", "length", "==", "this", ".", "prefixAndSuffixResultsCount", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "prefixAndSuffixResults", ",", "0", ",", "this", ".", "prefixAndSuffixResults", "=", "new", "char", "[", "length", "*", "2", "]", "[", "]", ",", "0", ",", "length", ")", ";", "}", "this", ".", "prefixAndSuffixResults", "[", "this", ".", "prefixAndSuffixResultsCount", "++", "]", "=", "name", ";", "}", "}", "public", "void", "acceptNameWithSuffix", "(", "char", "[", "]", "name", ",", "boolean", "isFirstSuffix", ",", "int", "reusedCharacters", ")", "{", "if", "(", "isFirstSuffix", ")", "{", "int", "length", "=", "this", ".", "firstSuffixResults", ".", "length", ";", "if", "(", "length", "==", "this", ".", "firstSuffixResultsCount", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "firstSuffixResults", ",", "0", ",", "this", ".", "firstSuffixResults", "=", "new", "char", "[", "length", "*", "2", "]", "[", "]", ",", "0", ",", "length", ")", ";", "}", "this", ".", "firstSuffixResults", "[", "this", ".", "firstSuffixResultsCount", "++", "]", "=", "name", ";", "}", "else", "{", "int", "length", "=", "this", ".", "suffixResults", ".", "length", ";", "if", "(", "length", "==", "this", ".", "suffixResultsCount", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "suffixResults", ",", "0", ",", "this", ".", "suffixResults", "=", "new", "char", "[", "length", "*", "2", "]", "[", "]", ",", "0", ",", "length", ")", ";", "}", "this", ".", "suffixResults", "[", "this", ".", "suffixResultsCount", "++", "]", "=", "name", ";", "}", "}", "public", "char", "[", "]", "[", "]", "getResults", "(", ")", "{", "int", "count", "=", "this", ".", "firstPrefixAndFirstSuffixResultsCount", "+", "this", ".", "firstPrefixAndSuffixResultsCount", "+", "this", ".", "prefixAndFirstSuffixResultsCount", "+", "this", ".", "prefixAndSuffixResultsCount", "+", "this", ".", "firstPrefixResultsCount", "+", "this", ".", "prefixResultsCount", "+", "this", ".", "firstSuffixResultsCount", "+", "this", ".", "suffixResultsCount", "+", "this", ".", "otherResultsCount", ";", "char", "[", "]", "[", "]", "results", "=", "new", "char", "[", "count", "]", "[", "]", ";", "int", "index", "=", "0", ";", "System", ".", "arraycopy", "(", "this", ".", "firstPrefixAndFirstSuffixResults", ",", "0", ",", "results", ",", "index", ",", "this", ".", "firstPrefixAndFirstSuffixResultsCount", ")", ";", "index", "+=", "this", ".", "firstPrefixAndFirstSuffixResultsCount", ";", "System", ".", "arraycopy", "(", "this", ".", "firstPrefixAndSuffixResults", ",", "0", ",", "results", ",", "index", ",", "this", ".", "firstPrefixAndSuffixResultsCount", ")", ";", "index", "+=", "this", ".", "firstPrefixAndSuffixResultsCount", ";", "System", ".", "arraycopy", "(", "this", ".", "prefixAndFirstSuffixResults", ",", "0", ",", "results", ",", "index", ",", "this", ".", "prefixAndFirstSuffixResultsCount", ")", ";", "index", "+=", "this", ".", "prefixAndFirstSuffixResultsCount", ";", "System", ".", "arraycopy", "(", "this", ".", "prefixAndSuffixResults", ",", "0", ",", "results", ",", "index", ",", "this", ".", "prefixAndSuffixResultsCount", ")", ";", "index", "+=", "this", ".", "prefixAndSuffixResultsCount", ";", "System", ".", "arraycopy", "(", "this", ".", "firstPrefixResults", ",", "0", ",", "results", ",", "index", ",", "this", ".", "firstPrefixResultsCount", ")", ";", "index", "+=", "this", ".", "firstPrefixResultsCount", ";", "System", ".", "arraycopy", "(", "this", ".", "prefixResults", ",", "0", ",", "results", ",", "index", ",", "this", ".", "prefixResultsCount", ")", ";", "index", "+=", "this", ".", "prefixResultsCount", ";", "System", ".", "arraycopy", "(", "this", ".", "firstSuffixResults", ",", "0", ",", "results", ",", "index", ",", "this", ".", "firstSuffixResultsCount", ")", ";", "index", "+=", "this", ".", "firstSuffixResultsCount", ";", "System", ".", "arraycopy", "(", "this", ".", "suffixResults", ",", "0", ",", "results", ",", "index", ",", "this", ".", "suffixResultsCount", ")", ";", "index", "+=", "this", ".", "suffixResultsCount", ";", "System", ".", "arraycopy", "(", "this", ".", "otherResults", ",", "0", ",", "results", ",", "index", ",", "this", ".", "otherResultsCount", ")", ";", "return", "results", ";", "}", "}", "private", "static", "final", "char", "[", "]", "GETTER_BOOL_NAME", "=", "\"is\"", ".", "toCharArray", "(", ")", ";", "private", "static", "final", "char", "[", "]", "GETTER_NAME", "=", "\"get\"", ".", "toCharArray", "(", ")", ";", "private", "static", "final", "char", "[", "]", "SETTER_NAME", "=", "\"set\"", ".", "toCharArray", "(", ")", ";", "public", "static", "final", "int", "VK_STATIC_FIELD", "=", "InternalNamingConventions", ".", "VK_STATIC_FIELD", ";", "public", "static", "final", "int", "VK_INSTANCE_FIELD", "=", "InternalNamingConventions", ".", "VK_INSTANCE_FIELD", ";", "public", "static", "final", "int", "VK_STATIC_FINAL_FIELD", "=", "InternalNamingConventions", ".", "VK_STATIC_FINAL_FIELD", ";", "public", "static", "final", "int", "VK_PARAMETER", "=", "InternalNamingConventions", ".", "VK_PARAMETER", ";", "public", "static", "final", "int", "VK_LOCAL", "=", "InternalNamingConventions", ".", "VK_LOCAL", ";", "public", "static", "final", "int", "BK_NAME", "=", "InternalNamingConventions", ".", "BK_SIMPLE_NAME", ";", "public", "static", "final", "int", "BK_TYPE_NAME", "=", "InternalNamingConventions", ".", "BK_SIMPLE_TYPE_NAME", ";", "private", "static", "String", "[", "]", "convertCharsToString", "(", "char", "[", "]", "[", "]", "c", ")", "{", "int", "length", "=", "c", "==", "null", "?", "0", ":", "c", ".", "length", ";", "String", "[", "]", "s", "=", "new", "String", "[", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "s", "[", "i", "]", "=", "String", ".", "valueOf", "(", "c", "[", "i", "]", ")", ";", "}", "return", "s", ";", "}", "private", "static", "char", "[", "]", "[", "]", "convertStringToChars", "(", "String", "[", "]", "s", ")", "{", "int", "length", "=", "s", "==", "null", "?", "0", ":", "s", ".", "length", ";", "char", "[", "]", "[", "]", "c", "=", "new", "char", "[", "length", "]", "[", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "if", "(", "s", "[", "i", "]", "==", "null", ")", "{", "c", "[", "i", "]", "=", "CharOperation", ".", "NO_CHAR", ";", "}", "else", "{", "c", "[", "i", "]", "=", "s", "[", "i", "]", ".", "toCharArray", "(", ")", ";", "}", "}", "return", "c", ";", "}", "public", "static", "char", "[", "]", "removePrefixAndSuffixForArgumentName", "(", "IJavaProject", "javaProject", ",", "char", "[", "]", "argumentName", ")", "{", "return", "InternalNamingConventions", ".", "removeVariablePrefixAndSuffix", "(", "VK_PARAMETER", ",", "javaProject", ",", "argumentName", ")", ";", "}", "public", "static", "String", "removePrefixAndSuffixForArgumentName", "(", "IJavaProject", "javaProject", ",", "String", "argumentName", ")", "{", "return", "String", ".", "valueOf", "(", "removePrefixAndSuffixForArgumentName", "(", "javaProject", ",", "argumentName", ".", "toCharArray", "(", ")", ")", ")", ";", "}", "public", "static", "char", "[", "]", "removePrefixAndSuffixForFieldName", "(", "IJavaProject", "javaProject", ",", "char", "[", "]", "fieldName", ",", "int", "modifiers", ")", "{", "return", "InternalNamingConventions", ".", "removeVariablePrefixAndSuffix", "(", "Flags", ".", "isStatic", "(", "modifiers", ")", "?", "VK_STATIC_FIELD", ":", "VK_INSTANCE_FIELD", ",", "javaProject", ",", "fieldName", ")", ";", "}", "public", "static", "String", "removePrefixAndSuffixForFieldName", "(", "IJavaProject", "javaProject", ",", "String", "fieldName", ",", "int", "modifiers", ")", "{", "return", "String", ".", "valueOf", "(", "removePrefixAndSuffixForFieldName", "(", "javaProject", ",", "fieldName", ".", "toCharArray", "(", ")", ",", "modifiers", ")", ")", ";", "}", "public", "static", "char", "[", "]", "removePrefixAndSuffixForLocalVariableName", "(", "IJavaProject", "javaProject", ",", "char", "[", "]", "localName", ")", "{", "return", "InternalNamingConventions", ".", "removeVariablePrefixAndSuffix", "(", "VK_LOCAL", ",", "javaProject", ",", "localName", ")", ";", "}", "public", "static", "String", "removePrefixAndSuffixForLocalVariableName", "(", "IJavaProject", "javaProject", ",", "String", "localName", ")", "{", "return", "String", ".", "valueOf", "(", "removePrefixAndSuffixForLocalVariableName", "(", "javaProject", ",", "localName", ".", "toCharArray", "(", ")", ")", ")", ";", "}", "public", "static", "String", "getBaseName", "(", "int", "variableKind", ",", "String", "variableName", ",", "IJavaProject", "javaProject", ")", "{", "return", "String", ".", "valueOf", "(", "InternalNamingConventions", ".", "getBaseName", "(", "variableKind", ",", "javaProject", ",", "variableName", ".", "toCharArray", "(", ")", ",", "true", ")", ")", ";", "}", "private", "static", "int", "getFieldVariableKind", "(", "int", "modifiers", ")", "{", "if", "(", "Flags", ".", "isStatic", "(", "modifiers", ")", ")", "{", "if", "(", "Flags", ".", "isFinal", "(", "modifiers", ")", ")", "{", "return", "VK_STATIC_FINAL_FIELD", ";", "}", "return", "VK_STATIC_FIELD", ";", "}", "return", "VK_INSTANCE_FIELD", ";", "}", "private", "static", "char", "[", "]", "suggestAccessorName", "(", "IJavaProject", "project", ",", "char", "[", "]", "fieldName", ",", "int", "modifiers", ")", "{", "char", "[", "]", "name", "=", "InternalNamingConventions", ".", "getBaseName", "(", "getFieldVariableKind", "(", "modifiers", ")", ",", "project", ",", "fieldName", ",", "false", ")", ";", "if", "(", "name", ".", "length", ">", "0", "&&", "ScannerHelper", ".", "isLowerCase", "(", "name", "[", "0", "]", ")", ")", "{", "if", "(", "name", ".", "length", "==", "1", "||", "!", "ScannerHelper", ".", "isUpperCase", "(", "name", "[", "1", "]", ")", ")", "{", "name", "[", "0", "]", "=", "ScannerHelper", ".", "toUpperCase", "(", "name", "[", "0", "]", ")", ";", "}", "}", "return", "name", ";", "}", "public", "static", "char", "[", "]", "[", "]", "suggestArgumentNames", "(", "IJavaProject", "javaProject", ",", "char", "[", "]", "packageName", ",", "char", "[", "]", "qualifiedTypeName", ",", "int", "dim", ",", "char", "[", "]", "[", "]", "excludedNames", ")", "{", "if", "(", "qualifiedTypeName", "==", "null", "||", "qualifiedTypeName", ".", "length", "==", "0", ")", "return", "CharOperation", ".", "NO_CHAR_CHAR", ";", "char", "[", "]", "typeName", "=", "CharOperation", ".", "lastSegment", "(", "qualifiedTypeName", ",", "'.'", ")", ";", "NamingRequestor", "requestor", "=", "new", "NamingRequestor", "(", ")", ";", "InternalNamingConventions", ".", "suggestVariableNames", "(", "VK_PARAMETER", ",", "BK_TYPE_NAME", ",", "typeName", ",", "javaProject", ",", "dim", ",", "null", ",", "excludedNames", ",", "true", ",", "requestor", ")", ";", "return", "requestor", ".", "getResults", "(", ")", ";", "}", "public", "static", "String", "[", "]", "suggestArgumentNames", "(", "IJavaProject", "javaProject", ",", "String", "packageName", ",", "String", "qualifiedTypeName", ",", "int", "dim", ",", "String", "[", "]", "excludedNames", ")", "{", "return", "convertCharsToString", "(", "suggestArgumentNames", "(", "javaProject", ",", "packageName", ".", "toCharArray", "(", ")", ",", "qualifiedTypeName", ".", "toCharArray", "(", ")", ",", "dim", ",", "convertStringToChars", "(", "excludedNames", ")", ")", ")", ";", "}", "public", "static", "char", "[", "]", "[", "]", "suggestFieldNames", "(", "IJavaProject", "javaProject", ",", "char", "[", "]", "packageName", ",", "char", "[", "]", "qualifiedTypeName", ",", "int", "dim", ",", "int", "modifiers", ",", "char", "[", "]", "[", "]", "excludedNames", ")", "{", "if", "(", "qualifiedTypeName", "==", "null", "||", "qualifiedTypeName", ".", "length", "==", "0", ")", "return", "CharOperation", ".", "NO_CHAR_CHAR", ";", "char", "[", "]", "typeName", "=", "CharOperation", ".", "lastSegment", "(", "qualifiedTypeName", ",", "'.'", ")", ";", "NamingRequestor", "requestor", "=", "new", "NamingRequestor", "(", ")", ";", "InternalNamingConventions", ".", "suggestVariableNames", "(", "Flags", ".", "isStatic", "(", "modifiers", ")", "?", "VK_STATIC_FIELD", ":", "VK_INSTANCE_FIELD", ",", "BK_TYPE_NAME", ",", "typeName", ",", "javaProject", ",", "dim", ",", "null", ",", "excludedNames", ",", "true", ",", "requestor", ")", ";", "return", "requestor", ".", "getResults", "(", ")", ";", "}", "public", "static", "String", "[", "]", "suggestFieldNames", "(", "IJavaProject", "javaProject", ",", "String", "packageName", ",", "String", "qualifiedTypeName", ",", "int", "dim", ",", "int", "modifiers", ",", "String", "[", "]", "excludedNames", ")", "{", "return", "convertCharsToString", "(", "suggestFieldNames", "(", "javaProject", ",", "packageName", ".", "toCharArray", "(", ")", ",", "qualifiedTypeName", ".", "toCharArray", "(", ")", ",", "dim", ",", "modifiers", ",", "convertStringToChars", "(", "excludedNames", ")", ")", ")", ";", "}", "public", "static", "char", "[", "]", "suggestGetterName", "(", "IJavaProject", "project", ",", "char", "[", "]", "fieldName", ",", "int", "modifiers", ",", "boolean", "isBoolean", ",", "char", "[", "]", "[", "]", "excludedNames", ")", "{", "if", "(", "isBoolean", ")", "{", "char", "[", "]", "name", "=", "InternalNamingConventions", ".", "getBaseName", "(", "getFieldVariableKind", "(", "modifiers", ")", ",", "project", ",", "fieldName", ",", "false", ")", ";", "int", "prefixLen", "=", "GETTER_BOOL_NAME", ".", "length", ";", "if", "(", "CharOperation", ".", "prefixEquals", "(", "GETTER_BOOL_NAME", ",", "name", ")", "&&", "name", ".", "length", ">", "prefixLen", "&&", "ScannerHelper", ".", "isUpperCase", "(", "name", "[", "prefixLen", "]", ")", ")", "{", "return", "suggestNewName", "(", "name", ",", "excludedNames", ")", ";", "}", "else", "{", "return", "suggestNewName", "(", "CharOperation", ".", "concat", "(", "GETTER_BOOL_NAME", ",", "suggestAccessorName", "(", "project", ",", "fieldName", ",", "modifiers", ")", ")", ",", "excludedNames", ")", ";", "}", "}", "else", "{", "return", "suggestNewName", "(", "CharOperation", ".", "concat", "(", "GETTER_NAME", ",", "suggestAccessorName", "(", "project", ",", "fieldName", ",", "modifiers", ")", ")", ",", "excludedNames", ")", ";", "}", "}", "public", "static", "String", "suggestGetterName", "(", "IJavaProject", "project", ",", "String", "fieldName", ",", "int", "modifiers", ",", "boolean", "isBoolean", ",", "String", "[", "]", "excludedNames", ")", "{", "return", "String", ".", "valueOf", "(", "suggestGetterName", "(", "project", ",", "fieldName", ".", "toCharArray", "(", ")", ",", "modifiers", ",", "isBoolean", ",", "convertStringToChars", "(", "excludedNames", ")", ")", ")", ";", "}", "public", "static", "char", "[", "]", "[", "]", "suggestLocalVariableNames", "(", "IJavaProject", "javaProject", ",", "char", "[", "]", "packageName", ",", "char", "[", "]", "qualifiedTypeName", ",", "int", "dim", ",", "char", "[", "]", "[", "]", "excludedNames", ")", "{", "if", "(", "qualifiedTypeName", "==", "null", "||", "qualifiedTypeName", ".", "length", "==", "0", ")", "return", "CharOperation", ".", "NO_CHAR_CHAR", ";", "char", "[", "]", "typeName", "=", "CharOperation", ".", "lastSegment", "(", "qualifiedTypeName", ",", "'.'", ")", ";", "NamingRequestor", "requestor", "=", "new", "NamingRequestor", "(", ")", ";", "InternalNamingConventions", ".", "suggestVariableNames", "(", "VK_LOCAL", ",", "BK_TYPE_NAME", ",", "typeName", ",", "javaProject", ",", "dim", ",", "null", ",", "excludedNames", ",", "true", ",", "requestor", ")", ";", "return", "requestor", ".", "getResults", "(", ")", ";", "}", "public", "static", "String", "[", "]", "suggestLocalVariableNames", "(", "IJavaProject", "javaProject", ",", "String", "packageName", ",", "String", "qualifiedTypeName", ",", "int", "dim", ",", "String", "[", "]", "excludedNames", ")", "{", "return", "convertCharsToString", "(", "suggestLocalVariableNames", "(", "javaProject", ",", "packageName", ".", "toCharArray", "(", ")", ",", "qualifiedTypeName", ".", "toCharArray", "(", ")", ",", "dim", ",", "convertStringToChars", "(", "excludedNames", ")", ")", ")", ";", "}", "private", "static", "char", "[", "]", "suggestNewName", "(", "char", "[", "]", "name", ",", "char", "[", "]", "[", "]", "excludedNames", ")", "{", "if", "(", "excludedNames", "==", "null", ")", "{", "return", "name", ";", "}", "char", "[", "]", "newName", "=", "name", ";", "int", "count", "=", "2", ";", "int", "i", "=", "0", ";", "while", "(", "i", "<", "excludedNames", ".", "length", ")", "{", "if", "(", "CharOperation", ".", "equals", "(", "newName", ",", "excludedNames", "[", "i", "]", ",", "false", ")", ")", "{", "newName", "=", "CharOperation", ".", "concat", "(", "name", ",", "String", ".", "valueOf", "(", "count", "++", ")", ".", "toCharArray", "(", ")", ")", ";", "i", "=", "0", ";", "}", "else", "{", "i", "++", ";", "}", "}", "return", "newName", ";", "}", "public", "static", "char", "[", "]", "suggestSetterName", "(", "IJavaProject", "project", ",", "char", "[", "]", "fieldName", ",", "int", "modifiers", ",", "boolean", "isBoolean", ",", "char", "[", "]", "[", "]", "excludedNames", ")", "{", "if", "(", "isBoolean", ")", "{", "char", "[", "]", "name", "=", "InternalNamingConventions", ".", "getBaseName", "(", "getFieldVariableKind", "(", "modifiers", ")", ",", "project", ",", "fieldName", ",", "false", ")", ";", "int", "prefixLen", "=", "GETTER_BOOL_NAME", ".", "length", ";", "if", "(", "CharOperation", ".", "prefixEquals", "(", "GETTER_BOOL_NAME", ",", "name", ")", "&&", "name", ".", "length", ">", "prefixLen", "&&", "ScannerHelper", ".", "isUpperCase", "(", "name", "[", "prefixLen", "]", ")", ")", "{", "name", "=", "CharOperation", ".", "subarray", "(", "name", ",", "prefixLen", ",", "name", ".", "length", ")", ";", "return", "suggestNewName", "(", "CharOperation", ".", "concat", "(", "SETTER_NAME", ",", "suggestAccessorName", "(", "project", ",", "name", ",", "modifiers", ")", ")", ",", "excludedNames", ")", ";", "}", "else", "{", "return", "suggestNewName", "(", "CharOperation", ".", "concat", "(", "SETTER_NAME", ",", "suggestAccessorName", "(", "project", ",", "fieldName", ",", "modifiers", ")", ")", ",", "excludedNames", ")", ";", "}", "}", "else", "{", "return", "suggestNewName", "(", "CharOperation", ".", "concat", "(", "SETTER_NAME", ",", "suggestAccessorName", "(", "project", ",", "fieldName", ",", "modifiers", ")", ")", ",", "excludedNames", ")", ";", "}", "}", "public", "static", "String", "suggestSetterName", "(", "IJavaProject", "project", ",", "String", "fieldName", ",", "int", "modifiers", ",", "boolean", "isBoolean", ",", "String", "[", "]", "excludedNames", ")", "{", "return", "String", ".", "valueOf", "(", "suggestSetterName", "(", "project", ",", "fieldName", ".", "toCharArray", "(", ")", ",", "modifiers", ",", "isBoolean", ",", "convertStringToChars", "(", "excludedNames", ")", ")", ")", ";", "}", "public", "static", "String", "[", "]", "suggestVariableNames", "(", "int", "variableKind", ",", "int", "baseNameKind", ",", "String", "baseName", ",", "IJavaProject", "javaProject", ",", "int", "dim", ",", "String", "[", "]", "excluded", ",", "boolean", "evaluateDefault", ")", "{", "NamingRequestor", "requestor", "=", "new", "NamingRequestor", "(", ")", ";", "InternalNamingConventions", ".", "suggestVariableNames", "(", "variableKind", ",", "baseNameKind", ",", "baseName", ".", "toCharArray", "(", ")", ",", "javaProject", ",", "dim", ",", "null", ",", "convertStringToChars", "(", "excluded", ")", ",", "evaluateDefault", ",", "requestor", ")", ";", "return", "convertCharsToString", "(", "requestor", ".", "getResults", "(", ")", ")", ";", "}", "private", "NamingConventions", "(", ")", "{", "}", "}", "</s>" ]
3,633
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "public", "abstract", "class", "ClasspathVariableInitializer", "{", "public", "ClasspathVariableInitializer", "(", ")", "{", "}", "public", "abstract", "void", "initialize", "(", "String", "variable", ")", ";", "}", "</s>" ]
3,634
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "public", "interface", "IClasspathEntry", "{", "int", "CPE_LIBRARY", "=", "1", ";", "int", "CPE_PROJECT", "=", "2", ";", "int", "CPE_SOURCE", "=", "3", ";", "int", "CPE_VARIABLE", "=", "4", ";", "int", "CPE_CONTAINER", "=", "5", ";", "boolean", "combineAccessRules", "(", ")", ";", "IAccessRule", "[", "]", "getAccessRules", "(", ")", ";", "int", "getContentKind", "(", ")", ";", "int", "getEntryKind", "(", ")", ";", "IPath", "[", "]", "getExclusionPatterns", "(", ")", ";", "IClasspathAttribute", "[", "]", "getExtraAttributes", "(", ")", ";", "IPath", "[", "]", "getInclusionPatterns", "(", ")", ";", "IPath", "getOutputLocation", "(", ")", ";", "IPath", "getPath", "(", ")", ";", "IPath", "getSourceAttachmentPath", "(", ")", ";", "IPath", "getSourceAttachmentRootPath", "(", ")", ";", "IClasspathEntry", "getReferencingEntry", "(", ")", ";", "boolean", "isExported", "(", ")", ";", "IClasspathEntry", "getResolvedEntry", "(", ")", ";", "}", "</s>" ]
3,635
[ "<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>" ]
3,636
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "import", "java", ".", "io", ".", "InputStream", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "public", "interface", "IType", "extends", "IMember", ",", "IAnnotatable", "{", "void", "codeComplete", "(", "char", "[", "]", "snippet", ",", "int", "insertion", ",", "int", "position", ",", "char", "[", "]", "[", "]", "localVariableTypeNames", ",", "char", "[", "]", "[", "]", "localVariableNames", ",", "int", "[", "]", "localVariableModifiers", ",", "boolean", "isStatic", ",", "ICompletionRequestor", "requestor", ")", "throws", "JavaModelException", ";", "void", "codeComplete", "(", "char", "[", "]", "snippet", ",", "int", "insertion", ",", "int", "position", ",", "char", "[", "]", "[", "]", "localVariableTypeNames", ",", "char", "[", "]", "[", "]", "localVariableNames", ",", "int", "[", "]", "localVariableModifiers", ",", "boolean", "isStatic", ",", "ICompletionRequestor", "requestor", ",", "WorkingCopyOwner", "owner", ")", "throws", "JavaModelException", ";", "void", "codeComplete", "(", "char", "[", "]", "snippet", ",", "int", "insertion", ",", "int", "position", ",", "char", "[", "]", "[", "]", "localVariableTypeNames", ",", "char", "[", "]", "[", "]", "localVariableNames", ",", "int", "[", "]", "localVariableModifiers", ",", "boolean", "isStatic", ",", "CompletionRequestor", "requestor", ")", "throws", "JavaModelException", ";", "void", "codeComplete", "(", "char", "[", "]", "snippet", ",", "int", "insertion", ",", "int", "position", ",", "char", "[", "]", "[", "]", "localVariableTypeNames", ",", "char", "[", "]", "[", "]", "localVariableNames", ",", "int", "[", "]", "localVariableModifiers", ",", "boolean", "isStatic", ",", "CompletionRequestor", "requestor", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "void", "codeComplete", "(", "char", "[", "]", "snippet", ",", "int", "insertion", ",", "int", "position", ",", "char", "[", "]", "[", "]", "localVariableTypeNames", ",", "char", "[", "]", "[", "]", "localVariableNames", ",", "int", "[", "]", "localVariableModifiers", ",", "boolean", "isStatic", ",", "CompletionRequestor", "requestor", ",", "WorkingCopyOwner", "owner", ")", "throws", "JavaModelException", ";", "void", "codeComplete", "(", "char", "[", "]", "snippet", ",", "int", "insertion", ",", "int", "position", ",", "char", "[", "]", "[", "]", "localVariableTypeNames", ",", "char", "[", "]", "[", "]", "localVariableNames", ",", "int", "[", "]", "localVariableModifiers", ",", "boolean", "isStatic", ",", "CompletionRequestor", "requestor", ",", "WorkingCopyOwner", "owner", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "IField", "createField", "(", "String", "contents", ",", "IJavaElement", "sibling", ",", "boolean", "force", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "IInitializer", "createInitializer", "(", "String", "contents", ",", "IJavaElement", "sibling", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "IMethod", "createMethod", "(", "String", "contents", ",", "IJavaElement", "sibling", ",", "boolean", "force", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "IType", "createType", "(", "String", "contents", ",", "IJavaElement", "sibling", ",", "boolean", "force", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "IMethod", "[", "]", "findMethods", "(", "IMethod", "method", ")", ";", "IJavaElement", "[", "]", "getChildrenForCategory", "(", "String", "category", ")", "throws", "JavaModelException", ";", "String", "getElementName", "(", ")", ";", "IField", "getField", "(", "String", "name", ")", ";", "IField", "[", "]", "getFields", "(", ")", "throws", "JavaModelException", ";", "String", "getFullyQualifiedName", "(", ")", ";", "String", "getFullyQualifiedName", "(", "char", "enclosingTypeSeparator", ")", ";", "String", "getFullyQualifiedParameterizedName", "(", ")", "throws", "JavaModelException", ";", "IInitializer", "getInitializer", "(", "int", "occurrenceCount", ")", ";", "IInitializer", "[", "]", "getInitializers", "(", ")", "throws", "JavaModelException", ";", "String", "getKey", "(", ")", ";", "IMethod", "getMethod", "(", "String", "name", ",", "String", "[", "]", "parameterTypeSignatures", ")", ";", "IMethod", "[", "]", "getMethods", "(", ")", "throws", "JavaModelException", ";", "IPackageFragment", "getPackageFragment", "(", ")", ";", "String", "getSuperclassName", "(", ")", "throws", "JavaModelException", ";", "String", "getSuperclassTypeSignature", "(", ")", "throws", "JavaModelException", ";", "String", "[", "]", "getSuperInterfaceTypeSignatures", "(", ")", "throws", "JavaModelException", ";", "String", "[", "]", "getSuperInterfaceNames", "(", ")", "throws", "JavaModelException", ";", "String", "[", "]", "getTypeParameterSignatures", "(", ")", "throws", "JavaModelException", ";", "ITypeParameter", "[", "]", "getTypeParameters", "(", ")", "throws", "JavaModelException", ";", "IType", "getType", "(", "String", "name", ")", ";", "ITypeParameter", "getTypeParameter", "(", "String", "name", ")", ";", "String", "getTypeQualifiedName", "(", ")", ";", "String", "getTypeQualifiedName", "(", "char", "enclosingTypeSeparator", ")", ";", "IType", "[", "]", "getTypes", "(", ")", "throws", "JavaModelException", ";", "boolean", "isAnonymous", "(", ")", "throws", "JavaModelException", ";", "boolean", "isClass", "(", ")", "throws", "JavaModelException", ";", "boolean", "isEnum", "(", ")", "throws", "JavaModelException", ";", "boolean", "isInterface", "(", ")", "throws", "JavaModelException", ";", "boolean", "isAnnotation", "(", ")", "throws", "JavaModelException", ";", "boolean", "isLocal", "(", ")", "throws", "JavaModelException", ";", "boolean", "isMember", "(", ")", "throws", "JavaModelException", ";", "boolean", "isResolved", "(", ")", ";", "ITypeHierarchy", "loadTypeHierachy", "(", "InputStream", "input", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "ITypeHierarchy", "newSupertypeHierarchy", "(", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "ITypeHierarchy", "newSupertypeHierarchy", "(", "ICompilationUnit", "[", "]", "workingCopies", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "ITypeHierarchy", "newSupertypeHierarchy", "(", "IWorkingCopy", "[", "]", "workingCopies", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "ITypeHierarchy", "newSupertypeHierarchy", "(", "WorkingCopyOwner", "owner", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "ITypeHierarchy", "newTypeHierarchy", "(", "IJavaProject", "project", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "ITypeHierarchy", "newTypeHierarchy", "(", "IJavaProject", "project", ",", "WorkingCopyOwner", "owner", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "ITypeHierarchy", "newTypeHierarchy", "(", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "ITypeHierarchy", "newTypeHierarchy", "(", "ICompilationUnit", "[", "]", "workingCopies", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "ITypeHierarchy", "newTypeHierarchy", "(", "IWorkingCopy", "[", "]", "workingCopies", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "ITypeHierarchy", "newTypeHierarchy", "(", "WorkingCopyOwner", "owner", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", ";", "String", "[", "]", "[", "]", "resolveType", "(", "String", "typeName", ")", "throws", "JavaModelException", ";", "String", "[", "]", "[", "]", "resolveType", "(", "String", "typeName", ",", "WorkingCopyOwner", "owner", ")", "throws", "JavaModelException", ";", "}", "</s>" ]
3,637
[ "<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>" ]
3,638
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "public", "interface", "IAnnotatable", "{", "IAnnotation", "getAnnotation", "(", "String", "name", ")", ";", "IAnnotation", "[", "]", "getAnnotations", "(", ")", "throws", "JavaModelException", ";", "}", "</s>" ]
3,639
[ "<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>" ]
3,640
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "public", "interface", "ILocalVariable", "extends", "IJavaElement", ",", "ISourceReference", ",", "IAnnotatable", "{", "String", "getElementName", "(", ")", ";", "ISourceRange", "getNameRange", "(", ")", ";", "String", "getTypeSignature", "(", ")", ";", "boolean", "isParameter", "(", ")", ";", "int", "getFlags", "(", ")", ";", "IMember", "getDeclaringMember", "(", ")", ";", "ITypeRoot", "getTypeRoot", "(", ")", ";", "}", "</s>" ]
3,641
[ "<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>" ]
3,642
[ "<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>" ]
3,643
[ "<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>" ]
3,644
[ "<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", "{", "String", "CLASSPATH_FILE_NAME", "=", "\".classpath\"", ";", "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>" ]
3,645
[ "<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", ";", "public", "static", "final", "int", "CANNOT_RETRIEVE_ATTACHED_JAVADOC_TIMEOUT", "=", "1012", ";", "public", "static", "final", "int", "OUTPUT_LOCATION_OVERLAPPING_ANOTHER_SOURCE", "=", "1013", ";", "}", "</s>" ]
3,646
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "public", "interface", "IRegion", "{", "void", "add", "(", "IJavaElement", "element", ")", ";", "boolean", "contains", "(", "IJavaElement", "element", ")", ";", "IJavaElement", "[", "]", "getElements", "(", ")", ";", "boolean", "remove", "(", "IJavaElement", "element", ")", ";", "}", "</s>" ]
3,647
[ "<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>" ]
3,648
[ "<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", ";", "int", "getOccurrenceCount", "(", ")", ";", "ITypeRoot", "getTypeRoot", "(", ")", ";", "IType", "getType", "(", "String", "name", ",", "int", "occurrenceCount", ")", ";", "boolean", "isBinary", "(", ")", ";", "}", "</s>" ]
3,649
[ "<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>" ]
3,650
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "public", "interface", "ICodeFormatter", "{", "String", "format", "(", "String", "string", ",", "int", "indentationLevel", ",", "int", "[", "]", "positions", ",", "String", "lineSeparator", ")", ";", "}", "</s>" ]
3,651
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "public", "interface", "IBufferChangedListener", "{", "public", "void", "bufferChanged", "(", "BufferChangedEvent", "event", ")", ";", "}", "</s>" ]
3,652
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "core", ";", "public", "interface", "IElementChangedListener", "{", "public", "void", "elementChanged", "(", "ElementChangedEvent", "event", ")", ";", "}", "</s>" ]
3,653
[ "<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>" ]
3,654
[ "<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>" ]
3,655
[ "<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>" ]
3,656
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "ResourcesPlugin", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IClasspathEntry", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaModel", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "SetVariablesOperation", "extends", "ChangeClasspathOperation", "{", "String", "[", "]", "variableNames", ";", "IPath", "[", "]", "variablePaths", ";", "boolean", "updatePreferences", ";", "public", "SetVariablesOperation", "(", "String", "[", "]", "variableNames", ",", "IPath", "[", "]", "variablePaths", ",", "boolean", "updatePreferences", ")", "{", "super", "(", "new", "IJavaElement", "[", "]", "{", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "getJavaModel", "(", ")", "}", ",", "!", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "isTreeLocked", "(", ")", ")", ";", "this", ".", "variableNames", "=", "variableNames", ";", "this", ".", "variablePaths", "=", "variablePaths", ";", "this", ".", "updatePreferences", "=", "updatePreferences", ";", "}", "protected", "void", "executeOperation", "(", ")", "throws", "JavaModelException", "{", "checkCanceled", "(", ")", ";", "try", "{", "beginTask", "(", "\"\"", ",", "1", ")", ";", "if", "(", "JavaModelManager", ".", "CP_RESOLVE_VERBOSE", ")", "verbose_set_variables", "(", ")", ";", "JavaModelManager", "manager", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ";", "if", "(", "manager", ".", "variablePutIfInitializingWithSameValue", "(", "this", ".", "variableNames", ",", "this", ".", "variablePaths", ")", ")", "return", ";", "int", "varLength", "=", "this", ".", "variableNames", ".", "length", ";", "final", "HashMap", "affectedProjectClasspaths", "=", "new", "HashMap", "(", "5", ")", ";", "IJavaModel", "model", "=", "getJavaModel", "(", ")", ";", "int", "discardCount", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "varLength", ";", "i", "++", ")", "{", "String", "variableName", "=", "this", ".", "variableNames", "[", "i", "]", ";", "IPath", "oldPath", "=", "manager", ".", "variableGet", "(", "variableName", ")", ";", "if", "(", "oldPath", "==", "JavaModelManager", ".", "VARIABLE_INITIALIZATION_IN_PROGRESS", ")", "{", "oldPath", "=", "null", ";", "}", "if", "(", "oldPath", "!=", "null", "&&", "oldPath", ".", "equals", "(", "this", ".", "variablePaths", "[", "i", "]", ")", ")", "{", "this", ".", "variableNames", "[", "i", "]", "=", "null", ";", "discardCount", "++", ";", "}", "}", "if", "(", "discardCount", ">", "0", ")", "{", "if", "(", "discardCount", "==", "varLength", ")", "return", ";", "int", "changedLength", "=", "varLength", "-", "discardCount", ";", "String", "[", "]", "changedVariableNames", "=", "new", "String", "[", "changedLength", "]", ";", "IPath", "[", "]", "changedVariablePaths", "=", "new", "IPath", "[", "changedLength", "]", ";", "for", "(", "int", "i", "=", "0", ",", "index", "=", "0", ";", "i", "<", "varLength", ";", "i", "++", ")", "{", "if", "(", "this", ".", "variableNames", "[", "i", "]", "!=", "null", ")", "{", "changedVariableNames", "[", "index", "]", "=", "this", ".", "variableNames", "[", "i", "]", ";", "changedVariablePaths", "[", "index", "]", "=", "this", ".", "variablePaths", "[", "i", "]", ";", "index", "++", ";", "}", "}", "this", ".", "variableNames", "=", "changedVariableNames", ";", "this", ".", "variablePaths", "=", "changedVariablePaths", ";", "varLength", "=", "changedLength", ";", "}", "if", "(", "isCanceled", "(", ")", ")", "return", ";", "IJavaProject", "[", "]", "projects", "=", "model", ".", "getJavaProjects", "(", ")", ";", "nextProject", ":", "for", "(", "int", "i", "=", "0", ",", "projectLength", "=", "projects", ".", "length", ";", "i", "<", "projectLength", ";", "i", "++", ")", "{", "JavaProject", "project", "=", "(", "JavaProject", ")", "projects", "[", "i", "]", ";", "IClasspathEntry", "[", "]", "classpath", "=", "project", ".", "getRawClasspath", "(", ")", ";", "for", "(", "int", "j", "=", "0", ",", "cpLength", "=", "classpath", ".", "length", ";", "j", "<", "cpLength", ";", "j", "++", ")", "{", "IClasspathEntry", "entry", "=", "classpath", "[", "j", "]", ";", "for", "(", "int", "k", "=", "0", ";", "k", "<", "varLength", ";", "k", "++", ")", "{", "String", "variableName", "=", "this", ".", "variableNames", "[", "k", "]", ";", "if", "(", "entry", ".", "getEntryKind", "(", ")", "==", "IClasspathEntry", ".", "CPE_VARIABLE", ")", "{", "if", "(", "variableName", ".", "equals", "(", "entry", ".", "getPath", "(", ")", ".", "segment", "(", "0", ")", ")", ")", "{", "affectedProjectClasspaths", ".", "put", "(", "project", ",", "project", ".", "getResolvedClasspath", "(", ")", ")", ";", "continue", "nextProject", ";", "}", "IPath", "sourcePath", ",", "sourceRootPath", ";", "if", "(", "(", "(", "sourcePath", "=", "entry", ".", "getSourceAttachmentPath", "(", ")", ")", "!=", "null", "&&", "variableName", ".", "equals", "(", "sourcePath", ".", "segment", "(", "0", ")", ")", ")", "||", "(", "(", "sourceRootPath", "=", "entry", ".", "getSourceAttachmentRootPath", "(", ")", ")", "!=", "null", "&&", "variableName", ".", "equals", "(", "sourceRootPath", ".", "segment", "(", "0", ")", ")", ")", ")", "{", "affectedProjectClasspaths", ".", "put", "(", "project", ",", "project", ".", "getResolvedClasspath", "(", ")", ")", ";", "continue", "nextProject", ";", "}", "}", "}", "}", "}", "for", "(", "int", "i", "=", "0", ";", "i", "<", "varLength", ";", "i", "++", ")", "{", "manager", ".", "variablePut", "(", "this", ".", "variableNames", "[", "i", "]", ",", "this", ".", "variablePaths", "[", "i", "]", ")", ";", "if", "(", "this", ".", "updatePreferences", ")", "manager", ".", "variablePreferencesPut", "(", "this", ".", "variableNames", "[", "i", "]", ",", "this", ".", "variablePaths", "[", "i", "]", ")", ";", "}", "if", "(", "!", "affectedProjectClasspaths", ".", "isEmpty", "(", ")", ")", "{", "String", "[", "]", "dbgVariableNames", "=", "this", ".", "variableNames", ";", "try", "{", "Iterator", "projectsToUpdate", "=", "affectedProjectClasspaths", ".", "keySet", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "projectsToUpdate", ".", "hasNext", "(", ")", ")", "{", "if", "(", "this", ".", "progressMonitor", "!=", "null", "&&", "this", ".", "progressMonitor", ".", "isCanceled", "(", ")", ")", "return", ";", "JavaProject", "affectedProject", "=", "(", "JavaProject", ")", "projectsToUpdate", ".", "next", "(", ")", ";", "if", "(", "JavaModelManager", ".", "CP_RESOLVE_VERBOSE_ADVANCED", ")", "verbose_update_project", "(", "dbgVariableNames", ",", "affectedProject", ")", ";", "ClasspathChange", "classpathChange", "=", "affectedProject", ".", "getPerProjectInfo", "(", ")", ".", "resetResolvedClasspath", "(", ")", ";", "classpathChanged", "(", "classpathChange", ",", "true", ")", ";", "if", "(", "this", ".", "canChangeResources", ")", "{", "affectedProject", ".", "getProject", "(", ")", ".", "touch", "(", "this", ".", "progressMonitor", ")", ";", "}", "}", "}", "catch", "(", "CoreException", "e", ")", "{", "if", "(", "JavaModelManager", ".", "CP_RESOLVE_VERBOSE", "||", "JavaModelManager", ".", "CP_RESOLVE_VERBOSE_FAILURE", ")", "{", "verbose_failure", "(", "dbgVariableNames", ")", ";", "e", ".", "printStackTrace", "(", ")", ";", "}", "if", "(", "e", "instanceof", "JavaModelException", ")", "{", "throw", "(", "JavaModelException", ")", "e", ";", "}", "else", "{", "throw", "new", "JavaModelException", "(", "e", ")", ";", "}", "}", "}", "}", "finally", "{", "done", "(", ")", ";", "}", "}", "private", "void", "verbose_failure", "(", "String", "[", "]", "dbgVariableNames", ")", "{", "Util", ".", "verbose", "(", "\"\"", "+", "\"tvariables:", "\"", "+", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "toString", "(", "dbgVariableNames", ")", ",", "System", ".", "err", ")", ";", "}", "private", "void", "verbose_update_project", "(", "String", "[", "]", "dbgVariableNames", ",", "JavaProject", "affectedProject", ")", "{", "Util", ".", "verbose", "(", "\"\"", "+", "\"tproject:", "\"", "+", "affectedProject", ".", "getElementName", "(", ")", "+", "'\\n'", "+", "\"tvariables:", "\"", "+", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "toString", "(", "dbgVariableNames", ")", ")", ";", "}", "private", "void", "verbose_set_variables", "(", ")", "{", "Util", ".", "verbose", "(", "\"\"", "+", "\"tvariables:", "\"", "+", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "toString", "(", "this", ".", "variableNames", ")", "+", "'\\n'", "+", "\"tvalues:", "\"", "+", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "toString", "(", "this", ".", "variablePaths", ")", ")", ";", "}", "}", "</s>" ]
3,657
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "Flags", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IField", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IMethod", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ITypeParameter", ";", "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", ".", "ast", ".", "ASTNode", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "AbstractMethodDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "AnnotationMethodDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "Argument", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "CompilationUnitDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ConstructorDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "FieldDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "ImportReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "MethodDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "QualifiedTypeReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TypeDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TypeReference", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileReader", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "ExtraCompilerModifiers", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "TypeConverter", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "problem", ".", "ProblemReporter", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "HashSetOfCharArrayArray", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "BinaryTypeConverter", "extends", "TypeConverter", "{", "private", "CompilationResult", "compilationResult", ";", "private", "HashSetOfCharArrayArray", "typeNames", ";", "public", "BinaryTypeConverter", "(", "ProblemReporter", "problemReporter", ",", "CompilationResult", "compilationResult", ",", "HashSetOfCharArrayArray", "typeNames", ")", "{", "super", "(", "problemReporter", ",", "Signature", ".", "C_DOLLAR", ")", ";", "this", ".", "compilationResult", "=", "compilationResult", ";", "this", ".", "typeNames", "=", "typeNames", ";", "}", "public", "ImportReference", "[", "]", "buildImports", "(", "ClassFileReader", "reader", ")", "{", "int", "[", "]", "constantPoolOffsets", "=", "reader", ".", "getConstantPoolOffsets", "(", ")", ";", "int", "constantPoolCount", "=", "constantPoolOffsets", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "constantPoolCount", ";", "i", "++", ")", "{", "int", "tag", "=", "reader", ".", "u1At", "(", "constantPoolOffsets", "[", "i", "]", ")", ";", "char", "[", "]", "name", "=", "null", ";", "switch", "(", "tag", ")", "{", "case", "ClassFileConstants", ".", "MethodRefTag", ":", "case", "ClassFileConstants", ".", "InterfaceMethodRefTag", ":", "int", "constantPoolIndex", "=", "reader", ".", "u2At", "(", "constantPoolOffsets", "[", "i", "]", "+", "3", ")", ";", "int", "utf8Offset", "=", "constantPoolOffsets", "[", "reader", ".", "u2At", "(", "constantPoolOffsets", "[", "constantPoolIndex", "]", "+", "3", ")", "]", ";", "name", "=", "reader", ".", "utf8At", "(", "utf8Offset", "+", "3", ",", "reader", ".", "u2At", "(", "utf8Offset", "+", "1", ")", ")", ";", "break", ";", "case", "ClassFileConstants", ".", "ClassTag", ":", "utf8Offset", "=", "constantPoolOffsets", "[", "reader", ".", "u2At", "(", "constantPoolOffsets", "[", "i", "]", "+", "1", ")", "]", ";", "name", "=", "reader", ".", "utf8At", "(", "utf8Offset", "+", "3", ",", "reader", ".", "u2At", "(", "utf8Offset", "+", "1", ")", ")", ";", "break", ";", "}", "if", "(", "name", "==", "null", "||", "(", "name", ".", "length", ">", "0", "&&", "name", "[", "0", "]", "==", "'['", ")", ")", "break", ";", "this", ".", "typeNames", ".", "add", "(", "CharOperation", ".", "splitOn", "(", "'/'", ",", "name", ")", ")", ";", "}", "int", "typeNamesLength", "=", "this", ".", "typeNames", ".", "size", "(", ")", ";", "ImportReference", "[", "]", "imports", "=", "new", "ImportReference", "[", "typeNamesLength", "]", ";", "char", "[", "]", "[", "]", "[", "]", "set", "=", "this", ".", "typeNames", ".", "set", ";", "int", "index", "=", "0", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "set", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "char", "[", "]", "[", "]", "typeName", "=", "set", "[", "i", "]", ";", "if", "(", "typeName", "!=", "null", ")", "{", "imports", "[", "index", "++", "]", "=", "new", "ImportReference", "(", "typeName", ",", "new", "long", "[", "typeName", ".", "length", "]", ",", "false", ",", "0", ")", ";", "}", "}", "return", "imports", ";", "}", "public", "TypeDeclaration", "buildTypeDeclaration", "(", "IType", "type", ",", "CompilationUnitDeclaration", "compilationUnit", ")", "throws", "JavaModelException", "{", "PackageFragment", "pkg", "=", "(", "PackageFragment", ")", "type", ".", "getPackageFragment", "(", ")", ";", "char", "[", "]", "[", "]", "packageName", "=", "Util", ".", "toCharArrays", "(", "pkg", ".", "names", ")", ";", "if", "(", "packageName", ".", "length", ">", "0", ")", "{", "compilationUnit", ".", "currentPackage", "=", "new", "ImportReference", "(", "packageName", ",", "new", "long", "[", "]", "{", "0", "}", ",", "false", ",", "ClassFileConstants", ".", "AccDefault", ")", ";", "}", "TypeDeclaration", "typeDeclaration", "=", "convert", "(", "type", ",", "null", ",", "null", ")", ";", "IType", "alreadyComputedMember", "=", "type", ";", "IType", "parent", "=", "type", ".", "getDeclaringType", "(", ")", ";", "TypeDeclaration", "previousDeclaration", "=", "typeDeclaration", ";", "while", "(", "parent", "!=", "null", ")", "{", "TypeDeclaration", "declaration", "=", "convert", "(", "parent", ",", "alreadyComputedMember", ",", "previousDeclaration", ")", ";", "alreadyComputedMember", "=", "parent", ";", "previousDeclaration", "=", "declaration", ";", "parent", "=", "parent", ".", "getDeclaringType", "(", ")", ";", "}", "compilationUnit", ".", "types", "=", "new", "TypeDeclaration", "[", "]", "{", "previousDeclaration", "}", ";", "return", "typeDeclaration", ";", "}", "private", "FieldDeclaration", "convert", "(", "IField", "field", ",", "IType", "type", ")", "throws", "JavaModelException", "{", "TypeReference", "typeReference", "=", "createTypeReference", "(", "field", ".", "getTypeSignature", "(", ")", ")", ";", "if", "(", "typeReference", "==", "null", ")", "return", "null", ";", "FieldDeclaration", "fieldDeclaration", "=", "new", "FieldDeclaration", "(", ")", ";", "fieldDeclaration", ".", "name", "=", "field", ".", "getElementName", "(", ")", ".", "toCharArray", "(", ")", ";", "fieldDeclaration", ".", "type", "=", "typeReference", ";", "fieldDeclaration", ".", "modifiers", "=", "field", ".", "getFlags", "(", ")", ";", "return", "fieldDeclaration", ";", "}", "private", "AbstractMethodDeclaration", "convert", "(", "IMethod", "method", ",", "IType", "type", ")", "throws", "JavaModelException", "{", "AbstractMethodDeclaration", "methodDeclaration", ";", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TypeParameter", "[", "]", "typeParams", "=", "null", ";", "if", "(", "this", ".", "has1_5Compliance", ")", "{", "ITypeParameter", "[", "]", "typeParameters", "=", "method", ".", "getTypeParameters", "(", ")", ";", "if", "(", "typeParameters", "!=", "null", "&&", "typeParameters", ".", "length", ">", "0", ")", "{", "int", "parameterCount", "=", "typeParameters", ".", "length", ";", "typeParams", "=", "new", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TypeParameter", "[", "parameterCount", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "parameterCount", ";", "i", "++", ")", "{", "ITypeParameter", "typeParameter", "=", "typeParameters", "[", "i", "]", ";", "typeParams", "[", "i", "]", "=", "createTypeParameter", "(", "typeParameter", ".", "getElementName", "(", ")", ".", "toCharArray", "(", ")", ",", "stringArrayToCharArray", "(", "typeParameter", ".", "getBounds", "(", ")", ")", ",", "0", ",", "0", ")", ";", "}", "}", "}", "if", "(", "method", ".", "isConstructor", "(", ")", ")", "{", "ConstructorDeclaration", "decl", "=", "new", "ConstructorDeclaration", "(", "this", ".", "compilationResult", ")", ";", "decl", ".", "bits", "&=", "~", "ASTNode", ".", "IsDefaultConstructor", ";", "decl", ".", "typeParameters", "=", "typeParams", ";", "methodDeclaration", "=", "decl", ";", "}", "else", "{", "MethodDeclaration", "decl", "=", "type", ".", "isAnnotation", "(", ")", "?", "new", "AnnotationMethodDeclaration", "(", "this", ".", "compilationResult", ")", ":", "new", "MethodDeclaration", "(", "this", ".", "compilationResult", ")", ";", "TypeReference", "typeReference", "=", "createTypeReference", "(", "method", ".", "getReturnType", "(", ")", ")", ";", "if", "(", "typeReference", "==", "null", ")", "return", "null", ";", "decl", ".", "returnType", "=", "typeReference", ";", "decl", ".", "typeParameters", "=", "typeParams", ";", "methodDeclaration", "=", "decl", ";", "}", "methodDeclaration", ".", "selector", "=", "method", ".", "getElementName", "(", ")", ".", "toCharArray", "(", ")", ";", "int", "flags", "=", "method", ".", "getFlags", "(", ")", ";", "boolean", "isVarargs", "=", "Flags", ".", "isVarargs", "(", "flags", ")", ";", "methodDeclaration", ".", "modifiers", "=", "flags", "&", "~", "Flags", ".", "AccVarargs", ";", "String", "[", "]", "argumentTypeNames", "=", "method", ".", "getParameterTypes", "(", ")", ";", "String", "[", "]", "argumentNames", "=", "method", ".", "getParameterNames", "(", ")", ";", "int", "argumentCount", "=", "argumentTypeNames", "==", "null", "?", "0", ":", "argumentTypeNames", ".", "length", ";", "int", "startIndex", "=", "(", "method", ".", "isConstructor", "(", ")", "&&", "type", ".", "isMember", "(", ")", "&&", "!", "Flags", ".", "isStatic", "(", "type", ".", "getFlags", "(", ")", ")", ")", "?", "1", ":", "0", ";", "argumentCount", "-=", "startIndex", ";", "methodDeclaration", ".", "arguments", "=", "new", "Argument", "[", "argumentCount", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "argumentCount", ";", "i", "++", ")", "{", "String", "argumentTypeName", "=", "argumentTypeNames", "[", "startIndex", "+", "i", "]", ";", "TypeReference", "typeReference", "=", "createTypeReference", "(", "argumentTypeName", ")", ";", "if", "(", "typeReference", "==", "null", ")", "return", "null", ";", "if", "(", "isVarargs", "&&", "i", "==", "argumentCount", "-", "1", ")", "{", "typeReference", ".", "bits", "|=", "ASTNode", ".", "IsVarArgs", ";", "}", "methodDeclaration", ".", "arguments", "[", "i", "]", "=", "new", "Argument", "(", "argumentNames", "[", "i", "]", ".", "toCharArray", "(", ")", ",", "0", ",", "typeReference", ",", "ClassFileConstants", ".", "AccDefault", ")", ";", "}", "String", "[", "]", "exceptionTypeNames", "=", "method", ".", "getExceptionTypes", "(", ")", ";", "int", "exceptionCount", "=", "exceptionTypeNames", "==", "null", "?", "0", ":", "exceptionTypeNames", ".", "length", ";", "if", "(", "exceptionCount", ">", "0", ")", "{", "methodDeclaration", ".", "thrownExceptions", "=", "new", "TypeReference", "[", "exceptionCount", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "exceptionCount", ";", "i", "++", ")", "{", "TypeReference", "typeReference", "=", "createTypeReference", "(", "exceptionTypeNames", "[", "i", "]", ")", ";", "if", "(", "typeReference", "==", "null", ")", "return", "null", ";", "methodDeclaration", ".", "thrownExceptions", "[", "i", "]", "=", "typeReference", ";", "}", "}", "return", "methodDeclaration", ";", "}", "private", "TypeDeclaration", "convert", "(", "IType", "type", ",", "IType", "alreadyComputedMember", ",", "TypeDeclaration", "alreadyComputedMemberDeclaration", ")", "throws", "JavaModelException", "{", "TypeDeclaration", "typeDeclaration", "=", "new", "TypeDeclaration", "(", "this", ".", "compilationResult", ")", ";", "if", "(", "type", ".", "getDeclaringType", "(", ")", "!=", "null", ")", "{", "typeDeclaration", ".", "bits", "|=", "ASTNode", ".", "IsMemberType", ";", "}", "typeDeclaration", ".", "name", "=", "type", ".", "getElementName", "(", ")", ".", "toCharArray", "(", ")", ";", "typeDeclaration", ".", "modifiers", "=", "type", ".", "getFlags", "(", ")", ";", "if", "(", "type", ".", "getSuperclassName", "(", ")", "!=", "null", ")", "{", "TypeReference", "typeReference", "=", "createTypeReference", "(", "type", ".", "getSuperclassTypeSignature", "(", ")", ")", ";", "if", "(", "typeReference", "!=", "null", ")", "{", "typeDeclaration", ".", "superclass", "=", "typeReference", ";", "typeDeclaration", ".", "superclass", ".", "bits", "|=", "ASTNode", ".", "IsSuperType", ";", "}", "}", "String", "[", "]", "interfaceTypes", "=", "type", ".", "getSuperInterfaceTypeSignatures", "(", ")", ";", "int", "interfaceCount", "=", "interfaceTypes", "==", "null", "?", "0", ":", "interfaceTypes", ".", "length", ";", "typeDeclaration", ".", "superInterfaces", "=", "new", "TypeReference", "[", "interfaceCount", "]", ";", "int", "count", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "interfaceCount", ";", "i", "++", ")", "{", "TypeReference", "typeReference", "=", "createTypeReference", "(", "interfaceTypes", "[", "i", "]", ")", ";", "if", "(", "typeReference", "!=", "null", ")", "{", "typeDeclaration", ".", "superInterfaces", "[", "count", "]", "=", "typeReference", ";", "typeDeclaration", ".", "superInterfaces", "[", "count", "++", "]", ".", "bits", "|=", "ASTNode", ".", "IsSuperType", ";", "}", "}", "if", "(", "count", "!=", "interfaceCount", ")", "{", "System", ".", "arraycopy", "(", "typeDeclaration", ".", "fields", ",", "0", ",", "typeDeclaration", ".", "superInterfaces", "=", "new", "TypeReference", "[", "interfaceCount", "]", ",", "0", ",", "interfaceCount", ")", ";", "}", "if", "(", "this", ".", "has1_5Compliance", ")", "{", "ITypeParameter", "[", "]", "typeParameters", "=", "type", ".", "getTypeParameters", "(", ")", ";", "if", "(", "typeParameters", "!=", "null", "&&", "typeParameters", ".", "length", ">", "0", ")", "{", "int", "parameterCount", "=", "typeParameters", ".", "length", ";", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TypeParameter", "[", "]", "typeParams", "=", "new", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "ast", ".", "TypeParameter", "[", "parameterCount", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "parameterCount", ";", "i", "++", ")", "{", "ITypeParameter", "typeParameter", "=", "typeParameters", "[", "i", "]", ";", "typeParams", "[", "i", "]", "=", "createTypeParameter", "(", "typeParameter", ".", "getElementName", "(", ")", ".", "toCharArray", "(", ")", ",", "stringArrayToCharArray", "(", "typeParameter", ".", "getBounds", "(", ")", ")", ",", "0", ",", "0", ")", ";", "}", "typeDeclaration", ".", "typeParameters", "=", "typeParams", ";", "}", "}", "IType", "[", "]", "memberTypes", "=", "type", ".", "getTypes", "(", ")", ";", "int", "memberTypeCount", "=", "memberTypes", "==", "null", "?", "0", ":", "memberTypes", ".", "length", ";", "typeDeclaration", ".", "memberTypes", "=", "new", "TypeDeclaration", "[", "memberTypeCount", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "memberTypeCount", ";", "i", "++", ")", "{", "if", "(", "alreadyComputedMember", "!=", "null", "&&", "alreadyComputedMember", ".", "getFullyQualifiedName", "(", ")", ".", "equals", "(", "memberTypes", "[", "i", "]", ".", "getFullyQualifiedName", "(", ")", ")", ")", "{", "typeDeclaration", ".", "memberTypes", "[", "i", "]", "=", "alreadyComputedMemberDeclaration", ";", "}", "else", "{", "typeDeclaration", ".", "memberTypes", "[", "i", "]", "=", "convert", "(", "memberTypes", "[", "i", "]", ",", "null", ",", "null", ")", ";", "}", "typeDeclaration", ".", "memberTypes", "[", "i", "]", ".", "enclosingType", "=", "typeDeclaration", ";", "}", "IField", "[", "]", "fields", "=", "type", ".", "getFields", "(", ")", ";", "int", "fieldCount", "=", "fields", "==", "null", "?", "0", ":", "fields", ".", "length", ";", "typeDeclaration", ".", "fields", "=", "new", "FieldDeclaration", "[", "fieldCount", "]", ";", "count", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "fieldCount", ";", "i", "++", ")", "{", "FieldDeclaration", "fieldDeclaration", "=", "convert", "(", "fields", "[", "i", "]", ",", "type", ")", ";", "if", "(", "fieldDeclaration", "!=", "null", ")", "{", "typeDeclaration", ".", "fields", "[", "count", "++", "]", "=", "fieldDeclaration", ";", "}", "}", "if", "(", "count", "!=", "fieldCount", ")", "{", "System", ".", "arraycopy", "(", "typeDeclaration", ".", "fields", ",", "0", ",", "typeDeclaration", ".", "fields", "=", "new", "FieldDeclaration", "[", "count", "]", ",", "0", ",", "count", ")", ";", "}", "IMethod", "[", "]", "methods", "=", "type", ".", "getMethods", "(", ")", ";", "int", "methodCount", "=", "methods", "==", "null", "?", "0", ":", "methods", ".", "length", ";", "int", "neededCount", "=", "1", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "methodCount", ";", "i", "++", ")", "{", "if", "(", "methods", "[", "i", "]", ".", "isConstructor", "(", ")", ")", "{", "neededCount", "=", "0", ";", "break", ";", "}", "}", "boolean", "isInterface", "=", "type", ".", "isInterface", "(", ")", ";", "neededCount", "=", "isInterface", "?", "0", ":", "neededCount", ";", "typeDeclaration", ".", "methods", "=", "new", "AbstractMethodDeclaration", "[", "methodCount", "+", "neededCount", "]", ";", "if", "(", "neededCount", "!=", "0", ")", "{", "typeDeclaration", ".", "methods", "[", "0", "]", "=", "typeDeclaration", ".", "createDefaultConstructor", "(", "false", ",", "false", ")", ";", "}", "boolean", "hasAbstractMethods", "=", "false", ";", "count", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "methodCount", ";", "i", "++", ")", "{", "AbstractMethodDeclaration", "method", "=", "convert", "(", "methods", "[", "i", "]", ",", "type", ")", ";", "if", "(", "method", "!=", "null", ")", "{", "boolean", "isAbstract", ";", "if", "(", "(", "isAbstract", "=", "method", ".", "isAbstract", "(", ")", ")", "||", "isInterface", ")", "{", "method", ".", "modifiers", "|=", "ExtraCompilerModifiers", ".", "AccSemicolonBody", ";", "}", "if", "(", "isAbstract", ")", "{", "hasAbstractMethods", "=", "true", ";", "}", "typeDeclaration", ".", "methods", "[", "neededCount", "+", "(", "count", "++", ")", "]", "=", "method", ";", "}", "}", "if", "(", "count", "!=", "methodCount", ")", "{", "System", ".", "arraycopy", "(", "typeDeclaration", ".", "methods", ",", "0", ",", "typeDeclaration", ".", "methods", "=", "new", "AbstractMethodDeclaration", "[", "count", "+", "neededCount", "]", ",", "0", ",", "count", "+", "neededCount", ")", ";", "}", "if", "(", "hasAbstractMethods", ")", "{", "typeDeclaration", ".", "bits", "|=", "ASTNode", ".", "HasAbstractMethods", ";", "}", "return", "typeDeclaration", ";", "}", "private", "static", "char", "[", "]", "[", "]", "stringArrayToCharArray", "(", "String", "[", "]", "strings", ")", "{", "if", "(", "strings", "==", "null", ")", "return", "null", ";", "int", "length", "=", "strings", ".", "length", ";", "if", "(", "length", "==", "0", ")", "return", "CharOperation", ".", "NO_CHAR_CHAR", ";", "char", "[", "]", "[", "]", "result", "=", "new", "char", "[", "length", "]", "[", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "result", "[", "i", "]", "=", "strings", "[", "i", "]", ".", "toCharArray", "(", ")", ";", "}", "return", "result", ";", "}", "private", "TypeReference", "createTypeReference", "(", "String", "typeSignature", ")", "{", "TypeReference", "result", "=", "createTypeReference", "(", "typeSignature", ",", "0", ",", "0", ")", ";", "if", "(", "this", ".", "typeNames", "!=", "null", "&&", "result", "instanceof", "QualifiedTypeReference", ")", "{", "this", ".", "typeNames", ".", "add", "(", "(", "(", "QualifiedTypeReference", ")", "result", ")", ".", "tokens", ")", ";", "}", "return", "result", ";", "}", "}", "</s>" ]
3,658
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IContainer", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "class", "PackageFragmentInfo", "extends", "OpenableElementInfo", "{", "protected", "Object", "[", "]", "nonJavaResources", ";", "public", "PackageFragmentInfo", "(", ")", "{", "this", ".", "nonJavaResources", "=", "null", ";", "}", "boolean", "containsJavaResources", "(", ")", "{", "return", "this", ".", "children", ".", "length", "!=", "0", ";", "}", "Object", "[", "]", "getNonJavaResources", "(", "IResource", "underlyingResource", ",", "PackageFragmentRoot", "rootHandle", ")", "{", "if", "(", "this", ".", "nonJavaResources", "==", "null", ")", "{", "try", "{", "this", ".", "nonJavaResources", "=", "PackageFragmentRootInfo", ".", "computeFolderNonJavaResources", "(", "rootHandle", ",", "(", "IContainer", ")", "underlyingResource", ",", "rootHandle", ".", "fullInclusionPatternChars", "(", ")", ",", "rootHandle", ".", "fullExclusionPatternChars", "(", ")", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "this", ".", "nonJavaResources", "=", "NO_NON_JAVA_RESOURCES", ";", "}", "}", "return", "this", ".", "nonJavaResources", ";", "}", "void", "setNonJavaResources", "(", "Object", "[", "]", "resources", ")", "{", "this", ".", "nonJavaResources", "=", "resources", ";", "}", "}", "</s>" ]
3,659
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "io", ".", "ByteArrayInputStream", ";", "import", "java", ".", "io", ".", "InputStream", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJarEntryResource", ";", "public", "class", "JarEntryDirectory", "extends", "JarEntryResource", "{", "private", "IJarEntryResource", "[", "]", "children", ";", "public", "JarEntryDirectory", "(", "String", "simpleName", ")", "{", "super", "(", "simpleName", ")", ";", "}", "public", "JarEntryResource", "clone", "(", "Object", "newParent", ")", "{", "JarEntryDirectory", "dir", "=", "new", "JarEntryDirectory", "(", "this", ".", "simpleName", ")", ";", "dir", ".", "setParent", "(", "newParent", ")", ";", "int", "length", "=", "this", ".", "children", ".", "length", ";", "if", "(", "length", ">", "0", ")", "{", "IJarEntryResource", "[", "]", "newChildren", "=", "new", "IJarEntryResource", "[", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "JarEntryResource", "child", "=", "(", "JarEntryResource", ")", "this", ".", "children", "[", "i", "]", ";", "newChildren", "[", "i", "]", "=", "child", ".", "clone", "(", "dir", ")", ";", "}", "dir", ".", "setChildren", "(", "newChildren", ")", ";", "}", "return", "dir", ";", "}", "public", "IJarEntryResource", "[", "]", "getChildren", "(", ")", "{", "return", "this", ".", "children", ";", "}", "public", "InputStream", "getContents", "(", ")", "throws", "CoreException", "{", "return", "new", "ByteArrayInputStream", "(", "new", "byte", "[", "0", "]", ")", ";", "}", "public", "boolean", "isFile", "(", ")", "{", "return", "false", ";", "}", "public", "void", "setChildren", "(", "IJarEntryResource", "[", "]", "children", ")", "{", "this", ".", "children", "=", "children", ";", "}", "public", "String", "toString", "(", ")", "{", "return", "\"\"", "+", "getEntryName", "(", ")", "+", "\"]\"", ";", "}", "}", "</s>" ]
3,660
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "*", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Messages", ";", "public", "class", "CopyPackageFragmentRootOperation", "extends", "JavaModelOperation", "{", "IPath", "destination", ";", "int", "updateResourceFlags", ";", "int", "updateModelFlags", ";", "IClasspathEntry", "sibling", ";", "public", "CopyPackageFragmentRootOperation", "(", "IPackageFragmentRoot", "root", ",", "IPath", "destination", ",", "int", "updateResourceFlags", ",", "int", "updateModelFlags", ",", "IClasspathEntry", "sibling", ")", "{", "super", "(", "root", ")", ";", "this", ".", "destination", "=", "destination", ";", "this", ".", "updateResourceFlags", "=", "updateResourceFlags", ";", "this", ".", "updateModelFlags", "=", "updateModelFlags", ";", "this", ".", "sibling", "=", "sibling", ";", "}", "protected", "void", "executeOperation", "(", ")", "throws", "JavaModelException", "{", "IPackageFragmentRoot", "root", "=", "(", "IPackageFragmentRoot", ")", "getElementToProcess", "(", ")", ";", "IClasspathEntry", "rootEntry", "=", "root", ".", "getRawClasspathEntry", "(", ")", ";", "IWorkspaceRoot", "workspaceRoot", "=", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ";", "if", "(", "!", "root", ".", "isExternal", "(", ")", "&&", "(", "this", ".", "updateModelFlags", "&", "IPackageFragmentRoot", ".", "NO_RESOURCE_MODIFICATION", ")", "==", "0", ")", "{", "copyResource", "(", "root", ",", "rootEntry", ",", "workspaceRoot", ")", ";", "}", "if", "(", "(", "this", ".", "updateModelFlags", "&", "IPackageFragmentRoot", ".", "DESTINATION_PROJECT_CLASSPATH", ")", "!=", "0", ")", "{", "addEntryToClasspath", "(", "rootEntry", ",", "workspaceRoot", ")", ";", "}", "}", "protected", "void", "copyResource", "(", "IPackageFragmentRoot", "root", ",", "IClasspathEntry", "rootEntry", ",", "final", "IWorkspaceRoot", "workspaceRoot", ")", "throws", "JavaModelException", "{", "final", "char", "[", "]", "[", "]", "exclusionPatterns", "=", "(", "(", "ClasspathEntry", ")", "rootEntry", ")", ".", "fullExclusionPatternChars", "(", ")", ";", "IResource", "rootResource", "=", "(", "(", "JavaElement", ")", "root", ")", ".", "resource", "(", ")", ";", "if", "(", "root", ".", "getKind", "(", ")", "==", "IPackageFragmentRoot", ".", "K_BINARY", "||", "exclusionPatterns", "==", "null", ")", "{", "try", "{", "IResource", "destRes", ";", "if", "(", "(", "this", ".", "updateModelFlags", "&", "IPackageFragmentRoot", ".", "REPLACE", ")", "!=", "0", ")", "{", "if", "(", "rootEntry", ".", "getPath", "(", ")", ".", "equals", "(", "this", ".", "destination", ")", ")", "return", ";", "if", "(", "(", "destRes", "=", "workspaceRoot", ".", "findMember", "(", "this", ".", "destination", ")", ")", "!=", "null", ")", "{", "destRes", ".", "delete", "(", "this", ".", "updateResourceFlags", ",", "this", ".", "progressMonitor", ")", ";", "}", "}", "rootResource", ".", "copy", "(", "this", ".", "destination", ",", "this", ".", "updateResourceFlags", ",", "this", ".", "progressMonitor", ")", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "throw", "new", "JavaModelException", "(", "e", ")", ";", "}", "}", "else", "{", "final", "int", "sourceSegmentCount", "=", "rootEntry", ".", "getPath", "(", ")", ".", "segmentCount", "(", ")", ";", "final", "IFolder", "destFolder", "=", "workspaceRoot", ".", "getFolder", "(", "this", ".", "destination", ")", ";", "final", "IPath", "[", "]", "nestedFolders", "=", "getNestedFolders", "(", "root", ")", ";", "IResourceProxyVisitor", "visitor", "=", "new", "IResourceProxyVisitor", "(", ")", "{", "public", "boolean", "visit", "(", "IResourceProxy", "proxy", ")", "throws", "CoreException", "{", "if", "(", "proxy", ".", "getType", "(", ")", "==", "IResource", ".", "FOLDER", ")", "{", "IPath", "path", "=", "proxy", ".", "requestFullPath", "(", ")", ";", "if", "(", "prefixesOneOf", "(", "path", ",", "nestedFolders", ")", ")", "{", "if", "(", "equalsOneOf", "(", "path", ",", "nestedFolders", ")", ")", "{", "return", "false", ";", "}", "else", "{", "IFolder", "folder", "=", "destFolder", ".", "getFolder", "(", "path", ".", "removeFirstSegments", "(", "sourceSegmentCount", ")", ")", ";", "if", "(", "(", "CopyPackageFragmentRootOperation", ".", "this", ".", "updateModelFlags", "&", "IPackageFragmentRoot", ".", "REPLACE", ")", "!=", "0", "&&", "folder", ".", "exists", "(", ")", ")", "{", "return", "true", ";", "}", "folder", ".", "create", "(", "CopyPackageFragmentRootOperation", ".", "this", ".", "updateResourceFlags", ",", "true", ",", "CopyPackageFragmentRootOperation", ".", "this", ".", "progressMonitor", ")", ";", "return", "true", ";", "}", "}", "else", "{", "IPath", "destPath", "=", "CopyPackageFragmentRootOperation", ".", "this", ".", "destination", ".", "append", "(", "path", ".", "removeFirstSegments", "(", "sourceSegmentCount", ")", ")", ";", "IResource", "destRes", ";", "if", "(", "(", "CopyPackageFragmentRootOperation", ".", "this", ".", "updateModelFlags", "&", "IPackageFragmentRoot", ".", "REPLACE", ")", "!=", "0", "&&", "(", "destRes", "=", "workspaceRoot", ".", "findMember", "(", "destPath", ")", ")", "!=", "null", ")", "{", "destRes", ".", "delete", "(", "CopyPackageFragmentRootOperation", ".", "this", ".", "updateResourceFlags", ",", "CopyPackageFragmentRootOperation", ".", "this", ".", "progressMonitor", ")", ";", "}", "proxy", ".", "requestResource", "(", ")", ".", "copy", "(", "destPath", ",", "CopyPackageFragmentRootOperation", ".", "this", ".", "updateResourceFlags", ",", "CopyPackageFragmentRootOperation", ".", "this", ".", "progressMonitor", ")", ";", "return", "false", ";", "}", "}", "else", "{", "IPath", "path", "=", "proxy", ".", "requestFullPath", "(", ")", ";", "IPath", "destPath", "=", "CopyPackageFragmentRootOperation", ".", "this", ".", "destination", ".", "append", "(", "path", ".", "removeFirstSegments", "(", "sourceSegmentCount", ")", ")", ";", "IResource", "destRes", ";", "if", "(", "(", "CopyPackageFragmentRootOperation", ".", "this", ".", "updateModelFlags", "&", "IPackageFragmentRoot", ".", "REPLACE", ")", "!=", "0", "&&", "(", "destRes", "=", "workspaceRoot", ".", "findMember", "(", "destPath", ")", ")", "!=", "null", ")", "{", "destRes", ".", "delete", "(", "CopyPackageFragmentRootOperation", ".", "this", ".", "updateResourceFlags", ",", "CopyPackageFragmentRootOperation", ".", "this", ".", "progressMonitor", ")", ";", "}", "proxy", ".", "requestResource", "(", ")", ".", "copy", "(", "destPath", ",", "CopyPackageFragmentRootOperation", ".", "this", ".", "updateResourceFlags", ",", "CopyPackageFragmentRootOperation", ".", "this", ".", "progressMonitor", ")", ";", "return", "false", ";", "}", "}", "}", ";", "try", "{", "rootResource", ".", "accept", "(", "visitor", ",", "IResource", ".", "NONE", ")", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "throw", "new", "JavaModelException", "(", "e", ")", ";", "}", "}", "setAttribute", "(", "HAS_MODIFIED_RESOURCE_ATTR", ",", "TRUE", ")", ";", "}", "protected", "void", "addEntryToClasspath", "(", "IClasspathEntry", "rootEntry", ",", "IWorkspaceRoot", "workspaceRoot", ")", "throws", "JavaModelException", "{", "IProject", "destProject", "=", "workspaceRoot", ".", "getProject", "(", "this", ".", "destination", ".", "segment", "(", "0", ")", ")", ";", "IJavaProject", "jProject", "=", "JavaCore", ".", "create", "(", "destProject", ")", ";", "IClasspathEntry", "[", "]", "classpath", "=", "jProject", ".", "getRawClasspath", "(", ")", ";", "int", "length", "=", "classpath", ".", "length", ";", "IClasspathEntry", "[", "]", "newClasspath", ";", "if", "(", "(", "this", ".", "updateModelFlags", "&", "IPackageFragmentRoot", ".", "REPLACE", ")", "!=", "0", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "if", "(", "this", ".", "destination", ".", "equals", "(", "classpath", "[", "i", "]", ".", "getPath", "(", ")", ")", ")", "{", "newClasspath", "=", "new", "IClasspathEntry", "[", "length", "]", ";", "System", ".", "arraycopy", "(", "classpath", ",", "0", ",", "newClasspath", ",", "0", ",", "length", ")", ";", "newClasspath", "[", "i", "]", "=", "copy", "(", "rootEntry", ")", ";", "jProject", ".", "setRawClasspath", "(", "newClasspath", ",", "this", ".", "progressMonitor", ")", ";", "return", ";", "}", "}", "}", "int", "position", ";", "if", "(", "this", ".", "sibling", "==", "null", ")", "{", "position", "=", "length", ";", "}", "else", "{", "position", "=", "-", "1", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "if", "(", "this", ".", "sibling", ".", "equals", "(", "classpath", "[", "i", "]", ")", ")", "{", "position", "=", "i", ";", "break", ";", "}", "}", "}", "if", "(", "position", "==", "-", "1", ")", "{", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INVALID_SIBLING", ",", "this", ".", "sibling", ".", "toString", "(", ")", ")", ")", ";", "}", "newClasspath", "=", "new", "IClasspathEntry", "[", "length", "+", "1", "]", ";", "if", "(", "position", "!=", "0", ")", "{", "System", ".", "arraycopy", "(", "classpath", ",", "0", ",", "newClasspath", ",", "0", ",", "position", ")", ";", "}", "if", "(", "position", "!=", "length", ")", "{", "System", ".", "arraycopy", "(", "classpath", ",", "position", ",", "newClasspath", ",", "position", "+", "1", ",", "length", "-", "position", ")", ";", "}", "IClasspathEntry", "newEntry", "=", "copy", "(", "rootEntry", ")", ";", "newClasspath", "[", "position", "]", "=", "newEntry", ";", "jProject", ".", "setRawClasspath", "(", "newClasspath", ",", "this", ".", "progressMonitor", ")", ";", "}", "protected", "IClasspathEntry", "copy", "(", "IClasspathEntry", "entry", ")", "throws", "JavaModelException", "{", "switch", "(", "entry", ".", "getEntryKind", "(", ")", ")", "{", "case", "IClasspathEntry", ".", "CPE_CONTAINER", ":", "return", "JavaCore", ".", "newContainerEntry", "(", "entry", ".", "getPath", "(", ")", ",", "entry", ".", "getAccessRules", "(", ")", ",", "entry", ".", "getExtraAttributes", "(", ")", ",", "entry", ".", "isExported", "(", ")", ")", ";", "case", "IClasspathEntry", ".", "CPE_LIBRARY", ":", "try", "{", "return", "JavaCore", ".", "newLibraryEntry", "(", "this", ".", "destination", ",", "entry", ".", "getSourceAttachmentPath", "(", ")", ",", "entry", ".", "getSourceAttachmentRootPath", "(", ")", ",", "entry", ".", "getAccessRules", "(", ")", ",", "entry", ".", "getExtraAttributes", "(", ")", ",", "entry", ".", "isExported", "(", ")", ")", ";", "}", "catch", "(", "ClasspathEntry", ".", "AssertionFailedException", "e", ")", "{", "IJavaModelStatus", "status", "=", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INVALID_PATH", ",", "e", ".", "getMessage", "(", ")", ")", ";", "throw", "new", "JavaModelException", "(", "status", ")", ";", "}", "case", "IClasspathEntry", ".", "CPE_PROJECT", ":", "return", "JavaCore", ".", "newProjectEntry", "(", "entry", ".", "getPath", "(", ")", ",", "entry", ".", "getAccessRules", "(", ")", ",", "entry", ".", "combineAccessRules", "(", ")", ",", "entry", ".", "getExtraAttributes", "(", ")", ",", "entry", ".", "isExported", "(", ")", ")", ";", "case", "IClasspathEntry", ".", "CPE_SOURCE", ":", "return", "JavaCore", ".", "newSourceEntry", "(", "this", ".", "destination", ",", "entry", ".", "getInclusionPatterns", "(", ")", ",", "entry", ".", "getExclusionPatterns", "(", ")", ",", "entry", ".", "getOutputLocation", "(", ")", ",", "entry", ".", "getExtraAttributes", "(", ")", ")", ";", "case", "IClasspathEntry", ".", "CPE_VARIABLE", ":", "try", "{", "return", "JavaCore", ".", "newVariableEntry", "(", "entry", ".", "getPath", "(", ")", ",", "entry", ".", "getSourceAttachmentPath", "(", ")", ",", "entry", ".", "getSourceAttachmentRootPath", "(", ")", ",", "entry", ".", "getAccessRules", "(", ")", ",", "entry", ".", "getExtraAttributes", "(", ")", ",", "entry", ".", "isExported", "(", ")", ")", ";", "}", "catch", "(", "ClasspathEntry", ".", "AssertionFailedException", "e", ")", "{", "IJavaModelStatus", "status", "=", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INVALID_PATH", ",", "e", ".", "getMessage", "(", ")", ")", ";", "throw", "new", "JavaModelException", "(", "status", ")", ";", "}", "default", ":", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "ELEMENT_DOES_NOT_EXIST", ",", "getElementToProcess", "(", ")", ")", ")", ";", "}", "}", "public", "IJavaModelStatus", "verify", "(", ")", "{", "IJavaModelStatus", "status", "=", "super", ".", "verify", "(", ")", ";", "if", "(", "!", "status", ".", "isOK", "(", ")", ")", "{", "return", "status", ";", "}", "PackageFragmentRoot", "root", "=", "(", "PackageFragmentRoot", ")", "getElementToProcess", "(", ")", ";", "if", "(", "root", "==", "null", "||", "!", "root", ".", "exists", "(", ")", ")", "{", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "ELEMENT_DOES_NOT_EXIST", ",", "root", ")", ";", "}", "IResource", "resource", "=", "root", ".", "resource", "(", ")", ";", "if", "(", "resource", "instanceof", "IFolder", ")", "{", "if", "(", "resource", ".", "isLinked", "(", ")", ")", "{", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INVALID_RESOURCE", ",", "root", ")", ";", "}", "}", "if", "(", "(", "this", ".", "updateModelFlags", "&", "IPackageFragmentRoot", ".", "DESTINATION_PROJECT_CLASSPATH", ")", "!=", "0", ")", "{", "String", "destProjectName", "=", "this", ".", "destination", ".", "segment", "(", "0", ")", ";", "IProject", "project", "=", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ".", "getProject", "(", "destProjectName", ")", ";", "if", "(", "JavaProject", ".", "hasJavaNature", "(", "project", ")", ")", "{", "try", "{", "IJavaProject", "destProject", "=", "JavaCore", ".", "create", "(", "project", ")", ";", "IClasspathEntry", "[", "]", "destClasspath", "=", "destProject", ".", "getRawClasspath", "(", ")", ";", "boolean", "foundSibling", "=", "false", ";", "boolean", "foundExistingEntry", "=", "false", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "destClasspath", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IClasspathEntry", "entry", "=", "destClasspath", "[", "i", "]", ";", "if", "(", "entry", ".", "equals", "(", "this", ".", "sibling", ")", ")", "{", "foundSibling", "=", "true", ";", "break", ";", "}", "if", "(", "entry", ".", "getPath", "(", ")", ".", "equals", "(", "this", ".", "destination", ")", ")", "{", "foundExistingEntry", "=", "true", ";", "}", "}", "if", "(", "this", ".", "sibling", "!=", "null", "&&", "!", "foundSibling", ")", "{", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INVALID_SIBLING", ",", "this", ".", "sibling", ".", "toString", "(", ")", ")", ";", "}", "if", "(", "foundExistingEntry", "&&", "(", "this", ".", "updateModelFlags", "&", "IPackageFragmentRoot", ".", "REPLACE", ")", "==", "0", ")", "{", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "NAME_COLLISION", ",", "Messages", ".", "bind", "(", "Messages", ".", "status_nameCollision", ",", "new", "String", "[", "]", "{", "this", ".", "destination", ".", "toString", "(", ")", "}", ")", ")", ";", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "return", "e", ".", "getJavaModelStatus", "(", ")", ";", "}", "}", "}", "return", "JavaModelStatus", ".", "VERIFIED_OK", ";", "}", "}", "</s>" ]
3,661
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "text", ".", "NumberFormat", ";", "import", "java", ".", "util", ".", "Enumeration", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IFile", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IBuffer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IOpenable", ";", "public", "class", "BufferManager", "{", "protected", "static", "BufferManager", "DEFAULT_BUFFER_MANAGER", ";", "protected", "static", "boolean", "VERBOSE", ";", "private", "BufferCache", "openBuffers", "=", "new", "BufferCache", "(", "60", ")", ";", "protected", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IBufferFactory", "defaultBufferFactory", "=", "new", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IBufferFactory", "(", ")", "{", "public", "IBuffer", "createBuffer", "(", "IOpenable", "owner", ")", "{", "return", "BufferManager", ".", "createBuffer", "(", "owner", ")", ";", "}", "}", ";", "protected", "void", "addBuffer", "(", "IBuffer", "buffer", ")", "{", "if", "(", "VERBOSE", ")", "{", "String", "owner", "=", "(", "(", "Openable", ")", "buffer", ".", "getOwner", "(", ")", ")", ".", "toStringWithAncestors", "(", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", "+", "owner", ")", ";", "}", "synchronized", "(", "this", ".", "openBuffers", ")", "{", "this", ".", "openBuffers", ".", "put", "(", "buffer", ".", "getOwner", "(", ")", ",", "buffer", ")", ";", "}", "this", ".", "openBuffers", ".", "closeBuffers", "(", ")", ";", "if", "(", "VERBOSE", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "NumberFormat", ".", "getInstance", "(", ")", ".", "format", "(", "this", ".", "openBuffers", ".", "fillingRatio", "(", ")", ")", "+", "\"%\"", ")", ";", "}", "}", "public", "static", "IBuffer", "createBuffer", "(", "IOpenable", "owner", ")", "{", "JavaElement", "element", "=", "(", "JavaElement", ")", "owner", ";", "IResource", "resource", "=", "element", ".", "resource", "(", ")", ";", "return", "new", "Buffer", "(", "resource", "instanceof", "IFile", "?", "(", "IFile", ")", "resource", ":", "null", ",", "owner", ",", "element", ".", "isReadOnly", "(", ")", ")", ";", "}", "public", "static", "IBuffer", "createNullBuffer", "(", "IOpenable", "owner", ")", "{", "JavaElement", "element", "=", "(", "JavaElement", ")", "owner", ";", "IResource", "resource", "=", "element", ".", "resource", "(", ")", ";", "return", "new", "NullBuffer", "(", "resource", "instanceof", "IFile", "?", "(", "IFile", ")", "resource", ":", "null", ",", "owner", ",", "element", ".", "isReadOnly", "(", ")", ")", ";", "}", "public", "IBuffer", "getBuffer", "(", "IOpenable", "owner", ")", "{", "synchronized", "(", "this", ".", "openBuffers", ")", "{", "return", "(", "IBuffer", ")", "this", ".", "openBuffers", ".", "get", "(", "owner", ")", ";", "}", "}", "public", "synchronized", "static", "BufferManager", "getDefaultBufferManager", "(", ")", "{", "if", "(", "DEFAULT_BUFFER_MANAGER", "==", "null", ")", "{", "DEFAULT_BUFFER_MANAGER", "=", "new", "BufferManager", "(", ")", ";", "}", "return", "DEFAULT_BUFFER_MANAGER", ";", "}", "public", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IBufferFactory", "getDefaultBufferFactory", "(", ")", "{", "return", "this", ".", "defaultBufferFactory", ";", "}", "public", "Enumeration", "getOpenBuffers", "(", ")", "{", "Enumeration", "result", ";", "synchronized", "(", "this", ".", "openBuffers", ")", "{", "this", ".", "openBuffers", ".", "shrink", "(", ")", ";", "result", "=", "this", ".", "openBuffers", ".", "elements", "(", ")", ";", "}", "this", ".", "openBuffers", ".", "closeBuffers", "(", ")", ";", "return", "result", ";", "}", "protected", "void", "removeBuffer", "(", "IBuffer", "buffer", ")", "{", "if", "(", "VERBOSE", ")", "{", "String", "owner", "=", "(", "(", "Openable", ")", "buffer", ".", "getOwner", "(", ")", ")", ".", "toStringWithAncestors", "(", ")", ";", "System", ".", "out", ".", "println", "(", "\"\"", "+", "owner", ")", ";", "}", "synchronized", "(", "this", ".", "openBuffers", ")", "{", "this", ".", "openBuffers", ".", "remove", "(", "buffer", ".", "getOwner", "(", ")", ")", ";", "}", "this", ".", "openBuffers", ".", "closeBuffers", "(", ")", ";", "if", "(", "VERBOSE", ")", "{", "System", ".", "out", ".", "println", "(", "\"\"", "+", "NumberFormat", ".", "getInstance", "(", ")", ".", "format", "(", "this", ".", "openBuffers", ".", "fillingRatio", "(", ")", ")", "+", "\"%\"", ")", ";", "}", "}", "}", "</s>" ]
3,662
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IField", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IInitializer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IMethod", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IPackageFragment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IType", ";", "class", "SingleTypeRequestor", "implements", "IJavaElementRequestor", "{", "protected", "IType", "element", "=", "null", ";", "public", "void", "acceptField", "(", "IField", "field", ")", "{", "}", "public", "void", "acceptInitializer", "(", "IInitializer", "initializer", ")", "{", "}", "public", "void", "acceptMemberType", "(", "IType", "type", ")", "{", "this", ".", "element", "=", "type", ";", "}", "public", "void", "acceptMethod", "(", "IMethod", "method", ")", "{", "}", "public", "void", "acceptPackageFragment", "(", "IPackageFragment", "packageFragment", ")", "{", "}", "public", "void", "acceptType", "(", "IType", "type", ")", "{", "this", ".", "element", "=", "type", ";", "}", "public", "IType", "getType", "(", ")", "{", "return", "this", ".", "element", ";", "}", "public", "boolean", "isCanceled", "(", ")", "{", "return", "this", ".", "element", "!=", "null", ";", "}", "public", "void", "reset", "(", ")", "{", "this", ".", "element", "=", "null", ";", "}", "}", "</s>" ]
3,663
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "*", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "*", ";", "public", "class", "DeletePackageFragmentRootOperation", "extends", "JavaModelOperation", "{", "int", "updateResourceFlags", ";", "int", "updateModelFlags", ";", "public", "DeletePackageFragmentRootOperation", "(", "IPackageFragmentRoot", "root", ",", "int", "updateResourceFlags", ",", "int", "updateModelFlags", ")", "{", "super", "(", "root", ")", ";", "this", ".", "updateResourceFlags", "=", "updateResourceFlags", ";", "this", ".", "updateModelFlags", "=", "updateModelFlags", ";", "}", "protected", "void", "executeOperation", "(", ")", "throws", "JavaModelException", "{", "IPackageFragmentRoot", "root", "=", "(", "IPackageFragmentRoot", ")", "getElementToProcess", "(", ")", ";", "IClasspathEntry", "rootEntry", "=", "root", ".", "getRawClasspathEntry", "(", ")", ";", "DeltaProcessor", "deltaProcessor", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "getDeltaProcessor", "(", ")", ";", "if", "(", "deltaProcessor", ".", "oldRoots", "==", "null", ")", "deltaProcessor", ".", "oldRoots", "=", "new", "HashMap", "(", ")", ";", "if", "(", "(", "this", ".", "updateModelFlags", "&", "IPackageFragmentRoot", ".", "ORIGINATING_PROJECT_CLASSPATH", ")", "!=", "0", ")", "{", "updateProjectClasspath", "(", "rootEntry", ".", "getPath", "(", ")", ",", "root", ".", "getJavaProject", "(", ")", ",", "deltaProcessor", ".", "oldRoots", ")", ";", "}", "if", "(", "(", "this", ".", "updateModelFlags", "&", "IPackageFragmentRoot", ".", "OTHER_REFERRING_PROJECTS_CLASSPATH", ")", "!=", "0", ")", "{", "updateReferringProjectClasspaths", "(", "rootEntry", ".", "getPath", "(", ")", ",", "root", ".", "getJavaProject", "(", ")", ",", "deltaProcessor", ".", "oldRoots", ")", ";", "}", "if", "(", "!", "root", ".", "isExternal", "(", ")", "&&", "(", "this", ".", "updateModelFlags", "&", "IPackageFragmentRoot", ".", "NO_RESOURCE_MODIFICATION", ")", "==", "0", ")", "{", "deleteResource", "(", "root", ",", "rootEntry", ")", ";", "}", "}", "protected", "void", "deleteResource", "(", "IPackageFragmentRoot", "root", ",", "IClasspathEntry", "rootEntry", ")", "throws", "JavaModelException", "{", "final", "char", "[", "]", "[", "]", "exclusionPatterns", "=", "(", "(", "ClasspathEntry", ")", "rootEntry", ")", ".", "fullExclusionPatternChars", "(", ")", ";", "IResource", "rootResource", "=", "(", "(", "JavaElement", ")", "root", ")", ".", "resource", "(", ")", ";", "if", "(", "rootEntry", ".", "getEntryKind", "(", ")", "!=", "IClasspathEntry", ".", "CPE_SOURCE", "||", "exclusionPatterns", "==", "null", ")", "{", "try", "{", "rootResource", ".", "delete", "(", "this", ".", "updateResourceFlags", ",", "this", ".", "progressMonitor", ")", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "throw", "new", "JavaModelException", "(", "e", ")", ";", "}", "}", "else", "{", "final", "IPath", "[", "]", "nestedFolders", "=", "getNestedFolders", "(", "root", ")", ";", "IResourceProxyVisitor", "visitor", "=", "new", "IResourceProxyVisitor", "(", ")", "{", "public", "boolean", "visit", "(", "IResourceProxy", "proxy", ")", "throws", "CoreException", "{", "if", "(", "proxy", ".", "getType", "(", ")", "==", "IResource", ".", "FOLDER", ")", "{", "IPath", "path", "=", "proxy", ".", "requestFullPath", "(", ")", ";", "if", "(", "prefixesOneOf", "(", "path", ",", "nestedFolders", ")", ")", "{", "return", "!", "equalsOneOf", "(", "path", ",", "nestedFolders", ")", ";", "}", "else", "{", "proxy", ".", "requestResource", "(", ")", ".", "delete", "(", "DeletePackageFragmentRootOperation", ".", "this", ".", "updateResourceFlags", ",", "DeletePackageFragmentRootOperation", ".", "this", ".", "progressMonitor", ")", ";", "return", "false", ";", "}", "}", "else", "{", "proxy", ".", "requestResource", "(", ")", ".", "delete", "(", "DeletePackageFragmentRootOperation", ".", "this", ".", "updateResourceFlags", ",", "DeletePackageFragmentRootOperation", ".", "this", ".", "progressMonitor", ")", ";", "return", "false", ";", "}", "}", "}", ";", "try", "{", "rootResource", ".", "accept", "(", "visitor", ",", "IResource", ".", "NONE", ")", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "throw", "new", "JavaModelException", "(", "e", ")", ";", "}", "}", "setAttribute", "(", "HAS_MODIFIED_RESOURCE_ATTR", ",", "TRUE", ")", ";", "}", "protected", "void", "updateReferringProjectClasspaths", "(", "IPath", "rootPath", ",", "IJavaProject", "projectOfRoot", ",", "Map", "oldRoots", ")", "throws", "JavaModelException", "{", "IJavaModel", "model", "=", "getJavaModel", "(", ")", ";", "IJavaProject", "[", "]", "projects", "=", "model", ".", "getJavaProjects", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "projects", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IJavaProject", "project", "=", "projects", "[", "i", "]", ";", "if", "(", "project", ".", "equals", "(", "projectOfRoot", ")", ")", "continue", ";", "updateProjectClasspath", "(", "rootPath", ",", "project", ",", "oldRoots", ")", ";", "}", "}", "protected", "void", "updateProjectClasspath", "(", "IPath", "rootPath", ",", "IJavaProject", "project", ",", "Map", "oldRoots", ")", "throws", "JavaModelException", "{", "oldRoots", ".", "put", "(", "project", ",", "project", ".", "getPackageFragmentRoots", "(", ")", ")", ";", "IClasspathEntry", "[", "]", "classpath", "=", "project", ".", "getRawClasspath", "(", ")", ";", "IClasspathEntry", "[", "]", "newClasspath", "=", "null", ";", "int", "cpLength", "=", "classpath", ".", "length", ";", "int", "newCPIndex", "=", "-", "1", ";", "for", "(", "int", "j", "=", "0", ";", "j", "<", "cpLength", ";", "j", "++", ")", "{", "IClasspathEntry", "entry", "=", "classpath", "[", "j", "]", ";", "if", "(", "rootPath", ".", "equals", "(", "entry", ".", "getPath", "(", ")", ")", ")", "{", "if", "(", "newClasspath", "==", "null", ")", "{", "newClasspath", "=", "new", "IClasspathEntry", "[", "cpLength", "-", "1", "]", ";", "System", ".", "arraycopy", "(", "classpath", ",", "0", ",", "newClasspath", ",", "0", ",", "j", ")", ";", "newCPIndex", "=", "j", ";", "}", "}", "else", "if", "(", "newClasspath", "!=", "null", ")", "{", "newClasspath", "[", "newCPIndex", "++", "]", "=", "entry", ";", "}", "}", "if", "(", "newClasspath", "!=", "null", ")", "{", "if", "(", "newCPIndex", "<", "newClasspath", ".", "length", ")", "{", "System", ".", "arraycopy", "(", "newClasspath", ",", "0", ",", "newClasspath", "=", "new", "IClasspathEntry", "[", "newCPIndex", "]", ",", "0", ",", "newCPIndex", ")", ";", "}", "project", ".", "setRawClasspath", "(", "newClasspath", ",", "this", ".", "progressMonitor", ")", ";", "}", "}", "protected", "IJavaModelStatus", "verify", "(", ")", "{", "IJavaModelStatus", "status", "=", "super", ".", "verify", "(", ")", ";", "if", "(", "!", "status", ".", "isOK", "(", ")", ")", "{", "return", "status", ";", "}", "IJavaElement", "root", "=", "getElementToProcess", "(", ")", ";", "if", "(", "root", "==", "null", "||", "!", "root", ".", "exists", "(", ")", ")", "{", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "ELEMENT_DOES_NOT_EXIST", ",", "root", ")", ";", "}", "IResource", "resource", "=", "(", "(", "JavaElement", ")", "root", ")", ".", "resource", "(", ")", ";", "if", "(", "resource", "instanceof", "IFolder", ")", "{", "if", "(", "resource", ".", "isLinked", "(", ")", ")", "{", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INVALID_RESOURCE", ",", "root", ")", ";", "}", "}", "return", "JavaModelStatus", ".", "VERIFIED_OK", ";", "}", "}", "</s>" ]
3,664
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IBuffer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "LRUCache", ";", "public", "class", "BufferCache", "extends", "OverflowingLRUCache", "{", "private", "ThreadLocal", "buffersToClose", "=", "new", "ThreadLocal", "(", ")", ";", "public", "BufferCache", "(", "int", "size", ")", "{", "super", "(", "size", ")", ";", "}", "public", "BufferCache", "(", "int", "size", ",", "int", "overflow", ")", "{", "super", "(", "size", ",", "overflow", ")", ";", "}", "protected", "boolean", "close", "(", "LRUCacheEntry", "entry", ")", "{", "IBuffer", "buffer", "=", "(", "IBuffer", ")", "entry", ".", "value", ";", "if", "(", "!", "(", "(", "Openable", ")", "buffer", ".", "getOwner", "(", ")", ")", ".", "canBufferBeRemovedFromCache", "(", "buffer", ")", ")", "{", "return", "false", ";", "}", "else", "{", "ArrayList", "buffers", "=", "(", "ArrayList", ")", "this", ".", "buffersToClose", ".", "get", "(", ")", ";", "if", "(", "buffers", "==", "null", ")", "{", "buffers", "=", "new", "ArrayList", "(", ")", ";", "this", ".", "buffersToClose", ".", "set", "(", "buffers", ")", ";", "}", "buffers", ".", "add", "(", "buffer", ")", ";", "return", "true", ";", "}", "}", "void", "closeBuffers", "(", ")", "{", "ArrayList", "buffers", "=", "(", "ArrayList", ")", "this", ".", "buffersToClose", ".", "get", "(", ")", ";", "if", "(", "buffers", "==", "null", ")", "return", ";", "this", ".", "buffersToClose", ".", "set", "(", "null", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "buffers", ".", "size", "(", ")", ";", "i", "<", "length", ";", "i", "++", ")", "{", "(", "(", "IBuffer", ")", "buffers", ".", "get", "(", "i", ")", ")", ".", "close", "(", ")", ";", "}", "}", "protected", "LRUCache", "newInstance", "(", "int", "size", ",", "int", "newOverflow", ")", "{", "return", "new", "BufferCache", "(", "size", ",", "newOverflow", ")", ";", "}", "}", "</s>" ]
3,665
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "*", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "*", ";", "public", "class", "MovePackageFragmentRootOperation", "extends", "CopyPackageFragmentRootOperation", "{", "protected", "void", "renameEntryInClasspath", "(", "IPath", "rootPath", ",", "IJavaProject", "project", ")", "throws", "JavaModelException", "{", "IClasspathEntry", "[", "]", "classpath", "=", "project", ".", "getRawClasspath", "(", ")", ";", "IClasspathEntry", "[", "]", "newClasspath", "=", "null", ";", "int", "cpLength", "=", "classpath", ".", "length", ";", "int", "newCPIndex", "=", "-", "1", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "cpLength", ";", "i", "++", ")", "{", "IClasspathEntry", "entry", "=", "classpath", "[", "i", "]", ";", "IPath", "entryPath", "=", "entry", ".", "getPath", "(", ")", ";", "if", "(", "rootPath", ".", "equals", "(", "entryPath", ")", ")", "{", "if", "(", "newClasspath", "==", "null", ")", "{", "newClasspath", "=", "new", "IClasspathEntry", "[", "cpLength", "]", ";", "System", ".", "arraycopy", "(", "classpath", ",", "0", ",", "newClasspath", ",", "0", ",", "i", ")", ";", "newCPIndex", "=", "i", ";", "}", "newClasspath", "[", "newCPIndex", "++", "]", "=", "copy", "(", "entry", ")", ";", "}", "else", "if", "(", "this", ".", "destination", ".", "equals", "(", "entryPath", ")", ")", "{", "if", "(", "newClasspath", "==", "null", ")", "{", "newClasspath", "=", "new", "IClasspathEntry", "[", "cpLength", "]", ";", "System", ".", "arraycopy", "(", "classpath", ",", "0", ",", "newClasspath", ",", "0", ",", "i", ")", ";", "newCPIndex", "=", "i", ";", "}", "}", "else", "if", "(", "entry", ".", "getEntryKind", "(", ")", "==", "IClasspathEntry", ".", "CPE_SOURCE", ")", "{", "IPath", "projectRelativePath", "=", "rootPath", ".", "removeFirstSegments", "(", "1", ")", ";", "IPath", "[", "]", "newExclusionPatterns", "=", "renamePatterns", "(", "projectRelativePath", ",", "entry", ".", "getExclusionPatterns", "(", ")", ")", ";", "IPath", "[", "]", "newInclusionPatterns", "=", "renamePatterns", "(", "projectRelativePath", ",", "entry", ".", "getInclusionPatterns", "(", ")", ")", ";", "if", "(", "newExclusionPatterns", "!=", "null", "||", "newInclusionPatterns", "!=", "null", ")", "{", "if", "(", "newClasspath", "==", "null", ")", "{", "newClasspath", "=", "new", "IClasspathEntry", "[", "cpLength", "]", ";", "System", ".", "arraycopy", "(", "classpath", ",", "0", ",", "newClasspath", ",", "0", ",", "i", ")", ";", "newCPIndex", "=", "i", ";", "}", "newClasspath", "[", "newCPIndex", "++", "]", "=", "JavaCore", ".", "newSourceEntry", "(", "entry", ".", "getPath", "(", ")", ",", "newInclusionPatterns", "==", "null", "?", "entry", ".", "getInclusionPatterns", "(", ")", ":", "newInclusionPatterns", ",", "newExclusionPatterns", "==", "null", "?", "entry", ".", "getExclusionPatterns", "(", ")", ":", "newExclusionPatterns", ",", "entry", ".", "getOutputLocation", "(", ")", ",", "entry", ".", "getExtraAttributes", "(", ")", ")", ";", "}", "else", "if", "(", "newClasspath", "!=", "null", ")", "{", "newClasspath", "[", "newCPIndex", "++", "]", "=", "entry", ";", "}", "}", "else", "if", "(", "newClasspath", "!=", "null", ")", "{", "newClasspath", "[", "newCPIndex", "++", "]", "=", "entry", ";", "}", "}", "if", "(", "newClasspath", "!=", "null", ")", "{", "if", "(", "newCPIndex", "<", "newClasspath", ".", "length", ")", "{", "System", ".", "arraycopy", "(", "newClasspath", ",", "0", ",", "newClasspath", "=", "new", "IClasspathEntry", "[", "newCPIndex", "]", ",", "0", ",", "newCPIndex", ")", ";", "}", "IJavaModelStatus", "status", "=", "JavaConventions", ".", "validateClasspath", "(", "project", ",", "newClasspath", ",", "project", ".", "getOutputLocation", "(", ")", ")", ";", "if", "(", "status", ".", "isOK", "(", ")", ")", "project", ".", "setRawClasspath", "(", "newClasspath", ",", "this", ".", "progressMonitor", ")", ";", "}", "}", "private", "IPath", "[", "]", "renamePatterns", "(", "IPath", "rootPath", ",", "IPath", "[", "]", "patterns", ")", "{", "IPath", "[", "]", "newPatterns", "=", "null", ";", "int", "newPatternsIndex", "=", "-", "1", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "patterns", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IPath", "pattern", "=", "patterns", "[", "i", "]", ";", "if", "(", "pattern", ".", "equals", "(", "rootPath", ")", ")", "{", "if", "(", "newPatterns", "==", "null", ")", "{", "newPatterns", "=", "new", "IPath", "[", "length", "]", ";", "System", ".", "arraycopy", "(", "patterns", ",", "0", ",", "newPatterns", ",", "0", ",", "i", ")", ";", "newPatternsIndex", "=", "i", ";", "}", "IPath", "newPattern", "=", "this", ".", "destination", ".", "removeFirstSegments", "(", "1", ")", ";", "if", "(", "pattern", ".", "hasTrailingSeparator", "(", ")", ")", "newPattern", "=", "newPattern", ".", "addTrailingSeparator", "(", ")", ";", "newPatterns", "[", "newPatternsIndex", "++", "]", "=", "newPattern", ";", "}", "}", "return", "newPatterns", ";", "}", "public", "MovePackageFragmentRootOperation", "(", "IPackageFragmentRoot", "root", ",", "IPath", "destination", ",", "int", "updateResourceFlags", ",", "int", "updateModelFlags", ",", "IClasspathEntry", "sibling", ")", "{", "super", "(", "root", ",", "destination", ",", "updateResourceFlags", ",", "updateModelFlags", ",", "sibling", ")", ";", "}", "protected", "void", "executeOperation", "(", ")", "throws", "JavaModelException", "{", "IPackageFragmentRoot", "root", "=", "(", "IPackageFragmentRoot", ")", "getElementToProcess", "(", ")", ";", "IClasspathEntry", "rootEntry", "=", "root", ".", "getRawClasspathEntry", "(", ")", ";", "IWorkspaceRoot", "workspaceRoot", "=", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "getRoot", "(", ")", ";", "if", "(", "!", "root", ".", "isExternal", "(", ")", "&&", "(", "this", ".", "updateModelFlags", "&", "IPackageFragmentRoot", ".", "NO_RESOURCE_MODIFICATION", ")", "==", "0", ")", "{", "moveResource", "(", "root", ",", "rootEntry", ",", "workspaceRoot", ")", ";", "}", "IJavaProject", "originatingProject", "=", "root", ".", "getJavaProject", "(", ")", ";", "if", "(", "(", "this", ".", "updateModelFlags", "&", "IPackageFragmentRoot", ".", "OTHER_REFERRING_PROJECTS_CLASSPATH", ")", "!=", "0", ")", "{", "updateReferringProjectClasspaths", "(", "rootEntry", ".", "getPath", "(", ")", ",", "originatingProject", ")", ";", "}", "boolean", "isRename", "=", "this", ".", "destination", ".", "segment", "(", "0", ")", ".", "equals", "(", "originatingProject", ".", "getElementName", "(", ")", ")", ";", "boolean", "updateOriginating", "=", "(", "this", ".", "updateModelFlags", "&", "IPackageFragmentRoot", ".", "ORIGINATING_PROJECT_CLASSPATH", ")", "!=", "0", ";", "boolean", "updateDestination", "=", "(", "this", ".", "updateModelFlags", "&", "IPackageFragmentRoot", ".", "DESTINATION_PROJECT_CLASSPATH", ")", "!=", "0", ";", "if", "(", "updateOriginating", ")", "{", "if", "(", "isRename", "&&", "updateDestination", ")", "{", "renameEntryInClasspath", "(", "rootEntry", ".", "getPath", "(", ")", ",", "originatingProject", ")", ";", "}", "else", "{", "removeEntryFromClasspath", "(", "rootEntry", ".", "getPath", "(", ")", ",", "originatingProject", ")", ";", "}", "}", "if", "(", "updateDestination", ")", "{", "if", "(", "!", "isRename", "||", "!", "updateOriginating", ")", "{", "addEntryToClasspath", "(", "rootEntry", ",", "workspaceRoot", ")", ";", "}", "}", "}", "protected", "void", "moveResource", "(", "IPackageFragmentRoot", "root", ",", "IClasspathEntry", "rootEntry", ",", "final", "IWorkspaceRoot", "workspaceRoot", ")", "throws", "JavaModelException", "{", "final", "char", "[", "]", "[", "]", "exclusionPatterns", "=", "(", "(", "ClasspathEntry", ")", "rootEntry", ")", ".", "fullExclusionPatternChars", "(", ")", ";", "IResource", "rootResource", "=", "(", "(", "JavaElement", ")", "root", ")", ".", "resource", "(", ")", ";", "if", "(", "rootEntry", ".", "getEntryKind", "(", ")", "!=", "IClasspathEntry", ".", "CPE_SOURCE", "||", "exclusionPatterns", "==", "null", ")", "{", "try", "{", "IResource", "destRes", ";", "if", "(", "(", "this", ".", "updateModelFlags", "&", "IPackageFragmentRoot", ".", "REPLACE", ")", "!=", "0", "&&", "(", "destRes", "=", "workspaceRoot", ".", "findMember", "(", "this", ".", "destination", ")", ")", "!=", "null", ")", "{", "destRes", ".", "delete", "(", "this", ".", "updateResourceFlags", ",", "this", ".", "progressMonitor", ")", ";", "}", "rootResource", ".", "move", "(", "this", ".", "destination", ",", "this", ".", "updateResourceFlags", ",", "this", ".", "progressMonitor", ")", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "throw", "new", "JavaModelException", "(", "e", ")", ";", "}", "}", "else", "{", "final", "int", "sourceSegmentCount", "=", "rootEntry", ".", "getPath", "(", ")", ".", "segmentCount", "(", ")", ";", "final", "IFolder", "destFolder", "=", "workspaceRoot", ".", "getFolder", "(", "this", ".", "destination", ")", ";", "final", "IPath", "[", "]", "nestedFolders", "=", "getNestedFolders", "(", "root", ")", ";", "IResourceProxyVisitor", "visitor", "=", "new", "IResourceProxyVisitor", "(", ")", "{", "public", "boolean", "visit", "(", "IResourceProxy", "proxy", ")", "throws", "CoreException", "{", "if", "(", "proxy", ".", "getType", "(", ")", "==", "IResource", ".", "FOLDER", ")", "{", "IPath", "path", "=", "proxy", ".", "requestFullPath", "(", ")", ";", "if", "(", "prefixesOneOf", "(", "path", ",", "nestedFolders", ")", ")", "{", "if", "(", "equalsOneOf", "(", "path", ",", "nestedFolders", ")", ")", "{", "return", "false", ";", "}", "else", "{", "IFolder", "folder", "=", "destFolder", ".", "getFolder", "(", "path", ".", "removeFirstSegments", "(", "sourceSegmentCount", ")", ")", ";", "if", "(", "(", "MovePackageFragmentRootOperation", ".", "this", ".", "updateModelFlags", "&", "IPackageFragmentRoot", ".", "REPLACE", ")", "!=", "0", "&&", "folder", ".", "exists", "(", ")", ")", "{", "return", "true", ";", "}", "folder", ".", "create", "(", "MovePackageFragmentRootOperation", ".", "this", ".", "updateResourceFlags", ",", "true", ",", "MovePackageFragmentRootOperation", ".", "this", ".", "progressMonitor", ")", ";", "return", "true", ";", "}", "}", "else", "{", "IPath", "destPath", "=", "MovePackageFragmentRootOperation", ".", "this", ".", "destination", ".", "append", "(", "path", ".", "removeFirstSegments", "(", "sourceSegmentCount", ")", ")", ";", "IResource", "destRes", ";", "if", "(", "(", "MovePackageFragmentRootOperation", ".", "this", ".", "updateModelFlags", "&", "IPackageFragmentRoot", ".", "REPLACE", ")", "!=", "0", "&&", "(", "destRes", "=", "workspaceRoot", ".", "findMember", "(", "destPath", ")", ")", "!=", "null", ")", "{", "destRes", ".", "delete", "(", "MovePackageFragmentRootOperation", ".", "this", ".", "updateResourceFlags", ",", "MovePackageFragmentRootOperation", ".", "this", ".", "progressMonitor", ")", ";", "}", "proxy", ".", "requestResource", "(", ")", ".", "move", "(", "destPath", ",", "MovePackageFragmentRootOperation", ".", "this", ".", "updateResourceFlags", ",", "MovePackageFragmentRootOperation", ".", "this", ".", "progressMonitor", ")", ";", "return", "false", ";", "}", "}", "else", "{", "IPath", "path", "=", "proxy", ".", "requestFullPath", "(", ")", ";", "IPath", "destPath", "=", "MovePackageFragmentRootOperation", ".", "this", ".", "destination", ".", "append", "(", "path", ".", "removeFirstSegments", "(", "sourceSegmentCount", ")", ")", ";", "IResource", "destRes", ";", "if", "(", "(", "MovePackageFragmentRootOperation", ".", "this", ".", "updateModelFlags", "&", "IPackageFragmentRoot", ".", "REPLACE", ")", "!=", "0", "&&", "(", "destRes", "=", "workspaceRoot", ".", "findMember", "(", "destPath", ")", ")", "!=", "null", ")", "{", "destRes", ".", "delete", "(", "MovePackageFragmentRootOperation", ".", "this", ".", "updateResourceFlags", ",", "MovePackageFragmentRootOperation", ".", "this", ".", "progressMonitor", ")", ";", "}", "proxy", ".", "requestResource", "(", ")", ".", "move", "(", "destPath", ",", "MovePackageFragmentRootOperation", ".", "this", ".", "updateResourceFlags", ",", "MovePackageFragmentRootOperation", ".", "this", ".", "progressMonitor", ")", ";", "return", "false", ";", "}", "}", "}", ";", "try", "{", "rootResource", ".", "accept", "(", "visitor", ",", "IResource", ".", "NONE", ")", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "throw", "new", "JavaModelException", "(", "e", ")", ";", "}", "}", "setAttribute", "(", "HAS_MODIFIED_RESOURCE_ATTR", ",", "TRUE", ")", ";", "}", "protected", "void", "updateReferringProjectClasspaths", "(", "IPath", "rootPath", ",", "IJavaProject", "projectOfRoot", ")", "throws", "JavaModelException", "{", "IJavaModel", "model", "=", "getJavaModel", "(", ")", ";", "IJavaProject", "[", "]", "projects", "=", "model", ".", "getJavaProjects", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "projects", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IJavaProject", "project", "=", "projects", "[", "i", "]", ";", "if", "(", "project", ".", "equals", "(", "projectOfRoot", ")", ")", "continue", ";", "renameEntryInClasspath", "(", "rootPath", ",", "project", ")", ";", "}", "}", "protected", "void", "removeEntryFromClasspath", "(", "IPath", "rootPath", ",", "IJavaProject", "project", ")", "throws", "JavaModelException", "{", "IClasspathEntry", "[", "]", "classpath", "=", "project", ".", "getRawClasspath", "(", ")", ";", "IClasspathEntry", "[", "]", "newClasspath", "=", "null", ";", "int", "cpLength", "=", "classpath", ".", "length", ";", "int", "newCPIndex", "=", "-", "1", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "cpLength", ";", "i", "++", ")", "{", "IClasspathEntry", "entry", "=", "classpath", "[", "i", "]", ";", "if", "(", "rootPath", ".", "equals", "(", "entry", ".", "getPath", "(", ")", ")", ")", "{", "if", "(", "newClasspath", "==", "null", ")", "{", "newClasspath", "=", "new", "IClasspathEntry", "[", "cpLength", "]", ";", "System", ".", "arraycopy", "(", "classpath", ",", "0", ",", "newClasspath", ",", "0", ",", "i", ")", ";", "newCPIndex", "=", "i", ";", "}", "}", "else", "if", "(", "newClasspath", "!=", "null", ")", "{", "newClasspath", "[", "newCPIndex", "++", "]", "=", "entry", ";", "}", "}", "if", "(", "newClasspath", "!=", "null", ")", "{", "if", "(", "newCPIndex", "<", "newClasspath", ".", "length", ")", "{", "System", ".", "arraycopy", "(", "newClasspath", ",", "0", ",", "newClasspath", "=", "new", "IClasspathEntry", "[", "newCPIndex", "]", ",", "0", ",", "newCPIndex", ")", ";", "}", "project", ".", "setRawClasspath", "(", "newClasspath", ",", "this", ".", "progressMonitor", ")", ";", "}", "}", "}", "</s>" ]
3,666
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "io", ".", "ByteArrayInputStream", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "io", ".", "InputStream", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "*", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IStatus", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "NullProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Path", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "jobs", ".", "ISchedulingRule", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IBuffer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElementDelta", ";", "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", ".", "JavaConventions", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Messages", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "CreateCompilationUnitOperation", "extends", "JavaModelOperation", "{", "protected", "String", "name", ";", "protected", "String", "source", "=", "null", ";", "public", "CreateCompilationUnitOperation", "(", "IPackageFragment", "parentElement", ",", "String", "name", ",", "String", "source", ",", "boolean", "force", ")", "{", "super", "(", "null", ",", "new", "IJavaElement", "[", "]", "{", "parentElement", "}", ",", "force", ")", ";", "this", ".", "name", "=", "name", ";", "this", ".", "source", "=", "source", ";", "}", "protected", "void", "executeOperation", "(", ")", "throws", "JavaModelException", "{", "try", "{", "beginTask", "(", "Messages", ".", "operation_createUnitProgress", ",", "2", ")", ";", "JavaElementDelta", "delta", "=", "newJavaElementDelta", "(", ")", ";", "ICompilationUnit", "unit", "=", "getCompilationUnit", "(", ")", ";", "IPackageFragment", "pkg", "=", "(", "IPackageFragment", ")", "getParentElement", "(", ")", ";", "IContainer", "folder", "=", "(", "IContainer", ")", "pkg", ".", "getResource", "(", ")", ";", "worked", "(", "1", ")", ";", "IFile", "compilationUnitFile", "=", "folder", ".", "getFile", "(", "new", "Path", "(", "this", ".", "name", ")", ")", ";", "if", "(", "compilationUnitFile", ".", "exists", "(", ")", ")", "{", "if", "(", "this", ".", "force", ")", "{", "IBuffer", "buffer", "=", "unit", ".", "getBuffer", "(", ")", ";", "if", "(", "buffer", "==", "null", ")", "return", ";", "buffer", ".", "setContents", "(", "this", ".", "source", ")", ";", "unit", ".", "save", "(", "new", "NullProgressMonitor", "(", ")", ",", "false", ")", ";", "this", ".", "resultElements", "=", "new", "IJavaElement", "[", "]", "{", "unit", "}", ";", "if", "(", "!", "Util", ".", "isExcluded", "(", "unit", ")", "&&", "unit", ".", "getParent", "(", ")", ".", "exists", "(", ")", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "resultElements", ".", "length", ";", "i", "++", ")", "{", "delta", ".", "changed", "(", "this", ".", "resultElements", "[", "i", "]", ",", "IJavaElementDelta", ".", "F_CONTENT", ")", ";", "}", "addDelta", "(", "delta", ")", ";", "}", "}", "else", "{", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "NAME_COLLISION", ",", "Messages", ".", "bind", "(", "Messages", ".", "status_nameCollision", ",", "compilationUnitFile", ".", "getFullPath", "(", ")", ".", "toString", "(", ")", ")", ")", ")", ";", "}", "}", "else", "{", "try", "{", "String", "encoding", "=", "null", ";", "try", "{", "encoding", "=", "folder", ".", "getDefaultCharset", "(", ")", ";", "}", "catch", "(", "CoreException", "ce", ")", "{", "}", "InputStream", "stream", "=", "new", "ByteArrayInputStream", "(", "encoding", "==", "null", "?", "this", ".", "source", ".", "getBytes", "(", ")", ":", "this", ".", "source", ".", "getBytes", "(", "encoding", ")", ")", ";", "createFile", "(", "folder", ",", "unit", ".", "getElementName", "(", ")", ",", "stream", ",", "this", ".", "force", ")", ";", "this", ".", "resultElements", "=", "new", "IJavaElement", "[", "]", "{", "unit", "}", ";", "if", "(", "!", "Util", ".", "isExcluded", "(", "unit", ")", "&&", "unit", ".", "getParent", "(", ")", ".", "exists", "(", ")", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "resultElements", ".", "length", ";", "i", "++", ")", "{", "delta", ".", "added", "(", "this", ".", "resultElements", "[", "i", "]", ")", ";", "}", "addDelta", "(", "delta", ")", ";", "}", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "JavaModelException", "(", "e", ",", "IJavaModelStatusConstants", ".", "IO_EXCEPTION", ")", ";", "}", "}", "worked", "(", "1", ")", ";", "}", "finally", "{", "done", "(", ")", ";", "}", "}", "protected", "ICompilationUnit", "getCompilationUnit", "(", ")", "{", "return", "(", "(", "IPackageFragment", ")", "getParentElement", "(", ")", ")", ".", "getCompilationUnit", "(", "this", ".", "name", ")", ";", "}", "protected", "ISchedulingRule", "getSchedulingRule", "(", ")", "{", "IResource", "resource", "=", "getCompilationUnit", "(", ")", ".", "getResource", "(", ")", ";", "IWorkspace", "workspace", "=", "resource", ".", "getWorkspace", "(", ")", ";", "if", "(", "resource", ".", "exists", "(", ")", ")", "{", "return", "workspace", ".", "getRuleFactory", "(", ")", ".", "modifyRule", "(", "resource", ")", ";", "}", "else", "{", "return", "workspace", ".", "getRuleFactory", "(", ")", ".", "createRule", "(", "resource", ")", ";", "}", "}", "public", "IJavaModelStatus", "verify", "(", ")", "{", "if", "(", "getParentElement", "(", ")", "==", "null", ")", "{", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "NO_ELEMENTS_TO_PROCESS", ")", ";", "}", "IJavaProject", "project", "=", "getParentElement", "(", ")", ".", "getJavaProject", "(", ")", ";", "if", "(", "JavaConventions", ".", "validateCompilationUnitName", "(", "this", ".", "name", ",", "project", ".", "getOption", "(", "JavaCore", ".", "COMPILER_SOURCE", ",", "true", ")", ",", "project", ".", "getOption", "(", "JavaCore", ".", "COMPILER_COMPLIANCE", ",", "true", ")", ")", ".", "getSeverity", "(", ")", "==", "IStatus", ".", "ERROR", ")", "{", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INVALID_NAME", ",", "this", ".", "name", ")", ";", "}", "if", "(", "this", ".", "source", "==", "null", ")", "{", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INVALID_CONTENTS", ")", ";", "}", "return", "JavaModelStatus", ".", "VERIFIED_OK", ";", "}", "}", "</s>" ]
3,667
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IProject", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IStatus", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IClasspathEntry", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaModelStatus", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "builder", ".", "JavaBuilder", ";", "public", "class", "ClasspathValidation", "{", "private", "JavaProject", "project", ";", "public", "ClasspathValidation", "(", "JavaProject", "project", ")", "{", "this", ".", "project", "=", "project", ";", "}", "public", "void", "validate", "(", ")", "{", "JavaModelManager", ".", "PerProjectInfo", "perProjectInfo", ";", "try", "{", "perProjectInfo", "=", "this", ".", "project", ".", "getPerProjectInfo", "(", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "IProject", "resource", "=", "this", ".", "project", ".", "getProject", "(", ")", ";", "if", "(", "resource", ".", "isAccessible", "(", ")", ")", "{", "this", ".", "project", ".", "flushClasspathProblemMarkers", "(", "true", ",", "true", ",", "true", ")", ";", "JavaBuilder", ".", "removeProblemsAndTasksFor", "(", "resource", ")", ";", "}", "return", ";", "}", "IClasspathEntry", "[", "]", "rawClasspath", ";", "IPath", "outputLocation", ";", "IJavaModelStatus", "status", ";", "synchronized", "(", "perProjectInfo", ")", "{", "rawClasspath", "=", "perProjectInfo", ".", "rawClasspath", ";", "outputLocation", "=", "perProjectInfo", ".", "outputLocation", ";", "status", "=", "perProjectInfo", ".", "rawClasspathStatus", ";", "}", "this", ".", "project", ".", "flushClasspathProblemMarkers", "(", "false", ",", "true", ",", "false", ")", ";", "if", "(", "!", "status", ".", "isOK", "(", ")", ")", "this", ".", "project", ".", "createClasspathProblemMarker", "(", "status", ")", ";", "this", ".", "project", ".", "flushClasspathProblemMarkers", "(", "false", ",", "false", ",", "true", ")", ";", "this", ".", "project", ".", "flushClasspathProblemMarkers", "(", "false", ",", "false", ",", "false", ")", ";", "if", "(", "rawClasspath", "!=", "JavaProject", ".", "INVALID_CLASSPATH", "&&", "outputLocation", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "rawClasspath", ".", "length", ";", "i", "++", ")", "{", "status", "=", "ClasspathEntry", ".", "validateClasspathEntry", "(", "this", ".", "project", ",", "rawClasspath", "[", "i", "]", ",", "false", ",", "false", ")", ";", "if", "(", "!", "status", ".", "isOK", "(", ")", ")", "{", "this", ".", "project", ".", "createClasspathProblemMarker", "(", "status", ")", ";", "}", "}", "status", "=", "ClasspathEntry", ".", "validateClasspath", "(", "this", ".", "project", ",", "rawClasspath", ",", "outputLocation", ")", ";", "if", "(", "status", ".", "getCode", "(", ")", "!=", "IStatus", ".", "OK", ")", "this", ".", "project", ".", "createClasspathProblemMarker", "(", "status", ")", ";", "}", "}", "}", "</s>" ]
3,668
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "public", "class", "InitializerElementInfo", "extends", "MemberElementInfo", "{", "}", "</s>" ]
3,669
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "preferences", ".", "IEclipsePreferences", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "preferences", ".", "InstanceScope", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "preferences", ".", "PreferenceModifyListener", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "*", ";", "import", "org", ".", "osgi", ".", "service", ".", "prefs", ".", "BackingStoreException", ";", "import", "org", ".", "osgi", ".", "service", ".", "prefs", ".", "Preferences", ";", "public", "class", "JavaCorePreferenceModifyListener", "extends", "PreferenceModifyListener", "{", "static", "int", "PREFIX_LENGTH", "=", "JavaModelManager", ".", "CP_CONTAINER_PREFERENCES_PREFIX", ".", "length", "(", ")", ";", "JavaModel", "javaModel", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "getJavaModel", "(", ")", ";", "public", "IEclipsePreferences", "preApply", "(", "IEclipsePreferences", "node", ")", "{", "Preferences", "instance", "=", "node", ".", "node", "(", "InstanceScope", ".", "SCOPE", ")", ";", "cleanJavaCore", "(", "instance", ".", "node", "(", "JavaCore", ".", "PLUGIN_ID", ")", ")", ";", "return", "super", ".", "preApply", "(", "node", ")", ";", "}", "void", "cleanJavaCore", "(", "Preferences", "preferences", ")", "{", "try", "{", "String", "[", "]", "keys", "=", "preferences", ".", "keys", "(", ")", ";", "for", "(", "int", "k", "=", "0", ",", "kl", "=", "keys", ".", "length", ";", "k", "<", "kl", ";", "k", "++", ")", "{", "String", "key", "=", "keys", "[", "k", "]", ";", "if", "(", "key", ".", "startsWith", "(", "JavaModelManager", ".", "CP_CONTAINER_PREFERENCES_PREFIX", ")", "&&", "!", "isJavaProjectAccessible", "(", "key", ")", ")", "{", "preferences", ".", "remove", "(", "key", ")", ";", "}", "}", "}", "catch", "(", "BackingStoreException", "e", ")", "{", "}", "}", "boolean", "isJavaProjectAccessible", "(", "String", "propertyName", ")", "{", "int", "index", "=", "propertyName", ".", "indexOf", "(", "'|'", ",", "PREFIX_LENGTH", ")", ";", "if", "(", "index", ">", "0", ")", "{", "final", "String", "projectName", "=", "propertyName", ".", "substring", "(", "PREFIX_LENGTH", ",", "index", ")", ".", "trim", "(", ")", ";", "JavaProject", "project", "=", "(", "JavaProject", ")", "this", ".", "javaModel", ".", "getJavaProject", "(", "projectName", ")", ";", "if", "(", "project", ".", "getProject", "(", ")", ".", "isAccessible", "(", ")", ")", "{", "return", "true", ";", "}", "}", "return", "false", ";", "}", "}", "</s>" ]
3,670
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "util", ".", "Enumeration", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "LRUCache", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Messages", ";", "public", "abstract", "class", "OverflowingLRUCache", "extends", "LRUCache", "{", "protected", "int", "overflow", "=", "0", ";", "protected", "boolean", "timestampsOn", "=", "true", ";", "protected", "double", "loadFactor", "=", "0.333", ";", "public", "OverflowingLRUCache", "(", "int", "size", ")", "{", "this", "(", "size", ",", "0", ")", ";", "}", "public", "OverflowingLRUCache", "(", "int", "size", ",", "int", "overflow", ")", "{", "super", "(", "size", ")", ";", "this", ".", "overflow", "=", "overflow", ";", "}", "public", "Object", "clone", "(", ")", "{", "OverflowingLRUCache", "newCache", "=", "(", "OverflowingLRUCache", ")", "newInstance", "(", "this", ".", "spaceLimit", ",", "this", ".", "overflow", ")", ";", "LRUCacheEntry", "qEntry", ";", "qEntry", "=", "this", ".", "entryQueueTail", ";", "while", "(", "qEntry", "!=", "null", ")", "{", "newCache", ".", "privateAdd", "(", "qEntry", ".", "key", ",", "qEntry", ".", "value", ",", "qEntry", ".", "space", ")", ";", "qEntry", "=", "qEntry", ".", "previous", ";", "}", "return", "newCache", ";", "}", "protected", "abstract", "boolean", "close", "(", "LRUCacheEntry", "entry", ")", ";", "public", "Enumeration", "elements", "(", ")", "{", "if", "(", "this", ".", "entryQueue", "==", "null", ")", "return", "new", "LRUCacheEnumerator", "(", "null", ")", ";", "LRUCacheEnumerator", ".", "LRUEnumeratorElement", "head", "=", "new", "LRUCacheEnumerator", ".", "LRUEnumeratorElement", "(", "this", ".", "entryQueue", ".", "value", ")", ";", "LRUCacheEntry", "currentEntry", "=", "this", ".", "entryQueue", ".", "next", ";", "LRUCacheEnumerator", ".", "LRUEnumeratorElement", "currentElement", "=", "head", ";", "while", "(", "currentEntry", "!=", "null", ")", "{", "currentElement", ".", "next", "=", "new", "LRUCacheEnumerator", ".", "LRUEnumeratorElement", "(", "currentEntry", ".", "value", ")", ";", "currentElement", "=", "currentElement", ".", "next", ";", "currentEntry", "=", "currentEntry", ".", "next", ";", "}", "return", "new", "LRUCacheEnumerator", "(", "head", ")", ";", "}", "public", "double", "fillingRatio", "(", ")", "{", "return", "(", "this", ".", "currentSpace", "+", "this", ".", "overflow", ")", "*", "100.0", "/", "this", ".", "spaceLimit", ";", "}", "public", "java", ".", "util", ".", "Hashtable", "getEntryTable", "(", ")", "{", "return", "this", ".", "entryTable", ";", "}", "public", "double", "getLoadFactor", "(", ")", "{", "return", "this", ".", "loadFactor", ";", "}", "public", "int", "getOverflow", "(", ")", "{", "return", "this", ".", "overflow", ";", "}", "protected", "boolean", "makeSpace", "(", "int", "space", ")", "{", "int", "limit", "=", "this", ".", "spaceLimit", ";", "if", "(", "this", ".", "overflow", "==", "0", "&&", "this", ".", "currentSpace", "+", "space", "<=", "limit", ")", "{", "return", "true", ";", "}", "int", "spaceNeeded", "=", "(", "int", ")", "(", "(", "1", "-", "this", ".", "loadFactor", ")", "*", "limit", ")", ";", "spaceNeeded", "=", "(", "spaceNeeded", ">", "space", ")", "?", "spaceNeeded", ":", "space", ";", "LRUCacheEntry", "entry", "=", "this", ".", "entryQueueTail", ";", "try", "{", "this", ".", "timestampsOn", "=", "false", ";", "while", "(", "this", ".", "currentSpace", "+", "spaceNeeded", ">", "limit", "&&", "entry", "!=", "null", ")", "{", "this", ".", "privateRemoveEntry", "(", "entry", ",", "false", ",", "false", ")", ";", "entry", "=", "entry", ".", "previous", ";", "}", "}", "finally", "{", "this", ".", "timestampsOn", "=", "true", ";", "}", "if", "(", "this", ".", "currentSpace", "+", "space", "<=", "limit", ")", "{", "this", ".", "overflow", "=", "0", ";", "return", "true", ";", "}", "this", ".", "overflow", "=", "this", ".", "currentSpace", "+", "space", "-", "limit", ";", "return", "false", ";", "}", "protected", "abstract", "LRUCache", "newInstance", "(", "int", "size", ",", "int", "newOverflow", ")", ";", "public", "void", "printStats", "(", ")", "{", "int", "forwardListLength", "=", "0", ";", "LRUCacheEntry", "entry", "=", "this", ".", "entryQueue", ";", "while", "(", "entry", "!=", "null", ")", "{", "forwardListLength", "++", ";", "entry", "=", "entry", ".", "next", ";", "}", "System", ".", "out", ".", "println", "(", "\"\"", "+", "forwardListLength", ")", ";", "int", "backwardListLength", "=", "0", ";", "entry", "=", "this", ".", "entryQueueTail", ";", "while", "(", "entry", "!=", "null", ")", "{", "backwardListLength", "++", ";", "entry", "=", "entry", ".", "previous", ";", "}", "System", ".", "out", ".", "println", "(", "\"\"", "+", "backwardListLength", ")", ";", "Enumeration", "keys", "=", "this", ".", "entryTable", ".", "keys", "(", ")", ";", "class", "Temp", "{", "public", "Class", "clazz", ";", "public", "int", "count", ";", "public", "Temp", "(", "Class", "aClass", ")", "{", "this", ".", "clazz", "=", "aClass", ";", "this", ".", "count", "=", "1", ";", "}", "public", "String", "toString", "(", ")", "{", "return", "\"Class:", "\"", "+", "this", ".", "clazz", "+", "\"", "has", "\"", "+", "this", ".", "count", "+", "\"", "entries.\"", ";", "}", "}", "java", ".", "util", ".", "HashMap", "h", "=", "new", "java", ".", "util", ".", "HashMap", "(", ")", ";", "while", "(", "keys", ".", "hasMoreElements", "(", ")", ")", "{", "entry", "=", "(", "LRUCacheEntry", ")", "this", ".", "entryTable", ".", "get", "(", "keys", ".", "nextElement", "(", ")", ")", ";", "Class", "key", "=", "entry", ".", "value", ".", "getClass", "(", ")", ";", "Temp", "t", "=", "(", "Temp", ")", "h", ".", "get", "(", "key", ")", ";", "if", "(", "t", "==", "null", ")", "{", "h", ".", "put", "(", "key", ",", "new", "Temp", "(", "key", ")", ")", ";", "}", "else", "{", "t", ".", "count", "++", ";", "}", "}", "for", "(", "Iterator", "iter", "=", "h", ".", "values", "(", ")", ".", "iterator", "(", ")", ";", "iter", ".", "hasNext", "(", ")", ";", ")", "{", "System", ".", "out", ".", "println", "(", "iter", ".", "next", "(", ")", ")", ";", "}", "}", "protected", "void", "privateRemoveEntry", "(", "LRUCacheEntry", "entry", ",", "boolean", "shuffle", ")", "{", "privateRemoveEntry", "(", "entry", ",", "shuffle", ",", "true", ")", ";", "}", "protected", "void", "privateRemoveEntry", "(", "LRUCacheEntry", "entry", ",", "boolean", "shuffle", ",", "boolean", "external", ")", "{", "if", "(", "!", "shuffle", ")", "{", "if", "(", "external", ")", "{", "this", ".", "entryTable", ".", "remove", "(", "entry", ".", "key", ")", ";", "this", ".", "currentSpace", "-=", "entry", ".", "space", ";", "}", "else", "{", "if", "(", "!", "close", "(", "entry", ")", ")", "return", ";", "if", "(", "this", ".", "entryTable", ".", "get", "(", "entry", ".", "key", ")", "==", "null", ")", "{", "return", ";", "}", "else", "{", "this", ".", "entryTable", ".", "remove", "(", "entry", ".", "key", ")", ";", "this", ".", "currentSpace", "-=", "entry", ".", "space", ";", "}", "}", "}", "LRUCacheEntry", "previous", "=", "entry", ".", "previous", ";", "LRUCacheEntry", "next", "=", "entry", ".", "next", ";", "if", "(", "previous", "==", "null", ")", "{", "this", ".", "entryQueue", "=", "next", ";", "}", "else", "{", "previous", ".", "next", "=", "next", ";", "}", "if", "(", "next", "==", "null", ")", "{", "this", ".", "entryQueueTail", "=", "previous", ";", "}", "else", "{", "next", ".", "previous", "=", "previous", ";", "}", "}", "public", "Object", "put", "(", "Object", "key", ",", "Object", "value", ")", "{", "if", "(", "this", ".", "overflow", ">", "0", ")", "shrink", "(", ")", ";", "int", "newSpace", "=", "spaceFor", "(", "value", ")", ";", "LRUCacheEntry", "entry", "=", "(", "LRUCacheEntry", ")", "this", ".", "entryTable", ".", "get", "(", "key", ")", ";", "if", "(", "entry", "!=", "null", ")", "{", "int", "oldSpace", "=", "entry", ".", "space", ";", "int", "newTotal", "=", "this", ".", "currentSpace", "-", "oldSpace", "+", "newSpace", ";", "if", "(", "newTotal", "<=", "this", ".", "spaceLimit", ")", "{", "updateTimestamp", "(", "entry", ")", ";", "entry", ".", "value", "=", "value", ";", "entry", ".", "space", "=", "newSpace", ";", "this", ".", "currentSpace", "=", "newTotal", ";", "this", ".", "overflow", "=", "0", ";", "return", "value", ";", "}", "else", "{", "privateRemoveEntry", "(", "entry", ",", "false", ",", "false", ")", ";", "}", "}", "makeSpace", "(", "newSpace", ")", ";", "privateAdd", "(", "key", ",", "value", ",", "newSpace", ")", ";", "return", "value", ";", "}", "public", "Object", "remove", "(", "Object", "key", ")", "{", "return", "removeKey", "(", "key", ")", ";", "}", "public", "void", "setLoadFactor", "(", "double", "newLoadFactor", ")", "throws", "IllegalArgumentException", "{", "if", "(", "newLoadFactor", "<=", "1.0", "&&", "newLoadFactor", ">", "0.0", ")", "this", ".", "loadFactor", "=", "newLoadFactor", ";", "else", "throw", "new", "IllegalArgumentException", "(", "Messages", ".", "cache_invalidLoadFactor", ")", ";", "}", "public", "void", "setSpaceLimit", "(", "int", "limit", ")", "{", "if", "(", "limit", "<", "this", ".", "spaceLimit", ")", "{", "makeSpace", "(", "this", ".", "spaceLimit", "-", "limit", ")", ";", "}", "this", ".", "spaceLimit", "=", "limit", ";", "}", "public", "boolean", "shrink", "(", ")", "{", "if", "(", "this", ".", "overflow", ">", "0", ")", "return", "makeSpace", "(", "0", ")", ";", "return", "true", ";", "}", "public", "String", "toString", "(", ")", "{", "return", "toStringFillingRation", "(", "\"\"", ")", "+", "toStringContents", "(", ")", ";", "}", "protected", "void", "updateTimestamp", "(", "LRUCacheEntry", "entry", ")", "{", "if", "(", "this", ".", "timestampsOn", ")", "{", "entry", ".", "timestamp", "=", "this", ".", "timestampCounter", "++", ";", "if", "(", "this", ".", "entryQueue", "!=", "entry", ")", "{", "this", ".", "privateRemoveEntry", "(", "entry", ",", "true", ")", ";", "privateAddEntry", "(", "entry", ",", "true", ")", ";", "}", "}", "}", "}", "</s>" ]
3,671
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "util", ".", "HashSet", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "*", ";", "public", "class", "ModelUpdater", "{", "HashSet", "projectsToUpdate", "=", "new", "HashSet", "(", ")", ";", "protected", "void", "addToParentInfo", "(", "Openable", "child", ")", "{", "Openable", "parent", "=", "(", "Openable", ")", "child", ".", "getParent", "(", ")", ";", "if", "(", "parent", "!=", "null", "&&", "parent", ".", "isOpen", "(", ")", ")", "{", "try", "{", "OpenableElementInfo", "info", "=", "(", "OpenableElementInfo", ")", "parent", ".", "getElementInfo", "(", ")", ";", "info", ".", "addChild", "(", "child", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "}", "}", "protected", "static", "void", "close", "(", "Openable", "element", ")", "{", "try", "{", "element", ".", "close", "(", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "}", "protected", "void", "elementAdded", "(", "Openable", "element", ")", "{", "int", "elementType", "=", "element", ".", "getElementType", "(", ")", ";", "if", "(", "elementType", "==", "IJavaElement", ".", "JAVA_PROJECT", ")", "{", "addToParentInfo", "(", "element", ")", ";", "this", ".", "projectsToUpdate", ".", "add", "(", "element", ")", ";", "}", "else", "{", "addToParentInfo", "(", "element", ")", ";", "close", "(", "element", ")", ";", "}", "switch", "(", "elementType", ")", "{", "case", "IJavaElement", ".", "PACKAGE_FRAGMENT_ROOT", ":", "this", ".", "projectsToUpdate", ".", "add", "(", "element", ".", "getJavaProject", "(", ")", ")", ";", "break", ";", "case", "IJavaElement", ".", "PACKAGE_FRAGMENT", ":", "JavaProject", "project", "=", "(", "JavaProject", ")", "element", ".", "getJavaProject", "(", ")", ";", "project", ".", "resetCaches", "(", ")", ";", "break", ";", "}", "}", "protected", "void", "elementChanged", "(", "Openable", "element", ")", "{", "close", "(", "element", ")", ";", "}", "protected", "void", "elementRemoved", "(", "Openable", "element", ")", "{", "if", "(", "element", ".", "isOpen", "(", ")", ")", "{", "close", "(", "element", ")", ";", "}", "removeFromParentInfo", "(", "element", ")", ";", "int", "elementType", "=", "element", ".", "getElementType", "(", ")", ";", "switch", "(", "elementType", ")", "{", "case", "IJavaElement", ".", "JAVA_MODEL", ":", "JavaModelManager", ".", "getIndexManager", "(", ")", ".", "reset", "(", ")", ";", "break", ";", "case", "IJavaElement", ".", "JAVA_PROJECT", ":", "JavaModelManager", "manager", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ";", "JavaProject", "javaProject", "=", "(", "JavaProject", ")", "element", ";", "manager", ".", "removePerProjectInfo", "(", "javaProject", ",", "true", ")", ";", "manager", ".", "containerRemove", "(", "javaProject", ")", ";", "break", ";", "case", "IJavaElement", ".", "PACKAGE_FRAGMENT_ROOT", ":", "this", ".", "projectsToUpdate", ".", "add", "(", "element", ".", "getJavaProject", "(", ")", ")", ";", "break", ";", "case", "IJavaElement", ".", "PACKAGE_FRAGMENT", ":", "JavaProject", "project", "=", "(", "JavaProject", ")", "element", ".", "getJavaProject", "(", ")", ";", "project", ".", "resetCaches", "(", ")", ";", "break", ";", "}", "}", "public", "void", "processJavaDelta", "(", "IJavaElementDelta", "delta", ")", "{", "try", "{", "traverseDelta", "(", "delta", ",", "null", ",", "null", ")", ";", "Iterator", "iterator", "=", "this", ".", "projectsToUpdate", ".", "iterator", "(", ")", ";", "while", "(", "iterator", ".", "hasNext", "(", ")", ")", "{", "JavaProject", "project", "=", "(", "JavaProject", ")", "iterator", ".", "next", "(", ")", ";", "project", ".", "resetCaches", "(", ")", ";", "}", "}", "finally", "{", "this", ".", "projectsToUpdate", "=", "new", "HashSet", "(", ")", ";", "}", "}", "protected", "void", "removeFromParentInfo", "(", "Openable", "child", ")", "{", "Openable", "parent", "=", "(", "Openable", ")", "child", ".", "getParent", "(", ")", ";", "if", "(", "parent", "!=", "null", "&&", "parent", ".", "isOpen", "(", ")", ")", "{", "try", "{", "OpenableElementInfo", "info", "=", "(", "OpenableElementInfo", ")", "parent", ".", "getElementInfo", "(", ")", ";", "info", ".", "removeChild", "(", "child", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "}", "}", "protected", "void", "traverseDelta", "(", "IJavaElementDelta", "delta", ",", "IPackageFragmentRoot", "root", ",", "IJavaProject", "project", ")", "{", "boolean", "processChildren", "=", "true", ";", "Openable", "element", "=", "(", "Openable", ")", "delta", ".", "getElement", "(", ")", ";", "switch", "(", "element", ".", "getElementType", "(", ")", ")", "{", "case", "IJavaElement", ".", "JAVA_PROJECT", ":", "project", "=", "(", "IJavaProject", ")", "element", ";", "break", ";", "case", "IJavaElement", ".", "PACKAGE_FRAGMENT_ROOT", ":", "root", "=", "(", "IPackageFragmentRoot", ")", "element", ";", "break", ";", "case", "IJavaElement", ".", "COMPILATION_UNIT", ":", "CompilationUnit", "cu", "=", "(", "CompilationUnit", ")", "element", ";", "if", "(", "cu", ".", "isWorkingCopy", "(", ")", "&&", "!", "cu", ".", "isPrimary", "(", ")", ")", "{", "return", ";", "}", "case", "IJavaElement", ".", "CLASS_FILE", ":", "processChildren", "=", "false", ";", "break", ";", "}", "switch", "(", "delta", ".", "getKind", "(", ")", ")", "{", "case", "IJavaElementDelta", ".", "ADDED", ":", "elementAdded", "(", "element", ")", ";", "break", ";", "case", "IJavaElementDelta", ".", "REMOVED", ":", "elementRemoved", "(", "element", ")", ";", "break", ";", "case", "IJavaElementDelta", ".", "CHANGED", ":", "if", "(", "(", "delta", ".", "getFlags", "(", ")", "&", "IJavaElementDelta", ".", "F_CONTENT", ")", "!=", "0", ")", "{", "elementChanged", "(", "element", ")", ";", "}", "break", ";", "}", "if", "(", "processChildren", ")", "{", "IJavaElementDelta", "[", "]", "children", "=", "delta", ".", "getAffectedChildren", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "children", ".", "length", ";", "i", "++", ")", "{", "IJavaElementDelta", "childDelta", "=", "children", "[", "i", "]", ";", "traverseDelta", "(", "childDelta", ",", "root", ",", "project", ")", ";", "}", "}", "}", "}", "</s>" ]
3,672
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IAnnotation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IClassFile", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IMember", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IMemberValuePair", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ISourceRange", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "SourceRange", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "IBinaryAnnotation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "IBinaryElementValuePair", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "Annotation", "extends", "SourceRefElement", "implements", "IAnnotation", "{", "public", "static", "final", "IAnnotation", "[", "]", "NO_ANNOTATIONS", "=", "new", "IAnnotation", "[", "0", "]", ";", "public", "static", "final", "IMemberValuePair", "[", "]", "NO_MEMBER_VALUE_PAIRS", "=", "new", "IMemberValuePair", "[", "0", "]", ";", "protected", "String", "name", ";", "protected", "String", "memberValuePairName", ";", "public", "Annotation", "(", "JavaElement", "parent", ",", "String", "name", ")", "{", "this", "(", "parent", ",", "name", ",", "null", ")", ";", "}", "public", "Annotation", "(", "JavaElement", "parent", ",", "String", "name", ",", "String", "memberValuePairName", ")", "{", "super", "(", "parent", ")", ";", "this", ".", "name", "=", "name", ";", "this", ".", "memberValuePairName", "=", "memberValuePairName", ";", "}", "public", "boolean", "equals", "(", "Object", "o", ")", "{", "if", "(", "!", "(", "o", "instanceof", "Annotation", ")", ")", "{", "return", "false", ";", "}", "Annotation", "other", "=", "(", "Annotation", ")", "o", ";", "if", "(", "this", ".", "memberValuePairName", "==", "null", ")", "{", "if", "(", "other", ".", "memberValuePairName", "!=", "null", ")", "return", "false", ";", "}", "else", "if", "(", "!", "this", ".", "memberValuePairName", ".", "equals", "(", "other", ".", "memberValuePairName", ")", ")", "{", "return", "false", ";", "}", "return", "super", ".", "equals", "(", "o", ")", ";", "}", "public", "IMember", "getDeclaringMember", "(", ")", "{", "return", "(", "IMember", ")", "getParent", "(", ")", ";", "}", "public", "String", "getElementName", "(", ")", "{", "return", "this", ".", "name", ";", "}", "public", "int", "getElementType", "(", ")", "{", "return", "ANNOTATION", ";", "}", "protected", "char", "getHandleMementoDelimiter", "(", ")", "{", "return", "JavaElement", ".", "JEM_ANNOTATION", ";", "}", "public", "IMemberValuePair", "[", "]", "getMemberValuePairs", "(", ")", "throws", "JavaModelException", "{", "Object", "info", "=", "getElementInfo", "(", ")", ";", "if", "(", "info", "instanceof", "AnnotationInfo", ")", "return", "(", "(", "AnnotationInfo", ")", "info", ")", ".", "members", ";", "IBinaryElementValuePair", "[", "]", "binaryAnnotations", "=", "(", "(", "IBinaryAnnotation", ")", "info", ")", ".", "getElementValuePairs", "(", ")", ";", "int", "length", "=", "binaryAnnotations", ".", "length", ";", "IMemberValuePair", "[", "]", "result", "=", "new", "IMemberValuePair", "[", "length", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IBinaryElementValuePair", "binaryAnnotation", "=", "binaryAnnotations", "[", "i", "]", ";", "MemberValuePair", "memberValuePair", "=", "new", "MemberValuePair", "(", "new", "String", "(", "binaryAnnotation", ".", "getName", "(", ")", ")", ")", ";", "memberValuePair", ".", "value", "=", "Util", ".", "getAnnotationMemberValue", "(", "this", ",", "memberValuePair", ",", "binaryAnnotation", ".", "getValue", "(", ")", ")", ";", "result", "[", "i", "]", "=", "memberValuePair", ";", "}", "return", "result", ";", "}", "public", "ISourceRange", "getNameRange", "(", ")", "throws", "JavaModelException", "{", "SourceMapper", "mapper", "=", "getSourceMapper", "(", ")", ";", "if", "(", "mapper", "!=", "null", ")", "{", "ClassFile", "classFile", "=", "(", "ClassFile", ")", "getClassFile", "(", ")", ";", "if", "(", "classFile", "!=", "null", ")", "{", "classFile", ".", "getBuffer", "(", ")", ";", "return", "mapper", ".", "getNameRange", "(", "this", ")", ";", "}", "}", "Object", "info", "=", "getElementInfo", "(", ")", ";", "if", "(", "info", "instanceof", "AnnotationInfo", ")", "{", "AnnotationInfo", "annotationInfo", "=", "(", "AnnotationInfo", ")", "info", ";", "return", "new", "SourceRange", "(", "annotationInfo", ".", "nameStart", ",", "annotationInfo", ".", "nameEnd", "-", "annotationInfo", ".", "nameStart", "+", "1", ")", ";", "}", "return", "null", ";", "}", "public", "ISourceRange", "getSourceRange", "(", ")", "throws", "JavaModelException", "{", "SourceMapper", "mapper", "=", "getSourceMapper", "(", ")", ";", "if", "(", "mapper", "!=", "null", ")", "{", "ClassFile", "classFile", "=", "(", "ClassFile", ")", "getClassFile", "(", ")", ";", "if", "(", "classFile", "!=", "null", ")", "{", "classFile", ".", "getBuffer", "(", ")", ";", "return", "mapper", ".", "getSourceRange", "(", "this", ")", ";", "}", "}", "return", "super", ".", "getSourceRange", "(", ")", ";", "}", "public", "IClassFile", "getClassFile", "(", ")", "{", "return", "(", "(", "JavaElement", ")", "getParent", "(", ")", ")", ".", "getClassFile", "(", ")", ";", "}", "public", "int", "hashCode", "(", ")", "{", "final", "int", "prime", "=", "31", ";", "int", "result", "=", "super", ".", "hashCode", "(", ")", ";", "result", "=", "prime", "*", "result", "+", "(", "(", "this", ".", "memberValuePairName", "==", "null", ")", "?", "0", ":", "this", ".", "memberValuePairName", ".", "hashCode", "(", ")", ")", ";", "result", "=", "prime", "*", "result", "+", "this", ".", "name", ".", "hashCode", "(", ")", ";", "return", "result", ";", "}", "protected", "void", "toStringName", "(", "StringBuffer", "buffer", ")", "{", "buffer", ".", "append", "(", "'@'", ")", ";", "buffer", ".", "append", "(", "getElementName", "(", ")", ")", ";", "}", "}", "</s>" ]
3,673
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "class", "JarPackageFragmentInfo", "extends", "PackageFragmentInfo", "{", "Object", "[", "]", "getNonJavaResources", "(", ")", "{", "return", "this", ".", "nonJavaResources", ";", "}", "}", "</s>" ]
3,674
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "public", "class", "ResolvedSourceMethod", "extends", "SourceMethod", "{", "private", "String", "uniqueKey", ";", "public", "ResolvedSourceMethod", "(", "JavaElement", "parent", ",", "String", "name", ",", "String", "[", "]", "parameterTypes", ",", "String", "uniqueKey", ")", "{", "super", "(", "parent", ",", "name", ",", "parameterTypes", ")", ";", "this", ".", "uniqueKey", "=", "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", ".", "getKey", "(", ")", ")", ";", "buffer", ".", "append", "(", "\"}\"", ")", ";", "}", "}", "public", "JavaElement", "unresolved", "(", ")", "{", "SourceRefElement", "handle", "=", "new", "SourceMethod", "(", "this", ".", "parent", ",", "this", ".", "name", ",", "this", ".", "parameterTypes", ")", ";", "handle", ".", "occurrenceCount", "=", "this", ".", "occurrenceCount", ";", "return", "handle", ";", "}", "}", "</s>" ]
3,675
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "ISourceMethod", ";", "public", "abstract", "class", "SourceMethodElementInfo", "extends", "AnnotatableInfo", "implements", "ISourceMethod", "{", "protected", "char", "[", "]", "[", "]", "argumentNames", ";", "protected", "char", "[", "]", "[", "]", "exceptionTypes", ";", "protected", "ILocalVariable", "[", "]", "arguments", ";", "protected", "ITypeParameter", "[", "]", "typeParameters", "=", "TypeParameter", ".", "NO_TYPE_PARAMETERS", ";", "public", "char", "[", "]", "[", "]", "getArgumentNames", "(", ")", "{", "return", "this", ".", "argumentNames", ";", "}", "public", "char", "[", "]", "[", "]", "getExceptionTypeNames", "(", ")", "{", "return", "this", ".", "exceptionTypes", ";", "}", "public", "abstract", "char", "[", "]", "getReturnTypeName", "(", ")", ";", "public", "char", "[", "]", "[", "]", "[", "]", "getTypeParameterBounds", "(", ")", "{", "int", "length", "=", "this", ".", "typeParameters", ".", "length", ";", "char", "[", "]", "[", "]", "[", "]", "typeParameterBounds", "=", "new", "char", "[", "length", "]", "[", "]", "[", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "try", "{", "TypeParameterElementInfo", "info", "=", "(", "TypeParameterElementInfo", ")", "(", "(", "JavaElement", ")", "this", ".", "typeParameters", "[", "i", "]", ")", ".", "getElementInfo", "(", ")", ";", "typeParameterBounds", "[", "i", "]", "=", "info", ".", "bounds", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "}", "return", "typeParameterBounds", ";", "}", "public", "char", "[", "]", "[", "]", "getTypeParameterNames", "(", ")", "{", "int", "length", "=", "this", ".", "typeParameters", ".", "length", ";", "if", "(", "length", "==", "0", ")", "return", "CharOperation", ".", "NO_CHAR_CHAR", ";", "char", "[", "]", "[", "]", "typeParameterNames", "=", "new", "char", "[", "length", "]", "[", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "typeParameterNames", "[", "i", "]", "=", "this", ".", "typeParameters", "[", "i", "]", ".", "getElementName", "(", ")", ".", "toCharArray", "(", ")", ";", "}", "return", "typeParameterNames", ";", "}", "public", "abstract", "boolean", "isConstructor", "(", ")", ";", "public", "abstract", "boolean", "isAnnotationMethod", "(", ")", ";", "protected", "void", "setArgumentNames", "(", "char", "[", "]", "[", "]", "names", ")", "{", "this", ".", "argumentNames", "=", "names", ";", "}", "protected", "void", "setExceptionTypeNames", "(", "char", "[", "]", "[", "]", "types", ")", "{", "this", ".", "exceptionTypes", "=", "types", ";", "}", "protected", "abstract", "void", "setReturnType", "(", "char", "[", "]", "type", ")", ";", "}", "</s>" ]
3,676
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "OperationCanceledException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "WorkingCopyOwner", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "codeassist", ".", "ISearchRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "NameEnvironmentAnswer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "problem", ".", "AbortCompilation", ";", "public", "class", "CancelableNameEnvironment", "extends", "SearchableEnvironment", "implements", "INameEnvironmentWithProgress", "{", "private", "IProgressMonitor", "monitor", ";", "public", "CancelableNameEnvironment", "(", "JavaProject", "project", ",", "WorkingCopyOwner", "owner", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "super", "(", "project", ",", "owner", ")", ";", "setMonitor", "(", "monitor", ")", ";", "}", "private", "void", "checkCanceled", "(", ")", "{", "if", "(", "this", ".", "monitor", "!=", "null", "&&", "this", ".", "monitor", ".", "isCanceled", "(", ")", ")", "{", "if", "(", "NameLookup", ".", "VERBOSE", ")", "System", ".", "out", ".", "println", "(", "Thread", ".", "currentThread", "(", ")", "+", "\"\"", ")", ";", "throw", "new", "AbortCompilation", "(", "true", ",", "new", "OperationCanceledException", "(", ")", ")", ";", "}", "}", "public", "void", "findPackages", "(", "char", "[", "]", "prefix", ",", "ISearchRequestor", "requestor", ")", "{", "checkCanceled", "(", ")", ";", "super", ".", "findPackages", "(", "prefix", ",", "requestor", ")", ";", "}", "public", "NameEnvironmentAnswer", "findType", "(", "char", "[", "]", "name", ",", "char", "[", "]", "[", "]", "packageName", ")", "{", "checkCanceled", "(", ")", ";", "return", "super", ".", "findType", "(", "name", ",", "packageName", ")", ";", "}", "public", "NameEnvironmentAnswer", "findType", "(", "char", "[", "]", "[", "]", "compoundTypeName", ")", "{", "checkCanceled", "(", ")", ";", "return", "super", ".", "findType", "(", "compoundTypeName", ")", ";", "}", "public", "void", "findTypes", "(", "char", "[", "]", "prefix", ",", "boolean", "findMembers", ",", "boolean", "camelCaseMatch", ",", "int", "searchFor", ",", "ISearchRequestor", "storage", ",", "IProgressMonitor", "progressMonitor", ")", "{", "checkCanceled", "(", ")", ";", "super", ".", "findTypes", "(", "prefix", ",", "findMembers", ",", "camelCaseMatch", ",", "searchFor", ",", "storage", ",", "progressMonitor", ")", ";", "}", "public", "void", "setMonitor", "(", "IProgressMonitor", "monitor", ")", "{", "this", ".", "monitor", "=", "monitor", ";", "}", "}", "</s>" ]
3,677
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "Enumeration", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "*", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "MementoTokenizer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Messages", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "PackageFragmentRoot", "extends", "Openable", "implements", "IPackageFragmentRoot", "{", "protected", "final", "static", "char", "ATTACHMENT_PROPERTY_DELIMITER", "=", "'*'", ";", "public", "final", "static", "String", "NO_SOURCE_ATTACHMENT", "=", "\"\"", ";", "protected", "IResource", "resource", ";", "protected", "PackageFragmentRoot", "(", "IResource", "resource", ",", "JavaProject", "project", ")", "{", "super", "(", "project", ")", ";", "this", ".", "resource", "=", "resource", ";", "}", "public", "void", "attachSource", "(", "IPath", "sourcePath", ",", "IPath", "rootPath", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "try", "{", "verifyAttachSource", "(", "sourcePath", ")", ";", "if", "(", "monitor", "!=", "null", ")", "{", "monitor", ".", "beginTask", "(", "Messages", ".", "element_attachingSource", ",", "2", ")", ";", "}", "SourceMapper", "oldMapper", "=", "getSourceMapper", "(", ")", ";", "boolean", "rootNeedsToBeClosed", "=", "false", ";", "if", "(", "sourcePath", "==", "null", ")", "{", "rootNeedsToBeClosed", "=", "true", ";", "setSourceMapper", "(", "null", ")", ";", "}", "else", "{", "IPath", "storedSourcePath", "=", "getSourceAttachmentPath", "(", ")", ";", "IPath", "storedRootPath", "=", "getSourceAttachmentRootPath", "(", ")", ";", "if", "(", "monitor", "!=", "null", ")", "{", "monitor", ".", "worked", "(", "1", ")", ";", "}", "if", "(", "storedSourcePath", "!=", "null", ")", "{", "if", "(", "!", "(", "storedSourcePath", ".", "equals", "(", "sourcePath", ")", "&&", "(", "rootPath", "!=", "null", "&&", "rootPath", ".", "equals", "(", "storedRootPath", ")", ")", "||", "storedRootPath", "==", "null", ")", ")", "{", "rootNeedsToBeClosed", "=", "true", ";", "}", "}", "Object", "target", "=", "JavaModel", ".", "getTarget", "(", "sourcePath", ",", "false", ")", ";", "if", "(", "target", "==", "null", ")", "{", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INVALID_PATH", ",", "sourcePath", ")", ")", ";", "}", "SourceMapper", "mapper", "=", "createSourceMapper", "(", "sourcePath", ",", "rootPath", ")", ";", "if", "(", "rootPath", "==", "null", "&&", "mapper", ".", "rootPath", "!=", "null", ")", "{", "rootPath", "=", "new", "Path", "(", "mapper", ".", "rootPath", ")", ";", "}", "setSourceMapper", "(", "mapper", ")", ";", "}", "if", "(", "sourcePath", "==", "null", ")", "{", "Util", ".", "setSourceAttachmentProperty", "(", "getPath", "(", ")", ",", "null", ")", ";", "}", "else", "{", "Util", ".", "setSourceAttachmentProperty", "(", "getPath", "(", ")", ",", "sourcePath", ".", "toString", "(", ")", "+", "(", "rootPath", "==", "null", "?", "\"\"", ":", "(", "ATTACHMENT_PROPERTY_DELIMITER", "+", "rootPath", ".", "toString", "(", ")", ")", ")", ")", ";", "}", "if", "(", "rootNeedsToBeClosed", ")", "{", "if", "(", "oldMapper", "!=", "null", ")", "{", "oldMapper", ".", "close", "(", ")", ";", "}", "BufferManager", "manager", "=", "BufferManager", ".", "getDefaultBufferManager", "(", ")", ";", "Enumeration", "openBuffers", "=", "manager", ".", "getOpenBuffers", "(", ")", ";", "while", "(", "openBuffers", ".", "hasMoreElements", "(", ")", ")", "{", "IBuffer", "buffer", "=", "(", "IBuffer", ")", "openBuffers", ".", "nextElement", "(", ")", ";", "IOpenable", "possibleMember", "=", "buffer", ".", "getOwner", "(", ")", ";", "if", "(", "isAncestorOf", "(", "(", "IJavaElement", ")", "possibleMember", ")", ")", "{", "buffer", ".", "close", "(", ")", ";", "}", "}", "if", "(", "monitor", "!=", "null", ")", "{", "monitor", ".", "worked", "(", "1", ")", ";", "}", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "Util", ".", "setSourceAttachmentProperty", "(", "getPath", "(", ")", ",", "null", ")", ";", "throw", "e", ";", "}", "finally", "{", "if", "(", "monitor", "!=", "null", ")", "{", "monitor", ".", "done", "(", ")", ";", "}", "}", "}", "protected", "boolean", "buildStructure", "(", "OpenableElementInfo", "info", ",", "IProgressMonitor", "pm", ",", "Map", "newElements", ",", "IResource", "underlyingResource", ")", "throws", "JavaModelException", "{", "(", "(", "PackageFragmentRootInfo", ")", "info", ")", ".", "setRootKind", "(", "determineKind", "(", "underlyingResource", ")", ")", ";", "return", "computeChildren", "(", "info", ",", "underlyingResource", ")", ";", "}", "SourceMapper", "createSourceMapper", "(", "IPath", "sourcePath", ",", "IPath", "rootPath", ")", "{", "SourceMapper", "mapper", "=", "new", "SourceMapper", "(", "sourcePath", ",", "rootPath", "==", "null", "?", "null", ":", "rootPath", ".", "toOSString", "(", ")", ",", "getJavaProject", "(", ")", ".", "getOptions", "(", "true", ")", ")", ";", "return", "mapper", ";", "}", "public", "void", "delete", "(", "int", "updateResourceFlags", ",", "int", "updateModelFlags", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "DeletePackageFragmentRootOperation", "op", "=", "new", "DeletePackageFragmentRootOperation", "(", "this", ",", "updateResourceFlags", ",", "updateModelFlags", ")", ";", "op", ".", "runOperation", "(", "monitor", ")", ";", "}", "protected", "boolean", "computeChildren", "(", "OpenableElementInfo", "info", ",", "IResource", "underlyingResource", ")", "throws", "JavaModelException", "{", "try", "{", "if", "(", "underlyingResource", ".", "getType", "(", ")", "==", "IResource", ".", "FOLDER", "||", "underlyingResource", ".", "getType", "(", ")", "==", "IResource", ".", "PROJECT", ")", "{", "ArrayList", "vChildren", "=", "new", "ArrayList", "(", "5", ")", ";", "IContainer", "rootFolder", "=", "(", "IContainer", ")", "underlyingResource", ";", "char", "[", "]", "[", "]", "inclusionPatterns", "=", "fullInclusionPatternChars", "(", ")", ";", "char", "[", "]", "[", "]", "exclusionPatterns", "=", "fullExclusionPatternChars", "(", ")", ";", "computeFolderChildren", "(", "rootFolder", ",", "!", "Util", ".", "isExcluded", "(", "rootFolder", ",", "inclusionPatterns", ",", "exclusionPatterns", ")", ",", "CharOperation", ".", "NO_STRINGS", ",", "vChildren", ",", "inclusionPatterns", ",", "exclusionPatterns", ")", ";", "IJavaElement", "[", "]", "children", "=", "new", "IJavaElement", "[", "vChildren", ".", "size", "(", ")", "]", ";", "vChildren", ".", "toArray", "(", "children", ")", ";", "info", ".", "setChildren", "(", "children", ")", ";", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "info", ".", "setChildren", "(", "new", "IJavaElement", "[", "]", "{", "}", ")", ";", "throw", "e", ";", "}", "return", "true", ";", "}", "protected", "void", "computeFolderChildren", "(", "IContainer", "folder", ",", "boolean", "isIncluded", ",", "String", "[", "]", "pkgName", ",", "ArrayList", "vChildren", ",", "char", "[", "]", "[", "]", "inclusionPatterns", ",", "char", "[", "]", "[", "]", "exclusionPatterns", ")", "throws", "JavaModelException", "{", "if", "(", "isIncluded", ")", "{", "IPackageFragment", "pkg", "=", "getPackageFragment", "(", "pkgName", ")", ";", "vChildren", ".", "add", "(", "pkg", ")", ";", "}", "try", "{", "JavaProject", "javaProject", "=", "(", "JavaProject", ")", "getJavaProject", "(", ")", ";", "JavaModelManager", "manager", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ";", "IResource", "[", "]", "members", "=", "folder", ".", "members", "(", ")", ";", "boolean", "hasIncluded", "=", "isIncluded", ";", "int", "length", "=", "members", ".", "length", ";", "if", "(", "length", ">", "0", ")", "{", "String", "sourceLevel", "=", "javaProject", ".", "getOption", "(", "JavaCore", ".", "COMPILER_SOURCE", ",", "true", ")", ";", "String", "complianceLevel", "=", "javaProject", ".", "getOption", "(", "JavaCore", ".", "COMPILER_COMPLIANCE", ",", "true", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "IResource", "member", "=", "members", "[", "i", "]", ";", "String", "memberName", "=", "member", ".", "getName", "(", ")", ";", "switch", "(", "member", ".", "getType", "(", ")", ")", "{", "case", "IResource", ".", "FOLDER", ":", "if", "(", "Util", ".", "isValidFolderNameForPackage", "(", "memberName", ",", "sourceLevel", ",", "complianceLevel", ")", ")", "{", "if", "(", "javaProject", ".", "contains", "(", "member", ")", ")", "{", "String", "[", "]", "newNames", "=", "Util", ".", "arrayConcat", "(", "pkgName", ",", "manager", ".", "intern", "(", "memberName", ")", ")", ";", "boolean", "isMemberIncluded", "=", "!", "Util", ".", "isExcluded", "(", "member", ",", "inclusionPatterns", ",", "exclusionPatterns", ")", ";", "computeFolderChildren", "(", "(", "IFolder", ")", "member", ",", "isMemberIncluded", ",", "newNames", ",", "vChildren", ",", "inclusionPatterns", ",", "exclusionPatterns", ")", ";", "}", "}", "break", ";", "case", "IResource", ".", "FILE", ":", "if", "(", "!", "hasIncluded", "&&", "Util", ".", "isValidCompilationUnitName", "(", "memberName", ",", "sourceLevel", ",", "complianceLevel", ")", "&&", "!", "Util", ".", "isExcluded", "(", "member", ",", "inclusionPatterns", ",", "exclusionPatterns", ")", ")", "{", "hasIncluded", "=", "true", ";", "IPackageFragment", "pkg", "=", "getPackageFragment", "(", "pkgName", ")", ";", "vChildren", ".", "add", "(", "pkg", ")", ";", "}", "break", ";", "}", "}", "}", "}", "catch", "(", "IllegalArgumentException", "e", ")", "{", "throw", "new", "JavaModelException", "(", "e", ",", "IJavaModelStatusConstants", ".", "ELEMENT_DOES_NOT_EXIST", ")", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "throw", "new", "JavaModelException", "(", "e", ")", ";", "}", "}", "public", "void", "copy", "(", "IPath", "destination", ",", "int", "updateResourceFlags", ",", "int", "updateModelFlags", ",", "IClasspathEntry", "sibling", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "CopyPackageFragmentRootOperation", "op", "=", "new", "CopyPackageFragmentRootOperation", "(", "this", ",", "destination", ",", "updateResourceFlags", ",", "updateModelFlags", ",", "sibling", ")", ";", "op", ".", "runOperation", "(", "monitor", ")", ";", "}", "protected", "Object", "createElementInfo", "(", ")", "{", "return", "new", "PackageFragmentRootInfo", "(", ")", ";", "}", "public", "IPackageFragment", "createPackageFragment", "(", "String", "pkgName", ",", "boolean", "force", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "CreatePackageFragmentOperation", "op", "=", "new", "CreatePackageFragmentOperation", "(", "this", ",", "pkgName", ",", "force", ")", ";", "op", ".", "runOperation", "(", "monitor", ")", ";", "return", "getPackageFragment", "(", "op", ".", "pkgName", ")", ";", "}", "protected", "int", "determineKind", "(", "IResource", "underlyingResource", ")", "throws", "JavaModelException", "{", "IClasspathEntry", "entry", "=", "(", "(", "JavaProject", ")", "getJavaProject", "(", ")", ")", ".", "getClasspathEntryFor", "(", "underlyingResource", ".", "getFullPath", "(", ")", ")", ";", "if", "(", "entry", "!=", "null", ")", "{", "return", "entry", ".", "getContentKind", "(", ")", ";", "}", "return", "IPackageFragmentRoot", ".", "K_SOURCE", ";", "}", "public", "boolean", "equals", "(", "Object", "o", ")", "{", "if", "(", "this", "==", "o", ")", "return", "true", ";", "if", "(", "!", "(", "o", "instanceof", "PackageFragmentRoot", ")", ")", "return", "false", ";", "PackageFragmentRoot", "other", "=", "(", "PackageFragmentRoot", ")", "o", ";", "return", "resource", "(", ")", ".", "equals", "(", "other", ".", "resource", "(", ")", ")", "&&", "this", ".", "parent", ".", "equals", "(", "other", ".", "parent", ")", ";", "}", "private", "IClasspathEntry", "findSourceAttachmentRecommendation", "(", ")", "{", "try", "{", "IPath", "rootPath", "=", "getPath", "(", ")", ";", "IClasspathEntry", "entry", ";", "JavaProject", "parentProject", "=", "(", "JavaProject", ")", "getJavaProject", "(", ")", ";", "try", "{", "entry", "=", "parentProject", ".", "getClasspathEntryFor", "(", "rootPath", ")", ";", "if", "(", "entry", "!=", "null", ")", "{", "Object", "target", "=", "JavaModel", ".", "getTarget", "(", "entry", ".", "getSourceAttachmentPath", "(", ")", ",", "true", ")", ";", "if", "(", "target", "!=", "null", ")", "{", "return", "entry", ";", "}", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "IJavaModel", "model", "=", "getJavaModel", "(", ")", ";", "IJavaProject", "[", "]", "jProjects", "=", "model", ".", "getJavaProjects", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "max", "=", "jProjects", ".", "length", ";", "i", "<", "max", ";", "i", "++", ")", "{", "JavaProject", "jProject", "=", "(", "JavaProject", ")", "jProjects", "[", "i", "]", ";", "if", "(", "jProject", "==", "parentProject", ")", "continue", ";", "try", "{", "entry", "=", "jProject", ".", "getClasspathEntryFor", "(", "rootPath", ")", ";", "if", "(", "entry", "!=", "null", ")", "{", "Object", "target", "=", "JavaModel", ".", "getTarget", "(", "entry", ".", "getSourceAttachmentPath", "(", ")", ",", "true", ")", ";", "if", "(", "target", "!=", "null", ")", "{", "return", "entry", ";", "}", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "return", "null", ";", "}", "public", "char", "[", "]", "[", "]", "fullExclusionPatternChars", "(", ")", "{", "try", "{", "if", "(", "isOpen", "(", ")", "&&", "getKind", "(", ")", "!=", "IPackageFragmentRoot", ".", "K_SOURCE", ")", "return", "null", ";", "ClasspathEntry", "entry", "=", "(", "ClasspathEntry", ")", "getRawClasspathEntry", "(", ")", ";", "if", "(", "entry", "==", "null", ")", "{", "return", "null", ";", "}", "else", "{", "return", "entry", ".", "fullExclusionPatternChars", "(", ")", ";", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "return", "null", ";", "}", "}", "public", "char", "[", "]", "[", "]", "fullInclusionPatternChars", "(", ")", "{", "try", "{", "if", "(", "isOpen", "(", ")", "&&", "getKind", "(", ")", "!=", "IPackageFragmentRoot", ".", "K_SOURCE", ")", "return", "null", ";", "ClasspathEntry", "entry", "=", "(", "ClasspathEntry", ")", "getRawClasspathEntry", "(", ")", ";", "if", "(", "entry", "==", "null", ")", "{", "return", "null", ";", "}", "else", "{", "return", "entry", ".", "fullInclusionPatternChars", "(", ")", ";", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "return", "null", ";", "}", "}", "public", "String", "getElementName", "(", ")", "{", "IResource", "res", "=", "resource", "(", ")", ";", "if", "(", "res", "instanceof", "IFolder", ")", "return", "(", "(", "IFolder", ")", "res", ")", ".", "getName", "(", ")", ";", "return", "\"\"", ";", "}", "public", "int", "getElementType", "(", ")", "{", "return", "PACKAGE_FRAGMENT_ROOT", ";", "}", "protected", "char", "getHandleMementoDelimiter", "(", ")", "{", "return", "JavaElement", ".", "JEM_PACKAGEFRAGMENTROOT", ";", "}", "public", "IJavaElement", "getHandleFromMemento", "(", "String", "token", ",", "MementoTokenizer", "memento", ",", "WorkingCopyOwner", "owner", ")", "{", "switch", "(", "token", ".", "charAt", "(", "0", ")", ")", "{", "case", "JEM_PACKAGEFRAGMENT", ":", "String", "[", "]", "pkgName", ";", "if", "(", "memento", ".", "hasMoreTokens", "(", ")", ")", "{", "token", "=", "memento", ".", "nextToken", "(", ")", ";", "char", "firstChar", "=", "token", ".", "charAt", "(", "0", ")", ";", "if", "(", "firstChar", "==", "JEM_CLASSFILE", "||", "firstChar", "==", "JEM_COMPILATIONUNIT", "||", "firstChar", "==", "JEM_COUNT", ")", "{", "pkgName", "=", "CharOperation", ".", "NO_STRINGS", ";", "}", "else", "{", "pkgName", "=", "Util", ".", "splitOn", "(", "'.'", ",", "token", ",", "0", ",", "token", ".", "length", "(", ")", ")", ";", "token", "=", "null", ";", "}", "}", "else", "{", "pkgName", "=", "CharOperation", ".", "NO_STRINGS", ";", "token", "=", "null", ";", "}", "JavaElement", "pkg", "=", "getPackageFragment", "(", "pkgName", ")", ";", "if", "(", "token", "==", "null", ")", "{", "return", "pkg", ".", "getHandleFromMemento", "(", "memento", ",", "owner", ")", ";", "}", "else", "{", "return", "pkg", ".", "getHandleFromMemento", "(", "token", ",", "memento", ",", "owner", ")", ";", "}", "}", "return", "null", ";", "}", "protected", "void", "getHandleMemento", "(", "StringBuffer", "buff", ")", "{", "IPath", "path", ";", "IResource", "underlyingResource", "=", "getResource", "(", ")", ";", "if", "(", "underlyingResource", "!=", "null", ")", "{", "if", "(", "resource", "(", ")", ".", "getProject", "(", ")", ".", "equals", "(", "getJavaProject", "(", ")", ".", "getProject", "(", ")", ")", ")", "{", "path", "=", "underlyingResource", ".", "getProjectRelativePath", "(", ")", ";", "}", "else", "{", "path", "=", "underlyingResource", ".", "getFullPath", "(", ")", ";", "}", "}", "else", "{", "path", "=", "getPath", "(", ")", ";", "}", "(", "(", "JavaElement", ")", "getParent", "(", ")", ")", ".", "getHandleMemento", "(", "buff", ")", ";", "buff", ".", "append", "(", "getHandleMementoDelimiter", "(", ")", ")", ";", "escapeMementoName", "(", "buff", ",", "path", ".", "toString", "(", ")", ")", ";", "}", "public", "int", "getKind", "(", ")", "throws", "JavaModelException", "{", "return", "(", "(", "PackageFragmentRootInfo", ")", "getElementInfo", "(", ")", ")", ".", "getRootKind", "(", ")", ";", "}", "int", "internalKind", "(", ")", "throws", "JavaModelException", "{", "JavaModelManager", "manager", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ";", "PackageFragmentRootInfo", "info", "=", "(", "PackageFragmentRootInfo", ")", "manager", ".", "peekAtInfo", "(", "this", ")", ";", "if", "(", "info", "==", "null", ")", "{", "info", "=", "(", "PackageFragmentRootInfo", ")", "openWhenClosed", "(", "createElementInfo", "(", ")", ",", "null", ")", ";", "}", "return", "info", ".", "getRootKind", "(", ")", ";", "}", "public", "Object", "[", "]", "getNonJavaResources", "(", ")", "throws", "JavaModelException", "{", "return", "(", "(", "PackageFragmentRootInfo", ")", "getElementInfo", "(", ")", ")", ".", "getNonJavaResources", "(", "getJavaProject", "(", ")", ",", "resource", "(", ")", ",", "this", ")", ";", "}", "public", "IPackageFragment", "getPackageFragment", "(", "String", "packageName", ")", "{", "String", "[", "]", "pkgName", "=", "Util", ".", "getTrimmedSimpleNames", "(", "packageName", ")", ";", "return", "getPackageFragment", "(", "pkgName", ")", ";", "}", "public", "PackageFragment", "getPackageFragment", "(", "String", "[", "]", "pkgName", ")", "{", "return", "new", "PackageFragment", "(", "this", ",", "pkgName", ")", ";", "}", "protected", "String", "getPackageName", "(", "IFolder", "folder", ")", "{", "IPath", "myPath", "=", "getPath", "(", ")", ";", "IPath", "pkgPath", "=", "folder", ".", "getFullPath", "(", ")", ";", "int", "mySegmentCount", "=", "myPath", ".", "segmentCount", "(", ")", ";", "int", "pkgSegmentCount", "=", "pkgPath", ".", "segmentCount", "(", ")", ";", "StringBuffer", "pkgName", "=", "new", "StringBuffer", "(", "IPackageFragment", ".", "DEFAULT_PACKAGE_NAME", ")", ";", "for", "(", "int", "i", "=", "mySegmentCount", ";", "i", "<", "pkgSegmentCount", ";", "i", "++", ")", "{", "if", "(", "i", ">", "mySegmentCount", ")", "{", "pkgName", ".", "append", "(", "'.'", ")", ";", "}", "pkgName", ".", "append", "(", "pkgPath", ".", "segment", "(", "i", ")", ")", ";", "}", "return", "pkgName", ".", "toString", "(", ")", ";", "}", "public", "IPath", "getPath", "(", ")", "{", "return", "internalPath", "(", ")", ";", "}", "public", "IPath", "internalPath", "(", ")", "{", "return", "resource", "(", ")", ".", "getFullPath", "(", ")", ";", "}", "public", "IClasspathEntry", "getRawClasspathEntry", "(", ")", "throws", "JavaModelException", "{", "IClasspathEntry", "rawEntry", "=", "null", ";", "JavaProject", "project", "=", "(", "JavaProject", ")", "getJavaProject", "(", ")", ";", "project", ".", "getResolvedClasspath", "(", ")", ";", "Map", "rootPathToRawEntries", "=", "project", ".", "getPerProjectInfo", "(", ")", ".", "rootPathToRawEntries", ";", "if", "(", "rootPathToRawEntries", "!=", "null", ")", "{", "rawEntry", "=", "(", "IClasspathEntry", ")", "rootPathToRawEntries", ".", "get", "(", "getPath", "(", ")", ")", ";", "}", "if", "(", "rawEntry", "==", "null", ")", "{", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "ELEMENT_NOT_ON_CLASSPATH", ",", "this", ")", ")", ";", "}", "return", "rawEntry", ";", "}", "public", "IClasspathEntry", "getResolvedClasspathEntry", "(", ")", "throws", "JavaModelException", "{", "IClasspathEntry", "resolvedEntry", "=", "null", ";", "JavaProject", "project", "=", "(", "JavaProject", ")", "getJavaProject", "(", ")", ";", "project", ".", "getResolvedClasspath", "(", ")", ";", "Map", "rootPathToResolvedEntries", "=", "project", ".", "getPerProjectInfo", "(", ")", ".", "rootPathToResolvedEntries", ";", "if", "(", "rootPathToResolvedEntries", "!=", "null", ")", "{", "resolvedEntry", "=", "(", "IClasspathEntry", ")", "rootPathToResolvedEntries", ".", "get", "(", "getPath", "(", ")", ")", ";", "}", "if", "(", "resolvedEntry", "==", "null", ")", "{", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "ELEMENT_NOT_ON_CLASSPATH", ",", "this", ")", ")", ";", "}", "return", "resolvedEntry", ";", "}", "public", "IResource", "resource", "(", ")", "{", "if", "(", "this", ".", "resource", "!=", "null", ")", "return", "this", ".", "resource", ";", "return", "super", ".", "resource", "(", ")", ";", "}", "public", "IResource", "resource", "(", "PackageFragmentRoot", "root", ")", "{", "return", "this", ".", "resource", ";", "}", "public", "IPath", "getSourceAttachmentPath", "(", ")", "throws", "JavaModelException", "{", "if", "(", "getKind", "(", ")", "!=", "K_BINARY", ")", "return", "null", ";", "IPath", "path", "=", "getPath", "(", ")", ";", "String", "serverPathString", "=", "Util", ".", "getSourceAttachmentProperty", "(", "path", ")", ";", "if", "(", "serverPathString", "!=", "null", ")", "{", "int", "index", "=", "serverPathString", ".", "lastIndexOf", "(", "ATTACHMENT_PROPERTY_DELIMITER", ")", ";", "if", "(", "index", "<", "0", ")", "{", "return", "new", "Path", "(", "serverPathString", ")", ";", "}", "else", "{", "String", "serverSourcePathString", "=", "serverPathString", ".", "substring", "(", "0", ",", "index", ")", ";", "return", "new", "Path", "(", "serverSourcePathString", ")", ";", "}", "}", "IClasspathEntry", "entry", "=", "(", "(", "JavaProject", ")", "getParent", "(", ")", ")", ".", "getClasspathEntryFor", "(", "path", ")", ";", "IPath", "sourceAttachmentPath", ";", "if", "(", "entry", "!=", "null", "&&", "(", "sourceAttachmentPath", "=", "entry", ".", "getSourceAttachmentPath", "(", ")", ")", "!=", "null", ")", "return", "sourceAttachmentPath", ";", "entry", "=", "findSourceAttachmentRecommendation", "(", ")", ";", "if", "(", "entry", "!=", "null", "&&", "(", "sourceAttachmentPath", "=", "entry", ".", "getSourceAttachmentPath", "(", ")", ")", "!=", "null", ")", "{", "return", "sourceAttachmentPath", ";", "}", "return", "null", ";", "}", "public", "void", "setSourceMapper", "(", "SourceMapper", "mapper", ")", "throws", "JavaModelException", "{", "(", "(", "PackageFragmentRootInfo", ")", "getElementInfo", "(", ")", ")", ".", "setSourceMapper", "(", "mapper", ")", ";", "}", "public", "IPath", "getSourceAttachmentRootPath", "(", ")", "throws", "JavaModelException", "{", "if", "(", "getKind", "(", ")", "!=", "K_BINARY", ")", "return", "null", ";", "IPath", "path", "=", "getPath", "(", ")", ";", "String", "serverPathString", "=", "Util", ".", "getSourceAttachmentProperty", "(", "path", ")", ";", "if", "(", "serverPathString", "!=", "null", ")", "{", "int", "index", "=", "serverPathString", ".", "lastIndexOf", "(", "ATTACHMENT_PROPERTY_DELIMITER", ")", ";", "if", "(", "index", "==", "-", "1", ")", "return", "null", ";", "String", "serverRootPathString", "=", "IPackageFragmentRoot", ".", "DEFAULT_PACKAGEROOT_PATH", ";", "if", "(", "index", "!=", "serverPathString", ".", "length", "(", ")", "-", "1", ")", "{", "serverRootPathString", "=", "serverPathString", ".", "substring", "(", "index", "+", "1", ")", ";", "}", "return", "new", "Path", "(", "serverRootPathString", ")", ";", "}", "IClasspathEntry", "entry", "=", "(", "(", "JavaProject", ")", "getParent", "(", ")", ")", ".", "getClasspathEntryFor", "(", "path", ")", ";", "IPath", "sourceAttachmentRootPath", ";", "if", "(", "entry", "!=", "null", "&&", "(", "sourceAttachmentRootPath", "=", "entry", ".", "getSourceAttachmentRootPath", "(", ")", ")", "!=", "null", ")", "return", "sourceAttachmentRootPath", ";", "entry", "=", "findSourceAttachmentRecommendation", "(", ")", ";", "if", "(", "entry", "!=", "null", "&&", "(", "sourceAttachmentRootPath", "=", "entry", ".", "getSourceAttachmentRootPath", "(", ")", ")", "!=", "null", ")", "return", "sourceAttachmentRootPath", ";", "return", "null", ";", "}", "public", "SourceMapper", "getSourceMapper", "(", ")", "{", "SourceMapper", "mapper", ";", "try", "{", "PackageFragmentRootInfo", "rootInfo", "=", "(", "PackageFragmentRootInfo", ")", "getElementInfo", "(", ")", ";", "mapper", "=", "rootInfo", ".", "getSourceMapper", "(", ")", ";", "if", "(", "mapper", "==", "null", ")", "{", "IPath", "sourcePath", "=", "getSourceAttachmentPath", "(", ")", ";", "IPath", "rootPath", "=", "getSourceAttachmentRootPath", "(", ")", ";", "if", "(", "sourcePath", "==", "null", ")", "mapper", "=", "createSourceMapper", "(", "getPath", "(", ")", ",", "rootPath", ")", ";", "else", "mapper", "=", "createSourceMapper", "(", "sourcePath", ",", "rootPath", ")", ";", "rootInfo", ".", "setSourceMapper", "(", "mapper", ")", ";", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "mapper", "=", "null", ";", "}", "return", "mapper", ";", "}", "public", "IResource", "getUnderlyingResource", "(", ")", "throws", "JavaModelException", "{", "if", "(", "!", "exists", "(", ")", ")", "throw", "newNotPresentException", "(", ")", ";", "return", "resource", "(", ")", ";", "}", "public", "boolean", "hasChildren", "(", ")", "throws", "JavaModelException", "{", "return", "true", ";", "}", "public", "int", "hashCode", "(", ")", "{", "return", "resource", "(", ")", ".", "hashCode", "(", ")", ";", "}", "public", "boolean", "isArchive", "(", ")", "{", "return", "false", ";", "}", "public", "boolean", "isExternal", "(", ")", "{", "return", "false", ";", "}", "protected", "IStatus", "validateOnClasspath", "(", ")", "{", "IPath", "path", "=", "getPath", "(", ")", ";", "try", "{", "JavaProject", "project", "=", "(", "JavaProject", ")", "getJavaProject", "(", ")", ";", "IClasspathEntry", "entry", "=", "project", ".", "getClasspathEntryFor", "(", "path", ")", ";", "if", "(", "entry", "!=", "null", ")", "{", "return", "Status", ".", "OK_STATUS", ";", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "return", "e", ".", "getJavaModelStatus", "(", ")", ";", "}", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "ELEMENT_NOT_ON_CLASSPATH", ",", "this", ")", ";", "}", "public", "void", "move", "(", "IPath", "destination", ",", "int", "updateResourceFlags", ",", "int", "updateModelFlags", ",", "IClasspathEntry", "sibling", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "MovePackageFragmentRootOperation", "op", "=", "new", "MovePackageFragmentRootOperation", "(", "this", ",", "destination", ",", "updateResourceFlags", ",", "updateModelFlags", ",", "sibling", ")", ";", "op", ".", "runOperation", "(", "monitor", ")", ";", "}", "protected", "void", "toStringInfo", "(", "int", "tab", ",", "StringBuffer", "buffer", ",", "Object", "info", ",", "boolean", "showResolvedInfo", ")", "{", "buffer", ".", "append", "(", "tabString", "(", "tab", ")", ")", ";", "IPath", "path", "=", "getPath", "(", ")", ";", "if", "(", "isExternal", "(", ")", ")", "{", "buffer", ".", "append", "(", "path", ".", "toOSString", "(", ")", ")", ";", "}", "else", "if", "(", "getJavaProject", "(", ")", ".", "getElementName", "(", ")", ".", "equals", "(", "path", ".", "segment", "(", "0", ")", ")", ")", "{", "if", "(", "path", ".", "segmentCount", "(", ")", "==", "1", ")", "{", "buffer", ".", "append", "(", "\"\"", ")", ";", "}", "else", "{", "buffer", ".", "append", "(", "path", ".", "removeFirstSegments", "(", "1", ")", ".", "makeRelative", "(", ")", ")", ";", "}", "}", "else", "{", "buffer", ".", "append", "(", "path", ")", ";", "}", "if", "(", "info", "==", "null", ")", "{", "buffer", ".", "append", "(", "\"", "(not", "open)\"", ")", ";", "}", "}", "protected", "IStatus", "validateExistence", "(", "IResource", "underlyingResource", ")", "{", "IStatus", "status", "=", "validateOnClasspath", "(", ")", ";", "if", "(", "!", "status", ".", "isOK", "(", ")", ")", "return", "status", ";", "if", "(", "!", "resourceExists", "(", "underlyingResource", ")", ")", "return", "newDoesNotExistStatus", "(", ")", ";", "return", "JavaModelStatus", ".", "VERIFIED_OK", ";", "}", "protected", "void", "verifyAttachSource", "(", "IPath", "sourcePath", ")", "throws", "JavaModelException", "{", "if", "(", "!", "exists", "(", ")", ")", "{", "throw", "newNotPresentException", "(", ")", ";", "}", "else", "if", "(", "getKind", "(", ")", "!=", "K_BINARY", ")", "{", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INVALID_ELEMENT_TYPES", ",", "this", ")", ")", ";", "}", "else", "if", "(", "sourcePath", "!=", "null", "&&", "!", "sourcePath", ".", "isAbsolute", "(", ")", ")", "{", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "RELATIVE_PATH", ",", "sourcePath", ")", ")", ";", "}", "}", "}", "</s>" ]
3,678
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "OperationCanceledException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "search", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "codeassist", ".", "ISearchRequestor", ";", "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", ".", "INameEnvironment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "ISourceType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "NameEnvironmentAnswer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "lookup", ".", "TypeConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "BasicSearchEngine", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "IRestrictedAccessConstructorRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "IRestrictedAccessTypeRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "search", ".", "indexing", ".", "IndexManager", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "SearchableEnvironment", "implements", "INameEnvironment", ",", "IJavaSearchConstants", "{", "public", "NameLookup", "nameLookup", ";", "protected", "ICompilationUnit", "unitToSkip", ";", "protected", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", "[", "]", "workingCopies", ";", "protected", "WorkingCopyOwner", "owner", ";", "protected", "JavaProject", "project", ";", "protected", "IJavaSearchScope", "searchScope", ";", "protected", "boolean", "checkAccessRestrictions", ";", "public", "SearchableEnvironment", "(", "JavaProject", "project", ",", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", "[", "]", "workingCopies", ")", "throws", "JavaModelException", "{", "this", ".", "project", "=", "project", ";", "this", ".", "checkAccessRestrictions", "=", "!", "JavaCore", ".", "IGNORE", ".", "equals", "(", "project", ".", "getOption", "(", "JavaCore", ".", "COMPILER_PB_FORBIDDEN_REFERENCE", ",", "true", ")", ")", "||", "!", "JavaCore", ".", "IGNORE", ".", "equals", "(", "project", ".", "getOption", "(", "JavaCore", ".", "COMPILER_PB_DISCOURAGED_REFERENCE", ",", "true", ")", ")", ";", "this", ".", "workingCopies", "=", "workingCopies", ";", "this", ".", "nameLookup", "=", "project", ".", "newNameLookup", "(", "workingCopies", ")", ";", "}", "public", "SearchableEnvironment", "(", "JavaProject", "project", ",", "WorkingCopyOwner", "owner", ")", "throws", "JavaModelException", "{", "this", "(", "project", ",", "owner", "==", "null", "?", "null", ":", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "getWorkingCopies", "(", "owner", ",", "true", ")", ")", ";", "this", ".", "owner", "=", "owner", ";", "}", "private", "static", "int", "convertSearchFilterToModelFilter", "(", "int", "searchFilter", ")", "{", "switch", "(", "searchFilter", ")", "{", "case", "IJavaSearchConstants", ".", "CLASS", ":", "return", "NameLookup", ".", "ACCEPT_CLASSES", ";", "case", "IJavaSearchConstants", ".", "INTERFACE", ":", "return", "NameLookup", ".", "ACCEPT_INTERFACES", ";", "case", "IJavaSearchConstants", ".", "ENUM", ":", "return", "NameLookup", ".", "ACCEPT_ENUMS", ";", "case", "IJavaSearchConstants", ".", "ANNOTATION_TYPE", ":", "return", "NameLookup", ".", "ACCEPT_ANNOTATIONS", ";", "case", "IJavaSearchConstants", ".", "CLASS_AND_ENUM", ":", "return", "NameLookup", ".", "ACCEPT_CLASSES", "|", "NameLookup", ".", "ACCEPT_ENUMS", ";", "case", "IJavaSearchConstants", ".", "CLASS_AND_INTERFACE", ":", "return", "NameLookup", ".", "ACCEPT_CLASSES", "|", "NameLookup", ".", "ACCEPT_INTERFACES", ";", "default", ":", "return", "NameLookup", ".", "ACCEPT_ALL", ";", "}", "}", "protected", "NameEnvironmentAnswer", "find", "(", "String", "typeName", ",", "String", "packageName", ")", "{", "if", "(", "packageName", "==", "null", ")", "packageName", "=", "IPackageFragment", ".", "DEFAULT_PACKAGE_NAME", ";", "if", "(", "this", ".", "owner", "!=", "null", ")", "{", "String", "source", "=", "this", ".", "owner", ".", "findSource", "(", "typeName", ",", "packageName", ")", ";", "if", "(", "source", "!=", "null", ")", "{", "ICompilationUnit", "cu", "=", "new", "BasicCompilationUnit", "(", "source", ".", "toCharArray", "(", ")", ",", "CharOperation", ".", "splitOn", "(", "'.'", ",", "packageName", ".", "toCharArray", "(", ")", ")", ",", "typeName", "+", "Util", ".", "defaultJavaExtension", "(", ")", ")", ";", "return", "new", "NameEnvironmentAnswer", "(", "cu", ",", "null", ")", ";", "}", "}", "NameLookup", ".", "Answer", "answer", "=", "this", ".", "nameLookup", ".", "findType", "(", "typeName", ",", "packageName", ",", "false", ",", "NameLookup", ".", "ACCEPT_ALL", ",", "this", ".", "checkAccessRestrictions", ")", ";", "if", "(", "answer", "!=", "null", ")", "{", "if", "(", "answer", ".", "type", "instanceof", "BinaryType", ")", "{", "try", "{", "return", "new", "NameEnvironmentAnswer", "(", "(", "IBinaryType", ")", "(", "(", "BinaryType", ")", "answer", ".", "type", ")", ".", "getElementInfo", "(", ")", ",", "answer", ".", "restriction", ")", ";", "}", "catch", "(", "JavaModelException", "npe", ")", "{", "}", "}", "else", "{", "try", "{", "SourceTypeElementInfo", "sourceType", "=", "(", "SourceTypeElementInfo", ")", "(", "(", "SourceType", ")", "answer", ".", "type", ")", ".", "getElementInfo", "(", ")", ";", "ISourceType", "topLevelType", "=", "sourceType", ";", "while", "(", "topLevelType", ".", "getEnclosingType", "(", ")", "!=", "null", ")", "{", "topLevelType", "=", "topLevelType", ".", "getEnclosingType", "(", ")", ";", "}", "IType", "[", "]", "types", "=", "sourceType", ".", "getHandle", "(", ")", ".", "getCompilationUnit", "(", ")", ".", "getTypes", "(", ")", ";", "ISourceType", "[", "]", "sourceTypes", "=", "new", "ISourceType", "[", "types", ".", "length", "]", ";", "sourceTypes", "[", "0", "]", "=", "sourceType", ";", "int", "length", "=", "types", ".", "length", ";", "for", "(", "int", "i", "=", "0", ",", "index", "=", "1", ";", "i", "<", "length", ";", "i", "++", ")", "{", "ISourceType", "otherType", "=", "(", "ISourceType", ")", "(", "(", "JavaElement", ")", "types", "[", "i", "]", ")", ".", "getElementInfo", "(", ")", ";", "if", "(", "!", "otherType", ".", "equals", "(", "topLevelType", ")", "&&", "index", "<", "length", ")", "sourceTypes", "[", "index", "++", "]", "=", "otherType", ";", "}", "return", "new", "NameEnvironmentAnswer", "(", "sourceTypes", ",", "answer", ".", "restriction", ")", ";", "}", "catch", "(", "JavaModelException", "jme", ")", "{", "if", "(", "jme", ".", "isDoesNotExist", "(", ")", "&&", "String", ".", "valueOf", "(", "TypeConstants", ".", "PACKAGE_INFO_NAME", ")", ".", "equals", "(", "typeName", ")", ")", "{", "return", "new", "NameEnvironmentAnswer", "(", "(", "ICompilationUnit", ")", "answer", ".", "type", ".", "getParent", "(", ")", ",", "answer", ".", "restriction", ")", ";", "}", "}", "}", "}", "return", "null", ";", "}", "public", "void", "findPackages", "(", "char", "[", "]", "prefix", ",", "ISearchRequestor", "requestor", ")", "{", "this", ".", "nameLookup", ".", "seekPackageFragments", "(", "new", "String", "(", "prefix", ")", ",", "true", ",", "new", "SearchableEnvironmentRequestor", "(", "requestor", ")", ")", ";", "}", "public", "void", "findExactTypes", "(", "char", "[", "]", "name", ",", "final", "boolean", "findMembers", ",", "int", "searchFor", ",", "final", "ISearchRequestor", "storage", ")", "{", "try", "{", "final", "String", "excludePath", ";", "if", "(", "this", ".", "unitToSkip", "!=", "null", ")", "{", "if", "(", "!", "(", "this", ".", "unitToSkip", "instanceof", "IJavaElement", ")", ")", "{", "findExactTypes", "(", "new", "String", "(", "name", ")", ",", "storage", ",", "convertSearchFilterToModelFilter", "(", "searchFor", ")", ")", ";", "return", ";", "}", "excludePath", "=", "(", "(", "IJavaElement", ")", "this", ".", "unitToSkip", ")", ".", "getPath", "(", ")", ".", "toString", "(", ")", ";", "}", "else", "{", "excludePath", "=", "null", ";", "}", "IProgressMonitor", "progressMonitor", "=", "new", "IProgressMonitor", "(", ")", "{", "boolean", "isCanceled", "=", "false", ";", "public", "void", "beginTask", "(", "String", "n", ",", "int", "totalWork", ")", "{", "}", "public", "void", "done", "(", ")", "{", "}", "public", "void", "internalWorked", "(", "double", "work", ")", "{", "}", "public", "boolean", "isCanceled", "(", ")", "{", "return", "this", ".", "isCanceled", ";", "}", "public", "void", "setCanceled", "(", "boolean", "value", ")", "{", "this", ".", "isCanceled", "=", "value", ";", "}", "public", "void", "setTaskName", "(", "String", "n", ")", "{", "}", "public", "void", "subTask", "(", "String", "n", ")", "{", "}", "public", "void", "worked", "(", "int", "work", ")", "{", "}", "}", ";", "IRestrictedAccessTypeRequestor", "typeRequestor", "=", "new", "IRestrictedAccessTypeRequestor", "(", ")", "{", "public", "void", "acceptType", "(", "int", "modifiers", ",", "char", "[", "]", "packageName", ",", "char", "[", "]", "simpleTypeName", ",", "char", "[", "]", "[", "]", "enclosingTypeNames", ",", "String", "path", ",", "AccessRestriction", "access", ")", "{", "if", "(", "excludePath", "!=", "null", "&&", "excludePath", ".", "equals", "(", "path", ")", ")", "return", ";", "if", "(", "!", "findMembers", "&&", "enclosingTypeNames", "!=", "null", "&&", "enclosingTypeNames", ".", "length", ">", "0", ")", "return", ";", "storage", ".", "acceptType", "(", "packageName", ",", "simpleTypeName", ",", "enclosingTypeNames", ",", "modifiers", ",", "access", ")", ";", "}", "}", ";", "try", "{", "new", "BasicSearchEngine", "(", "this", ".", "workingCopies", ")", ".", "searchAllTypeNames", "(", "null", ",", "SearchPattern", ".", "R_EXACT_MATCH", ",", "name", ",", "SearchPattern", ".", "R_EXACT_MATCH", ",", "searchFor", ",", "getSearchScope", "(", ")", ",", "typeRequestor", ",", "CANCEL_IF_NOT_READY_TO_SEARCH", ",", "progressMonitor", ")", ";", "}", "catch", "(", "OperationCanceledException", "e", ")", "{", "findExactTypes", "(", "new", "String", "(", "name", ")", ",", "storage", ",", "convertSearchFilterToModelFilter", "(", "searchFor", ")", ")", ";", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "findExactTypes", "(", "new", "String", "(", "name", ")", ",", "storage", ",", "convertSearchFilterToModelFilter", "(", "searchFor", ")", ")", ";", "}", "}", "private", "void", "findExactTypes", "(", "String", "name", ",", "ISearchRequestor", "storage", ",", "int", "type", ")", "{", "SearchableEnvironmentRequestor", "requestor", "=", "new", "SearchableEnvironmentRequestor", "(", "storage", ",", "this", ".", "unitToSkip", ",", "this", ".", "project", ",", "this", ".", "nameLookup", ")", ";", "this", ".", "nameLookup", ".", "seekTypes", "(", "name", ",", "null", ",", "false", ",", "type", ",", "requestor", ")", ";", "}", "public", "NameEnvironmentAnswer", "findType", "(", "char", "[", "]", "[", "]", "compoundTypeName", ")", "{", "if", "(", "compoundTypeName", "==", "null", ")", "return", "null", ";", "int", "length", "=", "compoundTypeName", ".", "length", ";", "if", "(", "length", "<=", "1", ")", "{", "if", "(", "length", "==", "0", ")", "return", "null", ";", "return", "find", "(", "new", "String", "(", "compoundTypeName", "[", "0", "]", ")", ",", "null", ")", ";", "}", "int", "lengthM1", "=", "length", "-", "1", ";", "char", "[", "]", "[", "]", "packageName", "=", "new", "char", "[", "lengthM1", "]", "[", "]", ";", "System", ".", "arraycopy", "(", "compoundTypeName", ",", "0", ",", "packageName", ",", "0", ",", "lengthM1", ")", ";", "return", "find", "(", "new", "String", "(", "compoundTypeName", "[", "lengthM1", "]", ")", ",", "CharOperation", ".", "toString", "(", "packageName", ")", ")", ";", "}", "public", "NameEnvironmentAnswer", "findType", "(", "char", "[", "]", "name", ",", "char", "[", "]", "[", "]", "packageName", ")", "{", "if", "(", "name", "==", "null", ")", "return", "null", ";", "return", "find", "(", "new", "String", "(", "name", ")", ",", "packageName", "==", "null", "||", "packageName", ".", "length", "==", "0", "?", "null", ":", "CharOperation", ".", "toString", "(", "packageName", ")", ")", ";", "}", "public", "void", "findTypes", "(", "char", "[", "]", "prefix", ",", "final", "boolean", "findMembers", ",", "boolean", "camelCaseMatch", ",", "int", "searchFor", ",", "final", "ISearchRequestor", "storage", ")", "{", "findTypes", "(", "prefix", ",", "findMembers", ",", "camelCaseMatch", ",", "searchFor", ",", "storage", ",", "null", ")", ";", "}", "public", "void", "findTypes", "(", "char", "[", "]", "prefix", ",", "final", "boolean", "findMembers", ",", "boolean", "camelCaseMatch", ",", "int", "searchFor", ",", "final", "ISearchRequestor", "storage", ",", "IProgressMonitor", "monitor", ")", "{", "try", "{", "final", "String", "excludePath", ";", "if", "(", "this", ".", "unitToSkip", "!=", "null", ")", "{", "if", "(", "!", "(", "this", ".", "unitToSkip", "instanceof", "IJavaElement", ")", ")", "{", "findTypes", "(", "new", "String", "(", "prefix", ")", ",", "storage", ",", "convertSearchFilterToModelFilter", "(", "searchFor", ")", ")", ";", "return", ";", "}", "excludePath", "=", "(", "(", "IJavaElement", ")", "this", ".", "unitToSkip", ")", ".", "getPath", "(", ")", ".", "toString", "(", ")", ";", "}", "else", "{", "excludePath", "=", "null", ";", "}", "int", "lastDotIndex", "=", "CharOperation", ".", "lastIndexOf", "(", "'.'", ",", "prefix", ")", ";", "char", "[", "]", "qualification", ",", "simpleName", ";", "if", "(", "lastDotIndex", "<", "0", ")", "{", "qualification", "=", "null", ";", "if", "(", "camelCaseMatch", ")", "{", "simpleName", "=", "prefix", ";", "}", "else", "{", "simpleName", "=", "CharOperation", ".", "toLowerCase", "(", "prefix", ")", ";", "}", "}", "else", "{", "qualification", "=", "CharOperation", ".", "subarray", "(", "prefix", ",", "0", ",", "lastDotIndex", ")", ";", "if", "(", "camelCaseMatch", ")", "{", "simpleName", "=", "CharOperation", ".", "subarray", "(", "prefix", ",", "lastDotIndex", "+", "1", ",", "prefix", ".", "length", ")", ";", "}", "else", "{", "simpleName", "=", "CharOperation", ".", "toLowerCase", "(", "CharOperation", ".", "subarray", "(", "prefix", ",", "lastDotIndex", "+", "1", ",", "prefix", ".", "length", ")", ")", ";", "}", "}", "IProgressMonitor", "progressMonitor", "=", "new", "IProgressMonitor", "(", ")", "{", "boolean", "isCanceled", "=", "false", ";", "public", "void", "beginTask", "(", "String", "name", ",", "int", "totalWork", ")", "{", "}", "public", "void", "done", "(", ")", "{", "}", "public", "void", "internalWorked", "(", "double", "work", ")", "{", "}", "public", "boolean", "isCanceled", "(", ")", "{", "return", "this", ".", "isCanceled", ";", "}", "public", "void", "setCanceled", "(", "boolean", "value", ")", "{", "this", ".", "isCanceled", "=", "value", ";", "}", "public", "void", "setTaskName", "(", "String", "name", ")", "{", "}", "public", "void", "subTask", "(", "String", "name", ")", "{", "}", "public", "void", "worked", "(", "int", "work", ")", "{", "}", "}", ";", "IRestrictedAccessTypeRequestor", "typeRequestor", "=", "new", "IRestrictedAccessTypeRequestor", "(", ")", "{", "public", "void", "acceptType", "(", "int", "modifiers", ",", "char", "[", "]", "packageName", ",", "char", "[", "]", "simpleTypeName", ",", "char", "[", "]", "[", "]", "enclosingTypeNames", ",", "String", "path", ",", "AccessRestriction", "access", ")", "{", "if", "(", "excludePath", "!=", "null", "&&", "excludePath", ".", "equals", "(", "path", ")", ")", "return", ";", "if", "(", "!", "findMembers", "&&", "enclosingTypeNames", "!=", "null", "&&", "enclosingTypeNames", ".", "length", ">", "0", ")", "return", ";", "storage", ".", "acceptType", "(", "packageName", ",", "simpleTypeName", ",", "enclosingTypeNames", ",", "modifiers", ",", "access", ")", ";", "}", "}", ";", "int", "matchRule", "=", "SearchPattern", ".", "R_PREFIX_MATCH", ";", "if", "(", "camelCaseMatch", ")", "matchRule", "|=", "SearchPattern", ".", "R_CAMELCASE_MATCH", ";", "if", "(", "monitor", "!=", "null", ")", "{", "IndexManager", "indexManager", "=", "JavaModelManager", ".", "getIndexManager", "(", ")", ";", "if", "(", "indexManager", ".", "awaitingJobsCount", "(", ")", "==", "0", ")", "{", "new", "BasicSearchEngine", "(", "this", ".", "workingCopies", ")", ".", "searchAllTypeNames", "(", "qualification", ",", "SearchPattern", ".", "R_EXACT_MATCH", ",", "simpleName", ",", "matchRule", ",", "searchFor", ",", "getSearchScope", "(", ")", ",", "typeRequestor", ",", "FORCE_IMMEDIATE_SEARCH", ",", "progressMonitor", ")", ";", "}", "else", "{", "try", "{", "Thread", ".", "sleep", "(", "100", ")", ";", "}", "catch", "(", "InterruptedException", "e", ")", "{", "}", "if", "(", "monitor", ".", "isCanceled", "(", ")", ")", "{", "throw", "new", "OperationCanceledException", "(", ")", ";", "}", "if", "(", "indexManager", ".", "awaitingJobsCount", "(", ")", "==", "0", ")", "{", "new", "BasicSearchEngine", "(", "this", ".", "workingCopies", ")", ".", "searchAllTypeNames", "(", "qualification", ",", "SearchPattern", ".", "R_EXACT_MATCH", ",", "simpleName", ",", "matchRule", ",", "searchFor", ",", "getSearchScope", "(", ")", ",", "typeRequestor", ",", "FORCE_IMMEDIATE_SEARCH", ",", "progressMonitor", ")", ";", "}", "else", "{", "findTypes", "(", "new", "String", "(", "prefix", ")", ",", "storage", ",", "convertSearchFilterToModelFilter", "(", "searchFor", ")", ")", ";", "}", "}", "}", "else", "{", "try", "{", "new", "BasicSearchEngine", "(", "this", ".", "workingCopies", ")", ".", "searchAllTypeNames", "(", "qualification", ",", "SearchPattern", ".", "R_EXACT_MATCH", ",", "simpleName", ",", "matchRule", ",", "searchFor", ",", "getSearchScope", "(", ")", ",", "typeRequestor", ",", "CANCEL_IF_NOT_READY_TO_SEARCH", ",", "progressMonitor", ")", ";", "}", "catch", "(", "OperationCanceledException", "e", ")", "{", "findTypes", "(", "new", "String", "(", "prefix", ")", ",", "storage", ",", "convertSearchFilterToModelFilter", "(", "searchFor", ")", ")", ";", "}", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "findTypes", "(", "new", "String", "(", "prefix", ")", ",", "storage", ",", "convertSearchFilterToModelFilter", "(", "searchFor", ")", ")", ";", "}", "}", "public", "void", "findConstructorDeclarations", "(", "char", "[", "]", "prefix", ",", "boolean", "camelCaseMatch", ",", "final", "ISearchRequestor", "storage", ",", "IProgressMonitor", "monitor", ")", "{", "try", "{", "final", "String", "excludePath", ";", "if", "(", "this", ".", "unitToSkip", "!=", "null", "&&", "this", ".", "unitToSkip", "instanceof", "IJavaElement", ")", "{", "excludePath", "=", "(", "(", "IJavaElement", ")", "this", ".", "unitToSkip", ")", ".", "getPath", "(", ")", ".", "toString", "(", ")", ";", "}", "else", "{", "excludePath", "=", "null", ";", "}", "int", "lastDotIndex", "=", "CharOperation", ".", "lastIndexOf", "(", "'.'", ",", "prefix", ")", ";", "char", "[", "]", "qualification", ",", "simpleName", ";", "if", "(", "lastDotIndex", "<", "0", ")", "{", "qualification", "=", "null", ";", "if", "(", "camelCaseMatch", ")", "{", "simpleName", "=", "prefix", ";", "}", "else", "{", "simpleName", "=", "CharOperation", ".", "toLowerCase", "(", "prefix", ")", ";", "}", "}", "else", "{", "qualification", "=", "CharOperation", ".", "subarray", "(", "prefix", ",", "0", ",", "lastDotIndex", ")", ";", "if", "(", "camelCaseMatch", ")", "{", "simpleName", "=", "CharOperation", ".", "subarray", "(", "prefix", ",", "lastDotIndex", "+", "1", ",", "prefix", ".", "length", ")", ";", "}", "else", "{", "simpleName", "=", "CharOperation", ".", "toLowerCase", "(", "CharOperation", ".", "subarray", "(", "prefix", ",", "lastDotIndex", "+", "1", ",", "prefix", ".", "length", ")", ")", ";", "}", "}", "IProgressMonitor", "progressMonitor", "=", "new", "IProgressMonitor", "(", ")", "{", "boolean", "isCanceled", "=", "false", ";", "public", "void", "beginTask", "(", "String", "name", ",", "int", "totalWork", ")", "{", "}", "public", "void", "done", "(", ")", "{", "}", "public", "void", "internalWorked", "(", "double", "work", ")", "{", "}", "public", "boolean", "isCanceled", "(", ")", "{", "return", "this", ".", "isCanceled", ";", "}", "public", "void", "setCanceled", "(", "boolean", "value", ")", "{", "this", ".", "isCanceled", "=", "value", ";", "}", "public", "void", "setTaskName", "(", "String", "name", ")", "{", "}", "public", "void", "subTask", "(", "String", "name", ")", "{", "}", "public", "void", "worked", "(", "int", "work", ")", "{", "}", "}", ";", "IRestrictedAccessConstructorRequestor", "constructorRequestor", "=", "new", "IRestrictedAccessConstructorRequestor", "(", ")", "{", "public", "void", "acceptConstructor", "(", "int", "modifiers", ",", "char", "[", "]", "simpleTypeName", ",", "int", "parameterCount", ",", "char", "[", "]", "signature", ",", "char", "[", "]", "[", "]", "parameterTypes", ",", "char", "[", "]", "[", "]", "parameterNames", ",", "int", "typeModifiers", ",", "char", "[", "]", "packageName", ",", "int", "extraFlags", ",", "String", "path", ",", "AccessRestriction", "access", ")", "{", "if", "(", "excludePath", "!=", "null", "&&", "excludePath", ".", "equals", "(", "path", ")", ")", "return", ";", "storage", ".", "acceptConstructor", "(", "modifiers", ",", "simpleTypeName", ",", "parameterCount", ",", "signature", ",", "parameterTypes", ",", "parameterNames", ",", "typeModifiers", ",", "packageName", ",", "extraFlags", ",", "path", ",", "access", ")", ";", "}", "}", ";", "int", "matchRule", "=", "SearchPattern", ".", "R_PREFIX_MATCH", ";", "if", "(", "camelCaseMatch", ")", "matchRule", "|=", "SearchPattern", ".", "R_CAMELCASE_MATCH", ";", "if", "(", "monitor", "!=", "null", ")", "{", "IndexManager", "indexManager", "=", "JavaModelManager", ".", "getIndexManager", "(", ")", ";", "while", "(", "indexManager", ".", "awaitingJobsCount", "(", ")", ">", "0", ")", "{", "try", "{", "Thread", ".", "sleep", "(", "50", ")", ";", "}", "catch", "(", "InterruptedException", "e", ")", "{", "}", "if", "(", "monitor", ".", "isCanceled", "(", ")", ")", "{", "throw", "new", "OperationCanceledException", "(", ")", ";", "}", "}", "new", "BasicSearchEngine", "(", "this", ".", "workingCopies", ")", ".", "searchAllConstructorDeclarations", "(", "qualification", ",", "simpleName", ",", "matchRule", ",", "getSearchScope", "(", ")", ",", "constructorRequestor", ",", "FORCE_IMMEDIATE_SEARCH", ",", "progressMonitor", ")", ";", "}", "else", "{", "try", "{", "new", "BasicSearchEngine", "(", "this", ".", "workingCopies", ")", ".", "searchAllConstructorDeclarations", "(", "qualification", ",", "simpleName", ",", "matchRule", ",", "getSearchScope", "(", ")", ",", "constructorRequestor", ",", "CANCEL_IF_NOT_READY_TO_SEARCH", ",", "progressMonitor", ")", ";", "}", "catch", "(", "OperationCanceledException", "e", ")", "{", "}", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "}", "private", "void", "findTypes", "(", "String", "prefix", ",", "ISearchRequestor", "storage", ",", "int", "type", ")", "{", "SearchableEnvironmentRequestor", "requestor", "=", "new", "SearchableEnvironmentRequestor", "(", "storage", ",", "this", ".", "unitToSkip", ",", "this", ".", "project", ",", "this", ".", "nameLookup", ")", ";", "int", "index", "=", "prefix", ".", "lastIndexOf", "(", "'.'", ")", ";", "if", "(", "index", "==", "-", "1", ")", "{", "this", ".", "nameLookup", ".", "seekTypes", "(", "prefix", ",", "null", ",", "true", ",", "type", ",", "requestor", ")", ";", "}", "else", "{", "String", "packageName", "=", "prefix", ".", "substring", "(", "0", ",", "index", ")", ";", "JavaElementRequestor", "elementRequestor", "=", "new", "JavaElementRequestor", "(", ")", ";", "this", ".", "nameLookup", ".", "seekPackageFragments", "(", "packageName", ",", "false", ",", "elementRequestor", ")", ";", "IPackageFragment", "[", "]", "fragments", "=", "elementRequestor", ".", "getPackageFragments", "(", ")", ";", "if", "(", "fragments", "!=", "null", ")", "{", "String", "className", "=", "prefix", ".", "substring", "(", "index", "+", "1", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "fragments", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "if", "(", "fragments", "[", "i", "]", "!=", "null", ")", "this", ".", "nameLookup", ".", "seekTypes", "(", "className", ",", "fragments", "[", "i", "]", ",", "true", ",", "type", ",", "requestor", ")", ";", "}", "}", "}", "private", "IJavaSearchScope", "getSearchScope", "(", ")", "{", "if", "(", "this", ".", "searchScope", "==", "null", ")", "{", "if", "(", "this", ".", "checkAccessRestrictions", ")", "{", "this", ".", "searchScope", "=", "BasicSearchEngine", ".", "createJavaSearchScope", "(", "new", "IJavaElement", "[", "]", "{", "this", ".", "project", "}", ")", ";", "}", "else", "{", "this", ".", "searchScope", "=", "BasicSearchEngine", ".", "createJavaSearchScope", "(", "this", ".", "nameLookup", ".", "packageFragmentRoots", ")", ";", "}", "}", "return", "this", ".", "searchScope", ";", "}", "public", "boolean", "isPackage", "(", "char", "[", "]", "[", "]", "parentPackageName", ",", "char", "[", "]", "subPackageName", ")", "{", "String", "[", "]", "pkgName", ";", "if", "(", "parentPackageName", "==", "null", ")", "pkgName", "=", "new", "String", "[", "]", "{", "new", "String", "(", "subPackageName", ")", "}", ";", "else", "{", "int", "length", "=", "parentPackageName", ".", "length", ";", "pkgName", "=", "new", "String", "[", "length", "+", "1", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "pkgName", "[", "i", "]", "=", "new", "String", "(", "parentPackageName", "[", "i", "]", ")", ";", "pkgName", "[", "length", "]", "=", "new", "String", "(", "subPackageName", ")", ";", "}", "return", "(", "this", ".", "owner", "!=", "null", "&&", "this", ".", "owner", ".", "isPackage", "(", "pkgName", ")", ")", "||", "this", ".", "nameLookup", ".", "isPackage", "(", "pkgName", ")", ";", "}", "protected", "String", "toStringChar", "(", "char", "[", "]", "name", ")", "{", "return", "\"[\"", "+", "new", "String", "(", "name", ")", "+", "\"]\"", ";", "}", "protected", "String", "toStringCharChar", "(", "char", "[", "]", "[", "]", "names", ")", "{", "StringBuffer", "result", "=", "new", "StringBuffer", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "names", ".", "length", ";", "i", "++", ")", "{", "result", ".", "append", "(", "toStringChar", "(", "names", "[", "i", "]", ")", ")", ";", "}", "return", "result", ".", "toString", "(", ")", ";", "}", "public", "void", "cleanup", "(", ")", "{", "}", "}", "</s>" ]
3,679
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "public", "class", "ResolvedBinaryMethod", "extends", "BinaryMethod", "{", "private", "String", "uniqueKey", ";", "public", "ResolvedBinaryMethod", "(", "JavaElement", "parent", ",", "String", "name", ",", "String", "[", "]", "parameterTypes", ",", "String", "uniqueKey", ")", "{", "super", "(", "parent", ",", "name", ",", "parameterTypes", ")", ";", "this", ".", "uniqueKey", "=", "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", "BinaryMethod", "(", "this", ".", "parent", ",", "this", ".", "name", ",", "this", ".", "parameterTypes", ")", ";", "handle", ".", "occurrenceCount", "=", "this", ".", "occurrenceCount", ";", "return", "handle", ";", "}", "}", "</s>" ]
3,680
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IInitializer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IPackageFragment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "codeassist", ".", "ISearchRequestor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "AccessRuleSet", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "AccessRestriction", ";", "class", "SearchableEnvironmentRequestor", "extends", "JavaElementRequestor", "{", "protected", "ISearchRequestor", "requestor", ";", "protected", "ICompilationUnit", "unitToSkip", ";", "protected", "IJavaProject", "project", ";", "protected", "NameLookup", "nameLookup", ";", "protected", "boolean", "checkAccessRestrictions", ";", "public", "SearchableEnvironmentRequestor", "(", "ISearchRequestor", "requestor", ")", "{", "this", ".", "requestor", "=", "requestor", ";", "this", ".", "unitToSkip", "=", "null", ";", "this", ".", "project", "=", "null", ";", "this", ".", "nameLookup", "=", "null", ";", "this", ".", "checkAccessRestrictions", "=", "false", ";", "}", "public", "SearchableEnvironmentRequestor", "(", "ISearchRequestor", "requestor", ",", "ICompilationUnit", "unitToSkip", ",", "IJavaProject", "project", ",", "NameLookup", "nameLookup", ")", "{", "this", ".", "requestor", "=", "requestor", ";", "this", ".", "unitToSkip", "=", "unitToSkip", ";", "this", ".", "project", "=", "project", ";", "this", ".", "nameLookup", "=", "nameLookup", ";", "this", ".", "checkAccessRestrictions", "=", "!", "JavaCore", ".", "IGNORE", ".", "equals", "(", "project", ".", "getOption", "(", "JavaCore", ".", "COMPILER_PB_FORBIDDEN_REFERENCE", ",", "true", ")", ")", "||", "!", "JavaCore", ".", "IGNORE", ".", "equals", "(", "project", ".", "getOption", "(", "JavaCore", ".", "COMPILER_PB_DISCOURAGED_REFERENCE", ",", "true", ")", ")", ";", "}", "public", "void", "acceptInitializer", "(", "IInitializer", "initializer", ")", "{", "}", "public", "void", "acceptPackageFragment", "(", "IPackageFragment", "packageFragment", ")", "{", "this", ".", "requestor", ".", "acceptPackage", "(", "packageFragment", ".", "getElementName", "(", ")", ".", "toCharArray", "(", ")", ")", ";", "}", "public", "void", "acceptType", "(", "IType", "type", ")", "{", "try", "{", "if", "(", "this", ".", "unitToSkip", "!=", "null", "&&", "this", ".", "unitToSkip", ".", "equals", "(", "type", ".", "getCompilationUnit", "(", ")", ")", ")", "{", "return", ";", "}", "char", "[", "]", "packageName", "=", "type", ".", "getPackageFragment", "(", ")", ".", "getElementName", "(", ")", ".", "toCharArray", "(", ")", ";", "boolean", "isBinary", "=", "type", "instanceof", "BinaryType", ";", "AccessRestriction", "accessRestriction", "=", "null", ";", "if", "(", "this", ".", "checkAccessRestrictions", "&&", "(", "isBinary", "||", "!", "type", ".", "getJavaProject", "(", ")", ".", "equals", "(", "this", ".", "project", ")", ")", ")", "{", "PackageFragmentRoot", "root", "=", "(", "PackageFragmentRoot", ")", "type", ".", "getAncestor", "(", "IJavaElement", ".", "PACKAGE_FRAGMENT_ROOT", ")", ";", "ClasspathEntry", "entry", "=", "(", "ClasspathEntry", ")", "this", ".", "nameLookup", ".", "rootToResolvedEntries", ".", "get", "(", "root", ")", ";", "if", "(", "entry", "!=", "null", ")", "{", "AccessRuleSet", "accessRuleSet", "=", "entry", ".", "getAccessRuleSet", "(", ")", ";", "if", "(", "accessRuleSet", "!=", "null", ")", "{", "char", "[", "]", "[", "]", "packageChars", "=", "CharOperation", ".", "splitOn", "(", "'.'", ",", "packageName", ")", ";", "char", "[", "]", "fileWithoutExtension", "=", "type", ".", "getElementName", "(", ")", ".", "toCharArray", "(", ")", ";", "accessRestriction", "=", "accessRuleSet", ".", "getViolatedRestriction", "(", "CharOperation", ".", "concatWith", "(", "packageChars", ",", "fileWithoutExtension", ",", "'/'", ")", ")", ";", "}", "}", "}", "this", ".", "requestor", ".", "acceptType", "(", "packageName", ",", "type", ".", "getElementName", "(", ")", ".", "toCharArray", "(", ")", ",", "null", ",", "type", ".", "getFlags", "(", ")", ",", "accessRestriction", ")", ";", "}", "catch", "(", "JavaModelException", "jme", ")", "{", "}", "}", "}", "</s>" ]
3,681
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "io", ".", "File", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IPackageFragmentRoot", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "public", "class", "ExternalPackageFragmentRoot", "extends", "PackageFragmentRoot", "{", "protected", "final", "IPath", "externalPath", ";", "protected", "ExternalPackageFragmentRoot", "(", "IPath", "externalPath", ",", "JavaProject", "project", ")", "{", "super", "(", "null", ",", "project", ")", ";", "this", ".", "externalPath", "=", "externalPath", ";", "}", "protected", "ExternalPackageFragmentRoot", "(", "IResource", "linkedFolder", ",", "IPath", "externalPath", ",", "JavaProject", "project", ")", "{", "super", "(", "linkedFolder", ",", "project", ")", ";", "this", ".", "externalPath", "=", "externalPath", "==", "null", "?", "linkedFolder", ".", "getLocation", "(", ")", ":", "externalPath", ";", "}", "protected", "int", "determineKind", "(", "IResource", "underlyingResource", ")", "{", "return", "IPackageFragmentRoot", ".", "K_BINARY", ";", "}", "public", "boolean", "equals", "(", "Object", "o", ")", "{", "if", "(", "this", "==", "o", ")", "return", "true", ";", "if", "(", "o", "instanceof", "ExternalPackageFragmentRoot", ")", "{", "ExternalPackageFragmentRoot", "other", "=", "(", "ExternalPackageFragmentRoot", ")", "o", ";", "return", "this", ".", "externalPath", ".", "equals", "(", "other", ".", "externalPath", ")", ";", "}", "return", "false", ";", "}", "public", "String", "getElementName", "(", ")", "{", "return", "this", ".", "externalPath", ".", "lastSegment", "(", ")", ";", "}", "public", "int", "getKind", "(", ")", "{", "return", "IPackageFragmentRoot", ".", "K_BINARY", ";", "}", "int", "internalKind", "(", ")", "throws", "JavaModelException", "{", "return", "IPackageFragmentRoot", ".", "K_BINARY", ";", "}", "public", "IPath", "getPath", "(", ")", "{", "return", "this", ".", "externalPath", ";", "}", "public", "IResource", "getUnderlyingResource", "(", ")", "throws", "JavaModelException", "{", "return", "null", ";", "}", "public", "int", "hashCode", "(", ")", "{", "return", "this", ".", "externalPath", ".", "hashCode", "(", ")", ";", "}", "public", "boolean", "isExternal", "(", ")", "{", "return", "true", ";", "}", "public", "IResource", "resource", "(", "PackageFragmentRoot", "root", ")", "{", "if", "(", "this", ".", "resource", "==", "null", ")", "return", "this", ".", "resource", "=", "JavaModelManager", ".", "getExternalManager", "(", ")", ".", "getFolder", "(", "this", ".", "externalPath", ")", ";", "return", "super", ".", "resource", "(", "root", ")", ";", "}", "protected", "boolean", "resourceExists", "(", "IResource", "underlyingResource", ")", "{", "if", "(", "underlyingResource", "==", "null", ")", "return", "false", ";", "IPath", "location", "=", "underlyingResource", ".", "getLocation", "(", ")", ";", "if", "(", "location", "==", "null", ")", "return", "false", ";", "File", "file", "=", "location", ".", "toFile", "(", ")", ";", "if", "(", "file", "==", "null", ")", "return", "false", ";", "return", "file", ".", "exists", "(", ")", ";", "}", "protected", "void", "toStringAncestors", "(", "StringBuffer", "buffer", ")", "{", "}", "}", "</s>" ]
3,682
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "public", "class", "BatchInitializationMonitor", "implements", "IProgressMonitor", "{", "public", "ThreadLocal", "initializeAfterLoadMonitor", "=", "new", "ThreadLocal", "(", ")", ";", "public", "String", "subTaskName", "=", "\"\"", ";", "public", "int", "worked", "=", "0", ";", "private", "IProgressMonitor", "getMonitor", "(", ")", "{", "return", "(", "IProgressMonitor", ")", "this", ".", "initializeAfterLoadMonitor", ".", "get", "(", ")", ";", "}", "public", "void", "beginTask", "(", "String", "name", ",", "int", "totalWork", ")", "{", "IProgressMonitor", "monitor", "=", "getMonitor", "(", ")", ";", "if", "(", "monitor", "!=", "null", ")", "monitor", ".", "beginTask", "(", "name", ",", "totalWork", ")", ";", "}", "public", "void", "done", "(", ")", "{", "IProgressMonitor", "monitor", "=", "getMonitor", "(", ")", ";", "if", "(", "monitor", "!=", "null", ")", "monitor", ".", "done", "(", ")", ";", "this", ".", "worked", "=", "0", ";", "this", ".", "subTaskName", "=", "\"\"", ";", "}", "public", "void", "internalWorked", "(", "double", "work", ")", "{", "IProgressMonitor", "monitor", "=", "getMonitor", "(", ")", ";", "if", "(", "monitor", "!=", "null", ")", "monitor", ".", "internalWorked", "(", "work", ")", ";", "}", "public", "boolean", "isCanceled", "(", ")", "{", "IProgressMonitor", "monitor", "=", "getMonitor", "(", ")", ";", "if", "(", "monitor", "!=", "null", ")", "return", "monitor", ".", "isCanceled", "(", ")", ";", "return", "false", ";", "}", "public", "void", "setCanceled", "(", "boolean", "value", ")", "{", "IProgressMonitor", "monitor", "=", "getMonitor", "(", ")", ";", "if", "(", "monitor", "!=", "null", ")", "monitor", ".", "setCanceled", "(", "value", ")", ";", "}", "public", "void", "setTaskName", "(", "String", "name", ")", "{", "IProgressMonitor", "monitor", "=", "getMonitor", "(", ")", ";", "if", "(", "monitor", "!=", "null", ")", "monitor", ".", "setTaskName", "(", "name", ")", ";", "}", "public", "void", "subTask", "(", "String", "name", ")", "{", "IProgressMonitor", "monitor", "=", "getMonitor", "(", ")", ";", "if", "(", "monitor", "!=", "null", ")", "monitor", ".", "subTask", "(", "name", ")", ";", "this", ".", "subTaskName", "=", "name", ";", "}", "public", "void", "worked", "(", "int", "work", ")", "{", "IProgressMonitor", "monitor", "=", "getMonitor", "(", ")", ";", "if", "(", "monitor", "!=", "null", ")", "monitor", ".", "worked", "(", "work", ")", ";", "synchronized", "(", "this", ")", "{", "this", ".", "worked", "+=", "work", ";", "}", "}", "public", "synchronized", "int", "getWorked", "(", ")", "{", "int", "result", "=", "this", ".", "worked", ";", "this", ".", "worked", "=", "0", ";", "return", "result", ";", "}", "}", "</s>" ]
3,683
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Path", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IAccessRule", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "IProblem", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "AccessRule", ";", "public", "class", "ClasspathAccessRule", "extends", "AccessRule", "implements", "IAccessRule", "{", "public", "ClasspathAccessRule", "(", "IPath", "pattern", ",", "int", "kind", ")", "{", "this", "(", "pattern", ".", "toString", "(", ")", ".", "toCharArray", "(", ")", ",", "toProblemId", "(", "kind", ")", ")", ";", "}", "public", "ClasspathAccessRule", "(", "char", "[", "]", "pattern", ",", "int", "problemId", ")", "{", "super", "(", "pattern", ",", "problemId", ")", ";", "}", "private", "static", "int", "toProblemId", "(", "int", "kind", ")", "{", "boolean", "ignoreIfBetter", "=", "(", "kind", "&", "IAccessRule", ".", "IGNORE_IF_BETTER", ")", "!=", "0", ";", "switch", "(", "kind", "&", "~", "IAccessRule", ".", "IGNORE_IF_BETTER", ")", "{", "case", "K_NON_ACCESSIBLE", ":", "return", "ignoreIfBetter", "?", "IProblem", ".", "ForbiddenReference", "|", "AccessRule", ".", "IgnoreIfBetter", ":", "IProblem", ".", "ForbiddenReference", ";", "case", "K_DISCOURAGED", ":", "return", "ignoreIfBetter", "?", "IProblem", ".", "DiscouragedReference", "|", "AccessRule", ".", "IgnoreIfBetter", ":", "IProblem", ".", "DiscouragedReference", ";", "default", ":", "return", "ignoreIfBetter", "?", "AccessRule", ".", "IgnoreIfBetter", ":", "0", ";", "}", "}", "public", "IPath", "getPattern", "(", ")", "{", "return", "new", "Path", "(", "new", "String", "(", "this", ".", "pattern", ")", ")", ";", "}", "public", "int", "getKind", "(", ")", "{", "switch", "(", "getProblemId", "(", ")", ")", "{", "case", "IProblem", ".", "ForbiddenReference", ":", "return", "K_NON_ACCESSIBLE", ";", "case", "IProblem", ".", "DiscouragedReference", ":", "return", "K_DISCOURAGED", ";", "default", ":", "return", "K_ACCESSIBLE", ";", "}", "}", "}", "</s>" ]
3,684
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "InvalidInputException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "codeassist", ".", "impl", ".", "AssistOptions", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "impl", ".", "CompilerOptions", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "Scanner", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "ScannerHelper", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "parser", ".", "TerminalTokens", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "SimpleSetOfCharArray", ";", "public", "class", "InternalNamingConventions", "{", "private", "static", "final", "char", "[", "]", "DEFAULT_NAME", "=", "\"name\"", ".", "toCharArray", "(", ")", ";", "private", "static", "Scanner", "getNameScanner", "(", "CompilerOptions", "compilerOptions", ")", "{", "return", "new", "Scanner", "(", "false", ",", "false", ",", "false", ",", "compilerOptions", ".", "sourceLevel", ",", "null", ",", "null", ",", "true", ")", ";", "}", "private", "static", "void", "acceptName", "(", "char", "[", "]", "name", ",", "char", "[", "]", "prefix", ",", "char", "[", "]", "suffix", ",", "boolean", "isFirstPrefix", ",", "boolean", "isFirstSuffix", ",", "int", "reusedCharacters", ",", "INamingRequestor", "requestor", ")", "{", "if", "(", "prefix", ".", "length", ">", "0", "&&", "suffix", ".", "length", ">", "0", ")", "{", "requestor", ".", "acceptNameWithPrefixAndSuffix", "(", "name", ",", "isFirstPrefix", ",", "isFirstSuffix", ",", "reusedCharacters", ")", ";", "}", "else", "if", "(", "prefix", ".", "length", ">", "0", ")", "{", "requestor", ".", "acceptNameWithPrefix", "(", "name", ",", "isFirstPrefix", ",", "reusedCharacters", ")", ";", "}", "else", "if", "(", "suffix", ".", "length", ">", "0", ")", "{", "requestor", ".", "acceptNameWithSuffix", "(", "name", ",", "isFirstSuffix", ",", "reusedCharacters", ")", ";", "}", "else", "{", "requestor", ".", "acceptNameWithoutPrefixAndSuffix", "(", "name", ",", "reusedCharacters", ")", ";", "}", "}", "private", "static", "char", "[", "]", "[", "]", "computeBaseTypeNames", "(", "char", "[", "]", "typeName", ",", "boolean", "isConstantField", ",", "char", "[", "]", "[", "]", "excludedNames", ")", "{", "if", "(", "isConstantField", ")", "{", "return", "computeNonBaseTypeNames", "(", "typeName", ",", "isConstantField", ",", "false", ")", ";", "}", "else", "{", "char", "[", "]", "name", "=", "computeBaseTypeNames", "(", "typeName", "[", "0", "]", ",", "excludedNames", ")", ";", "if", "(", "name", "!=", "null", ")", "{", "return", "new", "char", "[", "]", "[", "]", "{", "name", "}", ";", "}", "else", "{", "return", "computeNonBaseTypeNames", "(", "typeName", ",", "isConstantField", ",", "false", ")", ";", "}", "}", "}", "private", "static", "char", "[", "]", "computeBaseTypeNames", "(", "char", "firstName", ",", "char", "[", "]", "[", "]", "excludedNames", ")", "{", "char", "[", "]", "name", "=", "new", "char", "[", "]", "{", "firstName", "}", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "excludedNames", ".", "length", ";", "i", "++", ")", "{", "if", "(", "CharOperation", ".", "equals", "(", "name", ",", "excludedNames", "[", "i", "]", ",", "false", ")", ")", "{", "name", "[", "0", "]", "++", ";", "if", "(", "name", "[", "0", "]", ">", "'z'", ")", "name", "[", "0", "]", "=", "'a'", ";", "if", "(", "name", "[", "0", "]", "==", "firstName", ")", "return", "null", ";", "i", "=", "0", ";", "}", "}", "return", "name", ";", "}", "private", "static", "char", "[", "]", "[", "]", "computeNonBaseTypeNames", "(", "char", "[", "]", "sourceName", ",", "boolean", "isConstantField", ",", "boolean", "onlyLongest", ")", "{", "int", "length", "=", "sourceName", ".", "length", ";", "if", "(", "length", "==", "0", ")", "{", "return", "CharOperation", ".", "NO_CHAR_CHAR", ";", "}", "if", "(", "length", "==", "1", ")", "{", "if", "(", "isConstantField", ")", "{", "return", "generateConstantName", "(", "new", "char", "[", "]", "[", "]", "{", "CharOperation", ".", "toLowerCase", "(", "sourceName", ")", "}", ",", "0", ",", "onlyLongest", ")", ";", "}", "else", "{", "return", "generateNonConstantName", "(", "new", "char", "[", "]", "[", "]", "{", "CharOperation", ".", "toLowerCase", "(", "sourceName", ")", "}", ",", "0", ",", "onlyLongest", ")", ";", "}", "}", "char", "[", "]", "[", "]", "nameParts", "=", "new", "char", "[", "length", "]", "[", "]", ";", "int", "namePartsPtr", "=", "-", "1", ";", "int", "endIndex", "=", "length", ";", "char", "c", "=", "sourceName", "[", "length", "-", "1", "]", ";", "final", "int", "IS_LOWER_CASE", "=", "1", ";", "final", "int", "IS_UPPER_CASE", "=", "2", ";", "final", "int", "IS_UNDERSCORE", "=", "3", ";", "final", "int", "IS_OTHER", "=", "4", ";", "int", "previousCharKind", "=", "ScannerHelper", ".", "isLowerCase", "(", "c", ")", "?", "IS_LOWER_CASE", ":", "ScannerHelper", ".", "isUpperCase", "(", "c", ")", "?", "IS_UPPER_CASE", ":", "c", "==", "'_'", "?", "IS_UNDERSCORE", ":", "IS_OTHER", ";", "for", "(", "int", "i", "=", "length", "-", "1", ";", "i", ">=", "0", ";", "i", "--", ")", "{", "c", "=", "sourceName", "[", "i", "]", ";", "int", "charKind", "=", "ScannerHelper", ".", "isLowerCase", "(", "c", ")", "?", "IS_LOWER_CASE", ":", "ScannerHelper", ".", "isUpperCase", "(", "c", ")", "?", "IS_UPPER_CASE", ":", "c", "==", "'_'", "?", "IS_UNDERSCORE", ":", "IS_OTHER", ";", "switch", "(", "charKind", ")", "{", "case", "IS_LOWER_CASE", ":", "if", "(", "previousCharKind", "==", "IS_UPPER_CASE", ")", "{", "nameParts", "[", "++", "namePartsPtr", "]", "=", "CharOperation", ".", "subarray", "(", "sourceName", ",", "i", "+", "1", ",", "endIndex", ")", ";", "endIndex", "=", "i", "+", "1", ";", "}", "previousCharKind", "=", "IS_LOWER_CASE", ";", "break", ";", "case", "IS_UPPER_CASE", ":", "if", "(", "previousCharKind", "==", "IS_LOWER_CASE", ")", "{", "nameParts", "[", "++", "namePartsPtr", "]", "=", "CharOperation", ".", "subarray", "(", "sourceName", ",", "i", ",", "endIndex", ")", ";", "if", "(", "i", ">", "0", ")", "{", "char", "pc", "=", "sourceName", "[", "i", "-", "1", "]", ";", "previousCharKind", "=", "ScannerHelper", ".", "isLowerCase", "(", "pc", ")", "?", "IS_LOWER_CASE", ":", "ScannerHelper", ".", "isUpperCase", "(", "pc", ")", "?", "IS_UPPER_CASE", ":", "pc", "==", "'_'", "?", "IS_UNDERSCORE", ":", "IS_OTHER", ";", "}", "endIndex", "=", "i", ";", "}", "else", "{", "previousCharKind", "=", "IS_UPPER_CASE", ";", "}", "break", ";", "case", "IS_UNDERSCORE", ":", "switch", "(", "previousCharKind", ")", "{", "case", "IS_UNDERSCORE", ":", "if", "(", "isConstantField", ")", "{", "if", "(", "i", ">", "0", ")", "{", "char", "pc", "=", "sourceName", "[", "i", "-", "1", "]", ";", "previousCharKind", "=", "ScannerHelper", ".", "isLowerCase", "(", "pc", ")", "?", "IS_LOWER_CASE", ":", "ScannerHelper", ".", "isUpperCase", "(", "pc", ")", "?", "IS_UPPER_CASE", ":", "pc", "==", "'_'", "?", "IS_UNDERSCORE", ":", "IS_OTHER", ";", "}", "endIndex", "=", "i", ";", "}", "break", ";", "case", "IS_LOWER_CASE", ":", "case", "IS_UPPER_CASE", ":", "nameParts", "[", "++", "namePartsPtr", "]", "=", "CharOperation", ".", "subarray", "(", "sourceName", ",", "i", "+", "1", ",", "endIndex", ")", ";", "if", "(", "i", ">", "0", ")", "{", "char", "pc", "=", "sourceName", "[", "i", "-", "1", "]", ";", "previousCharKind", "=", "ScannerHelper", ".", "isLowerCase", "(", "pc", ")", "?", "IS_LOWER_CASE", ":", "ScannerHelper", ".", "isUpperCase", "(", "pc", ")", "?", "IS_UPPER_CASE", ":", "pc", "==", "'_'", "?", "IS_UNDERSCORE", ":", "IS_OTHER", ";", "}", "endIndex", "=", "i", "+", "1", ";", "break", ";", "default", ":", "previousCharKind", "=", "IS_UNDERSCORE", ";", "break", ";", "}", "break", ";", "default", ":", "previousCharKind", "=", "IS_OTHER", ";", "break", ";", "}", "}", "if", "(", "endIndex", ">", "0", ")", "{", "nameParts", "[", "++", "namePartsPtr", "]", "=", "CharOperation", ".", "subarray", "(", "sourceName", ",", "0", ",", "endIndex", ")", ";", "}", "if", "(", "namePartsPtr", "==", "-", "1", ")", "{", "return", "new", "char", "[", "]", "[", "]", "{", "sourceName", "}", ";", "}", "if", "(", "isConstantField", ")", "{", "return", "generateConstantName", "(", "nameParts", ",", "namePartsPtr", ",", "onlyLongest", ")", ";", "}", "else", "{", "return", "generateNonConstantName", "(", "nameParts", ",", "namePartsPtr", ",", "onlyLongest", ")", ";", "}", "}", "private", "static", "char", "[", "]", "excludeNames", "(", "char", "[", "]", "suffixName", ",", "char", "[", "]", "prefixName", ",", "char", "[", "]", "suffix", ",", "char", "[", "]", "[", "]", "excludedNames", ")", "{", "int", "count", "=", "2", ";", "int", "m", "=", "0", ";", "while", "(", "m", "<", "excludedNames", ".", "length", ")", "{", "if", "(", "CharOperation", ".", "equals", "(", "suffixName", ",", "excludedNames", "[", "m", "]", ",", "false", ")", ")", "{", "suffixName", "=", "CharOperation", ".", "concat", "(", "prefixName", ",", "String", ".", "valueOf", "(", "count", "++", ")", ".", "toCharArray", "(", ")", ",", "suffix", ")", ";", "m", "=", "0", ";", "}", "else", "{", "m", "++", ";", "}", "}", "return", "suffixName", ";", "}", "private", "static", "char", "[", "]", "[", "]", "generateNonConstantName", "(", "char", "[", "]", "[", "]", "nameParts", ",", "int", "namePartsPtr", ",", "boolean", "onlyLongest", ")", "{", "char", "[", "]", "[", "]", "names", ";", "if", "(", "onlyLongest", ")", "{", "names", "=", "new", "char", "[", "1", "]", "[", "]", ";", "}", "else", "{", "names", "=", "new", "char", "[", "namePartsPtr", "+", "1", "]", "[", "]", ";", "}", "char", "[", "]", "namePart", "=", "nameParts", "[", "0", "]", ";", "char", "[", "]", "name", "=", "CharOperation", ".", "toLowerCase", "(", "namePart", ")", ";", "if", "(", "!", "onlyLongest", ")", "{", "names", "[", "namePartsPtr", "]", "=", "name", ";", "}", "char", "[", "]", "nameSuffix", "=", "namePart", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<=", "namePartsPtr", ";", "i", "++", ")", "{", "namePart", "=", "nameParts", "[", "i", "]", ";", "name", "=", "CharOperation", ".", "concat", "(", "CharOperation", ".", "toLowerCase", "(", "namePart", ")", ",", "nameSuffix", ")", ";", "if", "(", "!", "onlyLongest", ")", "{", "names", "[", "namePartsPtr", "-", "i", "]", "=", "name", ";", "}", "nameSuffix", "=", "CharOperation", ".", "concat", "(", "namePart", ",", "nameSuffix", ")", ";", "}", "if", "(", "onlyLongest", ")", "{", "names", "[", "0", "]", "=", "name", ";", "}", "return", "names", ";", "}", "private", "static", "char", "[", "]", "[", "]", "generateConstantName", "(", "char", "[", "]", "[", "]", "nameParts", ",", "int", "namePartsPtr", ",", "boolean", "onlyLongest", ")", "{", "char", "[", "]", "[", "]", "names", ";", "if", "(", "onlyLongest", ")", "{", "names", "=", "new", "char", "[", "1", "]", "[", "]", ";", "}", "else", "{", "names", "=", "new", "char", "[", "namePartsPtr", "+", "1", "]", "[", "]", ";", "}", "char", "[", "]", "namePart", "=", "CharOperation", ".", "toUpperCase", "(", "nameParts", "[", "0", "]", ")", ";", "int", "namePartLength", "=", "namePart", ".", "length", ";", "System", ".", "arraycopy", "(", "namePart", ",", "0", ",", "namePart", ",", "0", ",", "namePartLength", ")", ";", "char", "[", "]", "name", "=", "namePart", ";", "if", "(", "!", "onlyLongest", ")", "{", "names", "[", "namePartsPtr", "]", "=", "name", ";", "}", "for", "(", "int", "i", "=", "1", ";", "i", "<=", "namePartsPtr", ";", "i", "++", ")", "{", "namePart", "=", "CharOperation", ".", "toUpperCase", "(", "nameParts", "[", "i", "]", ")", ";", "namePartLength", "=", "namePart", ".", "length", ";", "if", "(", "namePart", "[", "namePartLength", "-", "1", "]", "!=", "'_'", ")", "{", "name", "=", "CharOperation", ".", "concat", "(", "namePart", ",", "name", ",", "'_'", ")", ";", "}", "else", "{", "name", "=", "CharOperation", ".", "concat", "(", "namePart", ",", "name", ")", ";", "}", "if", "(", "!", "onlyLongest", ")", "{", "names", "[", "namePartsPtr", "-", "i", "]", "=", "name", ";", "}", "}", "if", "(", "onlyLongest", ")", "{", "names", "[", "0", "]", "=", "name", ";", "}", "return", "names", ";", "}", "public", "static", "char", "[", "]", "getBaseName", "(", "int", "variableKind", ",", "IJavaProject", "javaProject", ",", "char", "[", "]", "name", ",", "boolean", "updateFirstCharacter", ")", "{", "AssistOptions", "assistOptions", ";", "if", "(", "javaProject", "!=", "null", ")", "{", "assistOptions", "=", "new", "AssistOptions", "(", "javaProject", ".", "getOptions", "(", "true", ")", ")", ";", "}", "else", "{", "assistOptions", "=", "new", "AssistOptions", "(", "JavaCore", ".", "getOptions", "(", ")", ")", ";", "}", "char", "[", "]", "[", "]", "prefixes", "=", "null", ";", "char", "[", "]", "[", "]", "suffixes", "=", "null", ";", "switch", "(", "variableKind", ")", "{", "case", "VK_INSTANCE_FIELD", ":", "prefixes", "=", "assistOptions", ".", "fieldPrefixes", ";", "suffixes", "=", "assistOptions", ".", "fieldSuffixes", ";", "break", ";", "case", "VK_STATIC_FIELD", ":", "prefixes", "=", "assistOptions", ".", "staticFieldPrefixes", ";", "suffixes", "=", "assistOptions", ".", "staticFieldSuffixes", ";", "break", ";", "case", "VK_STATIC_FINAL_FIELD", ":", "prefixes", "=", "assistOptions", ".", "staticFinalFieldPrefixes", ";", "suffixes", "=", "assistOptions", ".", "staticFinalFieldSuffixes", ";", "break", ";", "case", "VK_LOCAL", ":", "prefixes", "=", "assistOptions", ".", "localPrefixes", ";", "suffixes", "=", "assistOptions", ".", "localSuffixes", ";", "break", ";", "case", "VK_PARAMETER", ":", "prefixes", "=", "assistOptions", ".", "argumentPrefixes", ";", "suffixes", "=", "assistOptions", ".", "argumentSuffixes", ";", "break", ";", "}", "return", "getBaseName", "(", "name", ",", "prefixes", ",", "suffixes", ",", "variableKind", "==", "VK_STATIC_FINAL_FIELD", ",", "updateFirstCharacter", ")", ";", "}", "private", "static", "char", "[", "]", "getBaseName", "(", "char", "[", "]", "name", ",", "char", "[", "]", "[", "]", "prefixes", ",", "char", "[", "]", "[", "]", "suffixes", ",", "boolean", "isConstant", ",", "boolean", "updateFirstCharacter", ")", "{", "char", "[", "]", "nameWithoutPrefixAndSiffix", "=", "removeVariablePrefixAndSuffix", "(", "name", ",", "prefixes", ",", "suffixes", ",", "updateFirstCharacter", ")", ";", "char", "[", "]", "baseName", ";", "if", "(", "isConstant", ")", "{", "int", "length", "=", "nameWithoutPrefixAndSiffix", ".", "length", ";", "baseName", "=", "new", "char", "[", "length", "]", ";", "int", "baseNamePtr", "=", "-", "1", ";", "boolean", "previousIsUnderscore", "=", "false", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "char", "c", "=", "nameWithoutPrefixAndSiffix", "[", "i", "]", ";", "if", "(", "c", "!=", "'_'", ")", "{", "if", "(", "previousIsUnderscore", ")", "{", "baseName", "[", "++", "baseNamePtr", "]", "=", "ScannerHelper", ".", "toUpperCase", "(", "c", ")", ";", "previousIsUnderscore", "=", "false", ";", "}", "else", "{", "baseName", "[", "++", "baseNamePtr", "]", "=", "ScannerHelper", ".", "toLowerCase", "(", "c", ")", ";", "}", "}", "else", "{", "previousIsUnderscore", "=", "true", ";", "}", "}", "System", ".", "arraycopy", "(", "baseName", ",", "0", ",", "baseName", "=", "new", "char", "[", "baseNamePtr", "+", "1", "]", ",", "0", ",", "baseNamePtr", "+", "1", ")", ";", "}", "else", "{", "baseName", "=", "nameWithoutPrefixAndSiffix", ";", "}", "return", "baseName", ";", "}", "public", "static", "char", "[", "]", "removeVariablePrefixAndSuffix", "(", "int", "variableKind", ",", "IJavaProject", "javaProject", ",", "char", "[", "]", "name", ")", "{", "AssistOptions", "assistOptions", ";", "if", "(", "javaProject", "!=", "null", ")", "{", "assistOptions", "=", "new", "AssistOptions", "(", "javaProject", ".", "getOptions", "(", "true", ")", ")", ";", "}", "else", "{", "assistOptions", "=", "new", "AssistOptions", "(", "JavaCore", ".", "getOptions", "(", ")", ")", ";", "}", "char", "[", "]", "[", "]", "prefixes", "=", "null", ";", "char", "[", "]", "[", "]", "suffixes", "=", "null", ";", "switch", "(", "variableKind", ")", "{", "case", "VK_INSTANCE_FIELD", ":", "prefixes", "=", "assistOptions", ".", "fieldPrefixes", ";", "suffixes", "=", "assistOptions", ".", "fieldSuffixes", ";", "break", ";", "case", "VK_STATIC_FIELD", ":", "prefixes", "=", "assistOptions", ".", "staticFieldPrefixes", ";", "suffixes", "=", "assistOptions", ".", "staticFieldSuffixes", ";", "break", ";", "case", "VK_STATIC_FINAL_FIELD", ":", "prefixes", "=", "assistOptions", ".", "staticFinalFieldPrefixes", ";", "suffixes", "=", "assistOptions", ".", "staticFinalFieldSuffixes", ";", "break", ";", "case", "VK_LOCAL", ":", "prefixes", "=", "assistOptions", ".", "localPrefixes", ";", "suffixes", "=", "assistOptions", ".", "localSuffixes", ";", "break", ";", "case", "VK_PARAMETER", ":", "prefixes", "=", "assistOptions", ".", "argumentPrefixes", ";", "suffixes", "=", "assistOptions", ".", "argumentSuffixes", ";", "break", ";", "}", "return", "InternalNamingConventions", ".", "removeVariablePrefixAndSuffix", "(", "name", ",", "prefixes", ",", "suffixes", ",", "true", ")", ";", "}", "private", "static", "char", "[", "]", "removeVariablePrefixAndSuffix", "(", "char", "[", "]", "name", ",", "char", "[", "]", "[", "]", "prefixes", ",", "char", "[", "]", "[", "]", "suffixes", ",", "boolean", "updateFirstCharacter", ")", "{", "char", "[", "]", "withoutPrefixName", "=", "name", ";", "if", "(", "prefixes", "!=", "null", ")", "{", "int", "bestLength", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "prefixes", ".", "length", ";", "i", "++", ")", "{", "char", "[", "]", "prefix", "=", "prefixes", "[", "i", "]", ";", "if", "(", "CharOperation", ".", "prefixEquals", "(", "prefix", ",", "name", ")", ")", "{", "int", "currLen", "=", "prefix", ".", "length", ";", "boolean", "lastCharIsLetter", "=", "ScannerHelper", ".", "isLetter", "(", "prefix", "[", "currLen", "-", "1", "]", ")", ";", "if", "(", "!", "lastCharIsLetter", "||", "(", "lastCharIsLetter", "&&", "name", ".", "length", ">", "currLen", "&&", "ScannerHelper", ".", "isUpperCase", "(", "name", "[", "currLen", "]", ")", ")", ")", "{", "if", "(", "bestLength", "<", "currLen", "&&", "name", ".", "length", "!=", "currLen", ")", "{", "withoutPrefixName", "=", "CharOperation", ".", "subarray", "(", "name", ",", "currLen", ",", "name", ".", "length", ")", ";", "bestLength", "=", "currLen", ";", "}", "}", "}", "}", "}", "char", "[", "]", "withoutSuffixName", "=", "withoutPrefixName", ";", "if", "(", "suffixes", "!=", "null", ")", "{", "int", "bestLength", "=", "0", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "suffixes", ".", "length", ";", "i", "++", ")", "{", "char", "[", "]", "suffix", "=", "suffixes", "[", "i", "]", ";", "if", "(", "CharOperation", ".", "endsWith", "(", "withoutPrefixName", ",", "suffix", ")", ")", "{", "int", "currLen", "=", "suffix", ".", "length", ";", "if", "(", "bestLength", "<", "currLen", "&&", "withoutPrefixName", ".", "length", "!=", "currLen", ")", "{", "withoutSuffixName", "=", "CharOperation", ".", "subarray", "(", "withoutPrefixName", ",", "0", ",", "withoutPrefixName", ".", "length", "-", "currLen", ")", ";", "bestLength", "=", "currLen", ";", "}", "}", "}", "}", "if", "(", "updateFirstCharacter", ")", "withoutSuffixName", "[", "0", "]", "=", "ScannerHelper", ".", "toLowerCase", "(", "withoutSuffixName", "[", "0", "]", ")", ";", "return", "withoutSuffixName", ";", "}", "private", "static", "char", "[", "]", "removePrefix", "(", "char", "[", "]", "name", ",", "char", "[", "]", "[", "]", "prefixes", ")", "{", "char", "[", "]", "withoutPrefixName", "=", "name", ";", "if", "(", "prefixes", "!=", "null", ")", "{", "int", "bestLength", "=", "0", ";", "int", "nameLength", "=", "name", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "prefixes", ".", "length", ";", "i", "++", ")", "{", "char", "[", "]", "prefix", "=", "prefixes", "[", "i", "]", ";", "int", "prefixLength", "=", "prefix", ".", "length", ";", "if", "(", "prefixLength", "<=", "nameLength", ")", "{", "if", "(", "CharOperation", ".", "prefixEquals", "(", "prefix", ",", "name", ",", "false", ")", ")", "{", "if", "(", "prefixLength", ">", "bestLength", ")", "{", "bestLength", "=", "prefixLength", ";", "}", "}", "}", "else", "{", "int", "currLen", "=", "0", ";", "for", "(", ";", "currLen", "<", "nameLength", ";", "currLen", "++", ")", "{", "if", "(", "ScannerHelper", ".", "toLowerCase", "(", "prefix", "[", "currLen", "]", ")", "!=", "ScannerHelper", ".", "toLowerCase", "(", "name", "[", "currLen", "]", ")", ")", "{", "if", "(", "currLen", ">", "bestLength", ")", "{", "bestLength", "=", "currLen", ";", "}", "break", ";", "}", "}", "if", "(", "currLen", "==", "nameLength", "&&", "currLen", ">", "bestLength", ")", "{", "bestLength", "=", "currLen", ";", "}", "}", "}", "if", "(", "bestLength", ">", "0", ")", "{", "if", "(", "bestLength", "==", "nameLength", ")", "{", "withoutPrefixName", "=", "CharOperation", ".", "NO_CHAR", ";", "}", "else", "{", "withoutPrefixName", "=", "CharOperation", ".", "subarray", "(", "name", ",", "bestLength", ",", "nameLength", ")", ";", "}", "}", "}", "return", "withoutPrefixName", ";", "}", "public", "static", "final", "int", "VK_STATIC_FIELD", "=", "1", ";", "public", "static", "final", "int", "VK_INSTANCE_FIELD", "=", "2", ";", "public", "static", "final", "int", "VK_STATIC_FINAL_FIELD", "=", "3", ";", "public", "static", "final", "int", "VK_PARAMETER", "=", "4", ";", "public", "static", "final", "int", "VK_LOCAL", "=", "5", ";", "public", "static", "final", "int", "BK_SIMPLE_NAME", "=", "1", ";", "public", "static", "final", "int", "BK_SIMPLE_TYPE_NAME", "=", "2", ";", "public", "static", "void", "suggestVariableNames", "(", "int", "variableKind", ",", "int", "baseNameKind", ",", "char", "[", "]", "baseName", ",", "IJavaProject", "javaProject", ",", "int", "dim", ",", "char", "[", "]", "internalPrefix", ",", "char", "[", "]", "[", "]", "excluded", ",", "boolean", "evaluateDefault", ",", "INamingRequestor", "requestor", ")", "{", "if", "(", "baseName", "==", "null", "||", "baseName", ".", "length", "==", "0", ")", "return", ";", "Map", "options", ";", "if", "(", "javaProject", "!=", "null", ")", "{", "options", "=", "javaProject", ".", "getOptions", "(", "true", ")", ";", "}", "else", "{", "options", "=", "JavaCore", ".", "getOptions", "(", ")", ";", "}", "CompilerOptions", "compilerOptions", "=", "new", "CompilerOptions", "(", "options", ")", ";", "AssistOptions", "assistOptions", "=", "new", "AssistOptions", "(", "options", ")", ";", "boolean", "isConstantField", "=", "false", ";", "char", "[", "]", "[", "]", "prefixes", "=", "null", ";", "char", "[", "]", "[", "]", "suffixes", "=", "null", ";", "switch", "(", "variableKind", ")", "{", "case", "VK_INSTANCE_FIELD", ":", "prefixes", "=", "assistOptions", ".", "fieldPrefixes", ";", "suffixes", "=", "assistOptions", ".", "fieldSuffixes", ";", "break", ";", "case", "VK_STATIC_FIELD", ":", "prefixes", "=", "assistOptions", ".", "staticFieldPrefixes", ";", "suffixes", "=", "assistOptions", ".", "staticFieldSuffixes", ";", "break", ";", "case", "VK_STATIC_FINAL_FIELD", ":", "isConstantField", "=", "true", ";", "prefixes", "=", "assistOptions", ".", "staticFinalFieldPrefixes", ";", "suffixes", "=", "assistOptions", ".", "staticFinalFieldSuffixes", ";", "break", ";", "case", "VK_LOCAL", ":", "prefixes", "=", "assistOptions", ".", "localPrefixes", ";", "suffixes", "=", "assistOptions", ".", "localSuffixes", ";", "break", ";", "case", "VK_PARAMETER", ":", "prefixes", "=", "assistOptions", ".", "argumentPrefixes", ";", "suffixes", "=", "assistOptions", ".", "argumentSuffixes", ";", "break", ";", "}", "if", "(", "prefixes", "==", "null", "||", "prefixes", ".", "length", "==", "0", ")", "{", "prefixes", "=", "new", "char", "[", "1", "]", "[", "0", "]", ";", "}", "else", "{", "int", "length", "=", "prefixes", ".", "length", ";", "System", ".", "arraycopy", "(", "prefixes", ",", "0", ",", "prefixes", "=", "new", "char", "[", "length", "+", "1", "]", "[", "]", ",", "0", ",", "length", ")", ";", "prefixes", "[", "length", "]", "=", "CharOperation", ".", "NO_CHAR", ";", "}", "if", "(", "suffixes", "==", "null", "||", "suffixes", ".", "length", "==", "0", ")", "{", "suffixes", "=", "new", "char", "[", "1", "]", "[", "0", "]", ";", "}", "else", "{", "int", "length", "=", "suffixes", ".", "length", ";", "System", ".", "arraycopy", "(", "suffixes", ",", "0", ",", "suffixes", "=", "new", "char", "[", "length", "+", "1", "]", "[", "]", ",", "0", ",", "length", ")", ";", "suffixes", "[", "length", "]", "=", "CharOperation", ".", "NO_CHAR", ";", "}", "if", "(", "internalPrefix", "==", "null", ")", "{", "internalPrefix", "=", "CharOperation", ".", "NO_CHAR", ";", "}", "else", "{", "internalPrefix", "=", "removePrefix", "(", "internalPrefix", ",", "prefixes", ")", ";", "}", "char", "[", "]", "[", "]", "tempNames", "=", "null", ";", "Scanner", "nameScanner", "=", "getNameScanner", "(", "compilerOptions", ")", ";", "if", "(", "baseNameKind", "==", "BK_SIMPLE_TYPE_NAME", ")", "{", "boolean", "isBaseType", "=", "false", ";", "try", "{", "nameScanner", ".", "setSource", "(", "baseName", ")", ";", "switch", "(", "nameScanner", ".", "getNextToken", "(", ")", ")", "{", "case", "TerminalTokens", ".", "TokenNameint", ":", "case", "TerminalTokens", ".", "TokenNamebyte", ":", "case", "TerminalTokens", ".", "TokenNameshort", ":", "case", "TerminalTokens", ".", "TokenNamechar", ":", "case", "TerminalTokens", ".", "TokenNamelong", ":", "case", "TerminalTokens", ".", "TokenNamefloat", ":", "case", "TerminalTokens", ".", "TokenNamedouble", ":", "case", "TerminalTokens", ".", "TokenNameboolean", ":", "isBaseType", "=", "true", ";", "break", ";", "}", "}", "catch", "(", "InvalidInputException", "e", ")", "{", "}", "if", "(", "isBaseType", ")", "{", "if", "(", "internalPrefix", ".", "length", ">", "0", ")", "return", ";", "tempNames", "=", "computeBaseTypeNames", "(", "baseName", ",", "isConstantField", ",", "excluded", ")", ";", "}", "else", "{", "tempNames", "=", "computeNonBaseTypeNames", "(", "baseName", ",", "isConstantField", ",", "false", ")", ";", "}", "}", "else", "{", "tempNames", "=", "computeNonBaseTypeNames", "(", "baseName", ",", "isConstantField", ",", "true", ")", ";", "}", "boolean", "acceptDefaultName", "=", "true", ";", "SimpleSetOfCharArray", "foundNames", "=", "new", "SimpleSetOfCharArray", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "tempNames", ".", "length", ";", "i", "++", ")", "{", "char", "[", "]", "tempName", "=", "tempNames", "[", "i", "]", ";", "if", "(", "dim", ">", "0", ")", "{", "int", "length", "=", "tempName", ".", "length", ";", "if", "(", "isConstantField", ")", "{", "if", "(", "tempName", "[", "length", "-", "1", "]", "==", "'S'", ")", "{", "if", "(", "tempName", ".", "length", ">", "1", "&&", "tempName", "[", "length", "-", "2", "]", "==", "'S'", ")", "{", "System", ".", "arraycopy", "(", "tempName", ",", "0", ",", "tempName", "=", "new", "char", "[", "length", "+", "2", "]", ",", "0", ",", "length", ")", ";", "tempName", "[", "length", "]", "=", "'E'", ";", "tempName", "[", "length", "+", "1", "]", "=", "'S'", ";", "}", "}", "else", "if", "(", "tempName", "[", "length", "-", "1", "]", "==", "'Y'", ")", "{", "boolean", "precededByAVowel", "=", "false", ";", "if", "(", "tempName", ".", "length", ">", "1", ")", "{", "switch", "(", "tempName", "[", "length", "-", "2", "]", ")", "{", "case", "'A'", ":", "case", "'E'", ":", "case", "'I'", ":", "case", "'O'", ":", "case", "'U'", ":", "precededByAVowel", "=", "true", ";", "break", ";", "}", "}", "if", "(", "precededByAVowel", ")", "{", "System", ".", "arraycopy", "(", "tempName", ",", "0", ",", "tempName", "=", "new", "char", "[", "length", "+", "1", "]", ",", "0", ",", "length", ")", ";", "tempName", "[", "length", "]", "=", "'S'", ";", "}", "else", "{", "System", ".", "arraycopy", "(", "tempName", ",", "0", ",", "tempName", "=", "new", "char", "[", "length", "+", "2", "]", ",", "0", ",", "length", ")", ";", "tempName", "[", "length", "-", "1", "]", "=", "'I'", ";", "tempName", "[", "length", "]", "=", "'E'", ";", "tempName", "[", "length", "+", "1", "]", "=", "'S'", ";", "}", "}", "else", "{", "System", ".", "arraycopy", "(", "tempName", ",", "0", ",", "tempName", "=", "new", "char", "[", "length", "+", "1", "]", ",", "0", ",", "length", ")", ";", "tempName", "[", "length", "]", "=", "'S'", ";", "}", "}", "else", "{", "if", "(", "tempName", "[", "length", "-", "1", "]", "==", "'s'", ")", "{", "if", "(", "tempName", ".", "length", ">", "1", "&&", "tempName", "[", "length", "-", "2", "]", "==", "'s'", ")", "{", "System", ".", "arraycopy", "(", "tempName", ",", "0", ",", "tempName", "=", "new", "char", "[", "length", "+", "2", "]", ",", "0", ",", "length", ")", ";", "tempName", "[", "length", "]", "=", "'e'", ";", "tempName", "[", "length", "+", "1", "]", "=", "'s'", ";", "}", "}", "else", "if", "(", "tempName", "[", "length", "-", "1", "]", "==", "'y'", ")", "{", "boolean", "precededByAVowel", "=", "false", ";", "if", "(", "tempName", ".", "length", ">", "1", ")", "{", "switch", "(", "tempName", "[", "length", "-", "2", "]", ")", "{", "case", "'a'", ":", "case", "'e'", ":", "case", "'i'", ":", "case", "'o'", ":", "case", "'u'", ":", "precededByAVowel", "=", "true", ";", "break", ";", "}", "}", "if", "(", "precededByAVowel", ")", "{", "System", ".", "arraycopy", "(", "tempName", ",", "0", ",", "tempName", "=", "new", "char", "[", "length", "+", "1", "]", ",", "0", ",", "length", ")", ";", "tempName", "[", "length", "]", "=", "'s'", ";", "}", "else", "{", "System", ".", "arraycopy", "(", "tempName", ",", "0", ",", "tempName", "=", "new", "char", "[", "length", "+", "2", "]", ",", "0", ",", "length", ")", ";", "tempName", "[", "length", "-", "1", "]", "=", "'i'", ";", "tempName", "[", "length", "]", "=", "'e'", ";", "tempName", "[", "length", "+", "1", "]", "=", "'s'", ";", "}", "}", "else", "{", "System", ".", "arraycopy", "(", "tempName", ",", "0", ",", "tempName", "=", "new", "char", "[", "length", "+", "1", "]", ",", "0", ",", "length", ")", ";", "tempName", "[", "length", "]", "=", "'s'", ";", "}", "}", "}", "char", "[", "]", "unprefixedName", "=", "tempName", ";", "int", "matchingIndex", "=", "-", "1", ";", "if", "(", "!", "isConstantField", ")", "{", "unprefixedName", "[", "0", "]", "=", "ScannerHelper", ".", "toUpperCase", "(", "unprefixedName", "[", "0", "]", ")", ";", "done", ":", "for", "(", "int", "j", "=", "0", ";", "j", "<=", "internalPrefix", ".", "length", ";", "j", "++", ")", "{", "if", "(", "j", "==", "internalPrefix", ".", "length", "||", "CharOperation", ".", "prefixEquals", "(", "CharOperation", ".", "subarray", "(", "internalPrefix", ",", "j", ",", "-", "1", ")", ",", "unprefixedName", ",", "j", "!=", "0", ")", ")", "{", "matchingIndex", "=", "j", ";", "break", "done", ";", "}", "}", "}", "else", "{", "done", ":", "for", "(", "int", "j", "=", "0", ";", "j", "<=", "internalPrefix", ".", "length", ";", "j", "++", ")", "{", "if", "(", "j", "==", "internalPrefix", ".", "length", ")", "{", "matchingIndex", "=", "j", ";", "break", "done", ";", "}", "else", "if", "(", "CharOperation", ".", "prefixEquals", "(", "CharOperation", ".", "subarray", "(", "internalPrefix", ",", "j", ",", "-", "1", ")", ",", "unprefixedName", ",", "j", "!=", "0", ")", ")", "{", "if", "(", "j", "==", "0", "||", "internalPrefix", "[", "j", "-", "1", "]", "==", "'_'", ")", "{", "matchingIndex", "=", "j", ";", "break", "done", ";", "}", "}", "}", "}", "if", "(", "matchingIndex", ">", "-", "1", ")", "{", "if", "(", "!", "isConstantField", ")", "{", "tempName", "=", "CharOperation", ".", "concat", "(", "CharOperation", ".", "subarray", "(", "internalPrefix", ",", "0", ",", "matchingIndex", ")", ",", "unprefixedName", ")", ";", "if", "(", "matchingIndex", "==", "0", ")", "tempName", "[", "0", "]", "=", "ScannerHelper", ".", "toLowerCase", "(", "tempName", "[", "0", "]", ")", ";", "}", "else", "{", "if", "(", "matchingIndex", "!=", "0", "&&", "tempName", "[", "0", "]", "!=", "'_'", "&&", "internalPrefix", "[", "matchingIndex", "-", "1", "]", "!=", "'_'", ")", "{", "tempName", "=", "CharOperation", ".", "concat", "(", "CharOperation", ".", "subarray", "(", "CharOperation", ".", "toUpperCase", "(", "internalPrefix", ")", ",", "0", ",", "matchingIndex", ")", ",", "unprefixedName", ",", "'_'", ")", ";", "}", "else", "{", "tempName", "=", "CharOperation", ".", "concat", "(", "CharOperation", ".", "subarray", "(", "CharOperation", ".", "toUpperCase", "(", "internalPrefix", ")", ",", "0", ",", "matchingIndex", ")", ",", "unprefixedName", ")", ";", "}", "}", "for", "(", "int", "k", "=", "0", ";", "k", "<", "prefixes", ".", "length", ";", "k", "++", ")", "{", "if", "(", "!", "isConstantField", ")", "{", "if", "(", "prefixes", "[", "k", "]", ".", "length", ">", "0", "&&", "ScannerHelper", ".", "isLetterOrDigit", "(", "prefixes", "[", "k", "]", "[", "prefixes", "[", "k", "]", ".", "length", "-", "1", "]", ")", ")", "{", "tempName", "[", "0", "]", "=", "ScannerHelper", ".", "toUpperCase", "(", "tempName", "[", "0", "]", ")", ";", "}", "else", "{", "tempName", "[", "0", "]", "=", "ScannerHelper", ".", "toLowerCase", "(", "tempName", "[", "0", "]", ")", ";", "}", "}", "char", "[", "]", "prefixName", "=", "CharOperation", ".", "concat", "(", "prefixes", "[", "k", "]", ",", "tempName", ")", ";", "for", "(", "int", "l", "=", "0", ";", "l", "<", "suffixes", ".", "length", ";", "l", "++", ")", "{", "char", "[", "]", "suffixName", "=", "CharOperation", ".", "concat", "(", "prefixName", ",", "suffixes", "[", "l", "]", ")", ";", "suffixName", "=", "excludeNames", "(", "suffixName", ",", "prefixName", ",", "suffixes", "[", "l", "]", ",", "excluded", ")", ";", "try", "{", "nameScanner", ".", "setSource", "(", "suffixName", ")", ";", "switch", "(", "nameScanner", ".", "getNextToken", "(", ")", ")", "{", "case", "TerminalTokens", ".", "TokenNameIdentifier", ":", "int", "token", "=", "nameScanner", ".", "getNextToken", "(", ")", ";", "if", "(", "token", "==", "TerminalTokens", ".", "TokenNameEOF", "&&", "nameScanner", ".", "startPosition", "==", "suffixName", ".", "length", ")", "{", "if", "(", "!", "foundNames", ".", "includes", "(", "suffixName", ")", ")", "{", "acceptName", "(", "suffixName", ",", "prefixes", "[", "k", "]", ",", "suffixes", "[", "l", "]", ",", "k", "==", "0", ",", "l", "==", "0", ",", "internalPrefix", ".", "length", "-", "matchingIndex", ",", "requestor", ")", ";", "foundNames", ".", "add", "(", "suffixName", ")", ";", "acceptDefaultName", "=", "false", ";", "}", "}", "break", ";", "default", ":", "suffixName", "=", "CharOperation", ".", "concat", "(", "prefixName", ",", "String", ".", "valueOf", "(", "1", ")", ".", "toCharArray", "(", ")", ",", "suffixes", "[", "l", "]", ")", ";", "suffixName", "=", "excludeNames", "(", "suffixName", ",", "prefixName", ",", "suffixes", "[", "l", "]", ",", "excluded", ")", ";", "nameScanner", ".", "setSource", "(", "suffixName", ")", ";", "switch", "(", "nameScanner", ".", "getNextToken", "(", ")", ")", "{", "case", "TerminalTokens", ".", "TokenNameIdentifier", ":", "token", "=", "nameScanner", ".", "getNextToken", "(", ")", ";", "if", "(", "token", "==", "TerminalTokens", ".", "TokenNameEOF", "&&", "nameScanner", ".", "startPosition", "==", "suffixName", ".", "length", ")", "{", "if", "(", "!", "foundNames", ".", "includes", "(", "suffixName", ")", ")", "{", "acceptName", "(", "suffixName", ",", "prefixes", "[", "k", "]", ",", "suffixes", "[", "l", "]", ",", "k", "==", "0", ",", "l", "==", "0", ",", "internalPrefix", ".", "length", "-", "matchingIndex", ",", "requestor", ")", ";", "foundNames", ".", "add", "(", "suffixName", ")", ";", "acceptDefaultName", "=", "false", ";", "}", "}", "}", "}", "}", "catch", "(", "InvalidInputException", "e", ")", "{", "}", "}", "}", "}", "}", "if", "(", "evaluateDefault", "&&", "acceptDefaultName", ")", "{", "char", "[", "]", "name", "=", "excludeNames", "(", "DEFAULT_NAME", ",", "DEFAULT_NAME", ",", "CharOperation", ".", "NO_CHAR", ",", "excluded", ")", ";", "requestor", ".", "acceptNameWithoutPrefixAndSuffix", "(", "name", ",", "0", ")", ";", "}", "}", "}", "</s>" ]
3,685
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IStatus", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IImportDeclaration", ";", "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", ".", "IType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaConventions", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "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", ".", "CompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "Name", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "PackageDeclaration", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "StructuralPropertyDescriptor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "rewrite", ".", "ASTRewrite", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Messages", ";", "public", "class", "CreatePackageDeclarationOperation", "extends", "CreateElementInCUOperation", "{", "protected", "String", "name", "=", "null", ";", "public", "CreatePackageDeclarationOperation", "(", "String", "name", ",", "ICompilationUnit", "parentElement", ")", "{", "super", "(", "parentElement", ")", ";", "this", ".", "name", "=", "name", ";", "}", "protected", "StructuralPropertyDescriptor", "getChildPropertyDescriptor", "(", "ASTNode", "parent", ")", "{", "return", "CompilationUnit", ".", "PACKAGE_PROPERTY", ";", "}", "protected", "ASTNode", "generateElementAST", "(", "ASTRewrite", "rewriter", ",", "ICompilationUnit", "cu", ")", "throws", "JavaModelException", "{", "IJavaElement", "[", "]", "children", "=", "getCompilationUnit", "(", ")", ".", "getChildren", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "children", ".", "length", ";", "i", "++", ")", "{", "if", "(", "children", "[", "i", "]", ".", "getElementType", "(", ")", "==", "IJavaElement", ".", "PACKAGE_DECLARATION", "&&", "this", ".", "name", ".", "equals", "(", "children", "[", "i", "]", ".", "getElementName", "(", ")", ")", ")", "{", "this", ".", "creationOccurred", "=", "false", ";", "return", "null", ";", "}", "}", "AST", "ast", "=", "this", ".", "cuAST", ".", "getAST", "(", ")", ";", "PackageDeclaration", "pkgDeclaration", "=", "ast", ".", "newPackageDeclaration", "(", ")", ";", "Name", "astName", "=", "ast", ".", "newName", "(", "this", ".", "name", ")", ";", "pkgDeclaration", ".", "setName", "(", "astName", ")", ";", "return", "pkgDeclaration", ";", "}", "protected", "IJavaElement", "generateResultHandle", "(", ")", "{", "return", "getCompilationUnit", "(", ")", ".", "getPackageDeclaration", "(", "this", ".", "name", ")", ";", "}", "public", "String", "getMainTaskName", "(", ")", "{", "return", "Messages", ".", "operation_createPackageProgress", ";", "}", "protected", "void", "initializeDefaultPosition", "(", ")", "{", "try", "{", "ICompilationUnit", "cu", "=", "getCompilationUnit", "(", ")", ";", "IImportDeclaration", "[", "]", "imports", "=", "cu", ".", "getImports", "(", ")", ";", "if", "(", "imports", ".", "length", ">", "0", ")", "{", "createBefore", "(", "imports", "[", "0", "]", ")", ";", "return", ";", "}", "IType", "[", "]", "types", "=", "cu", ".", "getTypes", "(", ")", ";", "if", "(", "types", ".", "length", ">", "0", ")", "{", "createBefore", "(", "types", "[", "0", "]", ")", ";", "return", ";", "}", "}", "catch", "(", "JavaModelException", "e", ")", "{", "}", "}", "public", "IJavaModelStatus", "verify", "(", ")", "{", "IJavaModelStatus", "status", "=", "super", ".", "verify", "(", ")", ";", "if", "(", "!", "status", ".", "isOK", "(", ")", ")", "{", "return", "status", ";", "}", "IJavaProject", "project", "=", "getParentElement", "(", ")", ".", "getJavaProject", "(", ")", ";", "if", "(", "JavaConventions", ".", "validatePackageName", "(", "this", ".", "name", ",", "project", ".", "getOption", "(", "JavaCore", ".", "COMPILER_SOURCE", ",", "true", ")", ",", "project", ".", "getOption", "(", "JavaCore", ".", "COMPILER_COMPLIANCE", ",", "true", ")", ")", ".", "getSeverity", "(", ")", "==", "IStatus", ".", "ERROR", ")", "{", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INVALID_NAME", ",", "this", ".", "name", ")", ";", "}", "return", "JavaModelStatus", ".", "VERIFIED_OK", ";", "}", "}", "</s>" ]
3,686
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "java", ".", "util", ".", "zip", ".", "ZipEntry", ";", "import", "java", ".", "util", ".", "zip", ".", "ZipFile", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IContainer", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IFile", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IFolder", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "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", ".", "core", ".", "compiler", ".", "IProblem", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFileReader", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "classfmt", ".", "ClassFormatException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "IBinaryType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "IDependent", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "SuffixConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "MementoTokenizer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "ClassFile", "extends", "Openable", "implements", "IClassFile", ",", "SuffixConstants", "{", "protected", "String", "name", ";", "protected", "BinaryType", "binaryType", "=", "null", ";", "protected", "ClassFile", "(", "PackageFragment", "parent", ",", "String", "nameWithoutExtension", ")", "{", "super", "(", "parent", ")", ";", "this", ".", "name", "=", "nameWithoutExtension", ";", "}", "public", "ICompilationUnit", "becomeWorkingCopy", "(", "IProblemRequestor", "problemRequestor", ",", "WorkingCopyOwner", "owner", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "JavaModelManager", "manager", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ";", "CompilationUnit", "workingCopy", "=", "new", "ClassFileWorkingCopy", "(", "this", ",", "owner", "==", "null", "?", "DefaultWorkingCopyOwner", ".", "PRIMARY", ":", "owner", ")", ";", "JavaModelManager", ".", "PerWorkingCopyInfo", "perWorkingCopyInfo", "=", "manager", ".", "getPerWorkingCopyInfo", "(", "workingCopy", ",", "false", ",", "true", ",", "null", ")", ";", "if", "(", "perWorkingCopyInfo", "==", "null", ")", "{", "close", "(", ")", ";", "BecomeWorkingCopyOperation", "operation", "=", "new", "BecomeWorkingCopyOperation", "(", "workingCopy", ",", "problemRequestor", ")", ";", "operation", ".", "runOperation", "(", "monitor", ")", ";", "return", "workingCopy", ";", "}", "return", "perWorkingCopyInfo", ".", "workingCopy", ";", "}", "protected", "boolean", "buildStructure", "(", "OpenableElementInfo", "info", ",", "IProgressMonitor", "pm", ",", "Map", "newElements", ",", "IResource", "underlyingResource", ")", "throws", "JavaModelException", "{", "IBinaryType", "typeInfo", "=", "getBinaryTypeInfo", "(", "(", "IFile", ")", "underlyingResource", ")", ";", "if", "(", "typeInfo", "==", "null", ")", "{", "info", ".", "setChildren", "(", "new", "IJavaElement", "[", "]", "{", "}", ")", ";", "return", "false", ";", "}", "IType", "type", "=", "getType", "(", ")", ";", "info", ".", "setChildren", "(", "new", "IJavaElement", "[", "]", "{", "type", "}", ")", ";", "newElements", ".", "put", "(", "type", ",", "typeInfo", ")", ";", "(", "(", "ClassFileInfo", ")", "info", ")", ".", "readBinaryChildren", "(", "this", ",", "(", "HashMap", ")", "newElements", ",", "typeInfo", ")", ";", "return", "true", ";", "}", "public", "void", "codeComplete", "(", "int", "offset", ",", "ICompletionRequestor", "requestor", ")", "throws", "JavaModelException", "{", "codeComplete", "(", "offset", ",", "requestor", ",", "DefaultWorkingCopyOwner", ".", "PRIMARY", ")", ";", "}", "public", "void", "codeComplete", "(", "int", "offset", ",", "ICompletionRequestor", "requestor", ",", "WorkingCopyOwner", "owner", ")", "throws", "JavaModelException", "{", "if", "(", "requestor", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"\"", ")", ";", "}", "codeComplete", "(", "offset", ",", "new", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "codeassist", ".", "CompletionRequestorWrapper", "(", "requestor", ")", ",", "owner", ")", ";", "}", "public", "void", "codeComplete", "(", "int", "offset", ",", "CompletionRequestor", "requestor", ")", "throws", "JavaModelException", "{", "codeComplete", "(", "offset", ",", "requestor", ",", "DefaultWorkingCopyOwner", ".", "PRIMARY", ")", ";", "}", "public", "void", "codeComplete", "(", "int", "offset", ",", "CompletionRequestor", "requestor", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "codeComplete", "(", "offset", ",", "requestor", ",", "DefaultWorkingCopyOwner", ".", "PRIMARY", ",", "monitor", ")", ";", "}", "public", "void", "codeComplete", "(", "int", "offset", ",", "CompletionRequestor", "requestor", ",", "WorkingCopyOwner", "owner", ")", "throws", "JavaModelException", "{", "codeComplete", "(", "offset", ",", "requestor", ",", "owner", ",", "null", ")", ";", "}", "public", "void", "codeComplete", "(", "int", "offset", ",", "CompletionRequestor", "requestor", ",", "WorkingCopyOwner", "owner", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "String", "source", "=", "getSource", "(", ")", ";", "if", "(", "source", "!=", "null", ")", "{", "BinaryType", "type", "=", "(", "BinaryType", ")", "getType", "(", ")", ";", "BasicCompilationUnit", "cu", "=", "new", "BasicCompilationUnit", "(", "getSource", "(", ")", ".", "toCharArray", "(", ")", ",", "null", ",", "type", ".", "sourceFileName", "(", "(", "IBinaryType", ")", "type", ".", "getElementInfo", "(", ")", ")", ",", "getJavaProject", "(", ")", ")", ";", "codeComplete", "(", "cu", ",", "cu", ",", "offset", ",", "requestor", ",", "owner", ",", "null", ",", "monitor", ")", ";", "}", "}", "public", "IJavaElement", "[", "]", "codeSelect", "(", "int", "offset", ",", "int", "length", ")", "throws", "JavaModelException", "{", "return", "codeSelect", "(", "offset", ",", "length", ",", "DefaultWorkingCopyOwner", ".", "PRIMARY", ")", ";", "}", "public", "IJavaElement", "[", "]", "codeSelect", "(", "int", "offset", ",", "int", "length", ",", "WorkingCopyOwner", "owner", ")", "throws", "JavaModelException", "{", "IBuffer", "buffer", "=", "getBuffer", "(", ")", ";", "char", "[", "]", "contents", ";", "if", "(", "buffer", "!=", "null", "&&", "(", "contents", "=", "buffer", ".", "getCharacters", "(", ")", ")", "!=", "null", ")", "{", "BinaryType", "type", "=", "(", "BinaryType", ")", "getType", "(", ")", ";", "BasicCompilationUnit", "cu", "=", "new", "BasicCompilationUnit", "(", "contents", ",", "null", ",", "type", ".", "sourceFileName", "(", "(", "IBinaryType", ")", "type", ".", "getElementInfo", "(", ")", ")", ")", ";", "return", "super", ".", "codeSelect", "(", "cu", ",", "offset", ",", "length", ",", "owner", ")", ";", "}", "else", "{", "return", "new", "IJavaElement", "[", "]", "{", "}", ";", "}", "}", "protected", "Object", "createElementInfo", "(", ")", "{", "return", "new", "ClassFileInfo", "(", ")", ";", "}", "public", "boolean", "equals", "(", "Object", "o", ")", "{", "if", "(", "!", "(", "o", "instanceof", "ClassFile", ")", ")", "return", "false", ";", "ClassFile", "other", "=", "(", "ClassFile", ")", "o", ";", "return", "this", ".", "name", ".", "equals", "(", "other", ".", "name", ")", "&&", "this", ".", "parent", ".", "equals", "(", "other", ".", "parent", ")", ";", "}", "public", "boolean", "existsUsingJarTypeCache", "(", ")", "{", "if", "(", "getPackageFragmentRoot", "(", ")", ".", "isArchive", "(", ")", ")", "{", "JavaModelManager", "manager", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ";", "IType", "type", "=", "getType", "(", ")", ";", "Object", "info", "=", "manager", ".", "getInfo", "(", "type", ")", ";", "if", "(", "info", "==", "JavaModelCache", ".", "NON_EXISTING_JAR_TYPE_INFO", ")", "return", "false", ";", "else", "if", "(", "info", "!=", "null", ")", "return", "true", ";", "JavaElementInfo", "parentInfo", "=", "(", "JavaElementInfo", ")", "manager", ".", "getInfo", "(", "getParent", "(", ")", ")", ";", "if", "(", "parentInfo", "!=", "null", ")", "{", "IJavaElement", "[", "]", "children", "=", "parentInfo", ".", "getChildren", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "length", "=", "children", ".", "length", ";", "i", "<", "length", ";", "i", "++", ")", "{", "if", "(", "this", ".", "name", ".", "equals", "(", "(", "(", "ClassFile", ")", "children", "[", "i", "]", ")", ".", "name", ")", ")", "return", "true", ";", "}", "return", "false", ";", "}", "try", "{", "info", "=", "getJarBinaryTypeInfo", "(", "(", "PackageFragment", ")", "getParent", "(", ")", ",", "true", ")", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "}", "catch", "(", "IOException", "e", ")", "{", "}", "catch", "(", "ClassFormatException", "e", ")", "{", "}", "manager", ".", "putJarTypeInfo", "(", "type", ",", "info", "==", "null", "?", "JavaModelCache", ".", "NON_EXISTING_JAR_TYPE_INFO", ":", "info", ")", ";", "return", "info", "!=", "null", ";", "}", "else", "return", "exists", "(", ")", ";", "}", "protected", "IJavaElement", "findElement", "(", "IJavaElement", "elt", ",", "int", "position", ",", "SourceMapper", "mapper", ")", "{", "SourceRange", "range", "=", "mapper", ".", "getSourceRange", "(", "elt", ")", ";", "if", "(", "range", "==", "null", "||", "position", "<", "range", ".", "getOffset", "(", ")", "||", "range", ".", "getOffset", "(", ")", "+", "range", ".", "getLength", "(", ")", "-", "1", "<", "position", ")", "{", "return", "null", ";", "}", "if", "(", "elt", "instanceof", "IParent", ")", "{", "try", "{", "IJavaElement", "[", "]", "children", "=", "(", "(", "IParent", ")", "elt", ")", ".", "getChildren", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "children", ".", "length", ";", "i", "++", ")", "{", "IJavaElement", "match", "=", "findElement", "(", "children", "[", "i", "]", ",", "position", ",", "mapper", ")", ";", "if", "(", "match", "!=", "null", ")", "{", "return", "match", ";", "}", "}", "}", "catch", "(", "JavaModelException", "npe", ")", "{", "}", "}", "return", "elt", ";", "}", "public", "IType", "findPrimaryType", "(", ")", "{", "IType", "primaryType", "=", "getType", "(", ")", ";", "if", "(", "primaryType", ".", "exists", "(", ")", ")", "{", "return", "primaryType", ";", "}", "return", "null", ";", "}", "public", "String", "getAttachedJavadoc", "(", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "return", "getType", "(", ")", ".", "getAttachedJavadoc", "(", "monitor", ")", ";", "}", "public", "IBinaryType", "getBinaryTypeInfo", "(", "IFile", "file", ")", "throws", "JavaModelException", "{", "return", "getBinaryTypeInfo", "(", "file", ",", "true", ")", ";", "}", "public", "IBinaryType", "getBinaryTypeInfo", "(", "IFile", "file", ",", "boolean", "fullyInitialize", ")", "throws", "JavaModelException", "{", "JavaElement", "pkg", "=", "(", "JavaElement", ")", "getParent", "(", ")", ";", "if", "(", "pkg", "instanceof", "JarPackageFragment", ")", "{", "try", "{", "IBinaryType", "info", "=", "getJarBinaryTypeInfo", "(", "(", "PackageFragment", ")", "pkg", ",", "fullyInitialize", ")", ";", "if", "(", "info", "==", "null", ")", "{", "throw", "newNotPresentException", "(", ")", ";", "}", "return", "info", ";", "}", "catch", "(", "ClassFormatException", "cfe", ")", "{", "if", "(", "JavaCore", ".", "getPlugin", "(", ")", ".", "isDebugging", "(", ")", ")", "{", "cfe", ".", "printStackTrace", "(", "System", ".", "err", ")", ";", "}", "return", "null", ";", "}", "catch", "(", "IOException", "ioe", ")", "{", "throw", "new", "JavaModelException", "(", "ioe", ",", "IJavaModelStatusConstants", ".", "IO_EXCEPTION", ")", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "if", "(", "e", "instanceof", "JavaModelException", ")", "{", "throw", "(", "JavaModelException", ")", "e", ";", "}", "else", "{", "throw", "new", "JavaModelException", "(", "e", ")", ";", "}", "}", "}", "else", "{", "byte", "[", "]", "contents", "=", "Util", ".", "getResourceContentsAsByteArray", "(", "file", ")", ";", "try", "{", "return", "new", "ClassFileReader", "(", "contents", ",", "file", ".", "getFullPath", "(", ")", ".", "toString", "(", ")", ".", "toCharArray", "(", ")", ",", "fullyInitialize", ")", ";", "}", "catch", "(", "ClassFormatException", "cfe", ")", "{", "return", "null", ";", "}", "}", "}", "public", "byte", "[", "]", "getBytes", "(", ")", "throws", "JavaModelException", "{", "JavaElement", "pkg", "=", "(", "JavaElement", ")", "getParent", "(", ")", ";", "if", "(", "pkg", "instanceof", "JarPackageFragment", ")", "{", "JarPackageFragmentRoot", "root", "=", "(", "JarPackageFragmentRoot", ")", "pkg", ".", "getParent", "(", ")", ";", "ZipFile", "zip", "=", "null", ";", "try", "{", "zip", "=", "root", ".", "getJar", "(", ")", ";", "String", "entryName", "=", "Util", ".", "concatWith", "(", "(", "(", "PackageFragment", ")", "pkg", ")", ".", "names", ",", "getElementName", "(", ")", ",", "'/'", ")", ";", "ZipEntry", "ze", "=", "zip", ".", "getEntry", "(", "entryName", ")", ";", "if", "(", "ze", "!=", "null", ")", "{", "return", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "getZipEntryByteContent", "(", "ze", ",", "zip", ")", ";", "}", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "ELEMENT_DOES_NOT_EXIST", ",", "this", ")", ")", ";", "}", "catch", "(", "IOException", "ioe", ")", "{", "throw", "new", "JavaModelException", "(", "ioe", ",", "IJavaModelStatusConstants", ".", "IO_EXCEPTION", ")", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "if", "(", "e", "instanceof", "JavaModelException", ")", "{", "throw", "(", "JavaModelException", ")", "e", ";", "}", "else", "{", "throw", "new", "JavaModelException", "(", "e", ")", ";", "}", "}", "finally", "{", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "closeZipFile", "(", "zip", ")", ";", "}", "}", "else", "{", "IFile", "file", "=", "(", "IFile", ")", "resource", "(", ")", ";", "return", "Util", ".", "getResourceContentsAsByteArray", "(", "file", ")", ";", "}", "}", "private", "IBinaryType", "getJarBinaryTypeInfo", "(", "PackageFragment", "pkg", ",", "boolean", "fullyInitialize", ")", "throws", "CoreException", ",", "IOException", ",", "ClassFormatException", "{", "JarPackageFragmentRoot", "root", "=", "(", "JarPackageFragmentRoot", ")", "pkg", ".", "getParent", "(", ")", ";", "ZipFile", "zip", "=", "null", ";", "try", "{", "zip", "=", "root", ".", "getJar", "(", ")", ";", "String", "entryName", "=", "Util", ".", "concatWith", "(", "pkg", ".", "names", ",", "getElementName", "(", ")", ",", "'/'", ")", ";", "ZipEntry", "ze", "=", "zip", ".", "getEntry", "(", "entryName", ")", ";", "if", "(", "ze", "!=", "null", ")", "{", "byte", "contents", "[", "]", "=", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "getZipEntryByteContent", "(", "ze", ",", "zip", ")", ";", "String", "fileName", "=", "root", ".", "getHandleIdentifier", "(", ")", "+", "IDependent", ".", "JAR_FILE_ENTRY_SEPARATOR", "+", "entryName", ";", "return", "new", "ClassFileReader", "(", "contents", ",", "fileName", ".", "toCharArray", "(", ")", ",", "fullyInitialize", ")", ";", "}", "}", "finally", "{", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "closeZipFile", "(", "zip", ")", ";", "}", "return", "null", ";", "}", "public", "IBuffer", "getBuffer", "(", ")", "throws", "JavaModelException", "{", "IStatus", "status", "=", "validateClassFile", "(", ")", ";", "if", "(", "status", ".", "isOK", "(", ")", ")", "{", "return", "super", ".", "getBuffer", "(", ")", ";", "}", "else", "{", "Object", "info", "=", "(", "(", "ClassFile", ")", "getClassFile", "(", ")", ")", ".", "getBinaryTypeInfo", "(", "(", "IFile", ")", "resource", "(", ")", ")", ";", "IBuffer", "buffer", "=", "openBuffer", "(", "null", ",", "info", ")", ";", "if", "(", "buffer", "!=", "null", "&&", "!", "(", "buffer", "instanceof", "NullBuffer", ")", ")", "return", "buffer", ";", "switch", "(", "status", ".", "getCode", "(", ")", ")", "{", "case", "IJavaModelStatusConstants", ".", "ELEMENT_NOT_ON_CLASSPATH", ":", "case", "IJavaModelStatusConstants", ".", "INVALID_ELEMENT_TYPES", ":", "return", "null", ";", "default", ":", "throw", "new", "JavaModelException", "(", "(", "IJavaModelStatus", ")", "status", ")", ";", "}", "}", "}", "public", "IClassFile", "getClassFile", "(", ")", "{", "return", "this", ";", "}", "public", "ITypeRoot", "getTypeRoot", "(", ")", "{", "return", "this", ";", "}", "public", "IResource", "getCorrespondingResource", "(", ")", "throws", "JavaModelException", "{", "IPackageFragmentRoot", "root", "=", "(", "IPackageFragmentRoot", ")", "getParent", "(", ")", ".", "getParent", "(", ")", ";", "if", "(", "root", ".", "isArchive", "(", ")", ")", "{", "return", "null", ";", "}", "else", "{", "return", "getUnderlyingResource", "(", ")", ";", "}", "}", "public", "IJavaElement", "getElementAt", "(", "int", "position", ")", "throws", "JavaModelException", "{", "IJavaElement", "parentElement", "=", "getParent", "(", ")", ";", "while", "(", "parentElement", ".", "getElementType", "(", ")", "!=", "IJavaElement", ".", "PACKAGE_FRAGMENT_ROOT", ")", "{", "parentElement", "=", "parentElement", ".", "getParent", "(", ")", ";", "}", "PackageFragmentRoot", "root", "=", "(", "PackageFragmentRoot", ")", "parentElement", ";", "SourceMapper", "mapper", "=", "root", ".", "getSourceMapper", "(", ")", ";", "if", "(", "mapper", "==", "null", ")", "{", "return", "null", ";", "}", "else", "{", "getBuffer", "(", ")", ";", "IType", "type", "=", "getType", "(", ")", ";", "return", "findElement", "(", "type", ",", "position", ",", "mapper", ")", ";", "}", "}", "public", "IJavaElement", "getElementAtConsideringSibling", "(", "int", "position", ")", "throws", "JavaModelException", "{", "IPackageFragment", "fragment", "=", "(", "IPackageFragment", ")", "getParent", "(", ")", ";", "PackageFragmentRoot", "root", "=", "(", "PackageFragmentRoot", ")", "fragment", ".", "getAncestor", "(", "IJavaElement", ".", "PACKAGE_FRAGMENT_ROOT", ")", ";", "SourceMapper", "mapper", "=", "root", ".", "getSourceMapper", "(", ")", ";", "if", "(", "mapper", "==", "null", ")", "{", "return", "null", ";", "}", "else", "{", "int", "index", "=", "this", ".", "name", ".", "indexOf", "(", "'$'", ")", ";", "int", "prefixLength", "=", "index", "<", "0", "?", "this", ".", "name", ".", "length", "(", ")", ":", "index", ";", "IType", "type", "=", "null", ";", "int", "start", "=", "-", "1", ";", "int", "end", "=", "Integer", ".", "MAX_VALUE", ";", "IJavaElement", "[", "]", "children", "=", "fragment", ".", "getChildren", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "children", ".", "length", ";", "i", "++", ")", "{", "String", "childName", "=", "children", "[", "i", "]", ".", "getElementName", "(", ")", ";", "int", "childIndex", "=", "childName", ".", "indexOf", "(", "'$'", ")", ";", "int", "childPrefixLength", "=", "childIndex", "<", "0", "?", "childName", ".", "indexOf", "(", "'.'", ")", ":", "childIndex", ";", "if", "(", "prefixLength", "==", "childPrefixLength", "&&", "this", ".", "name", ".", "regionMatches", "(", "0", ",", "childName", ",", "0", ",", "prefixLength", ")", ")", "{", "IClassFile", "classFile", "=", "(", "IClassFile", ")", "children", "[", "i", "]", ";", "classFile", ".", "getBuffer", "(", ")", ";", "SourceRange", "range", "=", "mapper", ".", "getSourceRange", "(", "classFile", ".", "getType", "(", ")", ")", ";", "if", "(", "range", "==", "SourceMapper", ".", "UNKNOWN_RANGE", ")", "continue", ";", "int", "newStart", "=", "range", ".", "getOffset", "(", ")", ";", "int", "newEnd", "=", "newStart", "+", "range", ".", "getLength", "(", ")", "-", "1", ";", "if", "(", "newStart", ">", "start", "&&", "newEnd", "<", "end", "&&", "newStart", "<=", "position", "&&", "newEnd", ">=", "position", ")", "{", "type", "=", "classFile", ".", "getType", "(", ")", ";", "start", "=", "newStart", ";", "end", "=", "newEnd", ";", "}", "}", "}", "if", "(", "type", "!=", "null", ")", "{", "return", "findElement", "(", "type", ",", "position", ",", "mapper", ")", ";", "}", "return", "null", ";", "}", "}", "public", "String", "getElementName", "(", ")", "{", "return", "this", ".", "name", "+", "SuffixConstants", ".", "SUFFIX_STRING_class", ";", "}", "public", "int", "getElementType", "(", ")", "{", "return", "CLASS_FILE", ";", "}", "public", "IJavaElement", "getHandleFromMemento", "(", "String", "token", ",", "MementoTokenizer", "memento", ",", "WorkingCopyOwner", "owner", ")", "{", "switch", "(", "token", ".", "charAt", "(", "0", ")", ")", "{", "case", "JEM_TYPE", ":", "if", "(", "!", "memento", ".", "hasMoreTokens", "(", ")", ")", "return", "this", ";", "String", "typeName", "=", "memento", ".", "nextToken", "(", ")", ";", "JavaElement", "type", "=", "new", "BinaryType", "(", "this", ",", "typeName", ")", ";", "return", "type", ".", "getHandleFromMemento", "(", "memento", ",", "owner", ")", ";", "}", "return", "null", ";", "}", "protected", "char", "getHandleMementoDelimiter", "(", ")", "{", "return", "JavaElement", ".", "JEM_CLASSFILE", ";", "}", "public", "IPath", "getPath", "(", ")", "{", "PackageFragmentRoot", "root", "=", "getPackageFragmentRoot", "(", ")", ";", "if", "(", "root", ".", "isArchive", "(", ")", ")", "{", "return", "root", ".", "getPath", "(", ")", ";", "}", "else", "{", "return", "getParent", "(", ")", ".", "getPath", "(", ")", ".", "append", "(", "getElementName", "(", ")", ")", ";", "}", "}", "public", "IResource", "resource", "(", "PackageFragmentRoot", "root", ")", "{", "return", "(", "(", "IContainer", ")", "(", "(", "Openable", ")", "this", ".", "parent", ")", ".", "resource", "(", "root", ")", ")", ".", "getFile", "(", "new", "Path", "(", "getElementName", "(", ")", ")", ")", ";", "}", "public", "String", "getSource", "(", ")", "throws", "JavaModelException", "{", "IBuffer", "buffer", "=", "getBuffer", "(", ")", ";", "if", "(", "buffer", "==", "null", ")", "{", "return", "null", ";", "}", "return", "buffer", ".", "getContents", "(", ")", ";", "}", "public", "ISourceRange", "getSourceRange", "(", ")", "throws", "JavaModelException", "{", "IBuffer", "buffer", "=", "getBuffer", "(", ")", ";", "if", "(", "buffer", "!=", "null", ")", "{", "String", "contents", "=", "buffer", ".", "getContents", "(", ")", ";", "if", "(", "contents", "==", "null", ")", "return", "null", ";", "return", "new", "SourceRange", "(", "0", ",", "contents", ".", "length", "(", ")", ")", ";", "}", "else", "{", "return", "null", ";", "}", "}", "public", "String", "getTopLevelTypeName", "(", ")", "{", "String", "topLevelTypeName", "=", "getElementName", "(", ")", ";", "int", "firstDollar", "=", "topLevelTypeName", ".", "indexOf", "(", "'$'", ")", ";", "if", "(", "firstDollar", "!=", "-", "1", ")", "{", "topLevelTypeName", "=", "topLevelTypeName", ".", "substring", "(", "0", ",", "firstDollar", ")", ";", "}", "else", "{", "topLevelTypeName", "=", "topLevelTypeName", ".", "substring", "(", "0", ",", "topLevelTypeName", ".", "length", "(", ")", "-", "SUFFIX_CLASS", ".", "length", ")", ";", "}", "return", "topLevelTypeName", ";", "}", "public", "IType", "getType", "(", ")", "{", "if", "(", "this", ".", "binaryType", "==", "null", ")", "{", "this", ".", "binaryType", "=", "new", "BinaryType", "(", "this", ",", "getTypeName", "(", ")", ")", ";", "}", "return", "this", ".", "binaryType", ";", "}", "public", "String", "getTypeName", "(", ")", "{", "int", "lastDollar", "=", "this", ".", "name", ".", "lastIndexOf", "(", "'$'", ")", ";", "return", "lastDollar", ">", "-", "1", "?", "Util", ".", "localTypeName", "(", "this", ".", "name", ",", "lastDollar", ",", "this", ".", "name", ".", "length", "(", ")", ")", ":", "this", ".", "name", ";", "}", "public", "ICompilationUnit", "getWorkingCopy", "(", "WorkingCopyOwner", "owner", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "CompilationUnit", "workingCopy", "=", "new", "ClassFileWorkingCopy", "(", "this", ",", "owner", "==", "null", "?", "DefaultWorkingCopyOwner", ".", "PRIMARY", ":", "owner", ")", ";", "JavaModelManager", "manager", "=", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ";", "JavaModelManager", ".", "PerWorkingCopyInfo", "perWorkingCopyInfo", "=", "manager", ".", "getPerWorkingCopyInfo", "(", "workingCopy", ",", "false", ",", "true", ",", "null", ")", ";", "if", "(", "perWorkingCopyInfo", "!=", "null", ")", "{", "return", "perWorkingCopyInfo", ".", "getWorkingCopy", "(", ")", ";", "}", "BecomeWorkingCopyOperation", "op", "=", "new", "BecomeWorkingCopyOperation", "(", "workingCopy", ",", "null", ")", ";", "op", ".", "runOperation", "(", "monitor", ")", ";", "return", "workingCopy", ";", "}", "public", "IJavaElement", "getWorkingCopy", "(", "IProgressMonitor", "monitor", ",", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IBufferFactory", "factory", ")", "throws", "JavaModelException", "{", "return", "getWorkingCopy", "(", "BufferFactoryWrapper", ".", "create", "(", "factory", ")", ",", "monitor", ")", ";", "}", "protected", "boolean", "hasBuffer", "(", ")", "{", "return", "true", ";", "}", "public", "int", "hashCode", "(", ")", "{", "return", "Util", ".", "combineHashCodes", "(", "this", ".", "name", ".", "hashCode", "(", ")", ",", "this", ".", "parent", ".", "hashCode", "(", ")", ")", ";", "}", "public", "boolean", "isClass", "(", ")", "throws", "JavaModelException", "{", "return", "getType", "(", ")", ".", "isClass", "(", ")", ";", "}", "public", "boolean", "isInterface", "(", ")", "throws", "JavaModelException", "{", "return", "getType", "(", ")", ".", "isInterface", "(", ")", ";", "}", "public", "boolean", "isReadOnly", "(", ")", "{", "return", "true", ";", "}", "private", "IStatus", "validateClassFile", "(", ")", "{", "IPackageFragmentRoot", "root", "=", "getPackageFragmentRoot", "(", ")", ";", "try", "{", "if", "(", "root", ".", "getKind", "(", ")", "!=", "IPackageFragmentRoot", ".", "K_BINARY", ")", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INVALID_ELEMENT_TYPES", ",", "root", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "return", "e", ".", "getJavaModelStatus", "(", ")", ";", "}", "IJavaProject", "project", "=", "getJavaProject", "(", ")", ";", "return", "JavaConventions", ".", "validateClassFileName", "(", "getElementName", "(", ")", ",", "project", ".", "getOption", "(", "JavaCore", ".", "COMPILER_SOURCE", ",", "true", ")", ",", "project", ".", "getOption", "(", "JavaCore", ".", "COMPILER_COMPLIANCE", ",", "true", ")", ")", ";", "}", "protected", "IBuffer", "openBuffer", "(", "IProgressMonitor", "pm", ",", "Object", "info", ")", "throws", "JavaModelException", "{", "IType", "outerMostEnclosingType", "=", "getOuterMostEnclosingType", "(", ")", ";", "IBuffer", "buffer", "=", "getBufferManager", "(", ")", ".", "getBuffer", "(", "outerMostEnclosingType", ".", "getClassFile", "(", ")", ")", ";", "if", "(", "buffer", "==", "null", ")", "{", "SourceMapper", "mapper", "=", "getSourceMapper", "(", ")", ";", "IBinaryType", "typeInfo", "=", "info", "instanceof", "IBinaryType", "?", "(", "IBinaryType", ")", "info", ":", "null", ";", "if", "(", "mapper", "!=", "null", ")", "{", "buffer", "=", "mapSource", "(", "mapper", ",", "typeInfo", ",", "outerMostEnclosingType", ".", "getClassFile", "(", ")", ")", ";", "}", "}", "return", "buffer", ";", "}", "private", "IBuffer", "mapSource", "(", "SourceMapper", "mapper", ",", "IBinaryType", "info", ",", "IClassFile", "bufferOwner", ")", "{", "char", "[", "]", "contents", "=", "mapper", ".", "findSource", "(", "getType", "(", ")", ",", "info", ")", ";", "if", "(", "contents", "!=", "null", ")", "{", "IBuffer", "buffer", "=", "BufferManager", ".", "createBuffer", "(", "bufferOwner", ")", ";", "if", "(", "buffer", "==", "null", ")", "return", "null", ";", "BufferManager", "bufManager", "=", "getBufferManager", "(", ")", ";", "bufManager", ".", "addBuffer", "(", "buffer", ")", ";", "if", "(", "buffer", ".", "getCharacters", "(", ")", "==", "null", ")", "{", "buffer", ".", "setContents", "(", "contents", ")", ";", "}", "buffer", ".", "addBufferChangedListener", "(", "this", ")", ";", "mapper", ".", "mapSource", "(", "getOuterMostEnclosingType", "(", ")", ",", "contents", ",", "info", ")", ";", "return", "buffer", ";", "}", "else", "{", "IBuffer", "buffer", "=", "BufferManager", ".", "createNullBuffer", "(", "bufferOwner", ")", ";", "if", "(", "buffer", "==", "null", ")", "return", "null", ";", "BufferManager", "bufManager", "=", "getBufferManager", "(", ")", ";", "bufManager", ".", "addBuffer", "(", "buffer", ")", ";", "buffer", ".", "addBufferChangedListener", "(", "this", ")", ";", "return", "buffer", ";", "}", "}", "static", "String", "simpleName", "(", "char", "[", "]", "className", ")", "{", "if", "(", "className", "==", "null", ")", "return", "null", ";", "String", "simpleName", "=", "new", "String", "(", "unqualifiedName", "(", "className", ")", ")", ";", "int", "lastDollar", "=", "simpleName", ".", "lastIndexOf", "(", "'$'", ")", ";", "if", "(", "lastDollar", "!=", "-", "1", ")", "return", "Util", ".", "localTypeName", "(", "simpleName", ",", "lastDollar", ",", "simpleName", ".", "length", "(", ")", ")", ";", "else", "return", "simpleName", ";", "}", "private", "IType", "getOuterMostEnclosingType", "(", ")", "{", "IType", "type", "=", "getType", "(", ")", ";", "IType", "enclosingType", "=", "type", ".", "getDeclaringType", "(", ")", ";", "while", "(", "enclosingType", "!=", "null", ")", "{", "type", "=", "enclosingType", ";", "enclosingType", "=", "type", ".", "getDeclaringType", "(", ")", ";", "}", "return", "type", ";", "}", "public", "static", "char", "[", "]", "translatedName", "(", "char", "[", "]", "name", ")", "{", "if", "(", "name", "==", "null", ")", "return", "null", ";", "int", "nameLength", "=", "name", ".", "length", ";", "char", "[", "]", "newName", "=", "new", "char", "[", "nameLength", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "nameLength", ";", "i", "++", ")", "{", "if", "(", "name", "[", "i", "]", "==", "'/'", ")", "{", "newName", "[", "i", "]", "=", "'.'", ";", "}", "else", "{", "newName", "[", "i", "]", "=", "name", "[", "i", "]", ";", "}", "}", "return", "newName", ";", "}", "static", "char", "[", "]", "[", "]", "translatedNames", "(", "char", "[", "]", "[", "]", "names", ")", "{", "if", "(", "names", "==", "null", ")", "return", "null", ";", "int", "length", "=", "names", ".", "length", ";", "char", "[", "]", "[", "]", "newNames", "=", "new", "char", "[", "length", "]", "[", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "newNames", "[", "i", "]", "=", "translatedName", "(", "names", "[", "i", "]", ")", ";", "}", "return", "newNames", ";", "}", "static", "char", "[", "]", "unqualifiedName", "(", "char", "[", "]", "className", ")", "{", "if", "(", "className", "==", "null", ")", "return", "null", ";", "int", "count", "=", "0", ";", "for", "(", "int", "i", "=", "className", ".", "length", "-", "1", ";", "i", ">", "-", "1", ";", "i", "--", ")", "{", "if", "(", "className", "[", "i", "]", "==", "'/'", ")", "{", "char", "[", "]", "name", "=", "new", "char", "[", "count", "]", ";", "System", ".", "arraycopy", "(", "className", ",", "i", "+", "1", ",", "name", ",", "0", ",", "count", ")", ";", "return", "name", ";", "}", "count", "++", ";", "}", "return", "className", ";", "}", "public", "void", "codeComplete", "(", "int", "offset", ",", "final", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICodeCompletionRequestor", "requestor", ")", "throws", "JavaModelException", "{", "if", "(", "requestor", "==", "null", ")", "{", "codeComplete", "(", "offset", ",", "(", "ICompletionRequestor", ")", "null", ")", ";", "return", ";", "}", "codeComplete", "(", "offset", ",", "new", "ICompletionRequestor", "(", ")", "{", "public", "void", "acceptAnonymousType", "(", "char", "[", "]", "superTypePackageName", ",", "char", "[", "]", "superTypeName", ",", "char", "[", "]", "[", "]", "parameterPackageNames", ",", "char", "[", "]", "[", "]", "parameterTypeNames", ",", "char", "[", "]", "[", "]", "parameterNames", ",", "char", "[", "]", "completionName", ",", "int", "modifiers", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", "{", "}", "public", "void", "acceptClass", "(", "char", "[", "]", "packageName", ",", "char", "[", "]", "className", ",", "char", "[", "]", "completionName", ",", "int", "modifiers", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", "{", "requestor", ".", "acceptClass", "(", "packageName", ",", "className", ",", "completionName", ",", "modifiers", ",", "completionStart", ",", "completionEnd", ")", ";", "}", "public", "void", "acceptError", "(", "IProblem", "error", ")", "{", "}", "public", "void", "acceptField", "(", "char", "[", "]", "declaringTypePackageName", ",", "char", "[", "]", "declaringTypeName", ",", "char", "[", "]", "fieldName", ",", "char", "[", "]", "typePackageName", ",", "char", "[", "]", "typeName", ",", "char", "[", "]", "completionName", ",", "int", "modifiers", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", "{", "requestor", ".", "acceptField", "(", "declaringTypePackageName", ",", "declaringTypeName", ",", "fieldName", ",", "typePackageName", ",", "typeName", ",", "completionName", ",", "modifiers", ",", "completionStart", ",", "completionEnd", ")", ";", "}", "public", "void", "acceptInterface", "(", "char", "[", "]", "packageName", ",", "char", "[", "]", "interfaceName", ",", "char", "[", "]", "completionName", ",", "int", "modifiers", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", "{", "requestor", ".", "acceptInterface", "(", "packageName", ",", "interfaceName", ",", "completionName", ",", "modifiers", ",", "completionStart", ",", "completionEnd", ")", ";", "}", "public", "void", "acceptKeyword", "(", "char", "[", "]", "keywordName", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", "{", "requestor", ".", "acceptKeyword", "(", "keywordName", ",", "completionStart", ",", "completionEnd", ")", ";", "}", "public", "void", "acceptLabel", "(", "char", "[", "]", "labelName", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", "{", "requestor", ".", "acceptLabel", "(", "labelName", ",", "completionStart", ",", "completionEnd", ")", ";", "}", "public", "void", "acceptLocalVariable", "(", "char", "[", "]", "localVarName", ",", "char", "[", "]", "typePackageName", ",", "char", "[", "]", "typeName", ",", "int", "modifiers", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", "{", "}", "public", "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", ")", "{", "requestor", ".", "acceptMethod", "(", "declaringTypePackageName", ",", "declaringTypeName", ",", "selector", ",", "parameterPackageNames", ",", "parameterTypeNames", ",", "returnTypePackageName", ",", "returnTypeName", ",", "completionName", ",", "modifiers", ",", "completionStart", ",", "completionEnd", ")", ";", "}", "public", "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", ")", "{", "}", "public", "void", "acceptModifier", "(", "char", "[", "]", "modifierName", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", "{", "requestor", ".", "acceptModifier", "(", "modifierName", ",", "completionStart", ",", "completionEnd", ")", ";", "}", "public", "void", "acceptPackage", "(", "char", "[", "]", "packageName", ",", "char", "[", "]", "completionName", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", "{", "requestor", ".", "acceptPackage", "(", "packageName", ",", "completionName", ",", "completionStart", ",", "completionEnd", ")", ";", "}", "public", "void", "acceptType", "(", "char", "[", "]", "packageName", ",", "char", "[", "]", "typeName", ",", "char", "[", "]", "completionName", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", "{", "requestor", ".", "acceptType", "(", "packageName", ",", "typeName", ",", "completionName", ",", "completionStart", ",", "completionEnd", ")", ";", "}", "public", "void", "acceptVariableName", "(", "char", "[", "]", "typePackageName", ",", "char", "[", "]", "typeName", ",", "char", "[", "]", "varName", ",", "char", "[", "]", "completionName", ",", "int", "completionStart", ",", "int", "completionEnd", ",", "int", "relevance", ")", "{", "}", "}", ")", ";", "}", "protected", "IStatus", "validateExistence", "(", "IResource", "underlyingResource", ")", "{", "IStatus", "status", "=", "validateClassFile", "(", ")", ";", "if", "(", "!", "status", ".", "isOK", "(", ")", ")", "return", "status", ";", "if", "(", "underlyingResource", "!=", "null", ")", "{", "if", "(", "!", "underlyingResource", ".", "isAccessible", "(", ")", ")", "return", "newDoesNotExistStatus", "(", ")", ";", "PackageFragmentRoot", "root", ";", "if", "(", "(", "underlyingResource", "instanceof", "IFolder", ")", "&&", "(", "root", "=", "getPackageFragmentRoot", "(", ")", ")", ".", "isArchive", "(", ")", ")", "{", "return", "root", ".", "newDoesNotExistStatus", "(", ")", ";", "}", "}", "return", "JavaModelStatus", ".", "VERIFIED_OK", ";", "}", "public", "ISourceRange", "getNameRange", "(", ")", "{", "return", "null", ";", "}", "}", "</s>" ]
3,687
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "public", "class", "SourceFieldWithChildrenInfo", "extends", "SourceFieldElementInfo", "{", "protected", "IJavaElement", "[", "]", "children", ";", "public", "SourceFieldWithChildrenInfo", "(", "IJavaElement", "[", "]", "children", ")", "{", "this", ".", "children", "=", "children", ";", "}", "public", "IJavaElement", "[", "]", "getChildren", "(", ")", "{", "return", "this", ".", "children", ";", "}", "}", "</s>" ]
3,688
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "util", ".", "zip", ".", "ZipFile", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Path", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "PlatformObject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJarEntryResource", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IPackageFragment", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IPackageFragmentRoot", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "abstract", "class", "JarEntryResource", "extends", "PlatformObject", "implements", "IJarEntryResource", "{", "protected", "Object", "parent", ";", "protected", "String", "simpleName", ";", "public", "JarEntryResource", "(", "String", "simpleName", ")", "{", "this", ".", "simpleName", "=", "simpleName", ";", "}", "public", "abstract", "JarEntryResource", "clone", "(", "Object", "newParent", ")", ";", "public", "boolean", "equals", "(", "Object", "obj", ")", "{", "if", "(", "!", "(", "obj", "instanceof", "JarEntryResource", ")", ")", "return", "false", ";", "JarEntryResource", "other", "=", "(", "JarEntryResource", ")", "obj", ";", "return", "this", ".", "parent", ".", "equals", "(", "other", ".", "parent", ")", "&&", "this", ".", "simpleName", ".", "equals", "(", "other", ".", "simpleName", ")", ";", "}", "protected", "String", "getEntryName", "(", ")", "{", "String", "parentEntryName", ";", "if", "(", "this", ".", "parent", "instanceof", "IPackageFragment", ")", "{", "String", "elementName", "=", "(", "(", "IPackageFragment", ")", "this", ".", "parent", ")", ".", "getElementName", "(", ")", ";", "parentEntryName", "=", "elementName", ".", "length", "(", ")", "==", "0", "?", "\"\"", ":", "elementName", ".", "replace", "(", "'.'", ",", "'/'", ")", "+", "'/'", ";", "}", "else", "if", "(", "this", ".", "parent", "instanceof", "IPackageFragmentRoot", ")", "{", "parentEntryName", "=", "\"\"", ";", "}", "else", "{", "parentEntryName", "=", "(", "(", "JarEntryDirectory", ")", "this", ".", "parent", ")", ".", "getEntryName", "(", ")", "+", "'/'", ";", "}", "return", "parentEntryName", "+", "this", ".", "simpleName", ";", "}", "public", "IPath", "getFullPath", "(", ")", "{", "return", "new", "Path", "(", "getEntryName", "(", ")", ")", ".", "makeAbsolute", "(", ")", ";", "}", "public", "String", "getName", "(", ")", "{", "return", "this", ".", "simpleName", ";", "}", "public", "Object", "getParent", "(", ")", "{", "return", "this", ".", "parent", ";", "}", "public", "IPackageFragmentRoot", "getPackageFragmentRoot", "(", ")", "{", "if", "(", "this", ".", "parent", "instanceof", "IPackageFragment", ")", "{", "return", "(", "IPackageFragmentRoot", ")", "(", "(", "IPackageFragment", ")", "this", ".", "parent", ")", ".", "getParent", "(", ")", ";", "}", "else", "if", "(", "this", ".", "parent", "instanceof", "IPackageFragmentRoot", ")", "{", "return", "(", "IPackageFragmentRoot", ")", "this", ".", "parent", ";", "}", "else", "{", "return", "(", "(", "JarEntryDirectory", ")", "this", ".", "parent", ")", ".", "getPackageFragmentRoot", "(", ")", ";", "}", "}", "protected", "ZipFile", "getZipFile", "(", ")", "throws", "CoreException", "{", "if", "(", "this", ".", "parent", "instanceof", "IPackageFragment", ")", "{", "JarPackageFragmentRoot", "root", "=", "(", "JarPackageFragmentRoot", ")", "(", "(", "IPackageFragment", ")", "this", ".", "parent", ")", ".", "getParent", "(", ")", ";", "return", "root", ".", "getJar", "(", ")", ";", "}", "else", "if", "(", "this", ".", "parent", "instanceof", "JarPackageFragmentRoot", ")", "{", "return", "(", "(", "JarPackageFragmentRoot", ")", "this", ".", "parent", ")", ".", "getJar", "(", ")", ";", "}", "else", "return", "(", "(", "JarEntryDirectory", ")", "this", ".", "parent", ")", ".", "getZipFile", "(", ")", ";", "}", "public", "int", "hashCode", "(", ")", "{", "return", "Util", ".", "combineHashCodes", "(", "this", ".", "simpleName", ".", "hashCode", "(", ")", ",", "this", ".", "parent", ".", "hashCode", "(", ")", ")", ";", "}", "public", "boolean", "isReadOnly", "(", ")", "{", "return", "true", ";", "}", "public", "void", "setParent", "(", "Object", "parent", ")", "{", "this", ".", "parent", "=", "parent", ";", "}", "}", "</s>" ]
3,689
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Messages", ";", "public", "class", "MoveElementsOperation", "extends", "CopyElementsOperation", "{", "public", "MoveElementsOperation", "(", "IJavaElement", "[", "]", "elementsToMove", ",", "IJavaElement", "[", "]", "destContainers", ",", "boolean", "force", ")", "{", "super", "(", "elementsToMove", ",", "destContainers", ",", "force", ")", ";", "}", "protected", "String", "getMainTaskName", "(", ")", "{", "return", "Messages", ".", "operation_moveElementProgress", ";", "}", "protected", "boolean", "isMove", "(", ")", "{", "return", "true", ";", "}", "}", "</s>" ]
3,690
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IBuffer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "WorkingCopyOwner", ";", "public", "class", "BufferFactoryWrapper", "extends", "WorkingCopyOwner", "{", "public", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IBufferFactory", "factory", ";", "private", "BufferFactoryWrapper", "(", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IBufferFactory", "factory", ")", "{", "this", ".", "factory", "=", "factory", ";", "}", "public", "static", "WorkingCopyOwner", "create", "(", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IBufferFactory", "factory", ")", "{", "return", "new", "BufferFactoryWrapper", "(", "factory", ")", ";", "}", "public", "IBuffer", "createBuffer", "(", "ICompilationUnit", "workingCopy", ")", "{", "if", "(", "this", ".", "factory", "==", "null", ")", "return", "super", ".", "createBuffer", "(", "workingCopy", ")", ";", "return", "this", ".", "factory", ".", "createBuffer", "(", "workingCopy", ")", ";", "}", "public", "boolean", "equals", "(", "Object", "obj", ")", "{", "if", "(", "!", "(", "obj", "instanceof", "BufferFactoryWrapper", ")", ")", "return", "false", ";", "BufferFactoryWrapper", "other", "=", "(", "BufferFactoryWrapper", ")", "obj", ";", "if", "(", "this", ".", "factory", "==", "null", ")", "return", "other", ".", "factory", "==", "null", ";", "return", "this", ".", "factory", ".", "equals", "(", "other", ".", "factory", ")", ";", "}", "public", "int", "hashCode", "(", ")", "{", "if", "(", "this", ".", "factory", "==", "null", ")", "return", "0", ";", "return", "this", ".", "factory", ".", "hashCode", "(", ")", ";", "}", "public", "String", "toString", "(", ")", "{", "return", "\"\"", "+", "this", ".", "factory", ";", "}", "}", "</s>" ]
3,691
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "ASTNode", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "dom", ".", "CompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "DOMFinder", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "MementoTokenizer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Messages", ";", "public", "abstract", "class", "SourceRefElement", "extends", "JavaElement", "implements", "ISourceReference", "{", "public", "int", "occurrenceCount", "=", "1", ";", "protected", "SourceRefElement", "(", "JavaElement", "parent", ")", "{", "super", "(", "parent", ")", ";", "}", "protected", "void", "closing", "(", "Object", "info", ")", "throws", "JavaModelException", "{", "}", "protected", "Object", "createElementInfo", "(", ")", "{", "return", "null", ";", "}", "public", "void", "copy", "(", "IJavaElement", "container", ",", "IJavaElement", "sibling", ",", "String", "rename", ",", "boolean", "force", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "if", "(", "container", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "Messages", ".", "operation_nullContainer", ")", ";", "}", "IJavaElement", "[", "]", "elements", "=", "new", "IJavaElement", "[", "]", "{", "this", "}", ";", "IJavaElement", "[", "]", "containers", "=", "new", "IJavaElement", "[", "]", "{", "container", "}", ";", "IJavaElement", "[", "]", "siblings", "=", "null", ";", "if", "(", "sibling", "!=", "null", ")", "{", "siblings", "=", "new", "IJavaElement", "[", "]", "{", "sibling", "}", ";", "}", "String", "[", "]", "renamings", "=", "null", ";", "if", "(", "rename", "!=", "null", ")", "{", "renamings", "=", "new", "String", "[", "]", "{", "rename", "}", ";", "}", "getJavaModel", "(", ")", ".", "copy", "(", "elements", ",", "containers", ",", "siblings", ",", "renamings", ",", "force", ",", "monitor", ")", ";", "}", "public", "void", "delete", "(", "boolean", "force", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "IJavaElement", "[", "]", "elements", "=", "new", "IJavaElement", "[", "]", "{", "this", "}", ";", "getJavaModel", "(", ")", ".", "delete", "(", "elements", ",", "force", ",", "monitor", ")", ";", "}", "public", "boolean", "equals", "(", "Object", "o", ")", "{", "if", "(", "!", "(", "o", "instanceof", "SourceRefElement", ")", ")", "return", "false", ";", "return", "this", ".", "occurrenceCount", "==", "(", "(", "SourceRefElement", ")", "o", ")", ".", "occurrenceCount", "&&", "super", ".", "equals", "(", "o", ")", ";", "}", "public", "ASTNode", "findNode", "(", "CompilationUnit", "ast", ")", "{", "DOMFinder", "finder", "=", "new", "DOMFinder", "(", "ast", ",", "this", ",", "false", ")", ";", "try", "{", "return", "finder", ".", "search", "(", ")", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "return", "null", ";", "}", "}", "protected", "void", "generateInfos", "(", "Object", "info", ",", "HashMap", "newElements", ",", "IProgressMonitor", "pm", ")", "throws", "JavaModelException", "{", "Openable", "openableParent", "=", "(", "Openable", ")", "getOpenableParent", "(", ")", ";", "if", "(", "openableParent", "==", "null", ")", "return", ";", "JavaElementInfo", "openableParentInfo", "=", "(", "JavaElementInfo", ")", "JavaModelManager", ".", "getJavaModelManager", "(", ")", ".", "getInfo", "(", "openableParent", ")", ";", "if", "(", "openableParentInfo", "==", "null", ")", "{", "openableParent", ".", "generateInfos", "(", "openableParent", ".", "createElementInfo", "(", ")", ",", "newElements", ",", "pm", ")", ";", "}", "}", "public", "IAnnotation", "getAnnotation", "(", "String", "name", ")", "{", "return", "new", "Annotation", "(", "this", ",", "name", ")", ";", "}", "public", "IAnnotation", "[", "]", "getAnnotations", "(", ")", "throws", "JavaModelException", "{", "AnnotatableInfo", "info", "=", "(", "AnnotatableInfo", ")", "getElementInfo", "(", ")", ";", "return", "info", ".", "annotations", ";", "}", "public", "ICompilationUnit", "getCompilationUnit", "(", ")", "{", "return", "(", "ICompilationUnit", ")", "getAncestor", "(", "COMPILATION_UNIT", ")", ";", "}", "public", "IResource", "getCorrespondingResource", "(", ")", "throws", "JavaModelException", "{", "if", "(", "!", "exists", "(", ")", ")", "throw", "newNotPresentException", "(", ")", ";", "return", "null", ";", "}", "public", "IJavaElement", "getHandleFromMemento", "(", "String", "token", ",", "MementoTokenizer", "memento", ",", "WorkingCopyOwner", "workingCopyOwner", ")", "{", "switch", "(", "token", ".", "charAt", "(", "0", ")", ")", "{", "case", "JEM_COUNT", ":", "return", "getHandleUpdatingCountFromMemento", "(", "memento", ",", "workingCopyOwner", ")", ";", "}", "return", "this", ";", "}", "protected", "void", "getHandleMemento", "(", "StringBuffer", "buff", ")", "{", "super", ".", "getHandleMemento", "(", "buff", ")", ";", "if", "(", "this", ".", "occurrenceCount", ">", "1", ")", "{", "buff", ".", "append", "(", "JEM_COUNT", ")", ";", "buff", ".", "append", "(", "this", ".", "occurrenceCount", ")", ";", "}", "}", "public", "IJavaElement", "getHandleUpdatingCountFromMemento", "(", "MementoTokenizer", "memento", ",", "WorkingCopyOwner", "owner", ")", "{", "if", "(", "!", "memento", ".", "hasMoreTokens", "(", ")", ")", "return", "this", ";", "this", ".", "occurrenceCount", "=", "Integer", ".", "parseInt", "(", "memento", ".", "nextToken", "(", ")", ")", ";", "if", "(", "!", "memento", ".", "hasMoreTokens", "(", ")", ")", "return", "this", ";", "String", "token", "=", "memento", ".", "nextToken", "(", ")", ";", "return", "getHandleFromMemento", "(", "token", ",", "memento", ",", "owner", ")", ";", "}", "public", "int", "getOccurrenceCount", "(", ")", "{", "return", "this", ".", "occurrenceCount", ";", "}", "public", "IOpenable", "getOpenableParent", "(", ")", "{", "IJavaElement", "current", "=", "getParent", "(", ")", ";", "while", "(", "current", "!=", "null", ")", "{", "if", "(", "current", "instanceof", "IOpenable", ")", "{", "return", "(", "IOpenable", ")", "current", ";", "}", "current", "=", "current", ".", "getParent", "(", ")", ";", "}", "return", "null", ";", "}", "public", "IPath", "getPath", "(", ")", "{", "return", "getParent", "(", ")", ".", "getPath", "(", ")", ";", "}", "public", "IResource", "resource", "(", ")", "{", "return", "this", ".", "parent", ".", "resource", "(", ")", ";", "}", "public", "String", "getSource", "(", ")", "throws", "JavaModelException", "{", "IOpenable", "openable", "=", "getOpenableParent", "(", ")", ";", "IBuffer", "buffer", "=", "openable", ".", "getBuffer", "(", ")", ";", "if", "(", "buffer", "==", "null", ")", "{", "return", "null", ";", "}", "ISourceRange", "range", "=", "getSourceRange", "(", ")", ";", "int", "offset", "=", "range", ".", "getOffset", "(", ")", ";", "int", "length", "=", "range", ".", "getLength", "(", ")", ";", "if", "(", "offset", "==", "-", "1", "||", "length", "==", "0", ")", "{", "return", "null", ";", "}", "try", "{", "return", "buffer", ".", "getText", "(", "offset", ",", "length", ")", ";", "}", "catch", "(", "RuntimeException", "e", ")", "{", "return", "null", ";", "}", "}", "public", "ISourceRange", "getSourceRange", "(", ")", "throws", "JavaModelException", "{", "SourceRefElementInfo", "info", "=", "(", "SourceRefElementInfo", ")", "getElementInfo", "(", ")", ";", "return", "info", ".", "getSourceRange", "(", ")", ";", "}", "public", "IResource", "getUnderlyingResource", "(", ")", "throws", "JavaModelException", "{", "if", "(", "!", "exists", "(", ")", ")", "throw", "newNotPresentException", "(", ")", ";", "return", "getParent", "(", ")", ".", "getUnderlyingResource", "(", ")", ";", "}", "public", "boolean", "hasChildren", "(", ")", "throws", "JavaModelException", "{", "return", "getChildren", "(", ")", ".", "length", ">", "0", ";", "}", "public", "boolean", "isStructureKnown", "(", ")", "throws", "JavaModelException", "{", "return", "true", ";", "}", "public", "void", "move", "(", "IJavaElement", "container", ",", "IJavaElement", "sibling", ",", "String", "rename", ",", "boolean", "force", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "if", "(", "container", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "Messages", ".", "operation_nullContainer", ")", ";", "}", "IJavaElement", "[", "]", "elements", "=", "new", "IJavaElement", "[", "]", "{", "this", "}", ";", "IJavaElement", "[", "]", "containers", "=", "new", "IJavaElement", "[", "]", "{", "container", "}", ";", "IJavaElement", "[", "]", "siblings", "=", "null", ";", "if", "(", "sibling", "!=", "null", ")", "{", "siblings", "=", "new", "IJavaElement", "[", "]", "{", "sibling", "}", ";", "}", "String", "[", "]", "renamings", "=", "null", ";", "if", "(", "rename", "!=", "null", ")", "{", "renamings", "=", "new", "String", "[", "]", "{", "rename", "}", ";", "}", "getJavaModel", "(", ")", ".", "move", "(", "elements", ",", "containers", ",", "siblings", ",", "renamings", ",", "force", ",", "monitor", ")", ";", "}", "public", "void", "rename", "(", "String", "newName", ",", "boolean", "force", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "if", "(", "newName", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "Messages", ".", "element_nullName", ")", ";", "}", "IJavaElement", "[", "]", "elements", "=", "new", "IJavaElement", "[", "]", "{", "this", "}", ";", "IJavaElement", "[", "]", "dests", "=", "new", "IJavaElement", "[", "]", "{", "getParent", "(", ")", "}", ";", "String", "[", "]", "renamings", "=", "new", "String", "[", "]", "{", "newName", "}", ";", "getJavaModel", "(", ")", ".", "rename", "(", "elements", ",", "dests", ",", "renamings", ",", "force", ",", "monitor", ")", ";", "}", "protected", "void", "toStringName", "(", "StringBuffer", "buffer", ")", "{", "super", ".", "toStringName", "(", "buffer", ")", ";", "if", "(", "this", ".", "occurrenceCount", ">", "1", ")", "{", "buffer", ".", "append", "(", "\"#\"", ")", ";", "buffer", ".", "append", "(", "this", ".", "occurrenceCount", ")", ";", "}", "}", "}", "</s>" ]
3,692
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IParent", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IRegion", ";", "public", "class", "Region", "implements", "IRegion", "{", "protected", "ArrayList", "rootElements", ";", "public", "Region", "(", ")", "{", "this", ".", "rootElements", "=", "new", "ArrayList", "(", "1", ")", ";", "}", "public", "void", "add", "(", "IJavaElement", "element", ")", "{", "if", "(", "!", "contains", "(", "element", ")", ")", "{", "removeAllChildren", "(", "element", ")", ";", "this", ".", "rootElements", ".", "add", "(", "element", ")", ";", "this", ".", "rootElements", ".", "trimToSize", "(", ")", ";", "}", "}", "public", "boolean", "contains", "(", "IJavaElement", "element", ")", "{", "int", "size", "=", "this", ".", "rootElements", ".", "size", "(", ")", ";", "ArrayList", "parents", "=", "getAncestors", "(", "element", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "IJavaElement", "aTop", "=", "(", "IJavaElement", ")", "this", ".", "rootElements", ".", "get", "(", "i", ")", ";", "if", "(", "aTop", ".", "equals", "(", "element", ")", ")", "{", "return", "true", ";", "}", "for", "(", "int", "j", "=", "0", ",", "pSize", "=", "parents", ".", "size", "(", ")", ";", "j", "<", "pSize", ";", "j", "++", ")", "{", "if", "(", "aTop", ".", "equals", "(", "parents", ".", "get", "(", "j", ")", ")", ")", "{", "return", "true", ";", "}", "}", "}", "return", "false", ";", "}", "private", "ArrayList", "getAncestors", "(", "IJavaElement", "element", ")", "{", "ArrayList", "parents", "=", "new", "ArrayList", "(", ")", ";", "IJavaElement", "parent", "=", "element", ".", "getParent", "(", ")", ";", "while", "(", "parent", "!=", "null", ")", "{", "parents", ".", "add", "(", "parent", ")", ";", "parent", "=", "parent", ".", "getParent", "(", ")", ";", "}", "parents", ".", "trimToSize", "(", ")", ";", "return", "parents", ";", "}", "public", "IJavaElement", "[", "]", "getElements", "(", ")", "{", "int", "size", "=", "this", ".", "rootElements", ".", "size", "(", ")", ";", "IJavaElement", "[", "]", "roots", "=", "new", "IJavaElement", "[", "size", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "roots", "[", "i", "]", "=", "(", "IJavaElement", ")", "this", ".", "rootElements", ".", "get", "(", "i", ")", ";", "}", "return", "roots", ";", "}", "public", "boolean", "remove", "(", "IJavaElement", "element", ")", "{", "removeAllChildren", "(", "element", ")", ";", "return", "this", ".", "rootElements", ".", "remove", "(", "element", ")", ";", "}", "protected", "void", "removeAllChildren", "(", "IJavaElement", "element", ")", "{", "if", "(", "element", "instanceof", "IParent", ")", "{", "ArrayList", "newRootElements", "=", "new", "ArrayList", "(", ")", ";", "for", "(", "int", "i", "=", "0", ",", "size", "=", "this", ".", "rootElements", ".", "size", "(", ")", ";", "i", "<", "size", ";", "i", "++", ")", "{", "IJavaElement", "currentRoot", "=", "(", "IJavaElement", ")", "this", ".", "rootElements", ".", "get", "(", "i", ")", ";", "IJavaElement", "parent", "=", "currentRoot", ".", "getParent", "(", ")", ";", "boolean", "isChild", "=", "false", ";", "while", "(", "parent", "!=", "null", ")", "{", "if", "(", "parent", ".", "equals", "(", "element", ")", ")", "{", "isChild", "=", "true", ";", "break", ";", "}", "parent", "=", "parent", ".", "getParent", "(", ")", ";", "}", "if", "(", "!", "isChild", ")", "{", "newRootElements", ".", "add", "(", "currentRoot", ")", ";", "}", "}", "this", ".", "rootElements", "=", "newRootElements", ";", "}", "}", "public", "String", "toString", "(", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "IJavaElement", "[", "]", "roots", "=", "getElements", "(", ")", ";", "buffer", ".", "append", "(", "'['", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "roots", ".", "length", ";", "i", "++", ")", "{", "buffer", ".", "append", "(", "roots", "[", "i", "]", ".", "getElementName", "(", ")", ")", ";", "if", "(", "i", "<", "(", "roots", ".", "length", "-", "1", ")", ")", "{", "buffer", ".", "append", "(", "\",", "\"", ")", ";", "}", "}", "buffer", ".", "append", "(", "']'", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "}", "</s>" ]
3,693
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "io", ".", "ByteArrayInputStream", ";", "import", "java", ".", "io", ".", "UnsupportedEncodingException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IFile", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IWorkspace", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "jobs", ".", "ISchedulingRule", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IBuffer", ";", "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", ".", "IJavaProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaCore", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Messages", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "CommitWorkingCopyOperation", "extends", "JavaModelOperation", "{", "public", "CommitWorkingCopyOperation", "(", "ICompilationUnit", "element", ",", "boolean", "force", ")", "{", "super", "(", "new", "IJavaElement", "[", "]", "{", "element", "}", ",", "force", ")", ";", "}", "protected", "void", "executeOperation", "(", ")", "throws", "JavaModelException", "{", "try", "{", "beginTask", "(", "Messages", ".", "workingCopy_commit", ",", "2", ")", ";", "CompilationUnit", "workingCopy", "=", "getCompilationUnit", "(", ")", ";", "if", "(", "ExternalJavaProject", ".", "EXTERNAL_PROJECT_NAME", ".", "equals", "(", "workingCopy", ".", "getJavaProject", "(", ")", ".", "getElementName", "(", ")", ")", ")", "{", "workingCopy", ".", "getBuffer", "(", ")", ".", "save", "(", "this", ".", "progressMonitor", ",", "this", ".", "force", ")", ";", "return", ";", "}", "ICompilationUnit", "primary", "=", "workingCopy", ".", "getPrimary", "(", ")", ";", "boolean", "isPrimary", "=", "workingCopy", ".", "isPrimary", "(", ")", ";", "JavaElementDeltaBuilder", "deltaBuilder", "=", "null", ";", "PackageFragmentRoot", "root", "=", "(", "PackageFragmentRoot", ")", "workingCopy", ".", "getAncestor", "(", "IJavaElement", ".", "PACKAGE_FRAGMENT_ROOT", ")", ";", "boolean", "isIncluded", "=", "!", "Util", ".", "isExcluded", "(", "workingCopy", ")", ";", "IFile", "resource", "=", "(", "IFile", ")", "workingCopy", ".", "getResource", "(", ")", ";", "IJavaProject", "project", "=", "root", ".", "getJavaProject", "(", ")", ";", "if", "(", "isPrimary", "||", "(", "root", ".", "validateOnClasspath", "(", ")", ".", "isOK", "(", ")", "&&", "isIncluded", "&&", "resource", ".", "isAccessible", "(", ")", "&&", "Util", ".", "isValidCompilationUnitName", "(", "workingCopy", ".", "getElementName", "(", ")", ",", "project", ".", "getOption", "(", "JavaCore", ".", "COMPILER_SOURCE", ",", "true", ")", ",", "project", ".", "getOption", "(", "JavaCore", ".", "COMPILER_COMPLIANCE", ",", "true", ")", ")", ")", ")", "{", "if", "(", "!", "isPrimary", "&&", "!", "primary", ".", "isOpen", "(", ")", ")", "{", "primary", ".", "open", "(", "null", ")", ";", "}", "if", "(", "isIncluded", "&&", "(", "!", "isPrimary", "||", "!", "workingCopy", ".", "isConsistent", "(", ")", ")", ")", "{", "deltaBuilder", "=", "new", "JavaElementDeltaBuilder", "(", "primary", ")", ";", "}", "IBuffer", "primaryBuffer", "=", "primary", ".", "getBuffer", "(", ")", ";", "if", "(", "!", "isPrimary", ")", "{", "if", "(", "primaryBuffer", "==", "null", ")", "return", ";", "char", "[", "]", "primaryContents", "=", "primaryBuffer", ".", "getCharacters", "(", ")", ";", "boolean", "hasSaved", "=", "false", ";", "try", "{", "IBuffer", "workingCopyBuffer", "=", "workingCopy", ".", "getBuffer", "(", ")", ";", "if", "(", "workingCopyBuffer", "==", "null", ")", "return", ";", "primaryBuffer", ".", "setContents", "(", "workingCopyBuffer", ".", "getCharacters", "(", ")", ")", ";", "primaryBuffer", ".", "save", "(", "this", ".", "progressMonitor", ",", "this", ".", "force", ")", ";", "primary", ".", "makeConsistent", "(", "this", ")", ";", "hasSaved", "=", "true", ";", "}", "finally", "{", "if", "(", "!", "hasSaved", ")", "{", "primaryBuffer", ".", "setContents", "(", "primaryContents", ")", ";", "}", "}", "}", "else", "{", "primaryBuffer", ".", "save", "(", "this", ".", "progressMonitor", ",", "this", ".", "force", ")", ";", "primary", ".", "makeConsistent", "(", "this", ")", ";", "}", "}", "else", "{", "String", "encoding", "=", "null", ";", "try", "{", "encoding", "=", "resource", ".", "getCharset", "(", ")", ";", "}", "catch", "(", "CoreException", "ce", ")", "{", "}", "String", "contents", "=", "workingCopy", ".", "getSource", "(", ")", ";", "if", "(", "contents", "==", "null", ")", "return", ";", "try", "{", "byte", "[", "]", "bytes", "=", "encoding", "==", "null", "?", "contents", ".", "getBytes", "(", ")", ":", "contents", ".", "getBytes", "(", "encoding", ")", ";", "ByteArrayInputStream", "stream", "=", "new", "ByteArrayInputStream", "(", "bytes", ")", ";", "if", "(", "resource", ".", "exists", "(", ")", ")", "{", "resource", ".", "setContents", "(", "stream", ",", "this", ".", "force", "?", "IResource", ".", "FORCE", "|", "IResource", ".", "KEEP_HISTORY", ":", "IResource", ".", "KEEP_HISTORY", ",", "null", ")", ";", "}", "else", "{", "resource", ".", "create", "(", "stream", ",", "this", ".", "force", ",", "this", ".", "progressMonitor", ")", ";", "}", "}", "catch", "(", "CoreException", "e", ")", "{", "throw", "new", "JavaModelException", "(", "e", ")", ";", "}", "catch", "(", "UnsupportedEncodingException", "e", ")", "{", "throw", "new", "JavaModelException", "(", "e", ",", "IJavaModelStatusConstants", ".", "IO_EXCEPTION", ")", ";", "}", "}", "setAttribute", "(", "HAS_MODIFIED_RESOURCE_ATTR", ",", "TRUE", ")", ";", "workingCopy", ".", "updateTimeStamp", "(", "(", "CompilationUnit", ")", "primary", ")", ";", "workingCopy", ".", "makeConsistent", "(", "this", ")", ";", "worked", "(", "1", ")", ";", "if", "(", "deltaBuilder", "!=", "null", ")", "{", "deltaBuilder", ".", "buildDeltas", "(", ")", ";", "if", "(", "deltaBuilder", ".", "delta", "!=", "null", ")", "{", "addDelta", "(", "deltaBuilder", ".", "delta", ")", ";", "}", "}", "worked", "(", "1", ")", ";", "}", "finally", "{", "done", "(", ")", ";", "}", "}", "protected", "CompilationUnit", "getCompilationUnit", "(", ")", "{", "return", "(", "CompilationUnit", ")", "getElementToProcess", "(", ")", ";", "}", "protected", "ISchedulingRule", "getSchedulingRule", "(", ")", "{", "IResource", "resource", "=", "getElementToProcess", "(", ")", ".", "getResource", "(", ")", ";", "if", "(", "resource", "==", "null", ")", "return", "null", ";", "IWorkspace", "workspace", "=", "resource", ".", "getWorkspace", "(", ")", ";", "if", "(", "resource", ".", "exists", "(", ")", ")", "{", "return", "workspace", ".", "getRuleFactory", "(", ")", ".", "modifyRule", "(", "resource", ")", ";", "}", "else", "{", "return", "workspace", ".", "getRuleFactory", "(", ")", ".", "createRule", "(", "resource", ")", ";", "}", "}", "public", "IJavaModelStatus", "verify", "(", ")", "{", "CompilationUnit", "cu", "=", "getCompilationUnit", "(", ")", ";", "if", "(", "!", "cu", ".", "isWorkingCopy", "(", ")", ")", "{", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INVALID_ELEMENT_TYPES", ",", "cu", ")", ";", "}", "if", "(", "cu", ".", "hasResourceChanged", "(", ")", "&&", "!", "this", ".", "force", ")", "{", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "UPDATE_CONFLICT", ")", ";", "}", "return", "JavaModelStatus", ".", "VERIFIED_OK", ";", "}", "}", "</s>" ]
3,694
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResourceRuleFactory", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "ResourcesPlugin", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "jobs", ".", "ISchedulingRule", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "jobs", ".", "MultiRule", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IClasspathEntry", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaModelStatus", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "JavaModelManager", ".", "PerProjectInfo", ";", "public", "class", "SetClasspathOperation", "extends", "ChangeClasspathOperation", "{", "IClasspathEntry", "[", "]", "newRawClasspath", ";", "IClasspathEntry", "[", "]", "referencedEntries", ";", "IPath", "newOutputLocation", ";", "JavaProject", "project", ";", "public", "SetClasspathOperation", "(", "JavaProject", "project", ",", "IClasspathEntry", "[", "]", "newRawClasspath", ",", "IPath", "newOutputLocation", ",", "boolean", "canChangeResource", ")", "{", "this", "(", "project", ",", "newRawClasspath", ",", "null", ",", "newOutputLocation", ",", "canChangeResource", ")", ";", "}", "public", "SetClasspathOperation", "(", "JavaProject", "project", ",", "IClasspathEntry", "[", "]", "newRawClasspath", ",", "IClasspathEntry", "[", "]", "referencedEntries", ",", "IPath", "newOutputLocation", ",", "boolean", "canChangeResource", ")", "{", "super", "(", "new", "IJavaElement", "[", "]", "{", "project", "}", ",", "canChangeResource", ")", ";", "this", ".", "project", "=", "project", ";", "this", ".", "newRawClasspath", "=", "newRawClasspath", ";", "this", ".", "referencedEntries", "=", "referencedEntries", ";", "this", ".", "newOutputLocation", "=", "newOutputLocation", ";", "}", "protected", "void", "executeOperation", "(", ")", "throws", "JavaModelException", "{", "checkCanceled", "(", ")", ";", "try", "{", "PerProjectInfo", "perProjectInfo", "=", "this", ".", "project", ".", "getPerProjectInfo", "(", ")", ";", "ClasspathChange", "classpathChange", "=", "perProjectInfo", ".", "setRawClasspath", "(", "this", ".", "newRawClasspath", ",", "this", ".", "referencedEntries", ",", "this", ".", "newOutputLocation", ",", "JavaModelStatus", ".", "VERIFIED_OK", ")", ";", "classpathChanged", "(", "classpathChange", ",", "true", ")", ";", "if", "(", "this", ".", "canChangeResources", "&&", "perProjectInfo", ".", "writeAndCacheClasspath", "(", "this", ".", "project", ",", "this", ".", "newRawClasspath", ",", "this", ".", "newOutputLocation", ")", ")", "setAttribute", "(", "HAS_MODIFIED_RESOURCE_ATTR", ",", "TRUE", ")", ";", "}", "finally", "{", "done", "(", ")", ";", "}", "}", "protected", "ISchedulingRule", "getSchedulingRule", "(", ")", "{", "if", "(", "this", ".", "canChangeResources", ")", "{", "IResourceRuleFactory", "ruleFactory", "=", "ResourcesPlugin", ".", "getWorkspace", "(", ")", ".", "getRuleFactory", "(", ")", ";", "return", "new", "MultiRule", "(", "new", "ISchedulingRule", "[", "]", "{", "ruleFactory", ".", "modifyRule", "(", "this", ".", "project", ".", "getProject", "(", ")", ")", ",", "ruleFactory", ".", "modifyRule", "(", "JavaModelManager", ".", "getExternalManager", "(", ")", ".", "getExternalFoldersProject", "(", ")", ")", "}", ")", ";", "}", "return", "super", ".", "getSchedulingRule", "(", ")", ";", "}", "public", "String", "toString", "(", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", "20", ")", ";", "buffer", ".", "append", "(", "\"\"", ")", ";", "buffer", ".", "append", "(", "\"\"", ")", ";", "buffer", ".", "append", "(", "\"{\"", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "this", ".", "newRawClasspath", ".", "length", ";", "i", "++", ")", "{", "if", "(", "i", ">", "0", ")", "buffer", ".", "append", "(", "\",\"", ")", ";", "IClasspathEntry", "element", "=", "this", ".", "newRawClasspath", "[", "i", "]", ";", "buffer", ".", "append", "(", "\"", "\"", ")", ".", "append", "(", "element", ".", "toString", "(", ")", ")", ";", "}", "buffer", ".", "append", "(", "\"\"", ")", ";", "buffer", ".", "append", "(", "this", ".", "newOutputLocation", ".", "toString", "(", ")", ")", ";", "return", "buffer", ".", "toString", "(", ")", ";", "}", "public", "IJavaModelStatus", "verify", "(", ")", "{", "IJavaModelStatus", "status", "=", "super", ".", "verify", "(", ")", ";", "if", "(", "!", "status", ".", "isOK", "(", ")", ")", "return", "status", ";", "this", ".", "project", ".", "flushClasspathProblemMarkers", "(", "false", ",", "false", ",", "true", ")", ";", "return", "ClasspathEntry", ".", "validateClasspath", "(", "this", ".", "project", ",", "this", ".", "newRawClasspath", ",", "this", ".", "newOutputLocation", ")", ";", "}", "}", "</s>" ]
3,695
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "io", ".", "File", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IFile", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IProject", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaProject", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "env", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ";", "public", "class", "BasicCompilationUnit", "implements", "ICompilationUnit", "{", "protected", "char", "[", "]", "contents", ";", "protected", "char", "[", "]", "fileName", ";", "protected", "char", "[", "]", "[", "]", "packageName", ";", "protected", "char", "[", "]", "mainTypeName", ";", "protected", "String", "encoding", ";", "public", "BasicCompilationUnit", "(", "char", "[", "]", "contents", ",", "char", "[", "]", "[", "]", "packageName", ",", "String", "fileName", ")", "{", "this", ".", "contents", "=", "contents", ";", "this", ".", "fileName", "=", "fileName", ".", "toCharArray", "(", ")", ";", "this", ".", "packageName", "=", "packageName", ";", "}", "public", "BasicCompilationUnit", "(", "char", "[", "]", "contents", ",", "char", "[", "]", "[", "]", "packageName", ",", "String", "fileName", ",", "String", "encoding", ")", "{", "this", "(", "contents", ",", "packageName", ",", "fileName", ")", ";", "this", ".", "encoding", "=", "encoding", ";", "}", "public", "BasicCompilationUnit", "(", "char", "[", "]", "contents", ",", "char", "[", "]", "[", "]", "packageName", ",", "String", "fileName", ",", "IJavaElement", "javaElement", ")", "{", "this", "(", "contents", ",", "packageName", ",", "fileName", ")", ";", "initEncoding", "(", "javaElement", ")", ";", "}", "private", "void", "initEncoding", "(", "IJavaElement", "javaElement", ")", "{", "if", "(", "javaElement", "!=", "null", ")", "{", "try", "{", "IJavaProject", "javaProject", "=", "javaElement", ".", "getJavaProject", "(", ")", ";", "switch", "(", "javaElement", ".", "getElementType", "(", ")", ")", "{", "case", "IJavaElement", ".", "COMPILATION_UNIT", ":", "IFile", "file", "=", "(", "IFile", ")", "javaElement", ".", "getResource", "(", ")", ";", "if", "(", "file", "!=", "null", ")", "{", "this", ".", "encoding", "=", "file", ".", "getCharset", "(", ")", ";", "break", ";", "}", "default", ":", "IProject", "project", "=", "(", "IProject", ")", "javaProject", ".", "getResource", "(", ")", ";", "if", "(", "project", "!=", "null", ")", "{", "this", ".", "encoding", "=", "project", ".", "getDefaultCharset", "(", ")", ";", "}", "break", ";", "}", "}", "catch", "(", "CoreException", "e1", ")", "{", "this", ".", "encoding", "=", "null", ";", "}", "}", "else", "{", "this", ".", "encoding", "=", "null", ";", "}", "}", "public", "char", "[", "]", "getContents", "(", ")", "{", "if", "(", "this", ".", "contents", "!=", "null", ")", "return", "this", ".", "contents", ";", "try", "{", "return", "Util", ".", "getFileCharContent", "(", "new", "File", "(", "new", "String", "(", "this", ".", "fileName", ")", ")", ",", "this", ".", "encoding", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "}", "return", "CharOperation", ".", "NO_CHAR", ";", "}", "public", "char", "[", "]", "getFileName", "(", ")", "{", "return", "this", ".", "fileName", ";", "}", "public", "char", "[", "]", "getMainTypeName", "(", ")", "{", "if", "(", "this", ".", "mainTypeName", "==", "null", ")", "{", "int", "start", "=", "CharOperation", ".", "lastIndexOf", "(", "'/'", ",", "this", ".", "fileName", ")", "+", "1", ";", "if", "(", "start", "==", "0", "||", "start", "<", "CharOperation", ".", "lastIndexOf", "(", "'\\\\'", ",", "this", ".", "fileName", ")", ")", "start", "=", "CharOperation", ".", "lastIndexOf", "(", "'\\\\'", ",", "this", ".", "fileName", ")", "+", "1", ";", "int", "separator", "=", "CharOperation", ".", "indexOf", "(", "'|'", ",", "this", ".", "fileName", ")", "+", "1", ";", "if", "(", "separator", ">", "start", ")", "start", "=", "separator", ";", "int", "end", "=", "CharOperation", ".", "lastIndexOf", "(", "'$'", ",", "this", ".", "fileName", ")", ";", "if", "(", "end", "==", "-", "1", "||", "!", "Util", ".", "isClassFileName", "(", "this", ".", "fileName", ")", ")", "{", "end", "=", "CharOperation", ".", "lastIndexOf", "(", "'.'", ",", "this", ".", "fileName", ")", ";", "if", "(", "end", "==", "-", "1", ")", "end", "=", "this", ".", "fileName", ".", "length", ";", "}", "this", ".", "mainTypeName", "=", "CharOperation", ".", "subarray", "(", "this", ".", "fileName", ",", "start", ",", "end", ")", ";", "}", "return", "this", ".", "mainTypeName", ";", "}", "public", "char", "[", "]", "[", "]", "getPackageName", "(", ")", "{", "return", "this", ".", "packageName", ";", "}", "public", "String", "toString", "(", ")", "{", "return", "\"\"", "+", "new", "String", "(", "this", ".", "fileName", ")", ";", "}", "}", "</s>" ]
3,696
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "io", ".", "ByteArrayInputStream", ";", "import", "java", ".", "io", ".", "IOException", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IFile", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResourceStatus", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "CoreException", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "ISafeRunnable", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "SafeRunner", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "content", ".", "IContentDescription", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "*", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "Buffer", "implements", "IBuffer", "{", "protected", "IFile", "file", ";", "protected", "int", "flags", ";", "protected", "char", "[", "]", "contents", ";", "protected", "ArrayList", "changeListeners", ";", "protected", "IOpenable", "owner", ";", "protected", "int", "gapStart", "=", "-", "1", ";", "protected", "int", "gapEnd", "=", "-", "1", ";", "protected", "Object", "lock", "=", "new", "Object", "(", ")", ";", "protected", "static", "final", "int", "F_HAS_UNSAVED_CHANGES", "=", "1", ";", "protected", "static", "final", "int", "F_IS_READ_ONLY", "=", "2", ";", "protected", "static", "final", "int", "F_IS_CLOSED", "=", "4", ";", "protected", "Buffer", "(", "IFile", "file", ",", "IOpenable", "owner", ",", "boolean", "readOnly", ")", "{", "this", ".", "file", "=", "file", ";", "this", ".", "owner", "=", "owner", ";", "if", "(", "file", "==", "null", ")", "{", "setReadOnly", "(", "readOnly", ")", ";", "}", "}", "public", "synchronized", "void", "addBufferChangedListener", "(", "IBufferChangedListener", "listener", ")", "{", "if", "(", "this", ".", "changeListeners", "==", "null", ")", "{", "this", ".", "changeListeners", "=", "new", "ArrayList", "(", "5", ")", ";", "}", "if", "(", "!", "this", ".", "changeListeners", ".", "contains", "(", "listener", ")", ")", "{", "this", ".", "changeListeners", ".", "add", "(", "listener", ")", ";", "}", "}", "public", "void", "append", "(", "char", "[", "]", "text", ")", "{", "if", "(", "!", "isReadOnly", "(", ")", ")", "{", "if", "(", "text", "==", "null", "||", "text", ".", "length", "==", "0", ")", "{", "return", ";", "}", "int", "length", "=", "getLength", "(", ")", ";", "synchronized", "(", "this", ".", "lock", ")", "{", "if", "(", "this", ".", "contents", "==", "null", ")", "return", ";", "moveAndResizeGap", "(", "length", ",", "text", ".", "length", ")", ";", "System", ".", "arraycopy", "(", "text", ",", "0", ",", "this", ".", "contents", ",", "length", ",", "text", ".", "length", ")", ";", "this", ".", "gapStart", "+=", "text", ".", "length", ";", "this", ".", "flags", "|=", "F_HAS_UNSAVED_CHANGES", ";", "}", "notifyChanged", "(", "new", "BufferChangedEvent", "(", "this", ",", "length", ",", "0", ",", "new", "String", "(", "text", ")", ")", ")", ";", "}", "}", "public", "void", "append", "(", "String", "text", ")", "{", "if", "(", "text", "==", "null", ")", "{", "return", ";", "}", "this", ".", "append", "(", "text", ".", "toCharArray", "(", ")", ")", ";", "}", "public", "void", "close", "(", ")", "{", "BufferChangedEvent", "event", "=", "null", ";", "synchronized", "(", "this", ".", "lock", ")", "{", "if", "(", "isClosed", "(", ")", ")", "return", ";", "event", "=", "new", "BufferChangedEvent", "(", "this", ",", "0", ",", "0", ",", "null", ")", ";", "this", ".", "contents", "=", "null", ";", "this", ".", "flags", "|=", "F_IS_CLOSED", ";", "}", "notifyChanged", "(", "event", ")", ";", "synchronized", "(", "this", ")", "{", "this", ".", "changeListeners", "=", "null", ";", "}", "}", "public", "char", "getChar", "(", "int", "position", ")", "{", "synchronized", "(", "this", ".", "lock", ")", "{", "if", "(", "this", ".", "contents", "==", "null", ")", "return", "Character", ".", "MIN_VALUE", ";", "if", "(", "position", "<", "this", ".", "gapStart", ")", "{", "return", "this", ".", "contents", "[", "position", "]", ";", "}", "int", "gapLength", "=", "this", ".", "gapEnd", "-", "this", ".", "gapStart", ";", "return", "this", ".", "contents", "[", "position", "+", "gapLength", "]", ";", "}", "}", "public", "char", "[", "]", "getCharacters", "(", ")", "{", "synchronized", "(", "this", ".", "lock", ")", "{", "if", "(", "this", ".", "contents", "==", "null", ")", "return", "null", ";", "if", "(", "this", ".", "gapStart", "<", "0", ")", "{", "return", "this", ".", "contents", ";", "}", "int", "length", "=", "this", ".", "contents", ".", "length", ";", "char", "[", "]", "newContents", "=", "new", "char", "[", "length", "-", "this", ".", "gapEnd", "+", "this", ".", "gapStart", "]", ";", "System", ".", "arraycopy", "(", "this", ".", "contents", ",", "0", ",", "newContents", ",", "0", ",", "this", ".", "gapStart", ")", ";", "System", ".", "arraycopy", "(", "this", ".", "contents", ",", "this", ".", "gapEnd", ",", "newContents", ",", "this", ".", "gapStart", ",", "length", "-", "this", ".", "gapEnd", ")", ";", "return", "newContents", ";", "}", "}", "public", "String", "getContents", "(", ")", "{", "char", "[", "]", "chars", "=", "getCharacters", "(", ")", ";", "if", "(", "chars", "==", "null", ")", "return", "null", ";", "return", "new", "String", "(", "chars", ")", ";", "}", "public", "int", "getLength", "(", ")", "{", "synchronized", "(", "this", ".", "lock", ")", "{", "if", "(", "this", ".", "contents", "==", "null", ")", "return", "-", "1", ";", "int", "length", "=", "this", ".", "gapEnd", "-", "this", ".", "gapStart", ";", "return", "(", "this", ".", "contents", ".", "length", "-", "length", ")", ";", "}", "}", "public", "IOpenable", "getOwner", "(", ")", "{", "return", "this", ".", "owner", ";", "}", "public", "String", "getText", "(", "int", "offset", ",", "int", "length", ")", "{", "synchronized", "(", "this", ".", "lock", ")", "{", "if", "(", "this", ".", "contents", "==", "null", ")", "return", "\"\"", ";", "if", "(", "offset", "+", "length", "<", "this", ".", "gapStart", ")", "return", "new", "String", "(", "this", ".", "contents", ",", "offset", ",", "length", ")", ";", "if", "(", "this", ".", "gapStart", "<", "offset", ")", "{", "int", "gapLength", "=", "this", ".", "gapEnd", "-", "this", ".", "gapStart", ";", "return", "new", "String", "(", "this", ".", "contents", ",", "offset", "+", "gapLength", ",", "length", ")", ";", "}", "StringBuffer", "buf", "=", "new", "StringBuffer", "(", ")", ";", "buf", ".", "append", "(", "this", ".", "contents", ",", "offset", ",", "this", ".", "gapStart", "-", "offset", ")", ";", "buf", ".", "append", "(", "this", ".", "contents", ",", "this", ".", "gapEnd", ",", "offset", "+", "length", "-", "this", ".", "gapStart", ")", ";", "return", "buf", ".", "toString", "(", ")", ";", "}", "}", "public", "IResource", "getUnderlyingResource", "(", ")", "{", "return", "this", ".", "file", ";", "}", "public", "boolean", "hasUnsavedChanges", "(", ")", "{", "return", "(", "this", ".", "flags", "&", "F_HAS_UNSAVED_CHANGES", ")", "!=", "0", ";", "}", "public", "boolean", "isClosed", "(", ")", "{", "return", "(", "this", ".", "flags", "&", "F_IS_CLOSED", ")", "!=", "0", ";", "}", "public", "boolean", "isReadOnly", "(", ")", "{", "return", "(", "this", ".", "flags", "&", "F_IS_READ_ONLY", ")", "!=", "0", ";", "}", "protected", "void", "moveAndResizeGap", "(", "int", "position", ",", "int", "size", ")", "{", "char", "[", "]", "content", "=", "null", ";", "int", "oldSize", "=", "this", ".", "gapEnd", "-", "this", ".", "gapStart", ";", "if", "(", "size", "<", "0", ")", "{", "if", "(", "oldSize", ">", "0", ")", "{", "content", "=", "new", "char", "[", "this", ".", "contents", ".", "length", "-", "oldSize", "]", ";", "System", ".", "arraycopy", "(", "this", ".", "contents", ",", "0", ",", "content", ",", "0", ",", "this", ".", "gapStart", ")", ";", "System", ".", "arraycopy", "(", "this", ".", "contents", ",", "this", ".", "gapEnd", ",", "content", ",", "this", ".", "gapStart", ",", "content", ".", "length", "-", "this", ".", "gapStart", ")", ";", "this", ".", "contents", "=", "content", ";", "}", "this", ".", "gapStart", "=", "this", ".", "gapEnd", "=", "position", ";", "return", ";", "}", "content", "=", "new", "char", "[", "this", ".", "contents", ".", "length", "+", "(", "size", "-", "oldSize", ")", "]", ";", "int", "newGapStart", "=", "position", ";", "int", "newGapEnd", "=", "newGapStart", "+", "size", ";", "if", "(", "oldSize", "==", "0", ")", "{", "System", ".", "arraycopy", "(", "this", ".", "contents", ",", "0", ",", "content", ",", "0", ",", "newGapStart", ")", ";", "System", ".", "arraycopy", "(", "this", ".", "contents", ",", "newGapStart", ",", "content", ",", "newGapEnd", ",", "content", ".", "length", "-", "newGapEnd", ")", ";", "}", "else", "if", "(", "newGapStart", "<", "this", ".", "gapStart", ")", "{", "int", "delta", "=", "this", ".", "gapStart", "-", "newGapStart", ";", "System", ".", "arraycopy", "(", "this", ".", "contents", ",", "0", ",", "content", ",", "0", ",", "newGapStart", ")", ";", "System", ".", "arraycopy", "(", "this", ".", "contents", ",", "newGapStart", ",", "content", ",", "newGapEnd", ",", "delta", ")", ";", "System", ".", "arraycopy", "(", "this", ".", "contents", ",", "this", ".", "gapEnd", ",", "content", ",", "newGapEnd", "+", "delta", ",", "this", ".", "contents", ".", "length", "-", "this", ".", "gapEnd", ")", ";", "}", "else", "{", "int", "delta", "=", "newGapStart", "-", "this", ".", "gapStart", ";", "System", ".", "arraycopy", "(", "this", ".", "contents", ",", "0", ",", "content", ",", "0", ",", "this", ".", "gapStart", ")", ";", "System", ".", "arraycopy", "(", "this", ".", "contents", ",", "this", ".", "gapEnd", ",", "content", ",", "this", ".", "gapStart", ",", "delta", ")", ";", "System", ".", "arraycopy", "(", "this", ".", "contents", ",", "this", ".", "gapEnd", "+", "delta", ",", "content", ",", "newGapEnd", ",", "content", ".", "length", "-", "newGapEnd", ")", ";", "}", "this", ".", "contents", "=", "content", ";", "this", ".", "gapStart", "=", "newGapStart", ";", "this", ".", "gapEnd", "=", "newGapEnd", ";", "}", "protected", "void", "notifyChanged", "(", "final", "BufferChangedEvent", "event", ")", "{", "ArrayList", "listeners", "=", "this", ".", "changeListeners", ";", "if", "(", "listeners", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ",", "size", "=", "listeners", ".", "size", "(", ")", ";", "i", "<", "size", ";", "++", "i", ")", "{", "final", "IBufferChangedListener", "listener", "=", "(", "IBufferChangedListener", ")", "listeners", ".", "get", "(", "i", ")", ";", "SafeRunner", ".", "run", "(", "new", "ISafeRunnable", "(", ")", "{", "public", "void", "handleException", "(", "Throwable", "exception", ")", "{", "Util", ".", "log", "(", "exception", ",", "\"\"", ")", ";", "}", "public", "void", "run", "(", ")", "throws", "Exception", "{", "listener", ".", "bufferChanged", "(", "event", ")", ";", "}", "}", ")", ";", "}", "}", "}", "public", "synchronized", "void", "removeBufferChangedListener", "(", "IBufferChangedListener", "listener", ")", "{", "if", "(", "this", ".", "changeListeners", "!=", "null", ")", "{", "this", ".", "changeListeners", ".", "remove", "(", "listener", ")", ";", "if", "(", "this", ".", "changeListeners", ".", "size", "(", ")", "==", "0", ")", "{", "this", ".", "changeListeners", "=", "null", ";", "}", "}", "}", "public", "void", "replace", "(", "int", "position", ",", "int", "length", ",", "char", "[", "]", "text", ")", "{", "if", "(", "!", "isReadOnly", "(", ")", ")", "{", "int", "textLength", "=", "text", "==", "null", "?", "0", ":", "text", ".", "length", ";", "synchronized", "(", "this", ".", "lock", ")", "{", "if", "(", "this", ".", "contents", "==", "null", ")", "return", ";", "moveAndResizeGap", "(", "position", "+", "length", ",", "textLength", "-", "length", ")", ";", "int", "min", "=", "Math", ".", "min", "(", "textLength", ",", "length", ")", ";", "if", "(", "min", ">", "0", ")", "{", "System", ".", "arraycopy", "(", "text", ",", "0", ",", "this", ".", "contents", ",", "position", ",", "min", ")", ";", "}", "if", "(", "length", ">", "textLength", ")", "{", "this", ".", "gapStart", "-=", "length", "-", "textLength", ";", "}", "else", "if", "(", "textLength", ">", "length", ")", "{", "this", ".", "gapStart", "+=", "textLength", "-", "length", ";", "System", ".", "arraycopy", "(", "text", ",", "0", ",", "this", ".", "contents", ",", "position", ",", "textLength", ")", ";", "}", "this", ".", "flags", "|=", "F_HAS_UNSAVED_CHANGES", ";", "}", "String", "string", "=", "null", ";", "if", "(", "textLength", ">", "0", ")", "{", "string", "=", "new", "String", "(", "text", ")", ";", "}", "notifyChanged", "(", "new", "BufferChangedEvent", "(", "this", ",", "position", ",", "length", ",", "string", ")", ")", ";", "}", "}", "public", "void", "replace", "(", "int", "position", ",", "int", "length", ",", "String", "text", ")", "{", "this", ".", "replace", "(", "position", ",", "length", ",", "text", "==", "null", "?", "null", ":", "text", ".", "toCharArray", "(", ")", ")", ";", "}", "public", "void", "save", "(", "IProgressMonitor", "progress", ",", "boolean", "force", ")", "throws", "JavaModelException", "{", "if", "(", "isReadOnly", "(", ")", "||", "this", ".", "file", "==", "null", ")", "{", "return", ";", "}", "if", "(", "!", "hasUnsavedChanges", "(", ")", ")", "return", ";", "try", "{", "String", "stringContents", "=", "getContents", "(", ")", ";", "if", "(", "stringContents", "==", "null", ")", "return", ";", "String", "encoding", "=", "null", ";", "try", "{", "encoding", "=", "this", ".", "file", ".", "getCharset", "(", ")", ";", "}", "catch", "(", "CoreException", "ce", ")", "{", "}", "byte", "[", "]", "bytes", "=", "encoding", "==", "null", "?", "stringContents", ".", "getBytes", "(", ")", ":", "stringContents", ".", "getBytes", "(", "encoding", ")", ";", "if", "(", "encoding", "!=", "null", "&&", "encoding", ".", "equals", "(", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "compiler", ".", "util", ".", "Util", ".", "UTF_8", ")", ")", "{", "IContentDescription", "description", ";", "try", "{", "description", "=", "this", ".", "file", ".", "getContentDescription", "(", ")", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "if", "(", "e", ".", "getStatus", "(", ")", ".", "getCode", "(", ")", "!=", "IResourceStatus", ".", "RESOURCE_NOT_FOUND", ")", "throw", "e", ";", "description", "=", "null", ";", "}", "if", "(", "description", "!=", "null", "&&", "description", ".", "getProperty", "(", "IContentDescription", ".", "BYTE_ORDER_MARK", ")", "!=", "null", ")", "{", "int", "bomLength", "=", "IContentDescription", ".", "BOM_UTF_8", ".", "length", ";", "byte", "[", "]", "bytesWithBOM", "=", "new", "byte", "[", "bytes", ".", "length", "+", "bomLength", "]", ";", "System", ".", "arraycopy", "(", "IContentDescription", ".", "BOM_UTF_8", ",", "0", ",", "bytesWithBOM", ",", "0", ",", "bomLength", ")", ";", "System", ".", "arraycopy", "(", "bytes", ",", "0", ",", "bytesWithBOM", ",", "bomLength", ",", "bytes", ".", "length", ")", ";", "bytes", "=", "bytesWithBOM", ";", "}", "}", "ByteArrayInputStream", "stream", "=", "new", "ByteArrayInputStream", "(", "bytes", ")", ";", "if", "(", "this", ".", "file", ".", "exists", "(", ")", ")", "{", "this", ".", "file", ".", "setContents", "(", "stream", ",", "force", "?", "IResource", ".", "FORCE", "|", "IResource", ".", "KEEP_HISTORY", ":", "IResource", ".", "KEEP_HISTORY", ",", "null", ")", ";", "}", "else", "{", "this", ".", "file", ".", "create", "(", "stream", ",", "force", ",", "null", ")", ";", "}", "}", "catch", "(", "IOException", "e", ")", "{", "throw", "new", "JavaModelException", "(", "e", ",", "IJavaModelStatusConstants", ".", "IO_EXCEPTION", ")", ";", "}", "catch", "(", "CoreException", "e", ")", "{", "throw", "new", "JavaModelException", "(", "e", ")", ";", "}", "this", ".", "flags", "&=", "~", "(", "F_HAS_UNSAVED_CHANGES", ")", ";", "}", "public", "void", "setContents", "(", "char", "[", "]", "newContents", ")", "{", "if", "(", "this", ".", "contents", "==", "null", ")", "{", "synchronized", "(", "this", ".", "lock", ")", "{", "this", ".", "contents", "=", "newContents", ";", "this", ".", "flags", "&=", "~", "(", "F_HAS_UNSAVED_CHANGES", ")", ";", "}", "return", ";", "}", "if", "(", "!", "isReadOnly", "(", ")", ")", "{", "String", "string", "=", "null", ";", "if", "(", "newContents", "!=", "null", ")", "{", "string", "=", "new", "String", "(", "newContents", ")", ";", "}", "synchronized", "(", "this", ".", "lock", ")", "{", "if", "(", "this", ".", "contents", "==", "null", ")", "return", ";", "this", ".", "contents", "=", "newContents", ";", "this", ".", "flags", "|=", "F_HAS_UNSAVED_CHANGES", ";", "this", ".", "gapStart", "=", "-", "1", ";", "this", ".", "gapEnd", "=", "-", "1", ";", "}", "BufferChangedEvent", "event", "=", "new", "BufferChangedEvent", "(", "this", ",", "0", ",", "getLength", "(", ")", ",", "string", ")", ";", "notifyChanged", "(", "event", ")", ";", "}", "}", "public", "void", "setContents", "(", "String", "newContents", ")", "{", "this", ".", "setContents", "(", "newContents", ".", "toCharArray", "(", ")", ")", ";", "}", "protected", "void", "setReadOnly", "(", "boolean", "readOnly", ")", "{", "if", "(", "readOnly", ")", "{", "this", ".", "flags", "|=", "F_IS_READ_ONLY", ";", "}", "else", "{", "this", ".", "flags", "&=", "~", "(", "F_IS_READ_ONLY", ")", ";", "}", "}", "public", "String", "toString", "(", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "buffer", ".", "append", "(", "\"Owner:", "\"", "+", "(", "(", "JavaElement", ")", "this", ".", "owner", ")", ".", "toStringWithAncestors", "(", ")", ")", ";", "buffer", ".", "append", "(", "\"\"", "+", "hasUnsavedChanges", "(", ")", ")", ";", "buffer", ".", "append", "(", "\"\"", "+", "isReadOnly", "(", ")", ")", ";", "buffer", ".", "append", "(", "\"nIs", "closed:", "\"", "+", "isClosed", "(", ")", ")", ";", "buffer", ".", "append", "(", "\"nContents:n\"", ")", ";", "char", "[", "]", "charContents", "=", "getCharacters", "(", ")", ";", "if", "(", "charContents", "==", "null", ")", "{", "buffer", ".", "append", "(", "\"<null>\"", ")", ";", "}", "else", "{", "int", "length", "=", "charContents", ".", "length", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "char", "c", "=", "charContents", "[", "i", "]", ";", "switch", "(", "c", ")", "{", "case", "'\\n'", ":", "buffer", ".", "append", "(", "\"\\\\nn\"", ")", ";", "break", ";", "case", "'\\r'", ":", "if", "(", "i", "<", "length", "-", "1", "&&", "this", ".", "contents", "[", "i", "+", "1", "]", "==", "'\\n'", ")", "{", "buffer", ".", "append", "(", "\"\\\\r\\\\nn\"", ")", ";", "i", "++", ";", "}", "else", "{", "buffer", ".", "append", "(", "\"\\\\rn\"", ")", ";", "}", "break", ";", "default", ":", "buffer", ".", "append", "(", "c", ")", ";", "break", ";", "}", "}", "}", "return", "buffer", ".", "toString", "(", ")", ";", "}", "}", "</s>" ]
3,697
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "java", ".", "util", ".", "ArrayList", ";", "import", "java", ".", "util", ".", "HashMap", ";", "import", "java", ".", "util", ".", "Iterator", ";", "import", "java", ".", "util", ".", "Map", ";", "import", "org", ".", "codehaus", ".", "jdt", ".", "groovy", ".", "integration", ".", "LanguageSupportFactory", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "Path", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IClassFile", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ICompilationUnit", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJarEntryResource", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaModelStatusConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "class", "JarPackageFragment", "extends", "PackageFragment", "{", "protected", "JarPackageFragment", "(", "PackageFragmentRoot", "root", ",", "String", "[", "]", "names", ")", "{", "super", "(", "root", ",", "names", ")", ";", "}", "protected", "boolean", "buildStructure", "(", "OpenableElementInfo", "info", ",", "IProgressMonitor", "pm", ",", "Map", "newElements", ",", "IResource", "underlyingResource", ")", "throws", "JavaModelException", "{", "JarPackageFragmentRoot", "root", "=", "(", "JarPackageFragmentRoot", ")", "getParent", "(", ")", ";", "JarPackageFragmentRootInfo", "parentInfo", "=", "(", "JarPackageFragmentRootInfo", ")", "root", ".", "getElementInfo", "(", ")", ";", "ArrayList", "[", "]", "entries", "=", "(", "ArrayList", "[", "]", ")", "parentInfo", ".", "rawPackageInfo", ".", "get", "(", "this", ".", "names", ")", ";", "if", "(", "entries", "==", "null", ")", "throw", "newNotPresentException", "(", ")", ";", "JarPackageFragmentInfo", "fragInfo", "=", "(", "JarPackageFragmentInfo", ")", "info", ";", "fragInfo", ".", "setChildren", "(", "computeChildren", "(", "entries", "[", "0", "]", ")", ")", ";", "fragInfo", ".", "setNonJavaResources", "(", "computeNonJavaResources", "(", "entries", "[", "1", "]", ")", ")", ";", "newElements", ".", "put", "(", "this", ",", "fragInfo", ")", ";", "return", "true", ";", "}", "private", "IJavaElement", "[", "]", "computeChildren", "(", "ArrayList", "namesWithoutExtension", ")", "{", "int", "size", "=", "namesWithoutExtension", ".", "size", "(", ")", ";", "if", "(", "size", "==", "0", ")", "return", "NO_ELEMENTS", ";", "IJavaElement", "[", "]", "children", "=", "new", "IJavaElement", "[", "size", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "String", "nameWithoutExtension", "=", "(", "String", ")", "namesWithoutExtension", ".", "get", "(", "i", ")", ";", "children", "[", "i", "]", "=", "new", "ClassFile", "(", "this", ",", "nameWithoutExtension", ")", ";", "}", "return", "children", ";", "}", "private", "Object", "[", "]", "computeNonJavaResources", "(", "ArrayList", "entryNames", ")", "{", "int", "length", "=", "entryNames", ".", "size", "(", ")", ";", "if", "(", "length", "==", "0", ")", "return", "JavaElementInfo", ".", "NO_NON_JAVA_RESOURCES", ";", "HashMap", "jarEntries", "=", "new", "HashMap", "(", ")", ";", "HashMap", "childrenMap", "=", "new", "HashMap", "(", ")", ";", "boolean", "isInteresting", "=", "LanguageSupportFactory", ".", "isInterestingProject", "(", "this", ".", "getJavaProject", "(", ")", ".", "getProject", "(", ")", ")", ";", "ArrayList", "topJarEntries", "=", "new", "ArrayList", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "length", ";", "i", "++", ")", "{", "String", "resName", "=", "(", "String", ")", "entryNames", ".", "get", "(", "i", ")", ";", "if", "(", "(", "!", "Util", ".", "isJavaLikeFileName", "(", "resName", ")", "||", "(", "isInteresting", "&&", "LanguageSupportFactory", ".", "isInterestingSourceFile", "(", "resName", ")", ")", ")", ")", "{", "IPath", "filePath", "=", "new", "Path", "(", "resName", ")", ";", "IPath", "childPath", "=", "filePath", ".", "removeFirstSegments", "(", "this", ".", "names", ".", "length", ")", ";", "if", "(", "jarEntries", ".", "containsKey", "(", "childPath", ")", ")", "{", "continue", ";", "}", "JarEntryFile", "file", "=", "new", "JarEntryFile", "(", "filePath", ".", "lastSegment", "(", ")", ")", ";", "jarEntries", ".", "put", "(", "childPath", ",", "file", ")", ";", "if", "(", "childPath", ".", "segmentCount", "(", ")", "==", "1", ")", "{", "file", ".", "setParent", "(", "this", ")", ";", "topJarEntries", ".", "add", "(", "file", ")", ";", "}", "else", "{", "IPath", "parentPath", "=", "childPath", ".", "removeLastSegments", "(", "1", ")", ";", "while", "(", "parentPath", ".", "segmentCount", "(", ")", ">", "0", ")", "{", "ArrayList", "parentChildren", "=", "(", "ArrayList", ")", "childrenMap", ".", "get", "(", "parentPath", ")", ";", "if", "(", "parentChildren", "==", "null", ")", "{", "Object", "dir", "=", "new", "JarEntryDirectory", "(", "parentPath", ".", "lastSegment", "(", ")", ")", ";", "jarEntries", ".", "put", "(", "parentPath", ",", "dir", ")", ";", "childrenMap", ".", "put", "(", "parentPath", ",", "parentChildren", "=", "new", "ArrayList", "(", ")", ")", ";", "parentChildren", ".", "add", "(", "childPath", ")", ";", "if", "(", "parentPath", ".", "segmentCount", "(", ")", "==", "1", ")", "{", "topJarEntries", ".", "add", "(", "dir", ")", ";", "break", ";", "}", "childPath", "=", "parentPath", ";", "parentPath", "=", "childPath", ".", "removeLastSegments", "(", "1", ")", ";", "}", "else", "{", "parentChildren", ".", "add", "(", "childPath", ")", ";", "break", ";", "}", "}", "}", "}", "}", "Iterator", "entries", "=", "childrenMap", ".", "entrySet", "(", ")", ".", "iterator", "(", ")", ";", "while", "(", "entries", ".", "hasNext", "(", ")", ")", "{", "Map", ".", "Entry", "entry", "=", "(", "Map", ".", "Entry", ")", "entries", ".", "next", "(", ")", ";", "IPath", "entryPath", "=", "(", "IPath", ")", "entry", ".", "getKey", "(", ")", ";", "ArrayList", "entryValue", "=", "(", "ArrayList", ")", "entry", ".", "getValue", "(", ")", ";", "JarEntryDirectory", "jarEntryDirectory", "=", "(", "JarEntryDirectory", ")", "jarEntries", ".", "get", "(", "entryPath", ")", ";", "int", "size", "=", "entryValue", ".", "size", "(", ")", ";", "IJarEntryResource", "[", "]", "children", "=", "new", "IJarEntryResource", "[", "size", "]", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "size", ";", "i", "++", ")", "{", "JarEntryResource", "child", "=", "(", "JarEntryResource", ")", "jarEntries", ".", "get", "(", "entryValue", ".", "get", "(", "i", ")", ")", ";", "child", ".", "setParent", "(", "jarEntryDirectory", ")", ";", "children", "[", "i", "]", "=", "child", ";", "}", "jarEntryDirectory", ".", "setChildren", "(", "children", ")", ";", "if", "(", "entryPath", ".", "segmentCount", "(", ")", "==", "1", ")", "{", "jarEntryDirectory", ".", "setParent", "(", "this", ")", ";", "}", "}", "return", "topJarEntries", ".", "toArray", "(", "new", "Object", "[", "topJarEntries", ".", "size", "(", ")", "]", ")", ";", "}", "public", "boolean", "containsJavaResources", "(", ")", "throws", "JavaModelException", "{", "return", "(", "(", "JarPackageFragmentInfo", ")", "getElementInfo", "(", ")", ")", ".", "containsJavaResources", "(", ")", ";", "}", "public", "ICompilationUnit", "createCompilationUnit", "(", "String", "cuName", ",", "String", "contents", ",", "boolean", "force", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "READ_ONLY", ",", "this", ")", ")", ";", "}", "protected", "Object", "createElementInfo", "(", ")", "{", "return", "new", "JarPackageFragmentInfo", "(", ")", ";", "}", "public", "IClassFile", "[", "]", "getClassFiles", "(", ")", "throws", "JavaModelException", "{", "ArrayList", "list", "=", "getChildrenOfType", "(", "CLASS_FILE", ")", ";", "IClassFile", "[", "]", "array", "=", "new", "IClassFile", "[", "list", ".", "size", "(", ")", "]", ";", "list", ".", "toArray", "(", "array", ")", ";", "return", "array", ";", "}", "public", "ICompilationUnit", "[", "]", "getCompilationUnits", "(", ")", "{", "return", "NO_COMPILATION_UNITS", ";", "}", "public", "IResource", "getCorrespondingResource", "(", ")", "{", "return", "null", ";", "}", "public", "Object", "[", "]", "getNonJavaResources", "(", ")", "throws", "JavaModelException", "{", "if", "(", "isDefaultPackage", "(", ")", ")", "{", "return", "JavaElementInfo", ".", "NO_NON_JAVA_RESOURCES", ";", "}", "else", "{", "return", "storedNonJavaResources", "(", ")", ";", "}", "}", "public", "boolean", "isReadOnly", "(", ")", "{", "return", "true", ";", "}", "protected", "Object", "[", "]", "storedNonJavaResources", "(", ")", "throws", "JavaModelException", "{", "return", "(", "(", "JarPackageFragmentInfo", ")", "getElementInfo", "(", ")", ")", ".", "getNonJavaResources", "(", ")", ";", "}", "}", "</s>" ]
3,698
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "*", ";", "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", ".", "IRegion", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IType", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ITypeHierarchy", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "search", ".", "IJavaSearchScope", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "hierarchy", ".", "RegionBasedTypeHierarchy", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "hierarchy", ".", "TypeHierarchy", ";", "public", "class", "CreateTypeHierarchyOperation", "extends", "JavaModelOperation", "{", "protected", "TypeHierarchy", "typeHierarchy", ";", "public", "CreateTypeHierarchyOperation", "(", "IRegion", "region", ",", "ICompilationUnit", "[", "]", "workingCopies", ",", "IType", "element", ",", "boolean", "computeSubtypes", ")", "{", "super", "(", "element", ")", ";", "this", ".", "typeHierarchy", "=", "new", "RegionBasedTypeHierarchy", "(", "region", ",", "workingCopies", ",", "element", ",", "computeSubtypes", ")", ";", "}", "public", "CreateTypeHierarchyOperation", "(", "IType", "element", ",", "ICompilationUnit", "[", "]", "workingCopies", ",", "IJavaSearchScope", "scope", ",", "boolean", "computeSubtypes", ")", "{", "super", "(", "element", ")", ";", "ICompilationUnit", "[", "]", "copies", ";", "if", "(", "workingCopies", "!=", "null", ")", "{", "int", "length", "=", "workingCopies", ".", "length", ";", "copies", "=", "new", "ICompilationUnit", "[", "length", "]", ";", "System", ".", "arraycopy", "(", "workingCopies", ",", "0", ",", "copies", ",", "0", ",", "length", ")", ";", "}", "else", "{", "copies", "=", "null", ";", "}", "this", ".", "typeHierarchy", "=", "new", "TypeHierarchy", "(", "element", ",", "copies", ",", "scope", ",", "computeSubtypes", ")", ";", "}", "public", "CreateTypeHierarchyOperation", "(", "IType", "element", ",", "ICompilationUnit", "[", "]", "workingCopies", ",", "IJavaProject", "project", ",", "boolean", "computeSubtypes", ")", "{", "super", "(", "element", ")", ";", "ICompilationUnit", "[", "]", "copies", ";", "if", "(", "workingCopies", "!=", "null", ")", "{", "int", "length", "=", "workingCopies", ".", "length", ";", "copies", "=", "new", "ICompilationUnit", "[", "length", "]", ";", "System", ".", "arraycopy", "(", "workingCopies", ",", "0", ",", "copies", ",", "0", ",", "length", ")", ";", "}", "else", "{", "copies", "=", "null", ";", "}", "this", ".", "typeHierarchy", "=", "new", "TypeHierarchy", "(", "element", ",", "copies", ",", "project", ",", "computeSubtypes", ")", ";", "}", "protected", "void", "executeOperation", "(", ")", "throws", "JavaModelException", "{", "this", ".", "typeHierarchy", ".", "refresh", "(", "this", ")", ";", "}", "public", "ITypeHierarchy", "getResult", "(", ")", "{", "return", "this", ".", "typeHierarchy", ";", "}", "public", "boolean", "isReadOnly", "(", ")", "{", "return", "true", ";", "}", "public", "IJavaModelStatus", "verify", "(", ")", "{", "IJavaElement", "elementToProcess", "=", "getElementToProcess", "(", ")", ";", "if", "(", "elementToProcess", "==", "null", "&&", "!", "(", "this", ".", "typeHierarchy", "instanceof", "RegionBasedTypeHierarchy", ")", ")", "{", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "NO_ELEMENTS_TO_PROCESS", ")", ";", "}", "if", "(", "elementToProcess", "!=", "null", "&&", "!", "elementToProcess", ".", "exists", "(", ")", ")", "{", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "ELEMENT_DOES_NOT_EXIST", ",", "elementToProcess", ")", ";", "}", "IJavaProject", "project", "=", "this", ".", "typeHierarchy", ".", "javaProject", "(", ")", ";", "if", "(", "project", "!=", "null", "&&", "!", "project", ".", "exists", "(", ")", ")", "{", "return", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "ELEMENT_DOES_NOT_EXIST", ",", "project", ")", ";", "}", "return", "JavaModelStatus", ".", "VERIFIED_OK", ";", "}", "}", "</s>" ]
3,699
[ "<s>", "package", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ";", "import", "org", ".", "eclipse", ".", "core", ".", "resources", ".", "IResource", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IPath", ";", "import", "org", ".", "eclipse", ".", "core", ".", "runtime", ".", "IProgressMonitor", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IBuffer", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaElement", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "IJavaModelStatusConstants", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "JavaModelException", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "ToolFactory", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "WorkingCopyOwner", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "compiler", ".", "CharOperation", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ".", "ClassFileBytesDisassembler", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "core", ".", "util", ".", "IClassFileReader", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Disassembler", ";", "import", "org", ".", "eclipse", ".", "jdt", ".", "internal", ".", "core", ".", "util", ".", "Util", ";", "public", "class", "ClassFileWorkingCopy", "extends", "CompilationUnit", "{", "public", "ClassFile", "classFile", ";", "public", "ClassFileWorkingCopy", "(", "ClassFile", "classFile", ",", "WorkingCopyOwner", "owner", ")", "{", "super", "(", "(", "PackageFragment", ")", "classFile", ".", "getParent", "(", ")", ",", "(", "(", "BinaryType", ")", "classFile", ".", "getType", "(", ")", ")", ".", "getSourceFileName", "(", "null", ")", ",", "owner", ")", ";", "this", ".", "classFile", "=", "classFile", ";", "}", "public", "void", "commitWorkingCopy", "(", "boolean", "force", ",", "IProgressMonitor", "monitor", ")", "throws", "JavaModelException", "{", "throw", "new", "JavaModelException", "(", "new", "JavaModelStatus", "(", "IJavaModelStatusConstants", ".", "INVALID_ELEMENT_TYPES", ",", "this", ")", ")", ";", "}", "public", "IBuffer", "getBuffer", "(", ")", "throws", "JavaModelException", "{", "if", "(", "isWorkingCopy", "(", ")", ")", "return", "super", ".", "getBuffer", "(", ")", ";", "else", "return", "this", ".", "classFile", ".", "getBuffer", "(", ")", ";", "}", "public", "char", "[", "]", "getContents", "(", ")", "{", "try", "{", "IBuffer", "buffer", "=", "getBuffer", "(", ")", ";", "if", "(", "buffer", "==", "null", ")", "return", "CharOperation", ".", "NO_CHAR", ";", "char", "[", "]", "characters", "=", "buffer", ".", "getCharacters", "(", ")", ";", "if", "(", "characters", "==", "null", ")", "return", "CharOperation", ".", "NO_CHAR", ";", "return", "characters", ";", "}", "catch", "(", "JavaModelException", "e", ")", "{", "return", "CharOperation", ".", "NO_CHAR", ";", "}", "}", "public", "IPath", "getPath", "(", ")", "{", "return", "this", ".", "classFile", ".", "getPath", "(", ")", ";", "}", "public", "IJavaElement", "getPrimaryElement", "(", "boolean", "checkOwner", ")", "{", "if", "(", "checkOwner", "&&", "isPrimary", "(", ")", ")", "return", "this", ";", "return", "new", "ClassFileWorkingCopy", "(", "this", ".", "classFile", ",", "DefaultWorkingCopyOwner", ".", "PRIMARY", ")", ";", "}", "public", "IResource", "resource", "(", "PackageFragmentRoot", "root", ")", "{", "if", "(", "root", ".", "isArchive", "(", ")", ")", "return", "root", ".", "resource", "(", "root", ")", ";", "return", "this", ".", "classFile", ".", "resource", "(", "root", ")", ";", "}", "protected", "IBuffer", "openBuffer", "(", "IProgressMonitor", "pm", ",", "Object", "info", ")", "throws", "JavaModelException", "{", "IBuffer", "buffer", "=", "this", ".", "owner", ".", "createBuffer", "(", "this", ")", ";", "if", "(", "buffer", "==", "null", ")", "return", "null", ";", "if", "(", "buffer", ".", "getCharacters", "(", ")", "==", "null", ")", "{", "IBuffer", "classFileBuffer", "=", "this", ".", "classFile", ".", "getBuffer", "(", ")", ";", "if", "(", "classFileBuffer", "!=", "null", ")", "{", "buffer", ".", "setContents", "(", "classFileBuffer", ".", "getCharacters", "(", ")", ")", ";", "}", "else", "{", "IClassFileReader", "reader", "=", "ToolFactory", ".", "createDefaultClassFileReader", "(", "this", ".", "classFile", ",", "IClassFileReader", ".", "ALL", ")", ";", "Disassembler", "disassembler", "=", "new", "Disassembler", "(", ")", ";", "String", "contents", "=", "disassembler", ".", "disassemble", "(", "reader", ",", "Util", ".", "getLineSeparator", "(", "\"\"", ",", "getJavaProject", "(", ")", ")", ",", "ClassFileBytesDisassembler", ".", "WORKING_COPY", ")", ";", "buffer", ".", "setContents", "(", "contents", ")", ";", "}", "}", "BufferManager", "bufManager", "=", "getBufferManager", "(", ")", ";", "bufManager", ".", "addBuffer", "(", "buffer", ")", ";", "buffer", ".", "addBufferChangedListener", "(", "this", ")", ";", "return", "buffer", ";", "}", "protected", "void", "toStringName", "(", "StringBuffer", "buffer", ")", "{", "buffer", ".", "append", "(", "this", ".", "classFile", ".", "getElementName", "(", ")", ")", ";", "}", "}", "</s>" ]