auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void init() { initializationTime = System.currentTimeMillis(); String entityId = this.statsdPort == 0 ? "none" : null; NonBlockingStatsDClientBuilder builder = new NonBlockingStatsDClientBuilder() .enableTelemetry(false) .hostname(this.statsdHost) .port(this.statsdPort) <START> .queueSize(Integer.MAX_VALUE) <END> .errorHandler(new LoggingErrorHandler()) .entityID(entityId); if (this.statsdPort == 0) { builder.maxPacketSizeBytes(8192); } statsDClient = builder.build(); }</code><technical_language>I this is default of java-dogstatsd-client (could check?), instead</technical_language>

Target:
private void init() { initializationTime = System.currentTimeMillis(); String entityId = this.statsdPort == 0 ? "none" : null; NonBlockingStatsDClientBuilder builder = new NonBlockingStatsDClientBuilder() .enableTelemetry(false) .hostname(this.statsdHost) .port(this.statsdPort) .errorHandler(new LoggingErrorHandler()) .entityID(entityId); if (this.statsdPort == 0) { builder.maxPacketSizeBytes(8192); } statsDClient = builder.build(); }
Source:
<code>protected Pair<Map<String, String>, Map<String, String>> convertAndSeparateParameters(WikiParameters params) { Map<String, String> resourceParameters; Map<String, String> genericParameters; if (params.getSize() > 0) { resourceParameters = new LinkedHashMap<String, String>(); genericParameters = new LinkedHashMap<String, String>(); for (WikiParameter wikiParameter : params.toList()) { String key = wikiParameter.getKey(); <START> if ((DocumentResourceReference.ANCHOR).equals(key) <END> || (DocumentResourceReference.QUERY_STRING).equals(key)) { resourceParameters.put(key, wikiParameter.getValue()); } else { genericParameters.put(key, wikiParameter.getValue()); } } } else { resourceParameters = Listener.EMPTY_PARAMETERS; genericParameters = Listener.EMPTY_PARAMETERS; } return new ImmutablePair<Map<String, String>, Map<String, String>>(resourceParameters, genericParameters); }</code><technical_language>Useless parenthesis</technical_language>

Target:
protected Pair<Map<String, String>, Map<String, String>> convertAndSeparateParameters(WikiParameters params) { Map<String, String> resourceParameters; Map<String, String> genericParameters; if (params.getSize() > 0) { resourceParameters = new LinkedHashMap<String, String>(); genericParameters = new LinkedHashMap<String, String>(); for (WikiParameter wikiParameter : params.toList()) { String key = wikiParameter.getKey(); if (DocumentResourceReference.ANCHOR.equals(key) || DocumentResourceReference.QUERY_STRING).equals(key)) { resourceParameters.put(key, wikiParameter.getValue()); } else { genericParameters.put(key, wikiParameter.getValue()); } } } else { resourceParameters = Listener.EMPTY_PARAMETERS; genericParameters = Listener.EMPTY_PARAMETERS; } return new ImmutablePair<Map<String, String>, Map<String, String>>(resourceParameters, genericParameters); }
Source:
<code>private static boolean isReadyForSpark(CustomTask task) { <START> Instant fiveMinsAgo = Instant.now().minus(1, ChronoUnit.MINUTES); <END> return task.getName() != null && task.getName().matches(".*TEST.*") && Instant.parse(task.getCreated_at()).isBefore(fiveMinsAgo) && task.getCustom_fields() .stream() .noneMatch(d -> d.getName().equals("ORIGINAL UUID") && d.getText_value() != null); }</code><technical_language>This is longer 5 mins ago, leave 1, variable renamed</technical_language>

Target:
private static boolean isReadyForSpark(CustomTask task) { Instant fiveMinsAgo = Instant.now().minus(5, ChronoUnit.MINUTES); return task.getName() != null && Instant.parse(task.getCreated_at()).isBefore(fiveMinsAgo) && task.getCustom_fields() .stream() .noneMatch(d -> d.getName().equals("ORIGINAL UUID") && d.getText_value() != null); }
Source:
<code>BlobStatus(List<String> replicaList) { if (replicaList != null && replicaList.size() > 0) { unavailable.addAll(replicaList); } <START> } <END></code><technical_language>minor: replicaList.size() > 0 check needed</technical_language>

Target:
BlobStatus(List<String> replicaList) { if (replicaList != null) { unavailable.addAll(replicaList); } }
Source:
<code><START> public synchronized void addNamespace(String prefix, String namespaceURI) { <END> urisByPrefix.put(prefix, namespaceURI); if (prefixesByURI.containsKey(namespaceURI)) { (prefixesByURI.get(namespaceURI)).add(prefix); } else { Set<String> set = new HashSet<String>(); set.add(prefix); prefixesByURI.put(namespaceURI, set); } }</code><technical_language>a specific reason marked this synchronized? library thread-safe, if this is hit multiple threads bad is happen</technical_language>

Target:
public void addNamespace(String prefix, String namespaceURI) { urisByPrefix.put(prefix, namespaceURI); if (prefixesByURI.containsKey(namespaceURI)) { (prefixesByURI.get(namespaceURI)).add(prefix); } else { Set<String> set = new HashSet<String>(); set.add(prefix); prefixesByURI.put(namespaceURI, set); } }
Source:
<code>private int getNumberOfPartitionsForTopic(final String topic) throws ExecutionException, InterruptedException { <START> try (AdminClient adminClient = createAdminClient()) { <END> final TopicDescription topicDescription = adminClient.describeTopics(Collections.singleton(topic)) .values() .get(topic) .get(); return topicDescription.partitions().size(); } }</code><technical_language>Ah, yeah, some limitations linter. Thanks for care of it</technical_language>

Target:
private int getNumberOfPartitionsForTopic(final String topic) throws Exception { try (final AdminClient adminClient = createAdminClient()) { final TopicDescription topicDescription = adminClient.describeTopics(Collections.singleton(topic)) .values() .get(topic) .get(); return topicDescription.partitions().size(); } }
Source:
<code>@Test public void supportsPortableCustomization() throws Exception { String uri = "/foo/bar?z=2&yAA=1"; close(); httpTracing = httpTracing.toBuilder() .clientRequestParser((request, context, span) -> { span.name(request.method().toLowerCase() + " " + request.path()); span.tag("http.url", request.url()); span.tag("request_customizer.is_span", (span instanceof brave.Span) + ""); }) .clientResponseParser(((response, error, context, span) -> { HttpResponseParser.DEFAULT.parse(response, error, context, span); span.tag("response_customizer.is_span", (span instanceof brave.Span) + ""); })) .build().clientOf("remote-service"); client = newClient(server.getPort()); server.enqueue(new MockResponse()); get(client, uri); <START> Span span = takeSpan(); <END> assertThat(span.name()) .isEqualTo("get /foo/bar"); assertThat(span.remoteServiceName()) .isEqualTo("remote-service"); assertThat(span.tags()) .containsEntry("http.url", url(uri)) .containsEntry("request_customizer.is_span", "false") .containsEntry("response_customizer.is_span", "false"); }</code><technical_language>Extra parenthesis lambda</technical_language>

Target:
@Test public void supportsPortableCustomization() throws Exception { String uri = "/foo/bar?z=2&yAA=1"; close(); httpTracing = httpTracing.toBuilder() .clientRequestParser((request, context, span) -> { span.name(request.method().toLowerCase() + " " + request.path()); span.tag("http.url", request.url()); span.tag("request_customizer.is_span", (span instanceof brave.Span) + ""); }) .clientResponseParser((response, context, span) -> { HttpResponseParser.DEFAULT.parse(response, context, span); span.tag("response_customizer.is_span", (span instanceof brave.Span) + ""); }) .build().clientOf("remote-service"); client = newClient(server.getPort()); server.enqueue(new MockResponse()); get(client, uri); Span span = takeSpan(); assertThat(span.name()) .isEqualTo("get /foo/bar"); assertThat(span.remoteServiceName()) .isEqualTo("remote-service"); assertThat(span.tags()) .containsEntry("http.url", url(uri)) .containsEntry("request_customizer.is_span", "false") .containsEntry("response_customizer.is_span", "false"); }
Source:
<code>public void databaseExceptionThrownWhenWrongTypeGiven() throws Exception { <START> authChecker.isAuthenticated(INVALID_ITEM_TYPE, INVALID_ITEM_ID, TEACHER_ID, Authentication.AuthType.newBuilder() <END> .setCheckAccess(true) .build()); }</code><technical_language>pass valid item id here? test is for invalid item type for id</technical_language>

Target:
public void databaseExceptionThrownWhenWrongTypeGiven() throws Exception { authChecker.isAuthenticated(INVALID_ITEM_TYPE, VALID_ITEM_ID, TEACHER_ID, Authentication.AuthType.newBuilder() .setCheckAccess(true) .build()); }
Source:
<code>public void testConcurrentlyGetStatefulPrototypeKieSession() throws Exception { final int nThreads = 10; ExecutorService executorService = Executors.newFixedThreadPool(nThreads); final ConcurrentHashMap ksessionMap = new ConcurrentHashMap(); CountDownLatch latch = new CountDownLatch(nThreads); for (int i = 0; i < nThreads; i++) { executorService.submit(new Runnable() { @Override public void run() { KieSession ksession = (KieSession) context.getBean("statefulPrototypeSession"); <START> Object put = ksessionMap.put(ksession.hashCode(), new Object()); <END> if (put != null) { log.warn("ksession:{} repeated", ksession); } latch.countDown(); } }); } latch.await(); assertEquals(nThreads,ksessionMap.size()); }</code><technical_language>fix is ok hashCode() unique key of a ksession isn't. I this is uncommon impossible 2 distinct ksessions hashcode. Please replace ksession.hashCode() ksession.getIdentifier()</technical_language>

Target:
public void testConcurrentlyGetStatefulPrototypeKieSession() throws Exception { final int nThreads = 10; ExecutorService executorService = Executors.newFixedThreadPool(nThreads); final ConcurrentHashMap ksessionMap = new ConcurrentHashMap(); final CountDownLatch latch = new CountDownLatch(nThreads); for (int i = 0; i < nThreads; i++) { executorService.submit(new Runnable() { @Override public void run() { KieSession ksession = (KieSession) context.getBean("statefulPrototypeSession"); Object put = ksessionMap.put(ksession.getIdentifier(), new Object()); if (put != null) { log.warn("ksession:{} repeated", ksession); } latch.countDown(); } }); } latch.await(); assertEquals(nThreads,ksessionMap.size()); }
Source:
<code>public void createDatabase_withPropertiesAndOptions() throws CosmosClientException { CosmosDatabaseProperties databaseDefinition = new CosmosDatabaseProperties(CosmosDatabaseForTest.generateId()); <START> databases.add(ModelBridgeInternal.getResource(databaseDefinition).getId()); <END> CosmosDatabaseResponse createResponse = client.createDatabase(databaseDefinition, new CosmosDatabaseRequestOptions()); validateDatabaseResponse(databaseDefinition, createResponse); }</code><technical_language>getId() is added undo this change getId required method in CosmosDatabaseProperties. in other places for properties classes</technical_language>

Target:
public void createDatabase_withPropertiesAndOptions() throws CosmosClientException { CosmosDatabaseProperties databaseDefinition = new CosmosDatabaseProperties(CosmosDatabaseForTest.generateId()); databases.add(databaseDefinition.getId()); CosmosDatabaseResponse createResponse = client.createDatabase(databaseDefinition, new CosmosDatabaseRequestOptions()); validateDatabaseResponse(databaseDefinition, createResponse); }
Source:
<code>public void applyParameters(Material program) { super.applyParameters(program); DisplayResolutionDependentFBOs displayResolutionDependentFBOs = CoreRegistry.get(DisplayResolutionDependentFBOs.class); <START> FBO sceneOpaqueFbo = displayResolutionDependentFBOs.get(new ResourceUrn("engine:sceneOpaque")); <END> if (sceneOpaqueFbo != null) { GL13.glActiveTexture(GL13.GL_TEXTURE0); sceneOpaqueFbo.bindDepthTexture(); program.setInt("texDepth", 0); program.setFloat("texelWidth", 1.0f / sceneOpaqueFbo.width()); program.setFloat("texelHeight", 1.0f / sceneOpaqueFbo.height()); } program.setFloat("pixelOffsetX", pixelOffsetX); program.setFloat("pixelOffsetY", pixelOffsetY); }</code><technical_language>ResourceUrn...</technical_language>

Target:
public void applyParameters(Material program) { super.applyParameters(program); DisplayResolutionDependentFBOs displayResolutionDependentFBOs = CoreRegistry.get(DisplayResolutionDependentFBOs.class); FBO sceneOpaqueFbo = displayResolutionDependentFBOs.get(READONLY_GBUFFER); if (sceneOpaqueFbo != null) { GL13.glActiveTexture(GL13.GL_TEXTURE0); sceneOpaqueFbo.bindDepthTexture(); program.setInt("texDepth", 0); program.setFloat("texelWidth", 1.0f / sceneOpaqueFbo.width()); program.setFloat("texelHeight", 1.0f / sceneOpaqueFbo.height()); } program.setFloat("pixelOffsetX", pixelOffsetX); program.setFloat("pixelOffsetY", pixelOffsetY); }
Source:
<code>public void testMarkingAcl_allUseMarking_allowConstraintMask() throws Exception { Permissions testPerms = new Permissions( TestObjectFactory.newPermissionList( TestObjectFactory.generatePermissions(2, 2, 1, 2, AccessRight.USE_MARKING_AS_INT, 0, PermissionSource.MARKING))); Permissions.Acl acl = testPerms.getMarkingAcl(~VIEW_ACCESS_RIGHTS); assertEquals( ImmutableSet.<String>of("MARKING_allow_user_0", "MARKING_allow_user_1"), acl.getAllowUsers()); assertEquals( <START> ImmutableSet.<String>of("MARKING_allow_group_0", AUTHENTICATED_USERS), <END> acl.getAllowGroups()); assertEquals( ImmutableSet.<String>of("MARKING_deny_user_0", "MARKING_deny_user_1"), acl.getDenyUsers()); assertEquals( ImmutableSet.<String>of("MARKING_deny_group_0", "MARKING_deny_group_1"), acl.getDenyGroups()); }</code><technical_language>of 2, 2, 1, 2, in a order assertions, for purpose, guessing, of wrapping this line borderline obfuscated</technical_language>

Target:
public void testMarkingAcl_allUseMarking_allowConstraintMask() throws Exception { Permissions testPerms = new Permissions( TestObjectFactory.getMarkingPermissions()); Permissions.Acl acl = testPerms.getMarkingAcl(~VIEW_ACCESS_RIGHTS); assertEquals(ImmutableSet.of("MARKING_allow_user_0"), acl.getAllowUsers()); assertEquals( ImmutableSet.of("MARKING_allow_group_0", AUTHENTICATED_USERS), acl.getAllowGroups()); assertEquals(ImmutableSet.of("MARKING_deny_user_0"), acl.getDenyUsers()); assertEquals(ImmutableSet.of("MARKING_deny_group_0"), acl.getDenyGroups()); }
Source:
<code>public Notification createNotification(Intent inboundIntent) { <START> final NotificationData data = readInboundIntent(inboundIntent); <END> if (null == data) { return null; } else { this.data = data; } MPLog.d(LOGTAG, "MP FCM notification received: " + data.message); final PendingIntent contentIntent = PendingIntent.getActivity( context, 0, data.intent, PendingIntent.FLAG_UPDATE_CURRENT ); builder. setDefaults(MPConfig.getInstance(context).getNotificationDefaults()). setWhen(now). setContentTitle(data.title). setContentText(data.message). setTicker(data.ticker == null ? data.message : data.ticker). setContentIntent(contentIntent); maybeSetSubTitle(); maybeSetNotificationBarIcon(); maybeSetLargeIcon(); maybeSetExpandableNotification(); maybeSetCustomIconColor(); maybeAddActionButtons(); maybeSetChannel(); maybeSetNotificationBadge(); maybeSetGroupKey(contentIntent); maybeSetTime(); maybeSetVisibility(); final Notification n = buildNotification(); if (!data.sticky) { n.flags |= Notification.FLAG_AUTO_CANCEL; } return n; }</code><technical_language>do this.data = readInboundIntent(inboundIntent)</technical_language>

Target:
public Notification createNotification(Intent inboundIntent) { this.data = readInboundIntent(inboundIntent); if (null == data) { return null; } MPLog.d(LOGTAG, "MP FCM notification received: " + data.message); final PendingIntent contentIntent = PendingIntent.getActivity( context, 0, data.intent, PendingIntent.FLAG_UPDATE_CURRENT ); builder. setDefaults(MPConfig.getInstance(context).getNotificationDefaults()). setWhen(now). setContentTitle(data.title). setContentText(data.message). setTicker(data.ticker == null ? data.message : data.ticker). setContentIntent(contentIntent); maybeSetNotificationBarIcon(); maybeSetLargeIcon(); maybeSetExpandableNotification(); maybeSetCustomIconColor(); maybeAddActionButtons(); maybeSetChannel(); maybeSetNotificationBadge(); maybeSetTime(); maybeSetVisibility(); maybeSetSubText(); final Notification n = buildNotification(); if (!data.sticky) { n.flags |= Notification.FLAG_AUTO_CANCEL; } return n; }
Source:
<code>public CompletableFuture<Void> waitRunningAsync( List<CompletableFuture<?>> toCancelFutures, KubernetesMachineImpl machine) { CompletableFuture<Void> waitFuture = <START> namespace.deployments().waitRunningAsync(machine.getPodName(), tracerUtil); <END> toCancelFutures.add(waitFuture); return waitFuture; }</code><technical_language>I is construction phase pass this dependency passing tracing waitRunningAsync argument violates SRP of this method. This distracts dev purpose of this method</technical_language>

Target:
public CompletableFuture<Void> waitRunningAsync( List<CompletableFuture<?>> toCancelFutures, KubernetesMachineImpl machine) { Span tracingSpan = tracerUtil.buildSpan( "WaitRunningAsync", null, machine.getWorkspaceId(), machine.getPodName()); CompletableFuture<Void> waitFuture = namespace.deployments().waitRunningAsync(machine.getPodName()); waitFuture.whenComplete( (res, ex) -> { if (ex != null) { tracerUtil.finishSpanAsFailure(tracingSpan, ex.getMessage()); } else { tracerUtil.finishSpan(tracingSpan); } }); toCancelFutures.add(waitFuture); return waitFuture; }
Source:
<code>public ResponseEntity<?> getTicketTokensOpenForTransfer(Authentication auth) { User currentUser = (User) auth.getPrincipal(); Collection<TicketTransferToken> tokens = <START> ticketService.getValidTicketTransferTokensByUser(currentUser.getEmail()); <END> return createResponseEntity(HttpStatus.OK, "Ticket transfer tokens successfully retrieved.", tokens); }</code><technical_language>Method name is wrong (was, is). accept a User, changed getValidTicketTransferTokensByUserEmail()</technical_language>

Target:
public ResponseEntity<?> getTicketTokensOpenForTransfer(Authentication auth) { User currentUser = (User) auth.getPrincipal(); Collection<TicketTransferToken> tokens = ticketService.getValidTicketTransferTokensByUserEmail(currentUser.getEmail()); return createResponseEntity(HttpStatus.OK, "Ticket transfer tokens successfully retrieved.", tokens); }
Source:
<code>protected CompletableFuture<Void> doResolve(ITextViewer viewer, IProgressMonitor monitor) { return CompletableFuture.runAsync(() -> { try { long implCount= countImplementations((IType) getElement(), monitor); if (implCount == 0 && showImplementationsAtLeastOne) { super.setLabel(""); } else { <START> super.setLabel(implCount + " implementations"); END> } } catch (JavaModelException e) { } }); }</code><technical_language>If want "0 references" "1 reference", condition need replaced "==". way, strings need externalized in a .properties file</technical_language>

Target:
protected CompletableFuture<Void> doResolve(ITextViewer viewer, IProgressMonitor monitor) { return CompletableFuture.runAsync(() -> { try { long implCount= countImplementations((IType) getElement(), monitor); if (implCount == 0 && showImplementationsAtLeastOne) { super.setLabel(""); } else { super.setLabel(MessageFormat.format(JavaCodeMiningMessages.JavaImplementationCodeMining_label, implCount)); } } catch (JavaModelException e) { } }); }
Source:
<code>protected ProcessBuilder createProcessBuilder() { ProcessBuilder pb = new ProcessBuilder( Paths.get(System.getProperty("user.dir"), "/bin/storm").toString(), "logviewer", "-c", <START> "storm.log.dir=" + logdir, <END> "-c", Config.LOGVIEWER_PORT + "=" + port ); Path logPath = Paths.get(System.getenv("MESOS_SANDBOX"), "/logs"); if (!logPath.toFile().exists() && !logPath.toFile().mkdirs()) { throw new RuntimeException("Couldn't create log directory"); } File log = Paths.get(System.getenv("MESOS_SANDBOX"), "/logs/logviewer-startup.log").toFile(); pb.redirectErrorStream(true); pb.redirectOutput(Redirect.appendTo(log)); return pb; }</code><technical_language>@erikdw MESOS_SANDBOX is set Mesos correct? Wondering if override System.getenv("MESOS_SANDBOX") logdir if storm.log.dir is configured</technical_language>

Target:
protected ProcessBuilder createProcessBuilder() { ProcessBuilder pb = new ProcessBuilder( Paths.get(System.getProperty("user.dir"), "/bin/storm").toString(), "logviewer", "-c", "storm.log.dir=" + logDir, "-c", Config.LOGVIEWER_PORT + "=" + port ); Path logPath = Paths.get(logDir); if (!logPath.toFile().exists() && !logPath.toFile().mkdirs()) { throw new RuntimeException("Couldn't create log directory"); } File log = Paths.get(logDir, "/logviewer-startup.log").toFile(); pb.redirectErrorStream(true); pb.redirectOutput(Redirect.appendTo(log)); return pb; }
Source:
<code>private void processInput(EntityRef entity, CharacterMovementComponent characterMovementComponent) { lookYaw = (lookYaw - lookYawDelta) % 360; lookYawDelta = 0f; lookPitch = TeraMath.clamp(lookPitch + lookPitchDelta, -89, 89); lookPitchDelta = 0f; Vector3f relMove = new Vector3f(relativeMovement); relMove.y = 0; Quat4f viewRot; switch (characterMovementComponent.mode) { case WALKING: <START> if (!playerCamera.isTracked()) { <END> viewRot = new Quat4f(TeraMath.DEG_TO_RAD * lookYaw, 0, 0); playerCamera.setOrientation(viewRot); } playerCamera.getOrientation().rotate(relMove, relMove); break; case CLIMBING: relMove.y += relativeMovement.y; break; default: if (playerCamera.isTracked()) { viewRot = new Quat4f(TeraMath.DEG_TO_RAD * lookYaw, TeraMath.DEG_TO_RAD * lookPitch, 0); playerCamera.setOrientation(viewRot); } playerCamera.getOrientation().rotate(relMove, relMove); relMove.y += relativeMovement.y; break; } entity.send(new CharacterMoveInputEvent(inputSequenceNumber++, lookPitch, lookYaw, relMove, run, jump, time.getGameDeltaInMs())); jump = false; }</code><technical_language>Hmmmm. unconvinced this. cameras components camera component data change player moves head walk room, orientation position components in entity. then? A tracked flag in position orientation components? I recommend not: if a tracking system is enabled exclusive control of components simply write them. In this context more LocalPlayerSystem CharacterSystem store a tracked flag. said: is player's head _not_ tracked? changing orientation of a character mouse a form of (hand) tracking</technical_language>

Target:
private void processInput(EntityRef entity, CharacterMovementComponent characterMovementComponent) { lookYaw = (lookYaw - lookYawDelta) % 360; lookYawDelta = 0f; lookPitch = TeraMath.clamp(lookPitch + lookPitchDelta, -89, 89); lookPitchDelta = 0f; Vector3f relMove = new Vector3f(relativeMovement); relMove.y = 0; Quat4f viewRotation; switch (characterMovementComponent.mode) { case WALKING: if (!config.getRendering().isVrSupport()) { viewRotation = new Quat4f(TeraMath.DEG_TO_RAD * lookYaw, 0, 0); playerCamera.setOrientation(viewRotation); } playerCamera.getOrientation().rotate(relMove, relMove); break; case CLIMBING: relMove.y += relativeMovement.y; break; default: if (!config.getRendering().isVrSupport()) { viewRotation = new Quat4f(TeraMath.DEG_TO_RAD * lookYaw, TeraMath.DEG_TO_RAD * lookPitch, 0); playerCamera.setOrientation(viewRotation); } playerCamera.getOrientation().rotate(relMove, relMove); relMove.y += relativeMovement.y; break; } if (!Float.isNaN(relMove.getX()) && !Float.isNaN(relMove.getY()) && !Float.isNaN(relMove.getZ())) { entity.send(new CharacterMoveInputEvent(inputSequenceNumber++, lookPitch, lookYaw, relMove, run, jump, time.getGameDeltaInMs())); } jump = false; }
Source:
<code>private void generateRowkeys(long maxInput) { int maxLength = ("" + maxInput).length(); for (int i = 0; i < maxInput; i++) { <START> String paddedRowkey = String.format("%0" + maxLength + "d", i); <END> String reversedRowkey = new StringBuilder(paddedRowkey).reverse().toString(); keys[i] = "" + reversedRowkey; } Arrays.sort(keys); }</code><technical_language>concatenation in a loop</technical_language>

Target:
private void generateRowkeys(long maxInput) { int maxLength = ("" + maxInput).length(); String numberFormat = "%0" + maxLength + "d"; for (int i = 0; i < maxInput; i++) { String paddedRowkey = String.format(numberFormat, i); String reversedRowkey = new StringBuilder(paddedRowkey).reverse().toString(); keys[i] = "" + reversedRowkey; } Arrays.sort(keys); }
Source:
<code>public static boolean canBePreviewed(OCFile file) { <START> return (file != null && file.isAudio()); <END> }</code><technical_language>this change? Do audio streaming too</technical_language>

Target:
public static boolean canBePreviewed(OCFile file) { return (file != null && file.isDown() && file.isAudio()); }
Source:
<code>private void migrateAllVdss() { for (Guid vdsId : vdssToMaintenance.keySet()) { MaintenanceVdsParameters tempVar = new MaintenanceVdsParameters(vdsId, getParameters().getIsInternal(), <START> getParameters().getIsStopGlusterProcesses()); <END> tempVar.setSessionId(getParameters().getSessionId()); tempVar.setCorrelationId(getParameters().getCorrelationId()); VdcReturnValueBase result = runInternalAction(VdcActionType.MaintenanceVds, tempVar, ExecutionHandler.createInternalJobContext(getContext())); if (!result.isValid()) { getReturnValue().getValidationMessages().addAll(result.getValidationMessages()); getReturnValue().setValid(false); } } }</code><technical_language>MaintenanceNumberOfVdssCommand is put maintenance hosts command. parameter set for of hosts put maintenance end activating callback stopping gluster services of hosts ? Is desired behavior</technical_language>

Target:
private void migrateAllVdss() { for (Guid vdsId : vdssToMaintenance.keySet()) { MaintenanceVdsParameters tempVar = new MaintenanceVdsParameters(vdsId, getParameters().getIsInternal(), getParameters().isStopGlusterService()); tempVar.setSessionId(getParameters().getSessionId()); tempVar.setCorrelationId(getParameters().getCorrelationId()); VdcReturnValueBase result = runInternalAction(VdcActionType.MaintenanceVds, tempVar, ExecutionHandler.createInternalJobContext(getContext())); if (!result.isValid()) { getReturnValue().getValidationMessages().addAll(result.getValidationMessages()); getReturnValue().setValid(false); } } }
Source:
<code>private static void writePoint(DynamicSliceOutput output, OGCGeometry geometry) { Geometry esriGeometry = geometry.getEsriGeometry(); verify(esriGeometry instanceof Point); Point point = (Point) esriGeometry; verify(!point.hasAttribute(VertexDescription.Semantics.Z) && !point.hasAttribute(VertexDescription.Semantics.M) && !point.hasAttribute(VertexDescription.Semantics.ID), "Only 2D points with no ID nor M attribute are supported"); output.appendByte(GeometryType.POINT.code()); if (!point.isEmpty()) { output.appendDouble(point.getX()); output.appendDouble(point.getY()); } else { <START> output.appendDouble(translateToAVNaN(NaN)); <END> output.appendDouble(translateToAVNaN(NaN)); } }</code><technical_language>Double.NaN here</technical_language>

Target:
private static void writePoint(DynamicSliceOutput output, OGCGeometry geometry) { Geometry esriGeometry = geometry.getEsriGeometry(); verify(esriGeometry instanceof Point, "geometry is expected to be an instance of Point"); Point point = (Point) esriGeometry; verify(!point.hasAttribute(VertexDescription.Semantics.Z) && !point.hasAttribute(VertexDescription.Semantics.M) && !point.hasAttribute(VertexDescription.Semantics.ID), "Only 2D points with no ID nor M attribute are supported"); output.appendByte(GeometryType.POINT.code()); if (!point.isEmpty()) { output.appendDouble(point.getX()); output.appendDouble(point.getY()); } else { output.appendDouble(NaN); output.appendDouble(NaN); } }
Source:
<code>public static VdcReturnValueBase evaluateCorrelationId(VdcActionParametersBase parameters) { VdcReturnValueBase returnValue = null; <START> if (parameters != null) { <END> String correlationId = parameters.getCorrelationId(); if (StringUtils.isEmpty(correlationId)) { parameters.setCorrelationId(LoggedUtils.getObjectId(parameters)); } else if (correlationId.length() > MAX_CORRELATION_ID_LENGTH) { VdcReturnValueBase returnErrorValue = new VdcReturnValueBase(); returnErrorValue.setCanDoAction(false); returnErrorValue.getCanDoActionMessages() .add(VdcBllMessages.CORRELATION_ID_EXCEEDS_MAX_LENGTH.toString()); return returnErrorValue; } } return returnValue; }</code><technical_language>validation proccess consize pls validator validate parameter class place constraints annotation VdcActionPatameterBase. e.g public interface PreRun { } VdcActionParameterBase.java @Pattern(regexp = ValidationUtils.NO_SPECIAL_CHARACTERS, message = "VALIDATION.TAGS.INVALID_COR_ID", group = PreRun.class) String correlatijonId in evaluateCorrelationId ValidationUtils.getValidator.validate(parameters,PreRun.class) checkout CommandBase.validateInputs result handling</technical_language>

Target:
public static VdcReturnValueBase evaluateCorrelationId(VdcActionParametersBase parameters) { VdcReturnValueBase returnValue = null; if (parameters != null) { String correlationId = parameters.getCorrelationId(); if (StringUtils.isEmpty(correlationId)) { parameters.setCorrelationId(LoggedUtils.getObjectId(parameters)); } else { ValidationResult result = ValidationUtils.validateInputs(validationGroups, parameters, null); if (!result.isValid()) { VdcReturnValueBase returnErrorValue = new VdcReturnValueBase(); returnErrorValue.setCanDoAction(false); returnErrorValue.getCanDoActionMessages().addAll(result.getMessages()); return returnErrorValue; } } } return returnValue; }
Source:
<code><START> public ImmutableList<String> getDomains() throws DomainListException { <END> List<String> domains = getDomainListInternal(); ImmutableList<String> detectedDomains = detectDomains(); ImmutableList<String> detectedIps = detectIps(Iterables.concat(domains, detectedDomains)); Iterable<String> allDomains = Iterables.concat(domains, detectedDomains, detectedIps); if (LOGGER.isDebugEnabled()) { for (String domain : allDomains) { LOGGER.debug("Handling mail for: " + domain); } } return ImmutableList.copyOf(allDomains); }</code><technical_language>about: @Override public List<String> getDomains() throws DomainListException { ImmutableList<String> domainsWithoutIp = Stream.concat( getDomainListInternal().stream(), detectDomains().stream()) .collect(Guavate.toImmutableList()); List<String> detectedIps = detectIps(domainsWithoutIp); return Stream.concat( domainsWithoutIp.stream(), detectedIps.stream()) .peek(domain -> LOGGER.debug("Handling mail for {}" + domain)) .collect(Guavate.toImmutableList()); }</technical_language>

Target:
public ImmutableList<String> getDomains() throws DomainListException { List<String> domains = getDomainListInternal(); ImmutableList<String> detectedDomains = detectDomains(); Iterable<String> domainsWithoutIp = Iterables.concat(domains, detectedDomains); ImmutableList<String> detectedIps = detectIps(domainsWithoutIp); ImmutableList<String> allDomains = ImmutableList.copyOf(Iterables.concat(domainsWithoutIp, detectedIps)); if (LOGGER.isDebugEnabled()) { for (String domain : allDomains) { LOGGER.debug("Handling mail for: " + domain); } } return allDomains; }
Source:
<code>public List<RefRight> getAllRights(final ApprovalCategory.Id id) { List<RefRight> l = new ArrayList<RefRight>(); l.addAll(getLocalRights(id)); l.addAll(getInheritedRights(id)); Collections.sort(l, RefRight.REF_PATTERN_ORDER); <START> l = Collections.unmodifiableList(RefControl.filterMostSpecific(l)); <END> return l; }</code><technical_language>Style-nit: return Collections.unmodifiableList ... avoid assignment l</technical_language>

Target:
public List<RefRight> getAllRights(final ApprovalCategory.Id id) { List<RefRight> l = new ArrayList<RefRight>(); l.addAll(getLocalRights(id)); l.addAll(getInheritedRights(id)); Collections.sort(l, RefRight.REF_PATTERN_ORDER); return Collections.unmodifiableList(RefControl.filterMostSpecific(l)); }
Source:
<code>public void <START> canSupportGuaranteedSize() <END> throws InterruptedException { ImageAnalysis useCase = new ImageAnalysis.Builder().build(); mInstrumentation.runOnMainSync(() -> { CameraX.bindToLifecycle(mLifecycleOwner, mCameraSelector, useCase); mLifecycleOwner.startAndResume(); useCase.setAnalyzer(CameraXExecutors.newHandlerExecutor(mHandler), mAnalyzer); }); mAnalysisResultsSemaphore.tryAcquire(5, TimeUnit.SECONDS); synchronized (mAnalysisResultLock) { assertEquals(GUARANTEED_RESOLUTION, mAnalysisResults.iterator().next().mResolution); } }</code><technical_language>guaranteed size means ? is 640x480 ? want test default resolution ? I if purpose is test 640x480 is supported, rely fact default resolution 640x480 this moment default resolution changes in future. Instead set target resolution 640x480</technical_language>

Target:
public void canSupportGuaranteedSize() throws InterruptedException, CameraInfoUnavailableException { for (int i = 0; i <= 1; i++) { final int lensFacing = i; if (CameraUtil.hasCameraWithLensFacing(lensFacing)) { continue; } String cameraId = CameraX.getCameraFactory().cameraIdForLensFacing(lensFacing); boolean isRotateNeeded = (CameraX.getCameraInfo(cameraId).getSensorRotationDegrees( Surface.ROTATION_0) % 180) != 0; ImageAnalysis useCase = new ImageAnalysis.Builder().setTargetResolution( GUARANTEED_RESOLUTION).setTargetRotation( isRotateNeeded ? Surface.ROTATION_90 : Surface.ROTATION_0).build(); mInstrumentation.runOnMainSync(() -> { CameraSelector cameraSelector = new CameraSelector.Builder().requireLensFacing( lensFacing).build(); CameraX.bindToLifecycle(mLifecycleOwner, cameraSelector, useCase); mLifecycleOwner.startAndResume(); useCase.setAnalyzer(CameraXExecutors.newHandlerExecutor(mHandler), mAnalyzer); }); mAnalysisResultsSemaphore.tryAcquire(5, TimeUnit.SECONDS); synchronized (mAnalysisResultLock) { assertEquals(GUARANTEED_RESOLUTION, mAnalysisResults.iterator().next().mResolution); } } }
Source:
<code>protected void registerCommands() { registerCommand("getConf", new AlluxioCommand(mAlluxioPath, "getConf --master --source"), null); registerCommand("fsadmin", new AlluxioCommand(mAlluxioPath, "fsadmin report"), null); registerCommand("mount", new AlluxioCommand(mAlluxioPath, "fs mount"), null); registerCommand("version", new AlluxioCommand(mAlluxioPath, "version -r"), null); <START> registerCommand("job", <END> new AlluxioCommand(mAlluxioPath, "job ls"), null); registerCommand("journal", new AlluxioCommand(mAlluxioPath, String.format("fs ls -R %s", mFsContext.getClusterConf().get(PropertyKey.MASTER_JOURNAL_FOLDER))), new ShellCommand(new String[]{"ls", "-al", "-R", mFsContext.getClusterConf().get(PropertyKey.MASTER_JOURNAL_FOLDER)})); }</code><technical_language>@bradyoo is a api for JobService information instead of dumping list of JobID's? If not, collect number of jobs instead of jobs themselves. A list of JobId's external reviewer</technical_language>

Target:
protected void registerCommands() { registerCommand("getConf", new AlluxioCommand(mAlluxioPath, "getConf --master --source"), null); registerCommand("fsadmin", new AlluxioCommand(mAlluxioPath, "fsadmin report"), null); registerCommand("mount", new AlluxioCommand(mAlluxioPath, "fs mount"), null); registerCommand("version", new AlluxioCommand(mAlluxioPath, "version -r"), null); registerCommand("job", new AlluxioCommand(mAlluxioPath, "job ls"), null); registerCommand("journal", new AlluxioCommand(mAlluxioPath, String.format("fs ls -R %s", mFsContext.getClusterConf().get(PropertyKey.MASTER_JOURNAL_FOLDER))), getListJournalCommand()); }
Source:
<code>public void browserAgentHeader_should_include_default_if_browser_agent_header_not_provided(@Nullable String browserAgentHeader) { authCardDetails.setUserAgentHeader(browserAgentHeader); List<NameValuePair> result = epdqPayloadDefinitionFor3ds2NewOrder.extract(epdqTemplateData); <START> assertThat(result, hasItem(new BasicNameValuePair(BROWSER_USER_AGENT, "Mozilla/5.0"))); <END> }</code><technical_language>Niche</technical_language>

Target:
public void browserAgentHeader_should_include_default_if_browser_agent_header_not_provided(@Nullable String browserAgentHeader) { authCardDetails.setUserAgentHeader(browserAgentHeader); List<NameValuePair> result = epdqPayloadDefinitionFor3ds2NewOrder.extract(epdqTemplateData); assertThat(result, is(aParameterBuilder().withBrowserUserAgent("Mozilla/5.0").build())); }
Source:
<code>private String getEffectiveUser(Props jobProps) { String effectiveUser = null; if (jobProps.containsKey(USER_TO_PROXY)) { effectiveUser = jobProps.getString(USER_TO_PROXY); } else if (jobProps.containsKey(CommonJobProperties.SUBMIT_USER)) { effectiveUser = jobProps.getString(CommonJobProperties.SUBMIT_USER); } else { <START> throw new RuntimeException("There is no user.to.proxy and submit.user in the jobProps. There is something wrong with the system"); <END> } info("effective user is: " + effectiveUser); return effectiveUser; }</code><technical_language>shorten error msg</technical_language>

Target:
private String getEffectiveUser(Props jobProps) { String effectiveUser = null; if (jobProps.containsKey(USER_TO_PROXY)) { effectiveUser = jobProps.getString(USER_TO_PROXY); } else if (jobProps.containsKey(CommonJobProperties.SUBMIT_USER)) { effectiveUser = jobProps.getString(CommonJobProperties.SUBMIT_USER); } else { throw new RuntimeException( "Internal Error: No user.to.proxy or submit.user in the jobProps"); } info("effective user is: " + effectiveUser); return effectiveUser; }
Source:
<code>public Set<Map<String, String>> getAll() { Set<Map<String, String>> result = new HashSet<>(); try (Jedis jedis = getJedisPool().getResource()) { <START> Set<String> keys = jedis.hkeys(DEPOSIT_STATUS_PREFIX +"*"); <END> if (keys != null) { for(String uuid : keys) { result.add(jedis.hgetAll(DEPOSIT_STATUS_PREFIX + uuid)); } } } return result; }</code><technical_language>space + :)</technical_language>

Target:
public Set<Map<String, String>> getAll() { Set<Map<String, String>> result = new HashSet<>(); try (Jedis jedis = getJedisPool().getResource()) { Set<String> keys = jedis.keys(DEPOSIT_STATUS_PREFIX + "*"); if (keys != null) { for (String key : keys) { result.add(jedis.hgetAll(key)); } } } return result; }
Source:
<code>public void setTriggerStack(TriggerExecutionStack triggerStack){ <START> this.triggerStack=triggerStack; <END> }</code><technical_language>triggerStack overwritten</technical_language>

Target:
public void setTriggerStack(TriggerExecutionStack triggerStack){ if(this.triggerStack!=null){ SanityManager.THROWASSERT("LCC already has a trigger stack."); } this.triggerStack=triggerStack; }
Source:
<code>public void execute(ScriptEntry scriptEntry) { <START> <END> List<EntityTag> casters = (List<EntityTag>) scriptEntry.getObject("casters"); ElementTag skill = scriptEntry.getObjectTag("skill"); List<EntityTag> entity_targets = (List<EntityTag>) scriptEntry.getObject("entity_targets"); List<LocationTag> location_targets = (List<LocationTag>) scriptEntry.getObject("location_targets"); ElementTag power = scriptEntry.getObjectTag("power"); if (scriptEntry.dbCallShouldDebug()) { Debug.report(scriptEntry, getName(), ArgumentHelper.debugList("casters", casters) + skill.debug() + (location_targets == null ? "" : ArgumentHelper.debugList("location_Targets", location_targets)) + (entity_targets == null ? "" : ArgumentHelper.debugList("entity_targets", entity_targets)) + (power == null ? "" : power.debug())); } for (EntityTag entity : casters) { MythicMobsBridge.castSkill(entity, skill.asString(), entity_targets, location_targets, power.asFloat()); } }</code><technical_language>do get redundant newline now</technical_language>

Target:
public void execute(ScriptEntry scriptEntry) { List<EntityTag> casters = (List<EntityTag>) scriptEntry.getObject("casters"); ElementTag skill = scriptEntry.getObjectTag("skill"); List<EntityTag> entity_targets = (List<EntityTag>) scriptEntry.getObject("entity_targets"); List<LocationTag> location_targets = (List<LocationTag>) scriptEntry.getObject("location_targets"); ElementTag power = scriptEntry.getObjectTag("power"); if (scriptEntry.dbCallShouldDebug()) { Debug.report(scriptEntry, getName(), ArgumentHelper.debugList("casters", casters) + skill.debug() + (location_targets == null ? "" : ArgumentHelper.debugList("location_Targets", location_targets)) + (entity_targets == null ? "" : ArgumentHelper.debugList("entity_targets", entity_targets)) + (power == null ? "" : power.debug())); } HashSet<Entity> entityTargets = null; HashSet<Location> locationTargets = null; if (entity_targets != null) { entityTargets = new HashSet<>(); for (EntityTag entity : entity_targets) { entityTargets.add(entity.getBukkitEntity()); } } else { locationTargets = new HashSet<>(location_targets); } for (EntityTag caster : casters) { MythicMobsBridge.getAPI().castSkill(caster.getBukkitEntity(), skill.asString(), caster.getBukkitEntity().getLocation(), entityTargets, locationTargets, power.asFloat()); } }
Source:
<code>private DbUserCacheManager() { for (AuthenticationProfile profile : AuthenticationProfileRepository.getInstance().getProfiles()) { directoriesMap.put(profile.getDirectory().getName(), profile.getDirectory()); <START> } <END> }</code><technical_language>I unsure need cache another instance of this map... query repository iteration</technical_language>

Target:
private DbUserCacheManager() { }
Source:
<code>public void stop() { stopping = true; exec.shutdown(); synchronized (tasks) { for (ForkingTaskRunnerWorkItem taskWorkItem : tasks.values()) { if (taskWorkItem.processHolder != null) { log.info("Closing output stream to task[%s].", taskWorkItem.getTask().getId()); try { taskWorkItem.processHolder.process.getOutputStream().close(); } catch (Exception e) { log.warn(e, "Failed to close stdout to task[%s]. Destroying task.", taskWorkItem.getTask().getId()); taskWorkItem.processHolder.process.destroy(); } } } } final DateTime start = new DateTime(); final long timeout = new Interval(start, taskConfig.getGracefulShutdownTimeout()).toDurationMillis(); log.info("Waiting up to %,dms for shutdown.", timeout); if (timeout > 0) { try { final boolean terminated = exec.awaitTermination(timeout, TimeUnit.MILLISECONDS); final long elapsed = System.currentTimeMillis() - start.getMillis(); if (terminated) { log.info("Finished stopping in %,dms.", elapsed); } else { <START> log.warn("Executor failed to stop after %,dms, not waiting for it!", elapsed); <END> } } catch (InterruptedException e) { log.warn(e, "Interrupted while waiting for executor to finish."); Thread.currentThread().interrupt(); } } else { log.warn("Ran out of time, not waiting for executor to finish!"); } }</code><technical_language>this more alarming? Alert level</technical_language>

Target:
public void stop() { stopping = true; exec.shutdown(); synchronized (tasks) { for (ForkingTaskRunnerWorkItem taskWorkItem : tasks.values()) { if (taskWorkItem.processHolder != null) { log.info("Closing output stream to task[%s].", taskWorkItem.getTask().getId()); try { taskWorkItem.processHolder.process.getOutputStream().close(); } catch (Exception e) { log.warn(e, "Failed to close stdout to task[%s]. Destroying task.", taskWorkItem.getTask().getId()); taskWorkItem.processHolder.process.destroy(); } } } } final DateTime start = new DateTime(); final long timeout = new Interval(start, taskConfig.getGracefulShutdownTimeout()).toDurationMillis(); log.info("Waiting up to %,dms for shutdown.", timeout); if (timeout > 0) { try { final boolean terminated = exec.awaitTermination(timeout, TimeUnit.MILLISECONDS); final long elapsed = System.currentTimeMillis() - start.getMillis(); if (terminated) { log.info("Finished stopping in %,dms.", elapsed); } else { final Set<String> stillRunning = ImmutableSet.copyOf(tasks.keySet()); log.makeAlert("Failed to stop forked tasks") .addData("stillRunning", stillRunning) .addData("elapsed", elapsed) .emit(); log.warn( "Executor failed to stop after %,dms, not waiting for it! Tasks still running: [%s]", elapsed, Joiner.on("; ").join(stillRunning) ); } } catch (InterruptedException e) { log.warn(e, "Interrupted while waiting for executor to finish."); Thread.currentThread().interrupt(); } } else { log.warn("Ran out of time, not waiting for executor to finish!"); } }
Source:
<code>public NodeTypesVisualsApiData(VisualAppearanceResource visuals) { NodeTypeId parent = (NodeTypeId) visuals.getId().getParent(); TNodeType element = RepositoryFactory.getRepository().getElement(parent); this.color = visuals.getBorderColor(); this.nodeTypeId = parent.getQName(); if (Objects.nonNull(element.getTags())) { Optional<TTag> isPattern = element.getTags() .getTag() .stream() .filter( tTag -> "pattern".equals( tTag.getName().toLowerCase() ) ) .findFirst(); <START> <END> isPattern.ifPresent(tTag -> this.pattern = tTag.getValue()); } RepositoryFileReference iconRef = new RepositoryFileReference(visuals.getId(), Filename.FILENAME_SMALL_ICON); if (RepositoryFactory.getRepository().exists(iconRef)) { iconUrl = visuals.getAbsoluteURL() + "16x16"; } RepositoryFileReference imageRef = new RepositoryFileReference(visuals.getId(), Filename.FILENAME_BIG_ICON); if (RepositoryFactory.getRepository().exists(imageRef)) { imageUrl = visuals.getAbsoluteURL() + "50x50"; } }</code><technical_language>chain. java .findFirst() .ifPresent..</technical_language>

Target:
public NodeTypesVisualsApiData(VisualAppearanceResource visuals) { IRepository repository = RepositoryFactory.getRepository(); NodeTypeId parent = (NodeTypeId) visuals.getId().getParent(); this.color = visuals.getBorderColor(); this.nodeTypeId = parent.getQName(); this.pattern = repository.getNamespaceManager().isPatternNamespace(parent.getNamespace().getDecoded()); RepositoryFileReference iconRef = new RepositoryFileReference(visuals.getId(), Filename.FILENAME_SMALL_ICON); if (repository.exists(iconRef)) { iconUrl = visuals.getAbsoluteURL() + "16x16"; } RepositoryFileReference imageRef = new RepositoryFileReference(visuals.getId(), Filename.FILENAME_BIG_ICON); if (repository.exists(imageRef)) { imageUrl = visuals.getAbsoluteURL() + "50x50"; } }
Source:
<code>public boolean isBinding(String replName) { <START> return factory.isBinded(getId(), replName); <END> }</code><technical_language>If move this method there, this more like: java return factory.getInterpreter(noteId, replName) != null;</technical_language>

Target:
public boolean isBinding(String replName) { return factory.getInterpreter(this.getId(), replName) != null; }
Source:
<code><START> public List getSelected() { <END> return list.getSelectedValuesList(); }</code><technical_language>Raw type List</technical_language>

Target:
public List<String> getSelected() { return list.getSelectedValuesList(); }
Source:
<code>protected String[] initTextMessages() { IBindingService bindingService = (IBindingService) PlatformUI.getWorkbench().getAdapter(IBindingService.class); String bindingKey = bindingService .getBestActiveBindingFormattedFor(IWorkbenchCommandConstants.EDIT_CONTENT_ASSIST); String context; switch(ContextType.get(currentPath)) { case PATH_ITEM: context = "path item"; break; case PATH_PARAMETER: context = "parameter"; break; case PATH_RESPONSE: context = "response"; break; default: context = "schema"; break; } return new String[] { String.format(Messages.content_assist_proposal_project, bindingKey, context), String.format(Messages.content_assist_proposal_workspace, bindingKey, context), <START> String.format(Messages.content_assist_proposal_local, bindingKey, context) <END> }; }</code><technical_language>a screenshot: <img width="395" alt="screen shot 2016-07-14 11 51 52 am" src="<LINK_0>"></technical_language>

Target:
protected String[] initTextMessages() { IBindingService bindingService = (IBindingService) PlatformUI.getWorkbench().getAdapter(IBindingService.class); String bindingKey = bindingService .getBestActiveBindingFormattedFor(IWorkbenchCommandConstants.EDIT_CONTENT_ASSIST); String context; switch(ContextType.get(currentPath)) { case PATH_ITEM: context = "path items"; break; case PATH_PARAMETER: context = "parameters"; break; case PATH_RESPONSE: context = "responses"; break; default: context = "schemas"; break; } return new String[] { String.format(Messages.content_assist_proposal_project, bindingKey, context), String.format(Messages.content_assist_proposal_workspace, bindingKey, context), String.format(Messages.content_assist_proposal_local, bindingKey, context) }; }