Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2000, 2010 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.compiler.lookup;
 
Denote a raw type, i.e. a generic type referenced without any type arguments. e.g. X<T extends Exception> can be used a raw type 'X', in which case it will behave as X<Exception>
 
 public class RawTypeBinding extends ParameterizedTypeBinding {

    
Raw type arguments are erasure of respective parameter bounds. But we may not have resolved these bounds yet if creating raw types while supertype hierarchies are being connected. Therefore, use 'null' instead, and access these in a lazy way later on (when substituting).
 
 	public RawTypeBinding(ReferenceBinding typeReferenceBinding enclosingTypeLookupEnvironment environment){
 		super(typenullenclosingTypeenvironment);
 		if ((type.tagBits & .) != 0) {
 			if (type instanceof MissingTypeBinding) {
 			} else if (type instanceof ParameterizedTypeBinding) {
 				ParameterizedTypeBinding parameterizedTypeBinding = (ParameterizedTypeBindingtype;
 				if (parameterizedTypeBinding.genericType() instanceof MissingTypeBinding) {
 				}
 			}
 		}
 		if (enclosingType != null && (enclosingType.tagBits & .) != 0) {
 			if (enclosingType instanceof MissingTypeBinding) {
 			} else if (enclosingType instanceof ParameterizedTypeBinding) {
 				ParameterizedTypeBinding parameterizedTypeBinding = (ParameterizedTypeBindingenclosingType;
 				if (parameterizedTypeBinding.genericType() instanceof MissingTypeBinding) {
 				}
 			}
 		}
 		if (enclosingType == null || (enclosingType.modifiers & .) == 0) {
 			this. &= ~.// only need signature if enclosing needs one
 		}
 	}
 
 	public char[] computeUniqueKey(boolean isLeaf) {
 	    StringBuffer sig = new StringBuffer(10);
 		    char[] typeSig = enclosingType().computeUniqueKey(false/*not a leaf*/);
 		    sig.append(typeSig, 0, typeSig.length-1); // copy all but trailing semicolon
 		    sig.append('.').append(sourceName()).append('<').append('>').append(';');
 		} else {
 		     sig.append(genericType().computeUniqueKey(false/*not a leaf*/));
 		     sig.insert(sig.length()-1, "<>"); //$NON-NLS-1$
 		}
 
 		int sigLength = sig.length();
 		char[] uniqueKey = new char[sigLength];
 		sig.getChars(0, sigLengthuniqueKey, 0);
 		return uniqueKey;
    	}

 
 		if (originalMethod.typeVariables == . || originalMethod.isStatic()) {
 			return super.createParameterizedMethod(originalMethod);
 		}
 		return this..createParameterizedGenericMethod(originalMethodthis);
 	}
 
 	public int kind() {
 		return ;
 	}

 
 	public String debugName() {
 	    StringBuffer nameBuffer = new StringBuffer(10);
 		nameBuffer.append(actualType().sourceName()).append("#RAW"); //$NON-NLS-1$
 	    return nameBuffer.toString();
 	}

Ltype<param1 ... paramN>; LY;
 
 	public char[] genericTypeSignature() {
		if (this. == null) {
else {
			    StringBuffer sig = new StringBuffer(10);
			    if (isMemberType()) {
			    	ReferenceBinding enclosing = enclosingType();
					char[] typeSig = enclosing.genericTypeSignature();
					sig.append(typeSig, 0, typeSig.length-1);// copy all but trailing semicolon
			    	if ((enclosing.modifiers & .) != 0) {
			    		sig.append('.');
			    	} else {
			    		sig.append('$');
			    	}
			    	sig.append(sourceName());
			    } else {
			    	char[] typeSig = genericType().signature();
					sig.append(typeSig, 0, typeSig.length-1);// copy all but trailing semicolon
		    	}
				sig.append(';');
				int sigLength = sig.length();
				this. = new char[sigLength];
				sig.getChars(0, sigLengththis., 0);
			}
		}
	}
    public boolean isEquivalentTo(TypeBinding otherType) {
		if (this == otherType || erasure() == otherType)
		    return true;
	    if (otherType == null)
	        return false;
	    switch(otherType.kind()) {
	    	case . :
	        	return ((WildcardBindingotherType).boundCheck(this);
	    	case . :
	    	case . :
	    	case . :
	            return erasure() == otherType.erasure();
	    }
        return false;
	}
    public boolean isProvablyDistinct(TypeBinding otherType) {
		if (this == otherType || erasure() == otherType// https://bugs.eclipse.org/bugs/show_bug.cgi?id=329588
		    return false;
	    if (otherType == null)
	        return true;
	    switch(otherType.kind()) {
	    	case . :
	    	case . :
	    	case . :
	            return erasure() != otherType.erasure();
	    }
        return true;
	}
	protected void initializeArguments() {
		int length = typeVariables.length;
		TypeBinding[] typeArguments = new TypeBinding[length];
		for (int i = 0; i < lengthi++) {
			// perform raw conversion on variable upper bound - could cause infinite regression if arguments were initialized lazily
		    typeArguments[i] = this..convertToRawType(typeVariables[i].erasure(), false /*do not force conversion of enclosing types*/);
		}
		this. = typeArguments;
	}
	public char[] readableName() /*java.lang.Object,  p.X<T> */ {
	    char[] readableName;
		if (isMemberType()) {
			readableName = CharOperation.concat(enclosingType().readableName(), this.'.');
else {
			readableName = CharOperation.concatWith(actualType().'.');
		}
		return readableName;
	}

	public char[] shortReadableName() /*Object*/ {
	    char[] shortReadableName;
		if (isMemberType()) {
			shortReadableName = CharOperation.concat(enclosingType().shortReadableName(), this.'.');
else {
			shortReadableName = actualType().;
		}
		return shortReadableName;
	}
New to GrepCode? Check out our FAQ X