private void parseClassName ( ICodeBaseEntry entry ) { DataInputStream in = null ; try { InputStream resourceIn = entry . openResource ( ) ; if ( resourceIn == null ) { throw new NullPointerException ( "Got null resource" ) ; } in = new DataInputStream ( resourceIn ) ; ClassParserInterface parser = new ClassParser ( in , null , entry ) ; ClassNameAndSuperclassInfo . Builder builder = new ClassNameAndSuperclassInfo . Builder ( ) ; parser . parse ( builder ) ; String trueResourceName = builder . build ( ) . getClassDescriptor ( ) . toResourceName ( ) ; if ( ! trueResourceName . equals ( entry . getResourceName ( ) ) ) { entry . overrideResourceName ( trueResourceName ) ; } } catch ( IOException e ) { errorLogger . logError ( "Invalid class resource " + entry . getResourceName ( ) + " in " + entry , e ) ; } catch ( InvalidClassFileFormatException e ) { errorLogger . logError ( "Invalid class resource " + entry . getResourceName ( ) + " in " + entry , e ) ; } finally { IO . close ( in ) ; } }
Attempt to parse data of given resource in order to divine the real name of the class contained in the resource .