auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void initNodeCommand(SensorContext context, File scriptFile) throws IOException { nodeCommandBuilder .outputConsumer(message -> { if (message.startsWith("DEBUG")) { LOG.debug(message.substring(5).trim()); } else { LOG.info(message); } }) .minNodeVersion(8) .configuration(context.config()) .script(scriptFile.getAbsolutePath()) .scriptArgs(String.valueOf(port)); context.config() .getInt(MAX_OLD_SPACE_SIZE_PROPERTY) .ifPresent(nodeCommandBuilder::maxOldSpaceSize); Optional<Path> typeScriptLocation = getTypeScriptLocation(context); if (typeScriptLocation.isPresent()) { LOG.debug("Using TypeScript at: '{}'", typeScriptLocation.get()); nodeCommandBuilder.addToNodePath(typeScriptLocation.get().toAbsolutePath()); } else { <START> LOG.debug("TypeScript dependency was not found, TypeScript analysis might fail."); <END> } nodeCommand = nodeCommandBuilder.build(); }</code><technical_language>absolutely explicit TypeScript dependency project directory, TypeScript looked based NODE_PATH; if NODE_PATH reference directory TypeScript, analysis fail</technical_language>

Target:
private void initNodeCommand(SensorContext context, File scriptFile) throws IOException { nodeCommandBuilder .outputConsumer(message -> { if (message.startsWith("DEBUG")) { LOG.debug(message.substring(5).trim()); } else { LOG.info(message); } }) .minNodeVersion(8) .configuration(context.config()) .script(scriptFile.getAbsolutePath()) .scriptArgs(String.valueOf(port)); context.config() .getInt(MAX_OLD_SPACE_SIZE_PROPERTY) .ifPresent(nodeCommandBuilder::maxOldSpaceSize); if (shouldDetectTypeScript(context.fileSystem())) { Optional<Path> typeScriptLocation = getTypeScriptLocation(context.fileSystem().baseDir()); if (typeScriptLocation.isPresent()) { LOG.info("Using TypeScript at: '{}'", typeScriptLocation.get()); nodeCommandBuilder.addToNodePath(typeScriptLocation.get().toAbsolutePath()); } else { LOG.info("TypeScript dependency was not found inside project directory, NodeJs will search TypeScript using " + "module resolution algorithm; analysis will fail without TypeScript."); } } nodeCommand = nodeCommandBuilder.build(); }
Source:
<code>public void reset(URL url) { server.reset(url); try { if (url.hasParameter(Constants.HEARTBEAT_KEY) || url.hasParameter(Constants.HEARTBEAT_TIMEOUT_KEY)) { <START> int h = url.getParameter(Constants.HEARTBEAT_KEY, heartbeat); <END> int t = url.getParameter(Constants.HEARTBEAT_TIMEOUT_KEY, h * 3); if (t < h * 2) { throw new IllegalStateException("idleTimeout < heartbeatInterval * 2"); } if (h != heartbeat || t != idleTimeout) { heartbeat = h; idleTimeout = t; stopIdleCheckTimer(); startIdleCheckTimer(); } } } catch (Throwable t) { logger.error(t.getMessage(), t); } }</code><technical_language>**h** rename **urlHeartBeatKey** do say</technical_language>

Target:
public void reset(URL url) { server.reset(url); try { if (url.hasParameter(Constants.HEARTBEAT_KEY) || url.hasParameter(Constants.HEARTBEAT_TIMEOUT_KEY)) { int h = url.getParameter(Constants.HEARTBEAT_KEY, heartbeat); int t = url.getParameter(Constants.HEARTBEAT_TIMEOUT_KEY, h * 3); if (t < h * 2) { throw new IllegalStateException("idleTimeout < heartbeatInterval * 2"); } if (h != heartbeat || t != idleTimeout) { heartbeat = h; idleTimeout = t; startIdleCheckTask(); } } } catch (Throwable t) { logger.error(t.getMessage(), t); } }
Source:
<code>public void destroyResources() { if (eurekaConnCleaner != null) { <START> eurekaConnCleaner.shutdown(); <END> } if (apacheHttpClient != null) { apacheHttpClient.close(); } }</code><technical_language>In existing code connCleaner is called time is shutdown. Do want replicate too</technical_language>

Target:
public void destroyResources() { if (eurekaConnCleaner != null) { eurekaConnCleaner.execute(connectionCleanerTask); eurekaConnCleaner.shutdown(); } if (apacheHttpClient != null) { apacheHttpClient.close(); } }
Source:
<code>protected void beforeExecute(Thread t, Runnable r) { super.beforeExecute(t, r); mPauseLock.lock(); try { mNumPaused++; while (mIsPaused) { mUnpaused.await(); } <START> mNumPaused--; <END> } catch (InterruptedException e) { t.interrupt(); } finally { mPauseLock.unlock(); } }</code><technical_language>this in finally block</technical_language>

Target:
protected void beforeExecute(Thread t, Runnable r) { super.beforeExecute(t, r); mPauseLock.lock(); try { mNumPaused++; while (mIsPaused) { mUnpaused.await(); } } catch (InterruptedException e) { t.interrupt(); } finally { mNumPaused--; mPauseLock.unlock(); } }
Source:
<code>BitMappedTrie<T> append(T trailing) { final int newSize = length() + 1; if (length() == 0) { <START> return new BitMappedTrie<>(asArray(trailing), offset, newSize, depthShift); <END> } else { Object[] array = this.array; int shift = depthShift; if (isFullRight(newSize)) { array = asArray(array); shift += BRANCHING_BASE; } array = modifyLeaf(array, shift, offset + length(), COPY_LEAF, updateLeafWith(trailing)); return new BitMappedTrie<>(array, offset, newSize, shift); } }</code><technical_language>while reading asArray(element) I a question in mind (without knowing talking I time read enough): Is allocate array (of size 32) 'slots'? safe array copy operations modifying trie</technical_language>

Target:
BitMappedTrie<T> append(T trailing) { final int newSize = length() + 1; if (length() == 0) { return new BitMappedTrie<>(asArray(trailing), offset, newSize, depthShift); } else { Object[] array = this.array; int shift = depthShift; if (isFullRight(newSize)) { array = asArray(array); shift += BRANCHING_BASE; } array = modifyLeaf(array, shift, offset + length(), copyLeaf, updateLeafWith(trailing)); return new BitMappedTrie<>(array, offset, newSize, shift); } }
Source:
<code>public List<IActivity> process(List<IActivity> activities) { if (queueRessources.isEmpty()) return activities; final List<IActivity> activitiesToExecute = new LinkedList<IActivity>(); for (IActivity activity : queueActivities) { if (isAvailable(activity)) <START> activitiesToExecute.add(activity); <END> else break; } for (IActivity activity : activities) { if (isAvailable(activity)) activitiesToExecute.add(activity); else queueActivities.add(activity); } return activitiesToExecute; }</code><technical_language>Subsequently remove activity queueActivities</technical_language>

Target:
public synchronized List<IActivity> process(List<IActivity> activities) { if (unavailableResources.isEmpty() && activityQueue.isEmpty()) { return activities; } List<IActivity> returnList = new LinkedList<>(); Set<SPath> resourcesInQueue = new HashSet<>(); processQueued(returnList, resourcesInQueue); processNew(returnList, resourcesInQueue, activities); return returnList; }
Source:
<code>public void startWork() throws InterruptedException { HandleSet handleSet = new HandleSet(); ConcreteEventHandler concreteEventHandler = new ConcreteEventHandler(); Worker worker = new Worker(handleSet, workers, 1, this, concreteEventHandler); Worker worker2 = new Worker(handleSet, workers, 2, this, concreteEventHandler); Worker worker3 = new Worker(handleSet, workers, 3, this, concreteEventHandler); Worker worker4 = new Worker(handleSet, workers, 4, this, concreteEventHandler); workers.add(worker); workers.add(worker2); workers.add(worker3); <START> workers.add(worker4); <END> this.leader = workers.get(0); executorService.submit(worker); executorService.submit(worker2); executorService.submit(worker3); executorService.submit(worker4); Random rand = new Random(1000); handleSet.fireEvent(new Work(Math.abs(rand.nextInt()))); handleSet.fireEvent(new Work(Math.abs(rand.nextInt()))); handleSet.fireEvent(new Work(Math.abs(rand.nextInt()))); handleSet.fireEvent(new Work(Math.abs(rand.nextInt()))); handleSet.fireEvent(new Work(Math.abs(rand.nextInt()))); Thread.sleep(1000); }</code><technical_language>Consider loops (e.g. create add workers, submit workers...)</technical_language>

Target:
public void startWork() throws InterruptedException { int i = 1; HandleSet handleSet = new HandleSet(); ConcreteEventHandler concreteEventHandler = new ConcreteEventHandler(); while (i <= 5) { Worker worker = new Worker(handleSet, workers, i, this, concreteEventHandler); workers.add(worker); i++; } this.leader = workers.get(0); executorService.submit(workers.get(0)); executorService.submit(workers.get(1)); executorService.submit(workers.get(2)); executorService.submit(workers.get(3)); Random rand = new Random(1000); int j = 0; while (j < 4) { handleSet.fireEvent(new Work(Math.abs(rand.nextInt()))); j++; } Thread.sleep(1000); }
Source:
<code>public CreatePassword() { password = System.getProperty("htpasswd.password", ""); username = System.getProperty("htpasswd.username", ""); algorithm = System.getProperty("htpasswd.algorithm", SHA256_ALGORITHM); fileName = System.getProperty("htpasswd.file", ""); <START> created = Boolean.getBoolean("htpasswd.created"); <END> }</code><technical_language>htpasswd.overwrite a more name? IIUC if this is true existing file overwritten, if false a line appended, right</technical_language>

Target:
public CreatePassword() { password = System.getProperty("htpasswd.password", ""); username = System.getProperty("htpasswd.username", ""); algorithm = System.getProperty("htpasswd.algorithm", SHA256_ALGORITHM); fileName = System.getProperty("htpasswd.file", ""); overwrite = Boolean.getBoolean("htpasswd.overwrite"); }
Source:
<code>public static boolean isTestPackageName(@Nullable String packageName) { <START> return packageName != null && packageName.length() > GoConstants.TEST_SUFFIX.length() && packageName.endsWith(GoConstants.TEST_SUFFIX); <END> }</code><technical_language>length checking redundant</technical_language>

Target:
public static boolean isTestPackageName(@Nullable String packageName) { return packageName != null && packageName.endsWith(GoConstants.TEST_SUFFIX); }
Source:
<code>public void registerSpecialPathInfo( SpecialPathInfo pathInfo, final String pkgType ) { <START> for ( Map.Entry<String, SpecialPathSet> entry : pkgtypes.entrySet() ) <END> { if ( pkgType.equals( entry.getKey() ) ) { entry.getValue().registerSpecialPathInfo( pathInfo ); } } }</code><technical_language>do pkgtypes.get(pkgType) here</technical_language>

Target:
public void registerSpecialPathInfo( SpecialPathInfo pathInfo, final String pkgType ) { pkgtypes.get(pkgType).registerSpecialPathInfo( pathInfo ); }
Source:
<code>public void addLogsInfo(long logSize, String logFilename) { LinearLayout logsLl = root.findViewById(R.id.frag_settings_logs_ll); TextView logsDesc1Tv = root.findViewById(R.id.frag_settings_logs_desc1_tv); TextView logsDesc2Tv = root.findViewById(R.id.frag_settings_logs_desc2_tv); logsDesc1Tv.setText(logFilename); <START> logsDesc2Tv.setText("Size: " + logSize + "kB"); <END> logsLl.setOnClickListener(view ->{ Intent i = new Intent(view.getContext() , LogsActivity.class); startActivity(i); }); }</code><technical_language>place this in strings.xml instead</technical_language>

Target:
public void addLogsInfo(long logSize, String logFilename) { LinearLayout logsLl = root.findViewById(R.id.frag_settings_logs_ll); TextView logsDesc1Tv = root.findViewById(R.id.frag_settings_logs_desc1_tv); TextView logsDesc2Tv = root.findViewById(R.id.frag_settings_logs_desc2_tv); logsDesc1Tv.setText(logFilename); logsDesc2Tv.setText(getContext().getString(R.string.settings_frag_size) + logSize + "kB"); logsLl.setOnClickListener(view ->{ Intent i = new Intent(view.getContext() , LogsActivity.class); startActivity(i); }); }
Source:
<code>public void asyncRestTemplateConfig() { AsyncRestTemplate asyncRestTemplate = TestUtils.getPropertyValue( this.asyncRestTemplateConfig, "handler.asyncRestTemplate", AsyncRestTemplate.class); <START> assertEquals(this.asyncRestTemplate, asyncRestTemplate); <END> }</code><technical_language>M-m-m. assertSame() test instance is config</technical_language>

Target:
public void asyncRestTemplateConfig() { AsyncRestTemplate asyncRestTemplate = TestUtils.getPropertyValue( this.asyncRestTemplateConfig, "handler.asyncRestTemplate", AsyncRestTemplate.class); assertSame(this.asyncRestTemplate, asyncRestTemplate); }
Source:
<code>public void testBlockWriting() throws IOException { Attribute.AttributeMap attributes = new Attribute.AttributeMap.DefaultAttributeMap(); attributes.put(DAG.DAGContext.APPLICATION_ID, "PartitionWriterTest"); attributes.put(DAG.DAGContext.APPLICATION_PATH, testMeta.outputPath); testMeta.context = mockOperatorContext(1, attributes); testMeta.underTest.setup(testMeta.context); int index = 0; for (int i = 0; i < FILE_CONTENTS.length; i++) { testMeta.underTest.beginWindow(i); testMeta.underTest.fileMetadataInput.process(testMeta.fileMetadatas.get(i)); for (int j = 0; j < testMeta.fileMetadatas.get(i).getNumberOfBlocks(); j++) { testMeta.underTest.input.process(testMeta.blockDataList.get(index++)); } testMeta.underTest.endWindow(); } testMeta.underTest.committed(2); testMeta.underTest.teardown(); File[] blockFileNames = testMeta.blocksDir.listFiles(); for (File blockFile : blockFileNames) { <START> int fileIndex = Integer.parseInt(blockFile.getName().split("\\.")[0].substring(4)); <END> int blockIndex = Integer.parseInt(blockFile.getName().split("\\.")[1].substring(4)); String expected = testMeta.blockIdToExpectedContent.get(testMeta.fileMetadatas.get(fileIndex).getBlockIds()[blockIndex - 1]); Assert.assertEquals(expected, FileUtils.readFileToString(blockFile)); } }</code><technical_language>If changes number of blocks tested this substring throw arrayIndexOutOfBounds. I extract blockId a class variable do log10(blockId) if extracting prefix in this way. A safer a Regex parse this out</technical_language>

Target:
public void testBlockWriting() throws IOException { Attribute.AttributeMap attributes = new Attribute.AttributeMap.DefaultAttributeMap(); attributes.put(DAG.DAGContext.APPLICATION_ID, "PartitionWriterTest"); attributes.put(DAG.DAGContext.APPLICATION_PATH, testMeta.outputPath); testMeta.context = mockOperatorContext(1, attributes); testMeta.underTest.setup(testMeta.context); for (int fileIndex = 0; fileIndex < FILE_CONTENTS.length; fileIndex++) { testMeta.underTest.beginWindow(fileIndex); testMeta.underTest.fileMetadataInput.process(testMeta.fileMetadatas.get(fileIndex)); for (int blockIndex = 0; blockIndex < testMeta.fileMetadatas.get(fileIndex).getNumberOfBlocks(); blockIndex++) { testMeta.underTest.input.process(testMeta.blockDataList.get(fileIndex).get(blockIndex)); } testMeta.underTest.endWindow(); } testMeta.underTest.committed(2); testMeta.underTest.teardown(); File[] blockFileNames = testMeta.blocksDir.listFiles(); for (File blockFile : blockFileNames) { int fileIndex = Integer.parseInt(blockFile.getName().split("\\.")[0].replaceAll(FILE_NAME, "")); int blockIndex = Integer.parseInt(blockFile.getName().split("\\.")[1].replaceAll(PartFileWriter.PARTSUFFIX.substring(1), "")); String expected = testMeta.blockIdToExpectedContent.get(testMeta.fileMetadatas.get(fileIndex).getBlockIds()[blockIndex - 1]); Assert.assertEquals(expected, FileUtils.readFileToString(blockFile)); } }
Source:
<code>public void saveSnapshot() { Session session = model.getSession(); JFileChooser chooser = new JFileChooser(model.getOptionsParam().getUserDirectory()); File fileproposal = new File(session.getSessionName()); <START> String proposedFileName; <END> if (session.getFileName() != null && session.getFileName().trim().length() > 0) { proposedFileName = session.getFileName().replace(".session",""); proposedFileName += "-" + dateFormat.format(new Date()) + ".session"; fileproposal = new File(proposedFileName); } chooser.setSelectedFile(fileproposal); chooser.setFileFilter(new FileFilter() { @Override public boolean accept(File file) { if (file.isDirectory()) { return true; } else if (file.isFile() && file.getName().endsWith(".session")) { return true; } return false; } @Override public String getDescription() { return Constant.messages.getString("file.format.zap.session"); } }); File file = null; int rc = chooser.showSaveDialog(view.getMainFrame()); if(rc == JFileChooser.APPROVE_OPTION) { file = chooser.getSelectedFile(); if (file == null) { return; } model.getOptionsParam().setUserDirectory(chooser.getCurrentDirectory()); String fileName = file.getAbsolutePath(); if (!fileName.endsWith(".session")) { fileName += ".session"; } try { waitMessageDialog = view.getWaitMessageDialog(Constant.messages.getString("menu.file.savingSession")); control.snapshotSession(fileName, this); log.info("snapshot as session file " + session.getFileName()); waitMessageDialog.setVisible(true); } catch (Exception e) { log.error(e.getMessage(), e); } } }</code><technical_language>declared in if-then block</technical_language>

Target:
public void saveSnapshot() { Session session = model.getSession(); JFileChooser chooser = new JFileChooser(model.getOptionsParam().getUserDirectory()); File fileproposal = new File(session.getSessionName()); if (session.getFileName() != null && session.getFileName().trim().length() > 0) { String proposedFileName; proposedFileName = StringUtils.removeEnd(session.getFileName(), ".session"); proposedFileName += "-" + dateFormat.format(new Date()) + ".session"; fileproposal = new File(proposedFileName); } chooser.setSelectedFile(fileproposal); chooser.setFileFilter(new FileFilter() { @Override public boolean accept(File file) { if (file.isDirectory()) { return true; } else if (file.isFile() && file.getName().endsWith(".session")) { return true; } return false; } @Override public String getDescription() { return Constant.messages.getString("file.format.zap.session"); } }); File file = null; int rc = chooser.showSaveDialog(view.getMainFrame()); if(rc == JFileChooser.APPROVE_OPTION) { file = chooser.getSelectedFile(); if (file == null) { return; } model.getOptionsParam().setUserDirectory(chooser.getCurrentDirectory()); String fileName = file.getAbsolutePath(); if (!fileName.endsWith(".session")) { fileName += ".session"; } try { waitMessageDialog = view.getWaitMessageDialog(Constant.messages.getString("menu.file.savingSnapshot")); control.snapshotSession(fileName, this); log.info("Snapshotting: " + session.getFileName() + " as " + fileName); waitMessageDialog.setVisible(true); } catch (Exception e) { log.error(e.getMessage(), e); } } }
Source:
<code>public void testMaxCnxnRate() throws InterruptedException { AtomicInteger connectionCounter = new AtomicInteger(0); int i = 0; <START> ArrayList<CnxnThread> threads = new ArrayList<>(300); <END> long start = System.nanoTime(); while (System.nanoTime() - start < TimeUnit.SECONDS.toNanos(3)) { CnxnThread thread = new CnxnThread(i++, host, port, connectionCounter); thread.start(); threads.add(thread); Thread.sleep(10); } for (CnxnThread thread : threads) { thread.join(); } assertEquals(13, connectionCounter.get(), 1); }</code><technical_language>Nit: List<CnxnThread> threads = ..</technical_language>

Target:
public void testMaxCnxnRate() throws InterruptedException { AtomicInteger connectionCounter = new AtomicInteger(0); int i = 0; List<CnxnThread> threads = new ArrayList<>(300); long start = System.nanoTime(); while (System.nanoTime() - start < TimeUnit.SECONDS.toNanos(3)) { CnxnThread thread = new CnxnThread(i++, host, port, connectionCounter); thread.start(); threads.add(thread); Thread.sleep(10); } for (CnxnThread thread : threads) { thread.join(); } assertEquals(13, connectionCounter.get(), 1); }
Source:
<code>public Set<String> getAllDTInstantiableOperators() { TypeGraphVertex tgv = typeGraph.get(DAG.GenericOperator.class.getName()); if (tgv == null) { return null; } Set<String> result = new TreeSet<>(); for (TypeGraphVertex node : tgv.allInstantiableDescendants) { <START> if ((isAncestor(DAG.GenericOperator.class.getName(), node.typeName) || !getAllInputPorts(node).isEmpty())) { <END> result.add(node.typeName); } } return result; }</code><technical_language>explain this change? changing intention of original code</technical_language>

Target:
public Set<String> getAllDTInstantiableOperators() { TypeGraphVertex tgv = typeGraph.get(GenericOperator.class.getName()); if (tgv == null) { return null; } Set<String> result = new TreeSet<>(); for (TypeGraphVertex node : tgv.allInstantiableDescendants) { if ((isAncestor(InputOperator.class.getName(), node.typeName) || !getAllInputPorts(node).isEmpty())) { result.add(node.typeName); } } return result; }
Source:
<code>public void storeBookmarks() { Logger.normal(this, "Attempting to save bookmarks to " + bookmarksFile.toString()); SimpleFieldSet sfs = null; synchronized(bookmarks) { if(isSavingBookmarks) return; isSavingBookmarks = true; sfs = toSimpleFieldSet(); } try (FileOutputStream fos = new FileOutputStream(backupBookmarksFile)){ sfs.writeToBigBuffer(fos); <START> if(!FileUtil.renameTo(backupBookmarksFile, bookmarksFile)) <END> Logger.error(this, "Unable to rename " + backupBookmarksFile.toString() + " to " + bookmarksFile.toString()); } catch(IOException ioe) { Logger.error(this, "An error has occured saving the bookmark file :" + ioe.getMessage(), ioe); } finally { synchronized(bookmarks) { isSavingBookmarks = false; } } }</code><technical_language>bet this breaks windows. If closed file, odds move it</technical_language>

Target:
public void storeBookmarks() { Logger.normal(this, "Attempting to save bookmarks to " + bookmarksFile.toString()); SimpleFieldSet sfs = null; synchronized(bookmarks) { if(isSavingBookmarks) return; isSavingBookmarks = true; sfs = toSimpleFieldSet(); } FileOutputStream fos = null; try { fos = new FileOutputStream(backupBookmarksFile); sfs.writeToBigBuffer(fos); fos.close(); fos = null; if(!FileUtil.renameTo(backupBookmarksFile, bookmarksFile)) Logger.error(this, "Unable to rename " + backupBookmarksFile.toString() + " to " + bookmarksFile.toString()); } catch(IOException ioe) { Logger.error(this, "An error has occured saving the bookmark file :" + ioe.getMessage(), ioe); } finally { Closer.close(fos); synchronized(bookmarks) { isSavingBookmarks = false; } } }
Source:
<code>public @Nonnull String getLog() throws IOException { <START> return IOUtils.toString(getLogReader()); <END> }</code><technical_language>ant: IOUtils.toString close stream</technical_language>

Target:
public @Nonnull String getLog() throws IOException { try (Reader log = getLogReader()) { return IOUtils.toString(log); } }
Source:
<code>protected void addAmbariConfigurationTable() throws SQLException { List<DBAccessor.DBColumnInfo> columns = new ArrayList<>(); columns.add(new DBAccessor.DBColumnInfo(AMBARI_CONFIGURATION_CATEGORY_NAME_COLUMN, String.class, 100, null, false)); columns.add(new DBAccessor.DBColumnInfo(AMBARI_CONFIGURATION_PROPERTY_NAME_COLUMN, String.class, 100, null, false)); <START> columns.add(new DBAccessor.DBColumnInfo(AMBARI_CONFIGURATION_PROPERTY_VALUE_COLUMN, String.class, 4000, null, true)); <END> dbAccessor.createTable(AMBARI_CONFIGURATION_TABLE, columns); dbAccessor.addPKConstraint(AMBARI_CONFIGURATION_TABLE, "PK_ambari_configuration", AMBARI_CONFIGURATION_CATEGORY_NAME_COLUMN, AMBARI_CONFIGURATION_PROPERTY_NAME_COLUMN); }</code><technical_language>I need a column definition update in UpgradeCatalog280, installations 2.7.0+ changed upgrading 2.8</technical_language>

Target:
protected void addAmbariConfigurationTable() throws SQLException { List<DBAccessor.DBColumnInfo> columns = new ArrayList<>(); columns.add(new DBAccessor.DBColumnInfo(AMBARI_CONFIGURATION_CATEGORY_NAME_COLUMN, String.class, 100, null, false)); columns.add(new DBAccessor.DBColumnInfo(AMBARI_CONFIGURATION_PROPERTY_NAME_COLUMN, String.class, 100, null, false)); columns.add(new DBAccessor.DBColumnInfo(AMBARI_CONFIGURATION_PROPERTY_VALUE_COLUMN, String.class, 2048, null, true)); dbAccessor.createTable(AMBARI_CONFIGURATION_TABLE, columns); dbAccessor.addPKConstraint(AMBARI_CONFIGURATION_TABLE, "PK_ambari_configuration", AMBARI_CONFIGURATION_CATEGORY_NAME_COLUMN, AMBARI_CONFIGURATION_PROPERTY_NAME_COLUMN); }
Source:
<code>public Builder stream(InputStream stream, long objectSize, long partSize) { validateNotNull(stream, "stream"); int partCount = -1; if (partSize > 0) { if (partSize < MIN_MULTIPART_SIZE) { throw new IllegalArgumentException( "part size " + partSize + " is not supported; minimum allowed 5MiB"); } if (partSize > MAX_PART_SIZE) { throw new IllegalArgumentException( "part size " + partSize + " is not supported; maximum allowed 5GiB"); } } if (objectSize >= 0) { if (objectSize > MAX_OBJECT_SIZE) { throw new IllegalArgumentException( "object size " + objectSize + " is not supported; maximum allowed 5TiB"); } if (partSize > 0) { if (partSize > objectSize) { partSize = objectSize; } partCount = (int) Math.ceil((double) objectSize / partSize); if (partCount > MAX_MULTIPART_COUNT) { throw new IllegalArgumentException( "object size " + objectSize + " and part size " + partSize + " make more than " + MAX_MULTIPART_COUNT + "parts for upload"); } } else { double pSize = Math.ceil((double) objectSize / MAX_MULTIPART_COUNT); pSize = Math.ceil(pSize / MIN_MULTIPART_SIZE) * MIN_MULTIPART_SIZE; partSize = (long) pSize; if (pSize > 0) { partCount = (int) Math.ceil(objectSize / pSize); <START> } else { partCount = 1; } <END> } } else if (partSize <= 0) { throw new IllegalArgumentException( "valid part size must be provided when object size is unknown"); } final BufferedInputStream bis = (stream instanceof BufferedInputStream) ? (BufferedInputStream) stream : new BufferedInputStream(stream); final long finalPartSize = partSize; final int finalPartCount = partCount; operations.add(args -> args.stream = bis); operations.add(args -> args.objectSize = objectSize); operations.add(args -> args.partSize = finalPartSize); operations.add(args -> args.partCount = finalPartCount); return this; }</code><technical_language>In scenario pSize <= 0 this place</technical_language>

Target:
public Builder stream(InputStream stream, long objectSize, long partSize) { validateNotNull(stream, "stream"); validateSizes(objectSize, partSize); long[] partinfo = partInfo(objectSize, partSize); long pSize = partinfo[0]; int pCount = (int) partinfo[1]; validatePartCount(pCount, objectSize, partSize); final BufferedInputStream bis = (stream instanceof BufferedInputStream) ? (BufferedInputStream) stream : new BufferedInputStream(stream); return setStream(bis, objectSize, pSize, pCount); }
Source:
<code>Layout restore(CorfuRuntime runtime, StateTransferManager transferManager) throws InterruptedException { LayoutTransferSegments layoutTransferSegments = performStateTransfer(runtime, transferManager); <START> BaseClient baseClient = runtime.getLayoutView() .getRuntimeLayout(layoutTransferSegments.getLayout()) .getBaseClient(currentNode); <END> mergeSegments(baseClient, runtime.getLayoutManagementView(), layoutTransferSegments); runtime.invalidateLayout(); return runtime.getLayoutView().getLayout(); }</code><technical_language>I this logic put mergeSegments(), remove BaseClient parameter of it, cleaner</technical_language>

Target:
private Layout restore(CorfuRuntime runtime, StateTransferManager transferManager) throws InterruptedException, OutrankedException { LayoutTransferSegments layoutTransferSegments = performStateTransfer(runtime, transferManager); mergeSegments(runtime.getLayoutView(), runtime.getLayoutManagementView(), layoutTransferSegments); runtime.invalidateLayout(); return runtime.getLayoutView().getLayout(); }
Source:
<code>public void onPlayerChangedWorldFlyReset(final PlayerChangedWorldEvent event) { final User user = ess.getUser(event.getPlayer()); <START> if (ess.getSettings().isWorldChangeFlyResetEnabled()) { <END> if (user.getBase().getGameMode() != GameMode.CREATIVE && !user.getBase().getGameMode().name().equals("SPECTATOR") && !user.isAuthorized("essentials.fly")) { user.getBase().setFallDistance(0f); user.getBase().setAllowFlight(false); } } if (ess.getSettings().isWorldChangeSpeedResetEnabled()) { if (!user.isAuthorized("essentials.speed")) { user.getBase().setFlySpeed(0.1f); user.getBase().setWalkSpeed(0.2f); } else { if (user.getBase().getFlySpeed() > ess.getSettings().getMaxFlySpeed() && !user.isAuthorized("essentials.speed.bypass")) { user.getBase().setFlySpeed((float) ess.getSettings().getMaxFlySpeed()); } else { user.getBase().setFlySpeed(user.getBase().getFlySpeed() * 0.99999f); } if (user.getBase().getWalkSpeed() > ess.getSettings().getMaxWalkSpeed() && !user.isAuthorized("essentials.speed.bypass")) { user.getBase().setWalkSpeed((float) ess.getSettings().getMaxWalkSpeed()); } else { user.getBase().setWalkSpeed(user.getBase().getWalkSpeed() * 0.99999f); } } } }</code><technical_language>This need nested</technical_language>

Target:
public void onPlayerChangedWorldFlyReset(final PlayerChangedWorldEvent event) { final User user = ess.getUser(event.getPlayer()); if (ess.getSettings().isWorldChangeFlyResetEnabled()) { if (user.getBase().getGameMode() != GameMode.CREATIVE && !user.getBase().getGameMode().name().equals("SPECTATOR") && !user.isAuthorized("essentials.fly")) { user.getBase().setFallDistance(0f); user.getBase().setAllowFlight(false); } } if (ess.getSettings().isWorldChangeSpeedResetEnabled()) { if (!user.isAuthorized("essentials.speed")) { user.getBase().setFlySpeed(0.1f); user.getBase().setWalkSpeed(0.2f); } else { if (user.getBase().getFlySpeed() > ess.getSettings().getMaxFlySpeed() && !user.isAuthorized("essentials.speed.bypass")) { user.getBase().setFlySpeed((float) ess.getSettings().getMaxFlySpeed()); } else { user.getBase().setFlySpeed(user.getBase().getFlySpeed() * 0.99999f); } if (user.getBase().getWalkSpeed() > ess.getSettings().getMaxWalkSpeed() && !user.isAuthorized("essentials.speed.bypass")) { user.getBase().setWalkSpeed((float) ess.getSettings().getMaxWalkSpeed()); } } } }
Source:
<code><START> TrampolineEval<A> asTrampoline() { <END> return this; }</code><technical_language>final</technical_language>

Target:
final TrampolineEval<A> asTrampoline() { return this; }
Source:
<code>protected void encode(ChannelHandlerContext ctx, HAProxyMessage msg, ByteBuf out) throws Exception { <START> if (msg.protocolVersion() == HAProxyProtocolVersion.V1) { <END> encodeV1(msg, out); } else if (msg.protocolVersion() == HAProxyProtocolVersion.V2) { encodeV2(msg, out); } else { throw new HAProxyProtocolException("Unsupported version: " + msg.protocolVersion()); } }</code><technical_language>nit: consider replacing a switch statement</technical_language>

Target:
protected void encode(ChannelHandlerContext ctx, HAProxyMessage msg, ByteBuf out) throws Exception { switch (msg.protocolVersion()) { case V1: encodeV1(msg, out); break; case V2: encodeV2(msg, out); break; default: throw new HAProxyProtocolException("Unsupported version: " + msg.protocolVersion()); } }
Source:
<code>private Collection<DroolsAbstractConstraintStream<Solution_>> assembleAllStreams( DroolsAbstractConstraintStream<Solution_> parent) { <START> final Set<DroolsAbstractConstraintStream<Solution_>> streams = new LinkedHashSet<>(); <END> streams.add(parent); for (DroolsAbstractConstraintStream<Solution_> child: parent.getChildStreams()) { streams.addAll(assembleAllStreams(child)); } return streams; }</code><technical_language>Code consistency: OptaPlanner's code plural for arrays collections, *List for lists *Set for sets. "streams" -> "streamSet"</technical_language>

Target:
private Collection<DroolsAbstractConstraintStream<Solution_>> assembleAllStreams( DroolsAbstractConstraintStream<Solution_> parent) { final Set<DroolsAbstractConstraintStream<Solution_>> streamSet = new LinkedHashSet<>(); streamSet.add(parent); for (DroolsAbstractConstraintStream<Solution_> child : parent.getChildStreams()) { streamSet.addAll(assembleAllStreams(child)); } return streamSet; }
Source:
<code>private void setTextProperty(String text) { savedText = text; if (getPropertyValue(PROPERTY_NAME_HTMLFORMAT).equals("True")) { <START> String sanitizedText = SimpleHtmlSanitizer.sanitizeHtml(text).asString(); <END> labelWidget.setHTML( (sanitizedText == null) ? sanitizedText : sanitizedText.replaceAll("\\\\n", "<br>") ); } else { labelWidget.setText( (text == null) ? text : text.replaceAll("\\\\n", "<br>") ); } }</code><technical_language>I sense do this substitution HTML format flag interpreted HTML (in case, need replace "\\n" "\n"</technical_language>

Target:
private void setTextProperty(String text) { savedText = text; if (getPropertyValue(PROPERTY_NAME_HTMLFORMAT).equals("True")) { String sanitizedText = SimpleHtmlSanitizer.sanitizeHtml(text).asString(); if (sanitizedText != null) { sanitizedText = sanitizedText.replaceAll("\\\\n", " "); } labelWidget.setHTML(sanitizedText); } else { labelWidget.setHTML(text.replaceAll("&", "&amp;").replaceAll("<", "&lt;") .replaceAll(">", "&gt;").replaceAll("\\\\n", "<br>") ); } }
Source:
<code>public Disks list() { if (isFiltered()) { <START> return mapCollection(getBackendCollection(VdcQueryType.GetAllDisksByUserId, new VdcQueryParametersBase())); <END> } else { return mapCollection(getBackendCollection(SearchType.Disk)); } }</code><technical_language>reusing GetAllDisks query</technical_language>

Target:
public Disks list() { if (isFiltered()) { return mapCollection(getBackendCollection(VdcQueryType.GetAllDisks, new VdcQueryParametersBase())); } else { return mapCollection(getBackendCollection(SearchType.Disk)); } }
Source:
<code>private static String removeTrailingZeroForNumber(String value, String type) { if (type == null || type.toUpperCase().equals("FLOAT") || type.toUpperCase().equals("DOUBLE") || type.toUpperCase().equals("BIGINT")) { <START> if (value.endsWith(".0")) { <END> return value.substring(0, value.length() - 2); } } return value; }</code><technical_language>So, this work for some cases. need double check DataTableReducer implementations check format double/float string. For instance, SelectionDataTableReducer SelectionOperatorUtils.renderSelectionResultsWithoutOrdering() this is causing x.0 for case. other hand, if check AggregationDataTableReducer, AggregationFunctionUtils.formatValue(), convert decimals x.00000 So, I approach is regex following: Find position 1. start '.' 2. number of {0} 3. end '0'</technical_language>

Target:
private static String removeTrailingZeroForNumber(String value, String type) { if (type == null || type.toUpperCase().equals("FLOAT") || type.toUpperCase().equals("DOUBLE") || type.toUpperCase().equals("BIGINT")) { try { return (new BigDecimal(value)).stripTrailingZeros().toPlainString(); } catch (NumberFormatException e) { } } return value; }
Source:
<code>public void serialization() { XStream2 xs = new XStream2(); TestData td = new TestData(); String out = xs.toXML(td); String expected = "<hudson.util.CopyOnWriteListTest_-TestData>" + "<list1/><list2/></hudson.util.CopyOnWriteListTest_-TestData>"; <START> assertThat(expected, CompareMatcher.isSimilarTo(out).ignoreWhitespace() <END> .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText))); TestData td2 = (TestData)xs.fromXML(out); assertTrue(td2.list1.isEmpty()); assertTrue(td2.list2.isEmpty()); td.list1.add("foobar1"); td.list2.add("foobar2"); out = xs.toXML(td); expected = "<hudson.util.CopyOnWriteListTest_-TestData>" + "<list1><string>foobar1</string></list1><list2><string>foobar2" + "</string></list2></hudson.util.CopyOnWriteListTest_-TestData>"; assertThat(expected, CompareMatcher.isSimilarTo(out).ignoreWhitespace() .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText))); td2 = (TestData)xs.fromXML(out); assertEquals("foobar1", td2.list1.getView().get(0)); assertEquals("foobar2", td2.list2.get(0)); }</code><technical_language>match semantic of assertThat, actual expected swapped (also in other test)</technical_language>

Target:
public void serialization() { XStream2 xs = new XStream2(); TestData td = new TestData(); String out = xs.toXML(td); String expected = "<hudson.util.CopyOnWriteListTest_-TestData>" + "<list1/><list2/></hudson.util.CopyOnWriteListTest_-TestData>"; assertThat(out, isSimilarTo(expected).ignoreWhitespace() .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText))); TestData td2 = (TestData)xs.fromXML(out); assertTrue(td2.list1.isEmpty()); assertTrue(td2.list2.isEmpty()); td.list1.add("foobar1"); td.list2.add("foobar2"); out = xs.toXML(td); expected = "<hudson.util.CopyOnWriteListTest_-TestData>" + "<list1><string>foobar1</string></list1><list2><string>foobar2" + "</string></list2></hudson.util.CopyOnWriteListTest_-TestData>"; assertThat(out, isSimilarTo(expected).ignoreWhitespace() .withNodeMatcher(new DefaultNodeMatcher(ElementSelectors.byNameAndText))); td2 = (TestData)xs.fromXML(out); assertEquals("foobar1", td2.list1.getView().get(0)); assertEquals("foobar2", td2.list2.get(0)); }
Source:
<code>public BoostLockedRegionPriority() { final JNodeLookup lookup = Jack.getSession().getLookup(); try { String className = ThreadConfig.get(BOOST_LOCK_CLASSNAME); String boostMethod = ThreadConfig.get(BOOST_LOCK_REQUEST_METHOD); String resetMethod = ThreadConfig.get(BOOST_LOCK_RESET_METHOD); <START> if (className.isEmpty() || boostMethod.isEmpty() || resetMethod.isEmpty()) { return; } <END> ams = lookup.getClass(className); throwable = lookup.getClass("Ljava/lang/Throwable;"); boostMethodId = ams.getMethodIdWide( boostMethod, Collections.<JType>emptyList(), MethodKind.STATIC); resetMethodId = ams.getMethodIdWide( resetMethod, Collections.<JType>emptyList(), MethodKind.STATIC); } catch (IncompatibleJTypeLookupException notFound) { return; } catch (JMethodLookupException notFound) { return; } }</code><technical_language>Manage plan, Feature property</technical_language>

Target:
public BoostLockedRegionPriority() { String className = ThreadConfig.get(Optimizations.BoostLockedRegionPriorityFeature.BOOST_LOCK_CLASSNAME); String lockTypeSig = NamingTools.getTypeSignatureName(className); String boostMethod = ThreadConfig.get(Optimizations.BoostLockedRegionPriorityFeature.BOOST_LOCK_REQUEST_METHOD); String resetMethod = ThreadConfig.get(Optimizations.BoostLockedRegionPriorityFeature.BOOST_LOCK_RESET_METHOD); final JNodeLookup lookup = Jack.getSession().getLookup(); try { if (lockTypeSig.isEmpty() || boostMethod.isEmpty() || resetMethod.isEmpty()) { return; } boostClass = lookup.getClass(lockTypeSig); throwable = lookup.getClass("Ljava/lang/Throwable;"); boostMethodId = boostClass.getMethodIdWide(boostMethod, Collections.<JType>emptyList(), MethodKind.STATIC); resetMethodId = boostClass.getMethodIdWide(resetMethod, Collections.<JType>emptyList(), MethodKind.STATIC); } catch (IncompatibleJTypeLookupException e) { Jack.getSession().getReporter().report(Severity.FATAL, new BadBoostLockedRegionPriorityConfigurationException(e)); Jack.getSession().abortEventually(); } catch (JMethodLookupException e) { Jack.getSession().getReporter().report(Severity.FATAL, new BadBoostLockedRegionPriorityConfigurationException(e)); Jack.getSession().abortEventually(); } }
Source:
<code>public OutputStream getOutputStream() { outputStream = provider.getOutputStream(); <START> if (outputStream != null) { <END> outputStream = new FilterOutputStream(outputStream) { @Override public void write(byte[] b) throws IOException { if (logToStderr) { System.err.println("LSP4E to " + id + ":" + new String(b)); } if (logToFile) { log("\nLSP4E to " + id + ":" + new String(b)); } super.write(b); } }; } return outputStream; }</code><technical_language>2 lines, instantiate a new FilterInputStream this method is asked. Instead, generated filtered inputstream stored a field returned if existing</technical_language>

Target:
public OutputStream getOutputStream() { if (outputStream != null) { return outputStream; } if (provider.getOutputStream() != null) { outputStream = new FilterOutputStream(provider.getOutputStream()) { @Override public void write(byte[] b) throws IOException { if (logToStderr) { System.err.println("LSP4E to " + id + ":" + new String(b)); } if (logToFile) { log("\nLSP4E to " + id + ":" + new String(b)); } super.write(b); } }; } return outputStream; }
Source:
<code>private void createIndexReport(GraphContext context) { ApplicationReportService applicationReportService = new ApplicationReportService(context); ApplicationReportModel report = applicationReportService.create(); report.setReportPriority(1); report.setReportIconClass("glyphicon glyphicon-home"); report.setReportName(APPLICATION_LIST_REPORT); report.setTemplatePath(TEMPLATE_PATH); report.setTemplateType(TemplateType.FREEMARKER); report.setDisplayInApplicationReportIndex(false); report.setReportFilename(OUTPUT_FILENAME); GraphService<WindupVertexListModel> listService = new GraphService<>(context, WindupVertexListModel.class); WindupVertexListModel<ApplicationReportModel> applications = listService.create(); Map<String, WindupVertexFrame> relatedData = new HashMap<>(); for (ApplicationReportModel applicationReportModel : applicationReportService.findAll()) { if (applicationReportModel.isMainApplicationReport() != null && applicationReportModel.isMainApplicationReport()) { applications.addItem(applicationReportModel); if (ProjectService.SHARED_LIBS_UNIQUE_ID.equals(applicationReportModel.getProjectModel().getUniqueID())) <START> relatedData.put("sharedLibsExists", applicationReportModel); END> } } relatedData.put("applications", applications); report.setRelatedResource(relatedData); }</code><technical_language>a boolean? name is sort of odd for a boolean value</technical_language>

Target:
private void createIndexReport(GraphContext context) { ApplicationReportService applicationReportService = new ApplicationReportService(context); ApplicationReportModel report = applicationReportService.create(); report.setReportPriority(1); report.setReportIconClass("glyphicon glyphicon-home"); report.setReportName(APPLICATION_LIST_REPORT); report.setTemplatePath(TEMPLATE_PATH); report.setTemplateType(TemplateType.FREEMARKER); report.setDisplayInApplicationReportIndex(false); report.setReportFilename(OUTPUT_FILENAME); GraphService<WindupVertexListModel> listService = new GraphService<>(context, WindupVertexListModel.class); WindupVertexListModel<ApplicationReportModel> applications = listService.create(); Map<String, WindupVertexFrame> relatedData = new HashMap<>(); for (ApplicationReportModel applicationReportModel : applicationReportService.findAll()) { if (applicationReportModel.isMainApplicationReport() != null && applicationReportModel.isMainApplicationReport()) { applications.addItem(applicationReportModel); if (ProjectService.SHARED_LIBS_UNIQUE_ID.equals(applicationReportModel.getProjectModel().getUniqueID())) relatedData.put("sharedLibsApplicationReport", applicationReportModel); } } relatedData.put("applications", applications); report.setRelatedResource(relatedData); }
Source:
<code>public MaxwellKafkaProducerWorker(MaxwellContext context, String kafkaTopic, ArrayBlockingQueue<RowMap> queue, Producer<String,String> producer) { super(context); if ( kafkaTopic == null ) { this.topic = "maxwell"; } else { this.topic = kafkaTopic; } this.interpolateTopic = this.topic.contains("%{"); this.kafka = producer; String hash = context.getConfig().kafkaPartitionHash; String partitionKey = context.getConfig().producerPartitionKey; String partitionColumns = context.getConfig().producerPartitionColumns; String partitionFallback = context.getConfig().producerPartitionFallback; this.partitioner = new MaxwellKafkaPartitioner(hash, partitionKey, partitionColumns, partitionFallback); this.ddlPartitioner = makeDDLPartitioner(hash, partitionKey); this.ddlTopic = context.getConfig().ddlKafkaTopic; this.deadLetterTopic = context.getConfig().deadLetterTopic; <START> this.deadLetterQueue = this.deadLetterTopic == null ? null : new ConcurrentLinkedQueue<>(); <END> if ( context.getConfig().kafkaKeyFormat.equals("hash") ) keyFormat = KeyFormat.HASH; else keyFormat = KeyFormat.ARRAY; this.queue = queue; this.taskState = new StoppableTaskState("MaxwellKafkaProducerWorker"); }</code><technical_language>overly optimized, init thing</technical_language>

Target:
public MaxwellKafkaProducerWorker(MaxwellContext context, String kafkaTopic, ArrayBlockingQueue<RowMap> queue, Producer<String,String> producer) { super(context); if ( kafkaTopic == null ) { this.topic = "maxwell"; } else { this.topic = kafkaTopic; } this.interpolateTopic = this.topic.contains("%{"); this.kafka = producer; String hash = context.getConfig().kafkaPartitionHash; String partitionKey = context.getConfig().producerPartitionKey; String partitionColumns = context.getConfig().producerPartitionColumns; String partitionFallback = context.getConfig().producerPartitionFallback; this.partitioner = new MaxwellKafkaPartitioner(hash, partitionKey, partitionColumns, partitionFallback); this.ddlPartitioner = makeDDLPartitioner(hash, partitionKey); this.ddlTopic = context.getConfig().ddlKafkaTopic; this.deadLetterTopic = context.getConfig().deadLetterTopic; this.deadLetterQueue = new ConcurrentLinkedQueue<>(); if ( context.getConfig().kafkaKeyFormat.equals("hash") ) keyFormat = KeyFormat.HASH; else keyFormat = KeyFormat.ARRAY; this.queue = queue; this.taskState = new StoppableTaskState("MaxwellKafkaProducerWorker"); }
Source:
<code>public PayeeACHAccount createPayeeAchAccount(PaymentWorksVendorUpdatesDTO vendorUpdate, String vendorNumber) { PayeeACHAccount payeeAchAccount = new PayeeACHAccount(); Map<String, String> fieldChanges = new PaymentWorksUtil().convertFieldArrayToMap(vendorUpdate.getField_changes()); payeeAchAccount.setPayeeIdentifierTypeCode(PdpConstants.PayeeIdTypeCodes.VENDOR_ID); payeeAchAccount.setPayeeIdNumber(vendorNumber); <START> payeeAchAccount.setBankRoutingNumber(fieldChanges.get("Routing num")); <END> payeeAchAccount.setBankAccountNumber(fieldChanges.get("Acct num")); payeeAchAccount.setBankAccountTypeCode(PdpConstants.ACH_TRANSACTION_TYPE_DEFAULT); payeeAchAccount.setAchTransactionType(PdpConstants.DisbursementTypeCodes.ACH); payeeAchAccount.setActive(true); payeeAchAccount.setLastUpdateUserId(PaymentWorksConstants.SOURCE_USER); payeeAchAccount.setLastUpdate(SpringContext.getBean(DateTimeService.class).getCurrentTimestamp()); return payeeAchAccount; }</code><technical_language>string literals constants</technical_language>

Target:
public PayeeACHAccount createPayeeAchAccount(PaymentWorksVendorUpdatesDTO vendorUpdate, String vendorNumber) { PayeeACHAccount payeeAchAccount = new PayeeACHAccount(); Map<String, String> fieldChanges = getPaymentWorksUtilityService().convertFieldArrayToMap(vendorUpdate.getField_changes()); payeeAchAccount.setPayeeIdentifierTypeCode(PdpConstants.PayeeIdTypeCodes.VENDOR_ID); payeeAchAccount.setPayeeIdNumber(vendorNumber); payeeAchAccount.setBankRoutingNumber(fieldChanges.get(PaymentWorksConstants.FieldNames.ROUTING_NUMBER)); payeeAchAccount.setBankAccountNumber(fieldChanges.get(PaymentWorksConstants.FieldNames.ACCOUNT_NUMBER)); payeeAchAccount.setBankAccountTypeCode(PdpConstants.ACH_TRANSACTION_TYPE_DEFAULT); payeeAchAccount.setAchTransactionType(PdpConstants.DisbursementTypeCodes.ACH); payeeAchAccount.setActive(true); payeeAchAccount.setLastUpdateUserId(PaymentWorksConstants.SOURCE_USER); payeeAchAccount.setLastUpdate(SpringContext.getBean(DateTimeService.class).getCurrentTimestamp()); return payeeAchAccount; }
Source:
<code>public CompassTargetData getCustomNeedle(String pOreDictName) { CompassTargetData needle = null; if (pOreDictName != null){ for (CompassTargetData entry : customNeedles.keySet()) { <START> if (entry.getOreDictName().equals(pOreDictName)) <END> { needle = entry; break; } } } return needle; }</code><technical_language>Is this null? flipping entry.getOreDictName() pOreDictName prevents theoretical NPE</technical_language>

Target:
public CompassTargetData getCustomNeedle(String pOreDictName) { CompassTargetData needle = null; if (pOreDictName != null){ for (CompassTargetData entry : customNeedles.keySet()) { if (pOreDictName.equals(entry.getOreDictName())) { needle = entry; break; } } } return needle; }