auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void test() { SampleResult samplerResult = new SampleResult(); samplerResult.setResponseData(responseData, null); JMESPathAssertion instance = new JMESPathAssertion(); instance.setJmesPath(jmesPath); instance.setJsonValidationBool(isValidation == ValidationType.USE_VALIDATION); instance.setInvert(isInverted == InvertType.USE_INVERT); instance.setIsRegex(isRegex == ComparisonType.USE_REGEX); instance.setExpectNull(isExpectedNull == ResultNullity.EXPECT_NULL); instance.setExpectedValue(expectedValue); AssertionResult expResult = new AssertionResult(""); AssertionResult result = instance.getResult(samplerResult); assertEquals(expResult.getName(), result.getName()); switch (resultType) { case SUCCESS: assertFalse(result.isError()); assertFalse(result.isFailure()); break; case FAILURE: assertFalse(result.isError()); assertTrue(result.isFailure()); break; case ERROR: assertTrue(result.isError()); assertFalse(result.isFailure()); break; default: throw new IllegalArgumentException("Unexpected type:"+resultType); } assertEquals(failureMessage, result.getFailureMessage()); }

Target:
public void test() { SampleResult samplerResult = new SampleResult(); samplerResult.setResponseData(responseData, null); JMESPathAssertion instance = new JMESPathAssertion(); instance.setJmesPath(jmesPath); instance.setJsonValidationBool(isValidation == ValidationType.USE_VALIDATION); instance.setInvert(isInverted == InvertType.USE_INVERT); instance.setIsRegex(isRegex == ComparisonType.USE_REGEX); instance.setExpectNull(isExpectedNull == ResultNullity.EXPECT_NULL); instance.setExpectedValue(expectedValue); AssertionResult expResult = new AssertionResult(""); AssertionResult result = instance.getResult(samplerResult); assertEquals(expResult.getName(), result.getName()); if (result.isError() && !result.isFailure()) { assertEquals(resultType, ResultType.ERROR); } else if (result.isFailure() && !result.isError()) { assertEquals(resultType, ResultType.FAILURE); } else if (!result.isError() && !result.isFailure()){ assertEquals(resultType, ResultType.SUCCESS); } else { fail("Got unexpected state where AssertionResult is in error and in failure"); } assertEquals(failureMessage, result.getFailureMessage()); }
Source:
public void testPherfMain() throws Exception{ String[] args = {"-q", "--scenarioFile", ".*prod_test_unsalted_scenario.*" }; try { Pherf.main(args); } catch (Exception e) { fail("Test encountered an exception."); throw e; } }

Target:
public void testPherfMain() { String[] args = { "-q", "--scenarioFile", ".*prod_test_unsalted_scenario.*", "-m", "--monitorFrequency", "10" }; Pherf.main(args); }
Source:
public void testAddBeforeExecutionFileFilterAsChild() throws Exception { final Checker checker = new Checker(); final TestBeforeExecutionFileFilter fileFilter = new TestBeforeExecutionFileFilter(); final PackageObjectFactory factory = new PackageObjectFactory( new HashSet<>(), Thread.currentThread().getContextClassLoader()) { @Override public Object createModule(String name) throws CheckstyleException { Object filter = fileFilter; if (!name.equals(TestBeforeExecutionFileFilter.class.getName())) { filter = super.createModule(name); } return filter; } }; checker.setModuleFactory(factory); checker.setupChild(createCheckConfig(TestBeforeExecutionFileFilter.class)); getAcceptFileStarted().invoke(checker, "test_file.name"); assertTrue("Checker.acceptFileStarted() doesn't call listener", fileFilter.wasCalled()); }

Target:
public void testAddBeforeExecutionFileFilterAsChild() throws Exception { final Checker checker = new Checker(); final TestBeforeExecutionFileFilter fileFilter = new TestBeforeExecutionFileFilter(); final PackageObjectFactory factory = new PackageObjectFactory( new HashSet<>(), Thread.currentThread().getContextClassLoader()) { @Override public Object createModule(String name) throws CheckstyleException { Object filter = fileFilter; if (!name.equals(TestBeforeExecutionFileFilter.class.getName())) { filter = super.createModule(name); } return filter; } }; checker.setModuleFactory(factory); checker.setupChild(createCheckConfig(TestBeforeExecutionFileFilter.class)); checker.process(Collections.singletonList(new File("dummy.java"))); assertTrue("Checker.acceptFileStarted() doesn't call listener", fileFilter.wasCalled()); }
Source:
public CompletableFuture<V> replaceAsync(K key, V value) { return super.replaceAsync(keyToStorage(key), valueToStorage(value)).thenApply(transcodeValueForRead); }

Target:
public CompletableFuture<V> replaceAsync(K key, V value) { return super.replaceAsync(keyToStorage(key), valueToStorage(value)).thenApply(decodedValueForRead); }
Source:
protected void doGetHtml(HttpServletRequest req, HttpServletResponse res) throws IOException { Repository repo = ServletUtils.getRepository(req); GitilesView view = getView(req, repo); Paginator paginator = newPaginator(repo, view); if (paginator == null) { res.setStatus(SC_NOT_FOUND); return; } try { GitilesAccess access = getAccess(req); DateFormatter df = new DateFormatter(access, Format.DEFAULT); Map<String, Object> data = new LogSoyData(req, view).toSoyData(paginator, null, df); List<String> prettyValues = view.getParameters().get(PRETTY_PARAM); String pretty = "default"; if (!prettyValues.isEmpty()) { pretty = prettyValues.get(0); } String variant = access.getConfig().getString("logFormat", pretty, "variant"); if (variant != null) { data.put("logEntryVariant", variant); } else { data.put("logEntryVariant", pretty); } if (!view.getRevision().nameIsId()) { List<Map<String, Object>> tags = Lists.newArrayListWithExpectedSize(1); for (RevObject o : RevisionServlet.listObjects(paginator.getWalk(), view.getRevision())) { if (o instanceof RevTag) { tags.add(new TagSoyData(linkifier, req).toSoyData((RevTag) o, df)); } } if (!tags.isEmpty()) { data.put("tags", tags); } } String title = "Log - "; if (view.getOldRevision() != Revision.NULL) { title += view.getRevisionRange(); } else { title += view.getRevision().getName(); } data.put("title", title); renderHtml(req, res, "gitiles.logDetail", data); } catch (RevWalkException e) { log.warn("Error in rev walk", e); res.setStatus(SC_INTERNAL_SERVER_ERROR); return; } finally { paginator.getWalk().release(); } }

Target:
protected void doGetHtml(HttpServletRequest req, HttpServletResponse res) throws IOException { Repository repo = ServletUtils.getRepository(req); GitilesView view = getView(req, repo); Paginator paginator = newPaginator(repo, view); if (paginator == null) { res.setStatus(SC_NOT_FOUND); return; } try { GitilesAccess access = getAccess(req); Config config = access.getConfig(); DateFormatter df = new DateFormatter(access, Format.DEFAULT); String pretty = Iterables.getFirst(view.getParameters().get(PRETTY_PARAM), "default"); Map<String, Object> data = new LogSoyData(req, view, config.getBoolean("logFormat", pretty, "verbose", false)).toSoyData(paginator, null, df); String variant = config.getString("logFormat", pretty, "variant"); data.put("logEntryVariant", Objects.firstNonNull(variant, pretty)); if (!view.getRevision().nameIsId()) { List<Map<String, Object>> tags = Lists.newArrayListWithExpectedSize(1); for (RevObject o : RevisionServlet.listObjects(paginator.getWalk(), view.getRevision())) { if (o instanceof RevTag) { tags.add(new TagSoyData(linkifier, req).toSoyData((RevTag) o, df)); } } if (!tags.isEmpty()) { data.put("tags", tags); } } String title = "Log - "; if (view.getOldRevision() != Revision.NULL) { title += view.getRevisionRange(); } else { title += view.getRevision().getName(); } data.put("title", title); renderHtml(req, res, "gitiles.logDetail", data); } catch (RevWalkException e) { log.warn("Error in rev walk", e); res.setStatus(SC_INTERNAL_SERVER_ERROR); return; } finally { paginator.getWalk().release(); } }
Source:
public static byte[] safelyLoadFileBytes(String fullyQualifiedFileName) { InputStream fileContents; byte[] fileByteContent; try { fileContents = new FileInputStream(fullyQualifiedFileName); } catch (FileNotFoundException e1) { LOG.error("safelyLoadFileBytes: Batch file not found [" + fullyQualifiedFileName + "]. " + e1.getMessage()); throw new RuntimeException("Batch File not found [" + fullyQualifiedFileName + "]. " + e1.getMessage(), e1); } try { fileByteContent = IOUtils.toByteArray(fileContents); } catch (IOException e1) { LOG.error("safelyLoadFileBytes: IO Exception loading: [" + fullyQualifiedFileName + "]. " + e1.getMessage()); throw new RuntimeException("IO Exception loading: [" + fullyQualifiedFileName + "]. " + e1.getMessage(), e1); } finally { try { IOUtils.closeQuietly(fileContents); } catch (Exception e) { LOG.error("safelyLoadFileBytes, unable tlose input stream.", e); } } return fileByteContent; }

Target:
public static byte[] safelyLoadFileBytes(String fullyQualifiedFileName) { InputStream fileContents; byte[] fileByteContent; try { fileContents = new FileInputStream(fullyQualifiedFileName); } catch (FileNotFoundException e1) { LOG.error("safelyLoadFileBytes: Batch file not found [" + fullyQualifiedFileName + "]. " + e1.getMessage()); throw new RuntimeException("Batch File not found [" + fullyQualifiedFileName + "]. " + e1.getMessage(), e1); } try { fileByteContent = IOUtils.toByteArray(fileContents); } catch (IOException e1) { LOG.error("safelyLoadFileBytes: IO Exception loading: [" + fullyQualifiedFileName + "]. " + e1.getMessage()); throw new RuntimeException("IO Exception loading: [" + fullyQualifiedFileName + "]. " + e1.getMessage(), e1); } finally { IOUtils.closeQuietly(fileContents); } return fileByteContent; }
Source:
public static StyledString markLTR(StyledString styledString) { if (!USE_TEXT_PROCESSOR) return styledString; String inputString= styledString.getString(); String string= TextProcessor.process(inputString); if (!Objects.equals(string, inputString)) insertMarks(styledString, inputString, string); return styledString; }

Target:
public static StyledString markLTR(StyledString styledString) { if (!USE_TEXT_PROCESSOR) return styledString; String inputString= styledString.getString(); String string= TextProcessor.process(inputString); if ((string == null && inputString != null) || (string != null && !string.equals(inputString))) insertMarks(styledString, inputString, string); return styledString; }
Source:
public Frame decorrelateRel(Sort rel) { assert !cm.mapRefRelToCorRef.containsKey(rel); final RelNode oldInput = rel.getInput(); final Frame frame = getInvoke(oldInput, rel); if (frame == null) { return null; } final RelNode newInput = frame.r; Mappings.TargetMapping mapping = Mappings.target(frame.oldToNewOutputs, oldInput.getRowType().getFieldCount(), newInput.getRowType().getFieldCount()); RelCollation oldCollation = rel.getCollation(); RelCollation newCollation = RexUtil.apply(mapping, oldCollation); final Sort newSort = (Sort) relBuilder .push(newInput) .sortLimit(newCollation, rel.offset, rel.fetch) .build(); return register(rel, newSort, frame.oldToNewOutputs, frame.corDefOutputs); }

Target:
public Frame decorrelateRel(Sort rel) { assert !cm.mapRefRelToCorRef.containsKey(rel); final RelNode oldInput = rel.getInput(); final Frame frame = getInvoke(oldInput, rel); if (frame == null) { return null; } final RelNode newInput = frame.r; Mappings.TargetMapping mapping = Mappings.target(frame.oldToNewOutputs, oldInput.getRowType().getFieldCount(), newInput.getRowType().getFieldCount()); RelCollation oldCollation = rel.getCollation(); RelCollation newCollation = RexUtil.apply(mapping, oldCollation); final int offset = rel.offset == null ? 0 : RexLiteral.intValue(rel.offset); final int fetch = rel.fetch == null ? 0 : RexLiteral.intValue(rel.fetch); final RelNode newSort = relBuilder .push(newInput) .sortLimit(offset, fetch, relBuilder.fields(newCollation)) .build(); return register(rel, newSort, frame.oldToNewOutputs, frame.corDefOutputs); }
Source:
public void testInspectNode() throws Exception { final DefaultDockerClient dockerClient = new DefaultDockerClient(builder); server.enqueue(new MockResponse() .setResponseCode(200) .addHeader("Content-Type", "application/json") .setBody( createObjectNode() .put("ApiVersion", "1.28") .put("Arch", "foobar") .put("GitCommit", "foobar") .put("GoVersion", "foobar") .put("KernelVersion", "foobar") .put("Os", "foobar") .put("Version", "1.20") .toString() ) ); server.enqueue(new MockResponse() .setResponseCode(200) .addHeader("Content-Type", "application/json") .setBody( fixture("fixtures/1.28/nodeInfo.json") ) ); NodeInfo nodeInfo = dockerClient.inspectNode("24ifsmvkjbyhk"); assertThat(nodeInfo, notNullValue()); assertThat(nodeInfo.id(), is("24ifsmvkjbyhk")); assertThat(nodeInfo.status(), notNullValue()); assertThat(nodeInfo.status().addr(), is("172.17.0.2")); assertThat(nodeInfo.managerStatus(), notNullValue()); assertThat(nodeInfo.managerStatus().addr(), is("172.17.0.2:2377")); assertThat(nodeInfo.managerStatus().leader(), is(true)); assertThat(nodeInfo.managerStatus().reachability(), is("reachable")); }

Target:
public void testInspectNode() throws Exception { final DefaultDockerClient dockerClient = new DefaultDockerClient(builder); enqueueServerApiVersion("1.28"); server.enqueue(new MockResponse() .setResponseCode(200) .addHeader("Content-Type", "application/json") .setBody( fixture("fixtures/1.28/nodeInfo.json") ) ); NodeInfo nodeInfo = dockerClient.inspectNode("24ifsmvkjbyhk"); assertThat(nodeInfo, notNullValue()); assertThat(nodeInfo.id(), is("24ifsmvkjbyhk")); assertThat(nodeInfo.status(), notNullValue()); assertThat(nodeInfo.status().addr(), is("172.17.0.2")); assertThat(nodeInfo.managerStatus(), notNullValue()); assertThat(nodeInfo.managerStatus().addr(), is("172.17.0.2:2377")); assertThat(nodeInfo.managerStatus().leader(), is(true)); assertThat(nodeInfo.managerStatus().reachability(), is("reachable")); }
Source:
public void testTransientCleanup() throws IOException { Path path = Files.createTempFile("pfouh","pfouh"); FileBlob blob = new FileBlob("pfouh"); Files.move(path, blob.getFile().toPath(), StandardCopyOption.REPLACE_EXISTING); String key = downloadService.store(Collections.singletonList(blob)); ByteArrayOutputStream out = new ByteArrayOutputStream(); HttpServletRequest request = mock(HttpServletRequest.class); when(request.getMethod()).thenReturn("GET"); HttpServletResponse response = mock(HttpServletResponse.class); ServletOutputStream sos = new ServletOutputStream() { @Override public void write(int b) throws IOException { out.write(b); } }; @SuppressWarnings("resource") PrintWriter printWriter = new PrintWriter(sos); when(response.getOutputStream()).thenReturn(sos); when(response.getWriter()).thenReturn(printWriter); NuxeoPrincipal principal = new UserPrincipal("bob", Collections.singletonList("members"), false, false); LoginStack loginStack = ClientLoginModule.getThreadLocalLogin(); loginStack.push(principal, null, null); try { downloadService.downloadBlob(request, response, key, "download"); } finally { loginStack.pop(); } assertFalse(blob.getFile().exists()); }

Target:
public void testTransientCleanup() throws IOException { Path path = Files.createTempFile("pfouh","pfouh"); FileBlob blob = new FileBlob("pfouh"); Files.move(path, blob.getFile().toPath(), REPLACE_EXISTING); String key = downloadService.storeBlobs(Collections.singletonList(blob)); ByteArrayOutputStream out = new ByteArrayOutputStream(); HttpServletRequest request = mock(HttpServletRequest.class); when(request.getMethod()).thenReturn("GET"); HttpServletResponse response = mock(HttpServletResponse.class); ServletOutputStream sos = new ServletOutputStream() { @Override public void write(int b) throws IOException { out.write(b); } }; @SuppressWarnings("resource") PrintWriter printWriter = new PrintWriter(sos); when(response.getOutputStream()).thenReturn(sos); when(response.getWriter()).thenReturn(printWriter); NuxeoPrincipal principal = new UserPrincipal("bob", Collections.singletonList("members"), false, false); LoginStack loginStack = ClientLoginModule.getThreadLocalLogin(); loginStack.push(principal, null, null); try { downloadService.downloadBlob(request, response, key, "download"); } finally { loginStack.pop(); } assertFalse(blob.getFile().exists()); }
Source:
public static URL sizedURL(Context context, String url, float dpSize) { Resources r = context.getResources(); float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dpSize, r.getDisplayMetrics()); try { return new URL(ZulipApp.get().getServerHostUri() + url + "&s=" + px); } catch (MalformedURLException e) { ZLog.logException(e); return null; } }

Target:
public static URL sizedURL(Context context, String url, float dpSize) { Resources r = context.getResources(); float px = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, dpSize, r.getDisplayMetrics()); try { return new URL(UrlHelper.addHost(url) + "&s=" + px); } catch (MalformedURLException e) { ZLog.logException(e); return null; } }
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; DataConversion that = (DataConversion) o; return Objects.equals(encoder, that.encoder) && Objects.equals(wrapper, that.wrapper) && Objects.equals(transcoder, that.transcoder) && isKey == that.isKey; }

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; DataConversion that = (DataConversion) o; return isKey == that.isKey && Objects.equals(encoder, that.encoder) && Objects.equals(wrapper, that.wrapper) && Objects.equals(transcoder, that.transcoder); }
Source:
public static CassandraKeyValueService createForTesting(CassandraKeyValueServiceConfig config) { MetricsManager metricsManager = MetricsManagers.createForTests(); Logger log = LoggerFactory.getLogger(CassandraKeyValueService.class); Pair<CassandraClientPool, Optional<AsyncClusterSession>> connections; try { connections = config.servers() .visit((thriftServers, maybeCqlServers) -> { CassandraClientPool clientPool = CassandraClientPoolImpl.createImplForTest(metricsManager, config, CassandraClientPoolImpl.StartupChecks.RUN, new Blacklist(config)); log.info("Maybe creating AsyncClusterSession"); AsyncClusterSession asyncClusterSession = maybeCqlServers .map(servers -> { log.info("Creating an AsyncClusterSession"); return AsyncSessionManager .getOrInitializeAsyncSessionManager() .getAsyncSession(config, servers); }).orElse(null); return new Pair<>(clientPool, Optional.of(asyncClusterSession)); }); } catch (Exception e) { log.warn("AsyncClusterSession cretion exception", e); throw Throwables.unwrapAndThrowAtlasDbDependencyException(e); } return createOrShutdownClientPool(metricsManager, config, CassandraKeyValueServiceRuntimeConfig::getDefault, connections.lhSide, connections.rhSide, CassandraMutationTimestampProviders.legacyModeForTestsOnly(), log, AtlasDbConstants.DEFAULT_INITIALIZE_ASYNC); }

Target:
public static CassandraKeyValueService createForTesting(CassandraKeyValueServiceConfig config) { try { MetricsManager metricsManager = MetricsManagers.createForTests(); CqlClusterManager cqlClusterManager = config.cqlClusterManager() .orElseGet(DefaultCqlClusterManager::getInstance); CassandraClientPool clientPool = CassandraClientPoolImpl.createImplForTest(metricsManager, config, CassandraClientPoolImpl.StartupChecks.RUN, new Blacklist(config)); Optional<CqlClusterClient> asyncClusterSession = config.servers() .visit((thriftServers, maybeCqlServers) -> maybeCqlServers .map(servers -> cqlClusterManager.createCqlClusterClient(config, servers))); return createOrShutdownClientPool(metricsManager, config, CassandraKeyValueServiceRuntimeConfig::getDefault, clientPool, asyncClusterSession, CassandraMutationTimestampProviders.legacyModeForTestsOnly(), LoggerFactory.getLogger(CassandraKeyValueService.class), AtlasDbConstants.DEFAULT_INITIALIZE_ASYNC); } catch (Exception e) { throw Throwables.unwrapAndThrowAtlasDbDependencyException(e); } }
Source:
public DesiredCapabilities getCapabilities(DesiredCapabilities capabilities) { MobileTestSession mobileSession = Grid.getMobileTestSession(); capabilities.setCapability(MobileCapabilityType.APP, mobileSession.getAppName()); if (StringUtils.isBlank(mobileSession.getAppName())) { capabilities.setCapability(MobileCapabilityType.APP, mobileSession.getAppPath()); } capabilities.setCapability(MOBILE_NODE_TYPE, mobileSession.getMobileNodeType().getAsString()); capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, mobileSession.getDeviceType()); if (mobileSession.getDeviceType() != null) { capabilities.setBrowserName(mobileSession.getDeviceType().toLowerCase()); } capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, mobileSession.getPlatformVersion()); capabilities.setCapability(APPIUM_LOCALE_TYPE, mobileSession.getAppLocale()); capabilities.setCapability(APPIUM_LANGUAGE_TYPE, mobileSession.getAppLanguage()); if (mobileSession.getPlatform() == WebDriverPlatform.ANDROID) { capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, APPIUM_ANDROID_PLATFORM_TYPE); capabilities.setPlatform(Platform.ANDROID); } if (mobileSession.getPlatform() == WebDriverPlatform.IOS) { capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, APPIUM_IOS_PLATFORM_TYPE); capabilities.setPlatform(Platform.MAC); } return capabilities; }

Target:
public DesiredCapabilities getCapabilities(DesiredCapabilities capabilities) { MobileTestSession mobileSession = Grid.getMobileTestSession(); capabilities.setCapability(MobileCapabilityType.APP, mobileSession.getAppName()); if (StringUtils.isBlank(mobileSession.getAppName())) { capabilities.setCapability(MobileCapabilityType.APP, mobileSession.getAppPath()); } capabilities.setCapability(MOBILE_NODE_TYPE, mobileSession.getMobileNodeType().getAsString()); capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, mobileSession.getDeviceType()); capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, mobileSession.getPlatformVersion()); capabilities.setCapability(APPIUM_LOCALE_TYPE, mobileSession.getAppLocale()); capabilities.setCapability(APPIUM_LANGUAGE_TYPE, mobileSession.getAppLanguage()); if (mobileSession.getPlatform() == WebDriverPlatform.ANDROID) { capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, APPIUM_ANDROID_PLATFORM_TYPE); } if (mobileSession.getPlatform() == WebDriverPlatform.IOS) { capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, APPIUM_IOS_PLATFORM_TYPE); } return capabilities; }
Source:
public CompletionStage<MetricsQueryResponse> queryMetrics(final MetricsQuery query) { final UUID queryUuid = UUID.randomUUID(); final JsonNode queryJson = _mapper.valueToTree(query); LOGGER.trace() .setMessage("starting queryMetrics") .addData("queryUuid", queryUuid) .addData("query", queryJson) .log(); final HttpRequest request = HttpRequest.POST(createUri(METRICS_QUERY_PATH).toString()) .withEntity(ContentTypes.APPLICATION_JSON, queryJson.toString()); final Instant startTime = Instant.now(); return fireRequest(request, MetricsQueryResponse.class) .whenComplete((response, error) -> { LOGGER.trace() .setMessage("finished queryMetrics") .addData("queryUuid", queryUuid) .addData("query", queryJson) .addData("duration", Duration.between(startTime, Instant.now())) .addData("success", error == null) .log(); }); }

Target:
public CompletionStage<MetricsQueryResponse> queryMetrics(final MetricsQuery query) { final Metrics metrics = _metricsFactory.create(); final UUID queryUuid = UUID.randomUUID(); final JsonNode queryJson = _mapper.valueToTree(query); LOGGER.trace() .setMessage("starting queryMetrics") .addData("queryUuid", queryUuid) .addData("query", queryJson) .log(); final HttpRequest request = HttpRequest.POST(createUri(METRICS_QUERY_PATH).toString()) .withEntity(ContentTypes.APPLICATION_JSON, queryJson.toString()); final Instant startTime = Instant.now(); return fireRequest(request, MetricsQueryResponse.class) .whenComplete((response, error) -> { LOGGER.trace() .setMessage("finished queryMetrics") .addData("queryUuid", queryUuid) .addData("query", queryJson) .addData("duration", Duration.between(startTime, Instant.now())) .setThrowable(error) .log(); metrics.incrementCounter("kairosClient/queryMetrics/success", error == null ? 1 : 0); metrics.close(); }); }
Source:
public void createProject_shouldCreateRefappModuleProject() throws Exception{ addTaskParam("moduleType", "refapp"); for( String option : options){ addTaskParam(option, "test"); } executeTask("create-project"); assertSuccess(); assertProjectCreated(); }

Target:
public void createProject_shouldCreateRefappModuleProject() throws Exception{ addTaskParam("type", "referenceapplication-module"); for( String option : options){ addTaskParam(option, "test"); } executeTask("create-project"); assertSuccess(); assertProjectCreated(); }
Source:
public static SecureRandom getSecureRandom(Properties props) { String secureRandomClasses = props.getProperty( CHIMERA_SECURE_RANDOM_CLASSES_KEY); if (secureRandomClasses == null) { secureRandomClasses = System.getProperty( CHIMERA_SECURE_RANDOM_CLASSES_KEY); } SecureRandom random = null; for (String klassName : Splitter.on(',').trimResults().omitEmptyStrings() .split(secureRandomClasses)) { try { final Class klass = ReflectionUtils.getClassByName(klassName); random = (SecureRandom) ReflectionUtils.newInstance(klass, props); if (random != null) { break; } } catch (ClassCastException e) { LOG.error("Class is not a Cipher.", klassName); } catch (ClassNotFoundException e) { LOG.error("Cipher not found.", klassName); } } return (random == null) ? new OsSecureRandom(props) : random; }

Target:
public static SecureRandom getSecureRandom(Properties props) { String secureRandomClasses = props.getProperty( CHIMERA_SECURE_RANDOM_CLASSES_KEY); if (secureRandomClasses == null) { secureRandomClasses = System.getProperty( CHIMERA_SECURE_RANDOM_CLASSES_KEY); } SecureRandom random = null; for (String klassName : Splitter.on(',').trimResults().omitEmptyStrings() .split(secureRandomClasses)) { try { final Class klass = ReflectionUtils.getClassByName(klassName); random = (SecureRandom) ReflectionUtils.newInstance(klass, props); if (random != null) { break; } } catch (ClassCastException e) { LOG.error("Class is not a Cipher.", klassName); } catch (ClassNotFoundException e) { LOG.error("Cipher not found.", klassName); } } return (random == null) ? new JavaSecureRandom(props) : random; }
Source:
private void init() { menu = menuFor(item); getElement().addClassName(style.itemPanel()); setWidget(getContents()); addDomHandler(new ContextMenuHandler() { @Override public void onContextMenu(ContextMenuEvent event) { NetworkItemPanel sourcePanel = (NetworkItemPanel) event.getSource(); NativeEvent nativeEvent = event.getNativeEvent(); showContextMenu(sourcePanel, nativeEvent.getClientX(), nativeEvent.getClientY()); event.stopPropagation(); event.preventDefault(); } }, ContextMenuEvent.getType()); addBitlessDomHandler(new DragStartHandler() { @Override public void onDragStart(DragStartEvent event) { if (!draggable) { return; } NetworkItemPanel sourcePanel = (NetworkItemPanel) event.getSource(); lastDragData = sourcePanel.item.getType() + " " + sourcePanel.item.getName(); event.setData("Text", lastDragData); NativeEvent nativeEvent = event.getNativeEvent(); int x = nativeEvent.getClientX() - sourcePanel.getAbsoluteLeft(); int y = nativeEvent.getClientY() - sourcePanel.getAbsoluteTop(); event.getDataTransfer().setDragImage(sourcePanel.getElement(), x, y); } }, DragStartEvent.getType()); }

Target:
private void init() { menu = menuFor(item); getElement().addClassName(style.itemPanel()); setWidget(getContents()); addDomHandler(new ContextMenuHandler() { @Override public void onContextMenu(ContextMenuEvent event) { NetworkItemPanel sourcePanel = (NetworkItemPanel) event.getSource(); NativeEvent nativeEvent = event.getNativeEvent(); showContextMenu(sourcePanel, nativeEvent.getClientX(), nativeEvent.getClientY()); event.stopPropagation(); event.preventDefault(); } }, ContextMenuEvent.getType()); if (draggable) { addBitlessDomHandler(new DragStartHandler() { @Override public void onDragStart(DragStartEvent event) { NetworkItemPanel sourcePanel = (NetworkItemPanel) event.getSource(); lastDragData = sourcePanel.item.getType() + " " + sourcePanel.item.getName(); event.setData("Text", lastDragData); NativeEvent nativeEvent = event.getNativeEvent(); int x = nativeEvent.getClientX() - sourcePanel.getAbsoluteLeft(); int y = nativeEvent.getClientY() - sourcePanel.getAbsoluteTop(); event.getDataTransfer().setDragImage(sourcePanel.getElement(), x, y); } }, DragStartEvent.getType()); } }
Source:
public void initActionSets() { if (descriptor != null) { List<IActionSetDescriptor> temp = new ArrayList<IActionSetDescriptor>(); List<String> ids = ModeledPageLayout.getIds(layout, ModeledPageLayout.ACTION_SET_TAG); createInitialActionSets(temp, ids); for (IActionSetDescriptor descriptor : temp) { if (!alwaysOnActionSets.contains(descriptor)) { alwaysOnActionSets.add(descriptor); } } } }

Target:
public void initActionSets() { if (descriptor != null) { List<String> ids = ModeledPageLayout.getIds(layout, ModeledPageLayout.ACTION_SET_TAG); for (IActionSetDescriptor descriptor : createInitialActionSets(ids)) { if (!alwaysOnActionSets.contains(descriptor)) { alwaysOnActionSets.add(descriptor); } } } }
Source:
public void dateFormattedCorrectly() throws Exception { ConsentSignature sig = makeSignatureWithoutImage(); ConsentPdf consentPdf = new ConsentPdf(study, EMAIL_PARTICIPANT, sig, SharingScope.NO_SHARING, NEW_DOCUMENT_FRAGMENT, consentBodyTemplate); String output = consentPdf.getFormattedConsentDocument(); assertTrue("Contains formatted date", output.contains(ConsentPdf.FORMATTER.print(DateTime.now()) + " (GMT)")); }

Target:
public void dateFormattedCorrectly() throws Exception { ConsentSignature sig = makeSignatureWithoutImage(); ConsentPdf consentPdf = new ConsentPdf(study, EMAIL_PARTICIPANT, sig, SharingScope.NO_SHARING, NEW_DOCUMENT_FRAGMENT, consentBodyTemplate); String output = consentPdf.getFormattedConsentDocument(); assertTrue("Contains formatted date", output.contains("October 4, 2017 (GMT)")); }
Source:
public static String getFileName(String filePath) { if (filePath.contains("/")) { return last(filePath.split("/")); } return ""; }

Target:
public static String getFileName(String filePath) { return last(filePath.split("/")); }
Source:
GroupingTable(Map<String, AggregateOperator> groupByAliasToAggregateType, List<String> orderedAliases, boolean hasSelectValue) { this.table = new HashMap<>(); this.groupByAliasToAggregateType = groupByAliasToAggregateType; this.orderedAliases = orderedAliases; this.hasSelectValue = hasSelectValue; }

Target:
GroupingTable(Map<String, AggregateOperator> groupByAliasToAggregateType, List<String> orderedAliases, boolean hasSelectValue) { if (groupByAliasToAggregateType == null) { throw new IllegalArgumentException("groupByAliasToAggregateType cannot be null"); } this.table = new HashMap<>(); this.groupByAliasToAggregateType = groupByAliasToAggregateType; this.orderedAliases = orderedAliases; this.hasSelectValue = hasSelectValue; }
Source:
private void mergeNewValues(boolean force, double compression) { if (unmergedWeight == 0) { return; } if (force || unmergedWeight > 0) { while (activeCentroids + tempUsed >= tempMean.length) { tempWeight = Arrays.copyOf(tempWeight, min(tempWeight.length * 2, maxBufferSize)); tempMean = Arrays.copyOf(tempMean, min(tempMean.length * 2, maxBufferSize)); order = Arrays.copyOf(order, min(order.length * 2, maxBufferSize)); } merge(tempMean, tempWeight, tempUsed, order, unmergedWeight, mergeCount % 2 == 1, compression); mergeCount++; tempUsed = 0; unmergedWeight = 0; } }

Target:
private void mergeNewValues(boolean force, double compression) { if (unmergedWeight == 0) { return; } if (force || unmergedWeight > 0) { merge(tempMean, tempWeight, tempUsed, order, unmergedWeight, mergeCount % 2 == 1, compression); mergeCount++; tempUsed = 0; unmergedWeight = 0; } }
Source:
protected static Set<String> parseShortInvokedMethods(String line) { Set<String> methods = Sets.newHashSet(); Set<String> blacklist = Sets.newHashSet("time", "date"); String regex = "\\b(?!" + StringUtils.join(blacklist, "|") + ")(?<!\")[\\w\\.]+[\\(\\s]"; Pattern pattern = Pattern.compile(regex); Matcher matcher = pattern.matcher(line); while (matcher.find()) { if(!matcher.group().startsWith("concourse.")) { methods.add(matcher.group().replaceFirst("[\\(\\s]", "")); } } return methods; }

Target:
protected static Set<String> parseShortInvokedMethods(String line) { Set<String> methods = Sets.newHashSet(); Set<String> blacklist = Sets.newHashSet("time", "date"); String regex = "\\b(?!" + StringUtils.join(blacklist, "|") + ")(?<!\")[\\w\\.]+[\\(\\s]"; Pattern pattern = Pattern.compile(regex); Matcher matcher = pattern.matcher(line); Pattern replacePattern = Pattern.compile("[\\(\\s]"); while (matcher.find()) { if(!matcher.group().startsWith("concourse.")) { methods.add(replacePattern.matcher(matcher.group()).replaceAll("")); } } return methods; }
Source:
public static String identifyVM() { SystemInfo si = new SystemInfo(); HardwareAbstractionLayer hw = si.getHardware(); NetworkIF[] nifs = hw.getNetworkIFs(); boolean isvm = false; for (NetworkIF nif : nifs) { String mac = nif.getMacaddr().substring(0, 8).toUpperCase(); if (vmMacAddressOUI.containsKey(mac)) { isvm = true; return "On a VM: " + vmMacAddressOUI.get(mac); } } if (!isvm) { String model = hw.getComputerSystem().getModel(); for (String vm : vmModelArray) { if (model.contains(vm)) { isvm = true; return "On a VM: " + vm; } } } if (!isvm) { String manufacturer = hw.getComputerSystem().getManufacturer(); String model = hw.getComputerSystem().getModel(); if (manufacturer.equals("Microsoft Corporation") && model.equals("Virtual Machine")) { isvm = true; return "On a VM: Microsoft Hyper-V"; } } return "Couldn't detect VM"; }

Target:
public static String identifyVM() { SystemInfo si = new SystemInfo(); HardwareAbstractionLayer hw = si.getHardware(); NetworkIF[] nifs = hw.getNetworkIFs(); for (NetworkIF nif : nifs) { String mac = nif.getMacaddr().substring(0, 8).toUpperCase(); if (vmMacAddressOUI.containsKey(mac)) { return vmMacAddressOUI.get(mac); } } String model = hw.getComputerSystem().getModel(); for (String vm : vmModelArray) { if (model.contains(vm)) { return vm; } } String manufacturer = hw.getComputerSystem().getManufacturer(); if ("Microsoft Corporation".equals(manufacturer) && "Virtual Machine".equals(model)) { return "Microsoft Hyper-V"; } return ""; }
Source:
public void scheduleTask(String taskName, boolean requestRecovery) throws TaskException { throw new TaskException("Requesting recovery is not supported in standalone mode", null); }

Target:
public void scheduleTask(String taskName, boolean requestRecovery) throws TaskException { if (this.isMyTaskTypeRegistered()) { this.scheduleLocalTask(taskName, requestRecovery); } else { throw new TaskException("Task type: '" + this.getTaskType() + "' is not registered in the current task node", Code.TASK_NODE_NOT_AVAILABLE); } }
Source:
public final @Nonnull Stream<OWLAxiom> axiomBase() { Stream<OWLAxiom> toReturn = axiomBase.stream(); toReturn = Stream.concat(tautologies.stream().flatMap(Set::stream), toReturn); return axiomBase.stream(); }

Target:
public final @Nonnull Stream<OWLAxiom> axiomBase() { return axiomBase.stream(); }
Source:
public void onEvent(GitEvent event) { if (event instanceof GitCheckoutEvent) { GitCheckoutEvent checkoutEvent = (GitCheckoutEvent) event; String workspaceIdAndProjectName = checkoutEvent.getWorkspaceId() + checkoutEvent.getProjectName(); endpointIdsWithWorkspaceIdAndProjectName .entrySet() .stream() .filter(it -> it.getValue().contains(workspaceIdAndProjectName)) .map(Entry::getKey) .forEach( it -> transmitter .newRequest() .endpointId(it) .methodName("git/checkoutOutput") .paramsAsDto(event) .sendAndSkipResult()); } else if (event instanceof IndexChangedEvent) { endpointIds.forEach( id -> transmitter .newRequest() .endpointId(id) .methodName("event/git-index") .paramsAsDto(((IndexChangedEvent) event).getStatus()) .sendAndSkipResult()); } }

Target:
public void onEvent(GitEvent event) { if (event instanceof GitCheckoutEvent) { handleCheckoutEvent((GitCheckoutEvent) event); } else if (event instanceof GitCommitEvent || event instanceof GitResetEvent || event instanceof GitRepositoryInitializedEvent || event instanceof GitRepositoryDeletedEvent) { handleIndexChangedEvent(event); } }
Source:
public void stateUpdated(Item item, State state) { State oldState = this.state; if (function != null && baseItem != null) { State calculatedState = function.calculate(members); if (baseItem.getAcceptedDataTypes().contains(PercentType.class) && !baseItem.getAcceptedDataTypes().contains(DecimalType.class)) { calculatedState = calculatedState.as(PercentType.class); } setState(calculatedState); } if (!oldState.equals(this.state)) { sendGroupStateChangedEvent(item.getName(), this.state, oldState); } }

Target:
public void stateUpdated(Item item, State state) { State oldState = this.state; if (function != null && baseItem != null) { State calculatedState = function.calculate(members); calculatedState = ItemUtil.convertToAcceptedState(calculatedState, baseItem); setState(calculatedState); } if (!oldState.equals(this.state)) { sendGroupStateChangedEvent(item.getName(), this.state, oldState); } }
Source:
public void serializeTimingData(Path outputPath) { merge(); try (FileWriter fw = new FileWriter(outputPath.toFile())) { fw.write("Number Of Executions | Total Milliseconds | Milliseconds per execution | Type\n"); for (Map.Entry<String, TimingData> timing : executionInfo.entrySet()) { TimingData data = timing.getValue(); long totalMillis = (data.totalNanos / 1000000); double millisPerExecution = (double) totalMillis / (double) data.numberOfExecutions; fw.write(String.format("%6d, %6d, %8.2f, %s", data.numberOfExecutions, totalMillis, millisPerExecution, StringEscapeUtils.escapeCsv(timing.getKey()) )); fw.write("\n"); } } catch (Exception e) { e.printStackTrace(); } }

Target:
public void serializeTimingData(Path outputPath) { merge(); try (FileWriter fw = new FileWriter(outputPath.toFile())) { fw.write("Number Of Executions, Total Milliseconds, Milliseconds per execution, Type\n"); for (Map.Entry<String, TimingData> timing : executionInfo.entrySet()) { TimingData data = timing.getValue(); long totalMillis = (data.totalNanos / 1000000); double millisPerExecution = (double) totalMillis / (double) data.numberOfExecutions; fw.write(String.format("%6d, %6d, %8.2f, %s\n", data.numberOfExecutions, totalMillis, millisPerExecution, StringEscapeUtils.escapeCsv(timing.getKey()) )); } } catch (Exception e) { e.printStackTrace(); } }
Source:
protected boolean canDoAction() { setVdsId(getParameters().getPrefferedSPMId()); if (getVds() == null) { return failCanDoAction(VdcBllMessages.VDS_NOT_EXIST); } if (getVds().getStatus() != VDSStatus.Up) { return failCanDo(VdcBllMessages.CANNOT_REINIT_SPM_VDS_NOT_UP); } if (getVds().getSpmStatus() != VdsSpmStatus.None) { return failCanDo(VdcBllMessages.CANNOT_REINIT_SPM_VDS_ALREADY_SPM); } if (getVds().getVdsSpmPriority() == BusinessEntitiesDefinitions.HOST_MIN_SPM_PRIORITY) { return failCanDo(VdcBllMessages.CANNOT_REINIT_SPM_VDS_MARKED_AS_NEVER_SPM); } return true; }

Target:
protected boolean canDoAction() { if (getVds() == null) { return failCanDoAction(VdcBllMessages.VDS_NOT_EXIST); } if (getVds().getStatus() != VDSStatus.Up) { return failCanDo(VdcBllMessages.CANNOT_REINIT_SPM_VDS_NOT_UP); } if (getVds().getStoragePoolId() != getParameters().getStoragePoolId() || getParameters().getStoragePoolId() == null) { return failCanDo(VdcBllMessages.CANNOT_REINIT_SPM_VDS_NOT_IN_POOL); } if (getVds().getSpmStatus() != VdsSpmStatus.None) { return failCanDo(VdcBllMessages.CANNOT_REINIT_SPM_VDS_ALREADY_SPM); } if (getVds().getVdsSpmPriority() == BusinessEntitiesDefinitions.HOST_MIN_SPM_PRIORITY) { return failCanDo(VdcBllMessages.CANNOT_REINIT_SPM_VDS_MARKED_AS_NEVER_SPM); } return true; }
Source:
public void registerAttributes(ManagementResourceRegistration resourceRegistration) { resourceRegistration.registerReadOnlyAttribute(MODULE, null); resourceRegistration.registerOperationHandler(ADD_OP, addHandler); }

Target:
public void registerAttributes(ManagementResourceRegistration resourceRegistration) { resourceRegistration.registerReadOnlyAttribute(MODULE, null); }
Source:
private List<String> mediaCellValues(String value, String imagePrefix) { List<String> cells = new ArrayList<>(); Media media = MediaResponse.parse(value); String filename = media.getFilename(); if (filename != null) { filename = filename.substring(filename.lastIndexOf("/") + 1); if (filename.length() > 0) { cells.add(imagePrefix + filename); if (splitIntoColumns && media.getLocation() != null) { cells.add(Double.toString(media.getLocation().getLatitude())); cells.add(Double.toString(media.getLocation().getLongitude())); cells.add(Double.toString(media.getLocation().getAccuracy())); } } } return cells; }

Target:
private List<String> mediaCellValues(String value, String imagePrefix) { List<String> cells = new ArrayList<>(); Media media = MediaResponse.parse(value); String filename = media.getFilename(); if (filename != null) { filename = Paths.get(filename).getFileName().toString(); if (filename.length() > 0) { cells.add(imagePrefix + filename); if (splitIntoColumns && media.getLocation() != null) { cells.add(Double.toString(media.getLocation().getLatitude())); cells.add(Double.toString(media.getLocation().getLongitude())); cells.add(Double.toString(media.getLocation().getAccuracy())); } } } return cells; }
Source:
public void updateFeedbackResponse( FeedbackResponseAttributes updatedResponse, FeedbackResponse oldResponseEntity) throws InvalidParametersException, EntityAlreadyExistsException { if (oldResponseEntity == null) { throw new NullPointerException("oldResponseEntity should not be null"); } FeedbackResponseAttributes newResponse = new FeedbackResponseAttributes(updatedResponse); FeedbackResponseAttributes oldResponse = new FeedbackResponseAttributes(oldResponseEntity); copyOldResponseToNewResponse(newResponse, oldResponse); if (!newResponse.recipientEmail.equals(oldResponse.recipientEmail) || !newResponse.giverEmail.equals(oldResponse.giverEmail)) { recreateResponse(newResponse, oldResponse); } else { try { frDb.updateFeedbackResponseOptimized(newResponse, oldResponseEntity); } catch (EntityDoesNotExistException e) { Assumption.fail(); } } }

Target:
public void updateFeedbackResponse( FeedbackResponseAttributes updatedResponse, FeedbackResponse oldResponseEntity) throws InvalidParametersException, EntityAlreadyExistsException { Assumption.assertNotNull(oldResponseEntity); FeedbackResponseAttributes newResponse = new FeedbackResponseAttributes(updatedResponse); FeedbackResponseAttributes oldResponse = new FeedbackResponseAttributes(oldResponseEntity); newResponse.courseId = oldResponse.courseId; newResponse.feedbackSessionName = oldResponse.feedbackSessionName; newResponse.feedbackQuestionId = oldResponse.feedbackQuestionId; newResponse.feedbackQuestionType = oldResponse.feedbackQuestionType; if (newResponse.responseMetaData == null) { newResponse.responseMetaData = oldResponse.responseMetaData; } if (newResponse.giverEmail == null) { newResponse.giverEmail = oldResponse.giverEmail; } if (newResponse.recipientEmail == null) { newResponse.recipientEmail = oldResponse.recipientEmail; } if (newResponse.giverSection == null) { newResponse.giverSection = oldResponse.giverSection; } if (newResponse.recipientSection == null) { newResponse.recipientSection = oldResponse.recipientSection; } if (!newResponse.recipientEmail.equals(oldResponse.recipientEmail) || !newResponse.giverEmail.equals(oldResponse.giverEmail)) { recreateResponse(newResponse, oldResponse); } else { try { frDb.updateFeedbackResponseOptimized(newResponse, oldResponseEntity); } catch (EntityDoesNotExistException e) { Assumption.fail(); } } }
Source:
public static IntervalList invert(final IntervalList list) { final IntervalList inverse = new IntervalList(list.header.clone()); final ListMap<Integer, Interval> map = new ListMap<Integer, Interval>(); for (final Interval i : list.uniqued().getIntervals()) { map.add(list.getHeader().getSequenceIndex(i.getContig()), i); } int intervals = 0; for (final SAMSequenceRecord samSequenceRecord : list.getHeader().getSequenceDictionary().getSequences()) { final Integer sequenceIndex = samSequenceRecord.getSequenceIndex(); final String sequenceName = samSequenceRecord.getSequenceName(); final int sequenceLength = samSequenceRecord.getSequenceLength(); Integer lastCoveredPosition = 0; if (map.containsKey(sequenceIndex)) { for (final Interval i : map.get(sequenceIndex)) { if (i.getStart() > lastCoveredPosition + 1) { inverse.add(new Interval(sequenceName, lastCoveredPosition + 1, i.getStart() - 1, false, "interval-" + (++intervals))); } lastCoveredPosition = i.getEnd(); } } if (sequenceLength > lastCoveredPosition) { inverse.add(new Interval(sequenceName, lastCoveredPosition + 1, sequenceLength, false, "interval-" + (++intervals))); } } return inverse; }

Target:
public static IntervalList invert(final IntervalList list) { final IntervalList inverse = new IntervalList(list.header.clone()); final ListMap<Integer, Interval> map = new ListMap<>(); for (final Interval i : list.uniqued().getIntervals()) { map.add(list.getHeader().getSequenceIndex(i.getContig()), i); } int intervals = 0; for (final SAMSequenceRecord samSequenceRecord : list.getHeader().getSequenceDictionary().getSequences()) { final Integer sequenceIndex = samSequenceRecord.getSequenceIndex(); final String sequenceName = samSequenceRecord.getSequenceName(); final int sequenceLength = samSequenceRecord.getSequenceLength(); int lastCoveredPosition = 0; if (map.containsKey(sequenceIndex)) { for (final Interval i : map.get(sequenceIndex)) { if (i.getStart() > lastCoveredPosition + 1) { inverse.add(new Interval(sequenceName, lastCoveredPosition + 1, i.getStart() - 1, false, "interval-" + (++intervals))); } lastCoveredPosition = i.getEnd(); } } if (sequenceLength > lastCoveredPosition) { inverse.add(new Interval(sequenceName, lastCoveredPosition + 1, sequenceLength, false, "interval-" + (++intervals))); } } return inverse; }
Source:
private Map<String, List<TaskId>> expectedAssignmentForTwoClients(final List<TaskId> assignedTasksForClient1, final List<TaskId> assignedTasksForClient2) { return mkMap( mkEntry(CLIENT_1, assignedTasksForClient1), mkEntry(CLIENT_2, assignedTasksForClient2) ); }

Target:
private static Map<String, List<TaskId>> expectedAssignmentForTwoClients(final List<TaskId> assignedTasksForClient1, final List<TaskId> assignedTasksForClient2) { return mkMap( mkEntry(CLIENT_1, assignedTasksForClient1), mkEntry(CLIENT_2, assignedTasksForClient2) ); }
Source:
public String toString() { StringBuilder fsBuilder = new StringBuilder(); for (Map.Entry<String, String> address : addresses.entrySet()) { fsBuilder.append("<nuage-extension>\n"); fsBuilder.append(" <interface mac='" + address.getKey() + "' vsp-vr-ip='" + address.getValue() + "'></interface>\n"); fsBuilder.append("</nuage-extension>\n"); } return fsBuilder.toString(); }

Target:
public String toString() { StringBuilder fsBuilder = new StringBuilder(); for (Map.Entry<String, String> address : addresses.entrySet()) { fsBuilder.append("<nuage-extension>\n") .append(" <interface mac='") .append(address.getKey()) .append("' vsp-vr-ip='") .append(address.getValue()) .append("'></interface>\n") .append("</nuage-extension>\n"); } return fsBuilder.toString(); }