auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> public TextureAtlasConfig(FileHandle packFile, FileHandle imagesDir){ <END> String[] lines; try { lines = packFile.readAllLines(); } catch (IOException e) { throw new MdxException(e.toString()); } int i = 1; while (i < lines.length){ String texturePath = imagesDir.child(lines[i]).path(); textures.put(texturePath, null); i+=5; while (i < lines.length && !lines[i].isEmpty()){ int index, x, y, width, height, originalWidth, originalHeight, offsetX, offsetY; String name = lines[i]; boolean rotate = Boolean.parseBoolean(lines[i + 1].split(":")[1].trim()); int[] xyTuple = TextureAtlas.readTuple(lines[i + 2]); x = xyTuple[0]; y = xyTuple[1]; int[] whTuple = TextureAtlas.readTuple(lines[i + 3]); width = whTuple[0]; height = whTuple[1]; int[] originalWhTuple = TextureAtlas.readTuple(lines[i + 4]); originalWidth = originalWhTuple[0]; originalHeight = originalWhTuple[1]; int[] offsetTuple = TextureAtlas.readTuple(lines[i + 5]); offsetX = offsetTuple[0]; offsetY = offsetTuple[1]; index = Integer.parseInt(lines[i + 6].split(":")[1].trim()); atlasRegions.add(Mdx.graphics.newTextureAtlasRegion(texturePath, name, index, x, y, width, height, rotate, originalWidth, originalHeight, offsetX, offsetY)); i += 7; } i++; } }</code><technical_language>Missing license info</technical_language>

Target:
public TextureAtlasConfig(FileHandle packFile, FileHandle imagesDir){ String[] lines; try { lines = packFile.readAllLines(); } catch (IOException e) { throw new MdxException(e.toString()); } int i = 1; while (i < lines.length){ String texturePath = imagesDir.child(lines[i]).path(); textures.put(texturePath, null); i+=5; while (i < lines.length && !lines[i].isEmpty()){ int index, x, y, width, height, originalWidth, originalHeight, offsetX, offsetY; String name = lines[i]; boolean rotate = Boolean.parseBoolean(lines[i + 1].split(":")[1].trim()); int[] xyTuple = readTuple(lines[i + 2]); x = xyTuple[0]; y = xyTuple[1]; int[] whTuple = readTuple(lines[i + 3]); width = whTuple[0]; height = whTuple[1]; int[] originalWhTuple = readTuple(lines[i + 4]); originalWidth = originalWhTuple[0]; originalHeight = originalWhTuple[1]; int[] offsetTuple = readTuple(lines[i + 5]); offsetX = offsetTuple[0]; offsetY = offsetTuple[1]; index = Integer.parseInt(lines[i + 6].split(":")[1].trim()); atlasRegions.add(Mdx.graphics.newTextureAtlasRegion(texturePath, name, index, x, y, width, height, rotate, originalWidth, originalHeight, offsetX, offsetY)); i += 7; } i++; } }
Source:
<code>public void testDeleteFile_onWindows() throws Exception { Assume.assumeTrue(Functions.isWindows()); Class<?> c; try { c = Class.forName("java.nio.file.FileSystemException"); } catch (ClassNotFoundException x) { throw new AssumptionViolatedException("prior to JDK 7", x); } File d = tmp.getRoot(); try { File f = new File(d, "f"); mkfiles(f); lockFileForDeletion(f); try { Util.deleteFile(f); fail("should not have been deletable"); } catch (IOException x) { assertThat(calcExceptionHierarchy(x), hasItem(c)); assertThat(x.getMessage(), containsString(f.getPath())); } } finally { unlockFilesForDeletion(); <START> Util.deleteRecursive(d); <END> } }</code><technical_language>This done TemporaryFolder Rule</technical_language>

Target:
public void testDeleteFile_onWindows() throws Exception { Assume.assumeTrue(Functions.isWindows()); Class<?> c; try { c = Class.forName("java.nio.file.FileSystemException"); } catch (ClassNotFoundException x) { throw new AssumptionViolatedException("prior to JDK 7", x); } try { File f = tmp.newFile(); mkfiles(f); lockFileForDeletion(f); try { Util.deleteFile(f); fail("should not have been deletable"); } catch (IOException x) { assertThat(calcExceptionHierarchy(x), hasItem(c)); assertThat(x.getMessage(), containsString(f.getPath())); } } finally { unlockFilesForDeletion(); } }
Source:
<code>public void callbackOnContext(TraverserContext context, DataSchemaTraverse.Order order) { if (order == DataSchemaTraverse.Order.POST_ORDER) { return; } DataSchema schema = context.getCurrentSchema(); SchemaAnnotationHandler.ValidationMetaData metaData = new SchemaAnnotationHandler.ValidationMetaData(); metaData.setDataSchema(context.getCurrentSchema()); metaData.setPathToSchema(context.getTraversePath()); metaData.setEnclosingField(context.getEnclosingField()); AnnotationValidationResult annotationValidationResult = _useProperties <START> ? _schemaAnnotationHandler.validate(context.getEnclosingField() != null <END> ? context.getEnclosingField().getProperties() : schema.getProperties(), metaData) : _schemaAnnotationHandler.validate(schema.getResolvedProperties(), metaData); if (!annotationValidationResult.isValid()) { getSchemaVisitorTraversalResult().addMessages(context.getSchemaPathSpec(), annotationValidationResult.getMessages()); } }</code><technical_language>A bit messy, re-organize? of parenthesis</technical_language>

Target:
public void callbackOnContext(TraverserContext context, DataSchemaTraverse.Order order) { if (order == DataSchemaTraverse.Order.POST_ORDER) { return; } DataSchema schema = context.getCurrentSchema(); SchemaAnnotationHandler.ValidationMetaData metaData = new SchemaAnnotationHandler.ValidationMetaData(); metaData.setDataSchema(context.getCurrentSchema()); metaData.setPathToSchema(context.getTraversePath()); AnnotationValidationResult annotationValidationResult = _schemaAnnotationHandler.validate(schema.getResolvedProperties(), metaData); if (!annotationValidationResult.isValid()) { getSchemaVisitorTraversalResult().addMessages(context.getSchemaPathSpec(), annotationValidationResult.getMessages()); } }
Source:
<code>public String getInputStream() { <START> return isBlank(inputStream) ? name : inputStream; <END> }</code><technical_language>suggestion return defaultIfBlank(inputStream, name);</technical_language>

Target:
public String getInputStream() { return defaultIfBlank(inputStream, name); }
Source:
<code>public void copyMetaData(final DirCacheEntry src) { int origflags = NB.decodeUInt16(info, infoOffset + P_FLAGS); int newflags = NB.decodeUInt16(src.info, src.infoOffset + P_FLAGS); System.arraycopy(src.info, src.infoOffset, info, infoOffset, INFO_LEN); final int pLen = origflags & NAME_MASK; final int SHIFTED_STAGE_MASK = 0x3 << 12; final int pStageShifted = origflags & SHIFTED_STAGE_MASK; NB.encodeInt16(info, infoOffset + P_FLAGS, pStageShifted | pLen <START> | (newflags & ~NAME_MASK & ~SHIFTED_STAGE_MASK)); <END> }</code><technical_language>ok me. some time investigate I this change is correct</technical_language>

Target:
public void copyMetaData(final DirCacheEntry src) { copyMetaData(src, false); }
Source:
<code>public float sendNotification(String message, EntityRef notificationMessageEntity, float lastNotification) { <START> if (time.getGameTime() - lastNotification > maxDelay || lastNotification == 0) { <END> localPlayer.getCharacterEntity().getOwner().send(new ChatMessageEvent(message, notificationMessageEntity)); return time.getGameTime(); } return lastNotification; }</code><technical_language>check for lastNotification == 0 first, subtraction > max check</technical_language>

Target:
public float sendNotification(String message, EntityRef notificationMessageEntity, float lastNotification) { if (lastNotification == 0 || time.getGameTime() - lastNotification > maxDelay) { localPlayer.getCharacterEntity().getOwner().send(new ChatMessageEvent(message, notificationMessageEntity)); return time.getGameTime(); } return lastNotification; }
Source:
<code>public ValueStack createValueStack(ValueStack stack) { <START> String allowStaticMethodAccess = container.getInstance(String.class, XWorkConstants.ALLOW_STATIC_METHOD_ACCESS); <END> ValueStack result = new OgnlValueStack(stack, xworkConverter, compoundRootAccessor, Boolean.valueOf(allowStaticMethodAccess)); container.inject(result); stack.getContext().put(ActionContext.CONTAINER, container); return result; }</code><technical_language>@lukaszlenart. Based inconsistency part of PR #320, appears XWorkConstants.ALLOW_STATIC_METHOD_ACCESS replaced StrutsConstants.STRUTS_ALLOW_STATIC_METHOD_ACCESS (as STRUTS_ALLOW_STATIC_METHOD_ACCESS is in 2.6.x for static access control flag)</technical_language>

Target:
public ValueStack createValueStack(ValueStack stack) { final boolean allowStaticMethodAccess = isAllowStaticMethodAccess(); ValueStack result = new OgnlValueStack(stack, xworkConverter, compoundRootAccessor, allowStaticMethodAccess); container.inject(result); stack.getContext().put(ActionContext.CONTAINER, container); return result; }
Source:
<code>protected String checkType(String descriptorType) { <START> if (!Objects.equals(descriptorType.toLowerCase(), DescriptorLanguage.CWL_STRING) <END> && !Objects.equals(descriptorType.toLowerCase(), DescriptorLanguage.WDL_STRING) && !Objects.equals(descriptorType.toLowerCase(), DescriptorLanguage.NFL_STRING)) { throw new CustomWebApplicationException(descriptorType + " is not a valid descriptor type", HttpStatus.SC_BAD_REQUEST); } return descriptorType.toLowerCase(); }</code><technical_language>nice if instead iterate DescriptorLanguage enum values instead of checking a hard-coded list of languages; if a new workflow language is added, update this code. E.g., call DescriptorLanguages.values() there. DescriptorLanguage case descriptor type, more hassle worth. you..</technical_language>

Target:
protected DescriptorLanguage checkType(String descriptorType) { for (DescriptorLanguage descriptorLanguage : DescriptorLanguage.values()) { if (Objects.equals(descriptorLanguage.toString().toLowerCase(), descriptorType.toLowerCase())) { return descriptorLanguage; } } throw new CustomWebApplicationException(descriptorType + " is not a valid descriptor type", HttpStatus.SC_BAD_REQUEST); }
Source:
<code><START> public SELF isBefore(LocalDateTime other) { <END> Objects.instance().assertNotNull(info, actual); assertLocalDateTimeParameterIsNotNull(other); comparables.assertIsBefore(info, actual, other); return myself; }</code><technical_language>Mentioning explaining breaking change done for changed assertions, I a bit of work I is necessary</technical_language>

Target:
public SELF isBefore(LocalDateTime other) { assertLocalDateTimeParameterIsNotNull(other); comparables.assertIsBefore(info, actual, other); return myself; }
Source:
<code>public JSONObject toJSON() { JSONObject json = new JSONObject(); try { json.put("id", pageId); json.put("revision", revisionId); json.put("lastmodified", sdf.format(getLastModified())); json.put("displaytitle", displayTitleText); if (editProtectionStatus == null) { json.put("protection", new JSONArray()); } else { JSONObject protectionStatusObject = new JSONObject(); JSONArray editProtectionStatusArray = new JSONArray(); editProtectionStatusArray.put(editProtectionStatus); protectionStatusObject.put("edit", editProtectionStatusArray); json.put("protection", protectionStatusObject); } json.put("languagecount", languageCount); <START> json.put("editable", canEdit); <END> if (isMainPage) { json.put("mainpage", ""); } if (isDisambiguationPage) { json.put("disambiguation", ""); } if (leadImageUrl != null) { JSONObject thumbObject = new JSONObject(); thumbObject.put("url", leadImageUrl); json.put("thumb", thumbObject); } if (leadImageName != null) { JSONObject imageObject = new JSONObject(); imageObject.put("file", leadImageName); json.put("image", imageObject); } } catch (JSONException e) { throw new RuntimeException(e); } return json; }</code><technical_language>TODO: This is isMainPage=false it</technical_language>

Target:
public JSONObject toJSON() { JSONObject json = new JSONObject(); try { json.put("id", pageId); json.put("revision", revisionId); json.put("lastmodified", sdf.format(getLastModified())); json.put("displaytitle", displayTitleText); if (editProtectionStatus == null) { json.put("protection", new JSONArray()); } else { JSONObject protectionStatusObject = new JSONObject(); JSONArray editProtectionStatusArray = new JSONArray(); editProtectionStatusArray.put(editProtectionStatus); protectionStatusObject.put("edit", editProtectionStatusArray); json.put("protection", protectionStatusObject); } json.put("languagecount", languageCount); json.put("editable", canEdit); if (isMainPage) { json.put("mainpage", "true"); } if (isDisambiguationPage) { json.put("disambiguation", "true"); } if (leadImageUrl != null) { JSONObject thumbObject = new JSONObject(); thumbObject.put("url", leadImageUrl); json.put("thumb", thumbObject); } if (leadImageName != null) { JSONObject imageObject = new JSONObject(); imageObject.put("file", leadImageName); json.put("image", imageObject); } } catch (JSONException e) { throw new RuntimeException(e); } return json; }
Source:
<code>public static void refreshRadius(IPapyrusEditPart editpart, int defaultCornerWidth, int defaultCornerHeight) { if (editpart.getPrimaryShape() instanceof IRoundedRectangleFigure) { IRoundedRectangleFigure roundedRectangleFigure = (IRoundedRectangleFigure) editpart.getPrimaryShape(); if (((GraphicalEditPart) editpart).getModel() instanceof View) { int width = NotationUtils.getIntValue((View) ((GraphicalEditPart) editpart).getModel(), RADIUS_WIDTH, defaultCornerWidth); int height = NotationUtils.getIntValue((View) ((GraphicalEditPart) editpart).getModel(), RADIUS_HEIGHT, defaultCornerHeight); <START> if (!((width == 0) != (height == 0))) { <END> roundedRectangleFigure.setCornerDimensions(new Dimension(width, height)); } } } }</code><technical_language>I is maintainable</technical_language>

Target:
public static void refreshRadius(IPapyrusEditPart editpart, int defaultCornerWidth, int defaultCornerHeight) { if (editpart.getPrimaryShape() instanceof IRoundedRectangleFigure) { IRoundedRectangleFigure roundedRectangleFigure = (IRoundedRectangleFigure) editpart.getPrimaryShape(); if (((GraphicalEditPart) editpart).getModel() instanceof View) { int width = NotationUtils.getIntValue((View) ((GraphicalEditPart) editpart).getModel(), RADIUS_WIDTH, defaultCornerWidth); int height = NotationUtils.getIntValue((View) ((GraphicalEditPart) editpart).getModel(), RADIUS_HEIGHT, defaultCornerHeight); if (!xor(width == 0, height == 0)) { roundedRectangleFigure.setCornerDimensions(new Dimension(width, height)); } } } }
Source:
<code>public void shouldSyncNewConfiguration() { String configName = "newName"; Config config = configService.create(); config.setName(configName); List<Config> configList = new ArrayList<>(); configList.add(config); Configs configs = new Configs(configList); configService.setConfigs(configs); <START> when(configService.verifyConfig(config)).thenReturn(true); <END> configService.syncConfig(configName); verify(eventRelay).sendEventMessage(eq(prepareConfigUpdateEvent(configName, true))); }</code><technical_language>mock external components, testing</technical_language>

Target:
public void shouldSyncNewConfiguration() { String configName = "newName"; Config config = configService.create(); config.setName(configName); Configs mockedConfigs = mock(Configs.class); when(mockedConfigs.getByName(configName)).thenReturn(config); configService.setConfigs(mockedConfigs); when(commCareAPIHttpClient.verifyConnection(any())).thenReturn(true); configService.syncConfig(configName); verify(mockedConfigs).getByName(configName); verify(commCareAPIHttpClient).verifyConnection(any()); verify(eventRelay).sendEventMessage(eq(prepareConfigUpdateEvent(configName, true))); }
Source:
<code>private static void registerValidityBoundMetric(MetricsManager metricsManager, CoordinationService<InternalSchemaMetadata> metadataCoordinationService) { metricsManager.registerMetric( MetadataCoordinationServiceMetrics.class, LAST_VALID_BOUND, <START> TrackerUtils.createCachingMonotonicIncreasingGauge( <END> log, Clock.defaultClock(), LAST_VALID_BOUND, () -> metadataCoordinationService.getLastKnownLocalValue() .map(ValueAndBound::bound) .orElse(Long.MIN_VALUE))); }</code><technical_language>max if ends</technical_language>

Target:
private static void registerValidityBoundMetric(MetricsManager metricsManager, CoordinationService<InternalSchemaMetadata> metadataCoordinationService) { metricsManager.registerMetric( MetadataCoordinationServiceMetrics.class, AtlasDbMetricNames.COORDINATION_LAST_VALID_BOUND, TrackerUtils.createCachingExceptionHandlingGauge( log, Clock.defaultClock(), AtlasDbMetricNames.COORDINATION_LAST_VALID_BOUND, () -> metadataCoordinationService.getLastKnownLocalValue() .map(ValueAndBound::bound) .orElse(Long.MIN_VALUE))); }
Source:
<code>public JSONObject createPayload() { JSONObject payload = super.createPayload(); String buildNumber = buildData.getBuildNumber("unknown"); String userId = buildData.getUserId(); String jobName = buildData.getJobName("unknown"); String buildUrl = buildData.getBuildUrl("unknown"); String hostname = buildData.getHostname("unknown"); String title = jobName + " build #" + buildNumber + " started on " + hostname; payload.put("title", title); String message = "%%% \n User " + userId + " started the [job " + jobName + " with build number #" + <START> buildNumber + "](" + buildUrl + ") " + getFormattedDuration() + " \n %%%"; <END> payload.put("text", message); payload.put("priority", "low"); payload.put("alert_type", "info"); return payload; }</code><technical_language>safe is change event message. users queries</technical_language>

Target:
public JSONObject createPayload() { JSONObject payload = super.createPayload(); String buildNumber = buildData.getBuildNumber("unknown"); String userId = buildData.getUserId(); String jobName = buildData.getJobName("unknown"); String buildUrl = buildData.getBuildUrl("unknown"); String hostname = buildData.getHostname("unknown"); String title = jobName + " build #" + buildNumber + " started on " + hostname; payload.put("title", title); String message = "%%% \nUser " + userId + " started the [job " + jobName + " build #" + buildNumber + "](" + buildUrl + ") " + getFormattedDuration() + " \n%%%"; payload.put("text", message); payload.put("priority", "low"); payload.put("alert_type", "info"); return payload; }
Source:
<code>private static Repo repo() { final String key = System.getProperty("failsafe.github.key"); Assume.assumeThat(key, Matchers.notNullValue()); <START> final String keyrepo = System.getProperty("failsafe.github.repo"); <END> Assume.assumeThat(keyrepo, Matchers.notNullValue()); return new RtGithub(key).repos().get(new Coordinates.Simple(keyrepo)); }</code><technical_language>repo</technical_language>

Target:
private static Repo repo() { final String key = System.getProperty("failsafe.github.key"); Assume.assumeThat(key, Matchers.notNullValue()); final String repo = System.getProperty("failsafe.github.repo"); Assume.assumeThat(repo, Matchers.notNullValue()); return new RtGithub(key).repos().get(new Coordinates.Simple(repo)); }
Source:
<code>public Map<Integer, Node> getFixedMapping() { <START> if (!bucketToNode.isPresent()) { <END> throw new IllegalArgumentException("No fixed bucket to node mapping"); } return new HashMap<>(bucketToNode.get()); }</code><technical_language>Assuming a defensive copy above, simplified return bucketToNode.orElseThrow(() -> new IllegalArgumentException("No fixed bucket node mapping"));</technical_language>

Target:
public Map<Integer, Node> getFixedMapping() { return bucketToNode.orElseThrow(() -> new IllegalArgumentException("No fixed bucket to node mapping")); }
Source:
<code>public void setTimeout(int timeout) { <START> this.timeout = timeout >= 2 ? timeout : DEFAULT_TIMEOUT_MINUTES; <END> }</code><technical_language>Do is worth logging if attempt set timeout 2 minutes</technical_language>

Target:
public void setTimeout(int timeout) { if (timeout >= MINIMUM_TIMEOUT_MINUTES) { this.timeout = timeout; } else { LOGGER.warn( "Received a timeout of minutes, which is less than the minimum timeout allowed of {}. Defaulting to {}.", timeout, MINIMUM_TIMEOUT_MINUTES, DEFAULT_TIMEOUT_MINUTES); this.timeout = DEFAULT_TIMEOUT_MINUTES; } }
Source:
<code>protected Path determineMountPoint() throws InvalidMountPointException { <START> for (MountPointChooser chooser : this.choosers) { Optional<Path> chosenPath = chooser.chooseMountPoint(); if (chosenPath.isEmpty()) { continue; } this.cleanupRequired = chooser.prepare(chosenPath.get()); this.usedChooser = chooser; return chosenPath.get(); } <END> String tried = Joiner.on(", ").join(this.choosers.stream().map((mpc) -> mpc.getClass().getTypeName()).collect(ImmutableSet.toImmutableSet())); throw new InvalidMountPointException(String.format("No feasible MountPoint found! Tried %s", tried)); }</code><technical_language>User mountpoint try mount. fallback mounting strategy, this done explicit user request</technical_language>

Target:
protected Path determineMountPoint() throws InvalidMountPointException { SortedSet<MountPointChooser> checkedChoosers = new TreeSet<>(); for (MountPointChooser chooser : this.choosers) { if(!chooser.isApplicable(this)) { continue; } Optional<Path> chosenPath = chooser.chooseMountPoint(this); checkedChoosers.add(chooser); if (chosenPath.isEmpty()) { continue; } this.cleanupRequired = chooser.prepare(this, chosenPath.get()); this.usedChooser = chooser; return chosenPath.get(); } String checked = Joiner.on(", ").join(checkedChoosers.stream().map((mpc) -> mpc.getClass().getTypeName()).collect(ImmutableSet.toImmutableSet())); throw new InvalidMountPointException(String.format("No feasible MountPoint found! Checked %s", checked.isBlank() ? "<No applicable MPC>" : checked)); }
Source:
<code>public void updateRecurringBilling(String merchantId, Boolean enable) { http.put(String.format("/merchants/%s/settings/orderSettings/recurringBilling/%b", merchantId, enable), null); <START> } <END></code><technical_language>string literals constant for readability</technical_language>

Target:
public void updateRecurringBilling(String merchantId, Boolean enable) { http.put(String.format(MERCHANT_SETTINGS_RECURRING_BILLING, merchantId, enable), null); }
Source:
<code><START> protected void <END> addLink(LinksTreeNode linksTree, String link) { String[] linkSegments = link.split("\\."); for (String segment : linkSegments) { linksTree = updateTree(linksTree, segment); } }</code><technical_language>protected? Do subclass? Try 'private' else is required. more accessible in future. other is harder</technical_language>

Target:
private void addLink(LinksTreeNode linksTree, String link) { String[] linkSegments = link.split("\\."); for (String segment : linkSegments) { linksTree = updateTree(linksTree, segment); } }
Source:
<code>public <V> ListenableFuture<V> createError(Request request, ErrorType errorType, Throwable throwable) { TFuture<V> future = TFuture.create(); ArgScheme argScheme = request.getArgScheme(); <START> Response response = Response.build(argScheme, new ErrorResponse( <END> request.getId(), errorType, throwable)); switch (argScheme) { case RAW: ((TFuture<RawResponse>)future).set((RawResponse) response); break; case JSON: ((TFuture<JsonResponse>)future).set((JsonResponse) response); break; case THRIFT: ((TFuture<ThriftResponse>)future).set((ThriftResponse) response); break; default: ((TFuture<RawResponse>)future).set((RawResponse) response); break; } return future; }</code><technical_language>response builder care of building Response based ArgScheme</technical_language>

Target:
public <V> ListenableFuture<V> createError(Request request, ErrorType errorType, Throwable throwable) { TFuture<V> future = TFuture.create(); ArgScheme argScheme = request.getArgScheme(); Response response = Response.build(argScheme, new ErrorResponse( request.getId(), errorType, throwable)); ResponseRouter.setResponse(future, argScheme, response); return future; }
Source:
<code>private void addParameter(org.sonar.plugins.python.api.tree.Parameter parameter, @Nullable String fileId, ParameterState parameterState) { Name parameterName = parameter.name(); Token starToken = parameter.starToken(); if (parameterName != null) { TypeAnnotation typeAnnotation = parameter.typeAnnotation(); InferredType declaredType = InferredTypes.anyType(); if (typeAnnotation != null) { declaredType = InferredTypes.declaredType(typeAnnotation); } boolean isVariadic = false; if (starToken != null) { hasVariadicParameter = true; isVariadic = true; } this.parameters.add(new ParameterImpl(parameterName.name(), declaredType, parameter.defaultValue() != null, <START> isVariadic, parameterState, locationInFile(parameter, fileId))); <END> } else if (starToken != null) { if ("*".equals(starToken.value())) { parameterState.keywordOnly = true; parameterState.positionalOnly = false; } if ("/".equals(starToken.value())) { parameterState.positionalOnly = false; } } }</code><technical_language>double-asterisk-kwargs play here, in case, works for usual def f(a, *b, c="default") now</technical_language>

Target:
private void addParameter(org.sonar.plugins.python.api.tree.Parameter parameter, @Nullable String fileId, ParameterState parameterState) { Name parameterName = parameter.name(); Token starToken = parameter.starToken(); if (parameterName != null) { TypeAnnotation typeAnnotation = parameter.typeAnnotation(); InferredType declaredType = InferredTypes.anyType(); if (typeAnnotation != null) { declaredType = InferredTypes.declaredType(typeAnnotation); } this.parameters.add(new ParameterImpl(parameterName.name(), declaredType, parameter.defaultValue() != null, starToken != null, parameterState, locationInFile(parameter, fileId))); if (starToken != null) { hasVariadicParameter = true; parameterState.keywordOnly = true; parameterState.positionalOnly = false; } } else if (starToken != null) { if ("*".equals(starToken.value())) { parameterState.keywordOnly = true; parameterState.positionalOnly = false; } if ("/".equals(starToken.value())) { parameterState.positionalOnly = false; } } }
Source:
<code>public Blog getBlog(String blogUuid) throws BlogServiceException { if(StringUtil.isEmpty(blogUuid)){ throw new BlogServiceException(null, "null blogUuid"); } <START> String getBlogUrl = resolveUrl(BLOG_HANDLE, FilterType.UPDATE_REMOVE_BLOG, blogUuid); <END> Blog blog; try { blog = (Blog)getEntity(getBlogUrl, null, new BlogsFeedHandler(this)); } catch (Exception e) { throw new BlogServiceException(e, "error getting blog"); } return blog; }</code><technical_language>Filtertype is Update_Remove_Blog for getBlog method ? Is correct</technical_language>

Target:
public Blog getBlog(String blogUuid) throws BlogServiceException { if(StringUtil.isEmpty(blogUuid)){ throw new BlogServiceException(null, "null blogUuid"); } String getBlogUrl = resolveUrl(BLOG_HANDLE, FilterType.GET_UPDATE_REMOVE_BLOG, blogUuid); Blog blog; try { blog = (Blog)getEntity(getBlogUrl, null, new BlogsFeedHandler(this)); } catch (Exception e) { throw new BlogServiceException(e, "error getting blog"); } return blog; }
Source:
<code>public Set<String> getInputs() { <START> return new HashSet<String>(); <END> }</code><technical_language>I return values getInputs getOutputs empty _unmodifiable_ collections</technical_language>

Target:
public Set<String> getInputs() { return Collections.EMPTY_SET; }
Source:
<code>void onErrorResponse(ReplicaId replicaId, RouterException exception) { <START> logger.info("DC: " + replicaId.getDataNodeId().getDatacenterName() + " exception: " + exception); <END> operationTracker.onResponse(replicaId, TrackedRequestFinalState.fromRouterErrorCodeToFinalState(exception.getErrorCode())); setOperationException(exception); routerMetrics.routerRequestErrorCount.inc(); routerMetrics.getDataNodeBasedMetrics(replicaId.getDataNodeId()).getBlobInfoRequestErrorCount.inc(); }</code><technical_language>Actually, need this info error message is included in trace log this method is called</technical_language>

Target:
private void onErrorResponse(ReplicaId replicaId, RouterException exception) { operationTracker.onResponse(replicaId, TrackedRequestFinalState.fromRouterErrorCodeToFinalState(exception.getErrorCode())); setOperationException(exception); routerMetrics.routerRequestErrorCount.inc(); routerMetrics.getDataNodeBasedMetrics(replicaId.getDataNodeId()).getBlobInfoRequestErrorCount.inc(); }
Source:
<code>public SingularityCreateResult addToPendingQueue(SingularityPendingRequest pendingRequest) { SingularityCreateResult result = create(getPendingPath(pendingRequest), pendingRequest, pendingRequestTranscoder); if (result == SingularityCreateResult.EXISTED) { <START> SingularityPendingRequest existingPendingRequest = getPendingRequest(pendingRequest.getRequestId(), pendingRequest.getDeployId()).get(); <END> if (existingPendingRequest.getPendingType() == PendingType.STARTUP) { set(getPendingPath(pendingRequest), pendingRequest, pendingRequestTranscoder); LOG.info("{} added to pending queue, overwriting an existing SingularityPendingRequest of type STARTUP. Previous pending request was {}", existingPendingRequest, result); return result; } } LOG.info("{} added to pending queue with result: {}", pendingRequest, result); return result; }</code><technical_language>scheduler poller run create this get, assume this optional present. add isPresent check</technical_language>

Target:
public SingularityCreateResult addToPendingQueue(SingularityPendingRequest pendingRequest) { SingularityCreateResult result = create(getPendingPath(pendingRequest), pendingRequest, pendingRequestTranscoder); if (result == SingularityCreateResult.EXISTED) { Optional<SingularityPendingRequest> existingPendingRequest = getPendingRequest(pendingRequest.getRequestId(), pendingRequest.getDeployId()); if (!existingPendingRequest.isPresent() || (existingPendingRequest.get().getPendingType() == PendingType.STARTUP)) { set(getPendingPath(pendingRequest), pendingRequest, pendingRequestTranscoder); LOG.info("{} added to pending queue, overwriting an existing SingularityPendingRequest of type STARTUP. Previous pending request was {}", existingPendingRequest, result); return result; } } LOG.info("{} added to pending queue with result: {}", pendingRequest, result); return result; }
Source:
<code>private AdminSearchPageData putStudentDetailsPageLinkIntoMap(List<StudentAttributes> students, AdminSearchPageData data){ for(StudentAttributes student : students){ if(student.course == null ||student.email == null){ continue; } String curLink = Url.addParamToUrl(Const.ActionURIs.INSTRUCTOR_COURSE_STUDENT_DETAILS_PAGE, Const.ParamsNames.COURSE_ID, student.course); curLink = Url.addParamToUrl(curLink, Const.ParamsNames.STUDENT_EMAIL, student.email); InstructorAttributes instructor = logic.getInstructorsForCourse(student.course).get(0); if(instructor.googleId == null){ continue; <START> } <END> curLink = Url.addParamToUrl(curLink, Const.ParamsNames.USER_ID, instructor.googleId); data.studentDetailsPageLinkMap.put(student.getIdentificationString(), curLink); } return data; }</code><technical_language>If instructor a Google ID, find instructor a Google ID right? Otherwise, link work</technical_language>

Target:
private AdminSearchPageData putStudentDetailsPageLinkIntoMap(List<StudentAttributes> students, AdminSearchPageData data){ for(StudentAttributes student : students){ if(student.course == null ||student.email == null){ continue; } String curLink = Url.addParamToUrl(Const.ActionURIs.INSTRUCTOR_COURSE_STUDENT_DETAILS_PAGE, Const.ParamsNames.COURSE_ID, student.course); curLink = Url.addParamToUrl(curLink, Const.ParamsNames.STUDENT_EMAIL, student.email); String availableGoogleId = findAvailableInstructorGoogleIdForCourse(student.course); if (!availableGoogleId.isEmpty()) { curLink = Url.addParamToUrl(curLink, Const.ParamsNames.USER_ID, availableGoogleId); data.studentDetailsPageLinkMap.put(student.getIdentificationString(), curLink); } } return data; }
Source:
<code><START> public static boolean isNotContains(String str, char ch) { <END> return isEmpty(str) || str.indexOf(ch) < 0; }</code><technical_language>implemented method</technical_language>

Target:
public static boolean isNotContains(String str, char ch) { return !isContains(str, ch); }
Source:
<code>public void cancel() { <START> this.canceled = true; <END> }</code><technical_language>If canceled flag is set, method stop - currently</technical_language>

Target:
public void cancel() { this.cancelled = true; }
Source:
<code>private void addRecord(final String message) { if (currentStep >= this.stepStarts.length) { this.stepStarts = Arrays.copyOf(this.stepStarts, this.stepStarts.length + 10); <START> this.stepNames = Arrays.copyOf(this.stepNames, this.stepStarts.length); <END> } this.stepStarts[currentStep] = System.currentTimeMillis(); this.stepNames[currentStep] = message; currentStep++; }</code><technical_language>I a perfect case array used</technical_language>

Target:
private void addRecord(final String message) { this.stepStarts.add(System.currentTimeMillis()); this.stepNames.add(message); }
Source:
<code>public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: finish(); return true; case R.id.menu_clear_all_saved_pages: AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage(R.string.dialog_title_clear_saved_pages); builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { <START> app.getPersister(SavedPage.class).deleteAll(); <END> (new SaneAsyncTask<Void>(SaneAsyncTask.SINGLE_THREAD) { @Override public Void performTask() throws Throwable { Utils.delete(new File(SavedPage.getSavedPagesDir()), true); return null; } }).execute(); } }); builder.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } }); builder.create().show(); return true; default: throw new RuntimeException("Unknown menu item clicked!"); } }</code><technical_language>This AsyncTask well</technical_language>

Target:
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: finish(); return true; case R.id.menu_clear_all_saved_pages: AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage(R.string.dialog_title_clear_saved_pages); builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { (new SaneAsyncTask<Void>(SaneAsyncTask.SINGLE_THREAD) { @Override public Void performTask() throws Throwable { app.getPersister(SavedPage.class).deleteAll(); Utils.delete(new File(SavedPage.getSavedPagesDir()), true); return null; } }).execute(); } }); builder.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } }); builder.create().show(); return true; default: throw new RuntimeException("Unknown menu item clicked!"); } }
Source:
<code>public Comment updateComment(@PathParam("commentId") String commentId, Comment comment) { if (!getContext().getCoreSession().exists(new IdRef(commentId))) { throw new DocumentNotFoundException("The comment " + commentId + " does not exist."); } <START> <END> CommentManager commentManager = Framework.getService(CommentManager.class); commentManager.updateComment(getContext().getCoreSession(), commentId, comment); return comment; }</code><technical_language>Flo remove this extra line :D</technical_language>

Target:
public Response updateComment(@PathParam("commentId") String commentId, Comment comment) { CommentManager commentManager = Framework.getService(CommentManager.class); Comment updatedComment = commentManager.updateComment(getContext().getCoreSession(), commentId, comment); return Response.ok(updatedComment).build(); }
Source:
<code>private void assertMessageValues(Document msgDoc, PID expectedPid) { Element entry = msgDoc.getRootElement(); <START> String pidString = entry.getChildText("pid", ATOM_NS);; <END> String author = entry.getChild("author", ATOM_NS) .getChildText("name", ATOM_NS); assertEquals(collection.getPid().getURI(), pidString); assertEquals(USER_NAME, author); }</code><technical_language>remove extra semi-colon</technical_language>

Target:
private void assertMessageValues(Document msgDoc, PID expectedPid) { Element entry = msgDoc.getRootElement(); String pidString = entry.getChild(RUN_ENHANCEMENTS.getName(), CDR_MESSAGE_NS) .getChildText("pid", CDR_MESSAGE_NS); String author = entry.getChild("author", ATOM_NS) .getChildText("name", ATOM_NS); assertEquals(collection.getPid().getURI(), pidString); assertEquals(USER_NAME, author); }
Source:
<code><START> public ValidationResult diskImagesHaveNoDerivedDisks(Guid storageDomainId) { <END> List<String> disksInfo = null; for (DiskImage diskImage : diskImages) { if (diskImage.getVmEntityType() != null && diskImage.getVmEntityType().isTemplateType()) { List<DiskImage> basedDisks = getDiskImageDAO().getAllSnapshotsForParent(diskImage.getImageId()); for (DiskImage basedDisk : basedDisks) { if (storageDomainId == null || basedDisk.getStorageIds().contains(storageDomainId)) { if (disksInfo == null) { disksInfo = new LinkedList<>(); } disksInfo.add(String.format("%s (%s) ", basedDisk.getDiskAlias(), basedDisk.getId())); } } } } if (disksInfo != null) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_DETECTED_DERIVED_DISKS, String.format("$disksInfo %s", String.format(StringUtils.join(disksInfo, "%n")))); } return ValidationResult.VALID; }</code><technical_language>While it, explain this :-)</technical_language>

Target:
public ValidationResult diskImagesHaveNoDerivedDisks(Guid storageDomainId) { List<String> disksInfo = new LinkedList<>(); for (DiskImage diskImage : diskImages) { if (diskImage.getVmEntityType() != null && diskImage.getVmEntityType().isTemplateType()) { List<DiskImage> basedDisks = getDiskImageDAO().getAllSnapshotsForParent(diskImage.getImageId()); for (DiskImage basedDisk : basedDisks) { if (storageDomainId == null || basedDisk.getStorageIds().contains(storageDomainId)) { disksInfo.add(String.format("%s (%s) ", basedDisk.getDiskAlias(), basedDisk.getId())); } } } } if (!disksInfo.isEmpty()) { return new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_DETECTED_DERIVED_DISKS, String.format("$disksInfo %s", String.format(StringUtils.join(disksInfo, "%n")))); } return ValidationResult.VALID; }
Source:
<code>public void testSeverityChange() throws Exception { final RestClient restClient = stack.opennms().getRestClient(); restClient.sendEvent(getServiceProblemEvent(42, "Warning")); final AlarmDao alarmDao = stack.postgres().getDaoFactory().getDao(AlarmDaoHibernate.class); final OnmsAlarm onmsAlarm1 = await().atMost(2, MINUTES).pollInterval(10, SECONDS) .until(DaoUtils.findMatchingCallable(alarmDao, new CriteriaBuilder(OnmsAlarm.class) .eq("uei", "uei.opennms.org/bsm/serviceProblem") .toCriteria()), notNullValue()); assertEquals(1L, (long) onmsAlarm1.getCounter()); <START> assertFalse(Strings.isNullOrEmpty(onmsAlarm1.getEventParameter("rootCause"))); <END> assertEquals(OnmsSeverity.WARNING, onmsAlarm1.getSeverity()); restClient.sendEvent(getServiceProblemEvent(42, "Minor")); final OnmsAlarm onmsAlarm2 = await().atMost(2, MINUTES).pollInterval(10, SECONDS) .until(DaoUtils.findMatchingCallable(alarmDao, new CriteriaBuilder(OnmsAlarm.class) .eq("uei", "uei.opennms.org/bsm/serviceProblem") .toCriteria()), notNullValue()); assertEquals(2L, (long) onmsAlarm2.getCounter()); assertFalse(Strings.isNullOrEmpty(onmsAlarm2.getEventParameter("rootCause"))); assertEquals(OnmsSeverity.MINOR, onmsAlarm2.getSeverity()); }</code><technical_language>suggestion assertThat(onmsAlarm1.getEventParameter("rootCause"), not(isEmptyOrNullString());</technical_language>

Target:
public void testSeverityChange() throws Exception { final RestClient restClient = stack.opennms().getRestClient(); restClient.sendEvent(getServiceProblemEvent(42, "Warning")); final AlarmDao alarmDao = stack.postgres().getDaoFactory().getDao(AlarmDaoHibernate.class); final OnmsAlarm onmsAlarm1 = await().atMost(2, MINUTES).pollInterval(10, SECONDS) .until(DaoUtils.findMatchingCallable(alarmDao, new CriteriaBuilder(OnmsAlarm.class) .eq("uei", "uei.opennms.org/bsm/serviceProblem") .toCriteria()), notNullValue()); assertEquals(1L, (long) onmsAlarm1.getCounter()); assertEquals(OnmsSeverity.WARNING, onmsAlarm1.getSeverity()); restClient.sendEvent(getServiceProblemEvent(42, "Minor")); final OnmsAlarm onmsAlarm2 = await().atMost(2, MINUTES).pollInterval(10, SECONDS) .until(DaoUtils.findMatchingCallable(alarmDao, new CriteriaBuilder(OnmsAlarm.class) .eq("uei", "uei.opennms.org/bsm/serviceProblem") .toCriteria()), notNullValue()); assertEquals(2L, (long) onmsAlarm2.getCounter()); assertEquals(OnmsSeverity.MINOR, onmsAlarm2.getSeverity()); }
Source:
<code>public void propagate(int evtmask) throws ContradictionException { boolean hasFiltered = true; while(hasFiltered) { hasFiltered = false; if(PropagatorEventType.isFullPropagation(evtmask)) { <START> boxesToCompute.clear(); <END> for (int i = 0; i < n; i++) { boxesToCompute.add(i); for (int j = i + 1; j < n; j++) { if (mayOverlap(i, j)) { overlappingBoxes.addEdge(i, j); if (boxInstantiated(i) && boxInstantiated(j)) { fails(); } } else { overlappingBoxes.removeEdge(i, j); } } } } pruneList.clear(); for(int k = 0; k<boxesToCompute.size(); k++) { int i = boxesToCompute.getQuick(k); energyCheck(i); hasFiltered |= prune(i); } boxesToCompute.clear(); for(int k = 0; k< pruneList.size(); k++) { prop(pruneList.getQuick(k)); } } }</code><technical_language>I suppose boxesToCompute.resetQuick() is enough in case</technical_language>

Target:
public void propagate(int evtmask) throws ContradictionException { boolean hasFiltered = true; while(hasFiltered) { hasFiltered = false; if(PropagatorEventType.isFullPropagation(evtmask)) { boxesToCompute.resetQuick(); for (int i = 0; i < n; i++) { boxesToCompute.add(i); for (int j = i + 1; j < n; j++) { if (mayOverlap(i, j)) { overlappingBoxes.addEdge(i, j); if (boxInstantiated(i) && boxInstantiated(j)) { fails(); } } else { overlappingBoxes.removeEdge(i, j); } } } } pruneList.clear(); for(int k = 0; k<boxesToCompute.size(); k++) { int i = boxesToCompute.getQuick(k); energyCheck(i); hasFiltered |= prune(i); } boxesToCompute.clear(); for(int k = 0; k< pruneList.size(); k++) { prop(pruneList.getQuick(k)); } } }
Source:
<code>public ListenableFuture<?> delete(ChangeData cd) { return executor != null ? executor.submit(deleteTask(cd)) <START> : null; <END> }</code><technical_language>I this return Futures.immediateFuture(null)</technical_language>

Target:
public ListenableFuture<?> delete(ChangeData cd) { return executor != null ? executor.submit(deleteTask(cd)) : Futures.immediateFuture(null); }
Source:
<code>private static OSCoreEndpoint newEndpoint() { OSCoreEndpoint ep = new OSCoreEndpoint(Collections.<String>emptyList()); try { ep.start(); } catch (IOException e) { <START> System.out.println("Could not create endpoint: " + e.getMessage()); <END> } return ep; }</code><technical_language>replace log statement</technical_language>

Target:
private static OSCoreEndpoint newEndpoint() { OSCoreEndpoint ep = new OSCoreEndpoint(); try { ep.start(); } catch (IOException e) { LOGGER.error("Could not create endpoint: " + e.getMessage()); } return ep; }
Source:
<code>public Suggestion(String value, String searchTerm) { this.value = value; display = new SpannableString(value); <START> display.setSpan(new ForegroundColorSpan(Color.GRAY), 0, searchTerm.length(), 0); <END> }</code><technical_language>A couple of corner cases consider: 1) I a guarantee match occur start of suggestion (although of suggestions I prefix matches) 2) Some suggestion APIs do spelling correction. For example, a query of "fcbook", returns: facebook, facebook.com, etc. do handle this case</technical_language>

Target:
public Suggestion(String value, String searchTerm) { this.value = value; display = new SpannableString(value); final int start = value.toLowerCase().indexOf(searchTerm.toLowerCase()); if (start >= 0) { display.setSpan(COLOR_SPAN, start, searchTerm.length(), 0); } }
Source:
<code>public PIDPropertyManager(String functionName, XPropertyManager propMan, double defaultP, double defaultI, double defaultD, double defaultF) { propP = propMan.createPersistentProperty(functionName + " P", defaultP); propI = propMan.createPersistentProperty(functionName + " I", defaultI); propD = propMan.createPersistentProperty(functionName + " D", defaultD); propF = propMan.createPersistentProperty(functionName + " F", defaultF); propErrorThreshold = <START> propMan.createPersistentProperty(functionName + " Error threshold", -1); <END> propErrorDerivativeThreshold = propMan.createPersistentProperty(functionName + " Derivative threshold", -1); }</code><technical_language>overloaded constructor set defaults these</technical_language>

Target:
public PIDPropertyManager(String functionName, XPropertyManager propMan, double defaultP, double defaultI, double defaultD, double defaultF) { this(functionName, propMan, defaultP, defaultI, defaultD, defaultF, -1, -1); }
Source:
<code>public void postDrawEvent(@Nullable ITimeEvent event, @Nullable Rectangle bounds, @Nullable GC gc) { if (bounds == null || gc == null) { return; } boolean visible = bounds.width == 0 ? false : true; if (!visible) { return; } if (!(event instanceof TimeEvent)) { return; } TimeEvent ev = (TimeEvent) event; if (ev.hasValue()) { VirtualMachineViewEntry entry = (VirtualMachineViewEntry) event.getEntry(); if (entry.getType() == Type.THREAD) { int value = ev.getValue(); if ((value & VcpuStateValues.VCPU_PREEMPT) != 0) { Color <START> white = <END> Display.getDefault().getSystemColor(SWT.COLOR_RED); int alpha = gc.getAlpha(); Color background = gc.getBackground(); gc.setBackground(white); gc.setAlpha(70); gc.fillRectangle(bounds); gc.setBackground(background); gc.setAlpha(alpha); } } } }</code><technical_language>I ;)</technical_language>

Target:
public void postDrawEvent(@Nullable ITimeEvent event, @Nullable Rectangle bounds, @Nullable GC gc) { if (bounds == null || gc == null) { return; } boolean visible = bounds.width == 0 ? false : true; if (!visible) { return; } if (!(event instanceof TimeEvent)) { return; } TimeEvent ev = (TimeEvent) event; if (ev.hasValue()) { VirtualMachineViewEntry entry = (VirtualMachineViewEntry) event.getEntry(); if (entry.getType() == Type.THREAD) { int value = ev.getValue(); if ((value & VcpuStateValues.VCPU_PREEMPT) != 0) { Color alphaColor = Display.getDefault().getSystemColor(SWT.COLOR_RED); int alpha = gc.getAlpha(); Color background = gc.getBackground(); gc.setBackground(alphaColor); gc.setAlpha(70); gc.fillRectangle(bounds); gc.setBackground(background); gc.setAlpha(alpha); } } } }
Source:
<code>public static void init(Configuration conf) { if (!initDone) { DefaultConfiguration.conf = conf; DefaultConfiguration.initDone = true; <START> } <END> }</code><technical_language>of methods this class synchronized. this change good</technical_language>

Target:
public static synchronized void init(Configuration conf) { if (!initDone) { DefaultConfiguration.conf = conf; DefaultConfiguration.initDone = true; } }
Source:
<code>private void dispatchJobUpdatedFullData(JobState job) { try { if (logger.isDebugEnabled()) { jlogger.debug(job.getJobInfo().getJobId(), " event [" + SchedulerEvent.JOB_UPDATED + "]"); } for (ListeningUser listeningUserId : identifications.values()) { if (listeningUserId.isListening()) { try { UserIdentificationImpl userId = listeningUserId.getUser(); if ((userId.getUserEvents() == null) || userId.getUserEvents().contains(SchedulerEvent.JOB_UPDATED)) { if (!userId.isMyEventsOnly() || (userId.isMyEventsOnly() && userId.getUsername().equals(job.getOwner()))) { listeningUserId.getListener() <START> .addEvent(eventMethods.get("jobUpdatedFullDataEvent"), job); <END> } } } catch (NullPointerException e) { logger.debug("", e); } } } clearListeners(); } catch (SecurityException e) { logger.error("", e); } }</code><technical_language>i this is in this pull request scope, simply a string eventMethods.get("jobUpdatedFullDataEvent") is a good practice. put a FIXEME for refactoring</technical_language>

Target:
private void dispatchJobUpdatedFullData(JobState job) { try { if (logger.isDebugEnabled()) { jlogger.debug(job.getJobInfo().getJobId(), " event [" + SchedulerEvent.JOB_UPDATED + "]"); } for (ListeningUser listeningUserId : identifications.values()) { if (listeningUserId.isListening()) { UserIdentificationImpl userId = listeningUserId.getUser(); if ((userId.getUserEvents() == null) || userId.getUserEvents().contains(SchedulerEvent.JOB_UPDATED)) { if (!userId.isMyEventsOnly() || (userId.isMyEventsOnly() && userId.getUsername().equals(job.getOwner()))) { listeningUserId.getListener() .addEvent(eventMethods.get(JOB_UPDATED_FULL_DATA_EVENT_METHOD), job); } } } } clearListeners(); } catch (SecurityException e) { logger.error("", e); } }