auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>protected Boolean doCall() { String deploymentName = context.getDeploymentName(); String resourceGroupName = context.getResourceGroupName(); AzureClient azureClient = context.getAzureClient(); String networkId = context.getNetworkId(); List<AzurePrivateDnsZoneServiceEnum> enabledPrivateEndpointServices = context.getEnabledPrivateEndpointServices(); LOGGER.info("Waiting for DNS zone to be created: {}", deploymentName); ResourceStatus templateDeploymentStatus = azureClient.getTemplateDeploymentStatus(resourceGroupName, deploymentName); if (templateDeploymentStatus.isPermanent() && templateDeploymentStatus != ResourceStatus.DELETED && azureClient.checkIfDnsZonesDeployed(resourceGroupName, enabledPrivateEndpointServices)) { LOGGER.info("DNS zone and network link creation has been finished with status {}", templateDeploymentStatus); <START> if (StringUtils.isNotEmpty(networkId)) { return azureClient.checkIfNetworkLinksDeployed(resourceGroupName, networkId, enabledPrivateEndpointServices); } return true; } else { LOGGER.info("DNS zone and network link creation not finished yet."); return false; } } <END></code><technical_language>this called networkId is null</technical_language>

Target:
protected Boolean doCall() { String deploymentName = context.getDeploymentName(); String resourceGroupName = context.getResourceGroupName(); AzureClient azureClient = context.getAzureClient(); String networkId = context.getNetworkId(); List<AzurePrivateDnsZoneServiceEnum> enabledPrivateEndpointServices = context.getEnabledPrivateEndpointServices(); LOGGER.info("Waiting for DNS zone deployment to be created: {}", deploymentName); ResourceStatus templateDeploymentStatus = azureClient.getTemplateDeploymentStatus(resourceGroupName, deploymentName); if (templateDeploymentStatus == ResourceStatus.DELETED) { throw new CloudConnectorException(String.format("Deployment %s is either deleted of does not exist", deploymentName)); } if (templateDeploymentStatus.isPermanent() && templateDeploymentStatus != ResourceStatus.DELETED) { LOGGER.info("Deployment has been finished with status {}", templateDeploymentStatus); if (StringUtils.isNotEmpty(networkId)) { return azureClient.checkIfNetworkLinksDeployed(resourceGroupName, networkId, enabledPrivateEndpointServices); } else { return azureClient.checkIfDnsZonesDeployed(resourceGroupName, enabledPrivateEndpointServices); } } else { LOGGER.info("DNS zone or network link creation not finished yet."); return false; } }
Source:
<code>public void setup() { closeStandalone = new TMarkLogicCloseStandalone(); <START> closeProperties = new MarkLogicCloseProperties("close"); <END> closeProperties.referencedComponent.componentInstanceId.setValue("referenced1"); container = Mockito.mock(RuntimeContainer.class); closeStandalone.initialize(container, closeProperties); }</code><technical_language>initialize close properties this value? more do in @Test method, @Before</technical_language>

Target:
public void setup() { closeStandalone = new TMarkLogicCloseStandalone(); }
Source:
<code>public Collection<SequencerReference> listByPlatformType(PlatformType platformType) throws IOException { <START> return sequencerReferenceDao.list(0, 0, true, "id", PaginationFilter.archived(false)); <END> }</code><technical_language>Method name is listByPlatformType, anymore? PlatformType parameter is</technical_language>

Target:
public Collection<SequencerReference> listByPlatformType(PlatformType platformType) throws IOException { return sequencerReferenceDao.list(0, 0, true, "id", PaginationFilter.platformType(platformType), PaginationFilter.archived(false)); }
Source:
<code>public boolean delete(HttpServletRequest request, HttpServletResponse response) throws IOException, BadRequestException, NotFoundException, UnauthorizedException { Session session = Root.zebedee.getSessions().get(request); if (session == null || !Root.zebedee.getPermissionsService().canEdit(session.getEmail())) { throw new UnauthorizedException("You are not authorised to edit content."); } Collection collection = Collections.getCollection(request); String uri = request.getParameter("uri"); try { <START> info().uri(uri).collectionID(collection).user(session).log("deleting colleciton version content"); <END> collection.deleteVersion(session.getEmail(), uri); } finally { collection.save(); } Audit.Event.COLLECTION_VERSION_DELETED .parameters() .host(request) .collection(collection) .version(uri) .user(session.getEmail()) .log(); return true; }</code><technical_language>typo in log message</technical_language>

Target:
public boolean delete(HttpServletRequest request, HttpServletResponse response) throws IOException, BadRequestException, NotFoundException, UnauthorizedException { Session session = Root.zebedee.getSessions().get(request); if (session == null || !Root.zebedee.getPermissionsService().canEdit(session.getEmail())) { throw new UnauthorizedException("You are not authorised to edit content."); } Collection collection = Collections.getCollection(request); String uri = request.getParameter("uri"); try { info().uri(uri).collectionID(collection).user(session).log("deleting collection version content"); collection.deleteVersion(session.getEmail(), uri); } finally { collection.save(); } Audit.Event.COLLECTION_VERSION_DELETED .parameters() .host(request) .collection(collection) .version(uri) .user(session.getEmail()) .log(); return true; }
Source:
<code>public void testUpdateGroupLaunchConfigurationFail() { URI endpoint = URI.create("<LINK_0>"); GroupApi api = requestsSendResponses( keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, authenticatedGET().method("PUT").endpoint(endpoint) .payload(payloadFromResourceWithContentType("/autoscale_groups_update_launch_configuration_request.json", MediaType.APPLICATION_JSON)).build(), HttpResponse.builder().statusCode(404) .build()) .getGroupApiForZone("DFW"); LaunchConfiguration lc = LaunchConfiguration.builder() .loadBalancers(ImmutableList.of(LoadBalancer.builder().port(8080).id(9099).build())) .serverName("autoscale_server") .serverImageRef("0d589460-f177-4b0f-81c1-8ab8903ac7d8") .serverFlavorRef("2") .serverDiskConfig("AUTO") .serverMetadata(ImmutableMap.of("build_config","core","meta_key_1","meta_value_1","meta_key_2","meta_value_2")) .networks(ImmutableList.of("11111111-1111-1111-1111-111111111111","00000000-0000-0000-0000-000000000000")) .personalities(ImmutableList.of(Personality.builder().path("/root/.csivh").contents("VGhpcyBpcyBhIHRlc3QgZmlsZS4=").build())) .type(LaunchConfigurationType.LAUNCH_SERVER) .build(); boolean result = api.updateLaunchConfiguration("1234567890", lc); <START> assertEquals(result, false); <END> }</code><technical_language>in above: assertEquals(result, false); => assertFalse(result, "Expected updateLaunchConfiguration fail");</technical_language>

Target:
public void testUpdateGroupLaunchConfigurationFail() { URI endpoint = URI.create("<LINK_0>"); GroupApi api = requestsSendResponses( keystoneAuthWithUsernameAndPasswordAndTenantName, responseWithKeystoneAccess, authenticatedGET().method("PUT").endpoint(endpoint) .payload(payloadFromResourceWithContentType("/autoscale_groups_update_launch_configuration_request.json", MediaType.APPLICATION_JSON)).build(), HttpResponse.builder().statusCode(404) .build()) .getGroupApiForZone("DFW"); LaunchConfiguration lc = LaunchConfiguration.builder() .loadBalancers(ImmutableList.of(LoadBalancer.builder().port(8080).id(9099).build())) .serverName("autoscale_server") .serverImageRef("0d589460-f177-4b0f-81c1-8ab8903ac7d8") .serverFlavorRef("2") .serverDiskConfig("AUTO") .serverMetadata(ImmutableMap.of("build_config","core","meta_key_1","meta_value_1","meta_key_2","meta_value_2")) .networks(ImmutableList.of("11111111-1111-1111-1111-111111111111","00000000-0000-0000-0000-000000000000")) .personalities(ImmutableList.of(Personality.builder().path("/root/.csivh").contents("VGhpcyBpcyBhIHRlc3QgZmlsZS4=").build())) .type(LaunchConfigurationType.LAUNCH_SERVER) .build(); boolean result = api.updateLaunchConfiguration("1234567890", lc); assertFalse(result); }
Source:
<code><START> public Set<Row> getRelationships(Row entity, Relationships.Direction direction, String... names) { <END> String cp = entity.getString(Statements.CP); Observable<List<Row>> relationships = getRelationshipTables(direction) .flatMap(table -> { final Clause cond = eq(Statements.RELATIONSHIP_MAIN_CP.get(table), cp); Statement q = select().all().from(table).where(cond).and(in(Statements.NAME, Arrays.asList(names))); return session.execute(q); }) .map(ResultSet::all); return ImmutableSet.copyOf(relationships.toBlocking().first()); }</code><technical_language>I model changes a lot, update this reflect latest model, relationships modelled in 3 tables? "main" table, in/out tables meant for hops filtering</technical_language>

Target:
public Set<Row> getRelationships(Row entity, Relationships.Direction direction, String... names) { if (direction == outgoing) { String cp = entity.getString(Statements.CP); List<Row> result = statements.findOutRelationshipBySourceAndNames(cp, Arrays.asList(names)) .toList() .toBlocking() .first(); return ImmutableSet.copyOf(result); } else if (direction == incoming) { String cp = entity.getString(Statements.CP); List<Row> result = statements.findInRelationshipByTargetAndNames(cp, Arrays.asList(names)) .toList() .toBlocking() .first(); return ImmutableSet.copyOf(result); } else if (direction == both) { return ImmutableSet.<Row>builder() .addAll(getRelationships(entity, incoming, names)) .addAll(getRelationships(entity, outgoing, names)) .build(); } throw new IllegalStateException("Unsupported direction: " + direction); }
Source:
<code>public void predateEntitlementCerts() throws Exception { consumer.setCreated(new Date()); certServiceAdapter = new DefaultEntitlementCertServiceAdapter( realPKI, extensionUtil, v3extensionUtil, mock(EntitlementCertificateCurator.class), keyPairCurator, serialCurator, entCurator, I18nFactory.getI18n(getClass(), Locale.US, I18nFactory.FALLBACK), config, productCurator); Calendar cal = Calendar.getInstance(); cal.add(Calendar.HOUR, -2); pool.setStartDate(cal.getTime()); X509Certificate result = certServiceAdapter.createX509Certificate(entitlement, product, new HashSet<Product>(), getProductModels(product, new HashSet<Product>(), "prefix", entitlement), new BigInteger("1234"), keyPair, true); <START> assert (result.getNotBefore().getTime() == pool.getStartDate().getTime() / 1000 * 1000); <END> cal.add(Calendar.MINUTE, 90); pool.setStartDate(cal.getTime()); result = certServiceAdapter.createX509Certificate(entitlement, product, new HashSet<Product>(), getProductModels(product, new HashSet<Product>(), "prefix", entitlement), new BigInteger("1234"), keyPair, true); assert (result.getNotBefore().getTime() < pool.getStartDate().getTime() / 1000 * 1000); }</code><technical_language>assertTrue assertEquals</technical_language>

Target:
public void predateEntitlementCerts() throws Exception { consumer.setCreated(new Date()); certServiceAdapter = new DefaultEntitlementCertServiceAdapter( realPKI, extensionUtil, v3extensionUtil, mock(EntitlementCertificateCurator.class), keyPairCurator, serialCurator, entCurator, I18nFactory.getI18n(getClass(), Locale.US, I18nFactory.FALLBACK), config, productCurator); Calendar cal = Calendar.getInstance(); cal.add(Calendar.HOUR, -2); pool.setStartDate(cal.getTime()); X509Certificate result = certServiceAdapter.createX509Certificate(entitlement, product, new HashSet<Product>(), getProductModels(product, new HashSet<Product>(), "prefix", entitlement), new BigInteger("1234"), keyPair, true); assertTrue(result.getNotBefore().getTime() == pool.getStartDate().getTime() / 1000 * 1000); cal.add(Calendar.MINUTE, 90); pool.setStartDate(cal.getTime()); result = certServiceAdapter.createX509Certificate(entitlement, product, new HashSet<Product>(), getProductModels(product, new HashSet<Product>(), "prefix", entitlement), new BigInteger("1234"), keyPair, true); assertTrue(result.getNotBefore().getTime() < pool.getStartDate().getTime() / 1000 * 1000); }
Source:
<code>public VisualEditorPageObject clickInsertToolButton() { <START> for (int i=0; i<toolsList.size(); i++) { <END> if (toolsList.get(i).getText().contentEquals("Insert")) { toolsList.get(i).click(); } } return this; }</code><technical_language>is this loop necessary? need click a single element? However, I wrong 100% is checked</technical_language>

Target:
public VisualEditorPageObject clickInsertToolButton() { insertDropdownMenuButton.click(); return this; }
Source:
<code>public void testDataRegionMetrics() throws Exception { List<List<?>> res = execute(ignite0, "SELECT REPLACE(name, 'io.dataregion.default.'), value, description FROM SYS.METRICS"); Set<String> names = new HashSet<>(); DataRegionConfiguration cfg = <START> ignite0.configuration().getDataStorageConfiguration().getDefaultDataRegionConfiguration(); <END> for (List<?> row : res) { String name = (String)row.get(0); names.add(name); if ("InitialSize".equals(name)) assertEquals(Long.toString(cfg.getInitialSize()), row.get(1)); else if ("MaxSize".equals(name)) assertEquals(Long.toString(cfg.getMaxSize()), row.get(1)); assertNotNull("Metric value must be not null [name=" + row.get(0) + ']', row.get(1)); } for (String attr : EXPECTED_ATTRIBUTES) assertTrue(attr + " should be exported via SQL view", names.contains(attr)); }</code><technical_language>Add empty line, please</technical_language>

Target:
public void testDataRegionMetrics() throws Exception { List<List<?>> res = execute(ignite0, "SELECT REPLACE(name, 'io.dataregion.default.'), value, description FROM SYS.METRICS"); Set<String> names = new HashSet<>(); DataRegionConfiguration cfg = ignite0.configuration().getDataStorageConfiguration().getDefaultDataRegionConfiguration(); for (List<?> row : res) { String name = (String)row.get(0); String val = (String)row.get(1); names.add(name); if ("InitialSize".equals(name)) assertEquals(Long.toString(cfg.getInitialSize()), val); else if ("MaxSize".equals(name)) assertEquals(Long.toString(cfg.getMaxSize()), val); assertNotNull("Metric value must be not null [name=" + name + ']', val); } for (String attr : EXPECTED_ATTRIBUTES) assertTrue(attr + " should be exported via SQL view", names.contains(attr)); }
Source:
<code>public boolean onContextItemSelected(MenuItem item) { Message message = itemFromMenuInfo((AdapterContextMenuInfo) item .getMenuInfo()); switch (item.getItemId()) { case R.id.reply_to_stream: mListener.openCompose(message.getStream(), message.getSubject()); return true; case R.id.reply_to_private: mListener.openCompose(message.getReplyTo(app)); return true; case R.id.reply_to_sender: mListener.openCompose(message.getSender().getEmail()); return true; case R.id.narrow_to_private: ((ZulipActivity) getActivity()).doNarrow(new NarrowFilterPM(Arrays .asList(message.getRecipients(app)))); return true; case R.id.narrow_to_stream: ((ZulipActivity) getActivity()).doNarrow(new NarrowFilterStream( message.getStream(), null)); return true; case R.id.narrow_to_subject: ((ZulipActivity) getActivity()).doNarrow(new NarrowFilterStream( message.getStream(), message.getSubject())); return true; case R.id.copy_message: copyMessage(message); return true; case R.id.mute_topic: <START> if (app.isTopicMute(message.getStream().getId(), message.getSubject())) { END> mListener.unMuteTopic(message.getStream().getId(), message.getSubject()); } else { mListener.MuteTopic(message.getStream().getId(), message.getSubject()); } return true; default: return super.onContextItemSelected(item); } }</code><technical_language>A cleaner API isTopicMute accept a Message object</technical_language>

Target:
public boolean onContextItemSelected(MenuItem item) { Message message = itemFromMenuInfo(item.getMenuInfo()); switch (item.getItemId()) { case R.id.reply_to_stream: mListener.openCompose(message.getStream(), message.getSubject()); return true; case R.id.reply_to_private: mListener.openCompose(message.getReplyTo(app)); return true; case R.id.reply_to_sender: mListener.openCompose(message.getSender().getEmail()); return true; case R.id.narrow_to_private: if (getActivity() instanceof NarrowListener) { ((NarrowListener) getActivity()).onNarrow(new NarrowFilterPM(Arrays.asList(message.getRecipients(app)))); } return true; case R.id.narrow_to_stream: if (getActivity() instanceof NarrowListener) { ((NarrowListener) getActivity()).onNarrow(new NarrowFilterStream(message.getStream(), null)); } return true; case R.id.narrow_to_subject: if (getActivity() instanceof NarrowListener) { ((NarrowListener) getActivity()).onNarrow(new NarrowFilterStream(message.getStream(), message.getSubject())); } return true; case R.id.copy_message: copyMessage(message); return true; default: return super.onContextItemSelected(item); } }
Source:
<code>public void rulesLoaded() { profile.define(context); Map<String, BuiltInActiveRule> activeRules = getActiveRulesByRuleKey(context); <START> assertThat(activeRules.size()).isGreaterThan(0); <END> }</code><technical_language>This is check in line 54. In opinion some rules loaded if of</technical_language>

Target:
public void rulesLoaded() { profile.define(context); Map<String, BuiltInActiveRule> activeRules = getActiveRulesByRuleKey(context); assertThat(activeRules.size()).isGreaterThan(0); assertThat(activeRules.keySet()).contains("HTL-0"); }
Source:
<code>public void servoSetVelocity(ServoControl servo) { <START> log.info("servoSetVelocity id velocity {}", servo.getName(), getDeviceId(servo), (int) servo.getSpeed().intValue()); <END> msg.servoSetVelocity(getDeviceId(servo), (int) servo.getSpeed().intValue()); }</code><technical_language>velocity speed</technical_language>

Target:
public void servoSetVelocity(ServoControl servo) { int speed = -1; if (servo.getSpeed() != null) { speed = servo.getSpeed().intValue(); } log.info("servoSetVelocity id velocity {}", servo.getName(), getDeviceId(servo), speed); msg.servoSetVelocity(getDeviceId(servo), speed); }
Source:
<code>public String getLearnerMaster() { QuorumPeer.QuorumServer learnerMaster = observer.getCurrentLearnerMaster(); InetSocketAddress address = learnerMaster.addr.getReachableOrOne(); <START> if (learnerMaster == null || address == null) { <END> return "Unknown"; } return address.getAddress().getHostAddress() + ":" + address.getPort(); }</code><technical_language>if learnerMaster is null get a NPE learnerMaster.addr.getReachableOrOne() above</technical_language>

Target:
public String getLearnerMaster() { QuorumPeer.QuorumServer learnerMaster = observer.getCurrentLearnerMaster(); if (learnerMaster == null || learnerMaster.addr.isEmpty()) { return "Unknown"; } InetSocketAddress address = learnerMaster.addr.getReachableOrOne(); return address.getAddress().getHostAddress() + ":" + address.getPort(); }
Source:
<code>public void configure(Binder binder) { <START> Multibinder<Procedure> procedureMultibinder = newSetBinder(binder, Procedure.class); <END> procedureMultibinder.addBinding().toProvider(CreateEmptyPartitionProcedure.class).in(Scopes.SINGLETON); }</code><technical_language>shorten this procedures</technical_language>

Target:
public void configure(Binder binder) { Multibinder<Procedure> procedures = newSetBinder(binder, Procedure.class); procedures.addBinding().toProvider(CreateEmptyPartitionProcedure.class).in(Scopes.SINGLETON); }
Source:
<code>protected void applyInlineDeployments() { runtime.getComponentManager().refresh(false); <START> runtime.getComponentManager().start(); END> }</code><technical_language>I easy read. point of view, I expect a proper stop, refresh start. if start is ensure a state, I prefer a proper call another method</technical_language>

Target:
protected void applyInlineDeployments() throws Exception { runtime.getComponentManager().refresh(false); runtime.getComponentManager().start(); postSetUp(); }
Source:
<code>public TmfXYChartViewer(Composite parent, String title, String xLabel, String yLabel) { super(parent, title); fSwtChart = new Chart(parent, SWT.NONE) { @Override public boolean setFocus() { return fSwtChart.getPlotArea().setFocus(); } }; <START> fSwtChart.addMouseListener(new MouseAdapter() { <END> @Override public void mouseDown(MouseEvent e) { fSwtChart.getPlotArea().setFocus(); } }); IAxis xAxis = fSwtChart.getAxisSet().getXAxis(0); IAxis yAxis = fSwtChart.getAxisSet().getYAxis(0); if (title == null) { fSwtChart.getTitle().setVisible(false); } else { fSwtChart.getTitle().setText(title); } if (xLabel == null) { xAxis.getTitle().setVisible(false); } else { xAxis.getTitle().setText(xLabel); } if (yLabel == null) { yAxis.getTitle().setVisible(false); } else { yAxis.getTitle().setText(yLabel); } fMouseSelectionProvider = new TmfMouseSelectionProvider(this); fMouseDragZoomProvider = new TmfMouseDragZoomProvider(this); fMouseWheelZoomProvider = new TmfMouseWheelZoomProvider(this); fToolTipProvider = new TmfSimpleTooltipProvider(this); fMouseDragProvider = new TmfMouseDragProvider(this); }</code><technical_language>mouse listener is called. So, work clicking plot area. need add listener fSwtChart.getPlotArea().addMouseListener() I works (windows Linux)</technical_language>

Target:
public TmfXYChartViewer(Composite parent, String title, String xLabel, String yLabel) { super(parent, title); fSwtChart = new Chart(parent, SWT.NONE) { @Override public boolean setFocus() { return fSwtChart.getPlotArea().setFocus(); } }; fSwtChart.getPlotArea().addMouseListener(new MouseAdapter() { @Override public void mouseDown(MouseEvent e) { fSwtChart.getPlotArea().setFocus(); } }); IAxis xAxis = fSwtChart.getAxisSet().getXAxis(0); IAxis yAxis = fSwtChart.getAxisSet().getYAxis(0); if (title == null) { fSwtChart.getTitle().setVisible(false); } else { fSwtChart.getTitle().setText(title); } if (xLabel == null) { xAxis.getTitle().setVisible(false); } else { xAxis.getTitle().setText(xLabel); } if (yLabel == null) { yAxis.getTitle().setVisible(false); } else { yAxis.getTitle().setText(yLabel); } fMouseSelectionProvider = new TmfMouseSelectionProvider(this); fMouseDragZoomProvider = new TmfMouseDragZoomProvider(this); fMouseWheelZoomProvider = new TmfMouseWheelZoomProvider(this); fToolTipProvider = new TmfSimpleTooltipProvider(this); fMouseDragProvider = new TmfMouseDragProvider(this); }
Source:
<code>public Blob run() throws IOException { if (!admin.getActions().contains(action)) { throw new NuxeoException("Action '" + action + "' not found"); } if (!admin.isHttpEnabled(action) && !session.getPrincipal().isAdministrator()) { <START> throw new NuxeoException("Action '" + action + "' denied"); <END> } String userName = session.getPrincipal().getName(); BulkCommand.Builder builder = new BulkCommand.Builder(action, query).user(userName).params(parameters); if (repositoryName != null) { builder.repository(repositoryName); } else { builder.repository(session.getRepositoryName()); } if (bucketSize > 0) { builder.bucket(bucketSize); } if (batchSize > 0) { builder.batch(batchSize); } String commandId = service.submit(builder.build()); return Blobs.createJSONBlobFromValue(Collections.singletonMap("commandId", commandId)); }</code><technical_language>sense add 403 error code</technical_language>

Target:
public Blob run() throws IOException { if (!admin.getActions().contains(action)) { throw new NuxeoException("Action '" + action + "' not found", HttpServletResponse.SC_NOT_FOUND); } if (!admin.isHttpEnabled(action) && !session.getPrincipal().isAdministrator()) { throw new NuxeoException("Action '" + action + "' denied", HttpServletResponse.SC_FORBIDDEN); } String userName = session.getPrincipal().getName(); BulkCommand.Builder builder = new BulkCommand.Builder(action, query).user(userName).params(parameters); if (repositoryName != null) { builder.repository(repositoryName); } else { builder.repository(session.getRepositoryName()); } if (bucketSize > 0) { builder.bucket(bucketSize); } if (batchSize > 0) { builder.batch(batchSize); } String commandId = service.submit(builder.build()); return Blobs.createJSONBlobFromValue(Collections.singletonMap("commandId", commandId)); }
Source:
<code>public boolean handleSelection() { try { IAtsVersion newSelectedVersion = TargetedVersionColumnUI.promptFoundInVersion(getArtifact(), VersionReleaseType.UnReleased, VersionLockedType.UnLocked, getRelation()); if (newSelectedVersion == null) { return false; <START> } <END> if (this.oldSelectedVersion == null || !this.oldSelectedVersion.getName().equals( newSelectedVersion.getName())) { this.oldSelectedVersion = (Version) newSelectedVersion; IAtsChangeSet changes = AtsClientService.get().createChangeSet("Update Found-In-Location"); changes.setRelation(getArtifact(), getRelation(), newSelectedVersion); changes.executeIfNeeded(); notifyXModifiedListeners(); refresh(); return true; } return false; } catch (Exception ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); } return false; }</code><technical_language>need getName() this.oldSelectedVersion.notEquals(newSelectedVersion)</technical_language>

Target:
public boolean handleSelection() { try { if (FoundInVersionColumnUI.promptFoundInVersion(getArtifact(), VersionReleaseType.UnReleased, VersionLockedType.UnLocked, getRelation())) { notifyXModifiedListeners(); refresh(); return true; } return false; } catch (Exception ex) { OseeLog.log(Activator.class, OseeLevel.SEVERE_POPUP, ex); } return false; }
Source:
<code>protected void applyCSSProperty(Control control, String property, CSSValue value, String pseudo, CSSEngine engine) throws Exception { if (!(control instanceof CTabFolder) || value.getCssValueType() != CSSValue.CSS_PRIMITIVE_VALUE || ((CSSPrimitiveValue) value).getPrimitiveType() != CSSPrimitiveValue.CSS_IDENT) { return; } CTabFolder tabFolder = (CTabFolder) control; String <START> postion = <END> ((CSSPrimitiveValue) value).getStringValue(); switch (postion.toLowerCase()) { case "bottom": tabFolder.setTabPosition(SWT.BOTTOM); break; case "top": tabFolder.setTabPosition(SWT.TOP); break; } }</code><technical_language>typo</technical_language>

Target:
protected void applyCSSProperty(Control control, String property, CSSValue value, String pseudo, CSSEngine engine) throws Exception { if (!(control instanceof CTabFolder) || value.getCssValueType() != CSSValue.CSS_PRIMITIVE_VALUE || ((CSSPrimitiveValue) value).getPrimitiveType() != CSSPrimitiveValue.CSS_IDENT) { return; } CTabFolder tabFolder = (CTabFolder) control; String position = ((CSSPrimitiveValue) value).getStringValue(); switch (position.toLowerCase()) { case "bottom": tabFolder.setTabPosition(SWT.BOTTOM); break; case "top": tabFolder.setTabPosition(SWT.TOP); break; } }
Source:
<code>public static Map<String,Object> getAppData() { HashMap<String,Object> data = new HashMap<>(); AppData source = getClient().getAppData(); data.putAll(source.getAppData()); data.putAll(source.getAppDataMetaData()); <START> data.putAll(source.getAppDataSummary()); <END> return data; }</code><technical_language>getAppDataSummary removed contents included in getAppData (same for device metadata)</technical_language>

Target:
public static Map<String,Object> getAppData() { HashMap<String,Object> data = new HashMap<>(); AppData source = getClient().getAppData(); data.putAll(source.getAppData()); data.putAll(source.getAppDataMetaData()); return data; }
Source:
<code>public Timer.Context timeReadRowsFirstResponse() { if (firstResponseTimer == null) { firstResponseTimer = BigtableClientMetrics.timer( MetricLevel.Info, "grpc.method.ReadRows.firstResponse.latency"); <START> } <END> return firstResponseTimer.time(); }</code><technical_language>I is a lot of benefit this lazily created</technical_language>

Target:
public Timer.Context timeReadRowsFirstResponse() { return firstResponseTimer.time(); }
Source:
<code>public final byte[] format(Tag tag) { ByteArrayOutputStream os = new ByteArrayOutputStream(); OutputStreamWriter w = new OutputStreamWriter(os, Constants.CHARSET); try { w.write("object "); tag.getObjId().copyTo(w); w.write('\n'); w.write("type "); w.write(tag.getType()); w.write("\n"); w.write("tag "); w.write(tag.getTag()); w.write("\n"); w.write("tagger "); <START> if(tag.getTagger() != null) <END> w.write(tag.getTagger().toExternalString()); w.write('\n'); w.write('\n'); if(tag.getMessage() != null) w.write(tag.getMessage()); w.close(); } catch (IOException err) { throw new RuntimeException(err); } return os.toByteArray(); }</code><technical_language>Nak. Needs be: if (tag.getTagger() != null) { w.write("tagger "); w.write(tag.getTagger().toExternalString()); w.write('\n'); } is produce "tagger" header line if is identity it. create empty header line. fix cherry-pick</technical_language>

Target:
public final byte[] format(Tag tag) { ByteArrayOutputStream os = new ByteArrayOutputStream(); OutputStreamWriter w = new OutputStreamWriter(os, Constants.CHARSET); try { w.write("object "); tag.getObjId().copyTo(w); w.write('\n'); w.write("type "); w.write(tag.getType()); w.write("\n"); w.write("tag "); w.write(tag.getTag()); w.write("\n"); if (tag.getTagger() != null) { w.write("tagger "); w.write(tag.getTagger().toExternalString()); w.write('\n'); } w.write('\n'); if(tag.getMessage() != null) w.write(tag.getMessage()); w.close(); } catch (IOException err) { throw new RuntimeException(err); } return os.toByteArray(); }
Source:
<code>public void tapWithOptions(WebElement webElement, EnumMap<GestureOptions, String> gestureOptions) { logger.entering(webElement, gestureOptions); String s = gestureOptions.get(GestureOptions.TOUCH_COUNT); int touchCount = s == null ? 1 : Integer.parseInt(s); s = gestureOptions.get(GestureOptions.DURATION); <START> int duration = s == null ? 100 : Integer.parseInt(s); <END> super.tap(touchCount, webElement, duration); logger.exiting(); }</code><technical_language>Please code default values static final constant values</technical_language>

Target:
public void tapWithOptions(WebElement webElement, EnumMap<GestureOptions, String> gestureOptions) { logger.entering(webElement, gestureOptions); String s = gestureOptions.get(GestureOptions.TOUCH_COUNT); int touchCount = s == null ? 1 : Integer.parseInt(s); s = gestureOptions.get(GestureOptions.DURATION); int duration = s == null ? TAP_DURATION : Integer.parseInt(s); super.tap(touchCount, webElement, duration); logger.exiting(); }
Source:
<code>public void shouldCreateNewAutoGenerationOptionWithoutLocation() throws Exception { long originalCount = getAllCount(); SimpleObject autoGenerationOption = new SimpleObject(); autoGenerationOption.add("identifierType", IDENTIFIER_TYPE_UUID); autoGenerationOption.add("source", SOURCE); autoGenerationOption.add("automaticGenerationEnabled", true); autoGenerationOption.add("manualEntryEnabled", true); String json = new ObjectMapper().writeValueAsString(autoGenerationOption); MockHttpServletRequest req = request(RequestMethod.POST, getURI()); req.setContent(json.getBytes()); SimpleObject newAutoGenerationOption = deserialize(handle(req)); assertNotNull(PropertyUtils.getProperty(newAutoGenerationOption, "uuid")); assertEquals(originalCount + 1, getAllCount()); assertNotNull( PropertyUtils.getProperty(newAutoGenerationOption, "source")); <START> assertNotNull( PropertyUtils.getProperty(newAutoGenerationOption, "location")); <END> assertNotNull(PropertyUtils.getProperty(newAutoGenerationOption, "identifierType")); }</code><technical_language>Instead of assertNotNull, assertEquals more precise? null, a expect. so</technical_language>

Target:
public void shouldCreateNewAutoGenerationOptionWithoutLocation() throws Exception { long originalCount = getAllCount(); SimpleObject autoGenerationOption = new SimpleObject(); autoGenerationOption.add("identifierType", IDENTIFIER_TYPE_UUID); autoGenerationOption.add("source", SOURCE); autoGenerationOption.add("automaticGenerationEnabled", true); autoGenerationOption.add("manualEntryEnabled", true); String json = new ObjectMapper().writeValueAsString(autoGenerationOption); MockHttpServletRequest req = request(RequestMethod.POST, getURI()); req.setContent(json.getBytes()); SimpleObject response = deserialize(handle(req)); assertEquals(originalCount + 1, getAllCount()); Object autogenerationOptionUuid = PropertyUtils.getProperty(response, "uuid"); AutoGenerationOption newAutoGenerationOption = identifierSourceService .getAutoGenerationOption(Integer.parseInt(autogenerationOptionUuid.toString())); assertEquals(SOURCE, newAutoGenerationOption.getSource().getUuid()); assertNull(newAutoGenerationOption.getLocation()); assertEquals(IDENTIFIER_TYPE_UUID, newAutoGenerationOption.getIdentifierType().getUuid()); assertEquals(true, newAutoGenerationOption.isAutomaticGenerationEnabled()); assertEquals(true, newAutoGenerationOption.isManualEntryEnabled()); }
Source:
<code>private void memoryCacheReset(IMemoryDMContext memoryDMC) { for (IMemoryDMContext ctx : fMemoryCaches.keySet()) { <START> if (ctx.equals(memoryDMC) || DMContexts.isAncestorOf(ctx, memoryDMC)) { <END> fMemoryCaches.get(ctx).reset(); } } }</code><technical_language>CommandCache#reset() method pointed to, realize check ctx is null first, avoid risk of NPE</technical_language>

Target:
private void memoryCacheReset(IMemoryDMContext memoryDMC) { for (IMemoryDMContext ctx : fMemoryCaches.keySet()) { if (ctx != null && ctx.equals(memoryDMC) || DMContexts.isAncestorOf(ctx, memoryDMC)) { fMemoryCaches.get(ctx).reset(); } } }
Source:
<code>void handleResponse(ResponseInfo responseInfo) { if (isOperationComplete()) { return; } int correlationId = ((GetRequest) responseInfo.getRequest()).getCorrelationId(); GetRequestInfo getRequestInfo = correlationIdToGetRequestInfo.remove(correlationId); if (getRequestInfo == null) { return; } if (responseInfo.getError() != null) { setOperationException(new RouterException("Operation timed out", RouterErrorCode.OperationTimedOut)); responseHandler.onRequestResponseException(getRequestInfo.replicaId, new IOException("NetworkClient error")); operationTracker.onResponse(getRequestInfo.replicaId, false); } else { try { GetResponse getResponse = GetResponse .readFrom(new DataInputStream(new ByteBufferInputStream(responseInfo.getResponse())), clusterMap); if (getResponse.getCorrelationId() != correlationId) { setOperationException( new RouterException("The correlation id in the GetResponse " + getResponse.getCorrelationId() + "is not the same as the correlation id in the associated GetRequest: " + correlationId, RouterErrorCode.UnexpectedInternalError)); operationTracker.onResponse(getRequestInfo.replicaId, false); } else { processGetResponse(getRequestInfo, getResponse); } <START> } catch (IOException | MessageFormatException e) { <END> setOperationException(new RouterException("Response deserialization received an unexpected error", e, RouterErrorCode.UnexpectedInternalError)); operationTracker.onResponse(getRequestInfo.replicaId, false); } } checkAndMaybeComplete(); }</code><technical_language>is this supported in older java versions? good this</technical_language>

Target:
void handleResponse(ResponseInfo responseInfo) { if (isOperationComplete()) { return; } int correlationId = ((GetRequest) responseInfo.getRequest()).getCorrelationId(); GetRequestInfo getRequestInfo = correlationIdToGetRequestInfo.remove(correlationId); if (responseInfo.getError() != null) { setOperationException(new RouterException("Operation timed out", RouterErrorCode.OperationTimedOut)); responseHandler.onRequestResponseException(getRequestInfo.replicaId, new IOException("NetworkClient error")); operationTracker.onResponse(getRequestInfo.replicaId, false); } else { try { GetResponse getResponse = GetResponse .readFrom(new DataInputStream(new ByteBufferInputStream(responseInfo.getResponse())), clusterMap); if (getResponse.getCorrelationId() != correlationId) { setOperationException( new RouterException("The correlation id in the GetResponse " + getResponse.getCorrelationId() + "is not the same as the correlation id in the associated GetRequest: " + correlationId, RouterErrorCode.UnexpectedInternalError)); operationTracker.onResponse(getRequestInfo.replicaId, false); } else { processGetResponse(getRequestInfo, getResponse); } } catch (IOException | MessageFormatException e) { setOperationException(new RouterException("Response deserialization received an unexpected error", e, RouterErrorCode.UnexpectedInternalError)); operationTracker.onResponse(getRequestInfo.replicaId, false); } } checkAndMaybeComplete(); }
Source:
<code><START> private static final int getFreePort() throws Exception { <END> try (ServerSocket socket = new ServerSocket(0)) { return socket.getLocalPort(); } }</code><technical_language>"final" is needed private methods</technical_language>

Target:
private static int getFreePort() throws Exception { try (ServerSocket socket = new ServerSocket(0)) { return socket.getLocalPort(); } }
Source:
<code>private void notifyClients(boolean finish) { synchronized (callbackList) { <START> final int N = callbackList.beginBroadcast(); <END> for (int i = 0; i < N; i++) { try { ICacheDownloadServiceCallback cb = callbackList.getBroadcastItem(i); if (finish) { cb.notifyFinish(); } else { cb.notifyRefresh(); } } catch (RemoteException e) { } } callbackList.finishBroadcast(); } }</code><technical_language>single character identifiers, for _index_ variable in a for-loop. variables fields starting uppercase character (except for constant values)</technical_language>

Target:
private void notifyClients(boolean finish) { synchronized (callbackList) { final int maxClientId = callbackList.beginBroadcast(); for (int i = 0; i < maxClientId; i++) { try { ICacheDownloadServiceCallback cb = callbackList.getBroadcastItem(i); if (finish) { cb.notifyFinish(); } else { cb.notifyRefresh(queue.size()); } } catch (RemoteException e) { } } callbackList.finishBroadcast(); } }
Source:
<code>public ValidationResult canStopOrCommitRemoveBrick(GlusterVolumeEntity volumeEntity, List<GlusterBrickEntity> paramBricks) { GlusterAsyncTask asyncTask = volumeEntity.getAsyncTask(); if (asyncTask == null || asyncTask.getType() != GlusterTaskType.REMOVE_BRICK) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_INVALID_TASK_TYPE); } if (paramBricks.isEmpty()) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_BRICKS_REQUIRED); } List<GlusterBrickEntity> bricksForTask = getGlusterBrickDao().getGlusterVolumeBricksByTaskId(asyncTask.getTaskId()); if (paramBricks.size() != bricksForTask.size() || !areBricksInTheList(volumeEntity, paramBricks, bricksForTask)) { <START> return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REMOVE_BRICKS_PARAMS_INVALID); <END> } return ValidationResult.VALID; }</code><technical_language>I useful return list of valid bricks end user</technical_language>

Target:
public ValidationResult canStopOrCommitRemoveBrick(GlusterVolumeEntity volumeEntity, List<GlusterBrickEntity> paramBricks) { GlusterAsyncTask asyncTask = volumeEntity.getAsyncTask(); if (asyncTask == null || asyncTask.getType() != GlusterTaskType.REMOVE_BRICK) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_INVALID_TASK_TYPE); } if (paramBricks.isEmpty()) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_BRICKS_REQUIRED); } List<GlusterBrickEntity> bricksForTask = getGlusterBrickDao().getGlusterVolumeBricksByTaskId(asyncTask.getTaskId()); if (paramBricks.size() != bricksForTask.size() || !areBricksInTheList(volumeEntity, paramBricks, bricksForTask)) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_GLUSTER_VOLUME_REMOVE_BRICKS_PARAMS_INVALID, String.format("$validBricks [%s]", getValidBrickNames(bricksForTask))); } return ValidationResult.VALID; }
Source:
<code>private DirectMucInvitationManager(XMPPConnection connection) { super(connection); <START> ServiceDiscoveryManager.getInstanceFor(connection).addFeature(GroupChatInvitation.NAMESPACE); <END> registerExtensionElementListener(); }</code><technical_language>I ServiceDiscoveryManager a field of this class</technical_language>

Target:
private DirectMucInvitationManager(XMPPConnection connection) { super(connection); serviceDiscoveryManager = ServiceDiscoveryManager.getInstanceFor(connection); registerExtensionElementListener(); serviceDiscoveryManager.addFeature(GroupChatInvitation.NAMESPACE); }
Source:
<code>private UploadProgress checkProgress(File uploadFile, String objectId) { val uploadId = UploadStateStore.fetchUploadId(uploadFile, objectId); UploadProgress progress = null; progress = storageService.getProgress(objectId, uploadFile.length()); if (uploadId.isPresent() && progress != null) { if (!uploadId.get().equalsIgnoreCase(progress.getUploadId())) { val msg = String.format( "Local in-progress upload %s conflicts with remote upload in progress %s. Aborting local upload.", uploadId.get(), progress.getUploadId()); throw new NotResumableException(new IllegalStateException(msg)); } } else if (progress != null) { val msg = String .format( "There is already an upload in progress that was started elsewhere with upload id %s. Aborting local upload.", progress.getUploadId()); <START> throw new NotResumableException(new IllegalStateException(msg)); <END> } return progress; }</code><technical_language>This pattern code base takes significant amount of space articulate. I adding a checkStateResumable in order. For example: java ... } else { checkStateResumable(progress == null, "There is upload in progress started upload id %s. Aborting local upload.", progress.getUploadId()); }</technical_language>

Target:
private UploadProgress checkProgress(File uploadFile, String objectId) { val uploadId = UploadStateStore.fetchUploadId(uploadFile, objectId); val progress = storageService.getProgress(objectId, uploadFile.length()); if (uploadId.isPresent() && progress != null) { if (!uploadId.get().equalsIgnoreCase(progress.getUploadId())) { val msg = String.format( "Local in-progress upload %s conflicts with remote upload in progress %s. Aborting local upload.", uploadId.get(), progress.getUploadId()); throw new NotResumableException(new IllegalStateException(msg)); } } else if (progress != null) { val msg = String .format( "There is already an upload in progress that was started elsewhere with upload id %s. Aborting local upload.", progress.getUploadId()); throw new NotResumableException(new IllegalStateException(msg)); } return progress; }
Source:
<code><START> public Privilege[] getSupportedPrivileges(String path) throws PathNotFoundException, RepositoryException { <END> return privileges.listOfSupported(); }</code><technical_language>Remove exceptions, thrown method</technical_language>

Target:
public Privilege[] getSupportedPrivileges(String path) { return privileges.listOfSupported(); }
Source:
<code><START> public synchronized HashSet<BoltServerAddress> update( ClusterComposition cluster ) <END> { expirationTimeout = cluster.expirationTimestamp; HashSet<BoltServerAddress> removed = new HashSet<>(); readers.update( cluster.readers(), removed ); writers.update( cluster.writers(), removed ); routers.update( cluster.routers(), removed ); return removed; }</code><technical_language>is Set<BoltServerAddress> return type</technical_language>

Target:
public synchronized Set<BoltServerAddress> update( ClusterComposition cluster ) { expirationTimeout = cluster.expirationTimestamp; HashSet<BoltServerAddress> removed = new HashSet<>(); readers.update( cluster.readers(), removed ); writers.update( cluster.writers(), removed ); routers.update( cluster.routers(), removed ); return removed; }
Source:
<code>private static String toArkUrl(String ark) { if (!(ark.startsWith("http://") || ark.startsWith("https://"))) { String arkUrlBase = Constants.DAMS_ARK_URL_BASE; arkUrlBase += arkUrlBase.endsWith("/") ? "" : "/"; <START> return arkUrlBase + "20775/" + ark; <END> } return ark; }</code><technical_language>In test, Constants.ARK_ORG, work well</technical_language>

Target:
private static String toArkUrl(String ark) { if (!(ark.startsWith("http://") || ark.startsWith("https://"))) { String arkUrlBase = Constants.DAMS_ARK_URL_BASE; arkUrlBase += arkUrlBase.endsWith("/") ? "" : "/"; return arkUrlBase + Constants.ARK_ORG + "/" + ark; } return ark; }
Source:
<code>private void fireDataChangedEvents(final String path, Set<IZkDataListenerEntry> listeners, final OptionalLong notificationTime, boolean pathExists) { try { final ZkPathStatRecord pathStatRecord = new ZkPathStatRecord(path); for (final IZkDataListenerEntry listener : listeners) { _eventThread.send(new ZkEvent("Data of " + path + " changed sent to " + listener.getDataListener() + " prefetch data: " + listener.isPrefetchData()) { @Override public void run() throws Exception { if (!pathExists) { listener.getDataListener().handleDataDeleted(path); return; } if (!pathStatRecord.pathChecked()) { <START> pathStatRecord.recordPathStat(getStat(path, true), notificationTime); <END> } Object data = null; if (listener.isPrefetchData()) { if (LOG.isDebugEnabled()) { LOG.debug("Prefetch data for path: {}", path); } try { data = readData(path, null, true); } catch (ZkNoNodeException e) { LOG.warn("Prefetch data for path: failed.", path, e); listener.getDataListener().handleDataDeleted(path); return; } } listener.getDataListener().handleDataChange(path, data); } }); } } catch (Exception e) { LOG.error("Failed to fire data changed event for path: {}", path, e); } }</code><technical_language>avoided notificationTime report deleting events this change. Please original order</technical_language>

Target:
private void fireDataChangedEvents(final String path, Set<IZkDataListenerEntry> listeners, final OptionalLong notificationTime, boolean pathExists) { try { final ZkPathStatRecord pathStatRecord = new ZkPathStatRecord(path); for (final IZkDataListenerEntry listener : listeners) { _eventThread.send(new ZkEvent("Data of " + path + " changed sent to " + listener.getDataListener() + " prefetch data: " + listener.isPrefetchData()) { @Override public void run() throws Exception { if (!pathStatRecord.pathChecked()) { pathStatRecord.recordPathStat(getStat(path, pathExists), notificationTime); } if (!pathStatRecord.pathExists()) { listener.getDataListener().handleDataDeleted(path); } else { Object data = null; if (listener.isPrefetchData()) { if (LOG.isDebugEnabled()) { LOG.debug("Prefetch data for path: {}", path); } try { data = readData(path, null, true); } catch (ZkNoNodeException e) { LOG.warn("Prefetch data for path: failed.", path, e); listener.getDataListener().handleDataDeleted(path); return; } } listener.getDataListener().handleDataChange(path, data); } } }); } } catch (Exception e) { LOG.error("Failed to fire data changed event for path: {}", path, e); } }
Source:
<code>public void before(){ browser.navigate().refresh(); Graphene.goTo(JVMPage.class); <START> browser.manage().window().maximize(); <END> Console.withBrowser(browser).waitUntilLoaded(); }</code><technical_language>consider org.jboss.hal.testsuite.util.Console.maximizeWindow() instead</technical_language>

Target:
public void before(){ browser.navigate().refresh(); Graphene.goTo(JVMPage.class); Console.withBrowser(browser).maximizeWindow().waitUntilLoaded(); }
Source:
<code>private Object getNameByValue(Object value) { for (GraphQLEnumValueDefinition valueDefinition : valueDefinitionMap.values()) { Object definitionValue = valueDefinition.getValue(); if (value.equals(definitionValue)) { return valueDefinition.getName(); } if (definitionValue instanceof Enum && value instanceof String) { <START> if (value.equals(definitionValue.toString())) { <END> return valueDefinition.getName(); } } } if (value instanceof Enum) { String enumNameValue = ((Enum<?>) value).name(); for (GraphQLEnumValueDefinition valueDefinition : valueDefinitionMap.values()) { Object definitionValue = String.valueOf(valueDefinition.getValue()); if (enumNameValue.equals(definitionValue)) { return valueDefinition.getName(); } } } throw new CoercingSerializeException("Invalid input for Enum '" + name + "'. Unknown value '" + value + "'"); }</code><technical_language>call name() instead? toString() overriden owner of enum class name() is final</technical_language>

Target:
private Object getNameByValue(Object value) { for (GraphQLEnumValueDefinition valueDefinition : valueDefinitionMap.values()) { Object definitionValue = valueDefinition.getValue(); if (value.equals(definitionValue)) { return valueDefinition.getName(); } if (definitionValue instanceof Enum && value instanceof String) { if (value.equals(((Enum) definitionValue).name())) { return valueDefinition.getName(); } } } if (value instanceof Enum) { String enumNameValue = ((Enum<?>) value).name(); for (GraphQLEnumValueDefinition valueDefinition : valueDefinitionMap.values()) { Object definitionValue = String.valueOf(valueDefinition.getValue()); if (enumNameValue.equals(definitionValue)) { return valueDefinition.getName(); } } } throw new CoercingSerializeException("Invalid input for Enum '" + name + "'. Unknown value '" + value + "'"); }