Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2000, 2006 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.eval;
An environment that wraps the client's name environment. This wrapper always considers the wrapped environment then if the name is not found, it search in the code snippet support. This includes the super class org.eclipse.jdt.internal.eval.target.CodeSnippet as well as the global variable classes.
Creates a new wrapper for the given environment.
	this. = env;
	this. = context;
public NameEnvironmentAnswer findType(char[][] compoundTypeName) {
	NameEnvironmentAnswer result = this..findType(compoundTypeName);
	if (result != null) {
		return result;
	}
	if (CharOperation.equals(compoundTypeName)) {
		if (binary == null) {
			return null;
else {
			return new NameEnvironmentAnswer(binarynull /*no access restriction*/);
		}
	}
	VariablesInfo installedVars = this..;
	ClassFile[] classFiles = installedVars.classFiles;
	for (int i = 0; i < classFiles.lengthi++) {
		ClassFile classFile = classFiles[i];
		if (CharOperation.equals(compoundTypeNameclassFile.getCompoundName())) {
			ClassFileReader binary = null;
			try {
				binary = new ClassFileReader(classFile.getBytes(), null);
catch (ClassFormatException e) {
				e.printStackTrace();  // Should never happen since we compiled this type
				return null;
			}
			return new NameEnvironmentAnswer(binarynull /*no access restriction*/);
		}
	}
	return null;
public NameEnvironmentAnswer findType(char[] typeNamechar[][] packageName) {
	NameEnvironmentAnswer result = this..findType(typeNamepackageName);
	if (result != null) {
		return result;
	}
	return findType(CharOperation.arrayConcat(packageNametypeName));
public boolean isPackage(char[][] parentPackageNamechar[] packageName) {
	return this..isPackage(parentPackageNamepackageName);
public void cleanup() {
	this..cleanup();
New to GrepCode? Check out our FAQ X