auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean verifyCertificate(X509Certificate certificate, Attributes attributes) throws NamingException { Attribute attribute = attributes.get(ldapAttribute); final int size = attribute.size(); for (int i = 0; i < size; i++) { <START> LdapName certSubjectDn = new LdapName(certificate.getSubjectDN().getName()); <END> LdapName attributeDn = new LdapName((String)attribute.get(i)); if (certSubjectDn.equals(attributeDn)) { return true; } } return false; }</code><technical_language>First, X509Certificate#getSubjectDN() is "denigrated", it. that, unsure if is LdapName a X500Principal this: X500Principal certSubjectDn = certificate.getSubjectX500Principal(); X500Principal attributeDn = new X500Principal((String) attribute.get(i)); difference is major, if getSubjectX500Principal() perform comparisons in terms of X500Principal</technical_language>

Target:
public boolean verifyCertificate(X509Certificate certificate, Attributes attributes) throws NamingException { Attribute attribute = attributes.get(ldapAttribute); if (attribute == null) return false; final int size = attribute.size(); for (int i = 0; i < size; i++) { Object attrSubject = attribute.get(i); if (attrSubject != null){ X500Principal certSubjectX500Principal = certificate.getSubjectX500Principal(); X500Principal attSubjectX500Principal = new X500Principal((String) attrSubject); if ( certSubjectX500Principal.equals(attSubjectX500Principal) ) { return true; } } } return false; }
Source:
<code>private void handleSequencer(Layout layout) { log.trace("Handling sequencer failures"); if (localMonitoringService.getMetrics().getSequencerStatus() == SequencerStatus.READY) { log.trace("Primary sequencer is ready. Nothing to do"); return; } if (sequencerNotReadyCounter.getEpoch() != layout.getEpoch()) { log.trace("Current epoch is different to layout epoch. Update current epoch to: {}", layout.getEpoch()); sequencerNotReadyCounter = new SequencerNotReadyCounter(layout.getEpoch(), 1); return; } sequencerNotReadyCounter.increment(); if (sequencerNotReadyCounter.getCounter() < SEQUENCER_NOT_READY_THRESHOLD) { return; } <START> log.info("Attempting to bootstrap the primary sequencer."); <END> getCorfuRuntime() .getLayoutManagementView() .asyncSequencerBootstrap(serverContext.copyManagementLayout(), failureDetectorWorker); }</code><technical_language>this handle failed node time. if 2 nodes failed in 5 node cluster. is limitation achieving</technical_language>

Target:
private CompletableFuture<DetectorTask> handleSequencer(Layout layout) { log.trace("Handling sequencer failures"); if (localMonitoringService.getMetrics().join().getSequencerStatus() == SequencerStatus.READY) { log.trace("Primary sequencer is ready. Nothing to do"); return DETECTOR_TASK_SKIPPED; } if (sequencerNotReadyCounter.getEpoch() != layout.getEpoch()) { log.trace("Current epoch is different to layout epoch. Update current epoch to: {}", layout.getEpoch()); sequencerNotReadyCounter = new SequencerNotReadyCounter(layout.getEpoch(), 1); return DETECTOR_TASK_SKIPPED; } sequencerNotReadyCounter.increment(); if (sequencerNotReadyCounter.getCounter() < SEQUENCER_NOT_READY_THRESHOLD) { return DETECTOR_TASK_SKIPPED; } log.info("Attempting to bootstrap the primary sequencer."); return getCorfuRuntime() .getLayoutManagementView() .asyncSequencerBootstrap(serverContext.copyManagementLayout(), failureDetectorWorker) .thenApply(DetectorTask::fromBool); }
Source:
<code>private static void registerTransformers_EAP_7_2_0(ResourceTransformationDescriptionBuilder subsystemBuilder) { <START> <END> }</code><technical_language>This filled in 7.0.0 API is. If some chance create a new API version for EAP 7.2, rename whatever's registerTransformersWildFly15</technical_language>

Target:
private static void registerTransformers_EAP_7_2_0(ResourceTransformationDescriptionBuilder subsystemBuilder) { subsystemBuilder .addChildResource(UndertowExtension.PATH_APPLICATION_SECURITY_DOMAIN) .getAttributeBuilder() .addRejectCheck(RejectAttributeChecker.DEFINED, ENABLE_JASPI, INTEGRATED_JASPI) .setDiscard(DiscardAttributeChecker.ALWAYS, ENABLE_JASPI, INTEGRATED_JASPI) .end(); }
Source:
<code>public String toString() { <START> if (amount == (long) amount) { <END> return currency + " " + Long.toString((long) amount); } return currency + " " + Double.toString(amount); }</code><technical_language>DoubleMath.isMathematicalInteger</technical_language>

Target:
public String toString() { return currency + " " + (DoubleMath.isMathematicalInteger(amount) ? Long.toString((long) amount) : Double.toString(amount)); }
Source:
<code>public void create( org.guvnor.common.services.project.model.Package pkg, String baseFileName, final NewResourcePresenter presenter ) { BusyPopup.showMessage( translationService.getTranslation( FormEditorConstants.NewFormDefinitionlHandlerSelectFormUse ) ); modelerService.call( path -> { BusyPopup.close(); presenter.complete(); notifySuccess(); PlaceRequest place = new PathPlaceRequest( (Path) path, "FormEditor" ); placeManager.goTo( place ); }, ( message, throwable ) -> { BusyPopup.close(); ErrorPopup.showMessage( CommonConstants.INSTANCE.SorryAnItemOfThatNameAlreadyExistsInTheRepositoryPleaseChooseAnother() ); <START> return true; <END> } ).createForm( pkg.getPackageMainResourcesPath(), buildFileName( baseFileName, resourceType ), formModelsPresenter.getFormModel() ); }</code><technical_language>If handled error, I false returned instead</technical_language>

Target:
public void create( org.guvnor.common.services.project.model.Package pkg, String baseFileName, final NewResourcePresenter presenter ) { BusyPopup.showMessage( translationService.getTranslation( FormEditorConstants.NewFormDefinitionlHandlerSelectFormUse ) ); modelerService.call( path -> { BusyPopup.close(); presenter.complete(); notifySuccess(); PlaceRequest place = new PathPlaceRequest( (Path) path, "FormEditor" ); placeManager.goTo( place ); }, ( message, throwable ) -> { BusyPopup.close(); ErrorPopup.showMessage( CommonConstants.INSTANCE.SorryAnItemOfThatNameAlreadyExistsInTheRepositoryPleaseChooseAnother() ); return false; } ).createForm( pkg.getPackageMainResourcesPath(), buildFileName( baseFileName, resourceType ), formModelsPresenter.getFormModel() ); }
Source:
<code>public void start() { int port = getIntSetting(SETTING_PORT); String host = getStringSetting(SETTING_HOST); try { <START> graphiteHttpUrl = new URL("http", host, port, "upload"); <END> } catch (MalformedURLException e) { throw new EmbeddedJmxTransException(e); } logger.info("Start Graphite writer connected to '{}'...", graphiteHttpUrl); metricPathPrefix = getStringSetting(SETTING_NAME_PREFIX, DEFAULT_NAME_PREFIX); metricPathPrefix = getStrategy().resolveExpression(metricPathPrefix); if (!metricPathPrefix.isEmpty() && !metricPathPrefix.endsWith(".")) { metricPathPrefix = metricPathPrefix + "."; } }</code><technical_language>in configuration GRAPHITE_PROXY_URL instead of restricting http (non SSL) /upload URI "host" & "port" approach</technical_language>

Target:
public void start() { String url = getStringSetting(SETTING_URL); try { graphiteHttpUrl = new URL(url); } catch (MalformedURLException e) { throw new EmbeddedJmxTransException(e); } logger.info("Start Graphite writer connected to '{}'...", graphiteHttpUrl); metricPathPrefix = getStringSetting(SETTING_NAME_PREFIX, DEFAULT_NAME_PREFIX); metricPathPrefix = getStrategy().resolveExpression(metricPathPrefix); if (!metricPathPrefix.isEmpty() && !metricPathPrefix.endsWith(".")) { metricPathPrefix = metricPathPrefix + "."; } }
Source:
<code>public static String convertToDebianVersion( String version, boolean apply, String envName, String template, Date timestamp ) { Matcher matcher = SNAPSHOT_PATTERN.matcher(version); if (matcher.matches()) { version = matcher.group(1) + "~"; if (apply) { final String envValue = System.getenv(envName); if(template != null && template.length() > 0) { <START> int startBracket = template.indexOf('['); <END> int endBracket = template.indexOf(']'); if(startBracket == -1 || endBracket == -1) { version += template; } else { final String date = new SimpleDateFormat(template.substring(startBracket + 1, endBracket)).format(timestamp); String datePrefix = startBracket == 0 ? "" : template.substring(0, startBracket); String dateSuffix = endBracket == template.length() ? "" : template.substring(endBracket + 1); version += datePrefix + date + dateSuffix; } } else if (envValue != null && envValue.length() > 0) { version += envValue; } else { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); version += dateFormat.format(timestamp); } } else { version += "SNAPSHOT"; } } else { matcher = BETA_PATTERN.matcher(version); if (matcher.matches()) { if (matcher.group(1) != null) { version = matcher.group(1) + "~" + matcher.group(4) + matcher.group(5); } else { version = matcher.group(3) + "~" + matcher.group(4) + matcher.group(5); } } } version = version.replaceAll("[^\\.+~A-Za-z0-9]", "+").replaceAll("\\++", "+"); return version; }</code><technical_language>code I referring to. parsing replacement separated out</technical_language>

Target:
public static String convertToDebianVersion( String version, boolean apply, String envName, String template, Date timestamp ) { Matcher matcher = SNAPSHOT_PATTERN.matcher(version); if (matcher.matches()) { version = matcher.group(1) + "~"; if (apply) { final String envValue = System.getenv(envName); if(template != null && template.length() > 0) { version += formatSnapshotTemplate(template, timestamp); } else if (envValue != null && envValue.length() > 0) { version += envValue; } else { SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMddHHmmss"); dateFormat.setTimeZone(TimeZone.getTimeZone("UTC")); version += dateFormat.format(timestamp); } } else { version += "SNAPSHOT"; } } else { matcher = BETA_PATTERN.matcher(version); if (matcher.matches()) { if (matcher.group(1) != null) { version = matcher.group(1) + "~" + matcher.group(4) + matcher.group(5); } else { version = matcher.group(3) + "~" + matcher.group(4) + matcher.group(5); } } } version = version.replaceAll("[^\\.+~A-Za-z0-9]", "+").replaceAll("\\++", "+"); return version; }
Source:
<code>public String getDescr() { <START> switch (m_name) { <END> case RRD_TIME_SERIES_STRATEGY_NAME: return "RRD (RRDTool or JRobin)"; case NEWTS_TIME_SERIES_STRATEGY_NAME: return "Newts"; case EVALUETE_TIME_SERIES_STRATEGY_NAME: return "Evaluate (Sizing mode, all data discarded)"; } return m_name; }</code><technical_language>This switch avoided passing description in constructor i.e.: RRD(RRD_TIME_SERIES_STRATEGY_NAME, "RRD (RRDTool JRobin)"),</technical_language>

Target:
public String getDescr() { return m_descr; }
Source:
<code>private void addDAGToCurrentDAG(ModuleMeta moduleMeta) { LogicalPlan subDag = moduleMeta.getDag(); String subDAGName = moduleMeta.getName(); String name; for (OperatorMeta operatorMeta : subDag.getAllOperators()) { name = subDAGName + MODULE_NAMESPACE_SEPARATOR + operatorMeta.getName(); this.addOperator(name, operatorMeta.getOperator()); OperatorMeta operatorMetaNew = this.getOperatorMeta(name); operatorMetaNew.setModuleName(operatorMeta.getModuleName() == null ? subDAGName : subDAGName + MODULE_NAMESPACE_SEPARATOR + operatorMeta.getModuleName()); } for (StreamMeta streamMeta : subDag.getAllStreams()) { OutputPortMeta sourceMeta = streamMeta.getSource(); List<InputPort<?>> ports = new LinkedList<>(); for (InputPortMeta inputPortMeta : streamMeta.getSinks()) { ports.add(inputPortMeta.getPortObject()); } InputPort[] inputPorts = ports.toArray(new InputPort[]{}); name = subDAGName + MODULE_NAMESPACE_SEPARATOR + streamMeta.getName(); StreamMeta streamMetaNew = this.addStream(name, sourceMeta.getPortObject(), inputPorts); <START> streamMetaNew.setModuleName(streamMeta.getModuleName() == null ? subDAGName : subDAGName + "_" + streamMeta.getModuleName()); <END> } }</code><technical_language>Removed</technical_language>

Target:
private void addDAGToCurrentDAG(ModuleMeta moduleMeta) { LogicalPlan subDag = moduleMeta.getDag(); String subDAGName = moduleMeta.getName(); String name; for (OperatorMeta operatorMeta : subDag.getAllOperators()) { name = subDAGName + MODULE_NAMESPACE_SEPARATOR + operatorMeta.getName(); this.addOperator(name, operatorMeta.getOperator()); OperatorMeta operatorMetaNew = this.getOperatorMeta(name); operatorMetaNew.setModuleName(operatorMeta.getModuleName() == null ? subDAGName : subDAGName + MODULE_NAMESPACE_SEPARATOR + operatorMeta.getModuleName()); } for (StreamMeta streamMeta : subDag.getAllStreams()) { OutputPortMeta sourceMeta = streamMeta.getSource(); List<InputPort<?>> ports = new LinkedList<>(); for (InputPortMeta inputPortMeta : streamMeta.getSinks()) { ports.add(inputPortMeta.getPortObject()); } InputPort[] inputPorts = ports.toArray(new InputPort[]{}); name = subDAGName + MODULE_NAMESPACE_SEPARATOR + streamMeta.getName(); this.addStream(name, sourceMeta.getPortObject(), inputPorts); } }
Source:
<code>public void queueMove(Location from, Location to) { <START> new Throwable().printStackTrace(); <END> queueLock.readLock().lock(); try { movingQueue.put(from, to); } finally { queueLock.readLock().unlock(); } }</code><technical_language>printing a stacktrace here...</technical_language>

Target:
public void queueMove(Location from, Location to) { queueLock.readLock().lock(); try { movingQueue.put(from, to); } finally { queueLock.readLock().unlock(); } }
Source:
<code>public void addSingleNodeWithPages() { DocStructInterface ds = null; <START> DocStructTypeInterface docStructTypeInterface = this.myPrefs.getDocStrctTypeByName(this.tempTyp); <END> try { ds = addNode(this.docStruct, this.digitalDocument, docStructTypeInterface, this.positionOfNewDocStrucElement, 1, null, null); } catch (UGHException e) { logger.error(e.getMessage()); } if (!this.pagesStart.equals("") && !this.pagesEnd.equals("")) { DocStructInterface temp = this.docStruct; this.docStruct = ds; this.ajaxPageStart = this.pagesStart; this.ajaxPageEnd = this.pagesEnd; ajaxSeitenStartUndEndeSetzen(); this.docStruct = temp; } readMetadataAsFirstTree(); }</code><technical_language>Interface appended variable name</technical_language>

Target:
public void addSingleNodeWithPages() { DocStructInterface docStruct = null; DocStructTypeInterface docStructType = this.myPrefs.getDocStrctTypeByName(this.tempTyp); try { docStruct = addNode(this.docStruct, this.digitalDocument, docStructType, this.positionOfNewDocStrucElement, 1, null, null); } catch (UGHException e) { logger.error(e.getMessage()); } if (!this.pagesStart.equals("") && !this.pagesEnd.equals("")) { DocStructInterface temp = this.docStruct; this.docStruct = docStruct; this.ajaxPageStart = this.pagesStart; this.ajaxPageEnd = this.pagesEnd; ajaxSeitenStartUndEndeSetzen(); this.docStruct = temp; } readMetadataAsFirstTree(); }
Source:
<code>public static ArrayList<String> readFile(String filePath, Class<?> publisherClass) throws java.io.FileNotFoundException, java.io.IOException { ArrayList<String> aList = new ArrayList<String>(); try { <START> final InputStream is = publisherClass.getResourceAsStream(filePath); <END> try { final Reader r = new InputStreamReader(is); try { final BufferedReader br = new BufferedReader(r); try { String line = null; while ((line = br.readLine()) != null) { aList.add(line); } br.close(); r.close(); is.close(); } finally { try { br.close(); } catch (IOException e) { e.printStackTrace(); } } } finally { try { r.close(); } catch (IOException e) { e.printStackTrace(); } } } finally { try { is.close(); } catch (IOException e) { e.printStackTrace(); } } } catch (IOException e) { e.printStackTrace(); } return aList; }</code><technical_language>Overkill. hardcode HtmlPublisher.class. (The original code triggered a FindBugs violation, BTW; is safe for subclassing another package.)</technical_language>

Target:
public static ArrayList<String> readFile(String filePath, Class<?> publisherClass) throws java.io.FileNotFoundException, java.io.IOException { ArrayList<String> aList = new ArrayList<String>(); try { final InputStream is = publisherClass.getResourceAsStream(filePath); try { final Reader r = new InputStreamReader(is, Charset.defaultCharset()); try { final BufferedReader br = new BufferedReader(r); try { String line = null; while ((line = br.readLine()) != null) { aList.add(line); } br.close(); r.close(); is.close(); } finally { try { br.close(); } catch (IOException e) { e.printStackTrace(); } } } finally { try { r.close(); } catch (IOException e) { e.printStackTrace(); } } } finally { try { is.close(); } catch (IOException e) { e.printStackTrace(); } } } catch (IOException e) { e.printStackTrace(); } return aList; }
Source:
<code>public static String toSRS(final CoordinateReferenceSystem crs) { if( crs == null ){ return null; } boolean forcedLonLat = false; try { forcedLonLat = Boolean.getBoolean("org.geotools.referencing.forceXY") || Boolean.TRUE.equals(Hints.getSystemDefault(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER)); } catch(Exception e) { LOGGER.log(Level.FINE, "Failed to determine if we are in forced lon/lat mode", e); } if (forcedLonLat && CRS.getAxisOrder(crs, false) == AxisOrder.NORTH_EAST) { try { Integer code = CRS.lookupEpsgCode(crs, false); if (code != null) { return "urn:ogc:def:crs:EPSG::" + code; } } catch (Exception e) { LOGGER.log(Level.FINE, "Failed to determine EPSG code", e); } } if( crs == DefaultGeographicCRS.WGS84){ return "CRS:84"; } for( ReferenceIdentifier identifier : crs.getIdentifiers() ){ if( identifier.toString().contains("EPSG:") || identifier.toString().contains("CRS:")){ return identifier.toString(); } } final ReferenceIdentifier name = crs.getName(); if (name != null) { if( name.toString().contains("EPSG:") || name.toString().contains("CRS:")){ return name.toString(); } <START> return "CUSTOM:"+name.toString(); END> } return null; }</code><technical_language>This is work, "CUSTOM" anything, name, a chance of resolvable a CoordinateReferenceSystem object, while "CUSTOM:xyzw" is guaranteed work</technical_language>

Target:
public static String toSRS(final CoordinateReferenceSystem crs) { if (crs == null) { return null; } boolean forcedLonLat = false; try { forcedLonLat = Boolean.getBoolean("org.geotools.referencing.forceXY") || Boolean.TRUE.equals(Hints.getSystemDefault(Hints.FORCE_LONGITUDE_FIRST_AXIS_ORDER)); } catch(Exception e) { LOGGER.log(Level.FINE, "Failed to determine if we are in forced lon/lat mode", e); } if (forcedLonLat && CRS.getAxisOrder(crs, false) == AxisOrder.NORTH_EAST) { try { Integer code = CRS.lookupEpsgCode(crs, false); if (code != null) { return "urn:ogc:def:crs:EPSG::" + code; } } catch (Exception e) { LOGGER.log(Level.FINE, "Failed to determine EPSG code", e); } } if (crs == DefaultGeographicCRS.WGS84) { return "CRS:84"; } Set<ReferenceIdentifier> identifiers = crs.getIdentifiers(); if (identifiers.isEmpty()) { final ReferenceIdentifier name = crs.getName(); if (name != null) { return name.toString(); } return null; } else { for (ReferenceIdentifier identifier : crs.getIdentifiers()) { String srs = identifier.toString(); if (srs.contains("EPSG:") || srs.contains("CRS:")) { return srs; } } ReferenceIdentifier name = crs.getName(); if (name != null && (name.toString().contains("EPSG:") || name.toString().contains("CRS:"))) { return name.toString(); } return identifiers.iterator().next().toString(); } }
Source:
<code>public List<GitHubBranchCommitCheck> getChecks() { <START> return checks; <END> }</code><technical_language>if (isNull(checks)) { checks = new ArrayList(); } return checks;</technical_language>

Target:
public List<GitHubBranchCommitCheck> getChecks() { if (isNull(checks)) { checks = new ArrayList<>(); } return checks; }
Source:
<code>public void revokeAccessTokens(String id, String token) { AccessToken accessToken = new AccessToken.Builder(token).build(); try { connector.revokeAllAccessTokens(id, accessToken); } catch (ConnectionInitializationException e) { LOGGER.warn(String.format("Unable to revoke access token on auth-server %s: %s", authServerHome, e.getMessage())); throw e; } catch (UnauthorizedException e) { LOGGER.warn("Error revoking all access tokens", e); <START> throw new InvalidTokenException("The provided access token is not valid", e); <END> } }</code><technical_language>log exception in other log statements. I a good idea, clutters logs for operations, log message: LOGGER.warn(String.format("Error revoking access tokens auth-server %s: %s", authServerHome, e.getMessage()))</technical_language>

Target:
public void revokeAccessTokens(String id, String token) { AccessToken accessToken = new AccessToken.Builder(token).build(); try { connector.revokeAllAccessTokens(id, accessToken); } catch (ConnectionInitializationException e) { LOGGER.warn(String.format("Unable to revoke access token on auth-server %s: %s", authServerHome, e.getMessage())); throw e; } catch (UnauthorizedException e) { LOGGER.warn(String.format("Error revoking all access tokens on auth-server: %s", e.getMessage())); throw new InvalidTokenException("The provided access token is not valid", e); } }
Source:
<code>public void testCrossCacheTransactionInAnotherThread() throws Exception { withAllIsolationsAndConcurrencies(new IgniteClosure<Object, Void>() { @Override public Void apply(Object o) { try { <START> crossCacheTransactionInAnotherThread(); <END> } catch (Exception ignore) { assert false : "Impossible situation"; } return null; } }); }</code><technical_language>rename "e" "ignored" Please fail() <LINK_0></technical_language>

Target:
public void testCrossCacheTransactionInAnotherThread() throws Exception { runWithAllIsolations(new IgniteCallable<Void>() { @Override public Void call() throws Exception { crossCacheTransactionInAnotherThread(); return null; } }); }
Source:
<code>public void filterQuery_invalidQuery_defaultSearchPerformed() { int[][] expected = new int[][]{{0, 1, 2, 3}}; String query = "unknown"; verifyActionResult(expected, "filterQuery", query); query = ""; verifyActionResult(expected, "filterQuery", query); query = "info"; verifyActionResult(expected, "filterQuery", query); query = "info:"; verifyActionResult(expected, "filterQuery", query); query = "receiver unknown_connector info:content"; verifyActionResult(expected, "filterQuery", query); query = "unknown:subject1 | info:keyword1"; verifyActionResult(expected, "filterQuery", query); expected = new int[][]{{0, 1, 2, 3, 4, 5, 6}}; <START> query = "information:unkown"; <END> verifyActionResult(expected, "filterQuery", query, "all", "true"); }</code><technical_language>Is unkown a typo</technical_language>

Target:
public void filterQuery_invalidQuery_defaultSearchPerformed() { int[][] expected = new int[][]{{0, 1, 2, 3}}; String query = "unknown"; verifyActionResult(expected, "filterQuery", query); query = ""; verifyActionResult(expected, "filterQuery", query); query = "info"; verifyActionResult(expected, "filterQuery", query); query = "info:"; verifyActionResult(expected, "filterQuery", query); query = "receiver unknown_connector info:content"; verifyActionResult(expected, "filterQuery", query); query = "unknown:subject1 | info:keyword1"; verifyActionResult(expected, "filterQuery", query); expected = new int[][]{{0, 1, 2, 3, 4, 5, 6}}; query = "information:unknown"; verifyActionResult(expected, "filterQuery", query, "all", "true"); }
Source:
<code>public DatastreamD2Config(Properties config, String clusterName, Map<String, String> endpoints) { Validate.notNull(config, "null D2 config"); Validate.notBlank(clusterName, "invalid cluster name"); Validate.notEmpty(endpoints, "invalid endpoints"); _zkBasePath = String.format("/%s/d2", clusterName); <START> _zkSessionTimeout = Integer.parseInt(config.getProperty(ZK_SESSION_TIMEOUT, DEFAULT_ZK_SESSION_TIMEOUT)); <END> _zkRetryLimit = Integer.parseInt(config.getProperty(ZK_RETRY_LIMIT, DEFAULT_ZK_RETRY_LIMIT)); _endpoints = endpoints; _serviceConfig.put(LB_STRATEGY_LIST, getSingletonList("degraderV3")); _serviceConfig.put(PRIORITIZED_SCHEMES, getSingletonList("http")); getOptServiceConfig(config); Map<String, Object> svcMap = new HashMap<>(); svcMap.put("services", _endpoints.entrySet().stream().collect(Collectors .toMap(e -> e.getKey(), e -> getSingletonMap("path", e.getValue())))); _clusterConfig.put(DMS_D2_CLUSTER, svcMap); }</code><technical_language>if wrap Properties object in a VerifiableProperties object, helpers verifiableProperties.getInt(propKey)</technical_language>

Target:
public DatastreamD2Config(Properties config, String clusterName, Map<String, String> endpoints) { Validate.notNull(config, "null D2 config"); Validate.notBlank(clusterName, "invalid cluster name"); Validate.notEmpty(endpoints, "invalid endpoints"); VerifiableProperties props = new VerifiableProperties(config); _zkBasePath = String.format("/%s/d2", clusterName); _zkSessionTimeout = props.getInt(ZK_SESSION_TIMEOUT, DEFAULT_ZK_SESSION_TIMEOUT); _zkRetryLimit = props.getInt(ZK_RETRY_LIMIT, DEFAULT_ZK_RETRY_LIMIT); _endpoints = endpoints; _serviceConfig.put(LB_STRATEGY_LIST, getSingletonList("degraderV3")); _serviceConfig.put(PRIORITIZED_SCHEMES, getSingletonList("http")); getOptServiceConfig(config); Map<String, Object> svcMap = new HashMap<>(); svcMap.put("services", _endpoints.entrySet().stream().collect(Collectors .toMap(e -> e.getKey(), e -> getSingletonMap("path", e.getValue())))); _clusterConfig.put(DMS_D2_CLUSTER, svcMap); }
Source:
<code>public ActiveScanPanel(ExtensionActiveScan extension) { super( "ascan", new ImageIcon(ActiveScanPanel.class.getResource("/resource/icon/16/093.png")), extension); tabbedPane.addChangeListener( new ChangeListener() { @Override <START> public void stateChanged(ChangeEvent e) { <END> switch (tabbedPane.getSelectedIndex()) { case 0: getExportButton().setTable(getMessagesTable()); break; case 1: getExportButton().setTable(getFilterMessageTable()); break; } } }); this.extension = extension; this.setDefaultAccelerator( extension .getView() .getMenuShortcutKeyStroke( KeyEvent.VK_A, KeyEvent.ALT_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK, false)); this.setMnemonic(Constant.messages.getChar("ascan.panel.mnemonic")); }</code><technical_language>a lambda for shorter code</technical_language>

Target:
public ActiveScanPanel(ExtensionActiveScan extension) { super( "ascan", new ImageIcon(ActiveScanPanel.class.getResource("/resource/icon/16/093.png")), extension); tabbedPane.addChangeListener( (e) -> { switch (tabbedPane.getSelectedIndex()) { case 0: getExportButton().setTable(getMessagesTable()); break; case 1: getExportButton().setTable(getFilterMessageTable()); break; } }); this.extension = extension; this.setDefaultAccelerator( extension .getView() .getMenuShortcutKeyStroke( KeyEvent.VK_A, KeyEvent.ALT_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK, false)); this.setMnemonic(Constant.messages.getChar("ascan.panel.mnemonic")); }
Source:
<code>public boolean next(List<Cell> results) throws IOException { List<Cell> dataTableResults = new ArrayList<Cell>(); boolean next = super.next(dataTableResults); try { addMutations(dataTableResults); } catch (SQLException e) { <START> e.printStackTrace(); <END> } if (ServerUtil.readyToCommit(mutationList.size(), mutationList.byteSize(), maxBatchSize, maxBatchSizeBytes)||!next) { region.batchMutate(mutationList.toArray(new Mutation[mutationList.size()])); mutationList.clear(); } return next; }</code><technical_language>swallowing exception printing stdout/stderr. log worst. reason this exception bubble up</technical_language>

Target:
public boolean next(List<Cell> results) throws IOException { List<Cell> dataTableResults = new ArrayList<Cell>(); boolean next = super.next(dataTableResults); try { addMutations(dataTableResults); } catch (SQLException e) { throw new IOException(e.getMessage()); } if (ServerUtil.readyToCommit(mutationList.size(), mutationList.byteSize(), maxBatchSize, maxBatchSizeBytes)||!next) { region.batchMutate(mutationList.toArray(new Mutation[mutationList.size()])); mutationList.clear(); } return next; }
Source:
<code>public ContentUpdatingNitroBroadcastHandler(ContentResolver resolver, ContentWriter writer, <START> LocalOrRemoteNitroFetcher localOrRemoteNitroFetcher, GroupLock<String> lock) { <END> this.writer = writer; this.localOrRemoteFetcher = localOrRemoteNitroFetcher; this.lock = lock; }</code><technical_language>this amount of space is correct - want check intellij settings reformatting new spaces, is making PR difficult read</technical_language>

Target:
public ContentUpdatingNitroBroadcastHandler(ContentResolver resolver, ContentWriter writer, LocalOrRemoteNitroFetcher localOrRemoteNitroFetcher, GroupLock<String> lock) { this.writer = writer; this.localOrRemoteFetcher = localOrRemoteNitroFetcher; this.lock = lock; this.idCodec = SubstitutionTableNumberCodec.lowerCaseOnly(); }
Source:
<code>public MomentSketchWrapper fromByteBuffer(ByteBuffer buffer, int numBytes) { if (numBytes == 0) { <START> return EMPTY_SKETCH; <END> } buffer.limit(buffer.position() + numBytes); return MomentSketchWrapper.fromBytes(buffer); }</code><technical_language>EMPTY_SKETCH.toByteArray() result in empty array? Currently is a discrepancy fromByteBuffer() toBytes() suspicious reading code</technical_language>

Target:
public MomentSketchWrapper fromByteBuffer(ByteBuffer buffer, int numBytes) { if (numBytes == 0) { return null; } buffer.limit(buffer.position() + numBytes); return MomentSketchWrapper.fromBytes(buffer); }
Source:
<code>protected void copyAboutFile(final IProject createdProject) { InputStream inputStream = null; OutputStream outputStream = null; try { final URL url = Activator.getDefault().getBundle().getResource(NattableConfigurationConstants.ABOUT_FILE_NAME); inputStream = url.openStream(); final File newAboutFile = new File(createdProject.getLocation().toOSString() + File.separator + NattableConfigurationConstants.ABOUT_FILE_NAME); newAboutFile.createNewFile(); outputStream = new FileOutputStream(newAboutFile); int read = 0; byte[] bytes = new byte[1024]; <START> while ((read = inputStream.read(bytes)) != -1) { <END> outputStream.write(bytes, 0, read); } } catch (IOException e) { Activator.logException(e); } finally { if (inputStream != null) { try { inputStream.close(); } catch (IOException e) { Activator.logException(e); } } if (outputStream != null) { try { outputStream.close(); } catch (IOException e) { Activator.logException(e); } } } }</code><technical_language>invert</technical_language>

Target:
protected void copyAboutFile(final IProject createdProject) { InputStream inputStream = null; OutputStream outputStream = null; try { final URL url = Activator.getDefault().getBundle().getResource(NattableConfigurationConstants.ABOUT_FILE_NAME); inputStream = url.openStream(); final File newAboutFile = new File(createdProject.getLocation().toOSString() + File.separator + NattableConfigurationConstants.ABOUT_FILE_NAME); newAboutFile.createNewFile(); outputStream = new FileOutputStream(newAboutFile); int read = 0; byte[] bytes = new byte[1024]; while ((read = inputStream.read(bytes)) != -1) { outputStream.write(bytes, 0, read); } } catch (final IOException e) { Activator.logException(e); } finally { if (null != inputStream) { try { inputStream.close(); } catch (final IOException e) { Activator.logException(e); } } if (null != outputStream) { try { outputStream.close(); } catch (final IOException e) { Activator.logException(e); } } } }
Source:
<code>private void processDynamicElements(Menu menu, final MMenu menuModel) { if (!menu.isDisposed()) { menu.getDisplay().asyncExec(new Runnable() { public void run() { MMenuElement[] ml = menuModel.getChildren().toArray( new MMenuElement[menuModel.getChildren().size()]); for (int i = 0; i < ml.length; i++) { MMenuElement currentMenuElement = ml[i]; if (currentMenuElement instanceof MDynamicMenuContribution) { Object contribution = ((MDynamicMenuContribution) currentMenuElement) .getObject(); IEclipseContext dynamicMenuContext = EclipseContextFactory .create(); @SuppressWarnings("unchecked") ArrayList<MMenuElement> mel = (ArrayList<MMenuElement>) currentMenuElement .getTransientData() .get(MenuManagerShowProcessor.DYNAMIC_ELEMENT_STORAGE_KEY); dynamicMenuContext.set(List.class, mel); ContextInjectionFactory .invoke(contribution, AboutToHide.class, <START> dynamicMenuContext, null); <END> } } } }); } }</code><technical_language>Needs rebased <LINK_0></technical_language>

Target:
private void processDynamicElements(Menu menu, final MMenu menuModel) { if (!menu.isDisposed()) { menu.getDisplay().asyncExec(new Runnable() { public void run() { MMenuElement[] ml = menuModel.getChildren().toArray( new MMenuElement[menuModel.getChildren().size()]); for (int i = 0; i < ml.length; i++) { MMenuElement currentMenuElement = ml[i]; if (currentMenuElement instanceof MDynamicMenuContribution) { Object contribution = ((MDynamicMenuContribution) currentMenuElement) .getObject(); IEclipseContext dynamicMenuContext = EclipseContextFactory .create(); @SuppressWarnings("unchecked") ArrayList<MMenuElement> mel = (ArrayList<MMenuElement>) currentMenuElement .getTransientData() .get(MenuManagerShowProcessor.DYNAMIC_ELEMENT_STORAGE_KEY); dynamicMenuContext.set(List.class, mel); IEclipseContext parentContext = modelService .getContainingContext(currentMenuElement); ContextInjectionFactory.invoke(contribution, AboutToHide.class, parentContext, dynamicMenuContext, null); } } } }); } }
Source:
<code>static public void assertEquals(String message, float expected, float actual, float delta) { if (Float.compare(expected, actual) == 0) { return; } if (!(Math.abs(expected - actual) <= delta)) { <START> failNotEquals(message, Float.valueOf(expected), Float.valueOf(actual)); <END> } }</code><technical_language>This optimization; Float.valueOf(float f) calls 'new Float(f)'</technical_language>

Target:
static public void assertEquals(String message, float expected, float actual, float delta) { if (Float.compare(expected, actual) == 0) { return; } if (!(Math.abs(expected - actual) <= delta)) { failNotEquals(message, new Float(expected), new Float(actual)); } }
Source:
<code>public void configure(Binder binder) { <START> JsonConfigProvider.bind(binder, "druid.hadoop.security.kerberos", DruidKerberosConfig.class); <END> JsonConfigProvider.bind(binder, "druid.hadoop.security.spnego", SpnegoFilterConfig.class); Multibinder.newSetBinder(binder, ServletFilterHolder.class) .addBinding() .to(SpnegoFilterHolder.class); binder.bind(HttpClient.class) .annotatedWith(Global.class) .toProvider(new KerberosHttpClientProvider(new HttpClientModule.HttpClientProvider(Global.class))) .in(LazySingleton.class); binder.bind(HttpClient.class) .annotatedWith(Client.class) .toProvider(new KerberosHttpClientProvider(new HttpClientModule.HttpClientProvider(Client.class))) .in(LazySingleton.class); binder.bind(org.eclipse.jetty.client.HttpClient.class) .annotatedWith(Router.class) .toProvider(new KerberosJettyHttpClientProvider(new JettyHttpClientModule.HttpClientProvider(Router.class))) .in(LazySingleton.class); }</code><technical_language>nit: fare HdfsKerberosConfig HadoopKerberosConfig call this AuthKerberosConfig other name reflects scope</technical_language>

Target:
public void configure(Binder binder) { JsonConfigProvider.bind(binder, "druid.hadoop.security.kerberos", AuthenticationKerberosConfig.class); JsonConfigProvider.bind(binder, "druid.hadoop.security.spnego", SpnegoFilterConfig.class); Multibinder.newSetBinder(binder, ServletFilterHolder.class) .addBinding() .to(SpnegoFilterHolder.class); binder.bind(HttpClient.class) .annotatedWith(Global.class) .toProvider(new KerberosHttpClientProvider(new HttpClientModule.HttpClientProvider(Global.class))) .in(LazySingleton.class); binder.bind(HttpClient.class) .annotatedWith(Client.class) .toProvider(new KerberosHttpClientProvider(new HttpClientModule.HttpClientProvider(Client.class))) .in(LazySingleton.class); binder.bind(org.eclipse.jetty.client.HttpClient.class) .annotatedWith(Router.class) .toProvider(new KerberosJettyHttpClientProvider(new JettyHttpClientModule.HttpClientProvider(Router.class))) .in(LazySingleton.class); }
Source:
<code>public NoChangeMove<Solution_> createUndoMove(ScoreDirector<Solution_> scoreDirector) { <START> return new NoChangeMove<>(); <END> }</code><technical_language>Ow damn, I broke Partitioned Search realizing test coverage for it</technical_language>

Target:
protected AbstractMove<Solution_> createUndoMove(ScoreDirector<Solution_> scoreDirector) { return null; }
Source:
<code><START> public void testGetForVdsFilteredWithPermissionsNoPermissionsAndNoFilter() { <END> storage_pool result = dao.get(vds, UNPRIVILEGED_USER_ID, false); assertGetResult(result); }</code><technical_language>s/get/getForVds/</technical_language>

Target:
public void testGetForVdsFilteredWithPermissionsNoPermissionsAndNoFilter() { storage_pool result = dao.getForVds(vds, UNPRIVILEGED_USER_ID, false); assertGetResult(result); }
Source:
<code>private void synchronizeJavaProjectInTransaction(final OmniEclipseProject project, final IProject workspaceProject, SubMonitor progress) throws JavaModelException, CoreException { progress.setWorkRemaining(8); CorePlugin.workspaceOperations().addNature(workspaceProject, JavaCore.NATURE_ID, progress.newChild(1)); IJavaProject javaProject = JavaCore.create(workspaceProject); OutputLocationUpdater.update(javaProject, project.getOutputLocation(), progress.newChild(1)); SourceFolderUpdater.update(javaProject, project.getSourceDirectories(), progress.newChild(1)); <START> ClasspathUpdater.update(javaProject, project, progress.newChild(1)); <END> ClasspathContainerUpdater.update(javaProject, project.getClasspathContainers(), project.getJavaSourceSettings().get(), progress.newChild(1)); JavaSourceSettingsUpdater.update(javaProject, project, progress.newChild(1)); GradleClasspathContainerUpdater.updateFromModel(javaProject, project, SynchronizeGradleBuildOperation.this.allProjects, progress.newChild(1)); WtpClasspathUpdater.update(javaProject, project, progress.newChild(1)); }</code><technical_language>LibraryFilter a more expressive name</technical_language>

Target:
private void synchronizeJavaProjectInTransaction(final OmniEclipseProject project, final IProject workspaceProject, SubMonitor progress) throws JavaModelException, CoreException { progress.setWorkRemaining(8); CorePlugin.workspaceOperations().addNature(workspaceProject, JavaCore.NATURE_ID, progress.newChild(1)); IJavaProject javaProject = JavaCore.create(workspaceProject); OutputLocationUpdater.update(javaProject, project.getOutputLocation(), progress.newChild(1)); SourceFolderUpdater.update(javaProject, project.getSourceDirectories(), progress.newChild(1)); LibraryFilter.update(javaProject, project, progress.newChild(1)); ClasspathContainerUpdater.update(javaProject, project.getClasspathContainers(), project.getJavaSourceSettings().get(), progress.newChild(1)); JavaSourceSettingsUpdater.update(javaProject, project, progress.newChild(1)); GradleClasspathContainerUpdater.updateFromModel(javaProject, project, SynchronizeGradleBuildOperation.this.allProjects, progress.newChild(1)); WtpClasspathUpdater.update(javaProject, project, progress.newChild(1)); }
Source:
<code><START> private void checkValidTime(long t) { <END> if (t < getStartTime() || t > fEndTime) { throw new TimeRangeException(getSSID() + " Time:" + t + ", Start:" + getStartTime() + ", End:" + fEndTime); } }</code><technical_language>avoid repetition, - super method protected - getStartTime() / getEndTime() instead of fSht.getTreeStart() / fSht.getTreeEnd() reimplementation of getEndTime() in this class is re-used</technical_language>

Target:
private void checkValidTime(long t) { if (t < getStartTime() || t > fEndTime) { throw new TimeRangeException(String.format("%s Time:%d, Start:%d, End:%d", getSSID(), t, getStartTime(), fEndTime)); } }
Source:
<code>public void handleAction(final ActionParameters params) throws ActionException { final int id = params.getRequiredParamInt(PARAM_ID); final OskariLayer oskariLayer = mapLayerService.find(id); if (oskariLayer == null) { throw new ActionParamsException("Layer not found, id: " + id); } String url = oskariLayer.getUrl(); String wmsUrl = Helpers.getGetFeatureInfoUrlForProxy(url, params.getHttpParam(PARAM_SRS), params.getHttpParam(PARAM_BBOX), params.getHttpParam(PARAM_WIDTH), params.getHttpParam(PARAM_HEIGHT), params.getHttpParam(PARAM_X), params.getHttpParam(PARAM_Y), params.getHttpParam(PARAM_LAYERS)); LOGGER.debug("Details of the data cropping feature"); try { HttpURLConnection con = IOHelper.getConnection(wmsUrl); <START> if(hasAuthorization()){ <END> IOHelper.setupBasicAuth(con,croppingUsername, croppingPassword); } con.setRequestProperty("Accept-Charset", "UTF-8"); final String data = IOHelper.readString(con, "UTF-8"); JSONObject json = new JSONObject(data); ResponseHelper.writeResponse(params, json); } catch (JSONException e) { throw new ActionException("Could not get cropping:", e); } catch (MalformedURLException e) { throw new ActionException("Could not get cropping:", e); } catch (IOException e) { throw new ActionException("Could not get cropping:", e); } }</code><technical_language>username/password combination is for layers. Is this intentional</technical_language>

Target:
public void handleAction(final ActionParameters params) throws ActionException { final int id = params.getRequiredParamInt(PARAM_ID); final OskariLayer oskariLayer = mapLayerService.find(id); if (oskariLayer == null) { throw new ActionParamsException("Layer not found, id: " + id); } String url = oskariLayer.getUrl(); String wmsUrl = Helpers.getGetFeatureInfoUrlForProxy(url, params.getHttpParam(PARAM_SRS), params.getHttpParam(PARAM_BBOX), params.getHttpParam(PARAM_WIDTH), params.getHttpParam(PARAM_HEIGHT), params.getHttpParam(PARAM_X), params.getHttpParam(PARAM_Y), params.getHttpParam(PARAM_LAYERS)); LOGGER.debug("Details of the data cropping feature"); try { HttpURLConnection con = IOHelper.getConnection(wmsUrl, oskariLayer.getUsername(), oskariLayer.getPassword()); con.setRequestProperty("Accept-Charset", "UTF-8"); final String data = IOHelper.readString(con, "UTF-8"); JSONObject json = new JSONObject(data); ResponseHelper.writeResponse(params, json); } catch (JSONException e) { throw new ActionException("Could not get cropping:", e); } catch (MalformedURLException e) { throw new ActionException("Could not get cropping:", e); } catch (IOException e) { throw new ActionException("Could not get cropping:", e); } }
Source:
<code>public final int getColumnIndex(String name) { if (m_columnNameIndexMap != null) { Integer cachedIndex = m_columnNameIndexMap.get(name); if (cachedIndex != null) { return cachedIndex; } } else { m_columnNameIndexMap = new HashMap<String,Integer>(m_colCount); } assert(verifyTableInvariants()); for (int i = 0; i < m_colCount; i++) { if (getColumnName(i).equalsIgnoreCase(name)) <START> m_columnNameIndexMap.put(name, Integer.valueOf(i)); <END> return i; } String msg = "No Column named '" + name + "'. Existing columns are:"; for (int i = 0; i < m_colCount; i++) { msg += "[" + i + "]" + getColumnName(i) + ","; } throw new IllegalArgumentException(msg); }</code><technical_language>a curly brace pair for if too. Otherwise, return 0</technical_language>

Target:
public final int getColumnIndex(String name) { if (m_columnNameIndexMap != null) { Integer cachedIndex = m_columnNameIndexMap.get(name.toUpperCase()); if (cachedIndex != null) { return cachedIndex; } } else { m_columnNameIndexMap = new HashMap<String,Integer>(m_colCount); } assert(verifyTableInvariants()); for (int i = 0; i < m_colCount; i++) { if (getColumnName(i).equalsIgnoreCase(name)) { m_columnNameIndexMap.put(name.toUpperCase(), Integer.valueOf(i)); return i; } } String msg = "No Column named '" + name + "'. Existing columns are:"; for (int i = 0; i < m_colCount; i++) { msg += "[" + i + "]" + getColumnName(i) + ","; } throw new IllegalArgumentException(msg); }
Source:
<code>private JSONArray buildSchemasResponseBody(Map<String, List<Attribute>> schemas) throws CharonException { JSONArray rootObject = new JSONArray(); <START> JSONObject userSchemaObject = buildUserSchema(schemas.get(USER_CORE_SCHEMA_URI)); <END> rootObject.put(userSchemaObject); if (schemas.get(ENTERPRISE_USER_SCHEMA_URI) != null) { JSONObject enterpriseUserSchemaObject = buildEnterpriseUserSchema(schemas.get(ENTERPRISE_USER_SCHEMA_URI)); rootObject.put(enterpriseUserSchemaObject); } return rootObject; }</code><technical_language>add null check schemas.get(USER_CORE_SCHEMA_URI)</technical_language>

Target:
private JSONArray buildSchemasResponseBody(Map<String, List<Attribute>> schemas) throws CharonException { JSONArray rootObject = new JSONArray(); if (schemas.get(USER_CORE_SCHEMA_URI) != null) { JSONObject userSchemaObject = buildUserSchema(schemas.get(USER_CORE_SCHEMA_URI)); rootObject.put(userSchemaObject); } if (schemas.get(ENTERPRISE_USER_SCHEMA_URI) != null) { JSONObject enterpriseUserSchemaObject = buildEnterpriseUserSchema(schemas.get(ENTERPRISE_USER_SCHEMA_URI)); rootObject.put(enterpriseUserSchemaObject); } return rootObject; }
Source:
<code>public Optional<DirectDownloadHandle> getDirectDownloadHandle(String key) { final long secondsToExpire = config.has("direct_download_expiration") ? <START> config.get("direct_download_expiration", Long.class) : 10*60; <END> GeneratePresignedUrlRequest req = new GeneratePresignedUrlRequest(bucket, key); req.setExpiration(Date.from(Instant.now().plusSeconds(secondsToExpire))); String url = client.generatePresignedUrl(req).toString(); return Optional.of(DirectDownloadHandle.of(url)); }</code><technical_language>@muga I this method set default value. <LINK_0></technical_language>

Target:
public Optional<DirectDownloadHandle> getDirectDownloadHandle(String key) { final long secondsToExpire = config.get("direct_download_expiration", Long.class, 10L*60); GeneratePresignedUrlRequest req = new GeneratePresignedUrlRequest(bucket, key); req.setExpiration(Date.from(Instant.now().plusSeconds(secondsToExpire))); String url = client.generatePresignedUrl(req).toString(); return Optional.of(DirectDownloadHandle.of(url)); }
Source:
<code>protected synchronized DatagramSocket getSocket() throws IOException { if (this.socketExpression != null) { <START> return this.socketExpression.getValue(this.evaluationContext, DatagramSocket.class); <END> } if (this.socket == null) { if (acknowledge) { if (localAddress == null) { this.socket = this.ackPort == 0 ? new DatagramSocket() : new DatagramSocket(this.ackPort); } else { InetAddress whichNic = InetAddress.getByName(this.localAddress); this.socket = new DatagramSocket(new InetSocketAddress(whichNic, this.ackPort)); } if (this.soReceiveBufferSize > 0) { socket.setReceiveBufferSize(this.soReceiveBufferSize); } if (logger.isDebugEnabled()) { logger.debug("Listening for acks on port: " + getAckPort()); } updateAckAddress(); } else { this.socket = new DatagramSocket(); } setSocketAttributes(this.socket); } return this.socket; }</code><technical_language>I missing main gain Expression stuff. context evaluate. I requestMessage a root object. So, this getSocket() logic socketExpression moved handleMessageInternal()</technical_language>

Target:
protected synchronized DatagramSocket getSocket() throws IOException { if (this.socket == null) { if (acknowledge) { if (localAddress == null) { this.socket = this.ackPort == 0 ? new DatagramSocket() : new DatagramSocket(this.ackPort); } else { InetAddress whichNic = InetAddress.getByName(this.localAddress); this.socket = new DatagramSocket(new InetSocketAddress(whichNic, this.ackPort)); } if (this.soReceiveBufferSize > 0) { socket.setReceiveBufferSize(this.soReceiveBufferSize); } if (logger.isDebugEnabled()) { logger.debug("Listening for acks on port: " + getAckPort()); } updateAckAddress(); } else { this.socket = new DatagramSocket(); } setSocketAttributes(this.socket); } return this.socket; }