auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static Properties defaultProperties() { Properties properties = BaseHttpApiMetadata.defaultProperties(); properties.setProperty(PROPERTY_AUTH_TAG, "AWS"); properties.setProperty(PROPERTY_HEADER_TAG, S3Headers.DEFAULT_AMAZON_HEADERTAG); properties.setProperty(PROPERTY_S3_SERVICE_PATH, "/"); properties.setProperty(PROPERTY_S3_VIRTUAL_HOST_BUCKETS, "false"); properties.setProperty(PROPERTY_RELAX_HOSTNAME, "true"); properties.setProperty(PROPERTY_BLOBSTORE_DIRECTORY_SUFFIX, "/"); <START> properties.setProperty(PROPERTY_V4_REQUEST_SIGNATURES, "false"); <END> properties.setProperty(PROPERTY_USER_METADATA_PREFIX, String.format("x-${%s}-meta-", PROPERTY_HEADER_TAG)); properties.setProperty(PROPERTY_IDEMPOTENT_METHODS, "DELETE,GET,HEAD,OPTIONS,POST,PUT"); properties.setProperty(PROPERTY_JCLOUDS_S3_CHUNKED_SIZE, String.valueOf(64 * 1024)); return properties; }</code><technical_language>AWSS3ApiMetadata set this "true"</technical_language>

Target:
public static Properties defaultProperties() { Properties properties = BaseHttpApiMetadata.defaultProperties(); properties.setProperty(PROPERTY_AUTH_TAG, "AWS"); properties.setProperty(PROPERTY_HEADER_TAG, S3Headers.DEFAULT_AMAZON_HEADERTAG); properties.setProperty(PROPERTY_S3_SERVICE_PATH, "/"); properties.setProperty(PROPERTY_S3_VIRTUAL_HOST_BUCKETS, "false"); properties.setProperty(PROPERTY_RELAX_HOSTNAME, "true"); properties.setProperty(PROPERTY_BLOBSTORE_DIRECTORY_SUFFIX, "/"); properties.setProperty(PROPERTY_S3_V4_REQUEST_SIGNATURES, "false"); properties.setProperty(PROPERTY_USER_METADATA_PREFIX, String.format("x-${%s}-meta-", PROPERTY_HEADER_TAG)); properties.setProperty(PROPERTY_IDEMPOTENT_METHODS, "DELETE,GET,HEAD,OPTIONS,POST,PUT"); properties.setProperty(PROPERTY_JCLOUDS_S3_CHUNKED_SIZE, String.valueOf(64 * 1024)); return properties; }
Source:
<code>public static void pushExportBuffer( int partitionId, String signature, long startSequenceNumber, long committedSequenceNumber, long tupleCount, long uniqueId, long genId, long bufferPtr, ByteBuffer buffer, boolean sync) { if (bufferPtr != 0) DBBPool.registerUnsafeMemory(bufferPtr); ExportManager instance = instance(); try { <START> long lastSeqNo = startSequenceNumber + tupleCount - 1; <END> ExportGeneration generation = instance.m_generation.get(); if (generation == null) { if (buffer != null) { DBBPool.wrapBB(buffer).discard(); } return; } generation.pushExportBuffer(partitionId, signature, startSequenceNumber, committedSequenceNumber, (int)tupleCount, uniqueId, genId, buffer, sync); } catch (Exception e) { exportLog.error("Error pushing export buffer", e); } }</code><technical_language>unused</technical_language>

Target:
public static void pushExportBuffer( int partitionId, String signature, long startSequenceNumber, long committedSequenceNumber, long tupleCount, long uniqueId, long genId, long bufferPtr, ByteBuffer buffer, boolean sync) { if (bufferPtr != 0) DBBPool.registerUnsafeMemory(bufferPtr); ExportManager instance = instance(); try { ExportGeneration generation = instance.m_generation.get(); if (generation == null) { if (buffer != null) { DBBPool.wrapBB(buffer).discard(); } return; } generation.pushExportBuffer(partitionId, signature, startSequenceNumber, committedSequenceNumber, (int)tupleCount, uniqueId, genId, buffer, sync); } catch (Exception e) { exportLog.error("Error pushing export buffer", e); } }
Source:
<code>public static Job createSystem(final ICoreRunnable runnable) { <START> Job job = create("", runnable); END> job.setSystem(true); return job; }</code><technical_language>This delegate two-argument createSystem variant</technical_language>

Target:
public static Job createSystem(final ICoreRunnable runnable) { return create("", runnable); }
Source:
<code>private void startSiteIconUpload(final String filePath) { if (TextUtils.isEmpty(filePath)) { ToastUtils.showToast(getActivity(), R.string.error_locating_image, ToastUtils.Duration.SHORT); return; } File file = new File(filePath); if (!file.exists()) { ToastUtils.showToast(getActivity(), R.string.error_locating_image, ToastUtils.Duration.SHORT); return; <START> } <END> SiteModel site = getSelectedSite(); if (site != null) { MediaModel media = buildMediaModel(file, site); UploadService.uploadMedia(getActivity(), media); } }</code><technical_language>if (!file.exists()) branch calls statements if (TextUtils.isEmpty(filePath)) branch above, combine if (TextUtils.isEmpty(filePath) || !(new File(filePath).exists()))</technical_language>

Target:
private void startSiteIconUpload(final String filePath) { if (TextUtils.isEmpty(filePath)) { ToastUtils.showToast(getActivity(), R.string.error_locating_image, ToastUtils.Duration.SHORT); return; } File file = new File(filePath); if (!file.exists()) { ToastUtils.showToast(getActivity(), R.string.file_error_create, ToastUtils.Duration.SHORT); return; } SiteModel site = getSelectedSite(); if (site != null) { MediaModel media = buildMediaModel(file, site); UploadService.uploadMedia(getActivity(), media); } else { ToastUtils.showToast(getActivity(), R.string.error_generic, ToastUtils.Duration.SHORT); AppLog.e(T.MAIN, "Unexpected error - Site icon upload failed, because there wasn't any site selected."); } }
Source:
<code>public void addHeaders(ServiceHeaderContext<?> context) { String auth = context.getConfig().getChildValue(ServiceConfig.KEY_SEGMENT_AUTH); if (!ServiceConfig.VALUE_AUTH_FORWARD.equals(auth)) { return; } SecurityContext securityContext = SecurityContextHolder.getContext(); if (securityContext == null) { return; } String authorizationHeader = context.getConfig().getChildValue(AUTHORIZATION); <START> context.setHeader(AUTHORIZATION, authorizationHeader + ""); <END> }</code><technical_language>Please remove + ""</technical_language>

Target:
public void addHeaders(ServiceHeaderContext<?> context) { String auth = context.getConfig().getChildValue(ServiceConfig.KEY_SEGMENT_AUTH); if (!ServiceConfig.VALUE_AUTH_FORWARD.equals(auth)) { return; } SecurityContext securityContext = SecurityContextHolder.getContext(); if (securityContext == null) { return; } String authorizationHeader = context.getConfig().getChildValue(AUTHORIZATION); context.setHeader(AUTHORIZATION, authorizationHeader); }
Source:
<code>public String getHostId() { CTFClock clock = getCTFTrace().getClock(); if (clock != null) { return (String) clock.getProperty(CLOCK_HOST_PROPERTY); } <START> return getName(); <END> }</code><technical_language>super.getHostId(). now, if change TmfTrace defines host ID, clock-less CTF traces follow</technical_language>

Target:
public String getHostId() { CTFClock clock = getCTFTrace().getClock(); if (clock != null) { return (String) clock.getProperty(CLOCK_HOST_PROPERTY); } return super.getHostId(); }
Source:
<code><START> public String getKey() { <END> StringBuffer sb = new StringBuffer(); sb.append(this.user.getUserId()); sb.append("_").append(this.language.getId()); if (StringUtils.isNotBlank(this.queryString)) { sb.append("_").append(this.queryString); } if (UtilMethods.isSet(persona) && StringUtils.isNotBlank(this.persona.getKeyTag())) { sb.append("_").append(this.persona); } return sb.toString(); }</code><technical_language>this method, "_" replaced StringPool.UNDERLINE</technical_language>

Target:
public String getKey() { StringBuilder sb = new StringBuilder(); sb.append(this.user.getUserId()); sb.append(StringPool.UNDERLINE).append(this.language.getId()); if (StringUtils.isNotBlank(this.queryString)) { sb.append(StringPool.UNDERLINE).append(this.queryString); } if (UtilMethods.isSet(persona) && StringUtils.isNotBlank(this.persona.getKeyTag())) { sb.append(StringPool.UNDERLINE).append(this.persona); } return sb.toString(); }
Source:
<code>static public Drive getDriveService(String token) { GoogleCredential credential = new GoogleCredential().setAccessToken(token); return new Drive.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential).setHttpRequestInitializer(new HttpRequestInitializer() { @Override public void initialize(HttpRequest httpRequest) throws IOException { credential.initialize(httpRequest); <START> httpRequest.setConnectTimeout(300 * 60000); END> httpRequest.setReadTimeout(300 * 60000); } }) .setApplicationName(SERVICE_APP_NAME).build(); }</code><technical_language>@jackyq2015 Is this timeout Google recommends ? I Apache HTTP a internal default of 3 minutes timeout overridden in Apache's newer package version</technical_language>

Target:
static public Drive getDriveService(String token) { GoogleCredential credential = new GoogleCredential().setAccessToken(token); return new Drive.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential).setHttpRequestInitializer(new HttpRequestInitializer() { @Override public void initialize(HttpRequest httpRequest) throws IOException { credential.initialize(httpRequest); httpRequest.setConnectTimeout(3 * 60000); httpRequest.setReadTimeout(3 * 60000); } }) .setApplicationName(SERVICE_APP_NAME).build(); }
Source:
<code>public void testFingerprintUmd() { testModules( "test.js", lines( "(function (name, context, definition) {", " 'use strict';", " if (typeof define === 'function' && define.amd) {", " define(definition);", " } else if (typeof module !== 'undefined' && module.exports) {", " module.exports = definition();", " } else if (context.exports) {", " context.exports = definition();", " } else {", " context[name] = definition();", " }", "})('Fingerprint2', this, function() {", " var Fingerprint2 = function() {", " if (!(this instanceof Fingerprint2)) { return new Fingerprint2(); }", " };", " return Fingerprint2$$module$test;", "})"), lines( " var module$test = {};", "var Fingerprint2$$module$test = function() {", <START> " if (!(this instanceof Fingerprint2$$module$test)) {", <END> " return new Fingerprint2$$module$test();", " }", "};", "module$test.default = Fingerprint2$$module$test;")); }</code><technical_language>@blickly I this Fingerprint2</technical_language>

Target:
public void testFingerprintUmd() { testModules( "test.js", lines( "(function (name, context, definition) {", " 'use strict';", " if (typeof define === 'function' && define.amd) {", " define(definition);", " } else if (typeof module !== 'undefined' && module.exports) {", " module.exports = definition();", " } else if (context.exports) {", " context.exports = definition();", " } else {", " context[name] = definition();", " }", "})('Fingerprint2', this, function() {", " var Fingerprint2 = function() {", " if (!(this instanceof Fingerprint2)) { return new Fingerprint2(); }", " };", " return Fingerprint2;", "})"), lines( " var module$test = {};", "var Fingerprint2$$module$test = function() {", " if (!(this instanceof Fingerprint2$$module$test)) {", " return new Fingerprint2$$module$test();", " }", "};", "module$test.default = Fingerprint2$$module$test;")); }
Source:
<code>public TpcdsDataSource(TpcdsTable table, int scaleFactor) { <START> this.table = table; <END> this.scaleFactor = scaleFactor; }</code><technical_language>requireNonNull</technical_language>

Target:
public TpcdsDataSource(TpcdsTable table, int scaleFactor) { checkArgument(scaleFactor > 0, "Scale factor should be greater than 0: %s", scaleFactor); this.table = table; this.scaleFactor = scaleFactor; }
Source:
<code>private final List<String> managedPathsWithFiles(Configuration config, DeploymentType deployment) { ImmutableList.Builder<String> nonEmptyPaths = ImmutableList.builder(); if (!config.m_isEnterprise) { return nonEmptyPaths.build(); } PathsType paths = deployment.getPaths(); <START> String voltDbRoot = paths.getVoltdbroot().getPath(); <END> String path; if ((path = managedPathEmptyCheck(voltDbRoot, paths.getSnapshots().getNodePath())) != null) nonEmptyPaths.add(path); if ((path = managedPathEmptyCheck(voltDbRoot, paths.getExportoverflow().getNodePath())) != null) nonEmptyPaths.add(path); if ((path = managedPathEmptyCheck(voltDbRoot, paths.getDroverflow().getNodePath())) != null) nonEmptyPaths.add(path); if ((path = managedPathEmptyCheck(voltDbRoot, paths.getCommandlog().getNodePath())) != null) nonEmptyPaths.add(path); if ((path = managedPathEmptyCheck(voltDbRoot, paths.getCommandlogsnapshot().getNodePath())) != null) nonEmptyPaths.add(path); return nonEmptyPaths.build(); }</code><technical_language>Do paths.getVoltdbroot().getNodePath()</technical_language>

Target:
private List<String> managedPathsWithFiles(Configuration config, DeploymentType deployment) { ImmutableList.Builder<String> nonEmptyPaths = ImmutableList.builder(); if (!config.m_isEnterprise) { return nonEmptyPaths.build(); } PathsType paths = deployment.getPaths(); String voltDbRoot = getVoltDBRootPath(paths.getVoltdbroot()); String path; if ((path = managedPathEmptyCheck(voltDbRoot, getSnapshotPath(paths.getSnapshots()))) != null) nonEmptyPaths.add(path); if ((path = managedPathEmptyCheck(voltDbRoot, getExportOverflowPath(paths.getExportoverflow()))) != null) nonEmptyPaths.add(path); if ((path = managedPathEmptyCheck(voltDbRoot, getDROverflowPath(paths.getDroverflow()))) != null) nonEmptyPaths.add(path); if ((path = managedPathEmptyCheck(voltDbRoot, getCommandLogPath(paths.getCommandlog()))) != null) nonEmptyPaths.add(path); if ((path = managedPathEmptyCheck(voltDbRoot, getCommandLogSnapshotPath(paths.getCommandlogsnapshot()))) != null) nonEmptyPaths.add(path); return nonEmptyPaths.build(); }
Source:
<code>public String getIdentifierForSeed(long seed) { int seqLength = firstIdentifierBase == null ? 1 : firstIdentifierBase.length(); String identifier = IdgenUtil.convertToBase(seed, baseCharacterSet.toCharArray(), seqLength); PrefixProvider prefixProvider = getPrefixProvider(prefix); if (prefixProvider != null) { identifier = (prefix == null ? identifier : prefixProvider.getValue() + identifier); <START> } else { <END> identifier = (prefix == null ? identifier : prefix + identifier); } identifier = (suffix == null ? identifier : identifier + suffix); if (getIdentifierType() != null && StringUtils.isNotEmpty(getIdentifierType().getValidator())) { try { Class<?> c = Context.loadClass(getIdentifierType().getValidator()); IdentifierValidator v = (IdentifierValidator)c.newInstance(); identifier = v.getValidIdentifier(identifier); } catch (Exception e) { throw new RuntimeException("Error generating check digit with " + getIdentifierType().getValidator(), e); } } if (this.minLength != null && this.minLength > 0) { if (identifier.length() < this.minLength) { throw new RuntimeException("Invalid configuration for IdentifierSource. Length minimum set to " + this.minLength + " but generated " + identifier); } } if (this.maxLength != null && this.maxLength > 0) { if (identifier.length() > this.maxLength) { throw new RuntimeException("Invalid configuration for IdentifierSource. Length maximum set to " + this.maxLength + " but generated " + identifier); } } return identifier; }</code><technical_language>is prefixProvider null, this happen</technical_language>

Target:
public String getIdentifierForSeed(long seed) { int seqLength = firstIdentifierBase == null ? 1 : firstIdentifierBase.length(); String identifier = IdgenUtil.convertToBase(seed, baseCharacterSet.toCharArray(), seqLength); PrefixProvider prefixProvider = getPrefixProvider(prefix); if (prefixProvider == null) { prefixProvider = new ConstantPrefixProvider(prefix); } identifier = prefixProvider.getValue() + identifier; identifier = (suffix == null ? identifier : identifier + suffix); if (getIdentifierType() != null && StringUtils.isNotEmpty(getIdentifierType().getValidator())) { try { Class<?> c = Context.loadClass(getIdentifierType().getValidator()); IdentifierValidator v = (IdentifierValidator)c.newInstance(); identifier = v.getValidIdentifier(identifier); } catch (Exception e) { throw new RuntimeException("Error generating check digit with " + getIdentifierType().getValidator(), e); } } if (this.minLength != null && this.minLength > 0) { if (identifier.length() < this.minLength) { throw new RuntimeException("Invalid configuration for IdentifierSource. Length minimum set to " + this.minLength + " but generated " + identifier); } } if (this.maxLength != null && this.maxLength > 0) { if (identifier.length() > this.maxLength) { throw new RuntimeException("Invalid configuration for IdentifierSource. Length maximum set to " + this.maxLength + " but generated " + identifier); } } return identifier; }
Source:
<code>public static void e(String tag, String message) { <START> SalesforceLogger.getLogger(COMPONENT_NAME, <END> SmartStoreSDKManager.getInstance().getAppContext()).e( tag, message); }</code><technical_language>code java SalesforceLogger.getLogger(COMPONENT_NAME, SalesforceSDKManager.getInstance().getAppContext()) is repeated a lot introduce a helper method: java private static SalesforceSDKLogger getLogger() { return SalesforceLogger.getLogger(COMPONENT_NAME, SalesforceSDKManager.getInstance().getAppContext()); }</technical_language>

Target:
public static void e(String tag, String message) { getLogger().e(tag, message); }
Source:
<code>public void getGapsFromNonNormalizedTracker() { tracker.addRange(500, 999); <START> for (Pair<Long, Long> gap = tracker.getFirstGap(1); gap != null; gap = tracker <END> .getFirstGap(gap.getSecond() + 1)) }</code><technical_language>a check of expected gaps here..</technical_language>

Target:
public void getGapsFromNonNormalizedTracker() { tracker.addRange(500, 999); assertEquals(Pair.of(ExportSequenceNumberTracker.MIN_SEQNO, 499L), tracker.getFirstGap(1)); assertEquals(Pair.of(1000L, ExportSequenceNumberTracker.INFINITE_SEQNO), tracker.getFirstGap(500)); assertNull(tracker.getFirstGap(ExportSequenceNumberTracker.INFINITE_SEQNO + 1)); }
Source:
<code><START> public Team getTeam(EntityPlayer player) <END> { String username = player.getName(); for(Team team : teams) { for (String name : team.members) { if (username.equals(name)) { return team; } } } return null; }</code><technical_language>worth returning Optional in this method instead of returning null issues line</technical_language>

Target:
public Optional<Team> getTeam(EntityPlayer player) { String username = player.getName(); for(Team team : teams) { for (String name : team.members) { if (username.equals(name)) { return Optional.of(team); } } } return Optional.empty(); }
Source:
<code>public void update(final VDS host) { try { AnsibleCommandBuilder command = new AnsibleCommandBuilder() .hostnames(host.getHostName()) .verboseLevel(AnsibleVerbosity.LEVEL1) .logFileDirectory(VdsDeployBase.HOST_DEPLOY_LOG_DIRECTORY) <START> .logFilePrefix("ovirt-host-mgmt-ansible") <END> .logFileName(host.getHostName()) .logFileSuffix(CorrelationIdTracker.getCorrelationId()) .playbook(AnsibleConstants.HOST_UPGRADE_PLAYBOOK); if (ansibleExecutor.runCommand(command).getAnsibleReturnCode() != AnsibleReturnCode.OK) { log.error("Failed to update host '{}'.", host.getName()); throw new RuntimeException("Failed to update host '{}'."); } } catch (InterruptedException | IOException ex) { throw new RuntimeException(ex); } }</code><technical_language>change this "ovirt-host-check-for-updates"</technical_language>

Target:
public void update(final VDS host) { try { AnsibleCommandBuilder command = new AnsibleCommandBuilder() .hostnames(host.getHostName()) .verboseLevel(AnsibleVerbosity.LEVEL1) .logFileDirectory(VdsDeployBase.HOST_DEPLOY_LOG_DIRECTORY) .logFilePrefix("ovirt-host-mgmt-ansible") .logFileName(host.getHostName()) .logFileSuffix(CorrelationIdTracker.getCorrelationId()) .playbook(AnsibleConstants.HOST_UPGRADE_PLAYBOOK); if (ansibleExecutor.runCommand(command).getAnsibleReturnCode() != AnsibleReturnCode.OK) { String error = String.format("Failed to update host '%1$s'.", host.getHostName()); log.error(error); throw new RuntimeException(error); } } catch (InterruptedException | IOException ex) { throw new RuntimeException(ex); } }
Source:
<code>private boolean matchesFilter(StackTraceElement[] stackTraces) { for (StackTraceElement element : stackTraces) { String methodName = element.getMethodName(); String className = element.getClassName(); int low = 0; int high = filters.length; while (low < high) { int mid = (low + high) >>> 1; Filter filter = filters[mid]; int c = methodName.compareTo(filter.methodName); <START> if (c == 0) <END> c = className.compareTo(filter.className); if (c == 0) { return true; } else if (c < 0) { high = mid; } else { low = mid + 1; } } } return false; }</code><technical_language>Please blocks for control statement blocks, i.e., {}</technical_language>

Target:
private boolean matchesFilter(StackTraceElement[] stackTraces) { for (StackTraceElement element : stackTraces) { String methodName = element.getMethodName(); String className = element.getClassName(); int low = 0; int high = filters.length; while (low < high) { int mid = (low + high) >>> 1; Filter filter = filters[mid]; int c = methodName.compareTo(filter.methodName); if (c == 0) { c = className.compareTo(filter.className); } if (c == 0) { return true; } else if (c < 0) { high = mid; } else { low = mid + 1; } } } return false; }
Source:
<code>protected void checkFieldType(Type type, Object value) throws OperationException { if (!type.isListType()) { throw new OperationException("Only multivalued types can be set using this operation"); } ListType listType = (ListType) type; Type itemType = listType.getFieldType(); if (itemType.isComplexType()) { throw new UnsupportedOperationException("Manage only lists of scalar items"); } <START> String exceptionReason = String.format("Given type \"%s\" value is not a %s type", value, itemType.getName()); <END> try { if (itemType.convert(value) == null) { throw new UnsupportedOperationException(exceptionReason); } } catch (TypeException | ClassCastException e) { throw new OperationException(exceptionReason, e); } }</code><technical_language>need compute error message in general case failure, please move this (duplicating if needed) a lines needed</technical_language>

Target:
protected void checkFieldType(Type type, Object value) throws OperationException { if (!type.isListType()) { throw new OperationException("Only multivalued types can be set using this operation"); } ListType listType = (ListType) type; Type itemType = listType.getFieldType(); if (itemType.isComplexType()) { throw new UnsupportedOperationException("Manage only lists of scalar items"); } try { if (itemType.convert(value) == null) { String exceptionReason = String.format("Given type \"%s\" value is not a %s type", value, itemType.getName()); throw new UnsupportedOperationException(exceptionReason); } } catch (TypeException | ClassCastException e) { String exceptionReason = String.format("Given type \"%s\" value is not a %s type", value, itemType.getName()); throw new OperationException(exceptionReason, e); } }
Source:
<code>public void floorTest() throws DatabaseEngineException { test5Columns(); EntityEntry.Builder entry = entry() .set("COL1", 2) .set("COL2", false) .set("COL3", 2.5D) .set("COL4", 3L) .set("COL5", "ADEUS"); for (int i = 0; i < 10; i++) { entry.set("COL1", i); engine.persist("TEST", entry .build()); } List<Map<String, ResultColumn>> query = engine.query(select(floor(column("COL3")).alias("FLOOR")).from(table("TEST"))); <START> assertEquals("result ok?", 2.0, query.get(0).get("FLOOR").toDouble(), 0.1); <END> }</code><technical_language>0.1 is a high delta. Ideally a static variable in tests please check STDDEV tests 0.0001D delta</technical_language>

Target:
public void floorTest() throws DatabaseEngineException { test5Columns(); EntityEntry.Builder entry = entry() .set("COL1", 2) .set("COL2", false) .set("COL3", 2.5D) .set("COL4", 3L) .set("COL5", "ADEUS"); for (int i = 0; i < 10; i++) { entry.set("COL1", i); engine.persist("TEST", entry .build()); } List<Map<String, ResultColumn>> query = engine.query(select(floor(column("COL3")).alias("FLOOR")).from(table("TEST"))); assertEquals("result ok?", 2.0, query.get(0).get("FLOOR").toDouble(), DELTA); }
Source:
<code>public final void testConsumerTransitionsToProcessingWithIntermittentInitializationFailures() { ExecutorService failingService = spy(executorService); ShardConsumer consumer = new ShardConsumer(recordsPublisher, failingService, shardInfo, logWarningForTaskAfterMillis, shardConsumerArgument, blockedOnParentsState, t -> t, 1, taskExecutionListener, 0); mockSuccessfulUnblockOnParents(); mockSuccessfulInitializeWithFailureTransition(); mockSuccessfulProcessing(null); doAnswer(invocation -> directlyExecuteRunnable(invocation)) .doThrow(new RejectedExecutionException()) .doThrow(new RejectedExecutionException()) .doThrow(new RejectedExecutionException()) <START> .doAnswer(invocation -> directlyExecuteRunnable(invocation)) <END> .when(failingService).execute(any()); int arbitraryExecutionCount = 6; do { try { consumer.executeLifecycle(); } catch (Exception e) { } } while (--arbitraryExecutionCount > 0); assertEquals(ShardConsumerState.PROCESSING.consumerState().state(), consumer.currentState().state()); verify(failingService, times(5)).execute(any()); }</code><technical_language>Is ArgumentCaptor here</technical_language>

Target:
public final void testConsumerTransitionsToProcessingWithIntermittentInitializationFailures() { ExecutorService failingService = spy(executorService); ShardConsumer consumer = new ShardConsumer(recordsPublisher, failingService, shardInfo, logWarningForTaskAfterMillis, shardConsumerArgument, blockedOnParentsState, t -> t, 1, taskExecutionListener, 0); mockSuccessfulUnblockOnParents(); mockSuccessfulInitializeWithFailureTransition(); mockSuccessfulProcessing(null); doAnswer(invocation -> directlyExecuteRunnable(invocation)) .doThrow(new RejectedExecutionException()) .doThrow(new RejectedExecutionException()) .doThrow(new RejectedExecutionException()) .doAnswer(invocation -> directlyExecuteRunnable(invocation)) .when(failingService).execute(any()); int arbitraryExecutionCount = 6; do { try { consumer.executeLifecycle(); } catch (Exception e) { fail("Unexpected exception while executing consumer lifecycle"); } } while (--arbitraryExecutionCount > 0); assertEquals(ShardConsumerState.PROCESSING.consumerState().state(), consumer.currentState().state()); verify(failingService, times(5)).execute(any()); }
Source:
<code>public void setMaxWait(int num) { blockingTimeoutMillis = num; log.warn( <START> "maxWait deprecated dbcp pool attribute usage, should use blockingTimeoutMillis geronimo pool attribute instead"); <END> }</code><technical_language>Wrong log message stating geronimo is removed in this PR</technical_language>

Target:
public void setMaxWait(int num) { blockingTimeoutMillis = num; }
Source:
<code>private void assertCorrectMetacardsReturned( List<Result> results, int startIndex, int expectedNumberOfMetacards) { <START> assertThat(results.size(), is(expectedNumberOfMetacards)); <END> for (int i = 0; i < expectedNumberOfMetacards; i++) { int id = startIndex + i; assertThat(results.get(i).getMetacard().getId(), equalTo("ID_" + String.valueOf(id))); } }</code><technical_language>assertThat(results, hasSize(expectedNumberOfMetacards))</technical_language>

Target:
private void assertCorrectMetacardsReturned( List<Result> results, int startIndex, int expectedNumberOfMetacards) { assertThat(results, hasSize(expectedNumberOfMetacards)); for (int i = 0; i < expectedNumberOfMetacards; i++) { int id = startIndex + i; assertThat(results.get(i).getMetacard().getId(), equalTo("ID_" + String.valueOf(id))); } }
Source:
<code>public void cannotDeleteClientByUnauthorizedUsers() { <START> makeUnauthorizedOperationAndVerify(getClientPath("any-client"), RequestType.DELETE, null); <END> }</code><technical_language>CLIENT_PATH others</technical_language>

Target:
public void cannotDeleteClientByUnauthorizedUsers() { makeUnauthorizedOperationAndVerify(getClientPath(TEST_CLIENT_3), RequestType.DELETE, null); }
Source:
<code><START> private void handleIOException(IOExceptionWithStatus ioe) throws IOException { <END> Status.Code code = ioe.getStatus().getCode(); if (retryOptions.isRetryable(code)) { logger.info("Reissuing scan after receiving error with status: %s.", code.name()); if (currentErrorBackoff == null) { currentErrorBackoff = retryOptions.createBackoff(); } backOffAndRetry(currentErrorBackoff, ioe); } else { throw ioe; } }</code><technical_language>currentTimeoutBackoff reset here</technical_language>

Target:
private void handleIOException(IOExceptionWithStatus ioe) throws IOException { Status.Code code = ioe.getStatus().getCode(); if (retryOptions.isRetryable(code)) { logger.info("Reissuing scan after receiving error with status: %s.", code.name()); if (currentErrorBackoff == null) { currentErrorBackoff = retryOptions.createBackoff(); } long nextBackOffMillis = currentErrorBackoff.nextBackOffMillis(); if (nextBackOffMillis == BackOff.STOP) { throw new BigtableRetriesExhaustedException("Exhausted streaming retries.", ioe); } sleep(nextBackOffMillis); reissueRequest(); } else { throw ioe; } }
Source:
<code>public Object getService(String serviceName) { synchronized (agentServices) { checkRunning(); Object service = agentServices.get(serviceName); if (service != null) return service; PriorityQueue<ServiceReference<IAgentServiceFactory>> refs; try { refs = new PriorityQueue<ServiceReference<IAgentServiceFactory>>(context.getServiceReferences(IAgentServiceFactory.class, "(" + IAgentServiceFactory.PROP_CREATED_SERVICE_NAME + '=' + serviceName + ')')); } catch (InvalidSyntaxException e) { e.printStackTrace(); return null; } if (refs == null || refs.isEmpty()) return null; <START> ServiceReference<IAgentServiceFactory> firstRef = refs.iterator().next(); <END> ServiceTracker<IAgentServiceFactory, Object> tracker = new ServiceTracker<IAgentServiceFactory, Object>(context, firstRef, this); tracker.open(); IAgentServiceFactory factory = (IAgentServiceFactory) tracker.getService(); if (factory == null) { tracker.close(); return null; } service = factory.createService(this); if (service == null) { tracker.close(); return null; } registerService(serviceName, service); trackers.put(firstRef, tracker); return service; } }</code><technical_language>a PriorityQueue, replace iterator().next() a more specific method peek</technical_language>

Target:
public Object getService(String serviceName) { synchronized (agentServices) { checkRunning(); Object service = agentServices.get(serviceName); if (service != null) return service; PriorityQueue<ServiceReference<IAgentServiceFactory>> refs; try { refs = new PriorityQueue<ServiceReference<IAgentServiceFactory>>(context.getServiceReferences(IAgentServiceFactory.class, "(" + IAgentServiceFactory.PROP_CREATED_SERVICE_NAME + '=' + serviceName + ')')); } catch (InvalidSyntaxException e) { e.printStackTrace(); return null; } if (refs == null || refs.isEmpty()) return null; ServiceReference<IAgentServiceFactory> firstRef = refs.peek(); ServiceTracker<IAgentServiceFactory, Object> tracker = new ServiceTracker<IAgentServiceFactory, Object>(context, firstRef, this); tracker.open(); IAgentServiceFactory factory = (IAgentServiceFactory) tracker.getService(); if (factory == null) { tracker.close(); return null; } service = factory.createService(this); if (service == null) { tracker.close(); return null; } registerService(serviceName, service); trackers.put(firstRef, tracker); return service; } }
Source:
<code>public boolean navigate(Button.ClickEvent clickEvent) { BaseUI.getCurrentEventBus().getConsumerRegistry().unregister(new ResponseEntityKey()); <START> BaseUI.getCurrent().getNavigator().navigateTo(navigateTo); <END> return true; }</code><technical_language>getCurrentNavigator</technical_language>

Target:
public boolean navigate(Button.ClickEvent clickEvent) { BaseUI.getCurrentEventBus().getConsumerRegistry().unregister(new ResponseEntityKey()); BaseUI.getCurrentNavigator().navigateTo(navigateTo); return true; }
Source:
<code>public static void main(String[] args){ MenuWindow = new MenuFrame(); <START> } <END></code><technical_language>remove red</technical_language>

Target:
public static void main(String[] args){ menuwindow = new MenuFrame(); }
Source:
<code>public long index(long... indices) { long index = 0; long[] physicalStrides = physicalStrides(sizes); for (int i = 0; i < indices.length && i < strides.length; i++) { long originalCoordinate = indices[i]; long mappedCoordinate = starts[i] + strides[i] * (originalCoordinate / blocks[i]) + (originalCoordinate % blocks[i]); <START> index += mappedCoordinate * physicalStrides[i]; <END> } return index; }</code><technical_language>This is bound reduce severely performance starts, counts, blocks used. need performance degradation in case</technical_language>

Target:
public long index(long... indices) { return index.index(indices); }
Source:
<code>void performRetry(BitmapHunter hunter) { if (hunter.isCancelled()) return; if (service.isShutdown()) { performError(hunter, false); return; } NetworkInfo networkInfo = null; if (scansNetworkChanges) { ConnectivityManager connectivityManager = getService(context, CONNECTIVITY_SERVICE); networkInfo = connectivityManager.getActiveNetworkInfo(); } boolean hasConnectivity = networkInfo != null && networkInfo.isConnected(); boolean shouldRetryHunter = hunter.shouldRetry(airplaneMode, networkInfo); boolean supportsReplay = hunter.supportsReplay(); if (!shouldRetryHunter) { boolean willReplay = scansNetworkChanges && supportsReplay; performError(hunter, willReplay); if (willReplay) { markForReplay(hunter); } return; } if (!scansNetworkChanges || hasConnectivity) { hunter.future = service.submit(hunter); if (hunter.getPicasso().loggingEnabled) { <START> log(OWNER_DISPATCHER, VERB_RETRIED, getLogIdsForHunter(hunter)); <END> } return; } performError(hunter, supportsReplay); if (supportsReplay) { markForReplay(hunter); } }</code><technical_language>This future tense ("retrying") retry happened yet. move log submit if want</technical_language>

Target:
void performRetry(BitmapHunter hunter) { if (hunter.isCancelled()) return; if (service.isShutdown()) { performError(hunter, false); return; } NetworkInfo networkInfo = null; if (scansNetworkChanges) { ConnectivityManager connectivityManager = getService(context, CONNECTIVITY_SERVICE); networkInfo = connectivityManager.getActiveNetworkInfo(); } boolean hasConnectivity = networkInfo != null && networkInfo.isConnected(); boolean shouldRetryHunter = hunter.shouldRetry(airplaneMode, networkInfo); boolean supportsReplay = hunter.supportsReplay(); if (!shouldRetryHunter) { boolean willReplay = scansNetworkChanges && supportsReplay; performError(hunter, willReplay); if (willReplay) { markForReplay(hunter); } return; } if (!scansNetworkChanges || hasConnectivity) { if (hunter.getPicasso().loggingEnabled) { log(OWNER_DISPATCHER, VERB_RETRYING, getLogIdsForHunter(hunter)); } hunter.future = service.submit(hunter); return; } performError(hunter, supportsReplay); if (supportsReplay) { markForReplay(hunter); } }
Source:
<code>public Scope getScopeForInterface(final Integer nodeId, final String ipAddress) { if (nodeId == null || Strings.isNullOrEmpty(ipAddress)) { return EmptyScope.EMPTY; } final Scope metaDataScope = this.transactions.execute((tx) -> { final OnmsIpInterface ipInterface = this.ipInterfaceDao.findByNodeIdAndIpAddress(nodeId, ipAddress); if (ipInterface == null) { return EmptyScope.EMPTY; } return new FallbackScope(transform(ipInterface.getMetaData()), new ObjectScope<>(ipInterface) .map("interface", "hostname", (i) -> Optional.of(i.getIpHostName())) .map("interface", "address", (i) -> Optional.of(i.getIpAddress()).map(InetAddressUtils::toIpAddrString)) .map("interface", "netmask", (i) -> Optional.of(i.getNetMask()).map(InetAddressUtils::toIpAddrString)) .map("interface", "if-index", (i) -> Optional.ofNullable(i.getIfIndex()).map(Object::toString)) <START> .map("interface", "if-alias", (i) -> Optional.of(i.getSnmpInterface().getIfAlias())) <END> .map("interface", "if-description", (i) -> Optional.of(i.getSnmpInterface().getIfDescr())) .map("interface", "phy-addr", (i) -> Optional.of(i.getSnmpInterface().getPhysAddr())) ); }); return metaDataScope; }</code><technical_language>Check for Null here. A SnmpInterface exist in case</technical_language>

Target:
public Scope getScopeForInterface(final Integer nodeId, final String ipAddress) { if (nodeId == null || Strings.isNullOrEmpty(ipAddress)) { return EmptyScope.EMPTY; } final Scope metaDataScope = this.transactions.execute((tx) -> { final OnmsIpInterface ipInterface = this.ipInterfaceDao.findByNodeIdAndIpAddress(nodeId, ipAddress); if (ipInterface == null) { return EmptyScope.EMPTY; } return new FallbackScope(transform(ipInterface.getMetaData()), new ObjectScope<>(ipInterface) .map("interface", "hostname", (i) -> Optional.ofNullable(i.getIpHostName())) .map("interface", "address", (i) -> Optional.ofNullable(i.getIpAddress()).map(InetAddressUtils::toIpAddrString)) .map("interface", "netmask", (i) -> Optional.ofNullable(i.getNetMask()).map(InetAddressUtils::toIpAddrString)) .map("interface", "if-index", (i) -> Optional.ofNullable(i.getIfIndex()).map(Object::toString)) .map("interface", "if-alias", (i) -> Optional.ofNullable(i.getSnmpInterface()).map(OnmsSnmpInterface::getIfAlias)) .map("interface", "if-description", (i) -> Optional.ofNullable(i.getSnmpInterface()).map(OnmsSnmpInterface::getIfDescr)) .map("interface", "phy-addr", (i) -> Optional.ofNullable(i.getSnmpInterface()).map(OnmsSnmpInterface::getPhysAddr)) ); }); return metaDataScope; }
Source:
<code>public Command teslaScenario(TeslaScenario scenario, Integer target) { if (scenario == null) return seq(); scenario = (TeslaScenario) EcoreUtil.copy(scenario); selectorParser = new TeslaSelectorParser(scenario); selectorParser.parse(); teslaCommands = scenario.getCommands(); pos = 0; script = new ArrayList<Command>(); while (target == null || pos < target) { if (pos >= teslaCommands.size()) { break; } Command newCommand = teslaCommand(); if (newCommand != null) { script.add(newCommand); } } Sequence seq = CoreFactory.eINSTANCE.createSequence(); List<Command> withified = EclRefactoring.withify(script, new Comparator<Command>() { public int compare(Command c1, Command c2) { if (c1 instanceof Selector && c2 instanceof Selector) { Selector s1 = (Selector) c1; Selector s2 = (Selector) c2; if (s1.getId() != null && s2.getId() != null) { return s1.getId().compareTo(s2.getId()); } } if (c1 instanceof GetItemImpl && c2 instanceof GetItemImpl) { GetItemImpl i1 = (GetItemImpl) c1; GetItemImpl i2 = (GetItemImpl) c2; if (i1.getPath() != null && i2.getPath() != null) { return i1.getPath().compareTo(i2.getPath()); } } <START> <END> if (c1 instanceof GetMenuImpl && c2 instanceof GetMenuImpl) { GetMenuImpl m1 = (GetMenuImpl) c1; GetMenuImpl m2 = (GetMenuImpl) c2; if (m1.getPath() != null && m2.getPath() != null) { return m1.getPath().compareTo(m2.getPath()); } } return 1; } }); seq.getCommands().addAll(DiagramUtils.updateSelectors(withified)); return TeslaScriptletFactory.makeSeq(seq); }</code><technical_language>Remove</technical_language>

Target:
public Command teslaScenario(TeslaScenario scenario, Integer target) { if (scenario == null) return seq(); scenario = (TeslaScenario) EcoreUtil.copy(scenario); selectorParser = new TeslaSelectorParser(scenario); selectorParser.parse(); teslaCommands = scenario.getCommands(); pos = 0; script = new ArrayList<Command>(); while (target == null || pos < target) { if (pos >= teslaCommands.size()) { break; } Command newCommand = teslaCommand(); if (newCommand != null) { script.add(newCommand); } } Sequence seq = CoreFactory.eINSTANCE.createSequence(); List<Command> withified = EclRefactoring.withify(script, new Comparator<Command>() { public int compare(Command c1, Command c2) { if (c1 instanceof Selector && c2 instanceof Selector) { Selector s1 = (Selector) c1; Selector s2 = (Selector) c2; if (s1.getId() != null && s2.getId() != null) { return s1.getId().compareTo(s2.getId()); } } if (c1 instanceof GetItem && c2 instanceof GetItem) { GetItem i1 = (GetItem) c1; GetItem i2 = (GetItem) c2; if (i1.getPath() != null && i2.getPath() != null) { return i1.getPath().compareTo(i2.getPath()); } } if (c1 instanceof GetMenu && c2 instanceof GetMenu) { GetMenu m1 = (GetMenu) c1; GetMenu m2 = (GetMenu) c2; if (m1.getPath() != null && m2.getPath() != null) { return m1.getPath().compareTo(m2.getPath()); } } return 1; } }); seq.getCommands().addAll(DiagramUtils.updateSelectors(withified)); return TeslaScriptletFactory.makeSeq(seq); }
Source:
<code>public ContainerEngineeringTable(InventoryPlayer inventoryPlayer, TileEntityEngineeringTable tileEntityEngineeringTable) { tileEntity = tileEntityEngineeringTable; itemHandler = tileEntityEngineeringTable.getCapability(ITEM_HANDLER_CAPABILITY, null); <START> assert itemHandler != null; <END> addSlotToContainer(new SlotItemHandler(itemHandler, 0, 30, 35)); for (int i = 0; i < 3; ++i) { for (int j = 0; j < 9; ++j) { addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); } } for (int i = 0; i < 4; ++i) { EntityEquipmentSlot equipmentSlot = ARMOR_SLOTS[i]; addSlotToContainer(new Slot(inventoryPlayer, inventoryPlayer.getSizeInventory() - 2 - i, 8, 8 + i * 18) { private EntityPlayer player = inventoryPlayer.player; @Override public int getSlotStackLimit() { return 1; } @Override public boolean isItemValid(ItemStack stack) { return !stack.isEmpty() && stack.getItem().isValidArmor(stack, equipmentSlot, player); } @Override @SideOnly(Side.CLIENT) public String getSlotTexture() { return ItemArmor.EMPTY_SLOT_NAMES[equipmentSlot.getIndex()]; } }); } addSlotToContainer(new Slot(inventoryPlayer, 40, 30, 62) { @Override @SideOnly(Side.CLIENT) public String getSlotTexture() { return "minecraft:items/empty_armor_slot_shield"; } }); for (int i = 0; i < 9; ++i) { addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 142)); } prevNumSlots = inventorySlots.size(); numBaseSlots = prevNumSlots; updateUpgradeSlots(); }</code><technical_language>assert testing. Change if statement, exception</technical_language>

Target:
public ContainerEngineeringTable(InventoryPlayer inventoryPlayer, TileEntityEngineeringTable tileEntityEngineeringTable) { tileEntity = tileEntityEngineeringTable; itemHandler = tileEntityEngineeringTable.getCapability(ITEM_HANDLER_CAPABILITY, null); addSlotToContainer(new SlotItemHandler(itemHandler, 0, 30, 35)); for (int i = 0; i < 3; ++i) { for (int j = 0; j < 9; ++j) { addSlotToContainer(new Slot(inventoryPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18)); } } for (int i = 0; i < 4; ++i) { EntityEquipmentSlot equipmentSlot = ARMOR_SLOTS[i]; addSlotToContainer(new Slot(inventoryPlayer, inventoryPlayer.getSizeInventory() - 2 - i, 8, 8 + i * 18) { private EntityPlayer player = inventoryPlayer.player; @Override public int getSlotStackLimit() { return 1; } @Override public boolean isItemValid(ItemStack stack) { return !stack.isEmpty() && stack.getItem().isValidArmor(stack, equipmentSlot, player); } @Override @SideOnly(Side.CLIENT) public String getSlotTexture() { return ItemArmor.EMPTY_SLOT_NAMES[equipmentSlot.getIndex()]; } }); } addSlotToContainer(new Slot(inventoryPlayer, 40, 30, 62) { @Override @SideOnly(Side.CLIENT) public String getSlotTexture() { return "minecraft:items/empty_armor_slot_shield"; } }); for (int i = 0; i < 9; ++i) { addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 142)); } prevNumSlots = inventorySlots.size(); numBaseSlots = prevNumSlots; updateUpgradeSlots(); }
Source:
<code>private static boolean isEnclosingClassFinal(ExpressionTree expressionTree) { if (expressionTree.is(IDENTIFIER)) { Tree parent = expressionTree.parent(); while (!parent.is(METHOD, CONSTRUCTOR, INITIALIZER)) { parent = parent.parent(); } <START> if (parent instanceof MethodTree) { <END> return ((MethodTree) parent).symbol().owner().isFinal(); } else { return ((ClassTree) parent.parent()).symbol().isFinal(); } } return ((MemberSelectExpressionTree) expressionTree).expression().symbolType().symbol().isFinal(); }</code><technical_language>Please parent.is here</technical_language>

Target:
private static boolean isEnclosingClassFinal(ExpressionTree expressionTree) { if (expressionTree.is(IDENTIFIER)) { MethodTree methodTree = findMethodTreeAncestor(expressionTree); if (methodTree != null) { return methodTree.symbol().owner().isFinal(); } else { return findClassTreeAncestor(expressionTree).symbol().isFinal(); } } return ((MemberSelectExpressionTree) expressionTree).expression().symbolType().symbol().isFinal(); }
Source:
<code><START> public static void waitUntilViewWithGivenTitleShows(final String viewTitle) { <END> waitForView(new BaseMatcher<IViewReference>() { public boolean matches(Object item) { if (item instanceof IViewReference) { return viewTitle.equals(((IViewReference) item).getTitle()); } return false; } public void describeTo(Description description) { description.appendText("Wait for view with title " + viewTitle); } }); }</code><technical_language>is this in this change</technical_language>

Target:
public static void waitUntilViewWithGivenTitleShows(final String viewTitle) { waitForView(new BaseMatcher<IViewReference>() { public boolean matches(Object item) { if (item instanceof IViewReference) return viewTitle.equals(((IViewReference) item).getTitle()); return false; } public void describeTo(Description description) { description.appendText("Wait for view with title " + viewTitle); } }); }
Source:
<code><START> protected String escapeDoubleQuotes(final String str) { <END> return str.replace("\"", "\\\""); }</code><technical_language>escape methods stay private, right</technical_language>

Target:
private String escapeDoubleQuotes(final String str) { return str.replace("\"", "\\\""); }
Source:
<code>private boolean isHttpsOnly(final DeploymentPhaseContext phaseContext, final DeploymentUnit unit) { CapabilityServiceSupport serviceSupport = unit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT); ServiceName undertowServiceName = serviceSupport.getCapabilityServiceName("org.wildfly.undertow"); ServiceController<?> undertowServiceController = phaseContext.getServiceRegistry().getService(undertowServiceName); UndertowService undertowService = (UndertowService) undertowServiceController.getValue(); Server defaultServer = null; for (Server server : undertowService.getServers()) { <START> if (server.getName().equals("default-server")) { <END> defaultServer = server; } } if (defaultServer == null) return false; List<String> listeners = new ArrayList<>(); for (UndertowListener listener : defaultServer.getListeners()) { listeners.add(listener.getProtocol()); } if (listeners.size() == 1) { return "https".equals(listeners.get(0)); } return false; }</code><technical_language>a magic value. UndertowService exposes a getDefaultServer() provide correct value</technical_language>

Target:
private boolean isHttpsOnly(final DeploymentPhaseContext phaseContext, final DeploymentUnit unit) { CapabilityServiceSupport serviceSupport = unit.getAttachment(Attachments.CAPABILITY_SERVICE_SUPPORT); ServiceName undertowServiceName = serviceSupport.getCapabilityServiceName("org.wildfly.undertow"); ServiceController<?> undertowServiceController = phaseContext.getServiceRegistry().getService(undertowServiceName); UndertowService undertowService = (UndertowService) undertowServiceController.getValue(); for (Server server : undertowService.getServers()) { if (server.getName().equals(undertowService.getDefaultServer())) { if ("https".equals(server.getListeners().get(0).getProtocol())) return true; } } return false; }
Source:
<code><START> protected ChannelManager() { <END> channelMap = new HashMap<String, Channel>(); }</code><technical_language>do need ChannelManager constructor protected? Res: private</technical_language>

Target:
private ChannelManager() { channelMap = new HashMap<String, Channel>(); }