auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public BasicSecuritySSLSocketFactory() { try { <START> SSLContext ctx = SSLContext.getInstance("TLS"); <END> ctx.init( null, new TrustManager[] {new BasicSecurityTrustManager()}, new SecureRandom()); sf = ctx.getSocketFactory(); } catch (NoSuchAlgorithmException | KeyManagementException e) { throw new IllegalArgumentException( "Unable to initialize socket factory", e); } }</code><technical_language>SSLContext exposed for configuration users set keystore, truststore, protocol, etc. TLSUtils some examples for that, SSLContextProvider for internal HTTP client</technical_language>

Target:
public BasicSecuritySSLSocketFactory() { SSLContext ctx = new TLSUtils.ClientSSLContextBuilder() .setProtocol(basicAuthSSLConfig.getProtocol()) .setTrustStoreType(basicAuthSSLConfig.getTrustStoreType()) .setTrustStorePath(basicAuthSSLConfig.getTrustStorePath()) .setTrustStoreAlgorithm(basicAuthSSLConfig.getTrustStoreAlgorithm()) .setTrustStorePasswordProvider(basicAuthSSLConfig.getTrustStorePasswordProvider()) .setKeyStoreType(basicAuthSSLConfig.getKeyStoreType()) .setKeyStorePath(basicAuthSSLConfig.getKeyStorePath()) .setKeyStoreAlgorithm(basicAuthSSLConfig.getKeyManagerFactoryAlgorithm()) .setCertAlias(basicAuthSSLConfig.getCertAlias()) .setKeyStorePasswordProvider(basicAuthSSLConfig.getKeyStorePasswordProvider()) .setKeyManagerFactoryPasswordProvider(basicAuthSSLConfig.getKeyManagerPasswordProvider()) .setValidateHostnames(basicAuthSSLConfig.getValidateHostnames()) .setCertificateChecker(certificateChecker) .build(); sf = ctx.getSocketFactory(); }
Source:
<code>public void roundTrip_full() throws IOException { InspectContainerResponse[] responses = JSONTestHelper.testRoundTrip(CommandJSONSamples.inspectContainerResponse_full, InspectContainerResponse[].class); <START> Assert.assertEquals(1, responses.length); <END> final InspectContainerResponse response = responses[0]; Assert.assertEquals(response.getVolumes().length, 2); Assert.assertEquals(response.getVolumesRW().length, 2); Assert.assertEquals(response.getVolumes()[1].getContainerPath(), "/bar/foo/myvol2"); Assert.assertEquals(response.getVolumes()[1].getHostPath(), "/path2"); Assert.assertEquals(response.getVolumesRW()[1].getVolume().getPath(), "/bar/foo/myvol2"); Assert.assertFalse(response.getVolumesRW()[1].getAccessMode().toBoolean()); Assert.assertTrue(response.getVolumesRW()[0].getAccessMode().toBoolean()); }</code><technical_language>IDE added this full class name move. If revert this change (add static import back), diff easily review</technical_language>

Target:
public void roundTrip_full() throws IOException { InspectContainerResponse[] responses = JSONTestHelper.testRoundTrip(CommandJSONSamples.inspectContainerResponse_full, InspectContainerResponse[].class); assertEquals(1, responses.length); final InspectContainerResponse response = responses[0]; assertEquals(response.getVolumes().length, 2); assertEquals(response.getVolumesRW().length, 2); assertEquals(response.getVolumes()[1].getContainerPath(), "/bar/foo/myvol2"); assertEquals(response.getVolumes()[1].getHostPath(), "/path2"); assertEquals(response.getVolumesRW()[1].getVolume().getPath(), "/bar/foo/myvol2"); assertFalse(response.getVolumesRW()[1].getAccessMode().toBoolean()); assertTrue(response.getVolumesRW()[0].getAccessMode().toBoolean()); }
Source:
<code>public List<DerivedCube> getAllDerivedQueryableCubes(CubeInterface cube) throws HiveException { List<DerivedCube> dcubes = new ArrayList<DerivedCube>(); try { for (CubeInterface cb : getAllCubes()) { if (cb.isDerivedCube() && ((DerivedCube)cb).getParent().getName().equalsIgnoreCase(cube.getName()) && cb.allFieldsQueriable()) { dcubes.add((DerivedCube)cb); } } } catch (HiveException e) { <START> throw new HiveException("Could not get all tables", e); <END> } return dcubes; }</code><technical_language>error message a final String change "Could fetch cubes". In cases HiveException thrown</technical_language>

Target:
public List<DerivedCube> getAllDerivedQueryableCubes(CubeInterface cube) throws HiveException { List<DerivedCube> dcubes = new ArrayList<DerivedCube>(); try { for (CubeInterface cb : getAllCubes()) { if (cb.isDerivedCube() && ((DerivedCube)cb).getParent().getName().equalsIgnoreCase(cube.getName()) && cb.allFieldsQueriable()) { dcubes.add((DerivedCube)cb); } } } catch (HiveException e) { throw new HiveException("Could not get all derived queryable cubes of " + cube, e); } return dcubes; }
Source:
<code>private void stopGlusterServices(VDS vds) { if (vds.getVdsGroupSupportsGlusterService()) { boolean succeeded = resourceManagerProvider.get().runVdsCommand(VDSCommandType.ManageGlusterService, new GlusterServiceVDSParameters(vds.getId(), Arrays.asList("glusterd"), "stop")).getSucceeded(); if (succeeded) { succeeded = resourceManagerProvider.get().runVdsCommand(VDSCommandType.StopGlusterProcesses, new VdsIdVDSCommandParametersBase(vds.getId())).getSucceeded(); if (succeeded) { List<GlusterBrickEntity> bricks = glusterBrickDao.getGlusterVolumeBricksByServerId(vds.getId()); for (GlusterBrickEntity brick : bricks) { brick.setStatus(GlusterStatus.DOWN); } glusterBrickDao.updateBrickStatuses(bricks); } } if(!succeeded){ <START> log.info("Failed <END> to stop gluster services while moving the host '{}' to maintenance", vds.getName()); } } }</code><technical_language>this warn/error</technical_language>

Target:
private void stopGlusterServices(VDS vds) { if (vds.getVdsGroupSupportsGlusterService()) { boolean succeeded = resourceManagerProvider.get().runVdsCommand(VDSCommandType.ManageGlusterService, new GlusterServiceVDSParameters(vds.getId(), Arrays.asList("glusterd"), "stop")).getSucceeded(); if (succeeded) { succeeded = resourceManagerProvider.get().runVdsCommand(VDSCommandType.StopGlusterProcesses, new VdsIdVDSCommandParametersBase(vds.getId())).getSucceeded(); if (succeeded) { List<GlusterBrickEntity> bricks = glusterBrickDao.getGlusterVolumeBricksByServerId(vds.getId()); for (GlusterBrickEntity brick : bricks) { brick.setStatus(GlusterStatus.DOWN); } glusterBrickDao.updateBrickStatuses(bricks); } } if(!succeeded){ log.error("Failed to stop gluster services while moving the host '{}' to maintenance", vds.getName()); } } }
Source:
<code><START> public void setBuildStatus(String buildStatus) { <END> StashBuildState overwrittenBuildState = null; try { overwrittenBuildState = StashBuildState.valueOf(buildStatus); } catch (Exception e) { } this.buildStatus = overwrittenBuildState; }</code><technical_language>complete method stripped to: try { this.buildStatus = StashBuildState.valueOf(buildStatus); } catch (Exception e) { // ignore unknown null values }</technical_language>

Target:
public void setBuildStatus(String buildStatus) { try { this.buildStatus = StashBuildState.valueOf(buildStatus); } catch (Exception e) { } }
Source:
<code>private void ping() throws IOException, InterruptedException { Future<?> f = channel.callAsync(new Ping()); long start = System.currentTimeMillis(); long end = System.nanoTime() + TimeUnit.MILLISECONDS.toNanos(timeout); long remaining = end - System.nanoTime(); do { try { <START> f.get(Math.max(TimeUnit.MILLISECONDS.toNanos(10),remaining),TimeUnit.NANOSECONDS); <END> return; } catch (ExecutionException e) { if (e.getCause() instanceof RequestAbortedException) return; onDead(e); return; } catch (TimeoutException e) { } remaining = end - System.nanoTime(); } while(remaining>0); onDead(new TimeoutException("Ping started at "+start+" hasn't completed by "+System.currentTimeMillis())); }</code><technical_language>change 0</technical_language>

Target:
private void ping() throws IOException, InterruptedException { Future<?> f = channel.callAsync(new Ping()); long start = System.currentTimeMillis(); long end = System.nanoTime() + TimeUnit.MILLISECONDS.toNanos(timeout); long remaining = end - System.nanoTime(); do { try { f.get(Math.max(1,remaining),TimeUnit.NANOSECONDS); return; } catch (ExecutionException e) { if (e.getCause() instanceof RequestAbortedException) return; onDead(e); return; } catch (TimeoutException e) { } remaining = end - System.nanoTime(); } while(remaining>0); onDead(new TimeoutException("Ping started at "+start+" hasn't completed by "+System.currentTimeMillis())); }
Source:
<code><START> public void testOne() throws Exception { <END> final File fileToProcess = new File( getPath("SuppressionXpathRegressionOverloadMethodsDeclarationOrder.java")); final DefaultConfiguration moduleConfig = createModuleConfig(clazz); final String[] expectedViolation = { "14:5: " + getCheckMessage(clazz, OverloadMethodsDeclarationOrderCheck.MSG_KEY, "5"), }; final List<String> expectedXpathQueries = Arrays.asList( "/CLASS_DEF[./IDENT" + "[@text='SuppressionXpathRegressionOverloadMethodsDeclarationOrder']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='overloadMethod']]", "/CLASS_DEF[./IDENT" + "[@text='SuppressionXpathRegressionOverloadMethodsDeclarationOrder']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='overloadMethod']]/MODIFIERS", "/CLASS_DEF[./IDENT" + "[@text='SuppressionXpathRegressionOverloadMethodsDeclarationOrder']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='overloadMethod']]" + "/MODIFIERS/LITERAL_PUBLIC" ); runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); }</code><technical_language>xpath atleast 2 tests</technical_language>

Target:
public void testOne() throws Exception { final File fileToProcess = new File( getPath("SuppressionXpathRegressionOverloadMethodsDeclarationOrder1.java")); final DefaultConfiguration moduleConfig = createModuleConfig(clazz); final String[] expectedViolation = { "14:5: " + getCheckMessage(clazz, OverloadMethodsDeclarationOrderCheck.MSG_KEY, "5"), }; final List<String> expectedXpathQueries = Arrays.asList( "/CLASS_DEF[./IDENT" + "[@text='SuppressionXpathRegressionOverloadMethodsDeclarationOrder1']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='overloadMethod']]", "/CLASS_DEF[./IDENT" + "[@text='SuppressionXpathRegressionOverloadMethodsDeclarationOrder1']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='overloadMethod']]/MODIFIERS", "/CLASS_DEF[./IDENT" + "[@text='SuppressionXpathRegressionOverloadMethodsDeclarationOrder1']]" + "/OBJBLOCK/METHOD_DEF[./IDENT[@text='overloadMethod']]" + "/MODIFIERS/LITERAL_PUBLIC" ); runVerifications(moduleConfig, fileToProcess, expectedViolation, expectedXpathQueries); }
Source:
<code>private void addLink(String label, final PatchSet.Id id) { final Anchor anchor = new Anchor(label); anchor.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (side == Side.A) { idSideA = id; } else { idSideB = id; } <START> Patch.Key k = new Patch.Key(idSideB, patchKey.get()); <END> switch (screenType) { case SIDE_BY_SIDE: Gerrit.display(Dispatcher.toPatchSideBySide(idSideA, k)); break; case UNIFIED: Gerrit.display(Dispatcher.toPatchUnified(idSideA, k)); break; } } }); links.add(anchor); linkPanel.add(anchor); }</code><technical_language>keySideB</technical_language>

Target:
private void addLink(String label, final PatchSet.Id id) { final Anchor anchor = new Anchor(label); anchor.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { if (side == Side.A) { idSideA = id; } else { idSideB = id; } Patch.Key keySideB = new Patch.Key(idSideB, patchKey.get()); switch (screenType) { case SIDE_BY_SIDE: Gerrit.display(Dispatcher.toPatchSideBySide(idSideA, keySideB)); break; case UNIFIED: Gerrit.display(Dispatcher.toPatchUnified(idSideA, keySideB)); break; } } }); links.add(anchor); linkPanel.add(anchor); }
Source:
<code>public synchronized void start() { if (!started.compareAndSet(false, true)) { logger.info("Event processor is already running"); return; } logger.info("Starting a new event processor instance with id {}", this.identifier); scheduler = Schedulers.newElastic("EventProcessor"); runner = scheduler.schedulePeriodically(partitionBasedLoadBalancer::loadBalance, INITIAL_DELAY, <START> INTERVAL_IN_SECONDS , TimeUnit.SECONDS); <END> }</code><technical_language>file a bug references this todo</technical_language>

Target:
public synchronized void start() { if (!started.compareAndSet(false, true)) { logger.info("Event processor is already running"); return; } logger.info("Starting a new event processor instance with id {}", this.identifier); scheduler = Schedulers.newElastic("EventProcessor"); Double jitterInMillis = ThreadLocalRandom.current().nextDouble() * TimeUnit.SECONDS.toMillis(BASE_JITTER_IN_SECONDS); runner = scheduler.schedulePeriodically(partitionBasedLoadBalancer::loadBalance, jitterInMillis.longValue(), TimeUnit.SECONDS.toMillis(INTERVAL_IN_SECONDS) , TimeUnit.MILLISECONDS); }
Source:
<code>private String classReplaceToIndicativeSentence(Class<?> testClass) { Class<?> enclosingParent = testClass.getEnclosingClass(); Optional<DisplayName> displayName = AnnotationSupport.findAnnotation(testClass, DisplayName.class); Optional<DisplayNameGeneration> displayNameGeneration = AnnotationSupport.findAnnotation(testClass, DisplayNameGeneration.class); if (enclosingParent == null) { return displayName.map(DisplayName::value).orElseGet(() -> generateDisplayNameForClass(testClass)); } <START> else { END> if (displayNameGeneration.isPresent()) { return displayName.map(DisplayName::value).orElseGet(() -> generateDisplayNameForClass(testClass)); } else { return displayName.map(name -> classReplaceToIndicativeSentence(enclosingParent) + getSentenceSeparator(testClass) + name.value()).orElseGet( () -> classReplaceToIndicativeSentence(enclosingParent) + getSentenceSeparator(testClass) + super.generateDisplayNameForNestedClass(testClass)); } } }</code><technical_language>Is this sth. meant check</technical_language>

Target:
private String classReplaceToIndicativeSentence(Class<?> testClass) { Class<?> enclosingParent = testClass.getEnclosingClass(); Optional<DisplayName> displayName = AnnotationSupport.findAnnotation(testClass, DisplayName.class); Optional<DisplayNameGeneration> displayNameGeneration = AnnotationSupport.findAnnotation(testClass, DisplayNameGeneration.class); if (enclosingParent == null) { return displayName.map(DisplayName::value).orElseGet(() -> generateDisplayNameForClass(testClass)); } if (displayNameGeneration.isPresent()) { return displayName.map(DisplayName::value).orElseGet(() -> generateDisplayNameForClass(testClass)); } return displayName.map(name -> classReplaceToIndicativeSentence(enclosingParent) + getSentenceSeparator(testClass) + name.value()).orElseGet( () -> classReplaceToIndicativeSentence(enclosingParent) + getSentenceSeparator(testClass) + getGeneratorForIndicativeSentence(testClass).generateDisplayNameForNestedClass( testClass)); }
Source:
<code>public boolean matches(ITmfEvent event) { for (ITmfFilterTreeNode node : getChildren()) { if (node.matches(event)) { return true ^ fNot; } } <START> return false; <END> }</code><technical_language>original code is wrong. returned false ^ fNot. is error in TmfFilterAndNode. returns true children. return false in case (^ fNot). I guess unit tests of classes improved test: - child (expect false) - child (fNot=true) (expect true) - children match (expect false) - children match (fNot=true) (expect true)</technical_language>

Target:
public boolean matches(ITmfEvent event) { for (ITmfFilterTreeNode node : getChildren()) { if (node.matches(event)) { return true ^ fNot; } } return false ^ fNot; }
Source:
<code>private void createClinitMethod(final ClassVisitor cv, final int probeCount) { <START> final MethodVisitor mv = cv.visitMethod(InstrSupport.INITMETHOD_ACC, <END> InstrSupport.CLINIT_NAME, InstrSupport.CLINIT_DESC, null, null); mv.visitCode(); final int maxStack = accessorGenerator.generateDataAccessor(classId, className, probeCount, mv); mv.visitFieldInsn(Opcodes.PUTSTATIC, className, InstrSupport.DATAFIELD_NAME, InstrSupport.DATAFIELD_DESC); mv.visitInsn(Opcodes.RETURN); mv.visitMaxs(maxStack, 0); mv.visitEnd(); }</code><technical_language>INITMETHOD_ACC works here, JVM ignores beside ACC_STATIC flag. a separate CLINIT_ACC constant</technical_language>

Target:
private void createClinitMethod(final ClassVisitor cv, final int probeCount) { final MethodVisitor mv = cv.visitMethod(InstrSupport.CLINIT_ACC, InstrSupport.CLINIT_NAME, InstrSupport.CLINIT_DESC, null, null); mv.visitCode(); final int maxStack = accessorGenerator.generateDataAccessor(classId, className, probeCount, mv); mv.visitFieldInsn(Opcodes.PUTSTATIC, className, InstrSupport.DATAFIELD_NAME, InstrSupport.DATAFIELD_DESC); mv.visitInsn(Opcodes.RETURN); mv.visitMaxs(maxStack, 0); mv.visitEnd(); }
Source:
<code>protected PartitionId getPartitionForPut(List<PartitionId> partitionIdsToExclude) throws RouterException { List<PartitionId> partitions = clusterMap.getWritablePartitionIds(); for (PartitionId partitionIdToExclude : partitionIdsToExclude) { <START> partitions.remove(partitionIdToExclude); <END> } if (partitions.isEmpty()) { throw new RouterException("No writable partitions available.", RouterErrorCode.AmbryUnavailable); } return partitions.get(ThreadLocalRandom.current().nextInt(partitions.size())); }</code><technical_language>is a [removeAll()](<LINK_0> used</technical_language>

Target:
protected PartitionId getPartitionForPut(List<PartitionId> partitionIdsToExclude) throws RouterException { List<PartitionId> partitions = clusterMap.getWritablePartitionIds(); partitions.removeAll(partitionIdsToExclude); if (partitions.isEmpty()) { throw new RouterException("No writable partitions available.", RouterErrorCode.AmbryUnavailable); } return partitions.get(ThreadLocalRandom.current().nextInt(partitions.size())); }
Source:
<code>public StreamGobbler(InputStream stream, OutputStream output) { this.reader = new BufferedReader(new InputStreamReader(stream)); if (output == null) this.writer = new BufferedWriter(new OutputStreamWriter( new <START> ByteArrayOutputStream())); <END> else this.writer = new BufferedWriter(new OutputStreamWriter(output)); }</code><technical_language>create a buffer store some content want throw in end? If output is <null> initialize a writer call() method writer is initialized read lines</technical_language>

Target:
public StreamGobbler(InputStream stream, OutputStream output) { this.reader = new BufferedReader(new InputStreamReader(stream)); if (output == null) this.writer = null; else this.writer = new BufferedWriter(new OutputStreamWriter(output)); }
Source:
<code>public CauseOfBlockage getCauseOfBlockage() { if (isLogUpdated() && !isConcurrentBuild()) { final R lastBuild = getLastBuild(); if (lastBuild != null) { return new BlockedBecauseOfBuildInProgress(lastBuild); } else { <START> LOGGER.log(Level.FINEST, "Previous build instance has been during the non-concurrent cause creation. The build is not blocked anymore"); <END> } } if (blockBuildWhenDownstreamBuilding()) { AbstractProject<?,?> bup = getBuildingDownstream(); if (bup!=null) return new BecauseOfDownstreamBuildInProgress(bup); } if (blockBuildWhenUpstreamBuilding()) { AbstractProject<?,?> bup = getBuildingUpstream(); if (bup!=null) return new BecauseOfUpstreamBuildInProgress(bup); } return null; }</code><technical_language>ant: This of FINEST. FINE</technical_language>

Target:
public CauseOfBlockage getCauseOfBlockage() { if (isLogUpdated() && !isConcurrentBuild()) { final R lastBuild = getLastBuild(); if (lastBuild != null) { return new BlockedBecauseOfBuildInProgress(lastBuild); } else { LOGGER.log(Level.FINE, "The last build has been deleted during the non-concurrent cause creation. The build is not blocked anymore"); } } if (blockBuildWhenDownstreamBuilding()) { AbstractProject<?,?> bup = getBuildingDownstream(); if (bup!=null) return new BecauseOfDownstreamBuildInProgress(bup); } if (blockBuildWhenUpstreamBuilding()) { AbstractProject<?,?> bup = getBuildingUpstream(); if (bup!=null) return new BecauseOfUpstreamBuildInProgress(bup); } return null; }
Source:
<code>protected void setOptionalValues(final DlmsDevice device, final TcpConnectionBuilder tcpConnectionBuilder) throws FunctionalException { if (device.getPort() != null) { tcpConnectionBuilder.setTcpPort(device.getPort().intValue()); } if (device.getLogicalId() != null) { tcpConnectionBuilder.setLogicalDeviceId(device.getLogicalId().intValue()); } final Integer challengeLength = device.getChallengeLength(); try { if (challengeLength != null) { tcpConnectionBuilder.setChallengeLength(challengeLength); } } catch (final IllegalArgumentException e) { final String errorMessage = String.format("Challenge length has to be between 8 and 64 for device %s", device.getDeviceIdentification()); LOGGER.error(errorMessage); <START> throw new FunctionalException(FunctionalExceptionType.CHALLENGE_LENGHT_OUT_OF_RANGE, ComponentType.PROTOCOL_DLMS, e); <END> } }</code><technical_language>Pleas change LENGTH</technical_language>

Target:
protected void setOptionalValues(final DlmsDevice device, final TcpConnectionBuilder tcpConnectionBuilder) throws FunctionalException { if (device.getPort() != null) { tcpConnectionBuilder.setTcpPort(device.getPort().intValue()); } if (device.getLogicalId() != null) { tcpConnectionBuilder.setLogicalDeviceId(device.getLogicalId().intValue()); } final Integer challengeLength = device.getChallengeLength(); try { if (challengeLength != null) { tcpConnectionBuilder.setChallengeLength(challengeLength); } } catch (final IllegalArgumentException e) { final String errorMessage = String.format("Challenge length has to be between 8 and 64 for device %s", device.getDeviceIdentification()); LOGGER.error(errorMessage); throw new FunctionalException(FunctionalExceptionType.CHALLENGE_LENGTH_OUT_OF_RANGE, ComponentType.PROTOCOL_DLMS, e); } }
Source:
<code>public synchronized void decrement(String name, String fieldName, double score) { <START> modifyFieldValue(name, fieldName, score); <END> }</code><technical_language>score</technical_language>

Target:
public void decrement(String name, String fieldName, double score) { modifyFieldValue(name, fieldName, -score); }
Source:
<code>static int getShard(WriteInfo writeInfo) { int shard = writeInfo.tableRefCell().hashCode() % SHARDS; <START> return (shard + SHARDS) % SHARDS; <END> }</code><technical_language>plug for laziness: IntMath.mod(writeInfo.tableRefCell().hashCode(), SHARDS) work</technical_language>

Target:
static int getShard(WriteInfo writeInfo) { return IntMath.mod(writeInfo.tableRefCell().hashCode(), SHARDS); }
Source:
<code>private static String findPath() { String filename = System.getProperty("postgres.pgservicefile"); if (filename == null) { filename = System.getenv().get("PGSERVICEFILE"); } if (filename == null) { <START> filename = System.getProperty("user.home") + "/.pgservices.conf"; <END> } return filename; }</code><technical_language>Change / java.io.File.separator</technical_language>

Target:
private static String findPath() { String filename = System.getProperty("org.postgresql.pgservicefile"); if (filename == null) { filename = System.getenv().get("PGSERVICEFILE"); } if (filename == null) { filename = System.getProperty("user.home") + File.separator + ".pg_service.conf"; } return filename; }
Source:
<code>public void testUnmarshallTopLevelEmptyEventProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateEscalationEvent emptyTopEvent = getCatchingIntermediateNodeById(diagram, EMPTY_TOP_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptyTopEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); <START> assertEscalationEventExecutionSet(emptyTopEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, ""); <END> assertDataIOSet(emptyTopEvent.getDataIOSet(), EMPTY_VALUE); }</code><technical_language>suggestion assertEscalationEventExecutionSet(emptyTopEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, EMPTY_VALUE);</technical_language>

Target:
public void testUnmarshallTopLevelEmptyEventProperties() throws Exception { Diagram<Graph, Metadata> diagram = unmarshall(marshaller, BPMN_CATCHING_INTERMEDIATE_EVENT_FILE_PATH); assertDiagram(diagram, AMOUNT_OF_NODES_IN_DIAGRAM); IntermediateEscalationEvent emptyTopEvent = getCatchingIntermediateNodeById(diagram, EMPTY_TOP_LEVEL_EVENT_ID, HAS_NO_INCOME_EDGE, HAS_OUTGOING_EDGE); assertGeneralSet(emptyTopEvent.getGeneral(), EMPTY_VALUE, EMPTY_VALUE); assertEscalationEventExecutionSet(emptyTopEvent.getExecutionSet(), EMPTY_VALUE, CANCELLING, EMPTY_VALUE); assertDataIOSet(emptyTopEvent.getDataIOSet(), EMPTY_VALUE); }
Source:
<code>List<String> fetchTableHeaders() { <START> return isAdmin() ? SUPER_MOD_HEADERS : HEADERS; <END> }</code><technical_language>SUPER_MOD_HEADERS get renamed</technical_language>

Target:
List<String> fetchTableHeaders() { return isAdmin() ? HEADERS_FOR_ADMIN : HEADERS; }
Source:
<code>private URI relativize(File file) { if (base == null) { <START> try { <END> return file.getCanonicalFile().toURI(); } catch (final IOException ex) { return file.toURI(); } } Path filePath = file.toPath() .toAbsolutePath(); Path relativePath = base.relativize(filePath); URI relativeURI = URI.create(IO.normalizePath(relativePath)); reporter.trace("Resolving %s relative to %s; Relative Path: %s, URI: %s", filePath, base, relativePath, relativeURI); return relativeURI; }</code><technical_language>I this is a good idea. caller supplies File objects supply canonical/absolute/relative File objects if choose</technical_language>

Target:
private URI relativize(File file) { if (base == null) { return file.toURI(); } Path filePath = file.toPath() .toAbsolutePath(); Path relativePath = base.relativize(filePath); URI relativeURI = URI.create(IO.normalizePath(relativePath)); reporter.trace("Resolving %s relative to %s; Relative Path: %s, URI: %s", filePath, base, relativePath, relativeURI); return relativeURI; }
Source:
<code>public void theDatabaseShouldBeUpdatedSoItIndicatesThatDeviceEIsUsingFirmwareVersion( final String deviceIdentification, final String firmwareVersion) throws Throwable { final Device device = this.deviceRepository.findByDeviceIdentification(deviceIdentification); assertNotNull(device); <START> final Firmware firmware = this.firmwareRepository.findByFilename(firmwareVersion); <END> assertNotNull(firmware); final Firmware activeFirmware = device.getActiveFirmware(); assertNotNull(activeFirmware); assertTrue(activeFirmware.getFilename().equals(firmware.getFilename())); assertTrue(activeFirmware.getModuleVersionComm().equals(firmware.getModuleVersionComm())); assertTrue(activeFirmware.getModuleVersionFunc().equals(firmware.getModuleVersionFunc())); assertTrue(activeFirmware.getModuleVersionMa().equals(firmware.getModuleVersionMa())); }</code><technical_language>This compile, checked in IDE maven test-compile (after enabling module integration-tests-cucumber in repositories root POM). Is code in FirmwareRepository in Platform repository merged development branch yet</technical_language>

Target:
public void theDatabaseShouldBeUpdatedSoItIndicatesThatDeviceEIsUsingFirmwareVersion( final String deviceIdentification, final String firmwareVersion) throws Throwable { final Device device = this.deviceRepository.findByDeviceIdentification(deviceIdentification); assertNotNull("Device not found.", device); final Firmware firmware = this.firmwareRepository.findByFilename(firmwareVersion); assertNotNull("Firmware not found.", firmware); final Firmware activeFirmware = device.getActiveFirmware(); assertNotNull("No active firmware found for device.", activeFirmware); assertEquals("Firmware filenames do not match.", firmware.getFilename(), activeFirmware.getFilename()); assertEquals("Firmware fields module_version_comm do not match.", firmware.getModuleVersionComm(), activeFirmware.getModuleVersionComm()); assertEquals("Firmware fields module_version_func do not match.", firmware.getModuleVersionFunc(), activeFirmware.getModuleVersionFunc()); assertEquals("Firmware fields module_version_ma do not match.", firmware.getModuleVersionMa(), activeFirmware.getModuleVersionMa()); }
Source:
<code>private boolean hostExists(List<GlusterServerInfo> glusterServers, VDS server) { if (GlusterFeatureSupported.glusterHostUuidSupported(getVdsGroup().getcompatibility_version())) { <START> VdsGluster vdsGluster = DbFacade.getInstance().getVdsGlusterDao().getById(getVds().getId()); <END> if (vdsGluster != null) { for (GlusterServerInfo glusterServer : glusterServers) { if (glusterServer.getUuid().equals(vdsGluster.getGlusterHostUuid())) { return true; } } } } else { for (GlusterServerInfo glusterServer : glusterServers) { if (glusterServer.getHostnameOrIp().equals(server.getHostName())) { return true; } for (VdsNetworkInterface vdsNwInterface : getVdsInterfaces(server.getId())) { if (glusterServer.getHostnameOrIp().equals(vdsNwInterface.getAddress())) { return true; } } } } return false; }</code><technical_language>Instead of getVds().getId(), server.getId()</technical_language>

Target:
private boolean hostExists(List<GlusterServerInfo> glusterServers, VDS server) { if (GlusterFeatureSupported.glusterHostUuidSupported(getVdsGroup().getcompatibility_version())) { GlusterServer glusterServer = DbFacade.getInstance().getGlusterServerDao().getByServerId(server.getId()); if (glusterServer != null) { for (GlusterServerInfo glusterServerInfo : glusterServers) { if (glusterServerInfo.getUuid().equals(glusterServer.getGlusterServerUuid())) { return true; } } } } else { for (GlusterServerInfo glusterServer : glusterServers) { if (glusterServer.getHostnameOrIp().equals(server.getHostName())) { return true; } try { String glusterHostAddr = InetAddress.getByName(glusterServer.getHostnameOrIp()).getHostAddress(); for (VdsNetworkInterface vdsNwInterface : getVdsInterfaces(server.getId())) { if (glusterHostAddr.equals(vdsNwInterface.getAddress())) { return true; } } } catch (UnknownHostException e) { log.errorFormat("Could not resole IP address of the host {0}. Error: {1}", glusterServer.getHostnameOrIp(), e.getMessage()); } } } return false; }
Source:
<code>private static boolean isHttpUrlOptions(RemoteOptions options) { return options.remoteCache != null <START> && !options.remoteCache.isEmpty() <END> && options.remoteCache.startsWith("http"); }</code><technical_language>startsWith() implies !isEmpty()</technical_language>

Target:
private static boolean isHttpUrlOptions(RemoteOptions options) { return options.remoteCache != null && options.remoteCache.toLowerCase().startsWith("http"); }
Source:
<code>private static void addTumorTypeToRows(TumorType tumorType, List<String> rows, List<String> parents) { List<String> row = new ArrayList<>(); String displayName = StringUtils.defaultString(tumorType.getName()).trim() + " (" + StringUtils.defaultString(tumorType.getCode()).trim() + ")"; row.addAll(parents); row.add(displayName); for (int i = 4; i > parents.size(); i--) { row.add(""); } row.add(StringUtils.defaultString(tumorType.getMainType() != null ? tumorType.getMainType().getName() : "")); row.add(StringUtils.defaultString(tumorType.getColor())); row.add(StringUtils.defaultString(tumorType.getNCI())); row.add(StringUtils.defaultString(tumorType.getUMLS())); rows.add(StringUtils.join(row, "\t")); Map<String, TumorType> children = tumorType.getChildren(); if (children.size() > 0) { parents.add(displayName); <START> for (String code : children.keySet()) { <END> TumorType child = children.get(code); addTumorTypeToRows(child, rows, parents); } parents.remove(parents.size() - 1); } }</code><technical_language>This eventually change calls oncotree-mappings api. calls return null</technical_language>

Target:
private static void addTumorTypeToRows(TumorType tumorType, List<String> rows, List<String> parents) { List<String> row = new ArrayList<>(); String oncotreeCode = StringUtils.defaultString(tumorType.getCode()).trim(); if (parents.size() > 4) { throw new RuntimeException("Oncotree depth for code " + oncotreeCode + " exceeds max representation. Depth cannot be > 5"); } String displayName = StringUtils.defaultString(tumorType.getName()).trim() + " (" + oncotreeCode + ")"; row.addAll(parents); row.add(displayName); for (int i = 4; i > parents.size(); i--) { row.add(""); } row.add(StringUtils.defaultString(tumorType.getMainType() != null ? tumorType.getMainType().getName() : "")); row.add(StringUtils.defaultString(tumorType.getColor())); row.add(StringUtils.defaultString(tumorType.getNCI())); row.add(StringUtils.defaultString(tumorType.getUMLS())); rows.add(StringUtils.join(row, "\t")); Map<String, TumorType> children = tumorType.getChildren(); if (children.size() > 0) { parents.add(displayName); for (String code : children.keySet()) { TumorType child = children.get(code); addTumorTypeToRows(child, rows, parents); } parents.remove(parents.size() - 1); } }
Source:
<code>private static int megabytes(int size) { <START> return toIntExact(new DataSize(size, DataSize.Unit.MEGABYTE).toBytes()); <END> }</code><technical_language>static import</technical_language>

Target:
private static int megabytes(int size) { return toIntExact(new DataSize(size, MEGABYTE).toBytes()); }
Source:
<code>private String getExtraClass(String giverEmail, String instructorEmail, boolean isPublic) { StringBuilder extraClass = new StringBuilder(50); extraClass.append(" giver_display-by-") .append(giverEmail.equals(instructorEmail) ? "you" : "others") .append(" status_display-") .append(isPublic ? "public" : "private"); <START> return extraClass.toString(); <END> }</code><technical_language>return ... + ... + ... do trick</technical_language>

Target:
private String getExtraClass(String giverEmail, String instructorEmail, boolean isPublic) { return " giver_display-by-" + (giverEmail.equals(instructorEmail) ? "you" : "others") + " status_display-" + (isPublic ? "public" : "private"); }
Source:
<code>private static void startGUI(String guiName, String[] args) { final String METHOD_NAME = "startGUI(String, String[])"; if (null == guiName) { getLogger().error(MegaMek.class, METHOD_NAME, "guiName must be non-null"); return; } if (null == args) { getLogger().error(MegaMek.class, METHOD_NAME, "args must be non-null"); return; } IMegaMekGUI mainGui = MegaMek.getGui(guiName); if (mainGui == null) { getLogger().info(MegaMek.class, METHOD_NAME, UNKNOWN_GUI_MESSAGE + guiName); <START> System.exit(1); <END> } else { StringBuffer message = new StringBuffer("Starting GUI "); message.append(guiName).append(". "); MegaMek.dumpArgs(message, args); getLogger().info(MegaMek.class, METHOD_NAME, message.toString()); mainGui.start(args); } }</code><technical_language>this example of a logger.fatal() message (instead of info)</technical_language>

Target:
private static void startGUI(String guiName, String[] args) { final String METHOD_NAME = "startGUI(String, String[])"; if (null == guiName) { getLogger().error(MegaMek.class, METHOD_NAME, "guiName must be non-null"); return; } if (null == args) { getLogger().error(MegaMek.class, METHOD_NAME, "args must be non-null"); return; } IMegaMekGUI mainGui = MegaMek.getGui(guiName); if (mainGui == null) { getLogger().fatal(MegaMek.class, METHOD_NAME, UNKNOWN_GUI_MESSAGE + guiName); System.exit(1); } else { StringBuffer message = new StringBuffer("Starting GUI "); message.append(guiName).append(". "); MegaMek.dumpArgs(message, args); getLogger().info(MegaMek.class, METHOD_NAME, message.toString()); mainGui.start(args); } }
Source:
<code>public void beforeCompletion() { try { if ( prepared ) { <START> if ( log.isTraceEnabled() ) { <END> log.tracef( "Transaction's beforeCompletion() phase already been processed, ignoring: %s", this.toString() ); } } else { if ( log.isTraceEnabled() ) { log.tracef( "Processing Transaction's beforeCompletion() phase: %s", this.toString() ); } queueingProcessor.prepareWorks( queue ); prepared = true; } if ( log.isTraceEnabled() ) { log.tracef( "Processing Transaction's afterCompletion() phase for %s. Performing work.", this.toString() ); } queueingProcessor.performWorks( queue ); } finally { consumed = true; if ( queuePerTransaction != null ) { queuePerTransaction.remove( transactionIdentifier ); } } }</code><technical_language>isTraceEnabled() business needed if pass this parameter value</technical_language>

Target:
public void beforeCompletion() { try { if ( prepared ) { log.tracef( "Transaction's beforeCompletion() phase already been processed, ignoring: %s", this ); } else { log.tracef( "Processing Transaction's beforeCompletion() phase: %s", this ); queueingProcessor.prepareWorks( queue ); prepared = true; } log.tracef( "Processing Transaction's afterCompletion() phase for %s. Performing work.", this ); queueingProcessor.performWorks( queue ); } finally { consumed = true; if ( queuePerTransaction != null ) { queuePerTransaction.remove( transactionIdentifier ); } } }
Source:
<code>private void validateSchema(Schema inputSchema, List<String> uniqueFields, @Nullable DedupConfig.DedupFunctionInfo function, FailureCollector collector) { for (String uniqueField : uniqueFields) { Schema.Field field = inputSchema.getField(uniqueField); if (field == null) { collector.addFailure(String.format("Cannot do an unique on field '%s' because it does " + <START> "not exist in inputSchema", uniqueField), <END> "Remove this entry.").withConfigElement("uniqueFields", uniqueField); } } if (function != null) { Schema.Field field = inputSchema.getField(function.getField()); if (field == null) { collector.addFailure(String.format( "Invalid filter %s(%s): Field '%s' does not exist in input schema ", function.getFunction(), function.getField(), function.getField()), "Remove this entry").withConfigProperty("filterOperation"); } } }</code><technical_language>indentation (rest of PR too)</technical_language>

Target:
private void validateSchema(Schema inputSchema, List<String> uniqueFields, @Nullable DedupConfig.DedupFunctionInfo function, FailureCollector collector) { for (String uniqueField : uniqueFields) { Schema.Field field = inputSchema.getField(uniqueField); if (field == null) { collector.addFailure(String.format("Field '%s' does not exist in the input schema", uniqueField), "") .withConfigElement("uniqueFields", uniqueField); } } if (function != null) { Schema.Field field = inputSchema.getField(function.getField()); if (field == null) { collector.addFailure(String.format("Invalid filter %s(%s): Field '%s' does not exist in input schema ", function.getFunction(), function.getField(), function.getField()), null) .withConfigProperty("filterOperation"); } } }
Source:
<code>private RestTemplate getSecureRestTemplate(ConfigClientProperties client) { SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory(); requestFactory.setReadTimeout((60 * 1000 * 3) + 5000); RestTemplate template = new RestTemplate(requestFactory); String username = client.getUsername(); String password = client.getPassword(); String authorization = client.getAuthorization(); <START> Map<String, String> headers = client.getHeaders(); <END> if (password != null && authorization != null) { throw new IllegalStateException( "You must set either 'password' or 'authorization'"); } if (password != null) { byte[] token = Base64Utils.encode((username + ":" + password).getBytes()); headers.put("Authorization", "Basic " + new String(token)); } else if (authorization != null) { headers.put("Authorization", authorization); } if (!headers.isEmpty()) { template.setInterceptors(Arrays.<ClientHttpRequestInterceptor> asList( new GenericRequestHeaderInterceptor(headers))); } return template; }</code><technical_language>I create a new Map copy values. guarantees map is mutable</technical_language>

Target:
private RestTemplate getSecureRestTemplate(ConfigClientProperties client) { SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory(); requestFactory.setReadTimeout((60 * 1000 * 3) + 5000); RestTemplate template = new RestTemplate(requestFactory); String username = client.getUsername(); String password = client.getPassword(); String authorization = client.getAuthorization(); Map<String, String> headers = new HashMap<>(client.getHeaders()); if (password != null && authorization != null) { throw new IllegalStateException( "You must set either 'password' or 'authorization'"); } if (password != null) { byte[] token = Base64Utils.encode((username + ":" + password).getBytes()); headers.put("Authorization", "Basic " + new String(token)); } else if (authorization != null) { headers.put("Authorization", authorization); } if (!headers.isEmpty()) { template.setInterceptors(Arrays.<ClientHttpRequestInterceptor> asList( new GenericRequestHeaderInterceptor(headers))); } return template; }
Source:
<code>public void copyRightToLeft(Diff target, Monitor monitor) { if (target.getState() != DifferenceState.UNRESOLVED) { return; } <START> long startTime = System.currentTimeMillis(); <END> target.setState(DifferenceState.MERGED); final Set<Diff> dependencies = getDirectMergeDependencies(target, true); boolean requiresMerging = requiresMerging(target, true); for (Diff mergeMe : dependencies) { mergeDiff(mergeMe, true, monitor); } for (Diff transitiveMerge : getDirectResultingMerges(target, true)) { transitiveMerge.setState(DifferenceState.MERGED); } if (requiresMerging) { if (target.getSource() == DifferenceSource.LEFT) { reject(target, true); } else { accept(target, true); } } if (isHandleSubDiffs()) { Set<Diff> subDiffs = Sets.newLinkedHashSet(ComparisonUtil.getDirectSubDiffs(false).apply(target)); for (Diff subDiff : subDiffs) { mergeDiff(subDiff, true, monitor); } } if (LOGGER.isDebugEnabled()) { LOGGER.debug("copyLeftToRight(Diff, Monitor) - diff " + target.hashCode() + " merged in " + getTimeSpentInMethod(startTime) + "s"); } }</code><technical_language>start</technical_language>

Target:
public void copyRightToLeft(Diff target, Monitor monitor) { if (target.getState() != DifferenceState.UNRESOLVED) { return; } long start = System.currentTimeMillis(); target.setState(DifferenceState.MERGED); final Set<Diff> dependencies = getDirectMergeDependencies(target, true); boolean requiresMerging = requiresMerging(target, true); for (Diff mergeMe : dependencies) { mergeDiff(mergeMe, true, monitor); } for (Diff transitiveMerge : getDirectResultingMerges(target, true)) { transitiveMerge.setState(DifferenceState.MERGED); } if (requiresMerging) { if (target.getSource() == DifferenceSource.LEFT) { reject(target, true); } else { accept(target, true); } } if (isHandleSubDiffs()) { Set<Diff> subDiffs = Sets.newLinkedHashSet(ComparisonUtil.getDirectSubDiffs(false).apply(target)); for (Diff subDiff : subDiffs) { mergeDiff(subDiff, true, monitor); } } if (LOGGER.isDebugEnabled()) { long duration = System.currentTimeMillis() - start; LOGGER.debug("copyLeftToRight(Diff, Monitor) - diff " + target.hashCode() + " merged in " + duration + "s"); } }
Source:
<code>private static void bootstrapManagementServer(IClientRouter router, Layout layout) throws TimeoutException, NetworkException, AlreadyBootstrappedException { ManagementClient managementClient = new ManagementClient(router, layout.getEpoch(), layout.getClusterId()); CompletableFuture<Void> bootstrapManagementServer = managementClient .bootstrapManagement(layout) .exceptionally(ex -> { try { CFUtils.unwrap(ex, AlreadyBootstrappedException.class); } catch (AlreadyBootstrappedException e) { log.warn("BootstrapUtil: Management Server {}:{} already bootstrapped.", router.getHost(), router.getPort()); return false; } return true; }) .thenCompose(bootstrapSucceeded -> { if (bootstrapSucceeded) return CompletableFuture.completedFuture(layout); return managementClient.getLayout(); }) .thenAccept(retrievedLayout -> { if (retrievedLayout.equals(layout)) { return; } <START> throw new AlreadyBootstrappedException(); <END> }); CFUtils.getUninterruptibly(bootstrapManagementServer, AlreadyBootstrappedException.class, TimeoutException.class, NetworkException.class); }</code><technical_language>Add a log information</technical_language>

Target:
public static void bootstrapManagementServer(IClientRouter router, Layout layout) { ManagementClient managementClient = new ManagementClient(router, layout.getEpoch(), layout.getClusterId()); bootstrap(router, layout, () -> managementClient.bootstrapManagement(layout), managementClient::getLayout); }
Source:
<code>boolean internalExecute(String sql) throws SQLException { clearCurrentResults(); checkOpen(); StatementClient client = null; ResultSet resultSet = null; try { client = connection().startQuery(sql, getStatementSessionProperties()); <START> if (client.isFinished() && client.finalStatusInfo().getError() != null) { <END> throw resultsException(client.finalStatusInfo()); } executingClient.set(client); resultSet = new PrestoResultSet(client, maxRows.get(), progressConsumer); if (client.currentStatusInfo().getUpdateType() == null) { currentResult.set(resultSet); return true; } while (resultSet.next()) { } connection().updateSession(client); Long updateCount = client.finalStatusInfo().getUpdateCount(); currentUpdateCount.set((updateCount != null) ? updateCount : 0); currentUpdateType.set(client.finalStatusInfo().getUpdateType()); return false; } catch (ClientException e) { throw new SQLException(e.getMessage(), e); } catch (RuntimeException e) { throw new SQLException("Error executing query", e); } finally { executingClient.set(null); if (currentResult.get() == null) { if (resultSet != null) { resultSet.close(); } if (client != null) { client.close(); } } } }</code><technical_language>Pull out final status a variable</technical_language>

Target:
boolean internalExecute(String sql) throws SQLException { clearCurrentResults(); checkOpen(); StatementClient client = null; ResultSet resultSet = null; try { client = connection().startQuery(sql, getStatementSessionProperties()); if (client.isFinished()) { QueryStatusInfo finalStatusInfo = client.finalStatusInfo(); if (finalStatusInfo.getError() != null) { throw resultsException(finalStatusInfo); } } executingClient.set(client); resultSet = new PrestoResultSet(client, maxRows.get(), progressConsumer); if (client.currentStatusInfo().getUpdateType() == null) { currentResult.set(resultSet); return true; } while (resultSet.next()) { } connection().updateSession(client); Long updateCount = client.finalStatusInfo().getUpdateCount(); currentUpdateCount.set((updateCount != null) ? updateCount : 0); currentUpdateType.set(client.finalStatusInfo().getUpdateType()); return false; } catch (ClientException e) { throw new SQLException(e.getMessage(), e); } catch (RuntimeException e) { throw new SQLException("Error executing query", e); } finally { executingClient.set(null); if (currentResult.get() == null) { if (resultSet != null) { resultSet.close(); } if (client != null) { client.close(); } } } }
Source:
<code>private void printHelpForKey() throws Exception { final String keyName = parser.getKey(); boolean foundKey = iterateAllKeys(this.configKeyFactory, keysConfig, new ConfigKeyHandler() { @Override public boolean handle(ConfigKey key) { if (key.getKey().equals(keyName)) { console.writeLine(key.getValueHelper().getHelpNote(key)); return false; } return true; } }); if (!foundKey) { console.writeFormat( <START> "Cannot display help for key %1$s. The key does not exist at the configuration file of engine-config.", <END> keyName); } }</code><technical_language>this a static message messages defined in beginning of this file</technical_language>

Target:
private void printHelpForKey() throws Exception { final String keyName = parser.getKey(); boolean foundKey = iterateAllKeys(this.configKeyFactory, keysConfig, new ConfigKeyHandler() { @Override public boolean handle(ConfigKey key) { if (key.getKey().equals(keyName)) { console.writeLine(key.getValueHelper().getHelpNote(key)); return false; } return true; } }); if (!foundKey) { console.writeFormat(KEY_NOT_FOUND_ERR_MSG, keyName); } }
Source:
<code>public List<GitlabMergeRequest> getOpenMergeRequests(Serializable projectId) throws IOException { <START> return getMergeRequestsWithStatus(projectId, "opened"); <END> }</code><technical_language>extract "opened" "merged" strings constants</technical_language>

Target:
public List<GitlabMergeRequest> getOpenMergeRequests(Serializable projectId) throws IOException { return getMergeRequestsWithStatus(projectId, GitlabMergeRequest.STATUS_OPENED); }
Source:
<code>public void setSeverityLevel(int severityLevel) { if (severityLevel < 1 || severityLevel > 5) { throw new IllegalArgumentException("The severty level should be between 1-5"); <START> } <END> this.severityLevel = severityLevel; }</code><technical_language>This ideally checked in ArgusCore/Notification.java</technical_language>

Target:
public void setSeverityLevel(int severityLevel) { this.severityLevel = severityLevel; }