auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void updateShiftStateNow() { <START> boolean keyboardAutoCap; <END> AnyKeyboard alphabetKeyboard = getCurrentAlphabetKeyboard(); keyboardAutoCap = alphabetKeyboard.autoCap; final InputConnection ic = getCurrentInputConnection(); EditorInfo ei = getCurrentInputEditorInfo(); final int caps; if (keyboardAutoCap && mAutoCap && ic != null && ei != null && ei.inputType != EditorInfo.TYPE_NULL) { caps = ic.getCursorCapsMode(ei.inputType); } else { caps = 0; } final boolean inputSaysCaps = caps != 0; Logger.d(TAG, "shift updateShiftStateNow inputSaysCaps=%s", inputSaysCaps); mShiftKeyState.setActiveState(inputSaysCaps); handleShift(); }</code><technical_language>Instead of query for this time this method is called, a class member set onAlphabetKeyboardSet()</technical_language>

Target:
private void updateShiftStateNow() { final InputConnection ic = getCurrentInputConnection(); EditorInfo ei = getCurrentInputEditorInfo(); final int caps; if (mKeyboardAutoCap && mAutoCap && ic != null && ei != null && ei.inputType != EditorInfo.TYPE_NULL) { caps = ic.getCursorCapsMode(ei.inputType); } else { caps = 0; } final boolean inputSaysCaps = caps != 0; Logger.d(TAG, "shift updateShiftStateNow inputSaysCaps=%s", inputSaysCaps); mShiftKeyState.setActiveState(inputSaysCaps); handleShift(); }
Source:
<code>public void testBitUtil() { Assert.assertTrue(BitUtil.isPowerOfTwo(64)); Assert.assertFalse(BitUtil.isPowerOfTwo(63)); Assert.assertTrue(BitUtil.isPowerOfTwo(4096L)); Assert.assertFalse(BitUtil.isPowerOfTwo(4097L)); Assert.assertEquals(BitUtil.nextHighestPowerOfTwo(62), 64); Assert.assertEquals(BitUtil.nextHighestPowerOfTwo(4092L), 4096); Assert.assertEquals(BitUtil.ntz(36), 2); Assert.assertEquals(BitUtil.ntz(4096L), 12); Assert.assertEquals(BitUtil.ntz2(4096L), 12); Assert.assertEquals(BitUtil.ntz3(4096L), 12); Assert.assertEquals(BitUtil.pop(4096), 1); long[] words1 = new long[2]; <START> words1[0] = 1266; <END> words1[1] = 1876; long[] words2 = new long[2]; words2[0] = 7654; words2[1] = 2567; Assert.assertEquals(BitUtil.pop_andnot(words1, words2, 0, 2), 5); Assert.assertEquals(BitUtil.pop_array(words1, 0, 2), 12); Assert.assertEquals(BitUtil.pop_intersect(words1, words2, 0, 2), 7); Assert.assertEquals(BitUtil.pop_union(words1, words2, 0, 2), 19); Assert.assertEquals(BitUtil.pop_xor(words1, words2, 0, 2), 12); }</code><technical_language>I easier follow if hex representation for values</technical_language>

Target:
public void testBitUtil() { Assert.assertTrue(BitUtil.isPowerOfTwo(32)); Assert.assertFalse(BitUtil.isPowerOfTwo(37)); Assert.assertTrue(BitUtil.isPowerOfTwo(4096L)); Assert.assertFalse(BitUtil.isPowerOfTwo(4097L)); Assert.assertEquals(BitUtil.nextHighestPowerOfTwo(62), 64); Assert.assertEquals(BitUtil.nextHighestPowerOfTwo(4092L), 4096); Assert.assertEquals(BitUtil.ntz(0x24), 2); Assert.assertEquals(BitUtil.ntz(0x1000), 12); Assert.assertEquals(BitUtil.ntz2(0x1000), 12); Assert.assertEquals(BitUtil.ntz3(0x1000), 12); Assert.assertEquals(BitUtil.pop(0x1000), 1); long[] words1 = new long[2]; words1[0] = 0x4f2; words1[1] = 0x754; long[] words2 = new long[2]; words2[0] = 0x1de6; words2[1] = 0xa07; Assert.assertEquals(BitUtil.pop_andnot(words1, words2, 0, 2), 5); Assert.assertEquals(BitUtil.pop_array(words1, 0, 2), 12); Assert.assertEquals(BitUtil.pop_intersect(words1, words2, 0, 2), 7); Assert.assertEquals(BitUtil.pop_union(words1, words2, 0, 2), 19); Assert.assertEquals(BitUtil.pop_xor(words1, words2, 0, 2), 12); }
Source:
<code>private void createArtifactSubdirectory(MavenJarArtifact artifact, File repositoryDir) { File artifactDirectory = new File(repositoryDir, artifact.jarPath()).getParentFile(); <START> artifactDirectory.mkdirs(); <END> }</code><technical_language>Nit: check return of mkdirs throw eventually</technical_language>

Target:
private boolean createArtifactSubdirectory(MavenJarArtifact artifact, File repositoryDir) { File artifactDirectory = new File(repositoryDir, artifact.jarPath()).getParentFile(); return artifactDirectory.mkdirs(); }
Source:
<code>public void handle(ContainerEvent event) { String reason = event.getReason(); String message = event.getMessage(); if (isUnrecoverable(reason)) { <START> LOG.error("Unrecoverable event occured {}, {}", reason, message); <END> eventPublisher.sendRuntimeStoppedEvent( format("Unrecoverable event occured: '%s', '%s'", reason, message), getContext().getIdentity()); } }</code><technical_language>Do dev/ops team able address logged problem somehow? is worth add more info able debug issue remove logging all</technical_language>

Target:
public void handle(ContainerEvent event) { if (isUnrecoverable(event)) { String reason = event.getReason(); String message = event.getMessage(); String podName = event.getPodName(); try { internalStop(emptyMap()); } catch (InfrastructureException e) { String workspaceId = getContext().getIdentity().getWorkspaceId(); LOG.error( "Unrecoverable event occured during workspace '{}' startup: {}, {}, {}", workspaceId, reason, message, podName); } finally { eventPublisher.sendRuntimeStoppedEvent( format("Unrecoverable event occured: '%s', '%s', '%s'", reason, message, podName), getContext().getIdentity()); } } }
Source:
<code>public void validateCantLiveMigrateToBackupDomain() { StorageDomain srcStorageDomain = initStorageDomain(srcStorageId); srcStorageDomain.setStatus(StorageDomainStatus.Active); <START> srcStorageDomain.setBackup(true); <END> initDiskImage(diskImageGroupId, diskImageId); initVm(VMStatus.Up, Guid.newGuid(), diskImageGroupId); ValidateTestUtils.runAndAssertValidateFailure(command, EngineMessage.ACTION_TYPE_FAILED_VM_DISKS_ON_BACKUP_STORAGE); }</code><technical_language>dst? test fail migrate a disk a destination backup storage domain</technical_language>

Target:
public void validateCantLiveMigrateToBackupDomain() { StorageDomain srcStorageDomain = initStorageDomain(srcStorageId); srcStorageDomain.setStatus(StorageDomainStatus.Active); StorageDomain dstStorageDomain = initStorageDomain(dstStorageId); dstStorageDomain.setStatus(StorageDomainStatus.Active); dstStorageDomain.setBackup(true); initDiskImage(diskImageGroupId, diskImageId); initVm(VMStatus.Up, Guid.newGuid(), diskImageGroupId); ValidateTestUtils.runAndAssertValidateFailure(command, EngineMessage.ACTION_TYPE_FAILED_VM_DISKS_ON_BACKUP_STORAGE); }
Source:
<code>public ListConfigKey(Class<V> subType, String name, String description, List<? extends V> defaultValue) { <START> super((Class)List.class, name, description, (List<? extends V>) defaultValue); <END> this.subType = subType; }</code><technical_language>Is cast (List<? extends V>) needed? in method signature</technical_language>

Target:
public ListConfigKey(Class<V> subType, String name, String description, List<? extends V> defaultValue) { super((Class)List.class, name, description, defaultValue); this.subType = subType; }
Source:
<code>public final Observable<T> takeLast(final int count) { <START> if (count == 1 ) <END> return lift(OperatorTakeLastOne.<T>instance()); else return lift(new OperatorTakeLast<T>(count)); }</code><technical_language>Is takeLast(0) meaningful? If so, routed ignoreElements(). BTW, ignoreElements() optimized making singleton simple (i.e., onNext nothing) instead of filtering false</technical_language>

Target:
public final Observable<T> takeLast(final int count) { if (count == 0) return ignoreElements(); else if (count == 1 ) return lift(OperatorTakeLastOne.<T>instance()); else return lift(new OperatorTakeLast<T>(count)); }
Source:
<code>public void processBuilder() { List<String> commands = Arrays.asList("myCommand", "myArg1", "myArg2"); ProcessBuilder pb = new ProcessBuilder("myCommand", "myArg1", "myArg2"); ProcessBuilder pb2 = new ProcessBuilder(commands); pb.command(); pb.command(commands); pb.command("myCommand", "myArg1", "myArg2"); ProcessBuilder pb3 = new ProcessBuilder(); <START> pb3.command("myCommand"); END> }</code><technical_language>unecessary test : is more</technical_language>

Target:
public void processBuilder() { List<String> commands = Arrays.asList("myCommand", "myArg1", "myArg2"); ProcessBuilder pb = new ProcessBuilder("myCommand", "myArg1", "myArg2"); ProcessBuilder pb2 = new ProcessBuilder(commands); pb.command(); pb.command(commands); pb.command("myCommand", "myArg1", "myArg2"); ProcessBuilder pb3 = new ProcessBuilder(); }
Source:
<code>public void createDirectory(OmKeyArgs args) throws IOException { Preconditions.checkNotNull(args, "Key args can not be null"); String volumeName = args.getVolumeName(); String bucketName = args.getBucketName(); String keyName = args.getKeyName(); try { metadataManager.getLock().acquireBucketLock(volumeName, bucketName); if (keyName.length() == 0) { return; } Path keyPath = Paths.get(keyName); OzoneFileStatus status = verifyNoFilesInPath(volumeName, bucketName, keyPath, false); if (status != null && OzoneFSUtils.pathToKey(status.getPath()) <START> .equals(keyPath.toString())) { <END> return; } OmKeyInfo dirDbKeyInfo = createDirectoryKey(volumeName, bucketName, keyName); String dirDbKey = metadataManager .getOzoneKey(volumeName, bucketName, dirDbKeyInfo.getKeyName()); metadataManager.getKeyTable().put(dirDbKey, dirDbKeyInfo); } finally { metadataManager.getLock().releaseBucketLock(volumeName, bucketName); } }</code><technical_language>keyName here, keyPath derived that</technical_language>

Target:
public void createDirectory(OmKeyArgs args) throws IOException { Preconditions.checkNotNull(args, "Key args can not be null"); String volumeName = args.getVolumeName(); String bucketName = args.getBucketName(); String keyName = args.getKeyName(); metadataManager.getLock().acquireBucketLock(volumeName, bucketName); try { if (keyName.length() == 0) { return; } Path keyPath = Paths.get(keyName); OzoneFileStatus status = verifyNoFilesInPath(volumeName, bucketName, keyPath, false); if (status != null && OzoneFSUtils.pathToKey(status.getPath()) .equals(keyName)) { return; } OmKeyInfo dirDbKeyInfo = createDirectoryKey(volumeName, bucketName, keyName); String dirDbKey = metadataManager .getOzoneKey(volumeName, bucketName, dirDbKeyInfo.getKeyName()); metadataManager.getKeyTable().put(dirDbKey, dirDbKeyInfo); } finally { metadataManager.getLock().releaseBucketLock(volumeName, bucketName); } }
Source:
<code>public void onReadError(Exception exception) { if (logger.isDebugEnabled()) { logger.debug("Executing onReadError: " + exception.getMessage(), exception); } final Message<Exception> message = MessageBuilder.withPayload(exception) .setHeader(BatchJobHeaders.BATCH_LISTENER_EVENT_TYPE, <START> BatchListenerEventType.ITEM_LISTENER_ON_READ_ERROR) <END> .build(); notificationsChannel.send(message); }</code><technical_language>Add .name()</technical_language>

Target:
public void onReadError(Exception exception) { if (logger.isDebugEnabled()) { logger.debug("Executing onReadError: " + exception.getMessage(), exception); } final Message<Exception> message = MessageBuilder.withPayload(exception) .setHeader(BatchJobHeaders.BATCH_LISTENER_EVENT_TYPE, BatchListenerEventType.ITEM_LISTENER_ON_READ_ERROR.name()) .build(); notificationsChannel.send(message); }
Source:
<code>public void testNotEquals() { ValueHolder<Integer> vh = new OnHeapStoreValueHolder<Integer>(10); <START> assertThat(new OnHeapStoreValueHolder<Integer>(101), new Not(is(vh))); <END> }</code><technical_language>new Not( ? static method for other matchers</technical_language>

Target:
public void testNotEquals() { ValueHolder<Integer> vh = new OnHeapStoreValueHolder<Integer>(10); assertThat(new OnHeapStoreValueHolder<Integer>(101), not(vh)); }
Source:
<code>public Object result(@PathParam("executionId") String executionId) throws IOException, MessagingException { if (isCompleted(executionId)) { Object output = getResult(executionId); String error = getError(executionId); cleanup(executionId); if (error != null) { throw new NuxeoException(error, HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } if (output instanceof Map) { Map map = (Map) output; Object url = ((Map<?, ?>) output).get(RESULT_URL_KEY); if (url instanceof String) { <START> map = new HashMap((Map) output); <END> try { boolean isAbsolute = new URI((String) url).isAbsolute(); String baseUrl = VirtualHostHelper.getBaseURL(ctx.getRequest()); map.put(RESULT_URL_KEY, isAbsolute ? url : baseUrl + url); } catch (URISyntaxException e) { log.error("Failed to parse result url {}", url); } } return Response.status(HttpServletResponse.SC_OK).entity(MAPPER.writeValueAsString(map)).build(); } return ResponseHelper.getResponse(output, request, HttpServletResponse.SC_OK); } throw new WebResourceNotFoundException("Execution with id=" + executionId + " not found"); }</code><technical_language>map = new HashMap(map)</technical_language>

Target:
public Object result(@PathParam("executionId") String executionId) throws IOException, MessagingException { if (isCompleted(executionId)) { Object output = getResult(executionId); String error = getError(executionId); cleanup(executionId); if (error != null) { throw new NuxeoException(error, HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } if (output instanceof Map) { Map map = (Map) output; Object url = ((Map<?, ?>) output).get(RESULT_URL_KEY); if (url instanceof String) { map = new HashMap(map); try { boolean isAbsolute = new URI((String) url).isAbsolute(); String baseUrl = VirtualHostHelper.getBaseURL(ctx.getRequest()); map.put(RESULT_URL_KEY, isAbsolute ? url : baseUrl + url); } catch (URISyntaxException e) { log.error("Failed to parse result url {}", url); } } return Response.status(HttpServletResponse.SC_OK).entity(MAPPER.writeValueAsString(map)).build(); } return ResponseHelper.getResponse(output, request, HttpServletResponse.SC_OK); } throw new WebResourceNotFoundException("Execution with id=" + executionId + " not found"); }
Source:
<code>public PolicyResponse processPreUpdate(Metacard input, Map<String, Serializable> properties) throws StopProcessingException { if (!Requests.isLocal(properties)) { return new PolicyResponseImpl(); } PolicyResponseImpl policyResponse = new PolicyResponseImpl( null, Permissions.parsePermissionsFromString(getUpdatePermissions())); List<Metacard> previousStateMetacards = ((OperationTransaction) properties.get(OPERATION_TRANSACTION_KEY)) .getPreviousStateMetacards(); Metacard previous; previous = previousStateMetacards <START> .stream() <END> .filter((x) -> x.getId().equals(input.getId())) .findFirst() .orElse(null); if (previous == null) { LOGGER.debug( "Cannot locate metacard for update. Applying permissions to the item", input.getId()); return policyResponse; } return requiresPermission(input.getResourceURI(), previous.getResourceURI()) ? policyResponse : new PolicyResponseImpl(); }</code><technical_language>Remove parens x</technical_language>

Target:
public PolicyResponse processPreUpdate(Metacard input, Map<String, Serializable> properties) throws StopProcessingException { if (!Requests.isLocal(properties)) { return new PolicyResponseImpl(); } PolicyResponseImpl policyResponse = new PolicyResponseImpl( null, Permissions.parsePermissionsFromString(getUpdatePermissions())); List<Metacard> previousStateMetacards = ((OperationTransaction) properties.get(OPERATION_TRANSACTION_KEY)) .getPreviousStateMetacards(); Metacard previous = previousStateMetacards .stream() .filter((x) -> x.getId().equals(input.getId())) .findFirst() .orElse(null); if (previous == null) { LOGGER.debug( "Cannot locate metacard for update. Applying permissions to the item", input.getId()); return policyResponse; } return requiresPermission(input.getResourceURI(), previous.getResourceURI()) ? policyResponse : new PolicyResponseImpl(); }
Source:
<code>public void testHalt() { Sensor<File> sensor = Sensor.create( FileSensor::create, SensorParams.create( Keys::path, "", ResourceLocator.path("rec-center-hourly-small.csv"))); Parameters p = NetworkTestHarness.getParameters().copy(); p = p.union(NetworkTestHarness.getHotGymTestEncoderParams()); p.set(KEY.RANDOM, new MersenneTwister(42)); <START> p.set(KEY.AUTO_CLASSIFY, false); <END> HTMSensor<File> htmSensor = (HTMSensor<File>)sensor; Network n = Network.create("test network", p); final Layer<int[]> l = new Layer<>(n); l.add(htmSensor); TestObserver<Inference> tester; l.subscribe(tester = new TestObserver<Inference>() { @Override public void onCompleted() { assertTrue(l.isHalted()); isHalted = true; } @Override public void onNext(Inference output) }); l.start(); try { l.halt(); l.getLayerThread().join(); assertTrue(isHalted); }catch(Exception e) { e.printStackTrace(); fail(); } checkObserver(tester); }</code><technical_language>@Hopding this need explicitly set false? if stated all? Also, test remain (i.e. test restarting installed classifiers?)</technical_language>

Target:
public void testHalt() { Sensor<File> sensor = Sensor.create( FileSensor::create, SensorParams.create( Keys::path, "", ResourceLocator.path("rec-center-hourly-small.csv"))); Parameters p = NetworkTestHarness.getParameters().copy(); p = p.union(NetworkTestHarness.getHotGymTestEncoderParams()); p.set(KEY.RANDOM, new MersenneTwister(42)); p.set(KEY.AUTO_CLASSIFY, Boolean.TRUE); p.set(KEY.INFERRED_FIELDS, getInferredFieldsMap("consumption", CLAClassifier.class)); HTMSensor<File> htmSensor = (HTMSensor<File>)sensor; Network n = Network.create("test network", p); final Layer<int[]> l = new Layer<>(n); l.add(htmSensor); TestObserver<Inference> tester; l.subscribe(tester = new TestObserver<Inference>() { @Override public void onCompleted() { assertTrue(l.isHalted()); isHalted = true; } @Override public void onNext(Inference output) }); l.start(); try { l.halt(); l.getLayerThread().join(); assertTrue(isHalted); }catch(Exception e) { e.printStackTrace(); fail(); } checkObserver(tester); }
Source:
<code>public void close() { try { outputStream.close(); if (indexer != null) { if (indexer instanceof TribbleIndexCreator) { <START> ((TribbleIndexCreator)indexer).setIndexSequenceDictionary(refDict); <END> } final Index index = indexer.finalizeIndex(locationSource.getPosition()); index.writeBasedOnFeatureFile(location); } } catch (final IOException e) { throw new RuntimeIOException("Unable to close index for " + getStreamName(), e); } }</code><technical_language>I if move setIndexSequenceDictionary for other index types, add base interface (IndexCreator) a default no-op implementation, TribbleIndexCreator override it. get rid of instanceOf downcast operators here, other index types if choose to, ignore it</technical_language>

Target:
public void close() { try { outputStream.close(); if (indexer != null) { indexer.setIndexSequenceDictionary(refDict); final Index index = indexer.finalizeIndex(locationSource.getPosition()); index.writeBasedOnFeatureFile(location); } } catch (final IOException e) { throw new RuntimeIOException("Unable to close index for " + getStreamName(), e); } }
Source:
<code>String[] getProgramArguments() throws IOException { LOGGER.entering(); <START> List<String> args = new LinkedList<String>(); <END> for (int i = 0; i < commands.size(); i++) { args.add(commands.get(i)); } if (InstanceType.SELENIUM_NODE.equals(type)) { args.addAll(Arrays.asList(getNodeProgramArguments())); } if (InstanceType.SELENIUM_HUB.equals(type)) { args.addAll(Arrays.asList(getHubProgramArguments())); } if ((!InstanceType.SELENIUM_STANDALONE.equals(type)) && (!commands.contains(SELION_CONFIG_ARG))) { args.add(SELION_CONFIG_ARG); args.add(SELION_CONFIG_FILE); } LOGGER.exiting(args.toString()); return args.toArray(new String[args.size()]); }</code><technical_language>Do need iterate element for this initialization ? do ? List<String> args = new LinkedList<String>(commands);</technical_language>

Target:
String[] getProgramArguments() throws IOException { LOGGER.entering(); InstanceType type = getType(); List<String> args = new LinkedList<String>(commands); if (InstanceType.SELENIUM_NODE.equals(type)) { args.addAll(Arrays.asList(getNodeProgramArguments())); } if (InstanceType.SELENIUM_HUB.equals(type)) { args.addAll(Arrays.asList(getHubProgramArguments())); } if ((!InstanceType.SELENIUM_STANDALONE.equals(type)) && (!commands.contains(SELION_CONFIG_ARG))) { args.add(SELION_CONFIG_ARG); args.add(SELION_CONFIG_FILE); } LOGGER.exiting(args.toString()); return args.toArray(new String[args.size()]); }
Source:
<code><START> public void testPartialQueryLoads() throws XPathSyntaxException, UnfullfilledRequirementsException, <END> XmlPullParserException, IOException, InvalidStructureException { ParseUtils.parseIntoSandbox(getClass().getResourceAsStream("/indexed_fixture/partial_lookup_load_body.xml"), sandbox); EvaluationContext ec = MockDataUtils.buildContextWithInstance(sandbox, "testfixture", "jr://fixture/testfixture"); EvaluationContext ecForTest = ec.spawnWithCleanLifecycle(); QueryContext context = ecForTest.getCurrentQueryContext(); ScopeLimitedReferenceRequestCache cache = context.getQueryCache(ScopeLimitedReferenceRequestCache.class); String exprString = "instance('testfixture')/test/entry[@filter_attribute = 'pass'][true() and filter_one = 'pass']/name"; XPathExpression expr = XPathParseTool.parseXPath(exprString); cache.addTreeReferencesToLimitedScope(new TreeReferenceAccumulatingAnalyzer(ecForTest).accumulate(expr)); CaseTestUtils.xpathEvalAndAssert(ecForTest, exprString, "succeed"); }</code><technical_language>2 tests identical for file path passed getResourceAsStream(). refactor a shared helper</technical_language>

Target:
public void testPartialQueryLoads() throws XPathSyntaxException, UnfullfilledRequirementsException, XmlPullParserException, IOException, InvalidStructureException { ParseUtils.parseIntoSandbox(getClass().getResourceAsStream("/indexed_fixture/partial_lookup_load_body.xml"), sandbox); doPartialLookupTest(); }
Source:
<code>public static void startRequestDetailActivity(Context ctx, Request request) { Intent i = ActivityUtil.newIntent(ctx, RequestDetailActivity.class); i.putExtra(RequestDetailActivity.REQUEST_ID, request.getObjectId()); <START> i.putExtra(RequestDetailActivity.REQUEST_STATE, request.getState().toString()); <END> ctx.startActivity(i); ActivityUtil.transitionRight((Activity)ctx); }</code><technical_language>pass enum, work</technical_language>

Target:
public static void startRequestDetailActivity(Context ctx, Request request) { Intent i = ActivityUtil.newIntent(ctx, RequestDetailActivity.class); i.putExtra(RequestDetailActivity.REQUEST_ID, request.getObjectId()); i.putExtra(RequestDetailActivity.REQUEST_STATE, request.getState()); ctx.startActivity(i); ActivityUtil.transitionRight((Activity)ctx); }
Source:
<code>private boolean pingSession( @Nonnull final String sessionId ) { boolean touchResult; try { touchResult = _memcached.add( _storageKeyFormat.format(sessionId), 1, BYTE_1 ); <START> } catch ( final IOException e ) { <END> _log.warn( "An exception occurred when trying to ping session " + sessionId, e ); return false; } if ( touchResult ) { _stats.nonStickySessionsPingFailed(); _log.warn( "The session " + sessionId + " should be touched in memcached, but it does not exist therein." ); return false; } else { _log.debug( "The session was ping'ed successfully." ); return true; } }</code><technical_language>Catch Exception</technical_language>

Target:
private boolean pingSession( @Nonnull final String sessionId ) throws InterruptedException { final Future<Boolean> touchResult = _memcached.add( _storageKeyFormat.format(sessionId), 1, BYTE_1 ); try { if ( touchResult.get() ) { _stats.nonStickySessionsPingFailed(); _log.warn( "The session " + sessionId + " should be touched in memcached, but it does not exist therein." ); return false; } _log.debug( "The session was ping'ed successfully." ); return true; } catch ( final ExecutionException e ) { _log.warn( "An exception occurred when trying to ping session " + sessionId, e ); return false; } }
Source:
<code>private void waitUntilServerIsAlive( ) { int timeout = 600000; final int sleep_time = 5000; boolean isAlive = false; while ( !isAlive ) { int statusCode = pingIsAlive(); if ( statusCode == HttpStatus.SC_OK ) { isAlive = true; } else { if ( timeout == 0 ) { placeBreadcrumbFile( getSolutionPath(), false ); } else { try { Thread.sleep( sleep_time ); } catch ( InterruptedException e ) { logger.error( e.getMessage() ); <START> } <END> timeout = timeout - sleep_time; } } } }</code><technical_language>exit while loop @timeout, write breadcrumb instead eventually leads exiting container, correct</technical_language>

Target:
private void waitUntilServerIsAlive( ) { int timeout = 600000; final int sleep_time = 5000; if ( logger.isDebugEnabled() ) { logger.debug( "Waiting until the server is alive..." ); } boolean isAlive = false; while ( !isAlive ) { int statusCode = pingIsAlive(); if ( statusCode == HttpStatus.SC_OK ) { isAlive = true; } else { if ( timeout == 0 ) { placeBreadcrumbFile( getSolutionPath(), false ); break; } else { try { Thread.sleep( sleep_time ); } catch ( InterruptedException e ) { logger.error( e.getMessage() ); } timeout = timeout - sleep_time; } } } }
Source:
<code>private OrcColumnarRowFileInputFormat<?, HiveSourceSplit> createOrcFormat() { return hiveVersion.startsWith("1.") ? OrcColumnarRowFileInputFormat.createPartitionedFormat( OrcShim.createShim(hiveVersion), jobConfWrapper.conf(), tableRowType(), partitionKeys, PARTITION_FIELD_EXTRACTOR, projectedFields(), <START> new ArrayList<>(), <END> DEFAULT_SIZE) : OrcNoHiveColumnarRowInputFormat.createPartitionedFormat( jobConfWrapper.conf(), tableRowType(), partitionKeys, PARTITION_FIELD_EXTRACTOR, projectedFields(), new ArrayList<>(), DEFAULT_SIZE); }</code><technical_language>Collections.emptyList()</technical_language>

Target:
private OrcColumnarRowFileInputFormat<?, HiveSourceSplit> createOrcFormat() { return hiveVersion.startsWith("1.") ? OrcNoHiveColumnarRowInputFormat.createPartitionedFormat( jobConfWrapper.conf(), tableRowType(), partitionKeys, PARTITION_FIELD_EXTRACTOR, computeSelectedFields(), Collections.emptyList(), DEFAULT_SIZE) : OrcColumnarRowFileInputFormat.createPartitionedFormat( OrcShim.createShim(hiveVersion), jobConfWrapper.conf(), tableRowType(), partitionKeys, PARTITION_FIELD_EXTRACTOR, computeSelectedFields(), Collections.emptyList(), DEFAULT_SIZE); }
Source:
<code>protected Object execute(Object[] data) { if (data == null) { throw new ExecutionPlanRuntimeException("Data can not be null."); } if (data.length < 2) { throw new ExecutionPlanRuntimeException("Number of values for data should be a multiple of 2"); <START> } <END> for (int i = 0; i < data.length; i += 2) { hashMap.put(data[i], data[i + 1]); } return hashMap; }</code><technical_language>Data greater multiplication of 2? change condition error message</technical_language>

Target:
protected Object execute(Object[] data) { if (data == null) { throw new ExecutionPlanRuntimeException("Data can not be null."); } if ((data.length % 2) == 1) { throw new ExecutionPlanRuntimeException("Number of values for data should be a multiple of 2"); } for (int i = 0; i < data.length; i += 2) { hashMap.put(data[i], data[i + 1]); } return hashMap; }
Source:
<code>public void setAttributes(Map<String, ? extends Object> map, boolean validate) { if (map == null) attributes = null; else { attributes = new MarkerAttributeMap<>(map.size()); for (Entry<String, ?> <START> i : <END> map.entrySet()) { Object key = i.getKey(); Assert.isTrue(key instanceof String); Object value = i.getValue(); setAttribute((String) key, value, validate); } } }</code><technical_language>If type is changing, please consider changing name of variable. In case of ModelObjectReaderWriterTest chose "entry" good enough well</technical_language>

Target:
public void setAttributes(Map<String, ? extends Object> map, boolean validate) { if (map == null) attributes = null; else { attributes = new MarkerAttributeMap<>(map.size()); for (Entry<String, ?> entry : map.entrySet()) { Object key = entry.getKey(); Assert.isTrue(key instanceof String); Object value = entry.getValue(); setAttribute((String) key, value, validate); } } }
Source:
<code>private void addMenuButton() { final ToolButton menuToolButton = new ToolButton(FontAwesome.COG); menuToolButton.getElement().setAttribute("name", "workBenchIconPartStackOptions"); menuButton.add(menuToolButton); menuToolButton.addClickHandler(new ClickHandler() { @Override <START> public void onClick(final ClickEvent event) { <END> Scheduler.get().scheduleDeferred(() -> { int left = getAbsoluteLeft(menuToolButton.getElement()); int top = getAbsoluteTop(menuToolButton.getElement()); delegate.onPartStackMenu(left + 10, top + 21 - 8); }); } }); if (menuButton.getElement() instanceof elemental.dom.Element) { Tooltip.create((elemental.dom.Element) menuButton.getElement(), PositionController.VerticalAlign.BOTTOM, PositionController.HorizontalAlign.MIDDLE, localizationConstant.partStackOptionsTitle()); } }</code><technical_language>I event is here, do need final</technical_language>

Target:
private void addMenuButton() { final ToolButton menuToolButton = new ToolButton(FontAwesome.COG); menuToolButton.getElement().setAttribute("name", "workBenchIconPartStackOptions"); menuButton.add(menuToolButton); menuToolButton.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { Scheduler.get().scheduleDeferred(() -> { int left = getAbsoluteLeft(menuToolButton.getElement()); int top = getAbsoluteTop(menuToolButton.getElement()); delegate.onPartStackMenu(left + 10, top + 21 - 8); }); } }); if (menuButton.getElement() instanceof elemental.dom.Element) { Tooltip.create((elemental.dom.Element) menuButton.getElement(), PositionController.VerticalAlign.BOTTOM, PositionController.HorizontalAlign.MIDDLE, localizationConstant.partStackOptionsTitle()); } }
Source:
<code>public void preInitialise(Context rootContext) { config = new Config(); config.load(); FlexibleConfigManager flexibleConfigManager = new FlexibleConfigManagerImpl(); rootContext.put(FlexibleConfigManager.class, flexibleConfigManager); FlexibleConfig renderingFlexibleConfig = new FlexibleConfigImpl(); flexibleConfigManager.addFlexibleConfig(new SimpleUri("engine:rendering"), renderingFlexibleConfig); <START> flexibleConfigManager.load(); <END> String serverPortProperty = System.getProperty(SERVER_PORT_PROPERTY); if (serverPortProperty != null) { try { config.getNetwork().setServerPort(Integer.parseInt(serverPortProperty)); } catch (NumberFormatException e) { logger.error("Failed to set server port to invalid value: {}", serverPortProperty); } } if (Iterables.isEmpty(config.getDefaultModSelection().listModules())) { config.getDefaultModSelection().addModule(TerasologyConstants.CORE_GAMEPLAY_MODULE); } checkServerIdentity(); logger.info("Video Settings: {}", config.renderConfigAsJson(config.getRendering())); rootContext.put(Config.class, config); }</code><technical_language>this part of config.load()? integration config.save()</technical_language>

Target:
public void preInitialise(Context rootContext) { config = new Config(rootContext); config.load(); FlexibleConfigManager flexibleConfigManager = new FlexibleConfigManagerImpl(); rootContext.put(FlexibleConfigManager.class, flexibleConfigManager); FlexibleConfig renderingFlexibleConfig = new FlexibleConfigImpl(); flexibleConfigManager.addConfig(new SimpleUri("engine:rendering"), renderingFlexibleConfig); flexibleConfigManager.loadAllConfigs(); String serverPortProperty = System.getProperty(SERVER_PORT_PROPERTY); if (serverPortProperty != null) { try { config.getNetwork().setServerPort(Integer.parseInt(serverPortProperty)); } catch (NumberFormatException e) { logger.error("Failed to set server port to invalid value: {}", serverPortProperty); } } if (Iterables.isEmpty(config.getDefaultModSelection().listModules())) { config.getDefaultModSelection().addModule(TerasologyConstants.CORE_GAMEPLAY_MODULE); } checkServerIdentity(); logger.info("Video Settings: {}", config.renderConfigAsJson(config.getRendering())); rootContext.put(Config.class, config); rootContext.put(InputDeviceConfiguration.class, new InputDeviceConfigurationImpl(config)); rootContext.put(BindsConfiguration.class, new BindsConfigurationImpl(config)); }
Source:
<code>public boolean checkQuotaNameReserved(Quota quota, List<String> messages) { String defaultQuotaForDCName = getDefaultQuotaName(getStoragePoolNameForQuota(quota)); <START> if (!quota.getIsDefaultQuota() && quota.getQuotaName().equals(defaultQuotaForDCName)) { <END> messages.add(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_NAME_RESERVED_FOR_DEFAULT.toString()); return false; } return true; }</code><technical_language>Need check if quota name is null, a parameter initialize in client</technical_language>

Target:
public boolean checkQuotaNameReserved(Quota quota, List<String> messages) { if (!quota.getIsDefaultQuota() && quota.getQuotaName().startsWith(DEFAULT_QUOTA_NAME_PERFIX)) { messages.add(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_NAME_RESERVED_FOR_DEFAULT.toString()); return false; } return true; }
Source:
<code>private boolean idleTimeout(Throwable failure) { Callback callback; boolean timeout; synchronized (this) { switch (_state) { case PENDING: { _state = State.FAILED; _failure = failure; callback = _callback; timeout = true; break; } case IDLE: <START> case SENDING: END> case SUCCEEDING: case FAILING: case FAILED: { callback = null; timeout = false; break; } default: { _state = State.FAILED; _failure = new IllegalStateException("Invalid transport state: " + _state, failure); callback = _callback; if (callback == null) callback = Callback.NOOP; timeout = true; failure = _failure; break; } } } idleTimeout(callback, timeout, failure); return timeout; }</code><technical_language>I kind of timeout win this race. else closed timeout, timeout due a slow generation of frame</technical_language>

Target:
private boolean idleTimeout(Throwable failure) { Callback callback; boolean timeout; synchronized (this) { switch (_state) { case PENDING: { callback = _callback; timeout = true; reset(failure); break; } case IDLE: case SENDING: case SUCCEEDING: case FAILING: case FAILED: { callback = null; timeout = false; break; } default: { callback = _callback; if (callback == null) callback = Callback.NOOP; timeout = true; failure = new IllegalStateException("Invalid transport state: " + _state, failure); reset(failure); break; } } } idleTimeout(callback, timeout, failure); return timeout; }
Source:
<code>private static boolean isDefaultConstructorForJpa(MethodTree methodTree) { if (!methodTree.block().body().isEmpty()) { return false; } ClassTree classTree = (ClassTree) methodTree.parent(); <START> return classTree.modifiers().annotations().stream() <END> .map(annotationTree -> annotationTree.annotationType().symbolType()) .anyMatch(symbol -> Stream.of(JPA_ANNOTATIONS).anyMatch(symbol::is)); }</code><technical_language>easier test presence of annotation symbol metadata: SymbolMetadata metadata = classTree.symbol().metadata(); Stream.of(JPA_ANNOTATIONS).anyMatch(metadata::isAnnotatedWith);</technical_language>

Target:
private static boolean isDefaultConstructorForJpa(MethodTree methodTree) { if (!methodTree.block().body().isEmpty()) { return false; } SymbolMetadata symbolMetadata = ((ClassTree) methodTree.parent()).symbol().metadata(); return Stream.of(JPA_ANNOTATIONS).anyMatch(symbolMetadata::isAnnotatedWith); }
Source:
<code>protected void sendMessage(ConsumerRecord<?, ?> record, Instant readTime) throws Exception { int sendAttempts = 0; while (true) { sendAttempts++; int numBytes = record.serializedKeySize() + record.serializedValueSize(); _consumerMetrics.updateBytesProcessedRate(numBytes); DatastreamProducerRecord datastreamProducerRecord = translate(record, readTime); try { sendDatastreamProducerRecord(datastreamProducerRecord); return; } catch (Exception e) { _logger.error("Error sending Message. task: ; error: {};", _taskName, e.toString()); _logger.error("Stack Trace: {}", Arrays.toString(e.getStackTrace())); if (_shouldDie || sendAttempts >= _maxRetryCount) { if (sendAttempts >= _maxRetryCount && _pausePartitionOnRetryExhaustion) { <START> _autoPausedSourcePartitions.add(new TopicPartition(record.topic(), record.partition())); <END> _autoPausedPartitionsCount++; _taskUpdates.add(DatastreamConstants.UpdateType.PAUSE_RESUME_PARTITIONS); return; } else { _logger.info("Send messages failed with exception: {}", e); throw e; } } _logger.warn("Sleeping for seconds before retrying. Retry of {}", _retrySleepDuration.getSeconds(), sendAttempts, _maxRetryCount); Thread.sleep(_retrySleepDuration.toMillis()); } } }</code><technical_language>want add a log message for debugging purpose</technical_language>

Target:
protected void sendMessage(ConsumerRecord<?, ?> record, Instant readTime) throws Exception { int sendAttempts = 0; while (true) { sendAttempts++; int numBytes = record.serializedKeySize() + record.serializedValueSize(); _consumerMetrics.updateBytesProcessedRate(numBytes); DatastreamProducerRecord datastreamProducerRecord = translate(record, readTime); try { sendDatastreamProducerRecord(datastreamProducerRecord); return; } catch (Exception e) { _logger.error("Error sending Message. task: ; error: {};", _taskName, e.toString()); _logger.error("Stack Trace: {}", Arrays.toString(e.getStackTrace())); if (_shouldDie || sendAttempts >= _maxRetryCount) { _logger.error("Send messages failed with exception: {}", e); throw e; } _logger.warn("Sleeping for seconds before retrying. Retry of {}", _retrySleepDuration.getSeconds(), sendAttempts, _maxRetryCount); Thread.sleep(_retrySleepDuration.toMillis()); } } }
Source:
<code>CompletableFuture<Object> poll(String location, Duration delay, Duration duration) { CompletableFuture<Object> resultFuture = new CompletableFuture<>(); <START> long deadline = System.currentTimeMillis() + duration.toMillis(); <END> CompletableRequest req = new CompletableRequest(Request.GET, location); Future pollFuture = executor.submit(() -> { do { req.call().thenAccept(res -> { if (req.isRedirected()) { resultFuture.complete(res.getResult()); } }).exceptionally(ex -> { resultFuture.completeExceptionally(ex.getCause()); return null; }); try { Thread.sleep(delay.toMillis()); } catch (InterruptedException e) { return; } } while (deadline > System.currentTimeMillis()); }); resultFuture.whenComplete((result, thrown) -> { pollFuture.cancel(true); }); return resultFuture; }</code><technical_language>FYI for deadline-based loops nanoTime() guaranteed monotonous</technical_language>

Target:
protected CompletableFuture<Object> poll(String location, Duration delay, Duration duration) { CompletableFuture<Object> resultFuture = new CompletableFuture<>(); long deadline = System.nanoTime() + duration.toNanos(); CompletableRequest req = new CompletableRequest(Request.GET, location); Future pollFuture = executor.submit(() -> { do { req.call().thenAccept(res -> { if (req.isRedirected()) { resultFuture.complete(res.getResult()); } }).exceptionally(ex -> { resultFuture.completeExceptionally(ex.getCause()); return null; }); try { Thread.sleep(delay.toMillis()); } catch (InterruptedException e) { return; } } while (deadline > System.nanoTime()); }); resultFuture.whenComplete((result, thrown) -> { pollFuture.cancel(true); }); return resultFuture; }
Source:
<code><START> protected void postLoad(DAnalysis dAnalysis, Version loadedVersion) { <END> if (loadedVersion.compareTo(MIGRATION_VERSION) < 0) { Iterator<EObject> it = EcoreUtil.getAllContents(getGMFDiagrams(dAnalysis)); while (it.hasNext()) { EObject next = it.next(); if (next instanceof View && ViewType.NOTE.equals(((View) next).getType()) && ((View) next).getElement() instanceof DRepresentationDescriptor) { SiriusNoteViewFactory.markAsLinkNote((View) next); } } } }</code><technical_language>some version, log information migration. for example org.eclipse.sirius.diagram.ui.business.internal.migration.RepairGMFbendpointsMigrationParticipant</technical_language>

Target:
protected void postLoad(DAnalysis dAnalysis, Version loadedVersion) { if (loadedVersion.compareTo(MIGRATION_VERSION) < 0) { StringBuilder builder = new StringBuilder(); boolean isModified = false; for (DView view : dAnalysis.getOwnedViews()) { for (DRepresentation representation : new DViewQuery(view).getLoadedRepresentations()) { if (representation instanceof DDiagram) { DDiagramGraphicalQuery query = new DDiagramGraphicalQuery((DDiagram) representation); Option<Diagram> option = query.getAssociatedGMFDiagram(); if (option.some() && migrateDiagram(option.get())) { builder.append(MessageFormat.format(Messages.LinkNoteMigrationParticipant_entry, representation.getName())).append(System.lineSeparator()); isModified = true; } } } } if (isModified) { builder.insert(0, System.lineSeparator()); builder.insert(0, Messages.LinkNoteMigrationParticipant_title); DiagramPlugin.getDefault().logInfo(builder.toString()); } } }
Source:
<code>public boolean isExpired(final String token) { <START> boolean isUnknownToken; <END> isUnknownToken = isUnknown(token); if (!isUnknownToken) { isUnknownToken = (getTokenExpiration(token) <= System.currentTimeMillis()); } return isUnknownToken; }</code><technical_language>isExpired</technical_language>

Target:
public boolean isExpired(final String token) { boolean isExpired; isExpired = isUnknown(token); if (!isExpired) { isExpired = (getTokenExpiration(token) <= System.currentTimeMillis()); } return isExpired; }
Source:
<code>private void removeDeviceInternal(String deviceId) { synchronized (mConfigLock) { Iterator<Device> it = mConfig.devices.iterator(); while (it.hasNext()) { Device d = it.next(); if (d.deviceID.equals(deviceId)) { <START> it.remove(); <END> } } } }</code><technical_language>Ditto breaking</technical_language>

Target:
private void removeDeviceInternal(String deviceId) { synchronized (mConfigLock) { Iterator<Device> it = mConfig.devices.iterator(); while (it.hasNext()) { Device d = it.next(); if (d.deviceID.equals(deviceId)) { it.remove(); break; } } } }
Source:
<code>public <START> IObservableValue<?> getObservableValue() <END> { return (IObservableValue<?>) source; }</code><technical_language><T></technical_language>

Target:
public IObservableValue<T> getObservableValue() { return (IObservableValue<T>) source; }
Source:
<code>private SymbolStatsEstimate getExpressionStats(Expression expression) { return Symbol.optionalFrom(expression) .map(symbol -> requireNonNull(input.getSymbolStatistics(symbol), () -> format("No statistics for symbol %s", symbol))) .orElseGet(() -> scalarStatsCalculator.calculate(expression, input, session)); <START> } <END></code><technical_language>FYI: i debug code, i seemingly redundant assignment return convenient. I Intellij if assinment, convenient. (i mind change though, this is FYI)</technical_language>

Target:
private SymbolStatsEstimate getExpressionStats(Expression expression) { if (expression instanceof SymbolReference) { Symbol symbol = Symbol.from(expression); return requireNonNull(input.getSymbolStatistics(symbol), () -> format("No statistics for symbol %s", symbol)); } return scalarStatsCalculator.calculate(expression, input, session); }
Source:
<code>public Vector2i toInt() { <START> return new SpongeVector2i((int) Math.round(x), (int) Math.round(y)); <END> }</code><technical_language>Possibly floor() ensure floors/make clear floors</technical_language>

Target:
public Vector2i toInt() { return new SpongeVector2i((int) x, (int) y); }
Source:
<code>public void startup(IProgressMonitor monitor) { SubMonitor subMonitor = SubMonitor.convert(monitor, 1); Preferences preferences = ResourcesPlugin.getPlugin().getPluginPreferences(); preferences.addPropertyChangeListener(this); refreshJob = new RefreshJob(); monitors = new MonitorManager(workspace, this); boolean autoRefresh = preferences.getBoolean(ResourcesPlugin.PREF_AUTO_REFRESH); if (autoRefresh) manageAutoRefresh(autoRefresh, subMonitor.split(1)); <START> subMonitor.setWorkRemaining(0); <END> }</code><technical_language>This method advance monitor</technical_language>

Target:
public void startup(IProgressMonitor monitor) { SubMonitor subMonitor = SubMonitor.convert(monitor, 1); Preferences preferences = ResourcesPlugin.getPlugin().getPluginPreferences(); preferences.addPropertyChangeListener(this); refreshJob = new RefreshJob(); monitors = new MonitorManager(workspace, this); boolean autoRefresh = preferences.getBoolean(ResourcesPlugin.PREF_AUTO_REFRESH); if (autoRefresh) manageAutoRefresh(autoRefresh, subMonitor.split(1)); }
Source:
<code>public void testExitOnError() throws Exception { XMLParser.Config config = new XMLParser.Config("body", "UTF-8", "title:/book/title,author:/book/author," + "year:/book/year", "title:string,author:int,year:int", "Exit on error"); try { Transform<StructuredRecord, StructuredRecord> transform = new XMLParser(config); transform.initialize(new MockTransformContext()); StructuredRecord inputRecord = StructuredRecord.builder(INPUT) .set("offset", 1) .set("body", "<book category=\"COOKING\"><title lang=\"en\">Everyday Italian</title>" + "<author>Giada De Laurentiis</author><year>2005</year><price>30.00</price></book>").build(); MockEmitter<StructuredRecord> emitter = new MockEmitter<>(); <START> transform.transform(inputRecord, emitter); <END> } catch (IllegalStateException e) { LOG.error("Test passes. Exiting on exception.", e); } }</code><technical_language>put Assert.fail() transform call, expect IllegalStateException is thrown</technical_language>

Target:
public void testExitOnError() throws Exception { XMLParser.Config config = new XMLParser.Config("body", "UTF-8", "title:/book/title,author:/book/author," + "year:/book/year", "title:string,author:int,year:int", "Exit on error"); try { Transform<StructuredRecord, StructuredRecord> transform = new XMLParser(config); transform.initialize(new MockTransformContext()); StructuredRecord inputRecord = StructuredRecord.builder(INPUT) .set("offset", 1) .set("body", "<book category=\"COOKING\"><title lang=\"en\">Everyday Italian</title>" + "<author>Giada De Laurentiis</author><year>2005</year><price>30.00</price></book>").build(); MockEmitter<StructuredRecord> emitter = new MockEmitter<>(); transform.transform(inputRecord, emitter); Assert.fail(); } catch (IllegalStateException e) { LOG.error("Test passes. Exiting on exception.", e); } }
Source:
<code>private boolean isUserMetric(MetricResult metricResult) { MetricName metricName = metricResult.getKey().metricName(); String urn = ((MonitoringInfoMetricName) metricName).getUrn(); return (metricName instanceof MonitoringInfoMetricName) && <START> (urn.contains(MonitoringInfoConstants.Urns.USER_SUM_INT64) || <END> urn.contains(MonitoringInfoConstants.Urns.USER_SUM_DOUBLE)|| urn.contains(MonitoringInfoConstants.Urns.USER_DISTRIBUTION_DOUBLE) || urn.contains(MonitoringInfoConstants.Urns.USER_DISTRIBUTION_INT64)); }</code><technical_language>ensure metricName is MonitoringInfoMetricName, remove judgment of metricName instanceof MonitoringInfoMetricName</technical_language>

Target:
private boolean isUserMetric(MetricResult metricResult) { MetricName metricName = metricResult.getKey().metricName(); if (metricName instanceof MonitoringInfoMetricName) { String urn = ((MonitoringInfoMetricName) metricName).getUrn(); return urn.contains(MonitoringInfoConstants.Urns.USER_SUM_INT64) || urn.contains(MonitoringInfoConstants.Urns.USER_SUM_DOUBLE) || urn.contains(MonitoringInfoConstants.Urns.USER_DISTRIBUTION_DOUBLE) || urn.contains(MonitoringInfoConstants.Urns.USER_DISTRIBUTION_INT64); } return false; }
Source:
<code>public Collection<String> getTokenIdentifiers() { <START> return CACHE.asMap().keySet(); <END> }</code><technical_language>leaking cache state here? If are, do care? CXF bork this? If a caller modifies collection impact underlying cache, docs</technical_language>

Target:
public Collection<String> getTokenIdentifiers() { return Collections.unmodifiableCollection(CACHE.asMap().keySet()); }