auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testPropertiesMarshallUnmarshall() throws Exception { XmlMarshallUnmarshallImpl xmlMarshallerImpl = new XmlMarshallUnmarshallImpl(); String pid = "org.eclipse.kura.cloud.CloudService"; Tocd definition = null; Map<String, Object> properties = new HashMap<>(); properties.put("prop.string", new String("prop.value")); properties.put("prop.long", Long.MAX_VALUE); properties.put("prop.double", Double.MAX_VALUE); properties.put("prop.float", Float.MAX_VALUE); properties.put("prop.integer", Integer.MAX_VALUE); properties.put("prop.byte", Byte.MAX_VALUE); properties.put("prop.character", 'a'); properties.put("prop.short", Short.MAX_VALUE); XmlComponentConfigurations xcc = new XmlComponentConfigurations(); List<ComponentConfiguration> ccis = new ArrayList<>(); ComponentConfigurationImpl config = new ComponentConfigurationImpl(pid, definition, properties); ccis.add(config); xcc.setConfigurations(ccis); String s = xmlMarshallerImpl.marshal(xcc); <START> System.err.println(s); <END> XmlComponentConfigurations config1 = xmlMarshallerImpl.unmarshal(s, XmlComponentConfigurations.class); String s1 = xmlMarshallerImpl.marshal(config1); System.err.println(s1); Map<String, Object> properties1 = config1.getConfigurations().get(0).getConfigurationProperties(); assertEquals(properties, properties1); }</code><technical_language>logger instead, if necessary</technical_language>

Target:
public void testPropertiesMarshallUnmarshall() throws Exception { XmlMarshallUnmarshallImpl xmlMarshallerImpl = new XmlMarshallUnmarshallImpl(); String pid = "org.eclipse.kura.cloud.CloudService"; Tocd definition = null; Map<String, Object> properties = new HashMap<>(); properties.put("prop.string", new String("prop.value")); properties.put("prop.long", Long.MAX_VALUE); properties.put("prop.double", Double.MAX_VALUE); properties.put("prop.float", Float.MAX_VALUE); properties.put("prop.integer", Integer.MAX_VALUE); properties.put("prop.byte", Byte.MAX_VALUE); properties.put("prop.character", 'a'); properties.put("prop.short", Short.MAX_VALUE); XmlComponentConfigurations xcc = new XmlComponentConfigurations(); List<ComponentConfiguration> ccis = new ArrayList<>(); ComponentConfigurationImpl config = new ComponentConfigurationImpl(pid, definition, properties); ccis.add(config); xcc.setConfigurations(ccis); String s = xmlMarshallerImpl.marshal(xcc); logger.info(s); XmlComponentConfigurations config1 = xmlMarshallerImpl.unmarshal(s, XmlComponentConfigurations.class); String s1 = xmlMarshallerImpl.marshal(config1); logger.info(s1); Map<String, Object> properties1 = config1.getConfigurations().get(0).getConfigurationProperties(); assertEquals(properties, properties1); }
Source:
<code>protected void run() throws Exception { if (localName != null && gitdir != null) throw die(CLIText.get().conflictingUsageOf_git_dir_andArguments); final URIish uri = new URIish(sourceUri); if (localName == null) { try { localName = uri.getHumanishName(); } catch (IllegalArgumentException e) { throw die(MessageFormat.format(CLIText.get().cannotGuessLocalNameFrom, sourceUri)); } } if (branch == null) branch = Constants.HEAD; CloneCommand command = Git.cloneRepository(); command.setURI(sourceUri).setRemote(remoteName) .setNoCheckout(noCheckout).setBranch(branch); command.setGitDir(gitdir == null ? null : new File(gitdir)); command.setDirectory(localName == null ? null : new File(localName)); try { <START> db = command.call().getRepository(); <END> outw.println(MessageFormat.format(CLIText.get().cloningInto, command.getDirectory().getPath())); if (db.resolve(Constants.HEAD) == null) outw.println(CLIText.get().clonedEmptyRepository); } catch (InvalidRemoteException e) { throw die(MessageFormat.format(CLIText.get().doesNotExist, sourceUri)); } finally { if (db != null) db.close(); } outw.println(); outw.flush(); }</code><technical_language>NPE in next line command.getDirectory() is null. cloning a bare repo is gitDir</technical_language>

Target:
protected void run() throws Exception { if (localName != null && gitdir != null) throw die(CLIText.get().conflictingUsageOf_git_dir_andArguments); final URIish uri = new URIish(sourceUri); File localNameF; if (localName == null) { try { localNameF = new File(SystemReader.getInstance().getProperty( Constants.OS_USER_DIR), uri.getHumanishName()); } catch (IllegalArgumentException e) { throw die(MessageFormat.format(CLIText.get().cannotGuessLocalNameFrom, sourceUri)); } } else localNameF = new File(localName); if (branch == null) branch = Constants.HEAD; CloneCommand command = Git.cloneRepository(); command.setURI(sourceUri).setRemote(remoteName) .setNoCheckout(noCheckout).setBranch(branch); command.setGitDir(gitdir == null ? null : new File(gitdir)); command.setDirectory(localNameF); try { db = command.call().getRepository(); outw.println(MessageFormat.format(CLIText.get().cloningInto, command.getDirectory().getPath())); if (db.resolve(Constants.HEAD) == null) outw.println(CLIText.get().clonedEmptyRepository); } catch (InvalidRemoteException e) { throw die(MessageFormat.format(CLIText.get().doesNotExist, sourceUri)); } finally { if (db != null) db.close(); } outw.println(); outw.flush(); }
Source:
<code><START> Mono<PhoneNumberSearch>> purchaseSearchActivationOperation(String searchId) { <END> return (pollingContext) -> { Mono<PhoneNumberSearch> res = purchaseSearch(searchId).flatMap(agh -> { return getSearchById(searchId); }); return res; }; }</code><technical_language>nit: do mind moving Mono<PhoneNumberSearch>> line above, cleaner :)</technical_language>

Target:
Mono<Void>> purchaseSearchActivationOperation(String searchId) { return (pollingContext) -> { return purchaseSearch(searchId); }; }
Source:
<code>public void startCopyFromURL() { final Poller<BlobCopyInfo, Void> poller = client.beginCopyFromUrl(url); poller.getObserver().subscribe(response -> { <START> System.out.printf("Copy identifier: %s%n", response.getValue().getCopyId()); <END> }); END: com.azure.storage.blob.specialized.BlobClientBase.beginCopyFromUrl#URL }</code><technical_language>add copy status this</technical_language>

Target:
public void startCopyFromURL() { final Poller<BlobCopyInfo, Void> poller = client.beginCopy(url, Duration.ofSeconds(2)); poller.getObserver().subscribe(response -> { System.out.printf("Copy identifier: %s%n", response.getValue().getCopyId()); }); END: com.azure.storage.blob.specialized.BlobClientBase.beginCopy#String-Duration }
Source:
<code>public void testAssignUniqueId() { <START> String unionLineitem50Times = IntStream.range(0, 25) <END> .mapToObj(i -> "SELECT * FROM lineitem") .collect(joining(" UNION ALL ")); assertQuery( "SELECT count(*) FROM (" + "SELECT * FROM (" + " SELECT (SELECT count(*) WHERE c = 1) " + " FROM (SELECT CASE orderkey WHEN 1 THEN orderkey ELSE 1 END " + " FROM (" + unionLineitem50Times + ")) o(c)) result(a) " + "WHERE a = 1)", "VALUES 1504375"); }</code><technical_language>@sopel39 Variable name needs updating: s/unionLineitem50Times/___25Times</technical_language>

Target:
public void testAssignUniqueId() { String unionLineitem25Times = IntStream.range(0, 25) .mapToObj(i -> "SELECT * FROM lineitem") .collect(joining(" UNION ALL ")); assertQuery( "SELECT count(*) FROM (" + "SELECT * FROM (" + " SELECT (SELECT count(*) WHERE c = 1) " + " FROM (SELECT CASE orderkey WHEN 1 THEN orderkey ELSE 1 END " + " FROM (" + unionLineitem25Times + ")) o(c)) result(a) " + "WHERE a = 1)", "VALUES 1504375"); }
Source:
<code>public DescribableList<NodeProperty<?>, NodePropertyDescriptor> getNodeProperties() { assert nodeProperties != null; <START> return nodeProperties; <END> }</code><technical_language>suggestion return Objects.requireNonNull(nodeProperties); remove assertion above</technical_language>

Target:
public DescribableList<NodeProperty<?>, NodePropertyDescriptor> getNodeProperties() { return Objects.requireNonNull(nodeProperties); }
Source:
<code>public static FunctionDefinition.Kind determineFromString(final String code) { <START> return code == null ? null : (FEEL.code.equals(code) ? FEEL : (JAVA.code.equals(code) ? JAVA : (PMML.code.equals(code) ? PMML : null))); <END> }</code><technical_language>Please Objects.equals in this liner</technical_language>

Target:
public static FunctionDefinition.Kind determineFromString(final String code) { return code == null ? null : Objects.equals(FEEL.code, code) ? FEEL : (Objects.equals(JAVA.code, code) ? JAVA : (Objects.equals(PMML.code, code) ? PMML : null)); }
Source:
<code><START> public static GCRule buildGarbageCollectionRule(HColumnDescriptor columnDescriptor) { <END> int maxVersions = columnDescriptor.getMaxVersions(); int minVersions = columnDescriptor.getMinVersions(); int ttlSeconds = columnDescriptor.getTimeToLive(); Preconditions.checkState(minVersions < maxVersions, "HColumnDescriptor min versions must be less than max versions."); if (ttlSeconds == HColumnDescriptor.DEFAULT_TTL) { if (maxVersions == Integer.MAX_VALUE) { return null; } else { return GCRules.GCRULES.maxVersions(maxVersions); } } GCRule ageRule = GCRULES.maxAge(org.threeten.bp.Duration.ofSeconds(ttlSeconds)); if (minVersions != HColumnDescriptor.DEFAULT_MIN_VERSIONS) { ageRule = GCRULES.intersection().rule(ageRule).rule(GCRULES.maxVersions(minVersions)); } if (maxVersions == Integer.MAX_VALUE) { return ageRule; } else { return GCRULES.union().rule(ageRule).rule(GCRULES.maxVersions(maxVersions)); } }</code><technical_language>please move this method original do easier comparison github UI</technical_language>

Target:
public static GCRule buildGarbageCollectionRule(HColumnDescriptor columnDescriptor) { int maxVersions = columnDescriptor.getMaxVersions(); int minVersions = columnDescriptor.getMinVersions(); int ttlSeconds = columnDescriptor.getTimeToLive(); Preconditions.checkState(minVersions < maxVersions, "HColumnDescriptor min versions must be less than max versions."); if (ttlSeconds == HColumnDescriptor.DEFAULT_TTL) { if (maxVersions == Integer.MAX_VALUE) { return null; } else { return GCRULES.maxVersions(maxVersions); } } GCRule ageRule = GCRULES.maxAge(Duration.ofSeconds(ttlSeconds)); if (minVersions != HColumnDescriptor.DEFAULT_MIN_VERSIONS) { ageRule = GCRULES.intersection().rule(ageRule).rule(GCRULES.maxVersions(minVersions)); } if (maxVersions == Integer.MAX_VALUE) { return ageRule; } else { return GCRULES.union().rule(ageRule).rule(GCRULES.maxVersions(maxVersions)); } }
Source:
<code>public void run() { try { System.out.println("Echo server started."); while (true) { final Socket socket = serverSocket.accept(); sockets.add(socket); Thread thread = new Thread() { @Override public void run() { try { DataInputStream input = new DataInputStream(socket.getInputStream()); DataOutputStream output = new DataOutputStream(socket.getOutputStream()); while (socket.isConnected() && !socket.isClosed()) { long size = input.readLong(); <START> if (renegotiate.get()) { <END> renegotiate.set(false); ((SSLSocket) socket).startHandshake(); } byte[] bytes = new byte[(int) size - 8]; input.readFully(bytes); output.writeLong(size); output.write(bytes); output.flush(); } } catch (IOException e) { System.out.println(e.getMessage()); } finally { try { socket.close(); } catch (IOException e) { System.out.println(e.getMessage()); } } } }; thread.start(); threads.add(thread); } } catch (IOException e) { System.out.println(e.getMessage()); } }</code><technical_language>do if(compareAndSet(true,false))</technical_language>

Target:
public void run() { try { System.out.println("Echo server started."); while (true) { final Socket socket = serverSocket.accept(); sockets.add(socket); Thread thread = new Thread() { @Override public void run() { try { DataInputStream input = new DataInputStream(socket.getInputStream()); DataOutputStream output = new DataOutputStream(socket.getOutputStream()); while (socket.isConnected() && !socket.isClosed()) { long size = input.readLong(); if (renegotiate.compareAndSet(true, false)) { ((SSLSocket) socket).startHandshake(); } byte[] bytes = new byte[(int) size - 8]; input.readFully(bytes); output.writeLong(size); output.write(bytes); output.flush(); } } catch (IOException e) { } finally { try { socket.close(); } catch (IOException e) { exceptions.add(e); } } } }; thread.start(); threads.add(thread); } } catch (IOException e) { exceptions.add(e); } }
Source:
<code>protected void initialize(Object... args) { super.initialize(args); <START> final HttpServletRequest request = ctx.getRequest(); <END> userId = request.getParameter("userId"); workflowInstanceId = request.getParameter("workflowInstanceId"); workflowModelName = request.getParameter("workflowModelName"); }</code><technical_language>final</technical_language>

Target:
protected void initialize(Object... args) { super.initialize(args); HttpServletRequest request = ctx.getRequest(); userId = request.getParameter("userId"); workflowInstanceId = request.getParameter("workflowInstanceId"); workflowModelName = request.getParameter("workflowModelName"); }
Source:
<code><START> public void setCopyRatioCallingMetadata(@Nonnull final CopyRatioCallingMetadata copyRatioCallingMetadata) { <END> this.copyRatioCallingMetadata = Utils.nonNull(copyRatioCallingMetadata, "The metadata must be non-null"); Utils.validateArg(copyRatioCallingMetadata.hasSampleCoverageDepth(), "The metadata must contain depth of coverage field"); Utils.validateArg(copyRatioCallingMetadata.hasSampleSexGenotypeData(), "The metadata must contain sex genotype data"); }</code><technical_language>do need able optionally store metadata in a field? calling code needs metadata data perform a calculation ask for separately (or ask for object stores metadata instance a collection of data). worth violate encapsulation require data mutable</technical_language>

Target:
public void setCopyRatioCallingMetadata(@Nonnull final CopyRatioCallingMetadata copyRatioCallingMetadata) { this.copyRatioCallingMetadata = Utils.nonNull(copyRatioCallingMetadata, "The metadata must be non-null"); Utils.validateArg(copyRatioCallingMetadata.hasSampleCoverageDepth(), "The metadata must contain depth of coverage field"); Utils.validateArg(copyRatioCallingMetadata.hasSampleSexGenotypeData(), "The metadata must contain sex genotype field"); Utils.validateArg(copyRatioCallingMetadata.hasEmissionCalculationStrategy(), "The metadata must contain emission calculation strategy field"); }
Source:
<code>public void testPost() throws Exception { <START> MockHttpServletResponse response = postAsServletResponse("/rest/sessions/js", ""); <END> assertEquals(201, response.getStatus()); assertNotNull(response.getHeader("Location")); long sessionId = Long.valueOf(response.getContentAsString()); assertTrue(response.getHeader("Location").endsWith("sessions/js/" + sessionId)); }</code><technical_language>Likewise, this /rest/script/sessions, sessions controller updated. restlet framework handled servlet paths differently MVC framework I believe. way, verify in a 2.11 geoserver script installed of correct path</technical_language>

Target:
public void testPost() throws Exception { MockHttpServletResponse response = postAsServletResponse("/script/sessions/js", ""); assertEquals(201, response.getStatus()); assertNotNull(response.getHeader("Location")); long sessionId = Long.valueOf(response.getContentAsString()); assertTrue(response.getHeader("Location").endsWith("sessions/js/" + sessionId)); }
Source:
<code>protected boolean canDoAction() { if (getParameters().getRngDevice().getVmId() == null || !entityExists()) { return failCanDoAction(getParameters().isVm() ? VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND : VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_DOES_NOT_EXIST); } if (!isRngAllowedInEngine()) { return failCanDoAction(VdcBllMessages.RNG_NOT_ENABLED_IN_ENGINE); } VDSGroup cluster = getClusterForEntity(); <START> if (cluster == null || Version.v3_3.compareTo(cluster.getcompatibility_version()) > 0) { <END> return failCanDoAction(VdcBllMessages.ACTION_NOT_SUPPORTED_FOR_CLUSTER_LEVEL); } return true; }</code><technical_language>Please consider FeatureSupported for this kinds of checks</technical_language>

Target:
protected boolean canDoAction() { if (getParameters().getRngDevice().getVmId() == null || !entityExists()) { return failCanDoAction(getParameters().isVm() ? VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND : VdcBllMessages.ACTION_TYPE_FAILED_TEMPLATE_DOES_NOT_EXIST); } VDSGroup cluster = getClusterForEntity(); if (cluster == null || !FeatureSupported.virtIoRngSupported(cluster.getcompatibility_version())) { return failCanDoAction(VdcBllMessages.ACTION_NOT_SUPPORTED_FOR_CLUSTER_LEVEL); } return true; }
Source:
<code>public static JsonPathContext jsonApiCommonSyntax(JsonValueContext input, String pathSpec) { PathMode mode; String pathWff; <START> try { <END> Matcher matcher = JSON_PATH_BASE.matcher(pathSpec); if (!matcher.matches()) { mode = PathMode.STRICT; pathWff = pathSpec; } else { mode = PathMode.valueOf(matcher.group(1).toUpperCase(Locale.ROOT)); pathWff = matcher.group(2); } DocumentContext ctx; switch (mode) { case STRICT: if (input.hasException()) { return JsonPathContext.withStrictException(pathSpec, input.exc); } ctx = JsonPath.parse(input.obj, Configuration .builder() .jsonProvider(JSON_PATH_JSON_PROVIDER) .mappingProvider(JSON_PATH_MAPPING_PROVIDER) .build()); break; case LAX: if (input.hasException()) { return JsonPathContext.withJavaObj(PathMode.LAX, null); } ctx = JsonPath.parse(input.obj, Configuration .builder() .options(Option.SUPPRESS_EXCEPTIONS) .jsonProvider(JSON_PATH_JSON_PROVIDER) .mappingProvider(JSON_PATH_MAPPING_PROVIDER) .build()); break; default: throw RESOURCE.illegalJsonPathModeInPathSpec(mode.toString(), pathSpec).ex(); } try { return JsonPathContext.withJavaObj(mode, ctx.read(pathWff)); } catch (Exception e) { return JsonPathContext.withStrictException(pathSpec, e); } } catch (Exception e) { return JsonPathContext.withUnknownException(e); } }</code><technical_language>pathWff mean? change a more clearer name</technical_language>

Target:
public static JsonPathContext jsonApiCommonSyntax(JsonValueContext input, String pathSpec) { PathMode mode; String pathStr; try { Matcher matcher = JSON_PATH_BASE.matcher(pathSpec); if (!matcher.matches()) { mode = PathMode.STRICT; pathStr = pathSpec; } else { mode = PathMode.valueOf(matcher.group(1).toUpperCase(Locale.ROOT)); pathStr = matcher.group(2); } DocumentContext ctx; switch (mode) { case STRICT: if (input.hasException()) { return JsonPathContext.withStrictException(pathSpec, input.exc); } ctx = JsonPath.parse(input.obj, Configuration .builder() .jsonProvider(JSON_PATH_JSON_PROVIDER) .mappingProvider(JSON_PATH_MAPPING_PROVIDER) .build()); break; case LAX: if (input.hasException()) { return JsonPathContext.withJavaObj(PathMode.LAX, null); } ctx = JsonPath.parse(input.obj, Configuration .builder() .options(Option.SUPPRESS_EXCEPTIONS) .jsonProvider(JSON_PATH_JSON_PROVIDER) .mappingProvider(JSON_PATH_MAPPING_PROVIDER) .build()); break; default: throw RESOURCE.illegalJsonPathModeInPathSpec(mode.toString(), pathSpec).ex(); } try { return JsonPathContext.withJavaObj(mode, ctx.read(pathStr)); } catch (Exception e) { return JsonPathContext.withStrictException(pathSpec, e); } } catch (Exception e) { return JsonPathContext.withUnknownException(e); } }
Source:
<code>private synchronized boolean isPossibleToIssueNewBuffer() { <START> Runtime rt = Runtime.getRuntime(); <END> int bufferCountByMaxFreeBuffers = maxBuffersToPool + rt.availableProcessors(); if (numBuffersInUse >= bufferCountByMaxFreeBuffers) { return false; } double freeMemory = rt.maxMemory() - (rt.totalMemory() - rt.freeMemory()); int bufferCountByMemory = (int) ceil( (freeMemory * maxMemUsagePercentage / HUNDRED) / bufferSize); int maxBuffersThatCanBeInUse = min(bufferCountByMemory, bufferCountByMaxFreeBuffers); if (maxBuffersThatCanBeInUse < 2) { maxBuffersThatCanBeInUse = 2; } return numBuffersInUse < maxBuffersThatCanBeInUse; }</code><technical_language>this done a sync block? a JNI call</technical_language>

Target:
private synchronized boolean isPossibleToIssueNewBuffer() { setMaxBuffersThatCanBeInUse(); return numBuffersInUse < MAX_BUFFERS_THAT_CAN_BE_IN_USE; }
Source:
<code>public static void copyToClipboard(final Context context, final String text) { <START> ClipboardManager clipboardManager = <END> (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE); if (clipboardManager == null) { Toast.makeText(context, R.string.permission_denied, Toast.LENGTH_LONG).show(); return; } clipboardManager.setPrimaryClip(ClipData.newPlainText(null, text)); Toast.makeText(context, R.string.msg_copied, Toast.LENGTH_SHORT) .show(); }</code><technical_language>This variable final</technical_language>

Target:
public static void copyToClipboard(final Context context, final String text) { final ClipboardManager clipboardManager = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE); if (clipboardManager == null) { Toast.makeText(context, R.string.permission_denied, Toast.LENGTH_LONG).show(); return; } clipboardManager.setPrimaryClip(ClipData.newPlainText(null, text)); Toast.makeText(context, R.string.msg_copied, Toast.LENGTH_SHORT) .show(); }
Source:
<code>public static <T> String toJson(T input) { Objects.requireNonNull(input); final ObjectMapper mapper = new ObjectMapper(); final AnnotationIntrospector introspectorPair = AnnotationIntrospector.pair( new JacksonAnnotationIntrospector(), new JaxbAnnotationIntrospector()); mapper.setDeserializationConfig(mapper.getDeserializationConfig().withAnnotationIntrospector(introspectorPair)); <START> mapper.setSerializationConfig(mapper.getSerializationConfig().withAnnotationIntrospector(introspectorPair)); <END> try { return mapper.writeValueAsString(input); } catch (IOException io) { throw Throwables.propagate(io); } }</code><technical_language>add a createDefaultObjectMapper() method somewhere? do create ObjectMapper manually time</technical_language>

Target:
public static <T> String toJson(T input) { Objects.requireNonNull(input); try { return JacksonUtils.createDefaultObjectMapper().writeValueAsString(input); } catch (IOException io) { throw Throwables.propagate(io); } }
Source:
<code>public void slicesOfOneFromOne() { Series series = new Series("1"); <START> List<String> expected = Arrays.asList("1"); <END> List<String> actual = series.slices(1); assertEquals(expected, actual); }</code><technical_language>This Collections.singletonList</technical_language>

Target:
public void slicesOfOneFromOne() { Series series = new Series("1"); List<String> expected = Collections.singletonList("1"); List<String> actual = series.slices(1); assertEquals(expected, actual); }
Source:
<code>protected void refresh(final boolean isFirst) { final int rpcseq = ++rpcSequence; script = null; comments = null; <START> if (Gerrit.isSignedIn()) { <END> updateReviewedStatus(1); } PatchUtil.DETAIL_SVC.patchScript(patchKey, idSideA, idSideB, scriptSettings, new GerritCallback<PatchScript>() { public void onSuccess(final PatchScript result) { if (rpcSequence == rpcseq) { script = result; onResult(); } } @Override public void onFailure(final Throwable caught) { if (rpcSequence == rpcseq) { if (isNoDifferences(caught) && !isFirst) { historyTable.enableAll(true); showPatch(false); } else { super.onFailure(caught); } } } private boolean isNoDifferences(final Throwable caught) { if (caught instanceof NoDifferencesException) { return true; } return caught instanceof RemoteJsonException && caught.getMessage().equals(NoDifferencesException.MESSAGE); } }); PatchUtil.DETAIL_SVC.patchComments(patchKey, idSideA, idSideB, new GerritCallback<CommentDetail>() { public void onSuccess(final CommentDetail result) { if (rpcSequence == rpcseq) { comments = result; onResult(); } } @Override public void onFailure(Throwable caught) { if (!isNoSuchEntity(caught) && rpcSequence == rpcseq) { super.onFailure(caught); } } }); }</code><technical_language>I if do this if isFirst is true, in case user modifies history panel checking checkbox</technical_language>

Target:
protected void refresh(final boolean isFirst) { final int rpcseq = ++rpcSequence; script = null; comments = null; if (Gerrit.isSignedIn() && isFirst) { setReviewedByCurrentUser(true ); } PatchUtil.DETAIL_SVC.patchScript(patchKey, idSideA, idSideB, scriptSettings, new GerritCallback<PatchScript>() { public void onSuccess(final PatchScript result) { if (rpcSequence == rpcseq) { script = result; onResult(); } } @Override public void onFailure(final Throwable caught) { if (rpcSequence == rpcseq) { if (isNoDifferences(caught) && !isFirst) { historyTable.enableAll(true); showPatch(false); } else { super.onFailure(caught); } } } private boolean isNoDifferences(final Throwable caught) { if (caught instanceof NoDifferencesException) { return true; } return caught instanceof RemoteJsonException && caught.getMessage().equals(NoDifferencesException.MESSAGE); } }); PatchUtil.DETAIL_SVC.patchComments(patchKey, idSideA, idSideB, new GerritCallback<CommentDetail>() { public void onSuccess(final CommentDetail result) { if (rpcSequence == rpcseq) { comments = result; onResult(); } } @Override public void onFailure(Throwable caught) { if (!isNoSuchEntity(caught) && rpcSequence == rpcseq) { super.onFailure(caught); } } }); }
Source:
<code>private void addTreeViewerEntries(ITmfStateSystem stateSystem, TmfTreeViewerEntry parentBranch, int quark) { for (int <START> q : <END> stateSystem.getSubAttributes(quark, false)) { TmfTreeViewerEntry childBranch = stateSystem.getSubAttributes(q, false).isEmpty() ? new CounterTreeViewerEntry(stateSystem.getAttributeName(q), q) : new TmfTreeViewerEntry(stateSystem.getAttributeName(q)); parentBranch.addChild(childBranch); addTreeViewerEntries(stateSystem, childBranch, q); } }</code><technical_language>childQuark</technical_language>

Target:
private void addTreeViewerEntries(ITmfStateSystem stateSystem, TmfTreeViewerEntry parentBranch, int quark) { for (int childQuark : stateSystem.getSubAttributes(quark, false)) { TmfTreeViewerEntry childBranch = stateSystem.getSubAttributes(childQuark, false).isEmpty() ? new CounterTreeViewerEntry(stateSystem.getAttributeName(childQuark), childQuark) : new TmfTreeViewerEntry(stateSystem.getAttributeName(childQuark)); parentBranch.addChild(childBranch); addTreeViewerEntries(stateSystem, childBranch, childQuark); } }
Source:
<code>public boolean shouldRerun() { <START> return !dto.getHealthType().isDone() && Duration.between(created, Instant.now()).toMinutes() < 10; <END> }</code><technical_language>Is this necessary scheduler hard-coded scan 15 minutes? If so, this greater instead of than</technical_language>

Target:
public boolean shouldRerun() { return !dto.getHealthType().isDone() && Duration.between(created, Instant.now()).toMinutes() > 10; }
Source:
<code>private BlobId(DataInputStream stream, ClusterMap clusterMap, boolean ensureFullyRead) throws IOException { this.version = stream.readShort(); if (version == 1) { partitionId = clusterMap.getPartitionIdFromStream(stream); if (partitionId == null) { throw new IllegalArgumentException("Partition ID cannot be null"); } uuid = Utils.readIntString(stream); <START> if (uuid == null) { <END> throw new IllegalArgumentException("Could not parse uuid"); } if (ensureFullyRead && stream.available() > 0) { throw new IllegalArgumentException("Stream should have no more available bytes to read"); } } else { throw new IllegalArgumentException("version " + version + " not supported for blob id"); } }</code><technical_language>While this, I sort of feel readIntString() general enough support 0 length strings - flexibility fields in stream optional, say. Do problems that</technical_language>

Target:
private BlobId(DataInputStream stream, ClusterMap clusterMap, boolean ensureFullyRead) throws IOException { this.version = stream.readShort(); if (version == 1) { partitionId = clusterMap.getPartitionIdFromStream(stream); if (partitionId == null) { throw new IllegalArgumentException("Partition ID cannot be null"); } uuid = Utils.readIntString(stream); if (ensureFullyRead && stream.read() != -1) { throw new IllegalArgumentException("Stream should have no more available bytes to read"); } } else { throw new IllegalArgumentException("version " + version + " not supported for blob id"); } }
Source:
<code>public synchronized void load() { try { Map.Entry<ManagerSpec, Map<ResourceGroupIdTemplate, ResourceGroupSpec>> specsFromDb = buildSpecsFromDb(); ManagerSpec managerSpec = specsFromDb.getKey(); Map<ResourceGroupIdTemplate, ResourceGroupSpec> resourceGroupSpecs = specsFromDb.getValue(); Set<ResourceGroupIdTemplate> changedSpecs = new HashSet<>(); Set<ResourceGroupIdTemplate> deletedSpecs = Sets.difference(this.resourceGroupSpecs.keySet(), resourceGroupSpecs.keySet()); for (Map.Entry<ResourceGroupIdTemplate, ResourceGroupSpec> entry : resourceGroupSpecs.entrySet()) { if (!entry.getValue().sameConfig(this.resourceGroupSpecs.get(entry.getKey()))) { changedSpecs.add(entry.getKey()); } } this.resourceGroupSpecs = resourceGroupSpecs; this.cpuQuotaPeriod.set(managerSpec.getCpuQuotaPeriod()); this.rootGroups.set(managerSpec.getRootGroups()); List<ResourceGroupSelector> selectors = buildSelectors(managerSpec); <START> if (enableExactMatchSelector) { <END> ImmutableList.Builder<ResourceGroupSelector> builder = ImmutableList.builder(); builder.add(new DbSourceExactMatchSelector(environment, dao)); builder.addAll(selectors); this.selectors.set(builder.build()); } else { this.selectors.set(selectors); } configureChangedGroups(changedSpecs); disableDeletedGroups(deletedSpecs); } catch (Throwable e) { log.error(e, "Error loading configuration from db"); } }</code><technical_language>I move this if logic buildSelectors method</technical_language>

Target:
public synchronized void load() { try { Map.Entry<ManagerSpec, Map<ResourceGroupIdTemplate, ResourceGroupSpec>> specsFromDb = buildSpecsFromDb(); ManagerSpec managerSpec = specsFromDb.getKey(); Map<ResourceGroupIdTemplate, ResourceGroupSpec> resourceGroupSpecs = specsFromDb.getValue(); Set<ResourceGroupIdTemplate> changedSpecs = new HashSet<>(); Set<ResourceGroupIdTemplate> deletedSpecs = Sets.difference(this.resourceGroupSpecs.keySet(), resourceGroupSpecs.keySet()); for (Map.Entry<ResourceGroupIdTemplate, ResourceGroupSpec> entry : resourceGroupSpecs.entrySet()) { if (!entry.getValue().sameConfig(this.resourceGroupSpecs.get(entry.getKey()))) { changedSpecs.add(entry.getKey()); } } this.resourceGroupSpecs = resourceGroupSpecs; this.cpuQuotaPeriod.set(managerSpec.getCpuQuotaPeriod()); this.rootGroups.set(managerSpec.getRootGroups()); List<ResourceGroupSelector> selectors = buildSelectors(managerSpec); if (exactMatchSelectorEnabled) { ImmutableList.Builder<ResourceGroupSelector> builder = ImmutableList.builder(); builder.add(new DbSourceExactMatchSelector(environment, dao)); builder.addAll(selectors); this.selectors.set(builder.build()); } else { this.selectors.set(selectors); } configureChangedGroups(changedSpecs); disableDeletedGroups(deletedSpecs); } catch (Throwable e) { log.error(e, "Error loading configuration from db"); } }
Source:
<code>public static String getThreadIdentifier(Thread thread) { <START> return String.format("{}({})", thread.getId(), thread.getName()); <END> }</code><technical_language>I thought format "%s" "%d"</technical_language>

Target:
public static String getThreadIdentifier(Thread thread) { return String.format("%d(%s)", thread.getId(), thread.getName()); }
Source:
<code>private void formatInternal(String pattern, ZoneInfo.WallTime wallTime, ZoneInfo zoneInfo) { <START> if (pattern.length() == 0) { <END> return; } CharBuffer formatBuffer = CharBuffer.wrap(pattern); while (formatBuffer.remaining() > 0) { boolean outputCurrentChar = true; char currentChar = formatBuffer.get(formatBuffer.position()); if (currentChar == '%') { outputCurrentChar = handleToken(formatBuffer, wallTime, zoneInfo); } if (outputCurrentChar) { outputBuilder.append(formatBuffer.get(formatBuffer.position())); } formatBuffer.position(formatBuffer.position() + 1); } }</code><technical_language>do need this special case? this happen, if does, do in loop below</technical_language>

Target:
private void formatInternal(String pattern, ZoneInfo.WallTime wallTime, ZoneInfo zoneInfo) { CharBuffer formatBuffer = CharBuffer.wrap(pattern); while (formatBuffer.remaining() > 0) { boolean outputCurrentChar = true; char currentChar = formatBuffer.get(formatBuffer.position()); if (currentChar == '%') { outputCurrentChar = handleToken(formatBuffer, wallTime, zoneInfo); } if (outputCurrentChar) { outputBuilder.append(formatBuffer.get(formatBuffer.position())); } formatBuffer.position(formatBuffer.position() + 1); } }
Source:
<code>private void deleteEntity() { TableServiceAsyncClient tableServiceAsyncClient = new TableServiceClientBuilder() .connectionString("connectionString") .buildAsyncClient(); TableAsyncClient tableAsyncClient = tableServiceAsyncClient.getTableAsyncClient("OfficeSupplies"); QueryOptions queryOptions = new QueryOptions(); queryOptions.setFilter("RowKey eq crayolaMarkers"); tableAsyncClient.queryEntity(queryOptions).flatMap(tableEntity -> { logger.info("Table Entity: " + tableEntity); Mono<Void> deleteEntityMono = tableAsyncClient.deleteEntity(tableEntity); return deleteEntityMono; }).subscribe(Void -> { <START> logger.info("Delete Entity Successful."); <END> }, error -> { logger.error("There was an error deleting the Entity. Error: " + error); }); }</code><technical_language>In Reactor, void return types onNext(). So, this message printed in onComplete() consumer. Update other samples too. java .subscribe(ignored -> {}, error -> logger.error("...", error), () -> logger.info("Delete Entity Successful."));</technical_language>

Target:
private void deleteEntity() { TableServiceAsyncClient tableServiceAsyncClient = new TableServiceClientBuilder() .connectionString("connectionString") .buildAsyncClient(); TableAsyncClient tableAsyncClient = tableServiceAsyncClient.getTableAsyncClient("OfficeSupplies"); String rowKey = "crayolaMarkers"; String partitionKey = "markers"; tableAsyncClient.get(rowKey, partitionKey).flatMap(tableEntity -> { System.out.println("Table Entity: " + tableEntity); return tableAsyncClient.deleteEntity(tableEntity); }).subscribe( Void -> { }, error -> System.err.println("There was an error deleting the Entity. Error: " + error), () -> System.out.println("Delete Entity Successful.")); }
Source:
<code>private IPath getBundleLocation(String aBundleId, VersionRange aVersionRange, boolean isSourceBundle) { BundleInfo bundleInfo = P2Utils.findBundle(aBundleId, aVersionRange, isSourceBundle); if (bundleInfo != null) { resolvedVersion = bundleInfo.getVersion(); return P2Utils.getBundleLocationPath(bundleInfo); } else { Bundle[] bundles= Platform.getBundles(aBundleId, aVersionRange.toString()); Bundle bestMatch = null; if (bundles != null) { for (Bundle bundle : bundles) { if (bestMatch == null || bundle.getState() > bestMatch.getState()) { bestMatch= bundle; } } } if (bestMatch == null) { return null; } resolvedVersion = bestMatch.getVersion().toString(); try { if (bundleRoot == null) { return new Path(FileLocator.getBundleFile(bestMatch).getAbsolutePath()); } else { <START> resolvedVersion = <END> bestMatch.getVersion().toString(); URL rootUrl= bestMatch.getEntry("/"); URL fileRootUrl= FileLocator.toFileURL(rootUrl); return new Path(fileRootUrl.getPath()); } } catch (IOException ex) { JUnitCorePlugin.log(ex); } } return null; }</code><technical_language>this line removed ? moving up</technical_language>

Target:
private IPath getBundleLocation(String aBundleId, VersionRange aVersionRange, boolean isSourceBundle) { BundleInfo bundleInfo = P2Utils.findBundle(aBundleId, aVersionRange, isSourceBundle); if (bundleInfo != null) { resolvedVersion = bundleInfo.getVersion(); return P2Utils.getBundleLocationPath(bundleInfo); } else { Bundle[] bundles= Platform.getBundles(aBundleId, aVersionRange.toString()); Bundle bestMatch = null; if (bundles != null) { for (Bundle bundle : bundles) { if (bestMatch == null || bundle.getState() > bestMatch.getState()) { bestMatch= bundle; } } } if (bestMatch == null) { return null; } resolvedVersion = bestMatch.getVersion().toString(); try { if (bundleRoot == null) { return new Path(FileLocator.getBundleFile(bestMatch).getAbsolutePath()); } else { URL rootUrl= bestMatch.getEntry("/"); URL fileRootUrl= FileLocator.toFileURL(rootUrl); return new Path(fileRootUrl.getPath()); } } catch (IOException ex) { JUnitCorePlugin.log(ex); } } return null; }
Source:
<code>private static List<GoNamedElement> getFieldDefinitions(@NotNull GoFieldDeclaration declaration) { GoNamedElement anonymousDefinition = ObjectUtils.tryCast(declaration.getAnonymousFieldDefinition(), GoNamedElement.class); return anonymousDefinition != null ? list(anonymousDefinition) <START> : map(declaration.getFieldDefinitionList(), definition -> ObjectUtils.tryCast(definition, GoNamedElement.class)); <END> }</code><technical_language>return List<? extends GonamedElement> cast definittions</technical_language>

Target:
private static List<? extends GoNamedElement> getFieldDefinitions(@NotNull GoFieldDeclaration declaration) { GoAnonymousFieldDefinition anonymousDefinition = declaration.getAnonymousFieldDefinition(); return anonymousDefinition != null ? list(anonymousDefinition) : declaration.getFieldDefinitionList(); }
Source:
<code>private Collection<CommandAssociatedEntity> buildCommandAssociatedEntities(Guid cmdId, SubjectEntity... subjectEntities) { if (subjectEntities.length == 0) { return Collections.emptyList(); <START> } <END> Set<CommandAssociatedEntity> results = new HashSet<>(subjectEntities.length); for (SubjectEntity subjectEntity : subjectEntities) { results.add(new CommandAssociatedEntity(cmdId, subjectEntity.getEntityType(), subjectEntity.getEntityId())); } return results; }</code><technical_language>i in mind is: Set<SubjectEntity> entities = new HashSet<>(Arrays.asList(subjectEntities)); List<CommandAssociatedEntity> results = new ArrayList<>(entities.size()); for (SubjectEntity subjectEntity : entities) {</technical_language>

Target:
private Collection<CommandAssociatedEntity> buildCommandAssociatedEntities(Guid cmdId, SubjectEntity... subjectEntities) { if (subjectEntities.length == 0) { return Collections.emptyList(); } Set<SubjectEntity> entities = new HashSet<>(Arrays.asList(subjectEntities)); List<CommandAssociatedEntity> results = new ArrayList<>(entities.size()); for (SubjectEntity subjectEntity : entities) { results.add(new CommandAssociatedEntity(cmdId, subjectEntity.getEntityType(), subjectEntity.getEntityId())); } return results; }
Source:
<code>public void scaleService(String service, Integer instances) throws Exception { if (ThreadProperty.get("deploy_api_id") == null) { fail("deploy_api_id variable is not set. Check deploy-api is installed and @dcos annotation is working properly."); } String endPoint = "/service/" + ThreadProperty.get("deploy_api_id") + "/deploy/scale?instances=" + instances + "&serviceName=" + service; Future<Response> response; response = commonspec.generateRequest("PUT", false, null, null, endPoint, "", null, ""); commonspec.setResponse("PUT", response.get()); <START> if (!(commonspec.getResponse().getStatusCode() != 200 && commonspec.getResponse().getStatusCode() != 201)) { <END> logger.error("Request failed to endpoint: " + endPoint + " with status code: " + commonspec.getResponse().getStatusCode() + " and response: " + commonspec.getResponse().getResponse()); throw new Exception("Request failed to endpoint: " + endPoint + " with status code: " + commonspec.getResponse().getStatusCode() + " and response: " + commonspec.getResponse().getResponse()); } }</code><technical_language>sobra la negacin: if (commonspec.getResponse().getStatusCode() != 200 && commonspec.getResponse().getStatusCode() != 201) {</technical_language>

Target:
public void scaleService(String service, Integer instances) throws Exception { if (ThreadProperty.get("deploy_api_id") == null) { fail("deploy_api_id variable is not set. Check deploy-api is installed and @dcos annotation is working properly."); } String endPoint = "/service/" + ThreadProperty.get("deploy_api_id") + "/deploy/scale?instances=" + instances + "&serviceName=" + service; Future<Response> response; response = commonspec.generateRequest("PUT", false, null, null, endPoint, "", null, ""); commonspec.setResponse("PUT", response.get()); if (commonspec.getResponse().getStatusCode() != 200 && commonspec.getResponse().getStatusCode() != 201) { logger.error("Request failed to endpoint: " + endPoint + " with status code: " + commonspec.getResponse().getStatusCode() + " and response: " + commonspec.getResponse().getResponse()); throw new Exception("Request failed to endpoint: " + endPoint + " with status code: " + commonspec.getResponse().getStatusCode() + " and response: " + commonspec.getResponse().getResponse()); } }
Source:
<code>public void creates_table_on_empty_db() throws SQLException { underTest.execute(); assertThat(dbTester.countRowsOfTable(TABLE_RULES_METADATA)).isEqualTo(0); dbTester.assertColumnDefinition(TABLE_RULES_METADATA, "rule_id", Types.INTEGER, null, false); dbTester.assertColumnDefinition(TABLE_RULES_METADATA, "organization_uuid", Types.VARCHAR, 40, false); dbTester.assertColumnDefinition(TABLE_RULES_METADATA, "note_data", Types.CLOB, null, true); dbTester.assertColumnDefinition(TABLE_RULES_METADATA, "note_user_login", Types.VARCHAR, 255, true); dbTester.assertColumnDefinition(TABLE_RULES_METADATA, "note_created_at", Types.BIGINT, null, true); dbTester.assertColumnDefinition(TABLE_RULES_METADATA, "note_updated_at", Types.BIGINT, null, true); dbTester.assertColumnDefinition(TABLE_RULES_METADATA, "remediation_function", Types.VARCHAR, 20, true); dbTester.assertColumnDefinition(TABLE_RULES_METADATA, "remediation_gap_mult", Types.VARCHAR, 20, true); dbTester.assertColumnDefinition(TABLE_RULES_METADATA, "remediation_base_effort", Types.VARCHAR, 20, true); <START> dbTester.assertColumnDefinition(TABLE_RULES_METADATA, "TAGS", Types.VARCHAR, 4000, true); <END> dbTester.assertColumnDefinition(TABLE_RULES_METADATA, "created_at", Types.BIGINT, null, false); dbTester.assertColumnDefinition(TABLE_RULES_METADATA, "updated_at", Types.BIGINT, null, false); dbTester.assertPrimaryKey(TABLE_RULES_METADATA, "pk_rules_metadata", "rule_id", "organization_uuid"); }</code><technical_language>TAGS in upper-case</technical_language>

Target:
public void creates_table_on_empty_db() throws SQLException { underTest.execute(); assertThat(dbTester.countRowsOfTable(TABLE_RULES_METADATA)).isEqualTo(0); dbTester.assertColumnDefinition(TABLE_RULES_METADATA, "rule_id", Types.INTEGER, null, false); dbTester.assertColumnDefinition(TABLE_RULES_METADATA, "organization_uuid", Types.VARCHAR, 40, false); dbTester.assertColumnDefinition(TABLE_RULES_METADATA, "note_data", Types.CLOB, null, true); dbTester.assertColumnDefinition(TABLE_RULES_METADATA, "note_user_login", Types.VARCHAR, 255, true); dbTester.assertColumnDefinition(TABLE_RULES_METADATA, "note_created_at", Types.BIGINT, null, true); dbTester.assertColumnDefinition(TABLE_RULES_METADATA, "note_updated_at", Types.BIGINT, null, true); dbTester.assertColumnDefinition(TABLE_RULES_METADATA, "remediation_function", Types.VARCHAR, 20, true); dbTester.assertColumnDefinition(TABLE_RULES_METADATA, "remediation_gap_mult", Types.VARCHAR, 20, true); dbTester.assertColumnDefinition(TABLE_RULES_METADATA, "remediation_base_effort", Types.VARCHAR, 20, true); dbTester.assertColumnDefinition(TABLE_RULES_METADATA, "tags", Types.VARCHAR, 4000, true); dbTester.assertColumnDefinition(TABLE_RULES_METADATA, "created_at", Types.BIGINT, null, false); dbTester.assertColumnDefinition(TABLE_RULES_METADATA, "updated_at", Types.BIGINT, null, false); dbTester.assertPrimaryKey(TABLE_RULES_METADATA, "pk_rules_metadata", "rule_id", "organization_uuid"); }
Source:
<code>public void updateIdentifiersCreatesExternalIdWithAssignment() { mockAccountNoEmail(); when(accountDao.authenticate(STUDY, PHONE_PASSWORD_SIGN_IN)).thenReturn(account); STUDY.setEmailVerificationEnabled(false); STUDY.setAutoVerificationEmailSuppressed(false); IdentifierUpdate update = new IdentifierUpdate(PHONE_PASSWORD_SIGN_IN, null, null, "extid"); participantService.updateIdentifiers(STUDY, CONTEXT, update); assertEquals("extid", account.getExternalId()); <START> verify(externalIdService).beginAssignExternalId(account, "extid"); <END> }</code><technical_language>a thenAnswer() accountDao.updateAccount() verified commit hook is passed in called</technical_language>

Target:
public void updateIdentifiersCreatesExternalIdWithAssignment() { ExternalIdentifier differentExternalId = ExternalIdentifier.create(TestConstants.TEST_STUDY, "extid"); mockAccountNoEmail(); when(accountDao.authenticate(STUDY, PHONE_PASSWORD_SIGN_IN)).thenReturn(account); when(externalIdService.getExternalId(any(), eq("extid"), eq(false))).thenReturn(differentExternalId); STUDY.setEmailVerificationEnabled(false); STUDY.setAutoVerificationEmailSuppressed(false); IdentifierUpdate update = new IdentifierUpdate(PHONE_PASSWORD_SIGN_IN, null, null, "extid"); participantService.updateIdentifiers(STUDY, CONTEXT, update); assertEquals("extid", account.getExternalId()); verify(externalIdService).commitAssignExternalId(differentExternalId); }
Source:
<code>public PipeRunResult doPipe(Message input, IPipeLineSession session, IOutputStreamingSupport nextProvider) throws PipeRunException { if (input==null) { throw new PipeRunException(this, getLogPrefix(session)+"got null input"); <START> } <END> Message message = new Message(input); try { if (StringUtils.isNotEmpty(getSessionKey())) { nextProvider=null; } else { if (nextProvider==null) { nextProvider = getStreamTarget(); } } PipeRunResult prr = sender.sendMessage(message, session, nextProvider); Object result = prr.getResult(); if (result instanceof StringWriter) { result = result.toString(); } PipeForward forward = prr.getPipeForward(); if (forward==null) { forward=getForward(); } if (StringUtils.isEmpty(getSessionKey())) { return new PipeRunResult(forward, result); } session.put(getSessionKey(), result); return new PipeRunResult(getForward(), input); } catch (Exception e) { throw new PipeRunException(this, getLogPrefix(session) + " Exception on transforming input", e); } }</code><technical_language>Overbodige Message message = new Message(input);</technical_language>

Target:
public PipeRunResult doPipe(Message input, IPipeLineSession session, IOutputStreamingSupport nextProvider) throws PipeRunException { if (input==null) { throw new PipeRunException(this, getLogPrefix(session)+"got null input"); } try { if (StringUtils.isNotEmpty(getSessionKey())) { nextProvider=null; } else { if (nextProvider==null) { nextProvider = getStreamTarget(); } } PipeRunResult prr = sender.sendMessage(input, session, nextProvider); Object result = prr.getResult(); if (result instanceof StringWriter) { result = result.toString(); } PipeForward forward = prr.getPipeForward(); if (forward==null) { forward=getForward(); } if (StringUtils.isEmpty(getSessionKey())) { return new PipeRunResult(forward, result); } session.put(getSessionKey(), result); return new PipeRunResult(getForward(), input); } catch (Exception e) { throw new PipeRunException(this, getLogPrefix(session) + " Exception on transforming input", e); } }
Source:
<code>public int hashCode() { <START> return (int)getId(); <END> }</code><technical_language>bad hashcode</technical_language>

Target:
public int hashCode() { if (hash != null) return hash; final int prime = 31; int h = 1; int id = (int)getId(); h = prime * h + (int) (id ^ (id >>> 32)); hash = h; return hash; }
Source:
<code>private void clearAsyncTasksWithOutVdsmId() { for (Guid asyncTaskId : getReturnValue().getAsyncTaskIdList()) { <START> AsyncTasks task = DbFacade.getInstance().getAsyncTaskDao().get(asyncTaskId); <END> if (task.getVdsmTaskId().equals(NGuid.Empty)) { AsyncTaskManager.failTaskWithoutVdsmId(task); } } }</code><technical_language>/s/DbFacade.getInstance().getAsyncTaskDao()/getAsyncTaskDao</technical_language>

Target:
private void clearAsyncTasksWithOutVdsmId() { for (Guid asyncTaskId : getReturnValue().getAsyncTaskIdList()) { AsyncTasks task = getAsyncTaskDao().get(asyncTaskId); if (task.getVdsmTaskId().equals(NGuid.Empty)) { AsyncTaskManager.failTaskWithoutVdsmId(task); } } }