auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Network inspectNetwork(InspectNetworkParams params) throws IOException { String netId = params.getNetworkId(); ServiceList services = openShiftClient.services() .inNamespace(this.cheOpenShiftProjectName) .list(); Map<String, ContainerInNetwork> containers = new HashMap<>(); for (Service svc : services.getItems()) { String selector = svc.getSpec().getSelector().get(OPENSHIFT_DEPLOYMENT_LABEL); if (selector == null || !selector.startsWith(CHE_OPENSHIFT_RESOURCES_PREFIX)) { continue; } PodList pods = openShiftClient.pods() .inNamespace(cheOpenShiftProjectName) .withLabel(OPENSHIFT_DEPLOYMENT_LABEL, selector) .list(); for (Pod pod : pods.getItems()) { String podName = pod.getMetadata() .getName(); ContainerInNetwork container = new ContainerInNetwork().withName(podName) .withIPv4Address(svc.getSpec() .getClusterIP()); String podId = getLabelFromContainerID(pod.getMetadata() .getLabels() .get(CHE_CONTAINER_IDENTIFIER_LABEL_KEY)); if (podId == null) { continue; } containers.put(podId, container); } } List<IpamConfig> ipamConfig = new ArrayList<>(); Ipam ipam = new Ipam().withDriver("bridge") .withOptions(Collections.emptyMap()) .withConfig(ipamConfig); return new Network().withName("OpenShift") .withId(netId) .withContainers(containers) .withLabels(Collections.emptyMap()) .withOptions(Collections.emptyMap()) .withDriver("default") .withIPAM(ipam) .withScope("local") .withInternal(false) .withEnableIPv6(false); }

Target:
public Network inspectNetwork(InspectNetworkParams params) throws IOException { String netId = params.getNetworkId(); ServiceList services = openShiftClient.services() .inNamespace(this.openShiftCheProjectName) .list(); Map<String, ContainerInNetwork> containers = new HashMap<>(); for (Service svc : services.getItems()) { String selector = svc.getSpec().getSelector().get(OPENSHIFT_DEPLOYMENT_LABEL); if (selector == null || !selector.startsWith(CHE_OPENSHIFT_RESOURCES_PREFIX)) { continue; } PodList pods = openShiftClient.pods() .inNamespace(openShiftCheProjectName) .withLabel(OPENSHIFT_DEPLOYMENT_LABEL, selector) .list(); for (Pod pod : pods.getItems()) { String podName = pod.getMetadata() .getName(); ContainerInNetwork container = new ContainerInNetwork().withName(podName) .withIPv4Address(svc.getSpec() .getClusterIP()); String podId = getLabelFromContainerID(pod.getMetadata() .getLabels() .get(CHE_CONTAINER_IDENTIFIER_LABEL_KEY)); if (podId == null) { continue; } containers.put(podId, container); } } List<IpamConfig> ipamConfig = new ArrayList<>(); Ipam ipam = new Ipam().withDriver("bridge") .withOptions(Collections.emptyMap()) .withConfig(ipamConfig); return new Network().withName("OpenShift") .withId(netId) .withContainers(containers) .withLabels(Collections.emptyMap()) .withOptions(Collections.emptyMap()) .withDriver("default") .withIPAM(ipam) .withScope("local") .withInternal(false) .withEnableIPv6(false); }
Source:
void testNoRetry() throws Exception { SyncTaskImpl task = new SyncTaskImpl(SUCCESS); RetryStats retryStats = new RetryStats(); Integer result = retry.run("test", retryStats, task); assertSyncSuccess(result, task, 1); }

Target:
void testNoRetry() throws Exception { SyncTaskImpl task = new SyncTaskImpl(SUCCESS); RetryStats retryStats = new RetryStats(); Integer result = retry.run("test", retryStats, task); assertSyncSuccess(result, task, 1); assertFinalSuccess(retryStats, 1); }
Source:
public void addAggregators(@NotNull String metric, @NotNull SingleMetricAggregator[] aggregators, @NotNull String[] logicalMetricNames) { Preconditions.checkNotNull(metric, "metric"); Preconditions.checkNotNull(aggregators, "aggregators"); Preconditions.checkNotNull(logicalMetricNames, "logicalMetricNames"); Preconditions.checkArgument(aggregators.length == logicalMetricNames.length, "different length aggregators and" + " logical names"); addAggregatorsHelper(metric, aggregators, logicalMetricNames); }

Target:
public void addAggregators(@NotNull String metric, @NotNull SingleMetricAggregator[] aggregators, @NotNull String[] logicalMetricNames) { Preconditions.checkNotNull(metric, "metric"); Preconditions.checkNotNull(aggregators, "aggregators"); Preconditions.checkNotNull(logicalMetricNames, "logicalMetricNames"); Preconditions.checkArgument(aggregators.length == logicalMetricNames.length, "different length aggregators and logical names"); addAggregatorsHelper(metric, aggregators, logicalMetricNames); }
Source:
public void testRelativeSymlink() throws IOException, URISyntaxException { assumeThat(System.getProperty("os.name"), not(containsString("Windows"))); final Path tempDir = Files.createTempDirectory("ds3_file_object_rel_test_"); final Path tempPath = Files.createTempFile(tempDir, "temp_", ".txt"); try { try (final SeekableByteChannel channel = Files.newByteChannel(tempPath, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.WRITE)) { channel.write(ByteBuffer.wrap(testData)); } final Path symLinkPath = tempDir.resolve("sym_" + tempPath.getFileName().toString()); final Path relPath = Paths.get("..", getParentDir(tempPath), tempPath.getFileName().toString()); LOG.info("Creating symlink from " + symLinkPath.toString() + " to " + relPath.toString()); Files.createSymbolicLink(symLinkPath, relPath); getFileWithPutter(tempDir, symLinkPath); } finally { Files.deleteIfExists(tempPath); Files.deleteIfExists(tempDir); } }

Target:
public void testRelativeSymlink() throws IOException, URISyntaxException { assumeFalse(Platform.isWindows()); final Path tempDir = Files.createTempDirectory("ds3_file_object_rel_test_"); final Path tempPath = Files.createTempFile(tempDir, "temp_", ".txt"); try { try (final SeekableByteChannel channel = Files.newByteChannel(tempPath, StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING, StandardOpenOption.WRITE)) { channel.write(ByteBuffer.wrap(testData)); } final Path symLinkPath = tempDir.resolve("sym_" + tempPath.getFileName().toString()); final Path relPath = Paths.get("..", getParentDir(tempPath), tempPath.getFileName().toString()); LOG.info("Creating symlink from " + symLinkPath.toString() + " to " + relPath.toString()); Files.createSymbolicLink(symLinkPath, relPath); getFileWithPutter(tempDir, symLinkPath); } finally { Files.deleteIfExists(tempPath); Files.deleteIfExists(tempDir); } }
Source:
public FormDefinitionImportService getService(ConfigurationType type) { switch (type) { case ODK: return formDefinitionImportServiceODK; case ONA: return formDefinitionImportServiceOna; case KOBO: return formDefinitionImportServiceKobo; default: return null; } }

Target:
public FormDefinitionImportService getService(ConfigurationType type) throws ConfigurationTypeException { switch (type) { case ODK: return formDefinitionImportServiceODK; case ONA: return formDefinitionImportServiceOna; case KOBO: return formDefinitionImportServiceKobo; default: throw new ConfigurationTypeException(NO_SERVICE + type); } }
Source:
public String getText(Object element) { if (element instanceof EObject) { EObject eObject = (EObject) element; String text = getLabel(eObject); EObject container = eObject.eContainer(); while (container != null) { text = getLabel(container) + DELIMITER + text; container = container.eContainer(); } return text; } return wrappedProvider != null ? wrappedProvider.getText(element) : super.getText(element); }

Target:
public String getText(Object element) { if (element instanceof EObject && handles((EObject) element)) { LinkedList<String> segments = Lists.newLinkedList(); for (EObject current = (EObject) element; current != null; current = current.eContainer()) { segments.addFirst(getLabel(current)); } return Joiner.on(getDelimiter()).join(segments); } return wrappedProvider != null ? wrappedProvider.getText(element) : super.getText(element); }
Source:
public ESat isEntailed() { if (isCompletelyInstantiated()) { return ESat.eval(values[y.getLB()] <= x.getUB() && x.getLB() <= values[y.getUB()]); } return ESat.UNDEFINED; }

Target:
public ESat isEntailed() { if (isCompletelyInstantiated()) { int idx = y.getValue(); if(idx < 0 || idx >= values.length) { return ESat.FALSE; } return ESat.eval( (idx == 0 || values[idx-1] < x.getLB()) && x.getLB() <= values[idx] && values[idx] <= x.getUB() && (idx == values.length-1 || x.getUB() < values[idx+1]) ); } return ESat.UNDEFINED; }
Source:
public void testEGetNullEObject() { assertEquals(null, eObjectServices.eGet(null, "query")); }

Target:
public void testEGetNullEObject() { eObjectServices.eGet(null, "query"); }
Source:
private void readFile(ByteBuffer buffer) { try (FileInputStream fis = new FileInputStream(file); FileChannel channel = fis.getChannel()) { channel.position(offset); channel.read(buffer); } catch (IOException e) { throw new RuntimeException(e); } }

Target:
private void readFile(ByteBuffer buffer) { try { fileChannel.read(buffer, offset); } catch (IOException e) { throw new RuntimeException(e); } }
Source:
public int hashCode() { return Objects.hash(hash); }

Target:
public int hashCode() { return hash.hashCode(); }
Source:
public void testInputValidation() { ______TS("input validation"); editPage.submitUnsuccessfully(null, "", null, null) .verifyStatus(Const.StatusMessages.FIELDS_EMPTY); String invalidStudentName = "invalidstudentnamewithmorethan40characters"; String newTeamName = "New teamname"; editPage.submitUnsuccessfully(invalidStudentName, newTeamName, null, null) .verifyStatus(Const.StatusMessages.COURSE_STUDENTNAME_INVALID); String newStudentName = "New guy"; String invalidTeamName = "invalidteamnamewithmorethan60characterslooooooooooooooooooong"; editPage.submitUnsuccessfully(newStudentName, invalidTeamName, null, null) .verifyStatus(Const.StatusMessages.COURSE_TEAMNAME_INVALID); String invalidEmail = "invalidemail"; editPage.submitUnsuccessfully(newStudentName, newTeamName, invalidEmail, null) .verifyStatus(Const.StatusMessages.COURSE_EMAIL_INVALID); }

Target:
public void testInputValidation() { ______TS("input validation"); editPage.submitUnsuccessfully(null, "", null, null) .verifyStatus(Const.StatusMessages.FIELDS_EMPTY); String invalidStudentName = StringHelper.generateStringOfLength(FieldValidator.COURSE_STUDENTNAME_MAX_LENGTH + 1); String newTeamName = "New teamname"; editPage.submitUnsuccessfully(invalidStudentName, newTeamName, null, null) .verifyStatus(Const.StatusMessages.COURSE_STUDENTNAME_INVALID); String newStudentName = "New guy"; String invalidTeamName = StringHelper.generateStringOfLength(FieldValidator.COURSE_TEAMNAME_MAX_LENGTH + 1); editPage.submitUnsuccessfully(newStudentName, invalidTeamName, null, null) .verifyStatus(Const.StatusMessages.COURSE_TEAMNAME_INVALID); String invalidEmail = "invalidemail"; editPage.submitUnsuccessfully(newStudentName, newTeamName, invalidEmail, null) .verifyStatus(Const.StatusMessages.COURSE_EMAIL_INVALID); }
Source:
public CalculatorExpressionTokenizer(Context context) { mReplacementMap = new HashMap<>(); NumberFormat nf = DecimalFormat.getInstance( context.getResources().getConfiguration().locale); mReplacementMap.put(".", context.getString(R.string.dec_point)); for (int i = 0; i <= 9; ++i) { mReplacementMap.put(String.valueOf(i), nf.format(i)); } mReplacementMap.put("/", context.getString(R.string.op_div)); mReplacementMap.put("*", context.getString(R.string.op_mul)); mReplacementMap.put("-", context.getString(R.string.op_sub)); mReplacementMap.put("cos", context.getString(R.string.fun_cos)); mReplacementMap.put("ln", context.getString(R.string.fun_ln)); mReplacementMap.put("log", context.getString(R.string.fun_log)); mReplacementMap.put("sin", context.getString(R.string.fun_sin)); mReplacementMap.put("tan", context.getString(R.string.fun_tan)); mReplacementMap.put("Infinity", context.getString(R.string.inf)); }

Target:
public CalculatorExpressionTokenizer(Context context) { mReplacementMap = new HashMap<>(); Locale locale = context.getResources().getConfiguration().locale; if (!"fa".equals(locale.getLanguage())) { locale = (new Locale.Builder()) .setLocale(locale) .setUnicodeLocaleKeyword("nu", "latn") .build(); } final NumberFormat nf = DecimalFormat.getInstance(locale); final DecimalFormatSymbols symbols = new DecimalFormatSymbols(locale); mReplacementMap.put(".", String.valueOf(symbols.getDecimalSeparator())); for (int i = 0; i <= 9; ++i) { mReplacementMap.put(String.valueOf(i), nf.format(i)); } mReplacementMap.put("/", context.getString(R.string.op_div)); mReplacementMap.put("*", context.getString(R.string.op_mul)); mReplacementMap.put("-", context.getString(R.string.op_sub)); mReplacementMap.put("cos", context.getString(R.string.fun_cos)); mReplacementMap.put("ln", context.getString(R.string.fun_ln)); mReplacementMap.put("log", context.getString(R.string.fun_log)); mReplacementMap.put("sin", context.getString(R.string.fun_sin)); mReplacementMap.put("tan", context.getString(R.string.fun_tan)); mReplacementMap.put("Infinity", context.getString(R.string.inf)); }
Source:
public CallFilteringResult whenDone(CallFilteringResult result) { mFilter.result = result; for (CallFilter filter : mFilter.getFollowings()) { if (filter.decrementAndGetIndegree() == 0) { mHandler.post(() -> scheduleFilter(filter)); } } if (mFilter.equals(mDummyComplete)) { mHandlerThread.quitSafely(); mListener.onCallFilteringComplete(mCall, result); } return result; }

Target:
public void whenDone(CallFilteringResult result) { mFilter.result = result; for (CallFilter filter : mFilter.getFollowings()) { if (filter.decrementAndGetIndegree() == 0) { scheduleFilter(filter); } } if (mFilter.equals(mDummyComplete)) { mFinished = true; mListener.onCallFilteringComplete(mCall, result); mHandlerThread.quitSafely(); } }
Source:
public void testVariantIds() { Set<String> emptySet = new HashSet<>(); String line = "1\t1000\trs123\tC\tT\t.\t.\t."; List<Variant> expResult = new LinkedList<>(); expResult.add(new Variant("1", 1000, 1000, "C", "T")); List<Variant> result = factory.create(FILE_ID, STUDY_ID, line); assertEquals(expResult, result); assertEquals(expResult.get(0).getIds(), emptySet); line = "1\t1000\trs123;rs456\tC\tT\t.\t.\t."; expResult = new LinkedList<>(); expResult.add(new Variant("1", 1000, 1000, "C", "T")); result = factory.create(FILE_ID, STUDY_ID, line); assertEquals(expResult, result); assertEquals(expResult.get(0).getIds(), emptySet); line = "1\t1000\t.\tC\tT\t.\t.\t."; expResult = new LinkedList<>(); expResult.add(new Variant("1", 1000, 1000, "C", "T")); result = factory.create(FILE_ID, STUDY_ID, line); assertEquals(expResult, result); assertEquals(expResult.get(0).getIds().size(), emptySet.size()); }

Target:
public void testVariantIds() { Set<String> emptySet = new HashSet<>(); String line = "1\t1000\trs123\tC\tT\t.\t.\t."; List<Variant> expResult = new LinkedList<>(); expResult.add(new Variant("1", 1000, 1000, "C", "T")); List<Variant> result = factory.create(FILE_ID, STUDY_ID, line); assertEquals(expResult, result); assertEquals(emptySet, result.get(0).getIds()); line = "1\t1000\trs123;rs456\tC\tT\t.\t.\t."; expResult = new LinkedList<>(); expResult.add(new Variant("1", 1000, 1000, "C", "T")); result = factory.create(FILE_ID, STUDY_ID, line); assertEquals(expResult, result); assertEquals(emptySet, result.get(0).getIds()); line = "1\t1000\t.\tC\tT\t.\t.\t."; expResult = new LinkedList<>(); expResult.add(new Variant("1", 1000, 1000, "C", "T")); result = factory.create(FILE_ID, STUDY_ID, line); assertEquals(expResult, result); assertEquals(emptySet, result.get(0).getIds()); }
Source:
private String waitAndRetrieveContainerID(String deploymentName) throws IOException { try (OpenShiftClient openShiftClient = new DefaultOpenShiftClient()) { for (int i = 0; i < OPENSHIFT_WAIT_POD_TIMEOUT; i++) { try { Thread.sleep(OPENSHIFT_WAIT_POD_DELAY); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } List<Pod> pods = openShiftClient.pods() .inNamespace(this.openShiftCheProjectName) .withLabel(OPENSHIFT_DEPLOYMENT_LABEL, deploymentName) .list() .getItems(); if (pods.size() < 1) { throw new OpenShiftException(String.format("Pod with deployment name %s not found", deploymentName)); } else if (pods.size() > 1) { throw new OpenShiftException(String.format("Multiple pods with deployment name %s found", deploymentName)); } Pod pod = pods.get(0); String status = pod.getStatus().getPhase(); if (OPENSHIFT_POD_STATUS_RUNNING.equals(status)) { String containerID = pod.getStatus().getContainerStatuses().get(0).getContainerID(); String normalizedID = KubernetesStringUtils.normalizeContainerID(containerID); pod.getSpec().setTerminationGracePeriodSeconds(OPENSHIFT_POD_TERMINATION_GRACE_PERIOD); openShiftClient.pods() .inNamespace(openShiftCheProjectName) .withName(pod.getMetadata().getName()) .edit() .editMetadata() .addToLabels(CHE_CONTAINER_IDENTIFIER_LABEL_KEY, KubernetesStringUtils.getLabelFromContainerID(normalizedID)) .endMetadata() .done(); return normalizedID; } } return null; } }

Target:
private String waitAndRetrieveContainerID(String deploymentName) throws IOException { try (OpenShiftClient openShiftClient = new DefaultOpenShiftClient()) { for (int i = 0; i < OPENSHIFT_WAIT_POD_TIMEOUT; i++) { try { Thread.sleep(OPENSHIFT_WAIT_POD_DELAY); } catch (InterruptedException ex) { Thread.currentThread().interrupt(); } List<Pod> pods = openShiftClient.pods() .inNamespace(this.openShiftCheProjectName) .withLabel(OPENSHIFT_DEPLOYMENT_LABEL, deploymentName) .list() .getItems(); if (pods.size() < 1) { throw new OpenShiftException(String.format("Pod with deployment name %s not found", deploymentName)); } else if (pods.size() > 1) { throw new OpenShiftException(String.format("Multiple pods with deployment name %s found", deploymentName)); } Pod pod = pods.get(0); String status = pod.getStatus().getPhase(); if (OPENSHIFT_POD_STATUS_RUNNING.equals(status)) { String containerID = pod.getStatus().getContainerStatuses().get(0).getContainerID(); String normalizedID = KubernetesStringUtils.normalizeContainerID(containerID); openShiftClient.pods() .inNamespace(openShiftCheProjectName) .withName(pod.getMetadata().getName()) .edit() .editMetadata() .addToLabels(CHE_CONTAINER_IDENTIFIER_LABEL_KEY, KubernetesStringUtils.getLabelFromContainerID(normalizedID)) .endMetadata() .done(); return normalizedID; } } return null; } }
Source:
public void setRedisKeyNamespace(String namespace) { this.keyPrefix = namespace + ":"; }

Target:
public void setRedisKeyNamespace(String namespace) { Assert.hasText(namespace, "namespace cannot be null or empty"); this.keyPrefix = namespace.trim() + ":"; }
Source:
protected <P extends Message, A extends AggregatePart<I, P, ?>> P getPartState( Class<P> partStateClass) { final P partState = root.getPartState(partStateClass); return partState; }

Target:
protected <P extends Message> P getPartState(Class<P> partStateClass) { final P partState = root.getPartState(partStateClass); return partState; }
Source:
private void addSecondaryWhenPrimaryIsNonNull(final MongoDBServer secondary) { executor.submit(new Runnable() { @Override public void run() { Boolean isAvailable = secondary.getAttribute(MongoDBServer.SERVICE_UP); MongoDBServer primary = getPrimary(); if (isAvailable && primary != null) { primary.getClient().addMemberToReplicaSet(secondary, nextMemberId.incrementAndGet()); if (LOG.isInfoEnabled()) { LOG.info("{} added to replica set {}", secondary, getName()); } } else { if (LOG.isTraceEnabled()) { LOG.trace("Rescheduling addition of member to replica set {}: service_up={}, primary={}", new Object[]{secondary, getName(), isAvailable, primary}); } executor.schedule(this, 3, TimeUnit.SECONDS); } } }); }

Target:
private void addSecondaryWhenPrimaryIsNonNull(final MongoDBServer secondary) { executor.submit(new Runnable() { @Override public void run() { Boolean isAvailable = secondary.getAttribute(MongoDBServer.SERVICE_UP); MongoDBServer primary = getPrimary(); if (Boolean.TRUE.equals(isAvailable) && primary != null) { primary.addMemberToReplicaSet(secondary, nextMemberId.incrementAndGet()); if (LOG.isInfoEnabled()) { LOG.info("{} added to replica set {}", secondary, getName()); } } else { if (LOG.isTraceEnabled()) { LOG.trace("Rescheduling addition of member to replica set {}: service_up={}, primary={}", new Object[]{secondary, getName(), isAvailable, primary}); } executor.schedule(this, 3, TimeUnit.SECONDS); } } }); }
Source:
public static byte[] inflate(byte[] bytes, int expectedSize) throws DataFormatException { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(expectedSize); InflaterOutputStream ios = new InflaterOutputStream(baos); ios.write(bytes, 0, bytes.length); return baos.toByteArray(); } catch (Exception e) { throw new DataFormatException(); } }

Target:
public static byte[] inflate(byte[] bytes, int expectedSize) throws DataFormatException { try (ByteArrayOutputStream baos = new ByteArrayOutputStream(expectedSize); InflaterOutputStream ios = new InflaterOutputStream(baos)) { ios.write(bytes, 0, bytes.length); return baos.toByteArray(); } catch (IOException e) { throw new DataFormatException(); } }
Source:
public InputStream locateResourceStream(String name) { try { return new URL( name ).openStream(); } catch (Exception ignore) { } try { final InputStream stream = aggregatedClassLoader.getResourceAsStream( name ); if ( stream != null ) { return stream; } } catch (Exception ignore) { } final String stripped = name.startsWith( "/" ) ? name.substring( 1 ) : null; if ( stripped != null ) { try { return new URL( stripped ).openStream(); } catch (Exception ignore) { } try { final InputStream stream = aggregatedClassLoader.getResourceAsStream( stripped ); if ( stream != null ) { return stream; } } catch (Exception ignore) { } } return null; }

Target:
public InputStream locateResourceStream(String name) { try { final InputStream stream = aggregatedClassLoader.getResourceAsStream( name ); if ( stream != null ) { return stream; } } catch (Exception ignore) { } final String stripped = name.startsWith( "/" ) ? name.substring( 1 ) : null; if ( stripped != null ) { try { return new URL( stripped ).openStream(); } catch (Exception ignore) { } try { final InputStream stream = aggregatedClassLoader.getResourceAsStream( stripped ); if ( stream != null ) { return stream; } } catch (Exception ignore) { } } return null; }
Source:
public boolean onTouchEvent(MotionEvent event) { if (!isEnabled()) return false; float eventX = event.getX(); float eventY = event.getY(); switch (event.getAction()) { case MotionEvent.ACTION_DOWN: getParent().requestDisallowInterceptTouchEvent(true); mPoints.clear(); if (mIsDoubleClick) { if (firstClick != 0 && System.currentTimeMillis() - firstClick > 200) { countClick = 0; } countClick ++; if (countClick == 1) { firstClick = System.currentTimeMillis(); } else if (countClick == 2) { long lastClick = System.currentTimeMillis(); if (lastClick - firstClick < 200) { this.clear(); break; } } } mPath.moveTo(eventX, eventY); mLastTouchX = eventX; mLastTouchY = eventY; addPoint(new TimedPoint(eventX, eventY)); if(mOnSignedListener != null) mOnSignedListener.onStartSigning(); case MotionEvent.ACTION_MOVE: resetDirtyRect(eventX, eventY); addPoint(new TimedPoint(eventX, eventY)); break; case MotionEvent.ACTION_UP: resetDirtyRect(eventX, eventY); addPoint(new TimedPoint(eventX, eventY)); getParent().requestDisallowInterceptTouchEvent(true); setIsEmpty(false); break; default: return false; } invalidate( (int) (mDirtyRect.left - mMaxWidth), (int) (mDirtyRect.top - mMaxWidth), (int) (mDirtyRect.right + mMaxWidth), (int) (mDirtyRect.bottom + mMaxWidth)); return true; }

Target:
public boolean onTouchEvent(MotionEvent event) { if (!isEnabled()) return false; float eventX = event.getX(); float eventY = event.getY(); switch (event.getAction()) { case MotionEvent.ACTION_DOWN: getParent().requestDisallowInterceptTouchEvent(true); mPoints.clear(); if (onDoubleClick()) break; mPath.moveTo(eventX, eventY); mLastTouchX = eventX; mLastTouchY = eventY; addPoint(getNewPoint(eventX, eventY)); if(mOnSignedListener != null) mOnSignedListener.onStartSigning(); case MotionEvent.ACTION_MOVE: resetDirtyRect(eventX, eventY); addPoint(getNewPoint(eventX, eventY)); break; case MotionEvent.ACTION_UP: resetDirtyRect(eventX, eventY); addPoint(getNewPoint(eventX, eventY)); getParent().requestDisallowInterceptTouchEvent(true); setIsEmpty(false); break; default: return false; } invalidate( (int) (mDirtyRect.left - mMaxWidth), (int) (mDirtyRect.top - mMaxWidth), (int) (mDirtyRect.right + mMaxWidth), (int) (mDirtyRect.bottom + mMaxWidth)); return true; }
Source:
private static void iterateNode(Node node, String fileName, String sectionName) { for (Node child : XmlUtil.getChildrenElements(node)) { if (NODES_TO_WRAP.contains(child.getNodeName())) { final String wrapperMessage = fileName + "/" + sectionName + ": Tag '" + child.getNodeName() + "' in '" + node.getNodeName() + "' needs a wrapping <span> or <div> with the class 'wrapper'."; Assert.assertTrue(wrapperMessage, "div".equals(node.getNodeName()) || "span".equals(node.getNodeName())); Assert.assertTrue(wrapperMessage, node.hasAttributes()); Assert.assertNotNull(wrapperMessage, node.getAttributes().getNamedItem("class")); Assert.assertTrue(wrapperMessage, node.getAttributes().getNamedItem("class").getNodeValue() .contains("wrapper")); if ("table".equals(child.getNodeName())) { iterateNode(child, fileName, sectionName); } if ("img".equals(child.getNodeName())) { final String dataImageInlineMessage = fileName + "/" + sectionName + ": img " + "needs an attribute data-image-inline which has the value 'true' if " + "the image should be displayed in the same line as the surrounding " + "text."; Assert.assertTrue(dataImageInlineMessage, node.getAttributes().getNamedItem("class").getNodeValue() .matches(".*(block|inline).*")); } } else { iterateNode(child, fileName, sectionName); } } }

Target:
private static void iterateNode(Node node, String fileName, String sectionName) { for (Node child : XmlUtil.getChildrenElements(node)) { if (NODES_TO_WRAP.contains(child.getNodeName())) { final String wrapperMessage = fileName + "/" + sectionName + ": Tag '" + child.getNodeName() + "' in '" + node.getNodeName() + "' needs a wrapping <span> or <div> with the class 'wrapper'."; Assert.assertTrue(wrapperMessage, "div".equals(node.getNodeName()) || "span".equals(node.getNodeName())); Assert.assertTrue(wrapperMessage, node.hasAttributes()); Assert.assertNotNull(wrapperMessage, node.getAttributes().getNamedItem("class")); Assert.assertTrue(wrapperMessage, node.getAttributes().getNamedItem("class").getNodeValue() .contains("wrapper")); if ("table".equals(child.getNodeName())) { iterateNode(child, fileName, sectionName); } if ("img".equals(child.getNodeName())) { final String dataImageInlineMessage = fileName + "/" + sectionName + ": img " + "needs the additional class inline if it should be displayed inline " + "or block if scrolling in mobile view should be enabled."; Assert.assertTrue(dataImageInlineMessage, node.getAttributes().getNamedItem("class").getNodeValue() .matches(".*(block|inline).*")); } } else { iterateNode(child, fileName, sectionName); } } }
Source:
public static <T extends WeldInjectionPointAttributes<?, ?>> Set<T> flattenInjectionPoints(List<? extends Set<T>> fieldInjectionPoints) { Set<T> injectionPoints = new HashSet<T>(); for (Set<T> i : fieldInjectionPoints) { injectionPoints.addAll(i); } return injectionPoints; }

Target:
public static <T extends WeldInjectionPointAttributes<?, ?>> Set<T> flattenInjectionPoints(List<? extends Set<T>> fieldInjectionPoints) { ImmutableSet.Builder<T> injectionPoints = ImmutableSet.builder(); for (Set<T> i : fieldInjectionPoints) { injectionPoints.addAll(i); } return injectionPoints.build(); }
Source:
JedisPool createPool(String host, int port, SslConfiguration sslConfiguration) { if (sslConfiguration != null) { return new JedisPool( poolConfiguration, URI.create(host + ":" + String.valueOf(port)), sslConfiguration.getSslSocketFactory(), sslConfiguration.getSslContext().getSupportedSSLParameters(), null ); } else { return new JedisPool(poolConfiguration, host, port, false); } }

Target:
JedisPool createPool(String host, int port, SslConfiguration sslConfiguration) { if (sslConfiguration != null) { return new JedisPool( poolConfiguration, URI.create(host + ":" + port), sslConfiguration.getSslSocketFactory(), sslConfiguration.getSslContext().getSupportedSSLParameters(), null ); } else { return new JedisPool(poolConfiguration, host, port, false); } }
Source:
protected Void doInBackground(Product... products) { Product product = products[0]; List<HistoryProduct> historyProducts = Utils.getAppDaoSession(mActivity).getHistoryProductDao().queryBuilder().where(HistoryProductDao.Properties.Barcode.eq(product.getCode())).list(); HistoryProduct hp; if(historyProducts.size() == 1) { hp = historyProducts.get(0); hp.setLastSeen(new Date()); } else { hp = new HistoryProduct(product.getProductName(), product.getBrands(), product.getImageFrontUrl(), product.getCode()); } Utils.getAppDaoSession(mActivity).getHistoryProductDao().insertOrReplace(hp); return null; }

Target:
protected Void doInBackground(Product... products) { Product product = products[0]; List<HistoryProduct> historyProducts = mHistoryProductDao.queryBuilder().where(HistoryProductDao.Properties.Barcode.eq(product.getCode())).list(); HistoryProduct hp; if(historyProducts.size() == 1) { hp = historyProducts.get(0); hp.setLastSeen(new Date()); } else { hp = new HistoryProduct(product.getProductName(), product.getBrands(), product.getImageFrontUrl(), product.getCode()); } mHistoryProductDao.insertOrReplace(hp); return null; }
Source:
private static ServerConnector initConnector(Server server, String intf, int portReq) { int portLo = portReq, portHi = portReq; if (portReq == 0) { portLo = VoltDB.DEFAULT_STATUS_PORT; portHi = portLo + 99; } for (int port=portLo; port<=portHi; port++) { try { ServerConnector connector = new ServerConnector(server); connector.setHost(intf); connector.setPort(port); connector.setName("status-connector"); connector.setIdleTimeout(CONNTMO); connector.open(); return connector; } catch (IOException ex) { logDebug("Unable to open port %s: %s", port, ex); } } String fail; if (portLo == portHi) { fail = String.format("Unable to open port %s", portLo); } else { fail = String.format("Unable to open any port in range %s to %s", portLo, portHi); } throw new RuntimeException(fail); }

Target:
private static ServerConnector initConnector(Server server, String intf, int portReq) throws IOException { int portLo = portReq, portHi = portReq; if (portReq == 0) { portLo = VoltDB.DEFAULT_STATUS_PORT; portHi = portLo + 99; } for (int port=portLo; port<=portHi; port++) { try { ServerConnector connector = new ServerConnector(server); connector.setHost(intf); connector.setPort(port); connector.setName("status-connector"); connector.setIdleTimeout(CONNTMO); connector.open(); return connector; } catch (IOException ex) { logDebug("Unable to open port %s: %s", port, ex); } } String fail; if (portLo == portHi) { fail = String.format("Unable to open port %s", portLo); } else { fail = String.format("Unable to open any port in range %s to %s", portLo, portHi); } throw new IOException(fail); }
Source:
public Set<String> getSupportedOptions() { AutoValueExtension.IncrementalExtensionType incrementalType = extensions.stream() .map(e -> e.incrementalType(processingEnv)) .min(Comparator.naturalOrder()) .orElse(AutoValueExtension.IncrementalExtensionType.ISOLATING); switch (incrementalType) { case ISOLATING: return ImmutableSet.of(OMIT_IDENTIFIERS_OPTION, IncrementalAnnotationProcessorType.ISOLATING.getProcessorOption()); case AGGREGATING: return ImmutableSet.of(OMIT_IDENTIFIERS_OPTION, IncrementalAnnotationProcessorType.AGGREGATING.getProcessorOption()); case UNKNOWN: default: return ImmutableSet.of(OMIT_IDENTIFIERS_OPTION); } }

Target:
public Set<String> getSupportedOptions() { AutoValueExtension.IncrementalExtensionType incrementalType = extensions.stream() .map(e -> e.incrementalType(processingEnv)) .min(Comparator.naturalOrder()) .orElse(AutoValueExtension.IncrementalExtensionType.ISOLATING); switch (incrementalType) { case ISOLATING: return ImmutableSet.of(OMIT_IDENTIFIERS_OPTION, IncrementalAnnotationProcessorType.ISOLATING.getProcessorOption()); case AGGREGATING: return ImmutableSet.of(OMIT_IDENTIFIERS_OPTION, IncrementalAnnotationProcessorType.AGGREGATING.getProcessorOption()); case UNKNOWN: return ImmutableSet.of(OMIT_IDENTIFIERS_OPTION); } throw new AssertionError(incrementalType); }
Source:
private List<ColumnWriter> getLeafWriters(GroupColumnIO group) { if (!groupToLeafWriter.containsKey(group)) { groupToLeafWriter.put(group, new ArrayList<ColumnWriter>()); } return groupToLeafWriter.get(group); }

Target:
private List<ColumnWriter> getLeafWriters(GroupColumnIO group) { List<ColumnWriter> writers = groupToLeafWriter.get(group); if (writers == null) { writers = new ArrayList<ColumnWriter>(); groupToLeafWriter.put(group, writers); } return writers; }
Source:
public PlanNode visitPlan(PlanNode node, Void context) { Optional<PlanNode> pushedDownPlan = tryCreatingNewScanNode(node); if (pushedDownPlan.isPresent()) { return pushedDownPlan.get(); } else { return replaceChildren(node, node.getSources().stream().map(c -> c.accept(this, null)).collect(toImmutableList())); } }

Target:
public PlanNode visitPlan(PlanNode node, Void context) { Optional<PlanNode> pushedDownPlan = tryCreatingNewScanNode(node); return pushedDownPlan.orElseGet(() -> replaceChildren( node, node.getSources().stream().map(source -> source.accept(this, null)).collect(toImmutableList()))); }
Source:
public void testPurging_Invocation() { setup("3"); for (int i = 0; i < 2; i++) { map.executeOnEntries(getSlowEntryProcessor(4)); } map.executeOnEntries(getSlowEntryProcessor(4)); map.executeOnEntries(getSlowEntryProcessor(4)); awaitSlowEntryProcessors(); shutdownOperationService(instance); Collection<SlowOperationLog> logs = getSlowOperationLogsAndAssertNumberOfSlowOperationLogs(instance, 1); SlowOperationLog firstLog = logs.iterator().next(); int totalInvocations = firstLog.totalInvocations.get(); assertTrue(String.format("Expected 3 or 4 total invocations, but was %s, logs: %s", totalInvocations, firstLog.createDTO().toJson()), totalInvocations >= 3 && totalInvocations <= 4); assertEntryProcessorOperation(firstLog); assertStackTraceContainsClassName(firstLog, "SlowEntryProcessor"); Collection<SlowOperationLog.Invocation> invocations = getInvocations(firstLog); int invocationCount = invocations.size(); assertTrue("Expected 1 or 2 invocations, but was " + invocationCount, invocationCount >= 1 && invocationCount <= 2); for (SlowOperationLog.Invocation invocation : invocations) { assertInvocationDurationBetween(invocation, 1000, 3500); } }

Target:
public void testPurging_Invocation() { setup("3"); for (int i = 0; i < 3; i++) { map.executeOnEntries(getSlowEntryProcessor(3)); } map.executeOnEntries(getSlowEntryProcessor(5)); awaitSlowEntryProcessors(); shutdownOperationService(instance); Collection<SlowOperationLog> logs = getSlowOperationLogsAndAssertNumberOfSlowOperationLogs(instance, 1); SlowOperationLog firstLog = logs.iterator().next(); assertEntryProcessorOperation(firstLog); assertStackTraceContainsClassName(firstLog, "SlowEntryProcessor"); Collection<SlowOperationLog.Invocation> invocations = getInvocations(firstLog); int invocationCount = invocations.size(); int totalInvocations = firstLog.totalInvocations.get(); assertTrue(String.format("Expected invocations must be less than total invocations, but was %s, total invocations: %s", invocationCount, totalInvocations), invocationCount < totalInvocations); for (SlowOperationLog.Invocation invocation : invocations) { assertInvocationDurationBetween(invocation, 1000, 4500); } }
Source:
private Set<K> keySetWithPagingPredicate(Predicate predicate) { PagingPredicateImpl pagingPredicate = unwrapPagingPredicate(predicate); pagingPredicate.setIterationType(IterationType.KEY); ClientMessage request = MapKeySetWithPagingPredicateCodec.encodeRequest(name, toData(predicate)); ClientMessage response = invokeWithPredicate(request, predicate); List<Entry> resultList = new ArrayList<>(); MapKeySetWithPagingPredicateCodec.decodeResponse(response, data -> { K key = toObject(data); resultList.add(new AbstractMap.SimpleEntry<K, V>(key, null)); }); return (Set<K>) getSortedQueryResultSet(resultList, pagingPredicate, IterationType.KEY); }

Target:
private Set<K> keySetWithPagingPredicate(Predicate predicate) { PagingPredicateImpl pagingPredicate = unwrapPagingPredicate(predicate); pagingPredicate.setIterationType(IterationType.KEY); ClientMessage request = MapKeySetWithPagingPredicateCodec.encodeRequest(name, toData(predicate)); ClientMessage response = invokeWithPredicate(request, predicate); List<Entry> resultList = new ArrayList<>(); MapKeySetWithPagingPredicateCodec.decodeResponse(response, data -> { K key = toObject(data); resultList.add(new AbstractMap.SimpleImmutableEntry<K, V>(key, null)); }); return (Set<K>) getSortedQueryResultSet(resultList, pagingPredicate, IterationType.KEY); }
Source:
public void init(final FilterConfig config) throws ServletException { this.config = config; try { this.delayBeforeReinit = Long.parseLong(StringUtils.defaultString(config.getInitParameter(DELAY_BEFORE_REINIT), "60000")); log.info("delayBeforeReinit param set to: ms", this.delayBeforeReinit); } catch (NumberFormatException e) { log.warn("Incorrect value for '{}' init parameter, number of ms expected (integer)", DELAY_BEFORE_REINIT); } this.enabled = (Boolean) getBackendParameter(ConfigurationValues.CORSSupport); this.enabledDefaultOrigins = (Boolean) getBackendParameter(ConfigurationValues.CORSAllowDefaultOrigins); String sufficesFromConf = StringUtils.defaultString((String) getBackendParameter(ConfigurationValues.CORSDefaultOriginSuffixes), ""); this.defaultOriginsSuffixes = new HashSet<>(Arrays.asList(sufficesFromConf.split(","))); }

Target:
public void init(final FilterConfig config) throws ServletException { this.config = config; this.enabled = (Boolean) getBackendParameter(ConfigurationValues.CORSSupport); this.enabledDefaultOrigins = (Boolean) getBackendParameter(ConfigurationValues.CORSAllowDefaultOrigins); String sufficesFromConf = StringUtils.defaultString( (String) getBackendParameter(ConfigurationValues.CORSDefaultOriginSuffixes), ""); this.defaultOriginsSuffixes = new HashSet<>(Arrays.asList(sufficesFromConf.split(","))); }
Source:
HardDeleteRecoveryMetadata(byte[] hardDeleteRecoveryMetadataBytes, StoreKeyFactory factory) throws IOException { DataInputStream stream = new DataInputStream(new ByteArrayInputStream(hardDeleteRecoveryMetadataBytes)); headerVersion = stream.readShort(); userMetadataVersion = stream.readShort(); userMetadataSize = stream.readInt(); blobRecordVersion = stream.readShort(); blobType = (int) stream.readShort(); blobStreamSize = stream.readLong(); if (!MessageFormatRecord.isValidHeaderVersion(headerVersion) || !MessageFormatRecord.isValidUserMetadataVersion(userMetadataVersion) || !MessageFormatRecord.isValidBlobRecordVersion(blobRecordVersion)) { throw new IOException( "Unknown version during hard delete, headerVersion: " + headerVersion + " userMetadataVersion: " + userMetadataVersion + " blobRecordVersion: " + blobRecordVersion + " blobType " + blobType); } storeKey = factory.getStoreKey(stream); }

Target:
HardDeleteRecoveryMetadata(byte[] hardDeleteRecoveryMetadataBytes, StoreKeyFactory factory) throws IOException { DataInputStream stream = new DataInputStream(new ByteArrayInputStream(hardDeleteRecoveryMetadataBytes)); headerVersion = stream.readShort(); userMetadataVersion = stream.readShort(); userMetadataSize = stream.readInt(); blobRecordVersion = stream.readShort(); if (blobRecordVersion == MessageFormatRecord.Blob_Version_V2) { blobType = BlobType.values()[stream.readShort()]; } else { blobType = BlobType.DataBlob; } blobStreamSize = stream.readLong(); if (!MessageFormatRecord.isValidHeaderVersion(headerVersion) || !MessageFormatRecord.isValidUserMetadataVersion(userMetadataVersion) || !MessageFormatRecord.isValidBlobRecordVersion(blobRecordVersion)) { throw new IOException( "Unknown version during hard delete, headerVersion: " + headerVersion + " userMetadataVersion: " + userMetadataVersion + " blobRecordVersion: " + blobRecordVersion + " blobType " + blobType); } storeKey = factory.getStoreKey(stream); }
Source:
public IntegrationFlow fromChannel() { IntegrationFlowBuilder flowBuilder = IntegrationFlows.from(processor.input()) .bridge() .channel(processor.output()); return flowBuilder.get(); }

Target:
public IntegrationFlow fromChannel() { return IntegrationFlows.from(processor.input()) .channel(processor.output()).get(); }
Source:
public List<CategoryDTO> fetchInstallableApplications() { ApplicationsSource lastApplicationSource = new NullApplicationSource(); for (ApplicationsSource applicationSource : applicationSources) { lastApplicationSource = new TeeApplicationsSource(lastApplicationSource, applicationSource); } return lastApplicationSource.fetchInstallableApplications(); }

Target:
public List<CategoryDTO> fetchInstallableApplications() { return applicationsSource.fetchInstallableApplications(); }
Source:
private VmStatsRefresher getRefresherForVds(VdsManager vdsManager) { Version version = vdsManager.getCompatibilityVersion(); VDS vds = vdsManager.getCopyVds(); if (FeatureSupported.jsonProtocol(version) && VdsProtocol.STOMP == vds.getProtocol() && FeatureSupported.vmStatsEvents(version)) { return new EventVmStatsRefresher(vdsManager); } if (FeatureSupported.jsonProtocol(version) && VdsProtocol.STOMP == vds.getProtocol() && FeatureSupported.events(version)) { return new EventVmStatsRefresher(vdsManager); } return new PollListAndAllVmStatsRefresher(vdsManager); }

Target:
private VmStatsRefresher getRefresherForVds(VdsManager vdsManager) { Version version = vdsManager.getCompatibilityVersion(); VDS vds = vdsManager.getCopyVds(); if ((FeatureSupported.jsonProtocol(version) && VdsProtocol.STOMP == vds.getProtocol() && FeatureSupported.vmStatsEvents(version)) || (FeatureSupported.jsonProtocol(version) && VdsProtocol.STOMP == vds.getProtocol() && FeatureSupported.events(version))) { return new EventVmStatsRefresher(vdsManager); } return new PollListAndAllVmStatsRefresher(vdsManager); }
Source:
static void runAgent(String agentArgs, Instrumentation instrumentation, boolean injected) throws Exception { IdeaPatcherOptionsHolder optionsHolder = IdeaPatcherOptionsHolder.getInstance(); optionsHolder.addAll(agentArgs); List<IdeaPatcherTransformer> knownTransformers = new ArrayList<IdeaPatcherTransformer>(); knownTransformers.add(new ModifierVisibilityClassFileTransformer()); for (IdeaPatcherTransformer transformer: KNOWN_TRANSFORMERS) { if (transformer.supported()) { instrumentation.addTransformer(transformer, transformer.canRetransform()); } } instrumentation.addTransformer(new ModifierVisibilityClassFileTransformer(), true); }

Target:
static void runAgent(String agentArgs, Instrumentation instrumentation, boolean injected) throws Exception { IdeaPatcherOptionsHolder optionsHolder = IdeaPatcherOptionsHolder.getInstance(); optionsHolder.addAll(agentArgs); for (IdeaPatcherTransformer transformer : KNOWN_TRANSFORMERS) { if (transformer.supported()) { instrumentation.addTransformer(transformer, transformer.canRetransform()); } } }
Source:
private void handleTimeSeriesResponseException( HttpResponseException rex, String msg, List<TimeSeries> nextN) { TimeSeries ts = findProblematicTimeSeriesElement(rex.getMessage(), nextN); if (ts != null) { log.error("{}\nTime Series element: {}", rex.getMessage(), ts.toString()); } else { log.error("Caught HttpResponseException {}", msg, rex); } }

Target:
private void handleTimeSeriesResponseException( HttpResponseException rex, String msg, List<TimeSeries> nextN) { TimeSeries ts = findProblematicTimeSeriesElement(rex.getMessage(), nextN); if (ts != null) { log.error("{}: time series element: {}", rex.getMessage(), ts.toString()); } else { log.error("Caught HttpResponseException {}", msg, rex); } }
Source:
private void startVolumeProfiling() { if(getSelectedItems() == null) { return; } GlusterVolumeParameters parameter = new GlusterVolumeParameters(((GlusterVolumeEntity) getSelectedItem()).getId()); Frontend.getInstance().runAction(VdcActionType.StartGlusterVolumeProfile, parameter); }

Target:
private void startVolumeProfiling() { if (getSelectedItems() == null) { return; } List<GlusterVolumeEntity> selectedVolumesList = Linq.<GlusterVolumeEntity> cast(getSelectedItems()); ArrayList<VdcActionParametersBase> parameters = new ArrayList<VdcActionParametersBase>(); for (GlusterVolumeEntity currentSelectedVolume : selectedVolumesList) { GlusterVolumeParameters parameter = new GlusterVolumeParameters(currentSelectedVolume.getId()); parameters.add(parameter); } Frontend.getInstance().runMultipleAction(VdcActionType.StartGlusterVolumeProfile, parameters); }
Source:
public String[] getRegistrationIDs(AuthConfigProvider provider) { List<String> al = new ArrayList<String>(); synchronized (this.keyToAuthConfigProviderMap) { AuthConfigProvider acp = null; for (Map.Entry<String, AuthConfigProvider> entry : this.keyToAuthConfigProviderMap.entrySet()) { acp = entry.getValue(); if ((acp != null && acp.equals(provider)) || (acp == null && provider == null)) al.add(entry.getKey()); } } String[] sarr = new String[al.size()]; al.toArray(sarr); return sarr; }

Target:
public String[] getRegistrationIDs(AuthConfigProvider provider) { List<String> al = new ArrayList<String>(); synchronized (this.keyToAuthConfigProviderMap) { AuthConfigProvider acp = null; for (Map.Entry<String, AuthConfigProvider> entry : this.keyToAuthConfigProviderMap.entrySet()) { acp = entry.getValue(); if ((acp != null && acp.equals(provider)) || provider == null) al.add(entry.getKey()); } } String[] sarr = new String[al.size()]; al.toArray(sarr); return sarr; }
Source:
public String toString() { StringBuilder out = new StringBuilder(); if (this.expr.isPresent()) { out.append("\\"); for (FunctionArgument argument : this.arguments) { out.append(" ").append(argument.toString()); } out.append(" = "); out.append(this.expr.get().toString()); } return out.toString(); }

Target:
public String toString() { StringBuilder out = new StringBuilder(); if (!this.arguments.isEmpty()) { out.append("λ"); for (FunctionArgument argument : this.arguments) { out.append(" ").append(argument.toHaskell()); } out.append(" -> "); } out.append(this.expr.toHaskell()); return out.toString(); }
Source:
private void warnIfNotAllDisksPermitSnapshots() { if (getParameters().getRunAsStateless()) { for (Disk disk : getVm().getDiskMap().values()) { if (!disk.isAllowSnapshot()) { AuditLogDirector.log(this, AuditLogType.USER_RUN_VM_AS_STATELESS_WITH_DISKS_NOT_ALLOWING_SNAPSHOT); break; } } } }

Target:
private void warnIfNotAllDisksPermitSnapshots() { for (Disk disk : getVm().getDiskMap().values()) { if (!disk.isAllowSnapshot()) { AuditLogDirector.log(this, AuditLogType.USER_RUN_VM_AS_STATELESS_WITH_DISKS_NOT_ALLOWING_SNAPSHOT); break; } } }
Source:
default Class<? extends IRetryAnalyzer> getRetryAnalyzerClass() { return null; }

Target:
default Class<? extends IRetryAnalyzer> getRetryAnalyzerClass() { return getRetryAnalyzer().getClass(); }
Source:
public boolean isTemplateQuestionPanelExpanded(int qnNumber) { waitForPageToLoad(); return browser.driver.findElement(By.id("addTemplateQuestion-" + qnNumber)) .findElement(By.className("in")).isDisplayed(); }

Target:
public boolean isTemplateQuestionPanelExpanded(int qnNumber) { By expandedPanelSelector = By.cssSelector("#addTemplateQuestion-" + qnNumber + " .in"); waitForElementPresence(expandedPanelSelector); return browser.driver.findElement(expandedPanelSelector).isDisplayed(); }