A problem of api: Analyzer # analyzeClass

40 views
Skip to first unread message

赵无敌

unread,
Oct 12, 2023, 2:35:05 AM10/12/23
to JaCoCo and EclEmma Users
I got a problem using jacoco ,
the   stack trace shows the error was happened at Analyzer # analyzeClass

/**
 * Analyzes the class definition from a given input stream. The provided
 * {@link InputStream} is not closed by this method.
 *
 * @param input
 *            stream to read class definition from
 * @param location
 *            a location description used for exception messages
 * @throws IOException
 *             if the stream can't be read or the class can't be analyzed
 */
public void analyzeClass(final InputStream input, final String location)
      throws IOException {
   final byte[] buffer;
   try {
      buffer = InputStreams.readFully(input);
   } catch (final IOException e) {
      throw analyzerError(location, e);
   }
   analyzeClass(buffer, location);
}

how to understand the  ' if the stream can't be read or the class can't be analyzed  ?'

Marc R. Hoffmann

unread,
Oct 16, 2023, 4:35:17 AM10/16/23
to JaCoCo and EclEmma Users
Hi,

if the underlying stream throws an IOException or if the content of the stream causes a problem, for example in case of invalid class file formats.

Regards,
-marc
Reply all
Reply to author
Forward
0 new messages