auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public Element createRootElement(Document doc, Jsr107CacheConfiguration cacheConfiguration) { <END> Element rootElement = doc.createElementNS(NAMESPACE.toString(), JSR_NAMESPACE_PREFIX + COLON + MBEANS_ELEMENT_NAME); rootElement.setAttributeNS(XMLConstants.XMLNS_ATTRIBUTE_NS_URI, "xmlns:" + JSR_NAMESPACE_PREFIX, NAMESPACE.toString()); ConfigurationElementState managementState = cacheConfiguration.isManagementEnabled(); ConfigurationElementState statisticsState = cacheConfiguration.isStatisticsEnabled(); if (ConfigurationElementState.ENABLED == managementState || ConfigurationElementState.DISABLED == managementState) { rootElement.setAttribute(MANAGEMENT_ENABLED_ATTRIBUTE, String.valueOf(cacheConfiguration.isManagementEnabled() .asBoolean())); } if (ConfigurationElementState.ENABLED == statisticsState || ConfigurationElementState.DISABLED == statisticsState) { rootElement.setAttribute(STATISTICS_ENABLED_ATTRIBUTE, String.valueOf(cacheConfiguration.isStatisticsEnabled() .asBoolean())); } return rootElement; }</code><technical_language>local variable</technical_language>

Target:
protected Element createRootElement(Document doc, Jsr107CacheConfiguration cacheConfiguration) { Element rootElement = doc.createElementNS(NAMESPACE.toString(), JSR_NAMESPACE_PREFIX + COLON + MBEANS_ELEMENT_NAME); ConfigurationElementState managementState = cacheConfiguration.isManagementEnabled(); ConfigurationElementState statisticsState = cacheConfiguration.isStatisticsEnabled(); if (ConfigurationElementState.ENABLED == managementState || ConfigurationElementState.DISABLED == managementState) { rootElement.setAttribute(MANAGEMENT_ENABLED_ATTRIBUTE, String.valueOf(cacheConfiguration.isManagementEnabled() .asBoolean())); } if (ConfigurationElementState.ENABLED == statisticsState || ConfigurationElementState.DISABLED == statisticsState) { rootElement.setAttribute(STATISTICS_ENABLED_ATTRIBUTE, String.valueOf(cacheConfiguration.isStatisticsEnabled() .asBoolean())); } return rootElement; }
Source:
<code>public void afterPropertiesSet() throws Exception { Mongo mongo; ServerAddress defaultOptions = new ServerAddress(); if (mongoOptions == null) { mongoOptions = new MongoOptions(); } <START> if (replicaPair != null && !replicaPair.isEmpty()) { <END> if (replicaPair.size() < 2) { throw new CannotGetMongoDbConnectionException("A replica pair must have two server entries"); } mongo = new Mongo(replicaPair.get(0), replicaPair.get(1), mongoOptions); } else if (replicaSetSeeds != null && !replicaSetSeeds.isEmpty()) { mongo = new Mongo(replicaSetSeeds, mongoOptions); } else { String mongoHost = StringUtils.hasText(host) ? host : defaultOptions.getHost(); mongo = port != null ? new Mongo(new ServerAddress(mongoHost, port), mongoOptions) : new Mongo(mongoHost, mongoOptions); } if (writeConcern != null) { mongo.setWriteConcern(writeConcern); } this.mongo = mongo; }</code><technical_language>Extract isNullOrEmpty() reuse in other if clause</technical_language>

Target:
public void afterPropertiesSet() throws Exception { Mongo mongo; ServerAddress defaultOptions = new ServerAddress(); if (mongoOptions == null) { mongoOptions = new MongoOptions(); } if (!isNullOrEmpty(replicaPair)) { if (replicaPair.size() < 2) { throw new CannotGetMongoDbConnectionException("A replica pair must have two server entries"); } mongo = new Mongo(replicaPair.get(0), replicaPair.get(1), mongoOptions); } else if (!isNullOrEmpty(replicaSetSeeds)) { mongo = new Mongo(replicaSetSeeds, mongoOptions); } else { String mongoHost = StringUtils.hasText(host) ? host : defaultOptions.getHost(); mongo = port != null ? new Mongo(new ServerAddress(mongoHost, port), mongoOptions) : new Mongo(mongoHost, mongoOptions); } if (writeConcern != null) { mongo.setWriteConcern(writeConcern); } this.mongo = mongo; }
Source:
<code><START> public ImmutableMap<String, LookupExtractor> getAll() throws ISE <END> { synchronized (lock) { assertStarted(); return ImmutableMap.copyOf(lookupMap); } }</code><technical_language>this needs synchronized. final ImmutableMap<String, LookupExtractor> immutableLookupMap = ImmutableMap.copyOf(lookupMap); assertStarted(); return immutableLookupMap; work</technical_language>

Target:
public Map<String, LookupExtractorFactory> getAll() { assertStarted(); return Maps.newHashMap(lookupMap); }
Source:
<code>public void startVDOService(VDS vds) { boolean succeeded = runVdsCommand(VDSCommandType.ManageGlusterService, new GlusterServiceVDSParameters(vds.getId(), Arrays.asList("vdo"), "restart")).getSucceeded(); if (!succeeded) { <START> log.error("Failed to stop VDO service while moving the host '{}' to maintenance", vds.getHostName()); <END> } }</code><technical_language>Failed start while activating host</technical_language>

Target:
public void startVDOService(VDS vds) { boolean succeeded = runVdsCommand(VDSCommandType.ManageGlusterService, new GlusterServiceVDSParameters(vds.getId(), Arrays.asList("vdo"), "restart")).getSucceeded(); if (!succeeded) { log.error("Failed to start VDO service while moving the host '{}' to maintenance", vds.getHostName()); } }
Source:
<code>public void testResultMessagesNullValue() throws Exception { try { <START> new BusinessException(null, null); <END> } catch (Exception e) { assertThat(e.getMessage(), is("messages must not be null")); throw e; } }</code><technical_language>[x] throw is missing. --- modified. bd4f804b9c372d711df571b2c3551406f2cef8c7</technical_language>

Target:
public void testResultMessagesNullValue() { expectedException.expect(IllegalArgumentException.class); expectedException.expectMessage("messages must not be null"); throw new BusinessException(null, null); }
Source:
<code>public void visit( OutputPortInfo p ) { if( p.protocol() != null ) { <START> p.protocol().accept( this ); <END> p.setProtocol( currNode ); } if( p.location() != null ) { p.location().accept( this ); p.setLocation( currNode ); } programChildren.add( p ); }</code><technical_language>call optimize</technical_language>

Target:
public void visit( OutputPortInfo p ) { if( p.protocol() != null ) { p.setProtocol( optimizeNode( p.protocol() ) ); } if( p.location() != null ) { p.setLocation( optimizeNode( p.location() ) ); } programChildren.add( p ); }
Source:
<code>public void scheduleService() throws Exception { if (SnapshotBackup.getTimer(config) != null && (CollectionUtils.isEmpty(config.getBackupRacs()) || config.getBackupRacs() .contains(instanceIdentity.getInstanceInfo().getRac()))) { <START> scheduleTask(scheduler, SnapshotBackup.class, SnapshotBackup.getTimer(config)); <END> scheduleTask( scheduler, CommitLogBackupTask.class, CommitLogBackupTask.getTimer(config)); } scheduleTask( scheduler, IncrementalBackup.class, IncrementalBackup.getTimer(config, backupRestoreConfig)); scheduleTask(scheduler, UpdateCleanupPolicy.class, UpdateCleanupPolicy.getTimer()); }</code><technical_language>intentional switch this CommitLogBackupTask</technical_language>

Target:
public void scheduleService() throws Exception { TaskTimer snapshotTimer = SnapshotBackup.getTimer(config); scheduleTask(scheduler, SnapshotBackup.class, snapshotTimer); if (snapshotTimer != null) { scheduleTask( scheduler, CommitLogBackupTask.class, CommitLogBackupTask.getTimer(config)); } scheduleTask( scheduler, IncrementalBackup.class, IncrementalBackup.getTimer(config, backupRestoreConfig)); scheduleTask(scheduler, UpdateCleanupPolicy.class, UpdateCleanupPolicy.getTimer()); }
Source:
<code>private static boolean startupChecksPass() { CassandraKeyValueServiceConfigManager manager = CassandraKeyValueServiceConfigManager.createSimpleManager( ThreeNodeCassandraCluster.KVS_CONFIG); try { new CassandraClientPool(manager.getConfig()); } catch (Exception e) { return false; } <START> return true; <END> }</code><technical_language>nit: return true; statement moved try block</technical_language>

Target:
private static boolean startupChecksPass() { CassandraKeyValueServiceConfigManager manager = CassandraKeyValueServiceConfigManager.createSimpleManager( ThreeNodeCassandraCluster.KVS_CONFIG); try { new CassandraClientPool(manager.getConfig()); return true; } catch (Exception e) { return false; } }
Source:
<code>public List<String> getAliasesForCluster(final String clusterName) throws AliasServiceException { final List<String> localAliases = localAliasService == null ? Collections.emptyList() : localAliasService.getAliasesForCluster(clusterName); if (localAliases == null || localAliases.isEmpty()) { if (remoteClient != null) { final List<String> remoteAliases = remoteClient.listChildEntries(buildClusterEntryName(clusterName)); <START> return remoteAliases == null ? new ArrayList<>() : remoteAliases; <END> } else { return new ArrayList<>(); } } else { return localAliases; } }</code><technical_language>Collections.emptyList() above</technical_language>

Target:
public List<String> getAliasesForCluster(final String clusterName) throws AliasServiceException { final List<String> localAliases = localAliasService.getAliasesForCluster(clusterName); if (localAliases == null || localAliases.isEmpty()) { if (remoteClient != null) { final List<String> remoteAliases = remoteClient.listChildEntries(buildClusterEntryName(clusterName)); return remoteAliases == null ? new ArrayList<>() : remoteAliases; } else { return new ArrayList<>(); } } else { return localAliases; } }
Source:
<code>public static void parseAndReact(@NonNull Activity activity, @NonNull JSONObject paramsJson) throws JSONException { logger.debug("DeepLink received. JSON Details:\n" + paramsJson); final Router router = new Router(); final boolean isLoggedIn = new LoginPrefs(activity).getUsername() != null; @ScreenDef final String screenName = paramsJson.getString(KEY_SCREEN_NAME); switch (screenName) { case Screen.COURSE_DASHBOARD: case Screen.COURSE_VIDEOS: { if (!isLoggedIn) { activity.startActivity(router.getLogInIntent()); } else { final String courseId = paramsJson.getString(KEY_COURSE_ID); router.showCourseDashboardTabs(activity, null, courseId, false, screenName); } break; } case Screen.PROGRAM: { if (!isLoggedIn) { activity.startActivity(router.getLogInIntent()); } else { router.showMainDashboard(activity, screenName); } break; } case Screen.COURSE_DISCOVERY: { String courseId = null; <START> if (paramsJson.has(KEY_COURSE_ID)) { <END> courseId = paramsJson.getString(KEY_COURSE_ID); } if (!isLoggedIn) { activity.startActivity(DiscoveryActivity.newIntent(activity, screenName, courseId)); } else { router.showMainDashboard(activity, screenName, courseId); } break; } } }</code><technical_language>Deep Link ID in path_id key, this needs changed</technical_language>

Target:
public static void parseAndReact(@NonNull Activity activity, @NonNull JSONObject paramsJson) throws JSONException { logger.debug("DeepLink received. JSON Details:\n" + paramsJson); final Router router = new Router(new Config(activity)); final String username = new LoginPrefs(activity).getUsername(); @ScreenDef final String screenName = paramsJson.getString(KEY_SCREEN_NAME); if (username == null) { switch (screenName) { case Screen.COURSE_DISCOVERY: router.showFindCourses(activity, screenName, paramsJson.optString(KEY_PATH_ID)); break; default: activity.startActivity(router.getLogInIntent()); break; } return; } switch (screenName) { case Screen.COURSE_DASHBOARD: case Screen.COURSE_VIDEOS: { final String courseId = paramsJson.getString(KEY_COURSE_ID); router.showCourseDashboardTabs(activity, null, courseId, false, screenName); break; } case Screen.PROGRAM: case Screen.COURSE_DISCOVERY: { router.showMainDashboard(activity, screenName, paramsJson.optString(KEY_PATH_ID)); break; } case Screen.PROFILE: { router.showUserProfile(activity, username); break; } } }
Source:
<code>public void testGoToTimeAndCheckStackWithNames() throws IOException { goToTime(TIMESTAMPS[0]); final SWTBotView viewBot = fBot.viewById(CallStackView.ID); viewBot.setFocus(); SWTBotTree tree = viewBot.bot().tree(); Object mapObj = CtfTmfTestTraceUtils.class.getResource("cyg-profile-mapping.txt"); assertTrue(mapObj instanceof URL); URL mapUrl = (URL) mapObj; String absoluteFile = FileLocator.toFileURL(mapUrl).getFile(); TmfFileDialogFactory.setOverrideFiles(absoluteFile); viewBot.toolbarButton("Configure how the addresses are mapped to function names").click(); String shellTitle = "Symbol mapping"; fBot.waitUntil(Conditions.shellIsActive(shellTitle)); SWTBot shellBot = fBot.shell(shellTitle).bot(); SWTBotShell activeShell = shellBot.activeShell(); shellBot.radio(1).click(); shellBot.button("Browse...", 1).click(); shellBot.button("OK").click(); shellBot.waitUntil(Conditions.shellCloses(activeShell)); goToTime(TIMESTAMPS[0]); <START> List<String> functions = new ArrayList<>(); <END> WaitUtils.waitForJobs(); List<String> names = new ArrayList<>(); for (SWTBotTreeItem swtBotTreeItem : tree.getAllItems()) { for (SWTBotTreeItem items : swtBotTreeItem.getItems()) { for (SWTBotTreeItem item : items.getItems()) { names.add(item.cell(0)); } } } functions = getVisibleStackFrames(viewBot); assertEquals(ImmutableList.of("glxgears-16073"), names); assertEquals(ImmutableList.of("main", "event_loop", "handle_event", "", ""), functions); }</code><technical_language>declare need</technical_language>

Target:
public void testGoToTimeAndCheckStackWithNames() throws IOException { goToTime(TIMESTAMPS[0]); final SWTBotView viewBot = fBot.viewById(CallStackView.ID); viewBot.setFocus(); SWTBotTree tree = viewBot.bot().tree(); Object mapObj = CtfTmfTestTraceUtils.class.getResource("cyg-profile-mapping.txt"); assertTrue(mapObj instanceof URL); URL mapUrl = (URL) mapObj; String absoluteFile = FileLocator.toFileURL(mapUrl).getFile(); TmfFileDialogFactory.setOverrideFiles(absoluteFile); viewBot.toolbarButton("Configure how the addresses are mapped to function names").click(); String shellTitle = "Symbol mapping"; fBot.waitUntil(Conditions.shellIsActive(shellTitle)); SWTBot shellBot = fBot.shell(shellTitle).bot(); SWTBotShell activeShell = shellBot.activeShell(); shellBot.radio(1).click(); shellBot.button("Browse...", 1).click(); shellBot.button("OK").click(); shellBot.waitUntil(Conditions.shellCloses(activeShell)); goToTime(TIMESTAMPS[0]); WaitUtils.waitForJobs(); List<String> names = new ArrayList<>(); for (SWTBotTreeItem swtBotTreeItem : tree.getAllItems()) { for (SWTBotTreeItem items : swtBotTreeItem.getItems()) { for (SWTBotTreeItem item : items.getItems()) { names.add(item.cell(0)); } } } List<String> functions = getVisibleStackFrames(viewBot); assertEquals(ImmutableList.of("glxgears-16073"), names); assertEquals(ImmutableList.of("main", "event_loop", "handle_event", "", ""), functions); }
Source:
<code>public void getInformations(APIRequest apiRequest) { String msg = "<msg><header " + "deviceID=\"" + handler.getMacAddress() + "\"" + " url=\"" + apiRequest + "\" method=\"GET\"><request requestID=\"0\"><info type=\"new\"/></request></header></msg>"; try { handler.getSession().getRemote().sendString(msg); } catch (IOException e) { handler.onWebSocketError(e); } <START> } <END></code><technical_language>2 if conditons merged</technical_language>

Target:
public void getInformations(APIRequest apiRequest) { String msg = "<msg><header " + "deviceID=\"" + handler.getMacAddress() + "\"" + " url=\"" + apiRequest + "\" method=\"GET\"><request requestID=\"0\"><info type=\"new\"/></request></header></msg>"; try { handler.getSession().getRemote().sendString(msg); logger.debug("{}: sending request: {}", handler.getDeviceName(), msg); } catch (IOException e) { handler.onWebSocketError(e); } }
Source:
<code>public void testListTypesIsEmpty() throws Exception { MockWebServer server = mockOpenStackServer(); server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json")))); <START> server.enqueue(addCommonHeaders(new MockResponse().setResponseCode(404).setBody(stringFromResource("/resource_type_list_response.json")))); <END> try { HeatApi heatApi = api(server.getUrl("/").toString(), "openstack-heat", overrides); ResourceApi api = heatApi.getResourceApi("RegionOne"); List<String> resourceTypes = api.listTypes(); assertThat(server.getRequestCount()).isEqualTo(2); assertAuthentication(server); assertRequest(server.takeRequest(), "GET", BASE_URI + "/resource_types"); assertThat(resourceTypes).isEmpty(); } finally { server.shutdown(); } }</code><technical_language>body removed? I assume server send a body a 404</technical_language>

Target:
public void testListTypesIsEmpty() throws Exception { MockWebServer server = mockOpenStackServer(); server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json")))); server.enqueue(addCommonHeaders(new MockResponse().setResponseCode(404))); try { HeatApi heatApi = api(server.getUrl("/").toString(), "openstack-heat", overrides); ResourceApi api = heatApi.getResourceApi("RegionOne"); List<String> resourceTypes = api.listTypes(); assertThat(server.getRequestCount()).isEqualTo(2); assertAuthentication(server); assertRequest(server.takeRequest(), "GET", BASE_URI + "/resource_types"); assertThat(resourceTypes).isEmpty(); } finally { server.shutdown(); } }
Source:
<code>public void updateNonExistingIDInJSONButValidInURL() throws Exception { ObjectMapper mapper = new ObjectMapper(); context.turnOffAuthorisationSystem(); BitstreamFormat bitstreamFormat = BitstreamFormatBuilder.createBitstreamFormat(context) .withMimeType("application/octet-stream") .withDescription("Description - updateNonExistingIDInJSONButValidInURL") .build(); context.restoreAuthSystemState(); int nonExistentBitstreamFormatID = 404404404; BitstreamFormatRest bitstreamFormatRest = converter.fromModel(bitstreamFormat); String token = getAuthToken(admin.getEmail(), password); bitstreamFormatRest.setShortDescription("Test short UPDATED"); bitstreamFormatRest.setId(nonExistentBitstreamFormatID); getClient(token).perform(put("/api/core/bitstreamformats/" + bitstreamFormat.getID()) .content(mapper.writeValueAsBytes(bitstreamFormatRest)).contentType(contentType)) <START> .andExpect(status().isBadRequest()); <END> }</code><technical_language>please double check changes persisted. I prefer change return code 422 this require a change in contract feel free leave a separate request if is agreement</technical_language>

Target:
public void updateNonExistingIDInJSONButValidInURL() throws Exception { ObjectMapper mapper = new ObjectMapper(); context.turnOffAuthorisationSystem(); BitstreamFormat bitstreamFormat = BitstreamFormatBuilder .createBitstreamFormat(context) .withShortDescription("Test short") .withMimeType("application/octet-stream") .withDescription("Description - updateNonExistingIDInJSONButValidInURL") .build(); context.restoreAuthSystemState(); int nonExistentBitstreamFormatID = 404404404; BitstreamFormatRest bitstreamFormatRest = converter.fromModel(bitstreamFormat); String token = getAuthToken(admin.getEmail(), password); bitstreamFormatRest.setShortDescription("Test short UPDATED"); bitstreamFormatRest.setId(nonExistentBitstreamFormatID); getClient(token).perform(put("/api/core/bitstreamformats/" + bitstreamFormat.getID()) .content(mapper.writeValueAsBytes(bitstreamFormatRest)) .contentType(contentType)) .andExpect(status().isBadRequest()); getClient(token).perform(get("/api/core/bitstreamformats/" + bitstreamFormat.getID())) .andExpect(status().isOk()) .andExpect(content().contentType(contentType)) .andExpect(jsonPath("$", Matchers.is( BitstreamFormatMatcher .matchBitstreamFormat(bitstreamFormat.getID(), bitstreamFormat.getMIMEType(), bitstreamFormat.getDescription(), bitstreamFormat.getShortDescription()) ))); }
Source:
<code>public static EventNode createEventNode(final Long eventID, FilteredEventsModel eventsModel) { final SingleEvent eventById = eventsModel.getEventById(eventID); try { SleuthkitCase sleuthkitCase = Case.getCurrentCase().getSleuthkitCase(); AbstractFile file = sleuthkitCase.getAbstractFileById(eventById.getFileID()); if (file != null) { if (eventById.getArtifactID().isPresent()) { BlackboardArtifact blackboardArtifact = sleuthkitCase.getBlackboardArtifact(eventById.getArtifactID().get()); return new EventNode(eventById, file, blackboardArtifact); } else { return new EventNode(eventById, file); } } else { <START> LOGGER.log(Level.WARNING, "Failed to lookup sleuthkit object backing TimeLineEvent."); END> return null; } } catch (IllegalStateException | TskCoreException ex) { LOGGER.log(Level.WARNING, "Failed to lookup sleuthkit object backing TimeLineEvent.", ex); return null; } }</code><technical_language>throw instead of logging</technical_language>

Target:
public static EventNode createEventNode(final Long eventID, FilteredEventsModel eventsModel) throws TskCoreException, IllegalStateException { final SingleEvent eventById = eventsModel.getEventById(eventID); SleuthkitCase sleuthkitCase = Case.getCurrentCase().getSleuthkitCase(); AbstractFile file = sleuthkitCase.getAbstractFileById(eventById.getFileID()); if (eventById.getArtifactID().isPresent()) { BlackboardArtifact blackboardArtifact = sleuthkitCase.getBlackboardArtifact(eventById.getArtifactID().get()); return new EventNode(eventById, file, blackboardArtifact); } else { return new EventNode(eventById, file); } }
Source:
<code>protected Callable<Response> getFutureRequest(final Request req, RequestMetrics metrics) { return new Callable<Response>() { @Override public Response call() { LOGGER.debug("Starting a future request",req.getOperation()); RequestMetrics.Context metricCtx = null; Response resp = null; switch (req.getOperation()) { case FIND: metricCtx = metrics.startEntityRequest("find", req.getEntityVersion().getEntity(), req.getEntityVersion().getVersion()); resp = find((FindRequest) req); metricCtx.markAllErrorsAndEndRequestMonitoring(resp.getErrors()); return resp; case INSERT: metricCtx = metrics.startEntityRequest("insert", req.getEntityVersion().getEntity(), req.getEntityVersion().getVersion()); resp = insert((InsertionRequest) req); metricCtx.markAllErrorsAndEndRequestMonitoring(resp.getErrors()); return resp; case DELETE: metricCtx = metrics.startEntityRequest("delete", req.getEntityVersion().getEntity(), req.getEntityVersion().getVersion()); resp = delete((DeleteRequest) req); metricCtx.markAllErrorsAndEndRequestMonitoring(resp.getErrors()); return resp; case UPDATE: metricCtx = metrics.startEntityRequest("update", req.getEntityVersion().getEntity(), req.getEntityVersion().getVersion()); resp = update((UpdateRequest) req); metricCtx.markAllErrorsAndEndRequestMonitoring(resp.getErrors()); return resp; case SAVE: metricCtx = metrics.startEntityRequest("save", req.getEntityVersion().getEntity(), req.getEntityVersion().getVersion()); resp = save((SaveRequest) req); metricCtx.markAllErrorsAndEndRequestMonitoring(resp.getErrors()); <START> return resp; <END> default: throw new UnsupportedOperationException("CRUD operation '"+req.getOperation()+"' is not supported!"); } } }; }</code><technical_language>This good. For worth, refactor store response in switch, of switch a single metricCtx.markAllErrorsAndEndRequestMonitoring(resp.getErrors()); a single return. reduces duplication a bit. a huge deal though. Also, consider adding overload startEntityRequest accepts a CRUDOperation. a single startEntityRequest call well</technical_language>

Target:
protected Callable<Response> getFutureRequest(final Request req, RequestMetrics metrics) { return new Callable<Response>() { @Override public Response call() { LOGGER.debug("Starting a future request",req.getOperation()); Response resp = null; RequestMetrics.Context metricCtx = metrics.startEntityRequest(req.getOperation().toString().toLowerCase(), req.getEntityVersion().getEntity(), req.getEntityVersion().getVersion()); switch (req.getOperation()) { case FIND: resp = find((FindRequest) req); break; case INSERT: resp = insert((InsertionRequest) req); break; case DELETE: resp = delete((DeleteRequest) req); break; case UPDATE: resp = update((UpdateRequest) req); break; case SAVE: resp = save((SaveRequest) req); break; default: throw new UnsupportedOperationException("CRUD operation '" + req.getOperation() + "' is not supported!"); } metricCtx.markAllErrorsAndEndRequestMonitoring(resp.getErrors()); return resp; } }; }
Source:
<code>public void enabledFilters(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String workspace = request.getParameter("workspace"); String layer = request.getParameter("layer"); if(workspace==null) { <START> workspace = layer.split(":")[0]; <END> layer = layer.split(":", 2)[1]; } try { respondWithDocument(response, getEnabledFiltersDocument(workspace, layer)); } catch (Exception e) { throw new RuntimeException(e); } }</code><technical_language>if is a 'workspace' parameter, a 'layer' parameter colon in it? 'workspace' is set is layer name split line throws ArrayIndexOutOfBoundsException? I misreading something</technical_language>

Target:
public void enabledFilters(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String workspace = request.getParameter("workspace"); String layer = request.getParameter("layer"); try { respondWithDocument(response, getEnabledFiltersDocument(workspace, layer)); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
<code>public String search(@PathVariable String geneId) { JsonArray result = new JsonArray(); Map<String, List<String>> cellIds = geneSearchService.getCellIdsInExperiments(geneId); cellIds.forEach((experimentAccession, cells) -> { JsonObject resultEntry = new JsonObject(); JsonElement element = GSON.toJsonTree(geneSearchService.getExperimentInformation(experimentAccession)); resultEntry.add("element", element); JsonArray facets = new JsonArray(); cells.forEach(facets::add); resultEntry.add("facets", facets); result.add(resultEntry); }); <START> return GSON.toJson(result); <END> }</code><technical_language>a level JsonObject easily replaced a map, get rid of resultEntry: ... result.add(ImmutableMap.of("element", element, "facets", facets); ... done always, bear in mind</technical_language>

Target:
public String search(@PathVariable String geneId) { JsonObject resultObject = new JsonObject(); JsonArray results = new JsonArray(); Map<String, List<String>> cellIds = geneSearchService.getCellIdsInExperiments(geneId); if(!cellIds.isEmpty()) { List<String> allCellIds = cellIds .values() .stream() .flatMap(List::stream) .collect(Collectors.toList()); Map<String, Map<String, List<String>>> factorFacets = geneSearchService.getFacets(allCellIds); Map<String, Map<Integer, List<Integer>>> markerGeneFacets = geneSearchService.getMarkerGeneProfile(geneId); cellIds.forEach((experimentAccession, cells) -> { JsonObject resultEntry = new JsonObject(); JsonObject experimentAttributes = GSON.toJsonTree(geneSearchService.getExperimentInformation(experimentAccession)).getAsJsonObject(); JsonArray facetsJson = convertFacetModel(factorFacets.getOrDefault(experimentAccession, new HashMap<>())); if(markerGeneFacets.containsKey(experimentAccession)) { facetsJson.add(facetValueObject("Marker genes", "Experiments with marker genes")); experimentAttributes.add("markerGenes", convertMarkerGeneModel(experimentAccession, geneId, markerGeneFacets.get(experimentAccession))); } experimentAttributes.addProperty("url", createExperimentPageURL(experimentAccession, geneId)); resultEntry.add("element", experimentAttributes); resultEntry.add("facets", facetsJson); results.add(resultEntry); }); } resultObject.add("results", results); JsonArray checkboxes = new JsonArray(); checkboxes.add("Marker genes"); resultObject.add("checkboxFacetGroups", checkboxes); return GSON.toJson(resultObject); }
Source:
<code>public void cannotSpecifyZeroServersIfUsingLockBlock() { assertThatThrownBy(() -> ImmutableAtlasDbConfig.builder() .keyValueService(KVS_CONFIG_WITHOUT_NAMESPACE) .namespace(CLIENT_NAMESPACE) <START> .timestamp(DEFAULT_SERVER_LIST) <END> .lock(ImmutableServerListConfig.builder().build()) .build()).isInstanceOf(IllegalStateException.class); }</code><technical_language>For clarity, DEFAULT_SERVER_LIST renamed ONE_SERVER, SINGLETON_SERVER_LIST, LIST_OF_ONE_SERVER</technical_language>

Target:
public void cannotSpecifyZeroServersIfUsingLockBlock() { assertThatThrownBy(() -> ImmutableAtlasDbConfig.builder() .keyValueService(KVS_CONFIG_WITHOUT_NAMESPACE) .namespace(CLIENT_NAMESPACE) .timestamp(SINGLETON_SERVER_LIST) .lock(ImmutableServerListConfig.builder().build()) .build()).isInstanceOf(IllegalStateException.class); }
Source:
<code>public Config generateConfig() { Map<String, String> configs = new HashMap<>(); configs.put(JobConfig.JOB_NAME(), jobName); List<String> inputs = inEdges.stream().map(edge -> edge.getFormattedSystemStream()).collect(Collectors.toList()); configs.put(TaskConfig.INPUT_STREAMS(), Joiner.on(',').join(inputs)); log.info("Job has generated configs {}", jobName, configs); <START> String configPrefix = String.format(CONFIG_PROCESSOR_PREFIX, jobName); <END> return Util.rewriteConfig(extractScopedConfig(config, new MapConfig(configs), configPrefix)); }</code><technical_language>CONFIG_JOB_PREFIX change config constant</technical_language>

Target:
public Config generateConfig() { Map<String, String> configs = new HashMap<>(); configs.put(JobConfig.JOB_NAME(), jobName); List<String> inputs = inEdges.stream().map(edge -> edge.getFormattedSystemStream()).collect(Collectors.toList()); configs.put(TaskConfig.INPUT_STREAMS(), Joiner.on(',').join(inputs)); log.info("Job has generated configs {}", jobName, configs); String configPrefix = String.format(CONFIG_JOB_PREFIX, jobName); return Util.rewriteConfig(extractScopedConfig(config, new MapConfig(configs), configPrefix)); }
Source:
<code>public void askForAudio(Controller controller, final FileChooserListener listener) { Gdx.input.getTextInput(new TextInputListener() { @Override public void input(String text) { <START> listener.fileChosen(text, null); <END> } @Override public void canceled() { } }, "File path!", "", ""); }</code><technical_language>Result.SUCCESS</technical_language>

Target:
public void askForAudio(Controller controller, final FileChooserListener listener) { Gdx.input.getTextInput(new TextInputListener() { @Override public void input(String text) { listener.fileChosen(text, FileChooserListener.Result.SUCCESS); } @Override public void canceled() { } }, "File path!", "", ""); }
Source:
<code>private int getLayoutId(final IPerson person, final IUserProfile profile) { final Hashtable<Integer, UserProfile> profiles = this.getUserProfileList(person); int layoutId = profile.getLayoutId(); List<Integer> layoutIds = getAllNonZeroLayoutIdsFromProfiles(profiles); if (layoutIds.size() > 0) { layoutId = layoutIds.get(0); } if (layoutIds.size() > 1) { <START> log.warn(String.format(UNSUPPORTED_MULTIPLE_LAYOUTS_FOUND, person.getID(), person.getID())); <END> } return layoutId; }</code><technical_language>of person.getID()s meant else get a username instead of ID number. :) More generally, this opportunity switch org.slf4j's Logger message format support, i.e. logger.warn("User ID {}'s profiles more non-zero layout id. This is currently supported.", person.getID() ); I user ID number is sufficient, administrator's next move user ID, hunt profiles, hunt layouts, figure out heck is on. :) this error a warn is wrong</technical_language>

Target:
private int getLayoutId(final IPerson person, final IUserProfile profile) { final Hashtable<Integer, UserProfile> profiles = this.getUserProfileList(person); int layoutId = profile.getLayoutId(); Set<Integer> layoutIds = getAllNonZeroLayoutIdsFromProfiles(profiles.values()); if (!layoutIds.isEmpty()) { layoutId = layoutIds.iterator().next(); } if (layoutIds.size() > 1) { logger.error(UNSUPPORTED_MULTIPLE_LAYOUTS_FOUND, person.getID() ); } return layoutId; }
Source:
<code>public boolean initialized() { <START> return initialized && store.initialized(); <END> }</code><technical_language>client longer checks if store is initialized, is desired behavior here</technical_language>

Target:
public boolean initialized() { return initialized.get(); }
Source:
<code>public void propertyChange(PropertyChangeEvent event) { <START> if (event.getOldValue() != event.getNewValue()) { <END> if (event.getPropertyName().equals(RenderingConfig.NORMAL_MAPPING)) { isNormalMapping = renderingConfig.isNormalMapping(); if (isNormalMapping) { addDesiredStateChange(setNormalTerrain); if (isParallaxMapping) { addDesiredStateChange(setHeightTerrain); } } else { removeDesiredStateChange(setNormalTerrain); if (isParallaxMapping) { removeDesiredStateChange(setHeightTerrain); } } } else { isParallaxMapping = renderingConfig.isParallaxMapping(); if (isNormalMapping) { if (isParallaxMapping) { addDesiredStateChange(setHeightTerrain); } else { removeDesiredStateChange(setHeightTerrain); } } } worldRenderer.requestTaskListRefresh(); } }</code><technical_language>I remember if event is fired property changed, making this check redundant. double-check this in propertyChange code</technical_language>

Target:
public void propertyChange(PropertyChangeEvent event) { if (event.getPropertyName().equals(RenderingConfig.NORMAL_MAPPING)) { normalMappingIsEnabled = renderingConfig.isNormalMapping(); if (normalMappingIsEnabled) { addDesiredStateChange(setTerrainNormalsInputTexture); if (parallaxMappingIsEnabled) { addDesiredStateChange(setTerrainHeightInputTexture); } } else { removeDesiredStateChange(setTerrainNormalsInputTexture); if (parallaxMappingIsEnabled) { removeDesiredStateChange(setTerrainHeightInputTexture); } } } else if (event.getPropertyName().equals(RenderingConfig.PARALLAX_MAPPING)) { parallaxMappingIsEnabled = renderingConfig.isParallaxMapping(); if (normalMappingIsEnabled) { if (parallaxMappingIsEnabled) { addDesiredStateChange(setTerrainHeightInputTexture); } else { removeDesiredStateChange(setTerrainHeightInputTexture); } } } worldRenderer.requestTaskListRefresh(); }
Source:
<code>public void selectPinType() { waitForElementByElement(pinCategorySelector); Select pinCategorySelectorDropDown = new Select(pinCategorySelector); List<WebElement> pinCategoryList = pinCategorySelectorDropDown.getOptions(); <START> pinCategoryList.get(1).click(); <END> PageObjectLogging.log("selectPinType", "Pin type was choosed", true, driver); }</code><technical_language>Select a method selectByIndex(int index) pinCategorySelectorDropdown.selectByIndex(1).click()</technical_language>

Target:
public void selectPinType() { waitForElementByElement(pinCategorySelector); Select pinCategorySelectorDropDown = new Select(pinCategorySelector); pinCategorySelectorDropDown.selectByIndex(1); PageObjectLogging.log("selectPinType", "Pin type was choosed", true, driver); }
Source:
<code><START> public static <T> T handleAuthException(Supplier<T> function) { <END> try { return function.get(); } catch (RuntimeException e) { if (ExceptionUtils.indexOfThrowable(e, AuthenticationException.class) != -1) { throw new ProviderAuthenticationFailedException(e); } else { throw e; } } }</code><technical_language>is personal taste I dislike static methods: harder mock. non-static methods, mock usual way</technical_language>

Target:
public <T> T handleAuthException(Supplier<T> function) { try { return function.get(); } catch (RuntimeException e) { if (ExceptionUtils.indexOfThrowable(e, AuthenticationException.class) != -1) { throw new ProviderAuthenticationFailedException(e); } else { throw e; } } }
Source:
<code>private static OperatingSystem mapOperatingSystem(VDS entity) { final OperatingSystem model = new OperatingSystem(); if (StringUtils.isNotBlank(entity.getHostOs())) { OS hostOs = OS.fromPackageVersionString(entity.getHostOs()); Version version = new Version(); <START> if (hostOs.getVersion().getMajor() != org.ovirt.engine.core.compat.Version.VERSION_NOT_SET) { <END> version.setMajor(hostOs.getVersion().getMajor()); } if (hostOs.getVersion().getMinor() != org.ovirt.engine.core.compat.Version.VERSION_NOT_SET) { version.setMinor(hostOs.getVersion().getMinor()); } if (hostOs.getVersion().getBuild() != org.ovirt.engine.core.compat.Version.VERSION_NOT_SET) { version.setBuild(hostOs.getVersion().getBuild()); } version.setFullVersion(hostOs.getFullVersion()); model.setVersion(version); model.setType(hostOs.getName()); } model.setCustomKernelCmdline(Objects.toString(entity.getCurrentKernelCmdline(), "")); model.setReportedKernelCmdline(entity.getKernelArgs()); return model; }</code><technical_language>static import of org.ovirt.engine.core.compat.Version.VERSION_NOT_SET code more readable</technical_language>

Target:
private static OperatingSystem mapOperatingSystem(VDS entity) { final OperatingSystem model = new OperatingSystem(); if (StringUtils.isNotBlank(entity.getHostOs())) { OS hostOs = OS.fromPackageVersionString(entity.getHostOs()); Version version = new Version(); if (hostOs.getVersion().getMajor() != VERSION_NOT_SET) { version.setMajor(hostOs.getVersion().getMajor()); } if (hostOs.getVersion().getMinor() != VERSION_NOT_SET) { version.setMinor(hostOs.getVersion().getMinor()); } if (hostOs.getVersion().getBuild() != VERSION_NOT_SET) { version.setBuild(hostOs.getVersion().getBuild()); } version.setFullVersion(hostOs.getFullVersion()); model.setVersion(version); model.setType(hostOs.getName()); } model.setCustomKernelCmdline(Objects.toString(entity.getCurrentKernelCmdline(), "")); model.setReportedKernelCmdline(entity.getKernelArgs()); return model; }
Source:
<code>public void remoteControlGranted(RemoteControlGrantedEvent event) { synchronized(videoComponentMutex) { if(videoComponent != null) { <START> DTMFHandler.enableSendingDTMFTone(false); <END> videoComponent.addKeyListener(this); videoComponent.addMouseListener(this); videoComponent.addMouseMotionListener(this); } } }</code><technical_language>enable/disable DTMFHandler adding methods CallPeerRenderer get renderer CallManager.getActiveCallContainer(getCallPeer().getCall()).getCurrentCallRenderer().getCallPeerRenderer(getCallPeer()) pass constructor of DesktopSharingMouseAndKeyboardListener</technical_language>

Target:
public void remoteControlGranted(RemoteControlGrantedEvent event) { synchronized(videoComponentMutex) { if(videoComponent != null) { videoComponent.addKeyListener(this); videoComponent.addMouseListener(this); videoComponent.addMouseMotionListener(this); } if (callPeerRenderer != null) { callPeerRenderer.setDtmfToneEnabled(false); } } }
Source:
<code>public List queryAuditRecords(String messageId, String relatesTo) { Session session = null; List<AuditRepositoryRecord> queryList = null; try { SessionFactory sessionFactory = HibernateUtil.getSessionFactory(); session = sessionFactory.openSession(); LOG.info("Getting Record for Audit Viewer "); Criteria queryCriteria = session.createCriteria(AuditRepositoryRecord.class); if (NullChecker.isNotNullish(messageId)) { queryCriteria.add(Restrictions.eq("messageId", messageId)); <START> <END> } if (NullChecker.isNotNullish(relatesTo)) { queryCriteria.add(Restrictions.eq("relatesTo", relatesTo)); } queryCriteria.setProjection(Projections.projectionList() .add(Projections.property("userId")) .add(Projections.property("eventType")) .add(Projections.property("eventId")) .add(Projections.property("outcome")) .add(Projections.property("eventTimestamp")) .add(Projections.property("remoteHcid")) .add(Projections.property("relatesTo")) .add(Projections.property("direction")) .add(Projections.property("id")) .add(Projections.property("messageId"))); queryList = queryCriteria.list(); } catch (HibernateException e) { LOG.error("Exception in AuditLog.get() occurred due to :" + e.getLocalizedMessage(), e); } finally { if (session != null) { session.flush(); session.close(); } } return queryList; }</code><technical_language>check prefix if prepend</technical_language>

Target:
public List queryAuditRecords(String messageId, String relatesTo) { Session session = null; List<AuditRepositoryRecord> queryList = null; try { SessionFactory sessionFactory = HibernateUtil.getSessionFactory(); session = sessionFactory.openSession(); LOG.info("Getting Record for Audit Viewer "); Criteria queryCriteria = session.createCriteria(AuditRepositoryRecord.class); if (NullChecker.isNotNullish(messageId)) { if (messageId.startsWith(NhincConstants.WS_SOAP_HEADER_MESSAGE_ID_PREFIX)) { queryCriteria.add(Restrictions.eq("messageId", messageId)); } else { queryCriteria.add(Restrictions.eq("messageId", NhincConstants.WS_SOAP_HEADER_MESSAGE_ID_PREFIX + messageId)); } } if (NullChecker.isNotNullish(relatesTo)) { queryCriteria.add(Restrictions.eq("relatesTo", relatesTo)); } queryList = setProjectionFields(queryCriteria).list(); } catch (HibernateException e) { LOG.error("Exception in AuditLog.get() occurred due to :" + e.getLocalizedMessage(), e); } finally { closeSession(session, false); } return queryList; }
Source:
<code>public boolean matches(BlockStateData state, Wool data) throws InvalidBlockStateException { <START> if (state.containsKey("color")) { <END> DyeColor color = StateSerialization.getColor(state.get("color")); if (color == null) { throw new InvalidBlockStateException(data.getItemType(), state); } return data.getColor() == color; } return true; }</code><technical_language>checking BlockStateData contains a key leads wrong results. This catch case BlockStateData contains invalid property for this material. In this case, I recommend copying keys a new ArrayList<String>, while looping iterator. This way, a key is successfully matched, call iterator.remove() remove key array. matches() method return true keys list is empty, ensuring this case is caught</technical_language>

Target:
public boolean matches(BlockStateData state, Wool data) throws InvalidBlockStateException { if (state.contains("color")) { DyeColor color = StateSerialization.getColor(state.get("color")); if (color == null) { throw new InvalidBlockStateException(data.getItemType(), state); } return data.getColor() == color; } return true; }
Source:
<code>public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ((WordPress) getApplication()).component().inject(this); unpackIntent(getIntent()); if (savedInstanceState != null) { mSite = (SiteModel) savedInstanceState.getSerializable(WordPress.SITE); } if (mSite == null) { ToastUtils.showToast(this, R.string.blog_not_found, ToastUtils.Duration.SHORT); finish(); return; } setContentView(R.layout.post_list_activity); setSupportActionBar((Toolbar) findViewById(R.id.toolbar)); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { <START> setTitle(getString(mIsPage ? R.string.pages : R.string.posts)); <END> actionBar.setDisplayShowTitleEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); } mPostList = getPostListFragment(); showErrorDialogIfNeeded(getIntent().getExtras()); }</code><technical_language>Another nitpick: calling this exact setTitle twice. Do remove public void setTitle(CharSequence title) { override add a helper method for setting title</technical_language>

Target:
public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); ((WordPress) getApplication()).component().inject(this); if (savedInstanceState != null) { mSite = (SiteModel) savedInstanceState.getSerializable(WordPress.SITE); mIsPage = savedInstanceState.getBoolean(EXTRA_VIEW_PAGES); } else if (getIntent() != null) { mSite = (SiteModel) getIntent().getSerializableExtra(WordPress.SITE); mIsPage = getIntent().getBooleanExtra(EXTRA_VIEW_PAGES, false); } if (mSite == null) { ToastUtils.showToast(this, R.string.blog_not_found, ToastUtils.Duration.SHORT); finish(); return; } setContentView(R.layout.post_list_activity); setSupportActionBar((Toolbar) findViewById(R.id.toolbar)); ActionBar actionBar = getSupportActionBar(); if (actionBar != null) { actionBar.setTitle(getString(mIsPage ? R.string.pages : R.string.posts)); actionBar.setDisplayShowTitleEnabled(true); actionBar.setDisplayHomeAsUpEnabled(true); } mPostList = (PostsListFragment) getFragmentManager().findFragmentById(R.id.postList); showErrorDialogIfNeeded(getIntent().getExtras()); }
Source:
<code>private void storeIfPresent(HttpHeaders headers, String name) { <START> String value = headers.getFirst(Constants.APP_VERSION_HEADER); <END> if (value != null) { storedHeaders.put(name, value); } }</code><technical_language>Constants.APP_VERSION_HEADER replaced name</technical_language>

Target:
private void storeIfPresent(HttpHeaders headers, String name) { String value = headers.getFirst(name); if (value != null) { storedHeaders.put(name, value); } }
Source:
<code>public AggregatorFactory optimizeForSegment(PerSegmentQueryOptimizationContext optimizationContext) { <START> if (filter instanceof IntervalDimFilter) { <END> IntervalDimFilter intervalDimFilter = ((IntervalDimFilter) filter); if (intervalDimFilter.getExtractionFn() != null) { return this; } Interval segmentInterval = optimizationContext.getSegmentDescriptor().getInterval(); List<Interval> filterIntervals = intervalDimFilter.getIntervals(); List<Interval> excludedFilterIntervals = new ArrayList<>(); List<Interval> effectiveFilterIntervals = new ArrayList<>(); boolean segmentIsCovered = false; for (Interval filterInterval : filterIntervals) { Interval overlap = filterInterval.overlap(segmentInterval); if (overlap == null) { excludedFilterIntervals.add(filterInterval); continue; } if (overlap.equals(segmentInterval)) { segmentIsCovered = true; break; } else { effectiveFilterIntervals.add(overlap); } } if (segmentIsCovered) { return delegate; } if (excludedFilterIntervals.size() == filterIntervals.size()) { return new SuppressedAggregatorFactory(delegate); } return new FilteredAggregatorFactory( delegate, new IntervalDimFilter( intervalDimFilter.getDimension(), effectiveFilterIntervals, intervalDimFilter.getExtractionFn() ) ); } else { return this; } }</code><technical_language>this optimization work is a single IntervalDimFilter here. But, more complicated filter AndDimFilter OrDimFilter. support that, need check filters. do adding a new interface optimizeForSegment DimFilter? need visitor pattern fully optimize this. this a part of this PR. If not, please raise issue this add a link here</technical_language>

Target:
public AggregatorFactory optimizeForSegment(PerSegmentQueryOptimizationContext optimizationContext) { if (filter instanceof IntervalDimFilter) { IntervalDimFilter intervalDimFilter = ((IntervalDimFilter) filter); if (intervalDimFilter.getExtractionFn() != null) { return this; } if (!intervalDimFilter.getDimension().equals(Column.TIME_COLUMN_NAME)) { return this; } Interval segmentInterval = optimizationContext.getSegmentDescriptor().getInterval(); List<Interval> filterIntervals = intervalDimFilter.getIntervals(); List<Interval> excludedFilterIntervals = new ArrayList<>(); List<Interval> effectiveFilterIntervals = new ArrayList<>(); boolean segmentIsCovered = false; for (Interval filterInterval : filterIntervals) { Interval overlap = filterInterval.overlap(segmentInterval); if (overlap == null) { excludedFilterIntervals.add(filterInterval); continue; } if (overlap.equals(segmentInterval)) { segmentIsCovered = true; break; } else { effectiveFilterIntervals.add(overlap); } } if (segmentIsCovered) { return delegate; } if (excludedFilterIntervals.size() == filterIntervals.size()) { return new SuppressedAggregatorFactory(delegate); } return new FilteredAggregatorFactory( delegate, new IntervalDimFilter( intervalDimFilter.getDimension(), effectiveFilterIntervals, intervalDimFilter.getExtractionFn() ) ); } else { return this; } }
Source:
<code>private boolean informStopActiveActions() { String activeActions = wrapEntriesInLiTags(control.getExtensionLoader().getActiveActions()); if (!activeActions.isEmpty()) { String message = MessageFormat <START> .format(Constant.messages.getString("menu.file.session.activeactions"), activeActions); <END> if (view.showConfirmDialog(message) != JOptionPane.OK_OPTION) { return false; } } return true; }</code><technical_language>this be: Constant.messages.getString("menu.file.session.activeactions", activeActions) ? (Without MessageFormat)</technical_language>

Target:
private boolean informStopActiveActions() { String activeActions = wrapEntriesInLiTags(control.getExtensionLoader().getActiveActions()); if (!activeActions.isEmpty()) { String message = Constant.messages.getString("menu.file.session.activeactions", activeActions); if (view.showConfirmDialog(message) != JOptionPane.OK_OPTION) { return false; } } return true; }