null
the current
- * working directory is used as the base for relative path
- * entries
- * @return number of class files found
- * @throws IOException if a file can't be read or a class can't be analyzed
- */
- public int analyzeAll(final String path, final File basedir)
- throws IOException {
- int count = 0;
- final StringTokenizer st = new StringTokenizer(path,
- File.pathSeparator);
- while (st.hasMoreTokens()) {
- count += analyzeAll(new File(basedir, st.nextToken()));
- }
- return count;
- }
+ /**
+ * Analyzes all classes from the given class path. Directories containing
+ * class files as well as archive files are considered.
+ *
+ * @param path
+ * path definition
+ * @param basedir
+ * optional base directory, if null
the current
+ * working directory is used as the base for relative path
+ * entries
+ * @return number of class files found
+ * @throws IOException
+ * if a file can't be read or a class can't be analyzed
+ */
+ public int analyzeAll(final String path, final File basedir)
+ throws IOException {
+ int count = 0;
+ final StringTokenizer st = new StringTokenizer(path,
+ File.pathSeparator);
+ while (st.hasMoreTokens()) {
+ count += analyzeAll(new File(basedir, st.nextToken()));
+ }
+ return count;
+ }
- private int analyzeZip(final InputStream input, final String location)
- throws IOException {
- final ZipInputStream zip = new ZipInputStream(input);
- ZipEntry entry;
- int count = 0;
- while ((entry = nextEntry(zip, location)) != null) {
- count += analyzeAll(zip, location + "@" + entry.getName());
- }
- return count;
- }
+ private int analyzeZip(final InputStream input, final String location)
+ throws IOException {
+ final ZipInputStream zip = new ZipInputStream(input);
+ ZipEntry entry;
+ int count = 0;
+ while ((entry = nextEntry(zip, location)) != null) {
+ count += analyzeAll(zip, location + "@" + entry.getName());
+ }
+ return count;
+ }
- private ZipEntry nextEntry(final ZipInputStream input,
- final String location) throws IOException {
- try {
- return input.getNextEntry();
- } catch (final IOException e) {
- throw analyzerError(location, e);
- }
- }
+ private ZipEntry nextEntry(final ZipInputStream input,
+ final String location) throws IOException {
+ try {
+ return input.getNextEntry();
+ } catch (final IOException e) {
+ throw analyzerError(location, e);
+ }
+ }
- private int analyzeGzip(final InputStream input, final String location)
- throws IOException {
- GZIPInputStream gzipInputStream;
- try {
- gzipInputStream = new GZIPInputStream(input);
- } catch (final IOException e) {
- throw analyzerError(location, e);
- }
- return analyzeAll(gzipInputStream, location);
- }
+ private int analyzeGzip(final InputStream input, final String location)
+ throws IOException {
+ GZIPInputStream gzipInputStream;
+ try {
+ gzipInputStream = new GZIPInputStream(input);
+ } catch (final IOException e) {
+ throw analyzerError(location, e);
+ }
+ return analyzeAll(gzipInputStream, location);
+ }
- private int analyzePack200(final InputStream input, final String location)
- throws IOException {
- InputStream unpackedInput;
- try {
- unpackedInput = Pack200Streams.unpack(input);
- } catch (final IOException e) {
- throw analyzerError(location, e);
- }
- return analyzeAll(unpackedInput, location);
- }
+ private int analyzePack200(final InputStream input, final String location)
+ throws IOException {
+ InputStream unpackedInput;
+ try {
+ unpackedInput = Pack200Streams.unpack(input);
+ } catch (final IOException e) {
+ throw analyzerError(location, e);
+ }
+ return analyzeAll(unpackedInput, location);
+ }
}
diff --git a/org.jacoco.core/src/org/jacoco/core/analysis/CoverageBuilder.java b/org.jacoco.core/src/org/jacoco/core/analysis/CoverageBuilder.java
index 71a52615da32532acbaa30d7ba81b891cbb69077..d265a075d513c67407266806c47050a935ef4336 100644
--- a/org.jacoco.core/src/org/jacoco/core/analysis/CoverageBuilder.java
+++ b/org.jacoco.core/src/org/jacoco/core/analysis/CoverageBuilder.java
@@ -43,7 +43,7 @@ public class CoverageBuilder implements ICoverageVisitor {
/**
* 新增代码类
*/
- public List- * Copyright: Copyright (c) 2021 + *
+ * Copyright: Copyright (c) 2021
*/
public class CodeDiffUtil {
- private final static String OPERATE_ADD = "ADD";
+ private final static String OPERATE_ADD = "ADD";
- /**
- * 检测类是否在差异代码中
- *
- * @param className
- * @return Boolean
- */
- public static Boolean checkClassIn(String className, List