auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public HelixHealthReportAggregationTaskTest(boolean enableAggregatedMonthlyAccountReport) throws IOException { this.enableAggregatedMonthlyAccountReport = enableAggregatedMonthlyAccountReport; File tempDir = Files.createTempDirectory("HelixHealthReportAggregationTask-" + new Random().nextInt(1000)).toFile(); String tempDirPath = tempDir.getAbsolutePath(); int zkPort = 13188; int maxRetries = 1000; int numRetries = 0; while (true) { if (numRetries > maxRetries) { throw new IOException("No ports are available to start zookeeper server"); } try { zkInfo = new TestUtils.ZkInfo(tempDirPath, "DC1", (byte) 0, zkPort, true); break; } catch (Exception e) { <START> if (e instanceof BindException || e.getCause() instanceof BindException) { <END> System.out.println("Port " + zkPort + " already in use, try " + (zkPort + 1) + " instead"); zkPort++; numRetries++; } else { throw new RuntimeException(e); } } } String zkAddr = "localhost:" + String.valueOf(zkInfo.getPort()); mockHelixAdmin = new MockHelixAdminFactory().getHelixAdmin(zkAddr); mockHelixManager = new MockHelixManager(INSTANCE_NAME, InstanceType.PARTICIPANT, zkAddr, CLUSTER_NAME, mockHelixAdmin, null, null); mockTime = new MockTime(SystemTime.getInstance().milliseconds()); }</code><technical_language>throw BindException directly. remove e instanceof BindException</technical_language>

Target:
public HelixHealthReportAggregationTaskTest(boolean enableAggregatedMonthlyAccountReport) throws IOException { this.enableAggregatedMonthlyAccountReport = enableAggregatedMonthlyAccountReport; File tempDir = Files.createTempDirectory("HelixHealthReportAggregationTask-" + new Random().nextInt(1000)).toFile(); String tempDirPath = tempDir.getAbsolutePath(); int zkPort = 13188; int maxRetries = 1000; int numRetries = 0; while (true) { if (numRetries > maxRetries) { throw new IOException("No ports are available to start zookeeper server"); } try { zkInfo = new TestUtils.ZkInfo(tempDirPath, "DC1", (byte) 0, zkPort, true); break; } catch (Exception e) { if (e.getCause() instanceof BindException) { System.out.println("Port " + zkPort + " already in use, try " + (zkPort + 1) + " instead"); zkPort++; numRetries++; } else { throw new RuntimeException(e); } } } String zkAddr = "localhost:" + zkInfo.getPort(); mockHelixAdmin = new MockHelixAdminFactory().getHelixAdmin(zkAddr); mockHelixManager = new MockHelixManager(INSTANCE_NAME, InstanceType.PARTICIPANT, zkAddr, CLUSTER_NAME, mockHelixAdmin, null, null); mockTime = new MockTime(SystemTime.getInstance().milliseconds()); clusterMapConfig = makeClusterMapConfig(); }
Source:
<code>private ActionItem findActionItem(ActionItemNoteDetailDto detailDto) { QueryByCriteria query = QueryByCriteria.Builder.fromPredicates( PredicateFactory.equal(KFSPropertyConstants.PRINCIPAL_ID, detailDto.getPrincipalId()), PredicateFactory.equal(CUKFSConstants.DOCUMENT_ID, detailDto.getDocHeaderId())); List<ActionItem> items = KRADServiceLocator.getDataObjectService().findMatching(ActionItem.class, query).getResults(); ActionListBuilder actionListBuilder = new ActionListBuilder(); ActionItem selectedActionItem = null; Comparator<ActionItemContract> priorityComparator = new ActionListPriorityComparator(); <START> for (ActionItem currentItem : items) { <END> if (ObjectUtils.isNull(selectedActionItem)) { selectedActionItem = currentItem; } else { selectedActionItem = (priorityComparator.compare(selectedActionItem, currentItem) >= 0) ? selectedActionItem : currentItem; } } return selectedActionItem; }</code><technical_language>potentially simplify this search Collections.max() method, need check for empty collection invoking it</technical_language>

Target:
private ActionItem findActionItem(ActionItemNoteDetailDto detailDto) { QueryByCriteria query = QueryByCriteria.Builder.fromPredicates( PredicateFactory.equal(KFSPropertyConstants.PRINCIPAL_ID, detailDto.getPrincipalId()), PredicateFactory.equal(CUKFSConstants.DOCUMENT_ID, detailDto.getDocHeaderId())); List<ActionItem> actionItems = KRADServiceLocator.getDataObjectService().findMatching(ActionItem.class, query).getResults(); ActionItem selectedActionItem = null; if (LOG.isDebugEnabled() ) { LOG.debug("findActionItem, number of action items for principal " + detailDto.getPrincipalId() + " and document number " + detailDto.getDocHeaderId() + " is " + CollectionUtils.size(actionItems)); } if (CollectionUtils.isNotEmpty(actionItems)) { selectedActionItem = (ActionItem) Collections.max(actionItems, new ActionListPriorityComparator()); } return selectedActionItem; }
Source:
<code>public String getHumanishName() throws IllegalArgumentException { if ("".equals(getPath()) || getPath() == null) throw new IllegalArgumentException(); String s = getPath(); String[] elements; if ("file".equals(scheme) || LOCAL_FILE.matcher(s).matches()) { <START> elements = s.split("[\\" + File.separator + "/]"); <END> } else elements = s.split("/"); if (elements.length == 0) throw new IllegalArgumentException(); String result = elements[elements.length - 1]; if (Constants.DOT_GIT.equals(result)) result = elements[elements.length - 2]; else if (result.endsWith(Constants.DOT_GIT_EXT)) result = result.substring(0, result.length() - Constants.DOT_GIT_EXT.length()); return result; }</code><technical_language>separatorChar</technical_language>

Target:
public String getHumanishName() throws IllegalArgumentException { if ("".equals(getPath()) || getPath() == null) throw new IllegalArgumentException(); String s = getPath(); String[] elements; if ("file".equals(scheme) || LOCAL_FILE.matcher(s).matches()) elements = s.split("[\\" + File.separatorChar + "/]"); else elements = s.split("/"); if (elements.length == 0) throw new IllegalArgumentException(); String result = elements[elements.length - 1]; if (Constants.DOT_GIT.equals(result)) result = elements[elements.length - 2]; else if (result.endsWith(Constants.DOT_GIT_EXT)) result = result.substring(0, result.length() - Constants.DOT_GIT_EXT.length()); return result; }
Source:
<code>public void testFileHandlerReconnectOnReadFail() throws Exception { final String chunkDownloadExMsg = "Test exception. Chunk processing error."; IgniteEx snd = startGrid(0); IgniteEx rcv = startGrid(1); snd.cluster().active(true); File fileToSend = createFileRandomData("testFile", 5 * 1024 * 1024); <START> final AtomicInteger readedChunks = new AtomicInteger(); <END> transmissionFileIoFactory(rcv, new FileIOFactory() { @Override public FileIO create(File file, OpenOption... modes) throws IOException { fileIo[0] = IO_FACTORY.create(file, modes); return new FileIODecorator(fileIo[0]) { @Override public long transferFrom(ReadableByteChannel src, long position, long count) throws IOException { if (readedChunks.incrementAndGet() == 4) throw new IgniteException(chunkDownloadExMsg); return super.transferFrom(src, position, count); } }; } }); rcv.context().io().addTransmissionHandler(topic, new DefaultTransmissionHandler(rcv, fileToSend, tempStore) { @Override public void onException(UUID nodeId, Throwable err) { assertEquals(chunkDownloadExMsg, err.getMessage()); } }); try (GridIoManager.TransmissionSender sender = snd.context() .io() .openTransmissionSender(rcv.localNode().id(), topic)) { sender.send(fileToSend, TransmissionPolicy.FILE); } }</code><technical_language>readedChunks -> readChunks</technical_language>

Target:
public void testFileHandlerReconnectOnReadFail() throws Exception { final String chunkDownloadExMsg = "Test exception. Chunk processing error."; snd = startGrid(0); rcv = startGrid(1); snd.cluster().active(true); File fileToSend = createFileRandomData("testFile", 5 * 1024 * 1024); final AtomicInteger readChunks = new AtomicInteger(); transmissionFileIoFactory(rcv, new FileIOFactory() { @Override public FileIO create(File file, OpenOption... modes) throws IOException { fileIo[0] = IO_FACTORY.create(file, modes); return new FileIODecorator(fileIo[0]) { @Override public long transferFrom(ReadableByteChannel src, long position, long count) throws IOException { if (readChunks.incrementAndGet() == 4) throw new IgniteException(chunkDownloadExMsg); return super.transferFrom(src, position, count); } }; } }); rcv.context().io().addTransmissionHandler(topic, new DefaultTransmissionHandler(rcv, fileToSend, tempStore) { @Override public void onException(UUID nodeId, Throwable err) { assertEquals(chunkDownloadExMsg, err.getMessage()); } }); try (GridIoManager.TransmissionSender sender = snd.context() .io() .openTransmissionSender(rcv.localNode().id(), topic)) { sender.send(fileToSend, TransmissionPolicy.FILE); } }
Source:
<code>public void testGetTumorTypesByVersion() { Map<String, TumorType> returnedTumorTypes = cacheUtil.getTumorTypesByVersion(legacyVersion); String rootTumorTypeCode = returnedTumorTypes.keySet().iterator().next(); TumorType rootTumorType = returnedTumorTypes.get(rootTumorTypeCode); assertEquals("TISSUE", rootTumorTypeCode); assertEquals("TISSUE", rootTumorType.getCode()); <START> assertEquals(32, rootTumorType.getChildren().size()); <END> assertNoHistoryInChildren(rootTumorType.getChildren()); assertNoRescindsInChildren(rootTumorType.getChildren()); assertNoPrecursorsInChildren(rootTumorType.getChildren()); returnedTumorTypes = cacheUtil.getTumorTypesByVersion(latestVersion); Boolean foundHistory = Boolean.FALSE; foundHistory = assertHistoryInChildren(returnedTumorTypes, foundHistory); assertTrue("Failed to find history for 'SS'", foundHistory); Boolean foundRescinds = Boolean.FALSE; foundRescinds = assertRescindsInChildren(returnedTumorTypes, foundRescinds); assertTrue("Failed to find rescinds for 'URMM'", foundRescinds); Boolean foundPrecursors = Boolean.FALSE; foundPrecursors = assertPrecursorsInChildren(returnedTumorTypes, foundPrecursors); assertTrue("Failed to find precursors for 'CLLSLL'", foundPrecursors); }</code><technical_language>32 a parameter defined in config class (or mock data is) .. computed there. alternatively, a tree traversal if tree returned matches tree defined in mock</technical_language>

Target:
public void testGetTumorTypesByVersion() { Map<String, TumorType> returnedTumorTypes = cacheUtil.getTumorTypesByVersion(legacyVersion); String rootTumorTypeCode = returnedTumorTypes.keySet().iterator().next(); TumorType rootTumorType = returnedTumorTypes.get(rootTumorTypeCode); assertEquals("TISSUE", rootTumorTypeCode); assertEquals("TISSUE", rootTumorType.getCode()); assertEquals(32, rootTumorType.getChildren().size()); assertNoHistoryInChildren(rootTumorType.getChildren()); assertNoRevocationsInChildren(rootTumorType.getChildren()); assertNoPrecursorsInChildren(rootTumorType.getChildren()); returnedTumorTypes = cacheUtil.getTumorTypesByVersion(latestVersion); Boolean foundHistory = Boolean.FALSE; foundHistory = assertHistoryInChildren(returnedTumorTypes, foundHistory); assertTrue("Failed to find history for 'SS'", foundHistory); Boolean foundRevocations = Boolean.FALSE; foundRevocations = assertRevocationsInChildren(returnedTumorTypes, foundRevocations); assertTrue("Failed to find revocations for 'URMM'", foundRevocations); Boolean foundPrecursors = Boolean.FALSE; foundPrecursors = assertPrecursorsInChildren(returnedTumorTypes, foundPrecursors); assertTrue("Failed to find precursors for 'CLLSLL'", foundPrecursors); }
Source:
<code>public void testUpdate() throws Exception { for (String regionId : regions) { <START> ImmutableMultimap<String, String> headers = ImmutableMultimap.of(SwiftHeaders.STATIC_WEB_INDEX, "__index.html", SwiftHeaders.STATIC_WEB_ERROR, "__error.html"); <END> UpdateContainerOptions opts = new UpdateContainerOptions().headers(headers); assertNotNull(api.getContainerApiForRegion(regionId).create(name)); Container container = api.getContainerApiForRegion(regionId).get(name); assertNotNull(container); assertEquals(container.getName(), name); assertEquals(container.getMetadata().size(), 0); assertNotNull(api.getContainerApiForRegion(regionId).update(name, opts)); Container updatedContainer = api.getContainerApiForRegion(regionId).get(name); assertNotNull(updatedContainer); assertEquals(updatedContainer.getName(), name); assertEquals(updatedContainer.getMetadata().size(), 2); assertEquals(updatedContainer.getMetadata().get("web-index"), "__index.html"); assertEquals(updatedContainer.getMetadata().get("web-error"), "__error.html"); assertTrue(api.getContainerApiForRegion(regionId).deleteIfEmpty(name)); } }</code><technical_language>Wrap this line</technical_language>

Target:
public void testUpdate() throws Exception { for (String regionId : regions) { ImmutableMultimap<String, String> headers = ImmutableMultimap.of(SwiftHeaders.STATIC_WEB_INDEX, "__index.html", SwiftHeaders.STATIC_WEB_ERROR, "__error.html"); UpdateContainerOptions opts = new UpdateContainerOptions().headers(headers); assertNotNull(api.getContainerApiForRegion(regionId).create(name)); Container container = api.getContainerApiForRegion(regionId).get(name); assertNotNull(container); assertEquals(container.getName(), name); assertTrue(container.getMetadata().isEmpty()); assertNotNull(api.getContainerApiForRegion(regionId).update(name, opts)); Container updatedContainer = api.getContainerApiForRegion(regionId).get(name); assertNotNull(updatedContainer); assertEquals(updatedContainer.getName(), name); assertEquals(updatedContainer.getMetadata().size(), 2); assertEquals(updatedContainer.getMetadata().get("web-index"), "__index.html"); assertEquals(updatedContainer.getMetadata().get("web-error"), "__error.html"); assertTrue(api.getContainerApiForRegion(regionId).deleteIfEmpty(name)); } }
Source:
<code>protected Mono<LoadBalancerInner> getInnerAsync() { <START> return this <END> .manager() .inner() .loadBalancers() .getByResourceGroupAsync(this.resourceGroupName(), this.name(), null); }</code><technical_language>Eh, I mean, try delete null in .getByResourceGroupAsync(this.resourceGroupName(), this.name(), null);. If compiles is good. If know. works .getByResourceGroupAsync(this.resourceGroupName(), this.name()); null is overload method is generated generator. yaohai added null build pass add TODO</technical_language>

Target:
protected Mono<LoadBalancerInner> getInnerAsync() { return this .manager() .inner() .loadBalancers() .getByResourceGroupAsync(this.resourceGroupName(), this.name()); }
Source:
<code>private ContentWriteController contentWriteController() { return ContentWriteController.create( configFetcher, contentWriteExecutor, lookupBackedContentIdGenerator, contentWriteMessageSender, contentModelOutputter(), lookupStore, contentResolver, contentWriter, new EquivalenceBreaker( contentResolver, entryStore, lookupWriter ), oldContentDeactivator, <START> configFetcher <END> ); }</code><technical_language>passed in</technical_language>

Target:
private ContentWriteController contentWriteController() { return ContentWriteController.create( configFetcher, contentWriteExecutor, lookupBackedContentIdGenerator, contentWriteMessageSender, contentModelOutputter(), lookupStore, contentResolver, contentWriter, new EquivalenceBreaker( contentResolver, entryStore, lookupWriter ), oldContentDeactivator ); }
Source:
<code><START> private boolean isCinderDisksExist() { <END> return CollectionUtils.exists(getDisksList(), new Predicate() { @Override public boolean evaluate(Object o) { Disk disk = (Disk) o; return disk.getDiskStorageType() == DiskStorageType.CINDER; } }); }</code><technical_language>replace this method ImageHandler().filterDisksBasedOnCinder</technical_language>

Target:
private boolean isCinderDisksExist() { return !ImagesHandler.filterDisksBasedOnCinder(getDisksList()).isEmpty(); }
Source:
<code>public ResponseEntity<?> createWorkflowInstance( @RequestBody @ApiParam(value = "Submitted workflow instance information", required = true) CreateWorkflowInstanceRequest req) { WorkflowInstance instance = createWorkflowConverter.convert(req); try { long id = workflowInstances.insertWorkflowInstance(instance); instance = workflowInstances.getWorkflowInstance(id, EnumSet.of(WorkflowInstanceInclude.CURRENT_STATE_VARIABLES), null); return created(URI.create(String.valueOf(id))).body(createWorkflowConverter.convert(instance)); <START> } catch (StateVariableValueTooLongException e) { <END> return badRequest().body(e.getMessage()); } }</code><technical_language>here. If StateVariableValueTooLongException thrown add exception mapper return type CreateWorkflowInstanceResponse</technical_language>

Target:
public ResponseEntity<CreateWorkflowInstanceResponse> createWorkflowInstance( @RequestBody @ApiParam(value = "Submitted workflow instance information", required = true) CreateWorkflowInstanceRequest req) { WorkflowInstance instance = createWorkflowConverter.convert(req); long id = workflowInstances.insertWorkflowInstance(instance); instance = workflowInstances.getWorkflowInstance(id, EnumSet.of(WorkflowInstanceInclude.CURRENT_STATE_VARIABLES), null); return created(URI.create(String.valueOf(id))).body(createWorkflowConverter.convert(instance)); }
Source:
<code>private void processExternallyManagedVms() { <START> _externalVmsToAdd.clear(); <END> List<String> vmsToQuery = new ArrayList<String>(); for (VmInternalData vmInternalData : _runningVms.values()) { VM currentVmData = _vmDict.get(vmInternalData.getVmDynamic().getId()); if (currentVmData == null) { if (getDbFacade().getVmStaticDao().get(vmInternalData.getVmDynamic().getId()) == null) { Guid vmId = vmInternalData.getVmDynamic().getId(); vmsToQuery.add(vmId.toString()); } } } if (!vmsToQuery.isEmpty()) { Map[] vmsInfo = getVmInfo(vmsToQuery); for (Map vmInfo : vmsInfo) { Guid vmId = Guid.createGuidFromString((String) vmInfo.get(VdsProperties.vm_guid)); VmStatic vmStatic = new VmStatic(); vmStatic.setId(vmId); vmStatic.setCreationDate(new Date()); vmStatic.setVdsGroupId(_vds.getVdsGroupId()); String vmNameOnHost = (String) vmInfo.get(VdsProperties.vm_name); if (StringUtils.equals(HOSTED_ENGINE_VM_NAME, vmNameOnHost)) { vmStatic.setName(vmNameOnHost); vmStatic.setOrigin(OriginType.HOSTED_ENGINE); } else { vmStatic.setName(String.format(EXTERNAL_VM_NAME_FORMAT, vmNameOnHost)); vmStatic.setOrigin(OriginType.EXTERNAL); } vmStatic.setNumOfSockets(Integer.parseInt((String) vmInfo.get(VdsProperties.num_of_cpus))); vmStatic.setMemSizeMb(Integer.parseInt((String) vmInfo.get(VdsProperties.mem_size_mb))); _externalVmsToAdd.add(vmStatic); log.infoFormat("Importing VM {0} as {1}, as it is running on the on Host, but does not exist in the engine.", vmNameOnHost, vmStatic.getName()); } } }</code><technical_language>i dont clear is needed, called run</technical_language>

Target:
private void processExternallyManagedVms() { List<String> vmsToQuery = new ArrayList<String>(); for (VmInternalData vmInternalData : _runningVms.values()) { VM currentVmData = _vmDict.get(vmInternalData.getVmDynamic().getId()); if (currentVmData == null) { if (getDbFacade().getVmStaticDao().get(vmInternalData.getVmDynamic().getId()) == null) { Guid vmId = vmInternalData.getVmDynamic().getId(); vmsToQuery.add(vmId.toString()); } } } if (!vmsToQuery.isEmpty()) { Map[] vmsInfo = getVmInfo(vmsToQuery); for (Map vmInfo : vmsInfo) { Guid vmId = Guid.createGuidFromString((String) vmInfo.get(VdsProperties.vm_guid)); VmStatic vmStatic = new VmStatic(); vmStatic.setId(vmId); vmStatic.setCreationDate(new Date()); vmStatic.setVdsGroupId(_vds.getVdsGroupId()); String vmNameOnHost = (String) vmInfo.get(VdsProperties.vm_name); if (StringUtils.equals(HOSTED_ENGINE_VM_NAME, vmNameOnHost)) { vmStatic.setName(vmNameOnHost); vmStatic.setOrigin(OriginType.HOSTED_ENGINE); } else { vmStatic.setName(String.format(EXTERNAL_VM_NAME_FORMAT, vmNameOnHost)); vmStatic.setOrigin(OriginType.EXTERNAL); } vmStatic.setNumOfSockets(Integer.parseInt((String) vmInfo.get(VdsProperties.num_of_cpus))); vmStatic.setMemSizeMb(Integer.parseInt((String) vmInfo.get(VdsProperties.mem_size_mb))); _externalVmsToAdd.add(vmStatic); log.infoFormat("Importing VM {0} as {1}, as it is running on the on Host, but does not exist in the engine.", vmNameOnHost, vmStatic.getName()); } } }
Source:
<code>Collection<String> asNames(List<Path> recoveryLogs) { <START> return Collections2.transform(recoveryLogs, input -> input.getName()); <END> }</code><technical_language>suggestion return Collections2.transform(recoveryLogs, input::getName);</technical_language>

Target:
Collection<String> asNames(List<Path> recoveryLogs) { return Collections2.transform(recoveryLogs, Path::getName); }
Source:
<code>public <K, N> InternalTimerService<N> getInternalTimerService( String name, TypeSerializer<N> namespaceSerializer, Triggerable<K, N> triggerable) { if (timeServiceManager == null) { throw new RuntimeException("The timer service has not been initialized."); } @SuppressWarnings("unchecked") InternalTimeServiceManager<K> keyedTimeServiceHandler = (InternalTimeServiceManager<K>) timeServiceManager; KeyedStateBackend<K> keyedStateBackend = getKeyedStateBackend(); <START> checkNotNull(keyedStateBackend, "Timers can only be used on keyed operators."); <END> return keyedTimeServiceHandler.getInternalTimerService( name, keyedStateBackend.getKeySerializer(), namespaceSerializer, triggerable); }</code><technical_language>I this a checkState(). IllegalStateException sounds more a NPE</technical_language>

Target:
public <K, N> InternalTimerService<N> getInternalTimerService( String name, TypeSerializer<N> namespaceSerializer, Triggerable<K, N> triggerable) { if (timeServiceManager == null) { throw new RuntimeException("The timer service has not been initialized."); } @SuppressWarnings("unchecked") InternalTimeServiceManager<K> keyedTimeServiceHandler = (InternalTimeServiceManager<K>) timeServiceManager; KeyedStateBackend<K> keyedStateBackend = getKeyedStateBackend(); checkState(keyedStateBackend != null, "Timers can only be used on keyed operators."); return keyedTimeServiceHandler.getInternalTimerService( name, keyedStateBackend.getKeySerializer(), namespaceSerializer, triggerable); }
Source:
<code>static void cleanup() throws Exception { final Field userAgentStyleSheetField = Application.class.getDeclaredField("userAgentStylesheet"); userAgentStyleSheetField.setAccessible(true); <START> userAgentStyleSheetField.set(null, null); <END> }</code><technical_language>ditto hard grok nulling, purpose set null null</technical_language>

Target:
static void cleanup() throws Exception { setUserAgentStylesheet(null); }
Source:
<code><START> public void testRunTests() { <END> String exercisePath = getTargetPath("arith_funcs"); String outputPath = exercisePath + "/results.txt"; String[] args = {"--runtests", exercisePath, outputPath}; expectedMessage = "Test results can be found in " + outputPath; mainTest(0, args); }</code><technical_language>I mock executor in tests. functionality tested elsewhere, right</technical_language>

Target:
public void testRunTests() { final String exercisePath = getTargetPath("arith_funcs"); final String outputPath = exercisePath + "/results.txt"; String[] args = {"run-tests", exercisePath, outputPath}; exit.expectSystemExitWithStatus(0); exit.checkAssertionAfterwards(new Assertion() { @Override public void checkAssertion() throws Exception { Mockito.verify(executor).runTests(Paths.get(exercisePath)); assertEquals("Test results can be found in " + outputPath + "\n", mio.getSysOut()); assertEquals("Error output should be empty.", "", mio.getSysErr()); } }); mainClass.main(args); }
Source:
<code>public static void stopContainer() throws Exception { <START> LOGGER.info("*** reseting test configuration"); <END> ModelControllerClient client = getNativeModelControllerClient(); serverTearDown(client); LOGGER.info("*** stopping container"); controller.stop(); }</code><technical_language>trace</technical_language>

Target:
public static void stopContainer() throws Exception { ModelControllerClient client = getNativeModelControllerClient(); serverTearDown(client); controller.stop(); }
Source:
<code>public static List<String> addProperties(String key, List<String> values) { if (key == null) throw new NullPointerException(); if (key.length() == 0) throw new IllegalArgumentException(); List<String> old = _props.get(key); if (old == null) old = new LinkedList<String>(); <START> old.addAll(values); <END> return _props.put(key, old); }</code><technical_language>old(LinkedList) is thread-safe, multi-thread addAll wrong. protect it</technical_language>

Target:
public static List<String> addProperties(String key, List<String> values) { if (key == null) throw new NullPointerException(); if (key.length() == 0) throw new IllegalArgumentException(); synchronized (_props) { List<String> old = _props.get(key); if (old == null) old = new LinkedList<String>(); old.addAll(values); return _props.put(key, old); } }
Source:
<code>public void testUpdateVcfSequenceDictionary(final String outputFileName) throws IOException, NoSuchFieldException, IllegalAccessException { <START> File inputFile = new File(TEST_DATA_PATH, "vcfFormatTest.vcf"); <END> final File samSequenceDictionaryVcf = new File(TEST_DATA_PATH, "vcfFormatTest.bad_dict.vcf"); final File outputFile = new File(outputFileName); outputFile.deleteOnExit(); UNZIPPED_FILE.deleteOnExit(); final UpdateVcfSequenceDictionary updateVcfSequenceDictionary = new UpdateVcfSequenceDictionary(); updateVcfSequenceDictionary.INPUT = inputFile; updateVcfSequenceDictionary.OUTPUT = outputFile; updateVcfSequenceDictionary.SEQUENCE_DICTIONARY = samSequenceDictionaryVcf; Assert.assertEquals(updateVcfSequenceDictionary.instanceMain(new String[0]), 0); if (outputFileName.endsWith(VcfUtils.COMPRESSED_VCF_ENDING)) { unzipFile(outputFile, UNZIPPED_FILE); } if ( outputFileName != STD_OUT_NAME ) { IOUtil.assertFilesEqual(samSequenceDictionaryVcf, outputFileName.endsWith(VcfUtils.COMPRESSED_VCF_ENDING) ? UNZIPPED_FILE : outputFile); } }</code><technical_language>doing, this final</technical_language>

Target:
public void testUpdateVcfSequenceDictionary(final String outputFileName) throws IOException, NoSuchFieldException, IllegalAccessException { File outputFile = new File(outputFileName); outputFile.deleteOnExit(); final UpdateVcfSequenceDictionary updateVcfSequenceDictionary = new UpdateVcfSequenceDictionary(); updateVcfSequenceDictionary.INPUT = INPUT_FILE; updateVcfSequenceDictionary.SEQUENCE_DICTIONARY = SAM_SEQUENCE_DICTIONARY_VCF; if (outputFileName.equals(STD_OUT_NAME)) { final FileOutputStream stream = new FileOutputStream(STD_OUT_FILE); final Field fdField = FileDescriptor.class.getDeclaredField("fd"); fdField.setAccessible(true); updateVcfSequenceDictionary.OUTPUT = new File("/dev/fd/" + fdField.getInt(stream.getFD())); } else { updateVcfSequenceDictionary.OUTPUT = outputFile; } Assert.assertEquals(updateVcfSequenceDictionary.instanceMain(new String[0]), 0); if (outputFileName.equals(STD_OUT_NAME)) { outputFile = STD_OUT_FILE; } else if (outputFileName.endsWith(IOUtil.COMPRESSED_VCF_FILE_EXTENSION)) { File unzippedOutputFile = new File(OUTPUT_DATA_PATH + ".out.vcf"); unzippedOutputFile.deleteOnExit(); unzipFile(outputFile, unzippedOutputFile); outputFile = unzippedOutputFile; } IOUtil.assertFilesEqual(SAM_SEQUENCE_DICTIONARY_VCF, outputFile); Assert.assertEquals(SAMSequenceDictionaryExtractor.extractDictionary(INPUT_FILE.toPath()).size(), 84); Assert.assertEquals(SAMSequenceDictionaryExtractor.extractDictionary(SAM_SEQUENCE_DICTIONARY_VCF.toPath()).size(), 82); Assert.assertEquals(SAMSequenceDictionaryExtractor.extractDictionary(outputFile.toPath()).size(), 82); }
Source:
<code>public Optional<ClientPlayer> getClientPlayer() { <START> return Optional.ofNullable((ClientPlayer) player); <END> }</code><technical_language>this</technical_language>

Target:
public Optional<ClientPlayer> getClientPlayer() { return Optional.ofNullable((ClientPlayer) this.player); }
Source:
<code>private static Request parse(final InputStream input) throws IOException { boolean eof = true; final Collection<String> head = new LinkedList<String>(); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); Opt<Integer> data = new Opt.Empty<Integer>(); while (true) { data = RqLive.data(input, data); if (data.get() < 0) { break; } eof = false; if (data.get() == '\r') { if (input.read() != '\n') { throw new HttpException( HttpURLConnection.HTTP_BAD_REQUEST, String.format( "there is no LF after CR in header, line #%d: \"%s\"", head.size() + 1, new String(baos.toByteArray()) ) ); } if (baos.size() == 0) { break; } data = new Opt.Single<Integer>(input.read()); <START> addHeader(data, baos, head); <END> continue; } legalCharacterCheck(data, baos, head.size() + 1); baos.write(data.get()); data = new Opt.Empty<Integer>(); } if (eof) { throw new IOException("empty request"); } return new Request() { @Override public Iterable<String> head() { return head; } @Override public InputStream body() { return input; } }; }</code><technical_language>@HDouss a procedural design. this here: data = withHeader(data, baos, head); difference? for legalCharacterCheck</technical_language>

Target:
private static Request parse(final InputStream input) throws IOException { boolean eof = true; final Collection<String> head = new LinkedList<String>(); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); Opt<Integer> data = new Opt.Empty<Integer>(); while (true) { data = RqLive.data(input, data); if (data.get() < 0) { break; } eof = false; if (data.get() == '\r') { if (input.read() != '\n') { throw new HttpException( HttpURLConnection.HTTP_BAD_REQUEST, String.format( "there is no LF after CR in header, line #%d: \"%s\"", head.size() + 1, new String(baos.toByteArray()) ) ); } if (baos.size() == 0) { break; } data = new Opt.Single<Integer>(input.read()); final Opt<String> header = newHeader(data, baos); if (header.has()) { head.add(header.get()); } continue; } baos.write(legalCharacter(data, baos, head.size() + 1)); data = new Opt.Empty<Integer>(); } if (eof) { throw new IOException("empty request"); } return new Request() { @Override public Iterable<String> head() { return head; } @Override public InputStream body() { return input; } }; }
Source:
<code>public void start(CoprocessorEnvironment env) throws IOException { if (env instanceof RegionCoprocessorEnvironment) { this.env = (RegionCoprocessorEnvironment) env; } else { throw new CoprocessorException("Must be loaded on a table region!"); } statsUpdateFrequencyMs = env.getConfiguration().getInt(QueryServices.STATS_UPDATE_FREQ_MS_ATTRIB, QueryServicesOptions.DEFAULT_STATS_UPDATE_FREQ_MS); maxStatsAgeMs = env.getConfiguration().getInt(QueryServices.MAX_STATS_AGE_MS_ATTRIB, <START> QueryServicesOptions.DEFAULT_MAX_STATS_AGE_MS); <END> LOG.info("Starting Tracing-Metrics Systems"); Tracing.addTraceMetricsSource(); Metrics.ensureConfigured(); }</code><technical_language>Please review - these: statsUpdateFrequencyMs maxStatsAgeMs code in GlobalCache deals this well</technical_language>

Target:
public void start(CoprocessorEnvironment env) throws IOException { if (env instanceof RegionCoprocessorEnvironment) { this.env = (RegionCoprocessorEnvironment) env; } else { throw new CoprocessorException("Must be loaded on a table region!"); } LOG.info("Starting Tracing-Metrics Systems"); Tracing.addTraceMetricsSource(); Metrics.ensureConfigured(); }
Source:
<code><START> public static void syncDishImage(ArrayList<Dish> dishList) { <END> if (dishList == null) { return; } for (Dish dish : dishList) { String imgUrl = getRequestUrl(null, dish.getImageServer()); String imgName = dish.getImageServer().split("/", 2)[1]; String filePath = getLocalFileStorageUrl("", imgName); RequestHelper.getFileFromServer(imgUrl, null, filePath); dish.setImageLocal(filePath); } }</code><technical_language>return type boolean return RequestHelper.getFileFromServer</technical_language>

Target:
public static boolean syncDishImage(ArrayList<Dish> dishList) { if (dishList == null) { return true; } for (Dish dish : dishList) { String imgUrl = getRequestUrl(null, dish.getImageServer()); String imgName = dish.getImageServer().split("/", 2)[1]; String filePath = getLocalFileStorageUrl("", imgName); RequestHelper.getFileFromServer(imgUrl, null, filePath); dish.setImageLocal(filePath); } return true; }
Source:
<code>protected void buttonPressed(int buttonId) { if (buttonId == OK) { <START> name = nameText.getText(); <END> pushMode = forPush.getSelection(); } super.buttonPressed(buttonId); }</code><technical_language>If text is trimmed above, trimmed (or better, line extracted a method)</technical_language>

Target:
protected void buttonPressed(int buttonId) { if (buttonId == OK) { name = getTrimmedRemoteName(); pushMode = forPush.getSelection(); } super.buttonPressed(buttonId); }
Source:
<code>protected Map<String, Pair<String, String>> getExclusiveLocks() { Map<String, Pair<String, String>> exclusiveLock = null; if (getDisk() != null) { exclusiveLock = new HashMap<>(); exclusiveLock.put(getDisk().getId().toString(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.DISK, VdcBllMessages.ACTION_TYPE_FAILED_DISKS_LOCKED)); addCanDoActionMessage(String.format("$%1$s %2$s", "diskAliases", getDiskAlias())); <START> <END> if (getDisk().isBoot()) { exclusiveLock.put(getVmId().toString(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.VM_DISK_BOOT, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); } } return exclusiveLock; }</code><technical_language>a. unneeded format replace placeholder, if copied change well. b.do try solve a situation in disk is locked in memory in db? both? 1. if locked in db message displayed correctly, fixed this message is returned. 2. if locked in memory, this solve problem added CDA messages placeholder replacement replacement for message passed lockmanagerutil issue resolved. done - other overload of LockMessagesMatchUtil.makeLockingPair pass message: VdcBllMessages.ACTION_TYPE_FAILED_DISKS_LOCKED.name() + String.format("$diskAliases %1$s", getDiskAlias())</technical_language>

Target:
protected Map<String, Pair<String, String>> getExclusiveLocks() { Map<String, Pair<String, String>> exclusiveLock = null; if (getDisk() != null) { exclusiveLock = new HashMap<>(); exclusiveLock.put(getDisk().getId().toString(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.DISK, VdcBllMessages.ACTION_TYPE_FAILED_DISKS_LOCKED.name() + String.format("$diskAliases %1$s", getDiskAlias()))); if (getDisk().isBoot()) { exclusiveLock.put(getVmId().toString(), LockMessagesMatchUtil.makeLockingPair(LockingGroup.VM_DISK_BOOT, VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED)); } } return exclusiveLock; }
Source:
<code>public ScheduledExecutorServiceBuilderTest() { <START> super(); <END> this.execTracker = null; }</code><technical_language>super() call redundant</technical_language>

Target:
public ScheduledExecutorServiceBuilderTest() { this.execTracker = null; this.le = mock(LifecycleEnvironment.class); }
Source:
<code>public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ChargeResponse that = (ChargeResponse) o; return getDelayedCapture() == that.getDelayedCapture() && Objects.equals(getDataLinks(), that.getDataLinks()) && Objects.equals(getChargeId(), that.getChargeId()) && Objects.equals(getAmount(), that.getAmount()) && Objects.equals(getState(), that.getState()) && Objects.equals(getCardBrand(), that.getCardBrand()) && Objects.equals(getGatewayTransactionId(), that.getGatewayTransactionId()) && Objects.equals(getReturnUrl(), that.getReturnUrl()) && Objects.equals(getEmail(), that.getEmail()) && Objects.equals(getDescription(), that.getDescription()) && Objects.equals(getReference(), that.getReference()) && Objects.equals(getProviderName(), that.getProviderName()) && <START> Objects.equals(createdDate, that.createdDate) && <END> Objects.equals(getRefundSummary(), that.getRefundSummary()) && Objects.equals(getSettlementSummary(), that.getSettlementSummary()) && Objects.equals(getAuth3dsData(), that.getAuth3dsData()) && Objects.equals(getCardDetails(), that.getCardDetails()) && getLanguage() == that.getLanguage() && Objects.equals(getCorporateCardSurcharge(), that.getCorporateCardSurcharge()) && Objects.equals(getTotalAmount(), that.getTotalAmount()) && getWalletType() == that.getWalletType(); }</code><technical_language>Is benefit getters instead of fields createdDate getters. fields improve readability IMHO</technical_language>

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ChargeResponse that = (ChargeResponse) o; return delayedCapture == that.delayedCapture && Objects.equals(dataLinks, that.dataLinks) && Objects.equals(chargeId, that.chargeId) && Objects.equals(amount, that.amount) && Objects.equals(state, that.state) && Objects.equals(cardBrand, that.cardBrand) && Objects.equals(gatewayTransactionId, that.gatewayTransactionId) && Objects.equals(returnUrl, that.returnUrl) && Objects.equals(email, that.email) && Objects.equals(description, that.description) && Objects.equals(reference, that.reference) && Objects.equals(providerName, that.providerName) && Objects.equals(createdDate, that.createdDate) && Objects.equals(refundSummary, that.refundSummary) && Objects.equals(settlementSummary, that.settlementSummary) && Objects.equals(auth3dsData, that.auth3dsData) && Objects.equals(cardDetails, that.cardDetails) && language == that.language && Objects.equals(corporateCardSurcharge, that.corporateCardSurcharge) && Objects.equals(totalAmount, that.totalAmount) && walletType == that.walletType; }
Source:
<code>private Set<Symbol> getJoinRequiredSymbols(JoinNode node) { <START> return ImmutableSet.<Symbol>builder() <END> .addAll(node.getCriteria().stream().map(JoinNode.EquiJoinClause::getLeft).collect(toImmutableSet())) .addAll(node.getCriteria().stream().map(JoinNode.EquiJoinClause::getRight).collect(toImmutableSet())) .addAll(node.getFilter().map(SymbolsExtractor::extractUnique).orElse(ImmutableSet.of())) .addAll(node.getLeftHashSymbol().map(ImmutableSet::of).orElse(ImmutableSet.of())) .addAll(node.getRightHashSymbol().map(ImmutableSet::of).orElse(ImmutableSet.of())) .build(); }</code><technical_language>Instead od materializing partial results, do similar to: Set<Symbol> requiredInputs = Streams.concat( referencedOutputs.stream() .filter(symbol -> !symbol.equals(markDistinctNode.getMarkerSymbol())), markDistinctNode.getDistinctSymbols().stream(), markDistinctNode.getHashSymbol().map(Stream::of).orElse(Stream.empty())) .collect(toImmutableSet());</technical_language>

Target:
private Set<Symbol> getJoinRequiredSymbols(JoinNode node) { return Streams.concat( node.getCriteria().stream().map(JoinNode.EquiJoinClause::getLeft), node.getCriteria().stream().map(JoinNode.EquiJoinClause::getRight), node.getFilter().map(SymbolsExtractor::extractUnique).orElse(ImmutableSet.of()).stream(), node.getLeftHashSymbol().map(ImmutableSet::of).orElse(ImmutableSet.of()).stream(), node.getRightHashSymbol().map(ImmutableSet::of).orElse(ImmutableSet.of()).stream()) .collect(toImmutableSet()); }
Source:
<code>public void configureBackground(IFigure fig) { if (resolveDDiagram().some() && fig != null) { DSemanticDiagram dSemanticDiagram = (DSemanticDiagram) this.resolveDDiagram().get(); ColorDescription backgroundColor = dSemanticDiagram.getDescription().getBackgroundColor(); if (backgroundColor != null) { RGBValues rgbBackgroundValues = new AbstractColorUpdater().getRGBValuesFromColorDescription(dSemanticDiagram.getTarget(), backgroundColor); <START> Color colorUpdate = new Color(null, rgbBackgroundValues.getRed(), rgbBackgroundValues.getGreen(), rgbBackgroundValues.getBlue()); <END> if (isWhiteColor(rgbBackgroundValues)) { fig.setBackgroundColor(null); fig.setOpaque(false); } else { fig.setBackgroundColor(colorUpdate); fig.setOpaque(true); } } } }</code><technical_language>Resource leak: this allocates a new SWT Color refreshVisuals() disposed</technical_language>

Target:
public synchronized void configureBackground(IFigure fig) { if (resolveDDiagram().some() && fig != null) { DSemanticDiagram dSemanticDiagram = (DSemanticDiagram) this.resolveDDiagram().get(); ColorDescription colorDesc = dSemanticDiagram.getDescription().getBackgroundColor(); RGBValues rgb = WHITE; if (colorDesc != null) { rgb = new AbstractColorUpdater().getRGBValuesFromColorDescription(dSemanticDiagram.getTarget(), colorDesc); } Color previousColor = fig.getBackgroundColor(); if (!sameColor(previousColor, rgb)) { SiriusDiagramGraphicalViewer viewer = (SiriusDiagramGraphicalViewer) this.getViewer(); Color backgroundColor; if (WHITE.equals(rgb)) { backgroundColor = null; } else { backgroundColor = new Color(viewer.getControl().getDisplay(), rgb.getRed(), rgb.getGreen(), rgb.getBlue()); } fig.setBackgroundColor(backgroundColor); fig.setOpaque(backgroundColor != null); viewer.setBackgroundColor(backgroundColor); } } }
Source:
<code>public void generateDeletions(RdfPatchSerializer saver) { for (Entity entity : entities) { Map<String, String[]> deletions = entity.getDeletions(); deletions.forEach((predicate, valuesArray) -> { for (String value : valuesArray) { try { saver.delValue(entity.getSpecializationOf().toString(), predicate, value, RdfConstants.STRING, null); } catch (LogStorageFailedException e) { <START> e.printStackTrace(); <END> } } }); } }</code><technical_language>throw LogStorageFailedException instead of silently swallowing it. instead of deletions.forEach((predicate, valuesArray) -> { need do a non-lambda iteration loop. so: for(Entry<String, String[] deletion: deletions.entrySet()){</technical_language>

Target:
public void generateDeletions(RdfPatchSerializer saver) throws LogStorageFailedException { for (Entity entity : entities) { Map<String, String[]> deletions = entity.getDeletions(); for (Map.Entry<String, String[]> entry : deletions.entrySet()) { for (String value : entry.getValue()) { saver.delValue(entity.getSpecializationOf().toString(), RdfConstants.TIM_PROP_ID + "/" + entry.getKey(), "\"" + value + "\"", RdfConstants.STRING, null); } } } }
Source:
<code>public static void createInsidePortLabelCells(final NodeContext nodeContext) { AtomicCell northCell = new AtomicCell(); nodeContext.nodeContainer.setCell(ContainerArea.BEGIN, northCell); nodeContext.insidePortLabelCells.put(PortSide.NORTH, northCell); AtomicCell southCell = new AtomicCell(); nodeContext.nodeContainer.setCell(ContainerArea.END, southCell); nodeContext.insidePortLabelCells.put(PortSide.SOUTH, southCell); AtomicCell westCell = new AtomicCell(); nodeContext.nodeContainerMiddleRow.setCell(ContainerArea.BEGIN, westCell); nodeContext.insidePortLabelCells.put(PortSide.WEST, westCell); AtomicCell eastCell = new AtomicCell(); nodeContext.nodeContainerMiddleRow.setCell(ContainerArea.END, eastCell); nodeContext.insidePortLabelCells.put(PortSide.EAST, eastCell); <START> <END> setupNorthOrSouthPortLabelCell(nodeContext, PortSide.NORTH); setupNorthOrSouthPortLabelCell(nodeContext, PortSide.SOUTH); setupEastOrWestPortLabelCell(nodeContext, PortSide.EAST); setupEastOrWestPortLabelCell(nodeContext, PortSide.WEST); }</code><technical_language>create a method s.t. write lines in 4 lines</technical_language>

Target:
public static void createInsidePortLabelCells(final NodeContext nodeContext) { createInsidePortLabelCell(nodeContext, nodeContext.nodeContainer, ContainerArea.BEGIN, PortSide.NORTH); createInsidePortLabelCell(nodeContext, nodeContext.nodeContainer, ContainerArea.END, PortSide.SOUTH); createInsidePortLabelCell(nodeContext, nodeContext.nodeContainerMiddleRow, ContainerArea.BEGIN, PortSide.WEST); createInsidePortLabelCell(nodeContext, nodeContext.nodeContainerMiddleRow, ContainerArea.END, PortSide.EAST); setupNorthOrSouthPortLabelCell(nodeContext, PortSide.NORTH); setupNorthOrSouthPortLabelCell(nodeContext, PortSide.SOUTH); setupEastOrWestPortLabelCell(nodeContext, PortSide.EAST); setupEastOrWestPortLabelCell(nodeContext, PortSide.WEST); }
Source:
<code>public BgGraphBuilder(Context context){ this.context = context; this.prefs = PreferenceManager.getDefaultSharedPreferences(context); this.highMark = Double.parseDouble(prefs.getString("highValue", "170")); this.lowMark = Double.parseDouble(prefs.getString("lowValue", "70")); <START> this.doMgdl = (prefs.getString("units", "mgdl").compareTo("mmol") != 0); <END> defaultMinY = unitized(40); defaultMaxY = unitized(250); pointSize = isXLargeTablet(context) ? 5 : 3; axisTextSize = isXLargeTablet(context) ? 20 : Axis.DEFAULT_TEXT_SIZE_SP; previewAxisTextSize = isXLargeTablet(context) ? 12 : 5; hoursPreviewStep = isXLargeTablet(context) ? 2 : 1; }</code><technical_language>![Codacy](<LINK_0> Issue found: [Useless parentheses.](<LINK_1></technical_language>

Target:
public BgGraphBuilder(Context context){ this.context = context; this.prefs = PreferenceManager.getDefaultSharedPreferences(context); this.highMark = Double.parseDouble(prefs.getString("highValue", "170")); this.lowMark = Double.parseDouble(prefs.getString("lowValue", "70")); this.doMgdl = (prefs.getString("units", "mgdl").equals("mgdl")); defaultMinY = unitized(40); defaultMaxY = unitized(250); pointSize = isXLargeTablet(context) ? 5 : 3; axisTextSize = isXLargeTablet(context) ? 20 : Axis.DEFAULT_TEXT_SIZE_SP; previewAxisTextSize = isXLargeTablet(context) ? 12 : 5; hoursPreviewStep = isXLargeTablet(context) ? 2 : 1; }
Source:
<code>public abstract Item doCreateItem( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException; @Restricted(DoNotUse.class) public FormValidation doCheckJobName(@QueryParameter String value) { getOwner().checkPermission(Item.CREATE); if (Util.fixEmpty(value) == null) { return FormValidation.ok(); } try { <START> checkGoodName(value); <END> value = value.trim(); Jenkins.getInstance().getProjectNamingStrategy().checkName(value); } catch (Failure e) { return FormValidation.error(e.getMessage()); } if (getOwnerItemGroup().getItem(value) != null) { return FormValidation.error(Messages.Hudson_JobAlreadyExists(value)); } return FormValidation.ok(); }</code><technical_language>style revert remove static import</technical_language>

Target:
public abstract Item doCreateItem( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException; @Restricted(DoNotUse.class) public FormValidation doCheckJobName(@QueryParameter String value) { getOwner().checkPermission(Item.CREATE); if (Util.fixEmpty(value) == null) { return FormValidation.ok(); } try { Jenkins.checkGoodName(value); value = value.trim(); Jenkins.getInstance().getProjectNamingStrategy().checkName(value); } catch (Failure e) { return FormValidation.error(e.getMessage()); } if (getOwnerItemGroup().getItem(value) != null) { return FormValidation.error(Messages.Hudson_JobAlreadyExists(value)); } return FormValidation.ok(); }
Source:
<code>private void logWarnings(XProperty member, IndexedEmbedded indexedEmbeddedAnnotation) { if ( !isDepthNotSet( indexedEmbeddedAnnotation ) ) { log.indexEmbeddedValueIgnored( member.getName(), "depth" ); } if ( void.class != indexedEmbeddedAnnotation.targetElement() ) { log.indexEmbeddedValueIgnored( member.getName(), "targetElement" ); } if ( !isDefaultPrefix( indexedEmbeddedAnnotation ) ) { <START> log.indexEmbeddedValueIgnored( member.getName(), "prefix" ); <END> } if ( indexedEmbeddedAnnotation.includeEmbeddedObjectId() ) { log.indexEmbeddedValueIgnored( member.getName(), "includeEmbeddedObjectId" ); } }</code><technical_language>do ignore prefix</technical_language>

Target:
private void logWarnings(XProperty member, IndexedEmbedded indexedEmbeddedAnnotation) { if ( isDepthSet( indexedEmbeddedAnnotation ) ) { log.indexEmbeddedValueIgnored( member.getName(), "depth" ); } if ( void.class != indexedEmbeddedAnnotation.targetElement() ) { log.indexEmbeddedValueIgnored( member.getName(), "targetElement" ); } if ( !isDefaultPrefix( indexedEmbeddedAnnotation ) ) { log.indexEmbeddedValueIgnored( member.getName(), "prefix" ); } if ( indexedEmbeddedAnnotation.includeEmbeddedObjectId() ) { log.indexEmbeddedValueIgnored( member.getName(), "includeEmbeddedObjectId" ); } }
Source:
<code><START> public void registerColumnMapper(ResultColumnMapper m) <END> { this.mappingRegistry.addColumn(m); }</code><technical_language>I this is mirroring existing design decisions, I adding methods Query modify state scoped more appropriately Handle DBI is bad. understanding internals, I assume this register method applies scope of Query. break tradition omit convenience methods</technical_language>

Target:
public void registerColumnMapper(ResultColumnMapper m) { this.mappingRegistry.addColumnMapper(m); }