/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* build @BUILD_TAG_PLACEHOLDER@
*
* @COPYRIGHT_MINI_LEGAL_NOTICE_PLACEHOLDER@
*/
/*
ClassLoader that knows how to fabricate exactly one class. The name
of the class is defined by the parameter singleClassName. When
asked to load a class, this loader first delegates to its parent as
usual, then, if that doesn't find the class and if the name is the
same as singleClassName, the class is fabricated. It is a public
class with no fields or methods and a single public no-arg
constructor that simply calls its parent's no-arg constructor. This
means that the parent must have a public or protected no-arg
constructor.
*/
super(parent);
try {
} catch (NoSuchMethodException e) {
throw new IllegalArgumentException("Superclass must have no-arg " +
"constructor");
}
"Superclass no-arg constructor must be public or protected";
throw new IllegalArgumentException(msg);
}
this.singleClassName = singleClassName;
final Class c;
try {
c = makeClass(superclass);
} catch (IOException e) {
throw new RuntimeException(e.toString());
}
this.singleClass = c;
}
cpoolIndex = 1;
// <init> method
// Code attribute
return
}
return singleClass;
else
throw new ClassNotFoundException(name);
}
return cpoolIndex++;
}
return cpoolIndex++;
}
throws IOException {
return cpoolIndex++;
}
throws IOException {
return cpoolIndex++;
}
private int cpoolIndex;
}