Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2000, 2013 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: IBM Corporation - initial API and implementation /
 
 package org.eclipse.jdt.internal.core;
 
 import java.util.Map;
 
 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;

See also:
IClassFile
 
 
 public class ClassFile extends Openable implements IClassFile, SuffixConstants {
 
 	protected String name;
 	protected BinaryType binaryType = null;
 
 /*
  * Creates a handle to a class file.
  */
 protected ClassFile(PackageFragment parentString nameWithoutExtension) {
 	super(parent);
 	this. = nameWithoutExtension;
 }
 
 /*
  * @see IClassFile#becomeWorkingCopy(IProblemRequestor, WorkingCopyOwner, IProgressMonitor)
  */
 public ICompilationUnit becomeWorkingCopy(IProblemRequestor problemRequestorWorkingCopyOwner owner, IProgressMonitor monitorthrows JavaModelException {
 	JavaModelManager manager = JavaModelManager.getJavaModelManager();
 	CompilationUnit workingCopy = new ClassFileWorkingCopy(thisowner == null ? . : owner);
 	JavaModelManager.PerWorkingCopyInfo perWorkingCopyInfo = manager.getPerWorkingCopyInfo(workingCopyfalse/*don't create*/true /*record usage*/null/*no problem requestor needed*/);
 	if (perWorkingCopyInfo == null) {
 		// close cu and its children
 		close();
 
 		BecomeWorkingCopyOperation operation = new BecomeWorkingCopyOperation(workingCopyproblemRequestor);
 		operation.runOperation(monitor);
 
 		return workingCopy;
 	}
 	return perWorkingCopyInfo.workingCopy;
 }

Creates the children elements for this class file adding the resulting new handles and info objects to the newElements table. Returns true if successful, or false if an error is encountered parsing the class file.

See also:
Openable
Signature
 
 protected boolean buildStructure(OpenableElementInfo info, IProgressMonitor pmMap newElements, IResource underlyingResourcethrows JavaModelException {
 	IBinaryType typeInfo = getBinaryTypeInfo((IFile) underlyingResource);
 	if (typeInfo == null) {
 		// The structure of a class file is unknown if a class file format errors occurred
 		//during the creation of the diet class file representative of this ClassFile.
 		info.setChildren(new IJavaElement[] {});
 		return false;
 	}
 
 	// Make the type
 	IType type = getType();
 	info.setChildren(new IJavaElement[] {type});
 	newElements.put(typetypeInfo);
 
 	// Read children
 	((ClassFileInfoinfo).readBinaryChildren(this, (HashMapnewElementstypeInfo);
 
 	return true;

Deprecated:
See also:
ICodeAssist.codeComplete(int, ICompletionRequestor)
public void codeComplete(int offsetICompletionRequestor requestorthrows JavaModelException {

Deprecated:
See also:
ICodeAssist.codeComplete(int, ICompletionRequestor, WorkingCopyOwner)
public void codeComplete(int offsetICompletionRequestor requestorWorkingCopyOwner ownerthrows JavaModelException {
	if (requestor == null) {
		throw new IllegalArgumentException("Completion requestor cannot be null"); //$NON-NLS-1$
	}
/* (non-Javadoc)
 * @see org.eclipse.jdt.core.ICodeAssist#codeComplete(int, org.eclipse.jdt.core.CompletionRequestor)
 */
public void codeComplete(int offsetCompletionRequestor requestorthrows JavaModelException {
/* (non-Javadoc)
 * @see org.eclipse.jdt.core.ICodeAssist#codeComplete(int, org.eclipse.jdt.core.CompletionRequestor, org.eclipse.core.runtime.IProgressMonitor)
 */
public void codeComplete(int offsetCompletionRequestor requestor, IProgressMonitor monitorthrows JavaModelException {
	codeComplete(offsetrequestor.monitor);
/* (non-Javadoc)
 * @see org.eclipse.jdt.core.ICodeAssist#codeComplete(int, org.eclipse.jdt.core.CompletionRequestor, org.eclipse.jdt.core.WorkingCopyOwner)
 */
public void codeComplete(int offsetCompletionRequestor requestorWorkingCopyOwner ownerthrows JavaModelException {
	codeComplete(offsetrequestorownernull);
/* (non-Javadoc)
 * @see org.eclipse.jdt.core.ICodeAssist#codeComplete(int, org.eclipse.jdt.core.CompletionRequestor, org.eclipse.jdt.core.WorkingCopyOwner, org.eclipse.core.runtime.IProgressMonitor)
 */
public void codeComplete(int offsetCompletionRequestor requestorWorkingCopyOwner owner, IProgressMonitor monitorthrows JavaModelException {
	String source = getSource();
	if (source != null) {
				null,
				getJavaProject()); // use project to retrieve corresponding .java IFile
		codeComplete(cucuoffsetrequestorownernull/*extended context isn't computed*/monitor);
	}

See also:
ICodeAssist.codeSelect(int, int)
public IJavaElement[] codeSelect(int offsetint lengththrows JavaModelException {
	return codeSelect(offsetlength.);

See also:
ICodeAssist.codeSelect(int, int, WorkingCopyOwner)
public IJavaElement[] codeSelect(int offsetint lengthWorkingCopyOwner ownerthrows JavaModelException {
	IBuffer buffer = getBuffer();
	char[] contents;
	if (buffer != null && (contents = buffer.getCharacters()) != null) {
	    BinaryType type = (BinaryTypegetType();
		return super.codeSelect(cuoffsetlengthowner);
else {
		//has no associated souce
		return new IJavaElement[] {};
	}
Returns a new element info for this element.
protected Object createElementInfo() {
	return new ClassFileInfo();
public boolean equals(Object o) {
	if (!(o instanceof ClassFile)) return false;
	ClassFile other = (ClassFileo;
	return this..equals(other.name) && this..equals(other.parent);
public boolean existsUsingJarTypeCache() {
		JavaModelManager manager = JavaModelManager.getJavaModelManager();
		IType type = getType();
		Object info = manager.getInfo(type);
			return false;
		else if (info != null)
			return true;
		// info is null
		JavaElementInfo parentInfo = (JavaElementInfomanager.getInfo(getParent());
		if (parentInfo != null) {
			// if parent is open, this class file must be in its children
			IJavaElement[] children = parentInfo.getChildren();
			for (int i = 0, length = children.lengthi < lengthi++) {
				if (this..equals(((ClassFilechildren[i]).))
					return true;
			}
			return false;
		}
		try {
			info = getJarBinaryTypeInfo((PackageFragmentgetParent(), true/*fully initialize so as to not keep a reference to the byte array*/);
catch (CoreException e) {
			// leave info null
catch (IOException e) {
			// leave info null
catch (ClassFormatException e) {
			// leave info null
		}
		manager.putJarTypeInfo(typeinfo == null ? . : info);
		return info != null;
else
		return exists();
Finds the deepest IJavaElement in the hierarchy of elt</elt>'s children (including elt itself) which has a source range that encloses position according to mapper.
protected IJavaElement findElement(IJavaElement eltint positionSourceMapper 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 = ((IParentelt).getChildren();
			for (int i = 0; i < children.lengthi++) {
				IJavaElement match = findElement(children[i], positionmapper);
				if (match != null) {
					return match;
				}
			}
catch (JavaModelException npe) {
			// elt doesn't exist: return the element
		}
	}
	return elt;

See also:
ITypeRoot.findPrimaryType()
	IType primaryTypegetType();
	if (primaryType.exists()) {
		return primaryType;
	}
	return null;
public String getAttachedJavadoc(IProgressMonitor monitorthrows JavaModelException {
	return getType().getAttachedJavadoc(monitor);
Returns the ClassFileReaderspecific for this IClassFile, based on its underlying resource, or null if unable to create the diet class file. There are two cases to consider:
  • a class file corresponding to an IFile resource
  • a class file corresponding to a zip entry in a JAR

Throws:
JavaModelException when the IFile resource or JAR is not available or when this class file is not present in the JAR
public IBinaryType getBinaryTypeInfo(IFile filethrows JavaModelException {
	return getBinaryTypeInfo(filetrue/*fully initialize so as to not keep a reference to the byte array*/);
public IBinaryType getBinaryTypeInfo(IFile fileboolean fullyInitializethrows JavaModelException {
	if (pkg instanceof JarPackageFragment) {
		try {
			IBinaryType info = getJarBinaryTypeInfo((PackageFragmentpkgfullyInitialize);
			if (info == null) {
			}
			return info;
catch (ClassFormatException cfe) {
			//the structure remains unknown
			if (JavaCore.getPlugin().isDebugging()) {
			}
			return null;
catch (IOException ioe) {
catch (CoreException e) {
			if (e instanceof JavaModelException) {
else {
				throw new JavaModelException(e);
			}
		}
else {
		byte[] contents = Util.getResourceContentsAsByteArray(file);
		try {
			return new ClassFileReader(contentsfile.getFullPath().toString().toCharArray(), fullyInitialize);
catch (ClassFormatException cfe) {
			//the structure remains unknown
			return null;
		}
	}
public byte[] getBytes() throws JavaModelException {
	if (pkg instanceof JarPackageFragment) {
		ZipFile zip = null;
		try {
			zip = root.getJar();
			String entryName = Util.concatWith(((PackageFragmentpkg).getElementName(), '/');
			ZipEntry ze = zip.getEntry(entryName);
			if (ze != null) {
				return org.eclipse.jdt.internal.compiler.util.Util.getZipEntryByteContent(zezip);
			}
catch (IOException ioe) {
catch (CoreException e) {
			if (e instanceof JavaModelException) {
else {
				throw new JavaModelException(e);
			}
finally {
			JavaModelManager.getJavaModelManager().closeZipFile(zip);
		}
else {
		IFile file = (IFile) resource();
	}
private IBinaryType getJarBinaryTypeInfo(PackageFragment pkgboolean fullyInitializethrows CoreException, IOExceptionClassFormatException {
	ZipFile zip = null;
	try {
		zip = root.getJar();
		String entryName = Util.concatWith(pkg.namesgetElementName(), '/');
		ZipEntry ze = zip.getEntry(entryName);
		if (ze != null) {
			byte contents[] = org.eclipse.jdt.internal.compiler.util.Util.getZipEntryByteContent(zezip);
			String fileName = root.getHandleIdentifier() + . + entryName;
			return new ClassFileReader(contentsfileName.toCharArray(), fullyInitialize);
		}
finally {
		JavaModelManager.getJavaModelManager().closeZipFile(zip);
	}
	return null;
public IBuffer getBuffer() throws JavaModelException {
	IStatus status = validateClassFile();
	if (status.isOK()) {
		return super.getBuffer();
else {
		switch (status.getCode()) {
		case .// don't throw a JavaModelException to be able to open .class file outside the classpath (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=138507 )
		case .// don't throw a JavaModelException to be able to open .class file in proj==src case without source (see https://bugs.eclipse.org/bugs/show_bug.cgi?id=221904 )
			return null;
		default:
			throw new JavaModelException((IJavaModelStatusstatus);
		}
	}

See also:
IMember
	return this;

See also:
IMember.getTypeRoot()
	return this;
A class file has a corresponding resource unless it is contained in a jar.

See also:
IJavaElement
public IResource getCorrespondingResource() throws JavaModelException {
	if (root.isArchive()) {
		return null;
else {
	}

See also:
IClassFile
public IJavaElement getElementAt(int positionthrows JavaModelException {
	IJavaElement parentElement = getParent();
	while (parentElement.getElementType() != .) {
		parentElement = parentElement.getParent();
	}
	PackageFragmentRoot root = (PackageFragmentRootparentElement;
	SourceMapper mapper = root.getSourceMapper();
	if (mapper == null) {
		return null;
else {
		// ensure this class file's buffer is open so that source ranges are computed
		IType type = getType();
		return findElement(typepositionmapper);
	}
	SourceMapper mapper = root.getSourceMapper();
	if (mapper == null) {
		return null;
else {
		int index = this..indexOf('$');
		int prefixLength = index < 0 ? this..length() : index;
		IType type = null;
		int start = -1;
		int end = .;
		IJavaElement[] children = fragment.getChildren();
		for (int i = 0; i < children.lengthi++) {
			String childName = children[i].getElementName();
			int childIndex = childName.indexOf('$');
			int childPrefixLength = childIndex < 0 ? childName.indexOf('.') : childIndex;
			if (prefixLength == childPrefixLength && this..regionMatches(0, childName, 0, prefixLength)) {
				IClassFile classFile = (IClassFilechildren[i];
				// ensure this class file's buffer is open so that source ranges are computed
				classFile.getBuffer();
				SourceRange range = mapper.getSourceRange(classFile.getType());
				if (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(typepositionmapper);
		}
		return null;
	}

See also:
IJavaElement
public int getElementType() {
	return ;
/*
 * @see JavaElement
 */
	switch (token.charAt(0)) {
		case :
			if (!memento.hasMoreTokens()) return this;
			String typeName = memento.nextToken();
			JavaElement type = new BinaryType(thistypeName);
			return type.getHandleFromMemento(mementoowner);
	}
	return null;

See also:
JavaElement.getHandleMemento()
protected char getHandleMementoDelimiter() {
/*
 * @see IJavaElement
 */
public IPath getPath() {
	if (root.isArchive()) {
		return root.getPath();
else {
		return getParent().getPath().append(getElementName());
	}
/*
 * @see IJavaElement
 */
public IResource resource(PackageFragmentRoot root) {
	return ((IContainer) ((Openablethis.).resource(root)).getFile(new Path(getElementName()));

See also:
ISourceReference
public String getSource() throws JavaModelException {
	IBuffer buffer = getBuffer();
	if (buffer == null) {
		return null;
	}
	return buffer.getContents();

See also:
ISourceReference
	IBuffer buffer = getBuffer();
	if (buffer != null) {
		String contents = buffer.getContents();
		if (contents == nullreturn null;
		return new SourceRange(0, contents.length());
else {
		return null;
	}
/*
 * Returns the name of the toplevel type of this class file.
 */
    String topLevelTypeName = getElementName();
    int firstDollar = topLevelTypeName.indexOf('$');
    if (firstDollar != -1) {
        topLevelTypeName = topLevelTypeName.substring(0, firstDollar);
    } else {
        topLevelTypeName = topLevelTypeName.substring(0, topLevelTypeName.length()-.);
    }
    return topLevelTypeName;

See also:
IClassFile
public IType getType() {
	if (this. == null) {
		this. = new BinaryType(thisgetTypeName());
	}
	return this.;
public String getTypeName() {
	// Internal class file name doesn't contain ".class" file extension
	int lastDollar = this..lastIndexOf('$');
	return lastDollar > -1 ? Util.localTypeName(this.lastDollarthis..length()) : this.;
/*
 * @see IClassFile
 */
public ICompilationUnit getWorkingCopy(WorkingCopyOwner owner, IProgressMonitor monitorthrows JavaModelException {
	CompilationUnit workingCopy = new ClassFileWorkingCopy(thisowner == null ? . : owner);
	JavaModelManager manager = JavaModelManager.getJavaModelManager();
	JavaModelManager.PerWorkingCopyInfo perWorkingCopyInfo =
		manager.getPerWorkingCopyInfo(workingCopyfalse/*don't create*/true/*record usage*/null/*not used since don't create*/);
	if (perWorkingCopyInfo != null) {
		return perWorkingCopyInfo.getWorkingCopy(); // return existing handle instead of the one created above
	}
	op.runOperation(monitor);
	return workingCopy;

Deprecated:
See also:
IClassFile
public IJavaElement getWorkingCopy(IProgressMonitor monitororg.eclipse.jdt.core.IBufferFactory factorythrows JavaModelException {
	return getWorkingCopy(BufferFactoryWrapper.create(factory), monitor);

See also:
Openable
protected boolean hasBuffer() {
	return true;
public int hashCode() {
	return Util.combineHashCodes(this..hashCode(), this..hashCode());

See also:
IClassFile
public boolean isClass() throws JavaModelException {
	return getType().isClass();

See also:
IClassFile
public boolean isInterface() throws JavaModelException {
	return getType().isInterface();
Returns true - class files are always read only.
public boolean isReadOnly() {
	return true;
private IStatus validateClassFile() {
	try {
catch (JavaModelException e) {
		return e.getJavaModelStatus();
	}
	return JavaConventions.validateClassFileName(getElementName(), project.getOption(.true), project.getOption(.true));
Opens and returns buffer on the source code associated with this class file. Maps the source code to the children elements of this class file. If no source code is associated with this class file, null is returned.

See also:
Openable
protected IBuffer openBuffer(IProgressMonitor pmObject infothrows JavaModelException {
	// Check the cache for the top-level type first
	IType outerMostEnclosingType = getOuterMostEnclosingType();
	IBuffer buffer = getBufferManager().getBuffer(outerMostEnclosingType.getClassFile());
	if (buffer == null) {
		IBinaryType typeInfo = info instanceof IBinaryType ? (IBinaryTypeinfo : null;
		if (mapper != null) {
			buffer = mapSource(mappertypeInfoouterMostEnclosingType.getClassFile());
		}
	}
	return buffer;
Loads the buffer via SourceMapper, and maps it in SourceMapper
private IBuffer mapSource(SourceMapper mapperIBinaryType infoIClassFile bufferOwner) {
	char[] contents = mapper.findSource(getType(), info);
	if (contents != null) {
		// create buffer
		IBuffer buffer = BufferManager.createBuffer(bufferOwner);
		if (buffer == nullreturn null;
		bufManager.addBuffer(buffer);
		// set the buffer source
		if (buffer.getCharacters() == null){
			buffer.setContents(contents);
		}
		// listen to buffer changes
		// do the source mapping
		mapper.mapSource(getOuterMostEnclosingType(), contentsinfo);
		return buffer;
else {
		// create buffer
		IBuffer buffer = BufferManager.createNullBuffer(bufferOwner);
		if (buffer == nullreturn null;
		bufManager.addBuffer(buffer);
		// listen to buffer changes
		return buffer;
	}
/* package */ 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(simpleNamelastDollarsimpleName.length());
	else
		return simpleName;
Returns the type of the top-level declaring class used to find the source code
	IType type = getType();
	IType enclosingType = type.getDeclaringType();
	while (enclosingType != null) {
		type = enclosingType;
		enclosingType = type.getDeclaringType();
	}
	return type;
Returns the Java Model representation of the given name which is provided in diet class file format, or null if the given name is null.

ClassFileReader format is similar to "java/lang/Object", and corresponding Java Model format is "java.lang.Object".

public static char[] translatedName(char[] name) {
	if (name == null)
		return null;
	int nameLength = name.length;
	char[] newNamenew char[nameLength];
	for (int i= 0; i < nameLengthi++) {
		if (name[i] == '/') {
			newName[i]= '.';
else {
			newName[i]= name[i];
		}
	}
	return newName;
Returns the Java Model representation of the given names which are provided in diet class file format, or null if the given names are null.

ClassFileReader format is similar to "java/lang/Object", and corresponding Java Model format is "java.lang.Object".

/* package */ static char[][] translatedNames(char[][] names) {
	if (names == null)
		return null;
	int length = names.length;
	char[][] newNames = new char[length][];
	for(int i = 0; i < lengthi++) {
		newNames[i] = translatedName(names[i]);
	}
	return newNames;
Returns the Java Model format of the unqualified class name for the given className which is provided in diet class file format, or null if the given className is null. (This removes the package name, but not enclosing type names).

ClassFileReader format is similar to "java/lang/Object", and corresponding Java Model simple name format is "Object".

/* package */ 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(classNamei + 1, name, 0, count);
			return name;
		}
		count++;
	}
	return className;

Deprecated:
- should use codeComplete(int, ICompletionRequestor) instead
See also:
ICodeAssist.codeComplete(int, ICodeCompletionRequestor)
public void codeComplete(int offsetfinal org.eclipse.jdt.core.ICodeCompletionRequestor requestorthrows JavaModelException {
	if (requestor == null){
		return;
	}
		offset,
			public void acceptAnonymousType(char[] superTypePackageName,char[] superTypeNamechar[][] parameterPackageNames,char[][] parameterTypeNames,char[][] parameterNames,char[] completionName,int modifiers,int completionStart,int completionEndint relevance) {
				// ignore
			}
			public void acceptClass(char[] packageNamechar[] classNamechar[] completionNameint modifiersint completionStartint completionEndint relevance) {
				requestor.acceptClass(packageNameclassNamecompletionNamemodifierscompletionStartcompletionEnd);
			}
			public void acceptError(IProblem error) {
				// was disabled in 1.0
			}
			public void acceptField(char[] declaringTypePackageNamechar[] declaringTypeNamechar[] fieldNamechar[] typePackageNamechar[] typeNamechar[] completionNameint modifiersint completionStartint completionEndint relevance) {
				requestor.acceptField(declaringTypePackageNamedeclaringTypeNamefieldNametypePackageNametypeNamecompletionNamemodifierscompletionStartcompletionEnd);
			}
			public void acceptInterface(char[] packageName,char[] interfaceName,char[] completionName,int modifiers,int completionStart,int completionEndint relevance) {
				requestor.acceptInterface(packageNameinterfaceNamecompletionNamemodifierscompletionStartcompletionEnd);
			}
			public void acceptKeyword(char[] keywordName,int completionStart,int completionEndint relevance){
				requestor.acceptKeyword(keywordNamecompletionStartcompletionEnd);
			}
			public void acceptLabel(char[] labelName,int completionStart,int completionEndint relevance){
				requestor.acceptLabel(labelNamecompletionStartcompletionEnd);
			}
			public void acceptLocalVariable(char[] localVarName,char[] typePackageName,char[] typeName,int modifiers,int completionStart,int completionEndint relevance){
				// ignore
			}
			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 completionEndint relevance){
				// skip parameter names
				requestor.acceptMethod(declaringTypePackageNamedeclaringTypeNameselectorparameterPackageNamesparameterTypeNamesreturnTypePackageNamereturnTypeNamecompletionNamemodifierscompletionStartcompletionEnd);
			}
			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 completionEndint relevance){
				// ignore
			}
			public void acceptModifier(char[] modifierName,int completionStart,int completionEndint relevance){
				requestor.acceptModifier(modifierNamecompletionStartcompletionEnd);
			}
			public void acceptPackage(char[] packageName,char[] completionName,int completionStart,int completionEndint relevance){
				requestor.acceptPackage(packageNamecompletionNamecompletionStartcompletionEnd);
			}
			public void acceptType(char[] packageName,char[] typeName,char[] completionName,int completionStart,int completionEndint relevance){
				requestor.acceptType(packageNametypeNamecompletionNamecompletionStartcompletionEnd);
			}
			public void acceptVariableName(char[] typePackageName,char[] typeName,char[] varName,char[] completionName,int completionStart,int completionEndint relevance){
				// ignore
			}
		});
protected IStatus validateExistence(IResource underlyingResource) {
	// check whether the class file can be opened
	IStatus status = validateClassFile();
	if (!status.isOK())
		return status;
	if (underlyingResource != null) {
		if (!underlyingResource.isAccessible())
		if ((underlyingResource instanceof IFolder) && (root = getPackageFragmentRoot()).isArchive()) { // see https://bugs.eclipse.org/bugs/show_bug.cgi?id=204652
			return root.newDoesNotExistStatus();
		}
	}
	return null;
New to GrepCode? Check out our FAQ X