String dirName = packageName.replace('.', '/') + "/";
String dirName = packageName.replace('.', '/') + '/';
	protected Class defineClass(String name, byte[] classbytes, int off, int len, ClasspathEntry classpathEntry) throws ClassFormatError {		// Define the package if it is not the default package.		int lastIndex = name.lastIndexOf('.');		if (lastIndex != -1) {			String packageName = name.substring(0, lastIndex);			Package pkg = getPackage(packageName);			if (pkg == null) {				// get info about the package from the classpath entry's manifest.				String specTitle = null, specVersion = null, specVendor = null, implTitle = null, implVersion = null, implVendor = null;				Manifest mf = ((EclipseClasspathEntry) classpathEntry).getManifest();				if (mf != null) {					Attributes mainAttributes = mf.getMainAttributes();					String dirName = packageName.replace('.', '/') + "/";					Attributes packageAttributes = mf.getAttributes(dirName);					boolean noEntry = false;					if (packageAttributes == null) {						noEntry = true;						packageAttributes = mainAttributes;					}					specTitle = packageAttributes.getValue(Attributes.Name.SPECIFICATION_TITLE);					if (specTitle == null && !noEntry)						specTitle = mainAttributes.getValue(Attributes.Name.SPECIFICATION_TITLE);					specVersion = packageAttributes.getValue(Attributes.Name.SPECIFICATION_VERSION);					if (specVersion == null && !noEntry)						specVersion = mainAttributes.getValue(Attributes.Name.SPECIFICATION_VERSION);					specVendor = packageAttributes.getValue(Attributes.Name.SPECIFICATION_VENDOR);					if (specVendor == null && !noEntry)						specVendor = mainAttributes.getValue(Attributes.Name.SPECIFICATION_VENDOR);					implTitle = packageAttributes.getValue(Attributes.Name.IMPLEMENTATION_TITLE);					if (implTitle == null && !noEntry)						implTitle = mainAttributes.getValue(Attributes.Name.IMPLEMENTATION_TITLE);					implVersion = packageAttributes.getValue(Attributes.Name.IMPLEMENTATION_VERSION);					if (implVersion == null && !noEntry)						implVersion = mainAttributes.getValue(Attributes.Name.IMPLEMENTATION_VERSION);					implVendor = packageAttributes.getValue(Attributes.Name.IMPLEMENTATION_VENDOR);					if (implVendor == null && !noEntry)						implVendor = mainAttributes.getValue(Attributes.Name.IMPLEMENTATION_VENDOR);				}				// The package is not defined yet define it before we define the class.				// TODO still need to seal packages.				definePackage(packageName, specTitle, specVersion, specVendor, implTitle, implVersion, implVendor, null);			}		}		return super.defineClass(name, classbytes, off, len, classpathEntry);	}