auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public ResponseEntity<String> scheduleMappingJob(@RequestParam String mappingProjectId, @RequestParam String targetEntityTypeId, @RequestParam(required = false) String label, @RequestParam(required = false, name = "package") String packageId, @RequestParam(required = false) Boolean addSourceAttribute) throws URISyntaxException { mappingProjectId = mappingProjectId.trim(); targetEntityTypeId = targetEntityTypeId.trim(); label = trim(label); packageId = trim(packageId); try { validateEntityName(targetEntityTypeId); if (mappingService.getMappingProject(mappingProjectId) == null) { throw new UnknownMappingProjectException(mappingProjectId); } if (packageId != null) { Package pack = dataService.getMeta().getPackage(packageId); if (pack == null) { throw new UnknownPackageException(packageId); } if (isSystemPackage(pack)) { throw new IllegalTargetPackageException(packageId); } } } catch (CodedRuntimeException cre) { return ResponseEntity.badRequest().contentType(TEXT_PLAIN).body(cre.getLocalizedMessage()); } MappingJobExecution mappingJobExecution = scheduleMappingJobInternal(mappingProjectId, targetEntityTypeId, addSourceAttribute, packageId, label); String jobHref = concatEntityHref(mappingJobExecution); return created(new URI(jobHref)).contentType(TEXT_PLAIN).body(jobHref); }

Target:
public ResponseEntity<String> scheduleMappingJob(@RequestParam String mappingProjectId, @RequestParam String targetEntityTypeId, @RequestParam(required = false) String label, @RequestParam(required = false, name = "package") String packageId, @RequestParam(required = false) Boolean addSourceAttribute) throws URISyntaxException { mappingProjectId = mappingProjectId.trim(); targetEntityTypeId = targetEntityTypeId.trim(); label = trim(label); packageId = trim(packageId); validateEntityName(targetEntityTypeId); if (mappingService.getMappingProject(mappingProjectId) == null) { throw new UnknownEntityException(mappingProjectMetaData, mappingProjectId); } if (packageId != null) { Package pack = dataService.getMeta().getPackage(packageId); if (pack == null) { throw new UnknownPackageException(packageId); } if (isSystemPackage(pack)) { throw new IllegalTargetPackageException(packageId); } } MappingJobExecution mappingJobExecution = scheduleMappingJobInternal(mappingProjectId, targetEntityTypeId, addSourceAttribute, packageId, label); String jobHref = concatEntityHref(mappingJobExecution); return created(new URI(jobHref)).contentType(TEXT_PLAIN).body(jobHref); }
Source:
protected void doWork(ProductInterface product) throws Exception { try { worker.doWork(); } catch (Exception e) { if (errorCount.incrementAndGet() > MAX_ERRORS) { e.printStackTrace(); Thread.currentThread().interrupt(); } else { System.err.printf("%s: %s%n", getProductWorker().getName(), e.getMessage()); } } }

Target:
protected void doWork(ProductInterface product) throws Exception { try { worker.doWork(); } catch (Exception e) { if (errorCount.incrementAndGet() > MAX_ERRORS) { e.printStackTrace(); throw e; } else { System.err.printf("%s: %s%n", getProductWorker().getName(), e.getMessage()); } } }
Source:
public URL getAuthenticatedUrl(@NonNull TaskRepository repository, @NonNull IRepositoryElement element) { URL resultUrl = null; try { String url = element.getUrl(); String urlString = url.replace("/rest.cgi/bug/", "/show_bug.cgi?id="); resultUrl = new URL(urlString); } catch (MalformedURLException e) { e.printStackTrace(); } return resultUrl; }

Target:
public URL getAuthenticatedUrl(@NonNull TaskRepository repository, @NonNull IRepositoryElement element) { if (element instanceof ITask) { try { String url = element.getUrl(); String urlString = url.replace("/rest.cgi/bug/", "/show_bug.cgi?id="); return new URL(urlString); } catch (MalformedURLException e) { StatusHandler.log( new Status(IStatus.ERROR, BugzillaRestCore.ID_PLUGIN, "could not create url from string", e)); } } return super.getAuthenticatedUrl(repository, element); }
Source:
public void invalidityInfoFor_invalidGender_returnErrorString() { String invalidGender = "alpha male"; String actual = validator.getInvalidityInfoForGender(invalidGender); assertEquals("Invalid gender should return appropriate error string", String.format(GENDER_ERROR_MESSAGE, invalidGender), actual); invalidGender = "<script> alert('hi!'); </script>"; actual = validator.getInvalidityInfoForGender(invalidGender); assertEquals("Invalid gender should return appropriate error string", String.format(GENDER_ERROR_MESSAGE, SanitizationHelper.sanitizeForHtml(invalidGender)), actual); }

Target:
public void invalidityInfoFor_invalidGender_returnErrorString() { String invalidGender = "alpha male"; String actual = validator.getInvalidityInfoForGender(invalidGender); assertEquals("Invalid gender should return appropriate error stirng", String.format(GENDER_ERROR_MESSAGE, invalidGender), actual); invalidGender = "<script> alert('hi!'); </script>"; actual = validator.getInvalidityInfoForGender(invalidGender); assertEquals("Unsanitized, invalid gender should return appropriate error string", String.format(GENDER_ERROR_MESSAGE, SanitizationHelper.sanitizeForHtml(invalidGender)), actual); }
Source:
private void testLOB() throws SQLException { deleteDb("bigResult"); Connection conn = getConnection("bigResult"); Statement stat = conn.createStatement(); stat.execute("SET MAX_MEMORY_ROWS " + 1); stat.execute("CREATE TABLE TEST(ID INT PRIMARY KEY, VALUE BLOB NOT NULL)"); PreparedStatement ps = conn.prepareStatement("INSERT INTO TEST VALUES (?, ?)"); byte[] data = new byte[1_000_000]; for (int i = 1; i <= 10; i++) { ps.setInt(1, i); Arrays.fill(data, (byte) i); ps.setBytes(2, data); ps.executeUpdate(); } Blob[] blobs = new Blob[10]; ResultSet rs = stat.executeQuery("SELECT * FROM TEST"); for (int i = 1; i <= 10; i++) { assertTrue(rs.next()); assertEquals(i, rs.getInt(1)); blobs[i - 1] = rs.getBlob(2); } assertFalse(rs.next()); rs.close(); for (int i = 1; i <= 10; i++) { Blob b = blobs[i - 1]; byte[] bytes = b.getBytes(1, (int) b.length()); Arrays.fill(data, (byte) i); assertEquals(data, bytes); b.free(); } conn.close(); }

Target:
private void testLOB() throws SQLException { deleteDb("bigResult"); Connection conn = getConnection("bigResult"); Statement stat = conn.createStatement(); stat.execute("SET MAX_MEMORY_ROWS " + 1); stat.execute("CREATE TABLE TEST(ID INT PRIMARY KEY, VALUE BLOB NOT NULL)"); PreparedStatement ps = conn.prepareStatement("INSERT INTO TEST VALUES (?, ?)"); int length = 1_000_000; byte[] data = new byte[length]; for (int i = 1; i <= 10; i++) { ps.setInt(1, i); Arrays.fill(data, (byte) i); ps.setBytes(2, data); ps.executeUpdate(); } Blob[] blobs = new Blob[10]; ResultSet rs = stat.executeQuery("SELECT * FROM TEST"); for (int i = 1; i <= 10; i++) { assertTrue(rs.next()); assertEquals(i, rs.getInt(1)); blobs[i - 1] = rs.getBlob(2); } assertFalse(rs.next()); rs.close(); for (int i = 1; i <= 10; i++) { Blob b = blobs[i - 1]; byte[] bytes = b.getBytes(1, (int) b.length()); Arrays.fill(data, (byte) i); assertEquals(data, bytes); b.free(); } stat.execute("DROP TABLE TEST"); stat.execute("CREATE TABLE TEST(ID INT PRIMARY KEY, VALUE CLOB NOT NULL)"); ps = conn.prepareStatement("INSERT INTO TEST VALUES (?, ?)"); char[] cdata = new char[length]; for (int i = 1; i <= 10; i++) { ps.setInt(1, i); Arrays.fill(cdata, (char) i); ps.setString(2, new String(cdata)); ps.executeUpdate(); } Clob[] clobs = new Clob[10]; rs = stat.executeQuery("SELECT * FROM TEST"); for (int i = 1; i <= 10; i++) { assertTrue(rs.next()); assertEquals(i, rs.getInt(1)); clobs[i - 1] = rs.getClob(2); } assertFalse(rs.next()); rs.close(); for (int i = 1; i <= 10; i++) { Clob c = clobs[i - 1]; String string = c.getSubString(1, (int) c.length()); Arrays.fill(cdata, (char) i); assertEquals(new String(cdata), string); c.free(); } conn.close(); }
Source:
public void visitNode(Tree tree) { ExpressionTree target = null; ExpressionTree shift = null; if (tree.is(Kind.LEFT_SHIFT, Kind.RIGHT_SHIFT)) { BinaryExpressionTree binaryExpressionTree = (BinaryExpressionTree) tree; target = binaryExpressionTree.leftOperand(); shift = binaryExpressionTree.rightOperand(); } else { AssignmentExpressionTreeImpl assignmentExpressionTree = (AssignmentExpressionTreeImpl) tree; target = assignmentExpressionTree.variable(); shift = assignmentExpressionTree.expression(); } String identifier = getIdentifierName(target); boolean expectLong = treeTypeIsLong(target); boolean expectInt = treeTypeIsInt(target); boolean shiftIsMinus = shift.is(Kind.UNARY_MINUS); if (shift.is(Kind.UNARY_MINUS, Kind.UNARY_PLUS)) { shift = ((UnaryExpressionTree) shift).expression(); } if (isShiftEvaluable(shift, expectInt || expectLong)) { String value = ((LiteralTreeImpl) shift).value(); long numberBits = (shiftIsMinus ? -1 : 1) * (expectInt ? Integer.parseInt(value) : Long.parseLong(value)); long reducedNumberBits = numberBits % (expectLong ? 64 : 32); insertIssue(tree, numberBits, reducedNumberBits, expectInt, identifier); } }

Target:
public void visitNode(Tree tree) { String identifier; ExpressionTree shift; if (tree.is(Kind.LEFT_SHIFT, Kind.RIGHT_SHIFT)) { BinaryExpressionTree binaryExpressionTree = (BinaryExpressionTree) tree; identifier = getIdentifierName(binaryExpressionTree.leftOperand()); shift = binaryExpressionTree.rightOperand(); } else { AssignmentExpressionTree assignmentExpressionTree = (AssignmentExpressionTree) tree; identifier = getIdentifierName(assignmentExpressionTree.variable()); shift = assignmentExpressionTree.expression(); } int sign = shift.is(Kind.UNARY_MINUS) ? -1 : 1; if (shift.is(Kind.UNARY_MINUS, Kind.UNARY_PLUS)) { shift = ((UnaryExpressionTree) shift).expression(); } if (shift.is(Kind.INT_LITERAL, Kind.LONG_LITERAL)) { int base = getBase(tree); long numberBits = sign * Long.decode(((LiteralTree) shift).value()); long reducedNumberBits = numberBits % base; String message = getMessage(numberBits, reducedNumberBits, base, identifier); if (message != null) { addIssue(tree, message); } } }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } ConnectorId other = (ConnectorId) obj; if (this.connectorType == null) { if (other.connectorType != null) { return false; } } else if (!this.connectorType.equals(other.connectorType)) { return false; } if (this.domainType == null) { if (other.domainType != null) { return false; } } else if (!this.domainType.equals(other.domainType)) { return false; } if (this.instanceId == null) { if (other.instanceId != null) { return false; } } else if (!this.instanceId.equals(other.instanceId)) { return false; } return true; }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (getClass() == obj.getClass()) { ConnectorId other = (ConnectorId) obj; return equals(other); } if (Map.class.isInstance(obj)) { Map<?, ?> metadata = (Map<?, ?>) obj; return toMetaData().equals(metadata); } if (obj instanceof String) { return toFullID().equals(obj); } return false; }
Source:
public static boolean isCidrFormatValid(String cidr) { return (cidr == null || !cidr.matches(getCidrRegex())) ? false : true; }

Target:
public static boolean isCidrFormatValid(String cidr) { return (cidr == null || !cidr.matches(ValidationUtils.CIDR_FORMAT_PATTERN)) ? false : true; }
Source:
private void updateIsLiveMergeSupported(Object entity) { if (entity == null) { return; } VM vm = (VM) entity; if (vm.getRunOnVds() == null || !AsyncDataProvider.getInstance().isLiveMergeSupported(vm)) { setLiveMergeSupported(false); return; } AsyncQuery query = new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { VmSnapshotListModel target = (VmSnapshotListModel) model; VDS vds = (VDS) returnValue; target.setLiveMergeSupported(vds.getLiveMergeSupport()); } }); AsyncDataProvider.getInstance().getHostById(query, vm.getRunOnVds()); }

Target:
private void updateIsLiveMergeSupported(Object entity) { if (entity == null) { return; } VM vm = (VM) entity; if (vm.getRunOnVds() == null || !AsyncDataProvider.getInstance().isLiveMergeSupported(vm)) { setLiveMergeSupported(false); return; } AsyncQuery query = new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { VmSnapshotListModel vmSnapshotListModel = (VmSnapshotListModel) model; VDS vds = (VDS) returnValue; vmSnapshotListModel.setLiveMergeSupported(vds.getLiveMergeSupport()); } }); AsyncDataProvider.getInstance().getHostById(query, vm.getRunOnVds()); }
Source:
public void getGeoSpeedAlerts() throws Exception { String result; result = geoLocationProviderServiceImpl.getSpeedAlerts(getDeviceIdentifier()); Assert.assertNotNull(result); Assert.assertEquals(result, "{'speedLimit':" + SAMPLE_SPEED_ALERT_VALUE + "}"); }

Target:
public void getGeoSpeedAlerts() throws GeoLocationBasedServiceException { String result; result = geoLocationProviderServiceImpl.getSpeedAlerts(getDeviceIdentifier()); Assert.assertNotNull(result); Assert.assertEquals(result, "{'speedLimit':" + SAMPLE_SPEED_ALERT_VALUE + "}"); }
Source:
public static Throwable from(Throwable throwable) { String message = String.format("%s [%s] occurred while processing thread (%s)", highLevelType(throwable), throwable, Thread.currentThread().getName()); return new SuppressedException(message); }

Target:
public static Throwable from(Throwable throwable) { String message = String.format("%s [%s] occurred while processing thread (%s)", highLevelType(throwable), throwable, Thread.currentThread().getName()); SuppressedException suppressedException = new SuppressedException(message); suppressedException.setStackTrace(throwable.getStackTrace()); return suppressedException; }
Source:
protected void onActivityResult(int requestCode,int resultCode,Intent capturedData){ if(requestCode == REQUEST_IMAGE_CAPTURE && resultCode == RESULT_OK){ Bundle capturedImageData = capturedData.getExtras(); Bitmap capturedImage = (Bitmap) capturedImageData.get("data"); Uri capturedImageUri = getImageUri(getApplicationContext(),capturedImage); capturedImagePath = getRealPathFromUri(capturedImageUri); new CheckAvailableSpaceTask().execute(); } else if(resultCode == RESULT_CANCELED){ setResult(RESULT_CANCELED); finish(); } }

Target:
protected void onActivityResult(int requestCode,int resultCode,Intent capturedData){ if(requestCode == REQUEST_IMAGE_CAPTURE && resultCode == RESULT_OK){ Bundle capturedImageData = capturedData.getExtras(); Bitmap capturedImage = (Bitmap) capturedImageData.get("data"); Uri capturedImageUri = getImageUri(getApplicationContext(),capturedImage); String capturedImagePath = getRealPathFromUri(capturedImageUri); new CheckAvailableSpaceTask(capturedImagePath).execute(); } else if(resultCode == RESULT_CANCELED){ setResult(RESULT_CANCELED); finish(); } }
Source:
protected FileLock lock(final int lockPosition) throws ActiveMQLockAcquisitionTimeoutException, InterruptedException { long start = System.nanoTime(); boolean isRecurringFailure = false; while (!interrupted) { try { FileLock lock = tryLock(lockPosition); isRecurringFailure = false; if (lock == null) { try { Thread.sleep(500); } catch (InterruptedException e) { return null; } if (this.lockAcquisitionTimeoutNanos != -1 && (System.nanoTime() - start) > this.lockAcquisitionTimeoutNanos) { throw new ActiveMQLockAcquisitionTimeoutException("timed out waiting for lock"); } } else { return lock; } } catch (IOException e) { logger.log(isRecurringFailure ? Logger.Level.DEBUG : Logger.Level.WARN, "Failure when accessing a lock file", e); isRecurringFailure = true; long waitTime = LOCK_ACCESS_FAILURE_WAIT_TIME_NANOS; if (this.lockAcquisitionTimeoutNanos != -1) { final long remainingTime = this.lockAcquisitionTimeoutNanos - (System.nanoTime() - start); if (remainingTime <= 0) { throw new ActiveMQLockAcquisitionTimeoutException("timed out waiting for lock"); } waitTime = Math.min(waitTime, remainingTime); } try { TimeUnit.NANOSECONDS.sleep(waitTime); } catch (InterruptedException interrupt) { throw new InterruptedException(); } } } throw new InterruptedException(); }

Target:
protected FileLock lock(final int lockPosition) throws ActiveMQLockAcquisitionTimeoutException { long start = System.nanoTime(); boolean isRecurringFailure = false; while (!interrupted) { try { FileLock lock = tryLock(lockPosition); isRecurringFailure = false; if (lock == null) { try { Thread.sleep(500); } catch (InterruptedException e) { return null; } if (this.lockAcquisitionTimeoutNanos != -1 && (System.nanoTime() - start) > this.lockAcquisitionTimeoutNanos) { throw new ActiveMQLockAcquisitionTimeoutException("timed out waiting for lock"); } } else { return lock; } } catch (IOException e) { logger.log(isRecurringFailure ? Logger.Level.DEBUG : Logger.Level.WARN, "Failure when accessing a lock file", e); isRecurringFailure = true; long waitTime = LOCK_ACCESS_FAILURE_WAIT_TIME_NANOS; if (this.lockAcquisitionTimeoutNanos != -1) { final long remainingTime = this.lockAcquisitionTimeoutNanos - (System.nanoTime() - start); if (remainingTime <= 0) { throw new ActiveMQLockAcquisitionTimeoutException("timed out waiting for lock"); } waitTime = Math.min(waitTime, remainingTime); } try { TimeUnit.NANOSECONDS.sleep(waitTime); } catch (InterruptedException interrupt) { return null; } } } return null; }
Source:
public void rollback() { log.warn("Rolling back ActiveMQ transaction"); try { ClientSession session = this.getClientSession(); session.rollback(); session.close(); } catch (ActiveMQException e) { log.error("Error rolling back ActiveMQ transaction", e); } }

Target:
public void rollback() { log.warn("Rolling back ActiveMQ transaction"); try (ClientSession session = this.getClientSession()) { session.rollback(); } catch (ActiveMQException e) { log.error("Error rolling back ActiveMQ transaction", e); } }
Source:
public String getGraphvizPlan(Session session, Statement statement, Type planType, List<Expression> parameters, WarningCollector warningCollector) { DataDefinitionTask<?> task = dataDefinitionTask.get(statement.getClass()); if (task != null) { return explainTask(statement, task, parameters); } switch (planType) { case LOGICAL: Plan plan = getLogicalPlan(session, statement, parameters, warningCollector); return PlanPrinter.graphvizLogicalPlan(plan.getRoot(), plan.getTypes(), session); case DISTRIBUTED: SubPlan subPlan = getDistributedPlan(session, statement, parameters, warningCollector); return PlanPrinter.graphvizDistributedPlan(subPlan, session); } throw new IllegalArgumentException("Unhandled plan type: " + planType); }

Target:
public String getGraphvizPlan(Session session, Statement statement, Type planType, List<Expression> parameters, WarningCollector warningCollector) { DataDefinitionTask<?> task = dataDefinitionTask.get(statement.getClass()); if (task != null) { return explainTask(statement, task, parameters); } switch (planType) { case LOGICAL: Plan plan = getLogicalPlan(session, statement, parameters, warningCollector); return graphvizLogicalPlan(plan.getRoot(), plan.getTypes(), session); case DISTRIBUTED: SubPlan subPlan = getDistributedPlan(session, statement, parameters, warningCollector); return graphvizDistributedPlan(subPlan, session); } throw new IllegalArgumentException("Unhandled plan type: " + planType); }
Source:
private void setLayout(View target, int verb, int anchorId) { RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams)target.getLayoutParams(); params.addRule(verb, anchorId); final ArrayList<Integer> rules; if (mHorizontalRules.contains(verb)) { rules = mHorizontalRules; } else if (mVerticalRules.contains(verb)) { rules = mVerticalRules; } else { rules = null; } if (rules != null && !verifyLayout(target, rules)) { JSONObject errorInfo = new JSONObject(); try { errorInfo.put("cid", mName); errorInfo.put("error_type", "circular_dependency"); } catch (JSONException e) { ; } throw new LayoutUpdateException("Circular dependency detected!", errorInfo); } target.setLayoutParams(params); }

Target:
private void setLayout(View target, int verb, int anchorId) throws CantVisitException { RelativeLayout.LayoutParams params = (RelativeLayout.LayoutParams)target.getLayoutParams(); params.addRule(verb, anchorId); final Set<Integer> rules; if (mHorizontalRules.contains(verb)) { rules = mHorizontalRules; } else if (mVerticalRules.contains(verb)) { rules = mVerticalRules; } else { rules = null; } if (rules != null && !verifyLayout(target, rules)) { throw new CantVisitException("Circular dependency detected!", "circular_dependency", mName); } target.setLayoutParams(params); }
Source:
private Function twoArgs(Function func, C context) { assert func.arguments().size() == 2 : "size of arguments must be two"; Symbol arg1 = func.arguments().get(0); Symbol newArg1 = arg1.accept(this, context); assert newArg1 != null : arg1 + " became NULL, symbols must never conver to NULL"; Symbol arg2 = func.arguments().get(1); Symbol newArg2 = arg2.accept(this, context); assert newArg2 != null : arg2 + " became NULL, symbols must never conver to NULL"; Symbol filter = func.filter(); Symbol newFilter = processNullable(filter, context); if (arg1 == newArg1 && arg2 == newArg2 && filter == newFilter) { return func; } return new Function(func.info(), List.of(newArg1, newArg2), newFilter); }

Target:
private Function twoArgs(Function func, C context) { assert func.arguments().size() == 2 : "size of arguments must be two"; Symbol arg1 = func.arguments().get(0); Symbol newArg1 = arg1.accept(this, context); assert newArg1 != null : arg1 + " became NULL, symbols must never convert to NULL"; Symbol arg2 = func.arguments().get(1); Symbol newArg2 = arg2.accept(this, context); assert newArg2 != null : arg2 + " became NULL, symbols must never convert to NULL"; Symbol filter = func.filter(); Symbol newFilter = processNullable(filter, context); if (arg1 == newArg1 && arg2 == newArg2 && filter == newFilter) { return func; } return new Function(func.info(), List.of(newArg1, newArg2), newFilter); }
Source:
public boolean match(ChangeData cd) throws OrmException { return cd.change().getLastUpdatedOn().getTime() <= cut.getTime(); }

Target:
public boolean match(ChangeData cd) throws OrmException { return cd.change().getLastUpdatedOn().getTime() >= cut.getTime(); }
Source:
public void registerEndpoint(RabbitListenerEndpoint endpoint, RabbitListenerContainerFactory<?> factory) { Assert.notNull(endpoint, "Endpoint must be set"); Assert.notNull(endpoint.getId(), "Endpoint id must be set"); this.endpointDescriptors.add(new AmqpListenerEndpointDescriptor(endpoint, factory)); }

Target:
public void registerEndpoint(RabbitListenerEndpoint endpoint, RabbitListenerContainerFactory<?> factory) { Assert.notNull(endpoint, "Endpoint must be set"); Assert.hasText(endpoint.getId(), "Endpoint id must be set"); this.endpointDescriptors.add(new AmqpListenerEndpointDescriptor(endpoint, factory)); }
Source:
public boolean promptPassword(String msg) { CredentialItem.Password p = new CredentialItem.Password(msg); if (provider.get(uri, p)) { password = new String(p.getValue()); return true; } else { CredentialItem.StringType v = newPrompt(msg); if (provider.get(uri, v)) { password = v.getValue(); return true; } else { password = null; return false; } } }

Target:
public boolean promptPassword(String msg) { CredentialItem.Password p = new CredentialItem.Password(msg); if (provider.get(uri, p)) { password = new String(p.getValue()); return true; } else { password = null; return false; } }
Source:
public void testDownloadDBOffline() { hasError = false; MockNetworkUtils network = new MockNetworkUtils(); network.networkAvailability = false; network.mock(); TestActivityWrapper wrapper = new TestActivityWrapper(getActivity()); WordsStorage.downloadDB(wrapper, "zh", Constants.CATEGORY_COUNTRY, new DownloadDBListener() { @Override public void onProgressing(int progress) { } @Override public void onComplete() { } @Override public void onError(int errorType, Exception e) { hasError = true; } }); assertTrue(hasError); network.restore(); }

Target:
public void testDownloadDBOffline() { hasError = false; MockNetworkUtils network = new MockNetworkUtils(); network.networkAvailability = false; network.mock(); TestActivityWrapper wrapper = new TestActivityWrapper(getActivity()); new WordsStorage(wrapper, "zh", Constants.CATEGORY_COUNTRY).downloadDB( new DownloadDBListener() { @Override public void onProgressing(int progress) { } @Override public void onComplete() { } @Override public void onError(int errorType, Exception e) { hasError = true; } }); assertTrue(hasError); network.restore(); }
Source:
public void test_evaluate_evaluation_failed_exception() { final AtomicInteger exception = new AtomicInteger(-1); browser.addProgressListener(new ProgressListener() { @Override public void changed(ProgressEvent event) @Override public void completed(ProgressEvent event) { try { browser.evaluate("return runSomeUndefinedFunctionInJavaScriptWhichCausesUndefinedError()"); } catch (SWTException e) { exception.set(e.code); } } }); browser.setText("<html><body>HelloWorld</body></html>"); shell.open(); for (int i = 0; i < (loopMultipier * secondsToWaitTillFail); i++) { runLoopTimer(waitMS); if (exception.get() != -1) { if (exception.get() == SWT.ERROR_FAILED_EVALUATE) { return; } else { System.err.println("test_evaluate_invalid_return_value - Invalid exception code"); fail(name.getMethodName() + " failed. Incorrect exception thrown: " + exception.get()); } break; } } fail(name.getMethodName() + " failed. Expected exception to be thrown."); }

Target:
public void test_evaluate_evaluation_failed_exception() { assumeFalse(webkit1SkipMsg(), isWebkit1); final AtomicInteger exception = new AtomicInteger(-1); browser.addProgressListener(new ProgressListener() { @Override public void changed(ProgressEvent event) @Override public void completed(ProgressEvent event) { try { browser.evaluate("return runSomeUndefinedFunctionInJavaScriptWhichCausesUndefinedError()"); } catch (SWTException e) { exception.set(e.code); } } }); browser.setText("<html><body>HelloWorld</body></html>"); shell.open(); for (int i = 0; i < (loopMultipier * secondsToWaitTillFail); i++) { runLoopTimer(waitMS); if (exception.get() != -1) { if (exception.get() == SWT.ERROR_FAILED_EVALUATE) { return; } else { fail("Invalid exception thrown: " + exception.get()); } break; } } fail("Expected exception to be thrown, but none was thrown. Test timed out."); }
Source:
public void init() throws javax.mail.MessagingException { content_types = ImmutableSet.copyOf(getCondition().split("\\s*,\\s*")); }

Target:
public void init() throws javax.mail.MessagingException { acceptedContentTypes = ImmutableSet.copyOf(Splitter.on(",").trimResults().split(getCondition())); }
Source:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest httpRequest = (HttpServletRequest) request; HttpServletResponse httpResponse = (HttpServletResponse) response; Object bucket = bucketing.bucket(httpRequest); ThrottlingState.Status status = throttler.status(bucket, httpRequest); if (status.banned) { log.info("A request is being throttled."); if (enabled) { nbBannedRequests.increment(); notifyUserBanned(httpResponse, status.bannedUntil); return; } } if (status.throttled) { log.info("A request is being throttled."); if (enabled) { nbThrottledRequests.increment(); notifyUserThrottled(httpResponse, status.backoffDelay); throttler.throttled(bucket, httpRequest); return; } } Stopwatch stopwatch = Stopwatch.createStarted(); try { chain.doFilter(request, response); if (httpResponse.getStatus() < 400) { throttler.success(bucket, httpRequest, stopwatch.elapsed()); } else { throttler.failure(bucket, httpRequest, stopwatch.elapsed()); } } catch (IOException | ServletException e) { throttler.failure(bucket, httpRequest, stopwatch.elapsed()); throw e; } }

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest httpRequest = (HttpServletRequest) request; HttpServletResponse httpResponse = (HttpServletResponse) response; Object bucket = bucketing.bucket(httpRequest); Instant now = now(); Instant bannedUntil = banThrottler.throttledUntil(bucket, httpRequest); if (bannedUntil.isAfter(now)) { log.info("A request is being banned."); if (enabled) { nbBannedRequests.increment(); notifyUserBanned(httpResponse, bannedUntil); return; } } Instant throttledUntil = timeAndErrorsThrottler.throttledUntil(bucket, httpRequest); if (throttledUntil.isAfter(now)) { log.info("A request is being throttled."); if (enabled) { nbThrottledRequests.increment(); notifyUserThrottled(httpResponse, throttledUntil); banThrottler.throttled(bucket, httpRequest); return; } } Stopwatch stopwatch = Stopwatch.createStarted(); try { chain.doFilter(request, response); if (httpResponse.getStatus() < 400) { timeAndErrorsThrottler.success(bucket, httpRequest, stopwatch.elapsed()); } else { timeAndErrorsThrottler.failure(bucket, httpRequest, stopwatch.elapsed()); } } catch (IOException | ServletException e) { timeAndErrorsThrottler.failure(bucket, httpRequest, stopwatch.elapsed()); throw e; } }
Source:
private static boolean skipBadMessageEnabled(DatastreamTask task) { return task.getDatastreams() .stream() .findFirst() .map(Datastream::getMetadata) .map(metadata -> metadata.getOrDefault(CFG_SKIP_BAD_MESSAGE, "false").toLowerCase().equals("true")) .orElse(false); }

Target:
private static boolean skipBadMessageEnabled(DatastreamTask task) { return task.getDatastreams() .stream() .findAny() .map(Datastream::getMetadata) .map(metadata -> metadata.getOrDefault(CFG_SKIP_BAD_MESSAGE, "false").toLowerCase().equals("true")) .orElse(false); }
Source:
public void testProvideAndRegisterDocumentSetB() { NhinTargetCommunitiesType targets = createNhinTargetCommunitiesType(receiverHCID); ProvideAndRegisterDocumentSetRequestType request = new ProvideAndRegisterDocumentSetRequestType(); final AssertionType assertion = createAssertion(senderHCID); UrlInfoType urlInfo = new UrlInfoType(); when(mockPolicyChecker.checkXDRRequestPolicy(any(ProvideAndRegisterDocumentSetRequestType.class), any(AssertionType.class), any(String.class), any(String.class), eq(NhincConstants.POLICYENGINE_OUTBOUND_DIRECTION))).thenReturn(Boolean.TRUE); when(mockDelegate.process(any(OutboundDocSubmissionDeferredRequestOrchestratable.class))).thenReturn( createOutboundDocSubmissionDeferredRequestOrchestratable(Boolean.TRUE)); StandardOutboundDocSubmissionDeferredRequest dsDeferredReq = createDocSubmissionDeferredRequestOrchImpl(); XDRAcknowledgementType response = dsDeferredReq.provideAndRegisterDocumentSetBAsyncRequest(request, assertion, targets, urlInfo); assertNotNull(response); assertEquals(NhincConstants.XDR_ACK_STATUS_MSG, response.getMessage().getStatus()); verify(mockAuditLogger).auditRequestMessage(eq(request), eq(assertion), any(NhinTargetSystemType.class), eq(NhincConstants.AUDIT_LOG_OUTBOUND_DIRECTION), eq(NhincConstants.AUDIT_LOG_NHIN_INTERFACE), eq(Boolean.TRUE), isNull(Properties.class), eq(NhincConstants.NHINC_XDR_REQUEST_SERVICE_NAME)); }

Target:
public void testProvideAndRegisterDocumentSetB() { NhinTargetCommunitiesType targets = createNhinTargetCommunitiesType(RECEIVER_HCID); ProvideAndRegisterDocumentSetRequestType request = new ProvideAndRegisterDocumentSetRequestType(); final AssertionType assertion = createAssertion(SENDER_HCID); UrlInfoType urlInfo = new UrlInfoType(); when(mockPolicyChecker.checkXDRRequestPolicy(any(ProvideAndRegisterDocumentSetRequestType.class), any(AssertionType.class), any(String.class), any(String.class), eq(NhincConstants.POLICYENGINE_OUTBOUND_DIRECTION))).thenReturn(Boolean.TRUE); when(mockDelegate.process(any(OutboundDocSubmissionDeferredRequestOrchestratable.class))).thenReturn( createOutboundDocSubmissionDeferredRequestOrchestratable(Boolean.TRUE)); StandardOutboundDocSubmissionDeferredRequest dsDeferredReq = createDocSubmissionDeferredRequestOrchImpl(); XDRAcknowledgementType response = dsDeferredReq.provideAndRegisterDocumentSetBAsyncRequest(request, assertion, targets, urlInfo); assertNotNull(response); assertEquals(NhincConstants.XDR_ACK_STATUS_MSG, response.getMessage().getStatus()); verify(mockAuditLogger).auditRequestMessage(eq(request), eq(assertion), any(NhinTargetSystemType.class), eq(NhincConstants.AUDIT_LOG_OUTBOUND_DIRECTION), eq(NhincConstants.AUDIT_LOG_NHIN_INTERFACE), eq(Boolean.TRUE), isNull(Properties.class), eq(NhincConstants.NHINC_XDR_REQUEST_SERVICE_NAME)); }
Source:
private void setModerateButtonForStatus(CommentStatus status) { int color; if (status == CommentStatus.APPROVED) { color = ContextCompat.getColor(getActivity(), R.color.orange_jazzy); mBtnModerateTextView.setText(R.string.comment_status_approved); } else { color = ContextCompat.getColor(getActivity(), R.color.grey_text_min); mBtnModerateTextView.setText(R.string.mnu_comment_approve); } ColorUtils.INSTANCE.setImageResourceWithTint(mBtnModerateIcon, R.drawable.ic_checkmark_white_24dp, color); mBtnModerateTextView.setTextColor(color); }

Target:
private void setModerateButtonForStatus(CommentStatus status) { int color; if (status == CommentStatus.APPROVED) { color = R.color.orange_jazzy; mBtnModerateTextView.setText(R.string.comment_status_approved); } else { color = R.color.grey_text_min; mBtnModerateTextView.setText(R.string.mnu_comment_approve); } ColorUtils.INSTANCE.setImageResourceWithTint(mBtnModerateIcon, R.drawable.ic_checkmark_white_24dp, color); mBtnModerateTextView.setTextColor(ContextCompat.getColor(requireContext(), color)); }
Source:
public <C extends Credential> C retrieve(String credentialAlias, Class<C> credentialType) throws CredentialStoreException, UnsupportedCredentialTypeException { Assert.assertNotNull(credentialAlias); Assert.assertNotNull(credentialType); if (credentialType.isAssignableFrom(PasswordCredential.class)) { try { return credentialType.cast(createPasswordCredential(executePasswordCommand(credentialAlias))); } catch (Throwable e) { throw log.passwordCommandExecutionProblem(getName(), e); } } else { throw log.credentialTypeNotSupported(credentialType.getName(), getName()); } }

Target:
public <C extends Credential> C retrieve(String credentialAlias, Class<C> credentialType) throws CredentialStoreException, UnsupportedCredentialTypeException { Assert.checkNotNullParam("credentialAlias", credentialAlias); Assert.checkNotNullParam("credentialType", credentialType); if (credentialType.isAssignableFrom(PasswordCredential.class)) { try { return credentialType.cast(new PasswordCredential(ClearPassword.createRaw(ClearPassword.ALGORITHM_CLEAR, executePasswordCommand(credentialAlias)))); } catch (Throwable e) { throw log.passwordCommandExecutionProblem(getName(), e); } } else { throw log.credentialTypeNotSupported(credentialType.getName(), getName()); } }
Source:
public String toString() { return "BinlogPosition[" + (gtidSetStr == null ? file + ":" + offset : gtidSetStr) + ", lastHeartbeat=" + String.valueOf(lastHeartbeat) + ", lastHeartbeat=" + String.valueOf(lastHeartbeat) + "]"; }

Target:
public String toString() { return "BinlogPosition[" + (gtidSetStr == null ? file + ":" + offset : gtidSetStr) + ", lastHeartbeat=" + String.valueOf(lastHeartbeat) + "]"; }
Source:
private boolean init(ChangeBoundsRequest request, GraphicalEditPart hostGraphicalEditPart) { List<?> editParts = request.getEditParts(); for (Object editPart : editParts) { if (editPart instanceof DragAndDropWrapper) { DragAndDropWrapper dragAndDropWrapperToDrop = (DragAndDropWrapper) editPart; elementsFromEclipseViewToDrop.add(dragAndDropWrapperToDrop); } else if (editPart instanceof IGraphicalEditPart) { IGraphicalEditPart graphicalEditPartToDrop = (IGraphicalEditPart) editPart; if (!(graphicalEditPartToDrop.getParent() == hostGraphicalEditPart || hostGraphicalEditPart instanceof CompartmentEditPart && graphicalEditPartToDrop.getParent() == hostGraphicalEditPart.getParent()) && graphicalEditPartToDrop.resolveSemanticElement() instanceof DSemanticDecorator) { EObject elementFromDiagramToDrop = graphicalEditPartToDrop.resolveSemanticElement(); DDiagramElement dDiagramElementTopDrop = (DDiagramElement) elementFromDiagramToDrop; elementsFromDiagramToDrop.add(dDiagramElementTopDrop); editPartsFromDiagramToDrop.add(graphicalEditPartToDrop); if (isInLayoutingMode(hostGraphicalEditPart) && graphicalEditPartToDrop instanceof IDiagramBorderNodeEditPart) { return false; } } } } return true; }

Target:
private boolean init(ChangeBoundsRequest request, GraphicalEditPart hostGraphicalEditPart) { List<?> editParts = request.getEditParts(); boolean isInLayoutingMode = isInLayoutingMode(hostGraphicalEditPart); for (Object editPart : editParts) { if (editPart instanceof DragAndDropWrapper) { DragAndDropWrapper dragAndDropWrapperToDrop = (DragAndDropWrapper) editPart; elementsFromEclipseViewToDrop.add(dragAndDropWrapperToDrop); } else if (editPart instanceof IGraphicalEditPart) { IGraphicalEditPart graphicalEditPartToDrop = (IGraphicalEditPart) editPart; if (!(graphicalEditPartToDrop.getParent() == hostGraphicalEditPart || hostGraphicalEditPart instanceof CompartmentEditPart && graphicalEditPartToDrop.getParent() == hostGraphicalEditPart.getParent()) && graphicalEditPartToDrop.resolveSemanticElement() instanceof DSemanticDecorator) { EObject elementFromDiagramToDrop = graphicalEditPartToDrop.resolveSemanticElement(); DDiagramElement dDiagramElementTopDrop = (DDiagramElement) elementFromDiagramToDrop; elementsFromDiagramToDrop.add(dDiagramElementTopDrop); editPartsFromDiagramToDrop.add(graphicalEditPartToDrop); if (isInLayoutingMode && graphicalEditPartToDrop instanceof IDiagramBorderNodeEditPart) { return false; } } } } return true; }
Source:
private void warnAboutProblematicCredentials(GoogleCredentials credentials) { if (!Boolean.parseBoolean(getEnv(SUPPRESS_GCLOUD_CREDS_WARNING_ENV_VAR)) && credentials instanceof UserCredentials && ((UserCredentials) credentials).getClientId().equals(CLOUDSDK_CLIENT_ID)) { LOGGER.log(Level.WARNING, CLOUDSDK_CREDENTIALS_WARNING); } }

Target:
private void warnAboutProblematicCredentials(GoogleCredentials credentials) { if (credentials instanceof UserCredentials && ((UserCredentials) credentials).getClientId().equals(CLOUDSDK_CLIENT_ID) && !Boolean.parseBoolean(getEnv(SUPPRESS_GCLOUD_CREDS_WARNING_ENV_VAR))) { LOGGER.log(Level.WARNING, CLOUDSDK_CREDENTIALS_WARNING); } }
Source:
public List<ExperimentLibraryDesign> list() { List expmts = this.getHibernateTemplate().find("from ExperimentLibraryDesign as libraryDesign order by libraryDesign.experimentLibraryDesignId asc" ); return expmts; }

Target:
public List<ExperimentLibraryDesign> list() { List expmts = this.getHibernateTemplate().find("from ExperimentLibraryDesign as libraryDesign" ); return expmts; }
Source:
private int appendChild(IStatus status, String indentation) { if (indentation == null) { appendStatusAndChildren(status, null); return appendAndReturnLength("; "); } else { result.append(indentation); appendStatusAndChildren(status, indentation); return appendAndReturnLength("\n"); } }

Target:
private int appendChild(IStatus status, String indentation) { if (indentation == null) { appendStatusAndChildren(status, indentation); return appendAndReturnLength("; "); } else { result.append(indentation); appendStatusAndChildren(status, indentation); return appendAndReturnLength("\n"); } }
Source:
public UploadPartResult uploadPart(UploadPartRequest request) throws IOException { return retry("upload part #" + request.getPartNumber() + " upload "+ request.getUploadId(), request.getKey(), true, () -> owner.uploadPart(request)); }

Target:
public UploadPartResult uploadPart(UploadPartRequest request) throws IOException { return retry("upload part #" + request.getPartNumber() + " upload ID "+ request.getUploadId(), request.getKey(), true, () -> owner.uploadPart(request)); }
Source:
public void onDataChange(String path) { if (operationType.equals(StoreOperationType.WRITE)) { latch.countDown(); } else { System.err.println("Data is changed but wrong operation type is specified. " + operationType); } }

Target:
public void onDataChange(String path) { if (!operationType.equals(StoreOperationType.WRITE)) { exceptionRef.set(new Exception("Data is changed but wrong operation type is specified. " + operationType)); } latch.countDown(); }
Source:
public <T> ListenableFuture<T> execute(Request request, final AsyncHandler<T> asyncHandler) throws IOException { final URI uri = request.getURI(); channels.configureProcessor(requestSender, closed, uri.getHost(), uri.getPort()); return requestSender.sendRequest(request, asyncHandler, null, false); }

Target:
public <T> ListenableFuture<T> execute(Request request, final AsyncHandler<T> asyncHandler) throws IOException { final URI uri = request.getURI(); final String host = AsyncHttpProviderUtils.getHost(uri); final int port = AsyncHttpProviderUtils.getPort(uri); channels.configureProcessor(requestSender, closed, host, port); return requestSender.sendRequest(request, asyncHandler, null, false); }
Source:
public int calculateMaxNumCharsFromNewNoteLine(String noteLine, String currentCheckStubDataLine) { String proposedCheckStubLine = (isLastCharacterSpace(currentCheckStubDataLine) || isFirstCharacterSpace(noteLine)) ? (currentCheckStubDataLine + noteLine) : (currentCheckStubDataLine + KFSConstants.BLANK_SPACE + noteLine); int totalNumChars = proposedCheckStubLine.length(); if (totalNumChars < CuDisbursementVoucherConstants.DV_EXTRACT_MAX_NOTE_LINE_SIZE) { return noteLine.length(); } else { String wrappedText = WordUtils.wrap(proposedCheckStubLine, CuDisbursementVoucherConstants.DV_EXTRACT_MAX_NOTE_LINE_SIZE); String[] constructedCheckStubLines = wrappedText.replaceAll("[\r]", "").split("\\n"); return noteLine.length() - constructedCheckStubLines[1].length(); } }

Target:
public int calculateMaxNumCharsFromNewNoteLine(String noteLine, String currentCheckStubDataLine) { String proposedCheckStubLine; if (StringUtils.isBlank(currentCheckStubDataLine) && StringUtils.isBlank(noteLine)) { proposedCheckStubLine = KFSConstants.EMPTY_STRING; } else if (StringUtils.isBlank(currentCheckStubDataLine) && StringUtils.isNotBlank(noteLine)) { proposedCheckStubLine = noteLine; } else if (StringUtils.isNotBlank(currentCheckStubDataLine) && StringUtils.isBlank(noteLine)) { proposedCheckStubLine = currentCheckStubDataLine; } else { proposedCheckStubLine = (currentCheckStubDataLine + KFSConstants.BLANK_SPACE + noteLine); } int totalNumChars = proposedCheckStubLine.length(); if (totalNumChars == 0 || totalNumChars <= CuDisbursementVoucherConstants.DV_EXTRACT_MAX_NOTE_LINE_SIZE) { return noteLine.length(); } else { String wrappedText = WordUtils.wrap(proposedCheckStubLine, CuDisbursementVoucherConstants.DV_EXTRACT_MAX_NOTE_LINE_SIZE, "\n", false); String[] constructedCheckStubLines = wrappedText.split("\n"); return noteLine.length() - constructedCheckStubLines[1].length(); } }
Source:
public void testCreateDonationWithDonationWithIneligibleDonorAndBackEntry_shouldAddDonationAndDiscardComponents() { Donation donation = aDonation().build(); long donorId = 993L; String donationBatchNumber = "000001"; DonationBackingForm backingForm = aDonationBackingForm() .withDonation(donation) .withDonor(aDonor().withId(donorId).build()) .withDonationBatchNumber(donationBatchNumber) .withPackType(aPackType().withId(IRRELEVANT_PACK_TYPE_ID).build()) .build(); PostDonationCounselling postDonationCounselling = aPostDonationCounselling().build(); DonationBatch donationBatch = aDonationBatch().thatIsBackEntry().build(); PackType packTypeThatCountsAsDonation = aPackType().withCountAsDonation(true).build(); when(packTypeRepository.getPackTypeById(IRRELEVANT_PACK_TYPE_ID)).thenReturn(packTypeThatCountsAsDonation); when(donorConstraintChecker.isDonorEligibleToDonate(donorId)).thenReturn(false); when(donationBatchRepository.findDonationBatchByBatchNumber(donationBatchNumber)).thenReturn(donationBatch); when(postDonationCounsellingCRUDService.createPostDonationCounsellingForDonation(donation)).thenReturn(postDonationCounselling); Donation returnedDonation = donationCRUDService.createDonation(backingForm); verify(donationRepository).addDonation(donation); verify(componentCRUDService).markComponentsBelongingToDonationAsUnsafe(donation); verify(postDonationCounsellingCRUDService).createPostDonationCounsellingForDonation(donation); assertThat(returnedDonation, is(donation)); }

Target:
public void testCreateDonationWithDonationWithIneligibleDonorAndBackEntry_shouldAddDonationAndDiscardComponents() { Donation donation = aDonation().build(); long donorId = 993L; String donationBatchNumber = "000001"; DonationBackingForm backingForm = aDonationBackingForm() .withDonation(donation) .withDonor(aDonor().withId(donorId).build()) .withDonationBatchNumber(donationBatchNumber) .withPackType(aPackType().withId(IRRELEVANT_PACK_TYPE_ID).build()) .build(); DonationBatch donationBatch = aDonationBatch().thatIsBackEntry().build(); PackType packTypeThatCountsAsDonation = aPackType().withCountAsDonation(true).build(); when(packTypeRepository.getPackTypeById(IRRELEVANT_PACK_TYPE_ID)).thenReturn(packTypeThatCountsAsDonation); when(donorConstraintChecker.isDonorEligibleToDonate(donorId)).thenReturn(false); when(donationBatchRepository.findDonationBatchByBatchNumber(donationBatchNumber)).thenReturn(donationBatch); Donation returnedDonation = donationCRUDService.createDonation(backingForm); verify(donationRepository).addDonation(donation); verify(componentCRUDService).markComponentsBelongingToDonationAsUnsafe(donation); verify(postDonationCounsellingCRUDService).createPostDonationCounsellingForDonation(donation); assertThat(returnedDonation, is(donation)); }
Source:
public Object getQueryObject() { return new MongoDBQueryDescriptor( collectionName, getOperation(), query, projection, orderBy, null, null, null, unwinds, null, null, null, count ); }

Target:
public Object getQueryObject() { return new MongoDBQueryDescriptor( collectionName, operation, query, projection, orderBy, null, null, null, unwinds, null, null, null ); }
Source:
public Map<Statistic, Long> getStatistics() { StatisticsFile statisticsFile = statsFile; return ((IMixinStatisticHolder) statisticsFile).getStatistics(); }

Target:
public Map<Statistic, Long> getStatistics() { return ((IMixinStatisticHolder) statsFile).getStatistics(); }
Source:
private Set<File> findDotProjectFiles(Set<File> changedFiles, Repository repository) { Set<File> result = new HashSet<>(); String workingTreeRootPath = repository.getWorkTree().toString(); for (File changedFile : changedFiles) { File projectFile = searchEnclosingProjectInWorkDir( changedFile.getParentFile().getAbsoluteFile(), workingTreeRootPath); if (projectFile != null) { result.add(projectFile); } } return result; }

Target:
private Set<File> findDotProjectFiles(Set<File> changedFiles, Repository repository) { Set<File> result = new HashSet<>(); String workingTreeRootPath = repository.getWorkTree().toString(); for (File changedFile : changedFiles) { File projectFile = searchEnclosingProjectInWorkDir( changedFile.getParentFile().getAbsoluteFile(), workingTreeRootPath); if (projectFile != null) result.add(projectFile); } return result; }