145 if (lastClass == null) {
146 errors.add(new Error(phase + ": failed during preload"
147 + " with classStart = " + classStart));
148 // skip one class
149 ++classStart;
150 } else {
151 errors.add(new Error(phase + ": failed during"
152 + " compilation of class #" + lastClass.second
153 + " : " + lastClass.first));
154 // continue with the next class
155 classStart = lastClass.second + 1;
156 }
157 }
158 } catch (Exception e) {
159 throw new Error("failed to run from " + classStart, e);
160 }
161 }
162 }
163
164 private long classCount() {
165 return PathHandler.create(targetPath.toString(), Runnable::run)
166 .classCount();
167 }
168
169 private Pair<String, Long> getLastClass(Path errFile) {
170 try (BufferedReader reader = Files.newBufferedReader(errFile)) {
171 String line = reader.lines()
172 .filter(IS_CLASS_LINE)
173 .reduce((a, b) -> b)
174 .orElse(null);
175 if (line != null) {
176 int open = line.indexOf('[') + 1;
177 int close = line.indexOf(']');
178 long index = Long.parseLong(line.substring(open, close));
179 String name = line.substring(close + 1).trim().replace('.', '/');
180 return new Pair<>(name, index);
181 }
182 } catch (IOException ioe) {
183 throw new Error("can not read " + errFile + " : "
184 + ioe.getMessage(), ioe);
185 }
186 return null;
|
145 if (lastClass == null) {
146 errors.add(new Error(phase + ": failed during preload"
147 + " with classStart = " + classStart));
148 // skip one class
149 ++classStart;
150 } else {
151 errors.add(new Error(phase + ": failed during"
152 + " compilation of class #" + lastClass.second
153 + " : " + lastClass.first));
154 // continue with the next class
155 classStart = lastClass.second + 1;
156 }
157 }
158 } catch (Exception e) {
159 throw new Error("failed to run from " + classStart, e);
160 }
161 }
162 }
163
164 private long classCount() {
165 List<PathHandler> phs = PathHandler.create(targetPath.toString());
166 long result = phs.stream()
167 .mapToLong(PathHandler::classCount)
168 .sum();
169 phs.forEach(PathHandler::close);
170 return result;
171 }
172
173 private Pair<String, Long> getLastClass(Path errFile) {
174 try (BufferedReader reader = Files.newBufferedReader(errFile)) {
175 String line = reader.lines()
176 .filter(IS_CLASS_LINE)
177 .reduce((a, b) -> b)
178 .orElse(null);
179 if (line != null) {
180 int open = line.indexOf('[') + 1;
181 int close = line.indexOf(']');
182 long index = Long.parseLong(line.substring(open, close));
183 String name = line.substring(close + 1).trim().replace('.', '/');
184 return new Pair<>(name, index);
185 }
186 } catch (IOException ioe) {
187 throw new Error("can not read " + errFile + " : "
188 + ioe.getMessage(), ioe);
189 }
190 return null;
|