auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public StandaloneDeployer addLibraries(List<File> libs) { <START> for (File file : libs) { <END> mule.addLibrary(file); log.debug(String.format("Adding library %s...", file)); } return this; }</code><technical_language>Please add a check null validation</technical_language>

Target:
public StandaloneDeployer addLibraries(List<File> libs) { checkNotNull(libs, "Libraries cannot be null"); for (File file : libs) { mule.addLibrary(file); log.debug(String.format("Adding library %s...", file)); } return this; }
Source:
<code>public void subscribe(final String contactIdentifier) throws IllegalArgumentException, IllegalStateException, OperationFailedException { <START> System.out.println("subscribe(\"" + contactIdentifier + "\") called"); <END> }</code><technical_language>logger if this is necessary</technical_language>

Target:
public void subscribe(final String contactIdentifier) throws IllegalArgumentException, IllegalStateException, OperationFailedException { LOGGER.trace("subscribe(\"" + contactIdentifier + "\") called"); throw new OperationFailedException("Not implemented.", OperationFailedException.NOT_SUPPORTED_OPERATION); }
Source:
<code>public LicensedVideoSwapHistoryPageObject(WebDriver driver) { super(driver); <START> PageFactory.initElements(driver, this); <END> }</code><technical_language>this is called in BasePageObject call</technical_language>

Target:
public LicensedVideoSwapHistoryPageObject(WebDriver driver) { super(driver); }
Source:
<code><START> static public void playSound(@ParamDoc(name = "filename", text = "the filename with extension") String filename) { <END> try { AudioActionService.audioManager.playFile(filename); } catch (AudioException e) { logger.warn("Failed playing audio file: {}", e.getMessage()); } }</code><technical_language>JLS suggested modifier order time? I prefer a consistent order in framework</technical_language>

Target:
public static void playSound(@ParamDoc(name = "filename", text = "the filename with extension") String filename) { try { AudioActionService.audioManager.playFile(filename); } catch (AudioException e) { logger.warn("Failed playing audio file: {}", e.getMessage()); } }
Source:
<code><START> public void referenceInsert_shouldNotEscapeWithSpecialTag(){ <END> String html = "<b>a bold statement</b>"; assertThat(insertionEventHandler.referenceInsert("$_noescape_" + SOME_REFERENCE, html)).isEqualTo(html); }</code><technical_language>//given/when/then convention? compare other tests</technical_language>

Target:
public void referenceInsert_shouldNotEscapeWithSpecialTag(){ String html = "<b>a bold statement</b>"; Object result = insertionEventHandler.referenceInsert("$_noescape_" + SOME_REFERENCE, html); assertThat(result).isEqualTo(html); }
Source:
<code>protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { super.service(request, response); StringBuilder sb = new StringBuilder(); sb.append(System.getenv("JUMBUNE_HOME")) .append(WebConstants.TMP_DIR_PATH) .append(WebConstants.JUMBUNE_STATE_FILE); File file = new File(sb.toString()); if (file.exists()) { file.delete(); } String jHome = System.getenv("JUMBUNE_HOME"); ObjectInputStream objectinputstream = null; InputStream streamIn = null; try { <START> File jHomeYamlFile = new File(jHome+YAML_FILE); <END> if(jHomeYamlFile.exists()){ streamIn = new FileInputStream(jHomeYamlFile); objectinputstream= new ObjectInputStream(streamIn); BasicYamlConfig config = (BasicYamlConfig) objectinputstream.readObject(); cleanUpJumbuneAgentCurrentJobFolder(config); } }catch(IOException e){ LOGGER.error(e.getMessage(), e); } catch (ClassNotFoundException e) { LOGGER.error(e.getMessage(), e); }finally{ try { if(objectinputstream != null){ objectinputstream .close(); } } catch (IOException e) { LOGGER.error(e.getMessage(), e); } try { if(streamIn!= null){ streamIn.close(); } } catch (IOException e) { LOGGER.error(e.getMessage(), e); } } HttpSession session = request.getSession(); session.removeAttribute("ExecutorServReference"); session.removeAttribute("ReportsBean"); session.removeAttribute("loader"); final RequestDispatcher rd = getServletContext().getRequestDispatcher( WebConstants.HOME_URL); rd.forward(request, response); }</code><technical_language>Avoid String concatenation in File constructors</technical_language>

Target:
protected void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { super.service(request, response); StringBuilder sb = new StringBuilder(); sb.append(System.getenv("JUMBUNE_HOME")) .append(WebConstants.TMP_DIR_PATH) .append(WebConstants.JUMBUNE_STATE_FILE); File file = new File(sb.toString()); if (file.exists()) { file.delete(); } String jHome = System.getenv("JUMBUNE_HOME"); ObjectInputStream objectinputstream = null; InputStream streamIn = null; try { String yamlFile = jHome+YAML_FILE; File jHomeYamlFile = new File(yamlFile); if(jHomeYamlFile.exists()){ streamIn = new FileInputStream(jHomeYamlFile); objectinputstream= new ObjectInputStream(streamIn); BasicYamlConfig config = (BasicYamlConfig) objectinputstream.readObject(); cleanUpJumbuneAgentCurrentJobFolder(config); } }catch(IOException e){ LOGGER.error(e.getMessage(), e); } catch (ClassNotFoundException e) { LOGGER.error(e.getMessage(), e); }finally{ try { if(objectinputstream != null){ objectinputstream .close(); } } catch (IOException e) { LOGGER.error(e.getMessage(), e); } try { if(streamIn!= null){ streamIn.close(); } } catch (IOException e) { LOGGER.error(e.getMessage(), e); } } HttpSession session = request.getSession(); session.removeAttribute("ExecutorServReference"); session.removeAttribute("ReportsBean"); session.removeAttribute("loader"); final RequestDispatcher rd = getServletContext().getRequestDispatcher( WebConstants.HOME_URL); rd.forward(request, response); }
Source:
<code>protected void doShutdown() throws IOException { if (this.disruptor != null) { long timeoutms = conf.getLong("hbase.wal.disruptor.shutdown.timeout.ms", 60000); try { this.disruptor.shutdown(timeoutms, TimeUnit.MILLISECONDS); } catch (TimeoutException e) { LOG.warn("Timed out bringing down disruptor after " + timeoutms + "ms; forcing halt " + "(It is a problem if this is NOT an ABORT! -- DATALOSS!!!!)"); this.disruptor.halt(); this.disruptor.shutdown(); } } if (LOG.isDebugEnabled()) { LOG.debug("Closing WAL writer in " + CommonFSUtils.getPath(walDir)); } if (this.writer != null) { this.writer.close(); this.writer = null; } closeExecutor.shutdown(); try { if (!closeExecutor.awaitTermination(waitOnShutdownInSeconds, TimeUnit.SECONDS)) { <START> LOG.error("We have waited " + waitOnShutdownInSeconds + " seconds but" <END> + " the close of writer(s) doesn't complete." + "Please check the status of underlying filesystem" + " or increase the wait time by the config \"" + FSHLOG_WAIT_ON_SHUTDOWN_IN_SECONDS + "\""); } } catch (InterruptedException e) { LOG.error("The wait for termination of FSHLog writer(s) is interrupted"); Thread.currentThread().interrupt(); } }</code><technical_language>replace method of logging placeholders</technical_language>

Target:
protected void doShutdown() throws IOException { if (this.disruptor != null) { long timeoutms = conf.getLong("hbase.wal.disruptor.shutdown.timeout.ms", 60000); try { this.disruptor.shutdown(timeoutms, TimeUnit.MILLISECONDS); } catch (TimeoutException e) { LOG.warn("Timed out bringing down disruptor after " + timeoutms + "ms; forcing halt " + "(It is a problem if this is NOT an ABORT! -- DATALOSS!!!!)"); this.disruptor.halt(); this.disruptor.shutdown(); } } if (LOG.isDebugEnabled()) { LOG.debug("Closing WAL writer in " + CommonFSUtils.getPath(walDir)); } if (this.writer != null) { this.writer.close(); this.writer = null; } closeExecutor.shutdown(); try { if (!closeExecutor.awaitTermination(waitOnShutdownInSeconds, TimeUnit.SECONDS)) { LOG.error("We have waited seconds but the close of writer(s) doesn't complete." + "Please check the status of underlying filesystem" + " or increase the wait time by the config \"{}\"", this.waitOnShutdownInSeconds, FSHLOG_WAIT_ON_SHUTDOWN_IN_SECONDS); } } catch (InterruptedException e) { LOG.error("The wait for termination of FSHLog writer(s) is interrupted"); Thread.currentThread().interrupt(); } }
Source:
<code>private long insertRevision(long docNumericId, String revId, long parentSequence, boolean deleted, boolean current, byte[] data, boolean available) { ContentValues args = new ContentValues(); args.put("doc_id", docNumericId); args.put("revid", revId); if (parentSequence > 0) { args.put("parent", parentSequence); } args.put("current", current); args.put("deleted", deleted); args.put("available", available); args.put("json", data); Log.d(LOG_TAG, "New revision inserted: " + docNumericId + ", " + revId); long newSequence = this.getSQLDatabase().insert("revs", args); if (newSequence < 0) { throw new IllegalStateException("Unknown error inserting new updated doc, please checking log"); } String attsSql = "INSERT INTO attachments "+ "(sequence, filename, key, type, length, revpos) "+ "SELECT "+newSequence+", filename, key, type, length, revpos "+ "FROM attachments WHERE sequence="+parentSequence; try { this.getSQLDatabase().execSQL(attsSql); } catch (SQLException e) { throw new IllegalStateException("Error copying attachments to new revision "+e); <START> } <END> return newSequence; }</code><technical_language>this SQL calls need happen neither, is insertRevision called a database transaction? guessing a rev newSequence could've inserted rev insert happens, new insert for attachments. _Update_: oops, newSequence insert rev statement. need for a transaction stands, I think</technical_language>

Target:
private long insertRevision(long docNumericId, String revId, long parentSequence, boolean deleted, boolean current, byte[] data, boolean available) { this.getSQLDatabase().beginTransaction(); long newSequence; try { ContentValues args = new ContentValues(); args.put("doc_id", docNumericId); args.put("revid", revId); if (parentSequence > 0) { args.put("parent", parentSequence); } args.put("current", current); args.put("deleted", deleted); args.put("available", available); args.put("json", data); Log.d(LOG_TAG, "New revision inserted: " + docNumericId + ", " + revId); newSequence = this.getSQLDatabase().insert("revs", args); if (newSequence < 0) { throw new IllegalStateException("Unknown error inserting new updated doc, please checking log"); } String attsSql = "INSERT INTO attachments " + "(sequence, filename, key, type, length, revpos) " + "SELECT " + newSequence + ", filename, key, type, length, revpos " + "FROM attachments WHERE sequence=" + parentSequence; try { this.getSQLDatabase().execSQL(attsSql); } catch (SQLException e) { throw new IllegalStateException("Error copying attachments to new revision " + e); } this.getSQLDatabase().setTransactionSuccessful(); } finally { this.getSQLDatabase().endTransaction(); } return newSequence; }
Source:
<code>public void testWriteBytes() throws Exception { int length = 65536; byte[] inputArray = new byte[length]; for (int i = 0; i < length; i++) { inputArray[i] = (byte) (i % 128); } int[] offsets = {0, 100, 545, 1024, 2049, 2050, 2051, 2151, 10480, 20042, 20100, 40001, 65536}; for (int bufferSize : new int[] {4096, 4345, 65535, 65536, 65537, 100000}) { <START> ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream(length); <END> BufferedOutputStreamSliceOutput output = new BufferedOutputStreamSliceOutput(byteOutputStream, bufferSize); for (int i = 0; i < offsets.length - 1; i++) { output.writeBytes(inputArray, offsets[i], offsets[i + 1] - offsets[i]); } output.flush(); assertEquals(byteOutputStream.toByteArray(), inputArray); byteOutputStream.close(); byteOutputStream = new ByteArrayOutputStream(length); Slice inputSlice = Slices.wrappedBuffer(inputArray); output = new BufferedOutputStreamSliceOutput(byteOutputStream, bufferSize); for (int i = 0; i < offsets.length - 1; i++) { output.writeBytes(inputSlice, offsets[i], offsets[i + 1] - offsets[i]); } output.flush(); assertEquals(byteOutputStream.toByteArray(), inputArray); byteOutputStream.close(); } }</code><technical_language>a subclass captures flush sizes validate get flushes > 4k</technical_language>

Target:
public void testWriteBytes() throws Exception { int length = 65536; byte[] inputArray = new byte[length]; for (int i = 0; i < length; i++) { inputArray[i] = (byte) (i % 128); } int[] offsets = {0, 100, 545, 1024, 2049, 2050, 2051, 2151, 10480, 20042, 20100, 40001, 65536}; MockOutputStream byteOutputStream = new MockOutputStream(length); BufferedOutputStreamSliceOutput output = new BufferedOutputStreamSliceOutput(byteOutputStream); for (int i = 0; i < offsets.length - 1; i++) { output.writeBytes(inputArray, offsets[i], offsets[i + 1] - offsets[i]); } output.flush(); assertEquals(byteOutputStream.toByteArray(), inputArray); byteOutputStream.close(); byteOutputStream = new MockOutputStream(length); Slice inputSlice = Slices.wrappedBuffer(inputArray); output = new BufferedOutputStreamSliceOutput(byteOutputStream); for (int i = 0; i < offsets.length - 1; i++) { output.writeBytes(inputSlice, offsets[i], offsets[i + 1] - offsets[i]); } output.flush(); assertEquals(byteOutputStream.toByteArray(), inputArray); byteOutputStream.close(); }
Source:
<code>public Response getClusterTopologyMap(@PathParam("clusterId") String clusterId) { <START> if (!doesClusterExist(clusterId)) { <END> return notFound(String.format("Cluster %s does not exist", clusterId)); } HelixAdmin admin = getHelixAdmin(); Map<String, List<String>> topologyMap = admin.getClusterTopology(clusterId).getTopologyMap(); return JSONRepresentation(topologyMap); }</code><technical_language>this add more zk read, admin.getClusterTopology(clusterId) reads cluster, I heavy this call is. I assume is deployment? I if result in admin.getClusterTopology: if cluster exist, exception(HelixException/NoClusterExistException) is thrown. Rest code catches returns 404. saves zk read</technical_language>

Target:
public Response getClusterTopologyMap(@PathParam("clusterId") String clusterId) { HelixAdmin admin = getHelixAdmin(); Map<String, List<String>> topologyMap; try { topologyMap = admin.getClusterTopology(clusterId).getTopologyMap(); } catch (HelixException ex) { return badRequest(ex.getMessage()); } return JSONRepresentation(topologyMap); }
Source:
<code>private eu.dnetlib.iis.citationmatching.direct.schemas.ReferenceMetadata convertReference(eu.dnetlib.iis.metadataextraction.schemas.ReferenceMetadata refMetadata) { if (refMetadata.getBasicMetadata().getExternalIds() == null) { return null; } if (refMetadata.getBasicMetadata().getExternalIds().isEmpty()) { return null; <START> } <END> return new eu.dnetlib.iis.citationmatching.direct.schemas.ReferenceMetadata( refMetadata.getPosition(), refMetadata.getBasicMetadata().getExternalIds()); }</code><technical_language>org.apache.commons.collections.MapUtils.isEmpty(map) here</technical_language>

Target:
private ReferenceMetadata convertReference(eu.dnetlib.iis.metadataextraction.schemas.ReferenceMetadata refMetadata) { if (MapUtils.isEmpty(refMetadata.getBasicMetadata().getExternalIds())) { return null; } return new eu.dnetlib.iis.citationmatching.direct.schemas.ReferenceMetadata( refMetadata.getPosition(), refMetadata.getBasicMetadata().getExternalIds()); }
Source:
<code>protected final boolean isAuthorized() { <START> if (!(goConfigService.isUserAdmin(currentUser) || goConfigService.isGroupAdministrator(currentUser.getUsername()))) { <END> result.unauthorized(LocalizedMessage.string("UNAUTHORIZED_TO_EDIT"), HealthStateType.unauthorised()); return false; } return true; }</code><technical_language>super-admins allowed this operations. Group admins is purely for managing pipeline groups</technical_language>

Target:
protected final boolean isAuthorized() { if (goConfigService.isUserAdmin(currentUser)) { return true; } result.unauthorized(LocalizedMessage.string("UNAUTHORIZED_TO_EDIT"), HealthStateType.unauthorised()); return false; }
Source:
<code>public void getOnceAndStream_WithInitialValue_WithDelayedSubscription_ReturnsFirstValue_AndDoesNotComplete() throws InterruptedException { final GitHubRepository value1 = create(100, "repository1"); final GitHubRepository value2 = create(100, "repository1"); gitHubRepositoryStore.put(value1); Thread.sleep(PROVIDER_WAIT_TIME); Observable<GitHubRepository> stream = gitHubRepositoryStore.getOnceAndStream(100); gitHubRepositoryStore.put(value2); <START> stream.subscribeWith(testObserver); <END> testObserver.awaitDone(PROVIDER_WAIT_TIME, TimeUnit.MILLISECONDS) .assertNotComplete() .assertNoErrors() .assertValues(value1); }</code><technical_language>plain test()</technical_language>

Target:
public void getOnceAndStream_WithInitialValue_WithDelayedSubscription_ReturnsFirstValue_AndDoesNotComplete() throws InterruptedException { final GitHubRepository value1 = create(100, "repository1"); final GitHubRepository value2 = create(100, "repository1"); gitHubRepositoryStore.put(value1); Thread.sleep(PROVIDER_WAIT_TIME); Observable<GitHubRepository> stream = gitHubRepositoryStore.getOnceAndStream(100); gitHubRepositoryStore.put(value2); stream.test() .awaitDone(PROVIDER_WAIT_TIME, TimeUnit.MILLISECONDS) .assertNotComplete() .assertNoErrors() .assertValues(value1); }
Source:
<code>public void transactionCompleting() { if (trace) { int done = 0, notDone = 0; for (int i = 0; i < index; ++i) { Object task = tasks[i]; if (task instanceof CompletableFuture) { if (((CompletableFuture) task).isDone()) { done++; } else { notDone++; } } } log.tracef("%d tasks done, %d tasks not done yet", done, notDone); } int count = 0; for (int i = 0; i < index; ++i) { Object task = tasks[i]; if (task instanceof CompletableFuture) { try { ((CompletableFuture) task).join(); } catch (CompletionException e) { log.failureBeforeTransactionCompletion(i, e); <START> } <END> tasks[i] = null; ++count; } } if (trace) { log.tracef("Finished %d tasks before completion", count); } }</code><technical_language>this join</technical_language>

Target:
public void transactionCompleting() { if (trace) { int done = 0, notDone = 0; for (int i = 0; i < index; ++i) { Object task = tasks[i]; if (task instanceof CompletableFuture) { if (((CompletableFuture) task).isDone()) { done++; } else { notDone++; } } } log.tracef("%d tasks done, %d tasks not done yet", done, notDone); } int count = 0; for (int i = 0; i < index; ++i) { Object task = tasks[i]; if (task instanceof CompletableFuture) { log.tracef("Waiting for %08x %s", System.identityHashCode(task), task); try { ((CompletableFuture) task).join(); } catch (CompletionException e) { log.failureBeforeTransactionCompletion(i, e); } tasks[i] = null; ++count; } else { log.tracef("Not waiting for %08x %s", System.identityHashCode(task), task); } } if (trace) { log.tracef("Finished %d tasks before completion", count); } }
Source:
<code>private void executeQuery(int numInstruments) throws Exception { String queryString = <START> "<trace> select i,p from /instrument i, /product p where i.productId = p.productId and i.types['TYPE']=$1"; <END> Query query = ClusterStartupRule.getClientCache().getQueryService().newQuery(queryString); Collection results = (Collection) query.execute(new Object[] {"TYPE1"}); assertThat(results.size()).isEqualTo(numInstruments); }</code><technical_language>of "/" replaced Region.SEPARATOR, remain consistent rest of codebase</technical_language>

Target:
private void executeQuery(int numInstruments) throws Exception { ClientCache cache = ClusterStartupRule.getClientCache(); Region productRegion = cache.getRegion(PRODUCT_REGION_NAME); Region instrumentRegion = cache.getRegion(INSTRUMENT_REGION_NAME); String queryString = "<trace> select i,p from " + instrumentRegion.getFullPath() + " i, " + productRegion.getFullPath() + " p where i.productId = p.productId and i.types['TYPE']=$1"; Query query = ClusterStartupRule.getClientCache().getQueryService().newQuery(queryString); Collection results = (Collection) query.execute(new Object[] {"TYPE1"}); assertThat(results.size()).isEqualTo(numInstruments); }
Source:
<code>public void loadProjectClassloaderTest() throws Exception { CompilationResponse res = compileProjectInRepo(MavenCLIArgs.CLEAN, MavenCLIArgs.COMPILE, MavenCLIArgs.INSTALL); if (!res.isSuccessful()) { TestUtil.writeMavenOutputIntoTargetFolder(tmp, res.getMavenOutput(), "ClassLoaderProviderTest.loadProjectClassloaderTest"); } assertThat(res.isSuccessful()).isTrue(); List<String> pomList = MavenUtils.searchPoms(Paths.get(ResourcesConstants.DUMMY_KIE_MULTIMODULE_CLASSLOADER_DIR)); Optional<ClassLoader> clazzLoader = CompilerClassloaderUtils.loadDependenciesClassloaderFromProject(pomList, mavenRepo.toAbsolutePath().toString()); assertThat(clazzLoader).isNotNull(); assertThat(clazzLoader).isPresent(); LoadProjectDependencyUtil.loadLoggerFactory(clazzLoader.get()); <START> if (tmpRoot != null) { <END> TestUtil.rm(tmpRoot.toFile()); } }</code><technical_language>This @After method. in other tests in this class</technical_language>

Target:
public void loadProjectClassloaderTest() throws Exception { CompilationResponse res = compileProjectInRepo(MavenCLIArgs.CLEAN, MavenCLIArgs.COMPILE, MavenCLIArgs.INSTALL); TestUtil.saveMavenLogIfCompilationResponseNotSuccessfull(tmp, res, this.getClass(), testName); assertThat(res.isSuccessful()).isTrue(); List<String> pomList = MavenUtils.searchPoms(Paths.get(ResourcesConstants.DUMMY_KIE_MULTIMODULE_CLASSLOADER_DIR)); Optional<ClassLoader> clazzLoader = CompilerClassloaderUtils.loadDependenciesClassloaderFromProject(pomList, mavenRepo.toAbsolutePath().toString()); assertThat(clazzLoader).isPresent(); LoadProjectDependencyUtil.loadLoggerFactory(clazzLoader.get()); }
Source:
<code>private org.snmp4j.Snmp createSnmp3(Profile profile) { try { TransportMapping<?> transport = new DefaultUdpTransportMapping(); org.snmp4j.Snmp snmp = new org.snmp4j.Snmp(transport); SecurityProtocols securityProtocols = SecurityProtocols.getInstance(); securityProtocols.addDefaultProtocols(); <START> securityProtocols.addPrivacyProtocol(new PrivAES192()); <END> USM usm = new USM(securityProtocols, profile.engineId, 0); ((org.snmp4j.mp.MPv3) snmp.getMessageProcessingModel(org.snmp4j.mp.MPv3.ID)) .setLocalEngineID(profile.engineId.getValue()); ((org.snmp4j.mp.MPv3) snmp.getMessageProcessingModel(org.snmp4j.mp.MPv3.ID)) .getSecurityModels().addSecurityModel(usm); SecurityModels.getInstance().addSecurityModel( usm); transport.listen(); snmp.getUSM().addUser( profile.username, getUsmUser(profile)); return snmp; } catch (IOException e) { throw new NotificationServiceException("error creating version 3 snmp " + getClass().getName()); } }</code><technical_language>Hmm, allow privacy protocol in config file</technical_language>

Target:
private org.snmp4j.Snmp createSnmp3(Profile profile) { try { TransportMapping<?> transport = new DefaultUdpTransportMapping(); org.snmp4j.Snmp snmp = new org.snmp4j.Snmp(transport); SecurityProtocols securityProtocols = SecurityProtocols.getInstance(); securityProtocols.addDefaultProtocols(); securityProtocols.addAuthenticationProtocol(new AuthMD5()); securityProtocols.addAuthenticationProtocol(new AuthSHA()); securityProtocols.addPrivacyProtocol(new PrivAES128()); securityProtocols.addPrivacyProtocol(new PrivAES192()); securityProtocols.addPrivacyProtocol(new PrivAES256()); USM usm = new USM(securityProtocols, profile.engineId, 0); ((org.snmp4j.mp.MPv3) snmp.getMessageProcessingModel(org.snmp4j.mp.MPv3.ID)) .setLocalEngineID(profile.engineId.getValue()); ((org.snmp4j.mp.MPv3) snmp.getMessageProcessingModel(org.snmp4j.mp.MPv3.ID)) .getSecurityModels().addSecurityModel(usm); SecurityModels.getInstance().addSecurityModel( usm); transport.listen(); snmp.getUSM().addUser( profile.username, getUsmUser(profile)); return snmp; } catch (IOException e) { throw new NotificationServiceException("error creating version 3 snmp " + getClass().getName()); } }
Source:
<code>private static File getTempRoot(Properties props) { String tempRoot = props.getProperty(JBOSS_EMBEDDED_ROOT, null); if (tempRoot == null) { return null; } File root = new File(tempRoot); if (!root.exists()) { <START> root.mkdirs(); <END> } validateDirectory("jboss.test.clean.root", root); root = new File(root, "configs"); root.mkdir(); SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmssSSS"); root = new File(root, format.format(new Date())); root.mkdir(); return root; }</code><technical_language>This is minor, Path api here? return error message File will. giving some context is on..</technical_language>

Target:
private static File getTempRoot(Properties props) { String tempRoot = props.getProperty(JBOSS_EMBEDDED_ROOT, null); if (tempRoot == null) { return null; } try { File root = new File(tempRoot); if (!root.exists()) { Files.createDirectories(root.toPath()); } validateDirectory("jboss.test.clean.root", root); root = new File(root, "configs"); Files.createDirectories(root.toPath()); SimpleDateFormat format = new SimpleDateFormat("yyyyMMddHHmmssSSS"); root = new File(root, format.format(new Date())); Files.createDirectory(root.toPath()); return root; } catch (IOException e) { throw EmbeddedLogger.ROOT_LOGGER.cannotSetupEmbeddedServer(e); } }
Source:
<code>public void metadataSemanticallyEquivalentToItselfIfCanBeDeserializedAndSemanticsAgree() { Assume.assumeTrue(V1_BASE.underlyingData().isPresent()); <START> assertThat(V1_BASE.knowablySemanticallyEquivalent(V1_BASE)).isTrue(); <END> }</code><technical_language>do want Assume here? silent broken tests some point? I feel is meant for Theories</technical_language>

Target:
public void metadataSemanticallyEquivalentToItselfIfCanBeDeserializedAndSemanticsAgree() { assertThat(V1_BASE.underlyingData()).isPresent(); assertThat(V1_BASE.knowablySemanticallyEquivalent(V1_BASE)).isTrue(); }
Source:
<code>public void addPages() { addPage(fSelectPage); addPage(fSelectDirectories); addPage(fScanPage); addPage(fImportOptions); <START> <END> }</code><technical_language>remove empty line</technical_language>

Target:
public void addPages() { addPage(fSelectPage); addPage(fSelectDirectories); addPage(fScanPage); }
Source:
<code>private InitStep loadInitStep(File jar) { try { ClassLoader pluginLoader = new URLClassLoader(new URL[] {jar.toURI().toURL()}, InitPluginStepsLoader.class.getClassLoader()); JarFile jarFile = new JarFile(jar); try { Attributes jarFileAttributes = jarFile.getManifest().getMainAttributes(); String initClassName = jarFileAttributes.getValue("Gerrit-InitStep"); if (initClassName == null) { return null; } @SuppressWarnings("unchecked") Class<? extends InitStep> initStepClass = (Class<? extends InitStep>) pluginLoader.loadClass(initClassName); return getPluginInjector(jar).getInstance(initStepClass); } finally { <START> jarFile.close(); <END> } } catch (ClassCastException e) { ui.message( "WARN: InitStep from plugin %s does not implement %s (Exception: %s)", jar.getName(), InitStep.class.getName(), e.getMessage()); return null; } catch (Exception e) { ui.message( "WARN: Cannot load and get plugin init step for %s (Exception: %s)", jar, e.getMessage()); return null; } }</code><technical_language>Java 7 now, consider usage of AutoClosable try-with-resource block</technical_language>

Target:
private InitStep loadInitStep(File jar) { try { ClassLoader pluginLoader = new URLClassLoader(new URL[] {jar.toURI().toURL()}, InitPluginStepsLoader.class.getClassLoader()); try (JarFile jarFile = new JarFile(jar)) { Attributes jarFileAttributes = jarFile.getManifest().getMainAttributes(); String initClassName = jarFileAttributes.getValue("Gerrit-InitStep"); if (initClassName == null) { return null; } @SuppressWarnings("unchecked") Class<? extends InitStep> initStepClass = (Class<? extends InitStep>) pluginLoader.loadClass(initClassName); return getPluginInjector(jar).getInstance(initStepClass); } } catch (ClassCastException e) { ui.message( "WARN: InitStep from plugin %s does not implement %s (Exception: %s)", jar.getName(), InitStep.class.getName(), e.getMessage()); return null; } catch (Exception e) { ui.message( "WARN: Cannot load and get plugin init step for %s (Exception: %s)", jar, e.getMessage()); return null; } }
Source:
<code><START> private void initialSetup() { <END> mockValidators(); doNothing().when(command).updateDisksFromDb(); doReturn(mockVm()).when(command).getVm(); doReturn(true).when(command).isDiskPassPciAndIdeLimit(any(Disk.class)); doReturn(true).when(command).checkDiskUsedAsOvfStore(diskValidator); doReturn(false).when(command).isOperationPerformedOnDiskSnapshot(); doReturn(vmDeviceDAO).when(command).getVmDeviceDao(); doReturn(storageDomainDAO).when(command).getStorageDomainDAO(); doReturn(storagePoolIsoMapDAO).when(command).getStoragePoolIsoMapDao(); mockStoragePoolIsoMap(); }</code><technical_language>This public a @Before annotation, called explicitly test</technical_language>

Target:
public void initialSetup() { mockValidators(); doNothing().when(command).updateDisksFromDb(); doReturn(mockVm()).when(command).getVm(); doReturn(true).when(command).isDiskPassPciAndIdeLimit(any(Disk.class)); doReturn(true).when(command).checkDiskUsedAsOvfStore(diskValidator); doReturn(false).when(command).isOperationPerformedOnDiskSnapshot(); doReturn(vmDeviceDAO).when(command).getVmDeviceDao(); doReturn(storageDomainDAO).when(command).getStorageDomainDAO(); doReturn(storagePoolIsoMapDAO).when(command).getStoragePoolIsoMapDao(); mockStoragePoolIsoMap(); }
Source:
<code>public void stateChanged(CuratorFramework client, ConnectionState newState) { stateHandlerLock.lock(); try { scheduler.setZkConnectionState(newState); ConnectionState previous = lastState.get(); if (!newState.isConnected()) { <START> scheduler.notLeader(); <END> lostConnectionStateChecker = new TimerTask() { @Override public void run() { stateHandlerLock.lock(); try { LOG.error("Aborting due to loss of zookeeper connection for {}ms. Current connection state {}", configuration.getZooKeeperConfiguration().getAbortAfterConnectionLostForMillis(), newState); abort.abort(AbortReason.LOST_ZK_CONNECTION, Optional.empty()); } finally { stateHandlerLock.unlock(); } } }; TIMER.schedule(lostConnectionStateChecker, configuration.getZooKeeperConfiguration().getAbortAfterConnectionLostForMillis()); } else if (previous != null && !previous.isConnected()) { if (lostConnectionStateChecker != null) { lostConnectionStateChecker.cancel(); } } } finally { stateHandlerLock.unlock(); } }</code><technical_language>Logging connection lost hang out for X millis useful for debugging</technical_language>

Target:
public void stateChanged(CuratorFramework client, ConnectionState newState) { LOG.info("Received update for new zk connection state {}", newState); stateHandlerLock.lock(); try { scheduler.setZkConnectionState(newState); if (!newState.isConnected()) { LOG.info("No longer connected to zk, pausing scheduler actions and waiting up to {}ms for reconnect", configuration.getZooKeeperConfiguration().getAbortAfterConnectionLostForMillis()); if (lostConnectionStateChecker != null) { LOG.warn("Already started connection state check, due in {}ms", lostConnectionStateChecker.scheduledExecutionTime() - System.currentTimeMillis()); return; } lostConnectionStateChecker = new TimerTask() { @Override public void run() { stateHandlerLock.lock(); if (scheduler.getState().getZkConnectionState().isConnected()) { LOG.debug("Reconnected to zk, will not abort"); return; } try { LOG.error("Aborting due to loss of zookeeper connection for {}ms. Current connection state {}", configuration.getZooKeeperConfiguration().getAbortAfterConnectionLostForMillis(), newState); abort.abort(AbortReason.LOST_ZK_CONNECTION, Optional.empty()); } finally { stateHandlerLock.unlock(); } } }; TIMER.schedule(lostConnectionStateChecker, configuration.getZooKeeperConfiguration().getAbortAfterConnectionLostForMillis()); } else if (lostConnectionStateChecker != null) { LOG.info("Reconnected to zk, scheduler actions resumed"); lostConnectionStateChecker.cancel(); lostConnectionStateChecker = null; } } finally { stateHandlerLock.unlock(); } }
Source:
<code>protected void initChannel(SocketChannel ch) throws Exception { ChannelPipeline pipeline = ch.pipeline(); <START> if (sslFactory != null) { <END> InetSocketAddress peerAddress = ch.remoteAddress(); String peerHost = peerAddress.getHostName(); int peerPort = peerAddress.getPort(); SslHandler sslHandler = new SslHandler(sslFactory.createSSLEngine(peerHost, peerPort, SSLFactory.Mode.SERVER)); pipeline.addLast("SslHandler", sslHandler); } pipeline.addLast(Http2FrameCodecBuilder.forServer().initialSettings(Http2Settings.defaultSettings()).build()) .addLast("Http2MultiplexHandler", new Http2MultiplexHandler( new Http2StreamHandler(nettyMetrics, nettyConfig, performanceConfig, requestHandler))); }</code><technical_language>For http2 is option set SSL? Objects.requireNonNull in constructor</technical_language>

Target:
protected void initChannel(SocketChannel ch) throws Exception { ChannelPipeline pipeline = ch.pipeline(); pipeline.addLast("connectionStatsHandler", connectionStatsHandler); InetSocketAddress peerAddress = ch.remoteAddress(); String peerHost = peerAddress.getHostName(); int peerPort = peerAddress.getPort(); SslHandler sslHandler = new SslHandler(sslFactory.createSSLEngine(peerHost, peerPort, SSLFactory.Mode.SERVER)); pipeline.addLast("SslHandler", sslHandler); pipeline.addLast(Http2FrameCodecBuilder.forServer().initialSettings(Http2Settings.defaultSettings()).build()) .addLast("Http2MultiplexHandler", new Http2MultiplexHandler( new Http2StreamHandler(nettyMetrics, nettyConfig, performanceConfig, requestHandler))); }
Source:
<code>public Response setBranchState(long branchUuid, BranchState newState) { BranchReadable branch = getBranchById(branchUuid); boolean modified = false; if (isDifferent(branch.getBranchState(), newState)) { <START> <END> activityLog.createEntry(BRANCH_OPERATION_TYPEID, ActivityLog.INITIAL_STATUS, String.format( "Branch Operation Branch State Changed {branchUUID: %s prevState: %s newState: %s accountId: %s serverId: %s clientId: %s}", branchUuid, branch.getBranchType(), newState, accountId, serverId, clientId)); Callable<?> op = getBranchOps().changeBranchState(branch, newState); executeCallable(op); modified = true; } return asResponse(modified); }</code><technical_language>try/catch</technical_language>

Target:
public Response setBranchState(long branchUuid, BranchState newState) { BranchReadable branch = getBranchById(branchUuid); boolean modified = false; if (isDifferent(branch.getBranchState(), newState)) { try { activityLog.createEntry(BRANCH_OPERATION_TYPEID, ActivityLog.INITIAL_STATUS, String.format( "Branch Operation Branch State Changed {branchUUID: %s prevState: %s newState: %s accountId: %s serverId: %s clientId: %s}", branchUuid, branch.getBranchType(), newState, RestUtil.getAccountId(httpHeaders), RestUtil.getServerId(httpHeaders), RestUtil.getClientId(httpHeaders))); } catch (OseeCoreException ex) { OseeLog.log(ActivityLog.class, OseeLevel.SEVERE_POPUP, ex); } Callable<?> op = getBranchOps().changeBranchState(branch, newState); executeCallable(op); modified = true; } return asResponse(modified); }
Source:
<code>protected Optional<UniqueConstraint> getPrimaryKey(DatabaseMetaData metaData, String schema, String table) throws SQLException { ResultSet rs = metaData.getPrimaryKeys(null, schema, table); <START> Map<Integer, String> keySeqColumnName = new HashMap<>(); <END> String pkName = null; while (rs.next()) { String columnName = rs.getString("COLUMN_NAME"); pkName = rs.getString("PK_NAME"); int keySeq = rs.getInt("KEY_SEQ"); keySeqColumnName.put(keySeq - 1, columnName); } List<String> pkFields = Arrays.asList(new String[keySeqColumnName.size()]); keySeqColumnName.forEach(pkFields::set); if (!pkFields.isEmpty()) { if (pkName == null) { pkName = "pk_" + String.join("_", pkFields); } return Optional.of(UniqueConstraint.primaryKey(pkName, pkFields)); } else { return Optional.empty(); } }</code><technical_language>modern GC algorithms optimized for creating small objects short lived, is basically 99% heuristic for Java objects in program. I GC overhead is low, besides in client side. I fine early initialize map</technical_language>

Target:
protected Optional<UniqueConstraint> getPrimaryKey(DatabaseMetaData metaData, String schema, String table) throws SQLException { ResultSet rs = metaData.getPrimaryKeys(null, schema, table); Map<Integer, String> keySeqColumnName = new HashMap<>(); String pkName = null; while (rs.next()) { String columnName = rs.getString("COLUMN_NAME"); pkName = rs.getString("PK_NAME"); int keySeq = rs.getInt("KEY_SEQ"); keySeqColumnName.put(keySeq - 1, columnName); } List<String> pkFields = Arrays.asList(new String[keySeqColumnName.size()]); keySeqColumnName.forEach(pkFields::set); if (!pkFields.isEmpty()) { pkName = pkName != null ? pkName : "pk_" + String.join("_", pkFields); return Optional.of(UniqueConstraint.primaryKey(pkName, pkFields)); } return Optional.empty(); }
Source:
<code>public static Collection<Object[]> runConfig() { return Arrays.asList(new Object[][] { <START> { PARTITIONED, CacheAtomicityMode.ATOMIC, true }, <END> { PARTITIONED, CacheAtomicityMode.ATOMIC, false }, { PARTITIONED, CacheAtomicityMode.TRANSACTIONAL, true }, { PARTITIONED, CacheAtomicityMode.TRANSACTIONAL, false }, { REPLICATED, CacheAtomicityMode.ATOMIC, false }, { REPLICATED, CacheAtomicityMode.TRANSACTIONAL, false }, }); }</code><technical_language>static import in cases</technical_language>

Target:
public static Collection<Object[]> runConfig() { return Arrays.asList(new Object[][] { {PARTITIONED, ATOMIC, true}, {PARTITIONED, ATOMIC, false}, {PARTITIONED, TRANSACTIONAL, true}, {PARTITIONED, TRANSACTIONAL, false}, {REPLICATED, ATOMIC, false}, {REPLICATED, TRANSACTIONAL, false}, }); }
Source:
<code><START> protected synchronized long getRemoteServiceVersion() throws AlluxioStatusException { <END> return retryRPC(() -> mVersionService.getServiceVersion( GetServiceVersionPRequest.newBuilder().setServiceType(getRemoteServiceType()).build()) .getVersion(), LOG, "getRemoteServiceVersion", ""); }</code><technical_language>add synchronization here</technical_language>

Target:
protected long getRemoteServiceVersion() throws AlluxioStatusException { return retryRPC(() -> mVersionService.getServiceVersion( GetServiceVersionPRequest.newBuilder().setServiceType(getRemoteServiceType()).build()) .getVersion(), LOG, "getRemoteServiceVersion", ""); }
Source:
<code>SpanHandlerImpl(final HandlerKey handlerKey, final int blockedItemsPerBatch, final Collection<SenderTask<String>> sendDataTasks, @Nonnull final ValidationConfiguration validationConfig, @Nullable final Consumer<Long> receivedRateSink, @Nullable final Logger blockedItemLogger, @Nullable final Logger validItemsLogger, @Nonnull final Supplier<Integer> dropSpansDelayedMinutes) { super(handlerKey, blockedItemsPerBatch, new SpanSerializer(), sendDataTasks, true, receivedRateSink, blockedItemLogger); this.validationConfig = validationConfig; this.validItemsLogger = validItemsLogger; this.dropSpansDelayedMinutes = dropSpansDelayedMinutes; this.spanTagCount = Metrics.defaultRegistry().newHistogram(new MetricName(handlerKey.toString(), "", <START> "spanTagCount"), false); <END> }</code><technical_language>rename this spanTagCount.received</technical_language>

Target:
SpanHandlerImpl(final HandlerKey handlerKey, final int blockedItemsPerBatch, final Collection<SenderTask<String>> sendDataTasks, @Nonnull final ValidationConfiguration validationConfig, @Nullable final Consumer<Long> receivedRateSink, @Nullable final Logger blockedItemLogger, @Nullable final Logger validItemsLogger, @Nonnull final Supplier<Integer> dropSpansDelayedMinutes) { super(handlerKey, blockedItemsPerBatch, new SpanSerializer(), sendDataTasks, true, receivedRateSink, blockedItemLogger); this.validationConfig = validationConfig; this.validItemsLogger = validItemsLogger; this.dropSpansDelayedMinutes = dropSpansDelayedMinutes; this.receivedTagCount = Metrics.newHistogram(new MetricName(handlerKey.toString() + ".received", "", "tagCount"), false); }
Source:
<code>public Optional<Map<String, Object>> getMetadata() { return metadata; <START> } <END></code><technical_language>getter deal wrapping in Optional</technical_language>

Target:
public ExternalMetadata getMetadata() { return metadata; }
Source:
<code>public NetSocket upgradeToSsl(String serverName, Handler<AsyncResult<Void>> handler) { ChannelOutboundHandler sslHandler = (ChannelOutboundHandler) chctx.pipeline().get("ssl"); if (sslHandler == null) { ChannelPromise p = chctx.newPromise(); chctx.pipeline().addFirst("handshaker", new SslHandshakeCompletionHandler(p)); p.addListener(future -> { if (handler != null) { AsyncResult<Void> res; if (future.isSuccess()) { res = Future.succeededFuture(); } else { res = Future.failedFuture(future.cause()); } <START> context.dispatch(null, u -> handler.handle(res)); <END> } }); if (remoteAddress != null) { sslHandler = new SslHandler(helper.createEngine(vertx, remoteAddress, serverName)); ((SslHandler) sslHandler).setHandshakeTimeout(helper.getSslHandshakeTimeout(), helper.getSslHandshakeTimeoutUnit()); } else { if (helper.isSNI()) { sslHandler = new SniHandler(helper.serverNameMapper(vertx)); } else { sslHandler = new SslHandler(helper.createEngine(vertx)); ((SslHandler) sslHandler).setHandshakeTimeout(helper.getSslHandshakeTimeout(), helper.getSslHandshakeTimeoutUnit()); } } chctx.pipeline().addFirst("ssl", sslHandler); } return this; }</code><technical_language>instead context.dispatch(res, handler)</technical_language>

Target:
public NetSocket upgradeToSsl(String serverName, Handler<AsyncResult<Void>> handler) { ChannelOutboundHandler sslHandler = (ChannelOutboundHandler) chctx.pipeline().get("ssl"); if (sslHandler == null) { ChannelPromise p = chctx.newPromise(); chctx.pipeline().addFirst("handshaker", new SslHandshakeCompletionHandler(p)); p.addListener(future -> { if (handler != null) { AsyncResult<Void> res; if (future.isSuccess()) { res = Future.succeededFuture(); } else { res = Future.failedFuture(future.cause()); } context.dispatch(res, handler); } }); if (remoteAddress != null) { sslHandler = new SslHandler(helper.createEngine(vertx, remoteAddress, serverName)); ((SslHandler) sslHandler).setHandshakeTimeout(helper.getSslHandshakeTimeout(), helper.getSslHandshakeTimeoutUnit()); } else { if (helper.isSNI()) { sslHandler = new SniHandler(helper.serverNameMapper(vertx)); } else { sslHandler = new SslHandler(helper.createEngine(vertx)); ((SslHandler) sslHandler).setHandshakeTimeout(helper.getSslHandshakeTimeout(), helper.getSslHandshakeTimeoutUnit()); } } chctx.pipeline().addFirst("ssl", sslHandler); } return this; }
Source:
<code>public Mutation(Mutation m) { m.serialize(); this.row = m.row; this.data = m.data; <START> this.size = new MutationSize(m.size.entries, m.size.sizeInBytes); <END> this.values = m.values; this.replicationSources = m.replicationSources; }</code><technical_language>a copy constructor for this case</technical_language>

Target:
public Mutation(Mutation m) { m.serialize(); this.row = m.row; this.data = m.data; this.entries = m.entries; this.values = m.values; this.replicationSources = m.replicationSources; }
Source:
<code>private void updateConfiguration( Integer iops ) { long oldState; long newState; if ( iops == null || iops < 1 ) { do { oldState = stateUpdater.get( this ); <START> int disabledCounter = getDisabledCounter( state ); <END> disabledCounter |= 1; newState = composeState( disabledCounter, NO_LIMIT ); } while ( !stateUpdater.compareAndSet( this, oldState, newState ) ); } else { do { oldState = stateUpdater.get( this ); int disabledCounter = getDisabledCounter( state ); disabledCounter &= 0xFFFFFFFE; int iopq = iops / QUANTUMS_PER_SECOND; newState = composeState( disabledCounter, iopq ); } while ( !stateUpdater.compareAndSet( this, oldState, newState ) ); } }</code><technical_language>I cleaner derive new oldState retrieved. a matter of taste, feel free ignore</technical_language>

Target:
private void updateConfiguration( Integer iops ) { long oldState; long newState; if ( iops == null || iops < 1 ) { do { oldState = stateUpdater.get( this ); int disabledCounter = getDisabledCounter( oldState ); disabledCounter |= 1; newState = composeState( disabledCounter, NO_LIMIT ); } while ( !stateUpdater.compareAndSet( this, oldState, newState ) ); } else { do { oldState = stateUpdater.get( this ); int disabledCounter = getDisabledCounter( oldState ); disabledCounter &= 0xFFFFFFFE; int iopq = iops / QUANTUMS_PER_SECOND; newState = composeState( disabledCounter, iopq ); } while ( !stateUpdater.compareAndSet( this, oldState, newState ) ); } }
Source:
<code><START> public List<QualityProfile> load(String projectKey, @Nullable String profileName) { <END> StringBuilder url = new StringBuilder(WS_URL + "?projectKey=" + encodeForUrl(projectKey)); if (profileName != null) { url.append("&profileName=").append(encodeForUrl(profileName)); } getOrganizationKey().ifPresent(k -> url.append("&organization=").append(encodeForUrl(k))); return call(url.toString()); }</code><technical_language>+s changed appends</technical_language>

Target:
public List<QualityProfile> load(String projectKey, @Nullable String profileName) { StringBuilder url = new StringBuilder(WS_URL + "?projectKey=").append(encodeForUrl(projectKey)); if (profileName != null) { url.append("&profileName=").append(encodeForUrl(profileName)); } getOrganizationKey().ifPresent(k -> url.append("&organization=").append(encodeForUrl(k))); return call(url.toString()); }
Source:
<code>public boolean pollWhileWaitingForTaskCompletionWithDefaultTimeout(FutureVDSCall<?> task, Guid vdsId) { final long <START> timeout = <END> TimeUnit.MINUTES.toMillis(2); return pollWhileWaitingForTaskCompletion(task, vdsId, timeout); }</code><technical_language>is point of separate variable. in method call hard code in pollWhileWaitingForTaskCompletion</technical_language>

Target:
public boolean pollWhileWaitingForTaskCompletionWithDefaultTimeout(FutureVDSCall<?> task, Guid vdsId) { return pollWhileWaitingForTaskCompletion(task, vdsId, DEFAULT_TIMEOUT); }
Source:
<code>void addSymbol(SymbolStyleSearchResult symbol) { <START> this.symbols.add(symbol); <END> notifyItemInserted(symbols.size() - 1); }</code><technical_language>drop this hungarian casing</technical_language>

Target:
void addSymbol(SymbolStyleSearchResult symbol) { mSymbols.add(symbol); notifyItemInserted(mSymbols.size() - 1); }
Source:
<code><START> protected final void initialize(final OrderBean bean, final Order order) { <END> fillTotalPrice(bean, order); fillTotalItems(bean, order); fillLineItems(bean, order); fillTotalPrice(bean, order); fillSalesTax(bean, order); fillSubtotalPrice(bean, order); fillCustomerEmail(bean, order); fillShippingAddress(bean, order); fillBillingAddress(bean, order); fillShippingMethod(bean, order); fillPaymentDetails(bean, order); fillOrderDate(bean, order); fillOrderNumber(bean, order); }</code><technical_language>is duplication, cart fields</technical_language>

Target:
protected final void initialize(final OrderBean bean, final Order order) { fillCartInfo(bean, order); fillOrderDate(bean, order); fillOrderNumber(bean, order); }