8160455: KSS : class.forName issue in TIFFImageMetadata.java

Reviewed-by: prr, bpb, serb
This commit is contained in:
Jayathirth D V 2016-08-09 13:55:27 +05:30
parent 0127b8e8b5
commit c4a6631fc1

@ -1465,8 +1465,14 @@ public class TIFFImageMetadata extends IIOMetadata {
String className = st.nextToken();
Object o = null;
Class<?> setClass = null;
try {
Class<?> setClass = Class.forName(className);
ClassLoader cl = TIFFImageMetadata.class.getClassLoader();
setClass = Class.forName(className, false, cl);
if (!TIFFTagSet.class.isAssignableFrom(setClass)) {
fatal(node, "TagSets in IFD must be subset of"
+ " TIFFTagSet class");
}
Method getInstanceMethod =
setClass.getMethod("getInstance", (Class[])null);
o = getInstanceMethod.invoke(null, (Object[])null);