diff options
author | Marc R. Hoffmann <hoffmann@mountainminds.com> | 2015-10-12 08:41:39 +0200 |
---|---|---|
committer | Marc R. Hoffmann <hoffmann@mountainminds.com> | 2015-10-12 08:41:39 +0200 |
commit | 024536619572c1ad5274cbe6872ea8068a9498ac (patch) | |
tree | b482bc625a72a37ed8b1af4ba4024b23effc3d7c /org.jacoco.core | |
parent | 2c73d99ac91de90576210cc77c9e1e067719c02b (diff) | |
download | jacoco-024536619572c1ad5274cbe6872ea8068a9498ac.tar.gz |
Clarify semantic of location parameter.
Diffstat (limited to 'org.jacoco.core')
-rw-r--r-- | org.jacoco.core/src/org/jacoco/core/analysis/Analyzer.java | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/org.jacoco.core/src/org/jacoco/core/analysis/Analyzer.java b/org.jacoco.core/src/org/jacoco/core/analysis/Analyzer.java index 623a1b69..466cdcd3 100644 --- a/org.jacoco.core/src/org/jacoco/core/analysis/Analyzer.java +++ b/org.jacoco.core/src/org/jacoco/core/analysis/Analyzer.java @@ -112,17 +112,17 @@ public class Analyzer { * * @param buffer * class definitions - * @param name - * a name used for exception messages + * @param location + * a location description used for exception messages * @throws IOException * if the class can't be analyzed */ - public void analyzeClass(final byte[] buffer, final String name) + public void analyzeClass(final byte[] buffer, final String location) throws IOException { try { analyzeClass(new ClassReader(buffer)); } catch (final RuntimeException cause) { - throw analyzerError(name, cause); + throw analyzerError(location, cause); } } @@ -131,24 +131,24 @@ public class Analyzer { * * @param input * stream to read class definition from - * @param name - * a name used for exception messages + * @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 name) + public void analyzeClass(final InputStream input, final String location) throws IOException { try { analyzeClass(new ClassReader(input)); } catch (final RuntimeException e) { - throw analyzerError(name, e); + throw analyzerError(location, e); } } - private IOException analyzerError(final String name, + private IOException analyzerError(final String location, final RuntimeException cause) { final IOException ex = new IOException(String.format( - "Error while analyzing class %s.", name)); + "Error while analyzing %s.", location)); ex.initCause(cause); return ex; } @@ -161,25 +161,25 @@ public class Analyzer { * * @param input * input data - * @param name - * a name used for exception messages + * @param location + * a location description used for exception messages * @return number of class files found * @throws IOException * if the stream can't be read or a class can't be analyzed */ - public int analyzeAll(final InputStream input, final String name) + public int analyzeAll(final InputStream input, final String location) throws IOException { final ContentTypeDetector detector = new ContentTypeDetector(input); switch (detector.getType()) { case ContentTypeDetector.CLASSFILE: - analyzeClass(detector.getInputStream(), name); + analyzeClass(detector.getInputStream(), location); return 1; case ContentTypeDetector.ZIPFILE: - return analyzeZip(detector.getInputStream(), name); + return analyzeZip(detector.getInputStream(), location); case ContentTypeDetector.GZFILE: - return analyzeGzip(detector.getInputStream(), name); + return analyzeGzip(detector.getInputStream(), location); case ContentTypeDetector.PACK200FILE: - return analyzePack200(detector.getInputStream(), name); + return analyzePack200(detector.getInputStream(), location); default: return 0; } @@ -237,25 +237,25 @@ public class Analyzer { return count; } - private int analyzeZip(final InputStream input, final String name) + private int analyzeZip(final InputStream input, final String location) throws IOException { final ZipInputStream zip = new ZipInputStream(input); ZipEntry entry; int count = 0; while ((entry = zip.getNextEntry()) != null) { - count += analyzeAll(zip, name + "@" + entry.getName()); + count += analyzeAll(zip, location + "@" + entry.getName()); } return count; } - private int analyzeGzip(final InputStream input, final String name) + private int analyzeGzip(final InputStream input, final String location) throws IOException { - return analyzeAll(new GZIPInputStream(input), name); + return analyzeAll(new GZIPInputStream(input), location); } - private int analyzePack200(final InputStream input, final String name) + private int analyzePack200(final InputStream input, final String location) throws IOException { - return analyzeAll(Pack200Streams.unpack(input), name); + return analyzeAll(Pack200Streams.unpack(input), location); } } |