auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean check() { format = FORMAT_UNSUPPORTED; try { <START> File fileCopy = File.createTempFile("modeshape-sequencer-audio", ".tmp"); <END> FileOutputStream fileOutputStream = new FileOutputStream(fileCopy); byte[] b = new byte[1024]; while (read(b) != -1) { fileOutputStream.write(b); } fileOutputStream.close(); if (mimeType.startsWith("audio/mpeg")) { format = FORMAT_MP3; audioFile = new MP3FileReader().read(fileCopy); } else if (mimeType.startsWith("audio/vorbis") || mimeType.startsWith("audio/x-vorbis")) { format = FORMAT_VORBIS; audioFile = new OggFileReader().read(fileCopy); } else if (mimeType.startsWith("audio/flac") || mimeType.startsWith("audio/x-flac")) { format = FORMAT_FLAC; audioFile = new FlacFileReader().read(fileCopy); } else if (mimeType.equals("audio/mp4") || mimeType.equals("video/mp4") || mimeType.equals("video/quicktime")) { format = FORMAT_MP4; audioFile = new Mp4FileReader().read(fileCopy); } else if (mimeType.equals("audio/x-ms-wma")) { format = FORMAT_WMA; audioFile = new AsfFileReader().read(fileCopy); } else if (mimeType.startsWith("audio/x-wav") || mimeType.startsWith("audio/wav")) { format = FORMAT_WAV; audioFile = new WavFileReader().read(fileCopy); } return checkSupportedAudio(); } catch (Exception e) { } return false; }</code><technical_language>this ModeShape's IoUtil.write commons package</technical_language>

Target:
public boolean check() throws Exception { format = FORMAT_UNSUPPORTED; File fileCopy = File.createTempFile("modeshape-sequencer-audio", ".tmp"); IoUtil.write(in, new BufferedOutputStream(new FileOutputStream(fileCopy))); if (mimeType.startsWith("audio/mpeg")) { format = FORMAT_MP3; audioFile = new MP3FileReader().read(fileCopy); } else if (mimeType.startsWith("audio/vorbis") || mimeType.startsWith("audio/x-vorbis")) { format = FORMAT_VORBIS; audioFile = new OggFileReader().read(fileCopy); } else if (mimeType.startsWith("audio/flac") || mimeType.startsWith("audio/x-flac")) { format = FORMAT_FLAC; audioFile = new FlacFileReader().read(fileCopy); } else if (mimeType.equals("audio/mp4") || mimeType.equals("video/mp4") || mimeType.equals("video/quicktime")) { format = FORMAT_MP4; audioFile = new Mp4FileReader().read(fileCopy); } else if (mimeType.equals("audio/x-ms-wma")) { format = FORMAT_WMA; audioFile = new AsfFileReader().read(fileCopy); } else if (mimeType.startsWith("audio/x-wav") || mimeType.startsWith("audio/wav")) { format = FORMAT_WAV; audioFile = new WavFileReader().read(fileCopy); } boolean deleted = false; try { deleted = fileCopy.delete(); } catch (SecurityException e) { } if (!deleted) { fileCopy.deleteOnExit(); } return checkSupportedAudio(); }
Source:
<code>private void removeEmptyParents(File f) { File parentFile = f.getParentFile(); while (!parentFile.equals(repo.getWorkDir())) { <START> if (parentFile.list().length == 0) <END> parentFile.delete(); else break; parentFile = parentFile.getParentFile(); } }</code><technical_language>I willing bet a beer next time meet in person doing: if (!parentFile.delete()) break; is faster. do a system call read directory contents, operating system is forbidden letting remove a directory long file/directory it. accomplish tasks in system call delete, aborting soon work</technical_language>

Target:
private void removeEmptyParents(File f) { File parentFile = f.getParentFile(); while (!parentFile.equals(repo.getWorkDir())) { if (!parentFile.delete()) break; parentFile = parentFile.getParentFile(); } }
Source:
<code>public Allele getAltAlleleWithHighestAlleleCount() { try { if ( isBiallelic() ) return getAlternateAllele(0); return getAlternateAlleles().stream() .map(allele -> new Tuple<>(allele, getCalledChrCount(allele))) .max((alleleAndCount1, alleleAndCount2) -> Integer.compare(alleleAndCount1.b, alleleAndCount2.b)) <START> .get() <END> .a; } catch(NoSuchElementException e) { return null; } }</code><technical_language>instead of try/catch, a getOrElse(null)</technical_language>

Target:
public Allele getAltAlleleWithHighestAlleleCount() { if ( isBiallelic() ) return getAlternateAllele(0); return getAlternateAlleles().stream() .map(allele -> new Tuple<>(allele, getCalledChrCount(allele))) .max((alleleAndCount1, alleleAndCount2) -> Integer.compare(alleleAndCount1.b, alleleAndCount2.b)) .orElse(null) .a; }
Source:
<code>public String getFullViewPath() { if (StringUtils.isBlank(assetRoot)) { return viewPath; } <START> return URI.create(assetRoot + File.separator + viewPath).normalize().toString(); <END> }</code><technical_language>this wrong separator windows</technical_language>

Target:
public String getFullViewPath() { if (StringUtils.isBlank(assetRoot)) { return viewPath; } return URI.create(FilenameUtils.separatorsToUnix(Paths.get( assetRoot, viewPath).toString())).normalize().toString(); }
Source:
<code><START> private ItemStack itemFromBlock(Block block, IBlockState state) <END> { try { return block.getPickBlock(state, null, null, null, null); } catch (Exception e) { ItemStack item = new ItemStack(block); int dropped = block.damageDropped(state); if (item.getItem().getHasSubtypes() && dropped > 0) { return new ItemStack(block, 1, dropped); } return item; } }</code><technical_language>statetostack</technical_language>

Target:
private ItemStack itemFromBlock(Block block, IBlockState state) { try { return block.getPickBlock(state, null, null, null, null); } catch (Exception e) { return ItemHelper.stateToStack(state, 1); } }
Source:
<code>public boolean basicPut(EntryEventImpl event, boolean ifNew, boolean ifOld, Object expectedOldValue, boolean requireOldValue) throws TimeoutException, CacheWriterException { boolean returnValue = getDataView().putEntry(event, ifNew, ifOld, expectedOldValue, requireOldValue, 0L, false); <START> getFutures.remove(event.getKey()); <END> return returnValue; }</code><technical_language>Need handle exception (in case of timeout exception, changes applied server). remove if proxy</technical_language>

Target:
public boolean basicPut(EntryEventImpl event, boolean ifNew, boolean ifOld, Object expectedOldValue, boolean requireOldValue) throws TimeoutException, CacheWriterException { try { return getDataView().putEntry(event, ifNew, ifOld, expectedOldValue, requireOldValue, 0L, false); } finally { clearOptimizedGetFuture(event.getKey()); } }
Source:
<code>public void testTenantIdleTime() throws Exception { AutomationContext context = new AutomationContext("AS", "appServerInstance0002", ContextXpathConstants.SUPER_TENANT, ContextXpathConstants.ADMIN); LoginLogoutClient loginLogoutClient = new LoginLogoutClient(context); String sessionCookie = loginLogoutClient.login(); AutomationContext contextUser = new AutomationContext("AS", "appServerInstance0002", ContextXpathConstants.SUPER_TENANT, "userKey1"); LoginLogoutClient loginLogoutClientUser = new LoginLogoutClient(contextUser); loginLogoutClientUser.login(); loginLogoutClient.logout(); boolean isStatingToCleanTenant = CarbonCommandToolsUtil.findMultipleStringsInLog( context.getContextUrls().getBackEndUrl(), new String[]{"Starting to clean tenant"}, sessionCookie); <START> Assert.assertTrue(isStatingToCleanTenant, "Not cleaned the tenant successfully"); <END> }</code><technical_language>static assert imports</technical_language>

Target:
public void testTenantIdleTime() throws Exception { AutomationContext context = new AutomationContext(ASIntegrationConstants.AS_PRODUCT_GROUP, ASIntegrationConstants.AS_INSTANCE_0002, ContextXpathConstants.SUPER_TENANT, ContextXpathConstants.ADMIN); LoginLogoutClient loginLogoutClient = new LoginLogoutClient(context); String sessionCookie = loginLogoutClient.login(); AutomationContext contextUser = new AutomationContext(ASIntegrationConstants.AS_PRODUCT_GROUP, ASIntegrationConstants.AS_INSTANCE_0002, ContextXpathConstants.SUPER_TENANT, "userKey1"); LoginLogoutClient loginLogoutClientUser = new LoginLogoutClient(contextUser); loginLogoutClientUser.login(); loginLogoutClient.logout(); boolean isStatingToCleanTenant = CarbonCommandToolsUtil.searchOnLogs( context.getContextUrls().getBackEndUrl(), new String[]{"Starting to clean tenant"}, sessionCookie); assertTrue(isStatingToCleanTenant, "Not cleaned the tenant successfully"); }
Source:
<code>public static void removePmFromOutbox(PrivateMessage pm) { info("Start to remove PM from outbox folder"); mainPage.openPrivateMessages(); <START> info("Opening outbox folder"); <END> pmPage.clickOpenOutboxMessages(); removePm(pm); }</code><technical_language>moved pmPage.clickOpenOutboxMessages()</technical_language>

Target:
public static void removePmFromOutbox(PrivateMessage pm) { info("Start to remove PM from outbox folder"); mainPage.openPrivateMessages(); pmPage.clickOpenOutboxMessages(); removePm(pm); }
Source:
<code>default Map<String, Set<DatastreamTask>> movePartitions(Map<String, Set<DatastreamTask>> currentAssignment, Map<String, Set<String>> targetAssignment, DatastreamGroupPartitionsMetadata partitionsMetadata) { <START> return currentAssignment; <END> }</code><technical_language>If assignment strategy implement movePartitions if operator calls movePartitions, is throw silently return. This is clear operator movePartitions is supported for connectors this assingment strategy</technical_language>

Target:
default Map<String, Set<DatastreamTask>> movePartitions(Map<String, Set<DatastreamTask>> currentAssignment, Map<String, Set<String>> targetAssignment, DatastreamGroupPartitionsMetadata partitionsMetadata) { throw new NotImplementedException("movePartitions are not implemented"); }
Source:
<code>public SimpleQueryableIndex( Interval dataInterval, Indexed<String> dimNames, BitmapFactory bitmapFactory, Map<String, Column> columns, SmooshedFileMapper fileMapper, Metadata metadata ) { Preconditions.checkNotNull(columns.get(Column.TIME_COLUMN_NAME)); this.dataInterval = dataInterval; ImmutableList.Builder<String> columnNamesBuilder = ImmutableList.builder(); for (String column : columns.keySet()) { if (!Column.TIME_COLUMN_NAME.equals(column)) { columnNamesBuilder.add(column); } <START> } <END> this.columnNames = columnNamesBuilder.build(); this.availableDimensions = dimNames; this.bitmapFactory = bitmapFactory; this.columns = columns; this.fileMapper = fileMapper; this.metadata = metadata; this.dimensionHandlers = Maps.newLinkedHashMap(); initDimensionHandlers(); removeNullorEmptyDimensions(); }</code><technical_language>filter dimNames here, field final</technical_language>

Target:
public SimpleQueryableIndex( Interval dataInterval, Indexed<String> dimNames, BitmapFactory bitmapFactory, Map<String, Column> columns, SmooshedFileMapper fileMapper, Metadata metadata ) { Preconditions.checkNotNull(columns.get(Column.TIME_COLUMN_NAME)); this.dataInterval = dataInterval; ImmutableList.Builder<String> columnNamesBuilder = ImmutableList.builder(); for (String column : columns.keySet()) { if (!Column.TIME_COLUMN_NAME.equals(column)) { columnNamesBuilder.add(column); } } this.columnNames = columnNamesBuilder.build(); this.availableDimensions = dimNames; this.bitmapFactory = bitmapFactory; this.columns = columns; this.fileMapper = fileMapper; this.metadata = metadata; this.dimensionHandlers = Maps.newLinkedHashMap(); initDimensionHandlers(); }
Source:
<code>public boolean equals( Object obj ) { if ( this == obj ) { return true; } <START> if ( ( obj == null ) || !( obj instanceof FileModelSource ) ) <END> { return false; } FileModelSource other = ( FileModelSource ) obj; return getFile().equals( other.getFile() ); }</code><technical_language>Compare null necessary null instanceof FileModelSource is false</technical_language>

Target:
public boolean equals( Object obj ) { if ( this == obj ) { return true; } if ( !( obj instanceof FileModelSource ) ) { return false; } FileModelSource other = ( FileModelSource ) obj; return getFile().equals( other.getFile() ); }
Source:
<code>public static MISTQuery cepStatelessTranslator(final MISTCepStatelessQuery query) { CepInput cepInput = query.getCepInput(); List<CepStatelessRule> cepStatelessRules = query.getCepStatelessRules(); <START> MISTQueryBuilder queryBuilder = new MISTQueryBuilder("example-group"); <END> ContinuousStream<HashMap<String, Tuple2<Object, CepValueType>>> inputMapStream = cepInputTranslator(queryBuilder, cepInput); cepStatelessRulesTranslator(inputMapStream, cepStatelessRules); return queryBuilder.build(); }</code><technical_language>do get a group info cep query</technical_language>

Target:
public static MISTQuery cepStatelessTranslator(final MISTCepStatelessQuery query) { final CepInput cepInput = query.getCepInput(); final List<CepStatelessRule> cepStatelessRules = query.getCepStatelessRules(); final MISTQueryBuilder queryBuilder = new MISTQueryBuilder(query.getGroupId()); final ContinuousStream<Map<String, Object>> inputMapStream = cepInputTranslator(queryBuilder, cepInput); cepStatelessRulesTranslator(inputMapStream, cepStatelessRules); return queryBuilder.build(); }
Source:
<code><START> <PK, M> MessageStreamImpl<M> generateIntStreamFromOpId(int opId, Function<M, PK> parKeyFn) { <END> String streamId = String.format("%s-%s", OperatorSpec.OpCode.PARTITION_BY.name().toLowerCase(), opId); StreamSpec streamSpec = runner.streamFromConfig(streamId); if (!this.inStreams.containsKey(streamSpec.getId())) { this.inStreams.putIfAbsent(streamSpec.getId(), new IntermediateStreamImpl(this, streamSpec, null, null, parKeyFn)); } IntermediateStreamImpl intStream = (IntermediateStreamImpl) this.inStreams.get(streamSpec.getId()); if (!this.outStreams.containsKey(streamSpec.getId())) { this.outStreams.putIfAbsent(streamSpec.getId(), intStream); } return intStream; }</code><technical_language>Naming: Prefer createRepartionStream similar this is specific a repartitioner. inline this method</technical_language>

Target:
<PK, M> MessageStreamImpl<M> generateIntStreamFromOpId(int opId, Function<M, PK> parKeyFn) { String opNameWithId = String.format("%s-%s", OperatorSpec.OpCode.PARTITION_BY.name().toLowerCase(), opId); String streamId = String.format("%s-%s-%s", config.get(JobConfig.JOB_NAME()), config.get(JobConfig.JOB_ID(), "1"), opNameWithId); StreamSpec streamSpec = runner.streamFromConfig(streamId); this.inStreams.putIfAbsent(streamSpec.getId(), new IntermediateStreamImpl(this, streamSpec, null, null, parKeyFn)); IntermediateStreamImpl intStream = (IntermediateStreamImpl) this.inStreams.get(streamSpec.getId()); this.outStreams.putIfAbsent(streamSpec.getId(), intStream); return intStream; }
Source:
<code>public BindAccountMetadataToDeleteToHeaders() { FN = new Function<String, String>() { @Override public String apply(String element) { String inLowercase = element.toLowerCase(); <START> return (!inLowercase.startsWith(ACCOUNT_METADATA_PREFIX)) <END> ? ACCOUNT_METADATA_PREFIX + inLowercase: inLowercase; } @Override public String toString() { return "prefix: " + ACCOUNT_METADATA_PREFIX; } }; FN2 = new Function<String, String>() { @Override public String apply(String element) { return ""; } }; }</code><technical_language>this test succeed ACCOUNT_METADATA_PREFIX mixed-case characters</technical_language>

Target:
public BindAccountMetadataToDeleteToHeaders() { transformHeaders = new Function<String, String>() { @Override public String apply(String element) { String inLowercase = element.toLowerCase(); return (!inLowercase.startsWith(ACCOUNT_METADATA_PREFIX)) ? ACCOUNT_METADATA_PREFIX.toLowerCase() + inLowercase : inLowercase; } @Override public String toString() { return "prefix: " + ACCOUNT_METADATA_PREFIX; } }; transformValues = new Function<String, String>() { @Override public String apply(String element) { return ""; } }; }
Source:
<code>public Map<String, Object> introspect(String token) { <START> TokenIntrospectionSuccessResponse response = Optional.of(this.requestEntityConverter.convert(token)) <END> .map(this::makeRequest) .map(this::adaptToNimbusResponse) .map(this::parseNimbusResponse) .map(this::castToNimbusSuccess) .filter(TokenIntrospectionSuccessResponse::isActive) .orElseThrow(() -> new OAuth2IntrospectionException("Provided token [" + token + "] isn't active")); return convertClaimsSet(response); }</code><technical_language>of suggestion TokenIntrospectionSuccessResponse response = Optional.of(token) .map(this.requestEntityConverter::convert)</technical_language>

Target:
public Map<String, Object> introspect(String token) { TokenIntrospectionSuccessResponse response = Optional.of(token) .map(this.requestEntityConverter::convert) .map(this::makeRequest) .map(this::adaptToNimbusResponse) .map(this::parseNimbusResponse) .map(this::castToNimbusSuccess) .filter(TokenIntrospectionSuccessResponse::isActive) .orElseThrow(() -> new OAuth2IntrospectionException("Provided token [" + token + "] isn't active")); return convertClaimsSet(response); }
Source:
<code>public CreateWorkflowResponse mergeSegments(@Nonnull String endpoint) throws TimeoutException { OrchestratorMsg req = new OrchestratorMsg(new MergeSegmentsRequest(endpoint)); CompletableFuture<OrchestratorResponse> resp = sendMessageWithFuture(CorfuMsgType .ORCHESTRATOR_REQUEST .payloadMsg(req)); <START> return (CreateWorkflowResponse) CFUtils.getUninterruptibly(resp, TimeoutException.class).getResponse(); <END> }</code><technical_language>return completablefuture block current thread</technical_language>

Target:
public CreateWorkflowResponse mergeSegments(@Nonnull String endpoint) throws TimeoutException { OrchestratorMsg req = new OrchestratorMsg(new RestoreRedundancyMergeSegmentsRequest(endpoint)); CompletableFuture<OrchestratorResponse> resp = sendMessageWithFuture(CorfuMsgType .ORCHESTRATOR_REQUEST .payloadMsg(req)); return (CreateWorkflowResponse) CFUtils.getUninterruptibly(resp, TimeoutException.class).getResponse(); }
Source:
<code>public static double calculateDistance(final Locatable from, final Locatable to) { if (!from.getContig().equals(to.getContig())) { return Double.POSITIVE_INFINITY; } else { final double toMidpoint = (to.getStart() + to.getEnd())/2; final double fromMidpoint = (from.getStart() + from.getEnd())/2; <START> return Math.abs(toMidpoint - fromMidpoint); <END> } }</code><technical_language>white space return</technical_language>

Target:
protected static double calculateDistance(final Locatable from, final Locatable to) { if (!from.getContig().equals(to.getContig())) { return Double.POSITIVE_INFINITY; } else { final double toMidpoint = (to.getStart() + to.getEnd())/2; final double fromMidpoint = (from.getStart() + from.getEnd())/2; return Math.abs(toMidpoint - fromMidpoint); } }
Source:
<code>public CancelStatus cancelStatus() { <START> if (CANCELLED.equals(status)) { <END> return CancelStatus.CANCELLED; } if (SUBMITTED.equals(status)) { return CancelStatus.SUBMITTED; } return CancelStatus.ERROR; }</code><technical_language>a switch statement a series of ifs here</technical_language>

Target:
public CancelStatus cancelStatus() { switch(status) { case CANCELLED: return CancelStatus.CANCELLED; case SUBMITTED: return CancelStatus.SUBMITTED; default: return CancelStatus.ERROR; } }
Source:
<code>public CommentAttributes(String courseId, String giverEmail, CommentParticipantType recipientType, Set<String> recipients, Date createdAt, Text commentText) { this.courseId = courseId; this.giverEmail = giverEmail; this.recipientType = recipientType == null ? CommentParticipantType.PERSON : recipientType; this.recipients = recipients; <START> this.commentText = commentText == null ? null : new Text(Sanitizer.sanitizeForRichText(commentText.getValue())); <END> this.createdAt = createdAt; this.lastEditorEmail = giverEmail; this.lastEditedAt = createdAt; }</code><technical_language>thinking, is a sanitizeForRichText method takes in Text parameter? reused potentially other places</technical_language>

Target:
public CommentAttributes(String courseId, String giverEmail, CommentParticipantType recipientType, Set<String> recipients, Date createdAt, Text commentText) { this.courseId = courseId; this.giverEmail = giverEmail; this.recipientType = recipientType == null ? CommentParticipantType.PERSON : recipientType; this.recipients = recipients; this.commentText = commentText; this.createdAt = createdAt; this.lastEditorEmail = giverEmail; this.lastEditedAt = createdAt; }
Source:
<code>public void testSimpleScript1() throws Exception { String value = "javaValue"; String key = "processValue"; cacheManager.getCache("test_cache").put(key, value); CompletableFuture exec = scriptingManager.runScript("testExecWithoutProp.js"); <START> while (!exec.isDone()) { <END> Thread.sleep(1000); } assertEquals(value + ":additionFromJavascript", cacheManager.getCache("test_cache").get(key)); }</code><technical_language>call exec.get() (with optional timeout if wish)</technical_language>

Target:
public void testSimpleScript1() throws Exception { String value = "javaValue"; String key = "processValue"; cacheManager.getCache("test_cache").put(key, value); CompletableFuture exec = scriptingManager.runScript("testExecWithoutProp.js"); exec.get(1000, TimeUnit.MILLISECONDS); assertEquals(value + ":additionFromJavascript", cacheManager.getCache("test_cache").get(key)); }
Source:
<code>public final Response getTermById(@PathParam("term_id") final String term_id) { if (null == term_id) { return new SegueErrorResponse(Status.BAD_REQUEST, "Please specify a term_id.").toResponse(); } Content c = null; try { c = this.contentManager.getContentDOById(this.contentIndex, term_id); if (null == c) { SegueErrorResponse error = new SegueErrorResponse(Status.NOT_FOUND, "No glossary term found with id: " + term_id); log.debug(error.getErrorMessage()); return error.toResponse(); } } catch (NumberFormatException e) { return new SegueErrorResponse(Status.BAD_REQUEST, "Unable to convert one of the integer parameters provided into numbers. " <START> + "Params provided were: limit" + DEFAULT_RESULTS_LIMIT + " and startIndex 0", e).toResponse(); <END> } catch (ContentManagerException e) { return new SegueErrorResponse(Status.INTERNAL_SERVER_ERROR, "Content acquisition error.", e).toResponse(); } return Response.ok(c).build(); }</code><technical_language>This a checked exception getContentDOById(...) converting parameters numbers this happen</technical_language>

Target:
public final Response getTermById(@PathParam("term_id") final String term_id) { if (null == term_id) { return new SegueErrorResponse(Status.BAD_REQUEST, "Please specify a term_id.").toResponse(); } Content c = null; try { c = this.contentManager.getContentDOById(this.contentIndex, term_id); if (null == c) { SegueErrorResponse error = new SegueErrorResponse(Status.NOT_FOUND, "No glossary term found with id: " + term_id); log.debug(error.getErrorMessage()); return error.toResponse(); } } catch (ContentManagerException e) { return new SegueErrorResponse(Status.INTERNAL_SERVER_ERROR, "Content acquisition error.", e).toResponse(); } EntityTag etag = new EntityTag(this.contentManager.getCurrentContentSHA().hashCode() + ""); return Response.ok(c).tag(etag).build(); }
Source:
<code>public static List<AbstractProject> getProjectsFromString(String projects, Item context) { List<AbstractProject> dependencyJobs = new ArrayList<AbstractProject>(); <START> if (projects == null) { <END> return null; } else { StringTokenizer tokens = new StringTokenizer(Util.fixNull(projects), ","); while (tokens.hasMoreTokens()) { String projectName = tokens.nextToken().trim(); if (!projectName.equals("")) { Item item = Jenkins.getInstance().getItem(projectName, context, Item.class); if ((item != null) && (item instanceof AbstractProject)) { dependencyJobs.add((AbstractProject)item); logger.debug("project dependency job added : {}", (AbstractProject)item); } } } } return dependencyJobs; }</code><technical_language>I guess projects empty string well, in case return null well</technical_language>

Target:
public static List<AbstractProject> getProjectsFromString(String projects, Item context) { List<AbstractProject> dependencyJobs = new ArrayList<AbstractProject>(); if ((projects == null) || projects.equals("")) { return null; } else { StringTokenizer tokens = new StringTokenizer(Util.fixNull(projects), ","); while (tokens.hasMoreTokens()) { String projectName = tokens.nextToken().trim(); if (!projectName.equals("")) { Item item = Jenkins.getInstance().getItem(projectName, context, Item.class); if ((item != null) && (item instanceof AbstractProject)) { dependencyJobs.add((AbstractProject)item); logger.debug("project dependency job added : {}", (AbstractProject)item); } } } } return dependencyJobs; }
Source:
<code>public List<IDockerContainerListener> getContainerListeners() { final IDockerContainerListener[] listeners = new IDockerContainerListener[this.containerListeners .size()]; <START> for (int i = 0; i < containerListeners.getListeners().length; i++) { <END> listeners[i] = (IDockerContainerListener) containerListeners .getListeners()[i]; } return Arrays.asList(listeners); }</code><technical_language>put containerListeners.getListeners() in a local variable</technical_language>

Target:
public List<IDockerContainerListener> getContainerListeners() { final IDockerContainerListener[] result = new IDockerContainerListener[this.containerListeners .size()]; final Object[] listeners = containerListeners.getListeners(); for (int i = 0; i < listeners.length; i++) { result[i] = (IDockerContainerListener) listeners[i]; } return Arrays.asList(result); }
Source:
<code>public EurekaInstanceConfigBean eurekaInstanceConfigBean(InetUtils inetUtils) { EurekaInstanceConfigBean instance = new EurekaInstanceConfigBean(inetUtils); instance.setNonSecurePort(this.nonSecurePort); instance.setInstanceId(getDefaultInstanceId(this.env)); if (this.managementPort != this.nonSecurePort && this.managementPort != 0) { if (StringUtils.hasText(this.hostname)) { instance.setHostname(this.hostname); } <START> if (StringUtils.hasText(statusPageUrlPath)) { <END> instance.setStatusPageUrlPath(statusPageUrlPath); } if (StringUtils.hasText(healthCheckUrlPath)) { instance.setHealthCheckUrlPath(healthCheckUrlPath); } String scheme = instance.getSecurePortEnabled() ? "https" : "http"; instance.setStatusPageUrl(scheme + "://" + instance.getHostname() + ":" + this.managementPort + instance.getStatusPageUrlPath()); instance.setHealthCheckUrl(scheme + "://" + instance.getHostname() + ":" + this.managementPort + instance.getHealthCheckUrlPath()); } return instance; }</code><technical_language>If a resolver = new RelaxedPropertyResolver(env); resolver.getProperty("eureka.instance.statusPageUrlPath"); // etc... more comfortable</technical_language>

Target:
public EurekaInstanceConfigBean eurekaInstanceConfigBean(InetUtils inetUtils) { RelaxedPropertyResolver relaxedPropertyResolver = new RelaxedPropertyResolver(env, "eureka.instance."); EurekaInstanceConfigBean instance = new EurekaInstanceConfigBean(inetUtils); instance.setNonSecurePort(this.nonSecurePort); instance.setInstanceId(getDefaultInstanceId(this.env)); if (this.managementPort != this.nonSecurePort && this.managementPort != 0) { if (StringUtils.hasText(this.hostname)) { instance.setHostname(this.hostname); } String statusPageUrlPath = relaxedPropertyResolver.getProperty("statusPageUrlPath"); String healthCheckUrlPath = relaxedPropertyResolver.getProperty("healthCheckUrlPath"); if (StringUtils.hasText(statusPageUrlPath)) { instance.setStatusPageUrlPath(statusPageUrlPath); } if (StringUtils.hasText(healthCheckUrlPath)) { instance.setHealthCheckUrlPath(healthCheckUrlPath); } String scheme = instance.getSecurePortEnabled() ? "https" : "http"; instance.setStatusPageUrl(scheme + "://" + instance.getHostname() + ":" + this.managementPort + instance.getStatusPageUrlPath()); instance.setHealthCheckUrl(scheme + "://" + instance.getHostname() + ":" + this.managementPort + instance.getHealthCheckUrlPath()); } return instance; }
Source:
<code>public String queryToRetrieveData() { StringBuilder builder = new StringBuilder(); if (query != null) { builder.append(query.trim()); if (builder.charAt(builder.length() - 1) == ';') { builder.deleteCharAt(builder.length() - 1); } } else { builder.append("SELECT ").append(columnsExpression).append(" FROM ").append(tableName); if (whereCondition != null) { builder.append(" WHERE ").append(whereCondition); } if (groupByClause != null) { builder.append(" GROUP BY ").append(groupByClause); if (havingCondition != null) { builder.append(" HAVING ").append(havingCondition); } } if (orderByExpr != null) { builder.append(" ORDER BY ").append(orderByExpr); } } if (limitSupported) { builder.append(" LIMIT ? , ? "); } else { <START> builder.append(" OFFSET ? ROWS FETCH NEXT ? ROWS FETCH NEXT ? ROWS ONLY "); <END> } builder.append(";"); String queryStr = builder.toString(); LOG.debug("built query {}", queryStr); return queryStr; }</code><technical_language>is this right? line 138 set query parameters</technical_language>

Target:
public String queryToRetrieveData() { StringBuilder builder = new StringBuilder(); if (query != null) { builder.append(query.trim()); if (builder.charAt(builder.length() - 1) == ';') { builder.deleteCharAt(builder.length() - 1); } } else { builder.append("SELECT ").append(columnsExpression).append(" FROM ").append(tableName); if (whereCondition != null) { builder.append(" WHERE ").append(whereCondition); } if (groupByClause != null) { builder.append(" GROUP BY ").append(groupByClause); if (havingCondition != null) { builder.append(" HAVING ").append(havingCondition); } } if (orderByExpr != null) { builder.append(" ORDER BY ").append(orderByExpr); } } if (mysqlSyntax) { builder.append(" LIMIT ").append(fetchSize).append(" OFFSET ?"); } else { builder.append(" OFFSET ? ROWS FETCH NEXT ").append(fetchSize).append(" ROWS ONLY"); } builder.append(";"); String queryStr = builder.toString(); LOG.debug("built query {}", queryStr); return queryStr; }
Source:
<code>public void setPasswordAndHashedPassword(String password) { SharedPreferences.Editor editor = getOpenMRSSharedPreferences().edit(); String salt = BCrypt.gensalt(ApplicationConstants.DEFAULT_BCRYPT_ROUND); String hashedPassword = BCrypt.hashpw(password, salt); editor.putString(ApplicationConstants.UserKeys.PASSWORD, password); editor.putString(ApplicationConstants.UserKeys.HASHED_PASSWORD, hashedPassword); <START> editor.commit(); <END> }</code><technical_language>is practice editor.apply() commit() called UI thread</technical_language>

Target:
public void setPasswordAndHashedPassword(String password) { SharedPreferences.Editor editor = getOpenMRSSharedPreferences().edit(); String salt = BCrypt.gensalt(ApplicationConstants.DEFAULT_BCRYPT_ROUND); String hashedPassword = BCrypt.hashpw(password, salt); editor.putString(ApplicationConstants.UserKeys.PASSWORD, password); editor.putString(ApplicationConstants.UserKeys.HASHED_PASSWORD, hashedPassword); editor.apply(); }
Source:
<code>private String makeFilename(String suffix) { <START> return StringUtils.safeFormat("%s.%s", filenameBase, suffix); <END> }</code><technical_language>crash if bad format string</technical_language>

Target:
private String makeFilename(String suffix) { return StringUtils.format("%s.%s", filenameBase, suffix); }
Source:
<code>public KafkaEightSimpleConsumerFirehoseFactory( @JsonProperty("brokerList") String brokerList, @JsonProperty("partitionIdList") String partitionIdList, @JsonProperty("clientId") String clientId, @JsonProperty("feed") String feed, @JsonProperty("parser") ByteBufferInputRowParser parser, @JsonProperty("offsetPosition") String offsetPosition, @JsonProperty("queueBufferLength") int queueBufferLength) { <START> log.info("brokerList:" + brokerList); <END> this.brokerList = brokerList; log.info("partitionIdList:" + partitionIdList); this.partitionIdList = partitionIdList; log.info("clientId:" + clientId); this.clientId = clientId; log.info("feed:" + feed); this.feed = feed; this.parser = (parser == null) ? null : parser; log.info("queueBufferLength:" + queueBufferLength); this.queueBufferLength = queueBufferLength; log.info("offsetPosition:" + offsetPosition); this.offsetPosition = offsetPosition; try { md = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { log.info("no md5 algorithm"); } }</code><technical_language>task config is printed in task logs, info logs duplicate info</technical_language>

Target:
public KafkaEightSimpleConsumerFirehoseFactory( @JsonProperty("brokerList") String brokerList, @JsonProperty("partitionIdList") String partitionIdList, @JsonProperty("clientId") String clientId, @JsonProperty("feed") String feed, @JsonProperty("parser") ByteBufferInputRowParser parser, @JsonProperty("offsetPosition") String offsetPosition, @JsonProperty("queueBufferLength") int queueBufferLength) { this.brokerList = brokerList; this.partitionIdList = partitionIdList; this.clientId = clientId; this.feed = feed; this.parser = (parser == null) ? null : parser; this.queueBufferLength = queueBufferLength; this.offsetPosition = offsetPosition; try { md = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { log.info("no md5 algorithm"); } }
Source:
<code>public void showLocationDisabledDialog(){ <START> Boolean isGPSDataCollectionEnabledSetting = new GPSFeaturePreferenceService(application).getIsGPSDataCollectionEnabledSetting(); <END> if(isGPSDataCollectionEnabledSetting) { AlertDialog.Builder alertDialog = new AlertDialog.Builder(application); alertDialog.setTitle(formWebViewActivity.getString(R.string.title_enable_gps_location)); alertDialog.setMessage(formWebViewActivity.getString(R.string.gps_location_off_message)); alertDialog.setPositiveButton(formWebViewActivity.getString(R.string.btn_location_setting), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS); application.startActivity(intent); } }); alertDialog.show(); } }</code><technical_language>I this renamed isGPSDataCollectionSettingEnabled isGPSDataCollectionSettingEnabled()</technical_language>

Target:
public void showLocationDisabledDialog(){ Boolean isGPSDataCollectionSettingEnabled = new GPSFeaturePreferenceService(application).isGPSDataCollectionSettingEnabled(); if(isGPSDataCollectionSettingEnabled) { AlertDialog.Builder alertDialog = new AlertDialog.Builder(application); alertDialog.setTitle(formWebViewActivity.getString(R.string.title_enable_gps_location)); alertDialog.setMessage(formWebViewActivity.getString(R.string.hint_gps_location_off)); alertDialog.setPositiveButton(formWebViewActivity.getString(R.string.general_location_setting), new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS); application.startActivity(intent); } }); alertDialog.show(); } }
Source:
<code>public ShardResponse(Version version) { <START> this.allOn4_1 = version.onOrAfter(Version.V_4_2_0); <END> }</code><technical_language>allOn4_1 correspond version.onOrAfter(Version.V_4_2_0) means versions >= 4.2.0</technical_language>

Target:
public ShardResponse(Version version) { this.allOn4_2 = version.onOrAfter(Version.V_4_2_0); }
Source:
<code>public Object lookupByName(String name) { Object service = null; ServiceReference<?> sr = bundleContext.getServiceReference(name); if (sr != null) { serviceReferenceQueue.add(sr); service = bundleContext.getService(sr); } else { try { ServiceReference<?>[] refs = bundleContext.getServiceReferences((String)null, "(" + Constants.SERVICE_PID + "=" + name + ")"); if (refs != null && refs.length > 0) { sr = refs[0]; serviceReferenceQueue.add(sr); service = bundleContext.getService(sr); } <START> } catch (InvalidSyntaxException ex) { <END> LOG.error("Invalid filter to lookup bean", ex); } } return service; }</code><technical_language>need do bette log ERROR. a DEBUG/TRACE logging error ignore this. needs wrapped thrown runtime exception. is API OSGi check if syntax is correct do a if correct ... else ignore,</technical_language>

Target:
public Object lookupByName(String name) { Object service = null; ServiceReference<?> sr = bundleContext.getServiceReference(name); if (sr == null) { String filterExpression = "(" + Constants.SERVICE_PID + "=" + name + ")"; try { ServiceReference<?>[] refs = bundleContext.getServiceReferences((String)null, filterExpression); if (refs != null && refs.length > 0) { sr = refs[0]; } } catch (InvalidSyntaxException ex) { if (LOG.isDebugEnabled()) { LOG.debug("Invalid OSGi service reference filter, skipped lookup by service.pid. Filter expression: " + filterExpression, ex); } } } if (sr != null) { serviceReferenceQueue.add(sr); service = bundleContext.getService(sr); } return service; }
Source:
<code>public void canSerializeDatesWithLargeTimestampsConcurrently() { JsonProvider provider = new JsonProvider(config, new ProductCachedSerializationModule(productCurator)); ObjectMapper mapper = provider.locateMapper(Object.class, MediaType.APPLICATION_JSON_TYPE); ExecutorService ex = Executors.newFixedThreadPool(1000); for (int i = 0; i < 500000; i++) { ex.execute(() -> { try { <START> mapper.writeValueAsString(new Date(getRandomTimestampWithMilliSeconds())); <END> } catch (JsonProcessingException e) { e.printStackTrace(); failed.set(true); } }); } if (failed.get()) { fail("A JsonProcessingException should not have been thrown " + "during concurrent Date serialization."); } }</code><technical_language>verify written is expected</technical_language>

Target:
public void canSerializeDatesWithLargeTimestampsConcurrently() { JsonProvider provider = new JsonProvider(config, new ProductCachedSerializationModule(productCurator)); ObjectMapper mapper = provider.locateMapper(Object.class, MediaType.APPLICATION_JSON_TYPE); final AtomicBoolean processingFailure = new AtomicBoolean(false); final AtomicBoolean comparisonFailure = new AtomicBoolean(false); ExecutorService ex = Executors.newFixedThreadPool(1000); for (int i = 0; i < 5000000; i++) { ex.execute(() -> { Date randomDate = new Date(getRandomTimestampWithMilliSeconds()); SimpleDateFormat iso8601WithoutMilliseconds = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ"); iso8601WithoutMilliseconds.setTimeZone(TimeZone.getTimeZone("UTC")); String expectedDate = "\"" + iso8601WithoutMilliseconds.format(randomDate) + "\""; try { String receivedDate = mapper.writeValueAsString(randomDate); try { assertEquals("The date was not serialized properly.", expectedDate, receivedDate); } catch (ComparisonFailure cf) { cf.printStackTrace(); comparisonFailure.set(true); } } catch (JsonProcessingException e) { e.printStackTrace(); processingFailure.set(true); } }); } if (processingFailure.get()) { fail("A JsonProcessingException was thrown during concurrent Date serialization."); } if (comparisonFailure.get()) { fail("A date was not serialized properly during concurrent Date serialization."); } }
Source:
<code>public void shouldNotCallSupplierUntilNecessary() { <START> assertThat(iterate(2, (i) -> {throw new RuntimeException("The supplier function should not be called since the next value is not needed in order to get head.");}).head()).isEqualTo(2); <END> }</code><technical_language>personal preference omit text in Exception, name of test explains intent :)</technical_language>

Target:
public void shouldNotCallSupplierUntilNecessary() { assertThat(iterate(2, (i) -> {throw new RuntimeException();}).head()).isEqualTo(2); }
Source:
<code>public void setPreparedStatementParams(PreparedStatement preparedStatement, Schema.Type type, int index, Object val) throws SQLException { if (val == null) { preparedStatement.setNull(index, getSqlType(type)); return; } switch (type) { <START> case BOOLEAN: <END> preparedStatement.setBoolean(index, (Boolean) val); break; case BYTE: preparedStatement.setByte(index, (Byte) val); break; case SHORT: preparedStatement.setShort(index, (Short) val); break; case INTEGER: preparedStatement.setInt(index, (Integer) val); break; case LONG: preparedStatement.setLong(index, (Long) val); break; case FLOAT: preparedStatement.setFloat(index, (Float) val); break; case DOUBLE: preparedStatement.setDouble(index, (Double) val); break; case STRING: String stringValue = (String) val; if (StringUtils.isEmpty(stringValue)) preparedStatement.setString(index, EMPTY_STRING_PLACEHOLDER); else preparedStatement.setString(index, stringValue); break; case BINARY: preparedStatement.setBytes(index, (byte[]) val); break; case BLOB: preparedStatement.setBinaryStream(index, (InputStream) val); break; case NESTED: case ARRAY: preparedStatement.setObject(index, val); break; } }</code><technical_language>reimplement cases for types for want default logic? Extend Default impl, case for STRING "default:" invoke super.setPreparedStatementParams</technical_language>

Target:
public void setPreparedStatementParams(PreparedStatement preparedStatement, Schema.Type type, int index, Object val) throws SQLException { if (type == Schema.Type.STRING && StringUtils.isEmpty((String) val)) { preparedStatement.setString(index, EMPTY_STRING_PLACEHOLDER); } else super.setPreparedStatementParams(preparedStatement, type, index, val); }
Source:
<code>public void start(FeaturesRunner runner) { RuntimeHarness harness = runner.getFeature(RuntimeFeature.class).getHarness(); streamType = defaultProperty(STREAM_PROPERTY, STREAM_CHRONICLE); try { switch (streamType) { case STREAM_CHRONICLE: initChronicle(harness); break; case STREAM_KAFKA: initKafka(harness); break; default: throw new UnsupportedOperationException(streamType + " stream type is not supported"); } } catch (IOException e) { throw new RuntimeServiceException("Unable to configure the stream implementation", e); <START> } <END> }</code><technical_language>is necessary</technical_language>

Target:
public void start(FeaturesRunner runner) { RuntimeHarness harness = runner.getFeature(RuntimeFeature.class).getHarness(); streamType = defaultProperty(STREAM_PROPERTY, STREAM_CHRONICLE); try { String msg = "Deploying Nuxeo Stream using " + StringUtils.capitalize(streamType.toLowerCase()); System.out.println(getClass().getSimpleName() + ": " + msg); log.info(msg); switch (streamType) { case STREAM_CHRONICLE: break; case STREAM_KAFKA: initKafka(harness); break; default: throw new UnsupportedOperationException(streamType + " stream type is not supported"); } } catch (Exception e) { throw new RuntimeServiceException("Unable to configure the stream implementation", e); } }
Source:
<code>private Function<PollingContext<KeyVaultCertificate>, Mono<PollResponse<KeyVaultCertificate>>> createRecoverPollOperation(String keyName) { return pollingContext -> withContext(context -> service.getCertificatePoller(vaultUrl, keyName, "", API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context) .flatMap(keyResponse -> { <START> if (keyResponse.getStatusCode() == 404) { <END> return Mono.defer(() -> Mono.just(new PollResponse<>(LongRunningOperationStatus.IN_PROGRESS, pollingContext.getLatestResponse().getValue()))); } return Mono.defer(() -> Mono.just(new PollResponse<>(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, keyResponse.getValue()))); })) .onErrorReturn(new PollResponse<>(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollingContext.getLatestResponse().getValue())); }</code><technical_language>HttpURLConnection.HTTP_NOT_FOUND</technical_language>

Target:
private Function<PollingContext<KeyVaultCertificate>, Mono<PollResponse<KeyVaultCertificate>>> createRecoverPollOperation(String keyName) { return pollingContext -> withContext(context -> service.getCertificatePoller(vaultUrl, keyName, "", API_VERSION, ACCEPT_LANGUAGE, CONTENT_TYPE_HEADER_VALUE, context) .flatMap(certificateResponse -> { if (certificateResponse.getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) { return Mono.defer(() -> Mono.just(new PollResponse<>(LongRunningOperationStatus.IN_PROGRESS, pollingContext.getLatestResponse().getValue()))); } return Mono.defer(() -> Mono.just(new PollResponse<>(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, certificateResponse.getValue()))); })) .onErrorReturn(new PollResponse<>(LongRunningOperationStatus.SUCCESSFULLY_COMPLETED, pollingContext.getLatestResponse().getValue())); }
Source:
<code><START> public CompletableFuture<?> asyncClose() { <END> CompletableFuture<Void> counter = new CompletableFuture<>(); asyncClose(new SyncCloseCallback(), counter); explicitLacFlushPolicy.stopExplicitLacFlush(); return counter; }</code><technical_language>close implemented asyncClose()</technical_language>

Target:
public CompletableFuture<Void> asyncClose() { CompletableFuture<Void> result = new CompletableFuture<>(); SyncCloseCallback callback = new SyncCloseCallback(result); asyncClose(callback, null); explicitLacFlushPolicy.stopExplicitLacFlush(); return result; }
Source:
<code>public ResponseEntity <User> getUserByID(@PathVariable String userID){ if (userService.getUserByID(userID) == null) <START> return new ResponseEntity<User>(HttpStatus.INTERNAL_SERVER_ERROR); END> else return new ResponseEntity<User>(userService.getUserByID(userID), HttpStatus.OK); }</code><technical_language>Nice. show return error statuses Spring AOP next time</technical_language>

Target:
public @ResponseBody User getUserByID(@PathVariable String userID) throws InvalidUserIDException{ return userService.getUserByID(userID); }
Source:
<code>public void validate() { Attribute<Long> reaperWakeUpInterval = attributes.attribute(REAPER_WAKE_UP_INTERVAL); Attribute<Long> completedTxTimeout = attributes.attribute(COMPLETED_TX_TIMEOUT); if (reaperWakeUpInterval.get()< 0) throw log.invalidReaperWakeUpInterval(reaperWakeUpInterval.get()); if (completedTxTimeout.get() < 0) throw log.invalidCompletedTxTimeout(completedTxTimeout.get()); CacheMode cacheMode = clustering().cacheMode(); if(attributes.attribute(TRANSACTION_PROTOCOL).get() == TransactionProtocol.TOTAL_ORDER) { if(transactionMode() != TransactionMode.TRANSACTIONAL) { throw log.invalidTxModeForTotalOrder(transactionMode()); } if(!cacheMode.isReplicated() && !cacheMode.isDistributed()) { throw log.invalidCacheModeForTotalOrder(clustering().cacheMode().friendlyCacheModeString()); } if (lockingMode() != LockingMode.OPTIMISTIC) { throw log.invalidLockingModeForTotalOrder(lockingMode()); } } if (!attributes.attribute(NOTIFICATIONS).get()) { log.transactionNotificationsDisabled(); } if (attributes.attribute(TRANSACTION_MODE).get() == TransactionMode.TRANSACTIONAL && !cacheMode.isSynchronous()) { CacheMode syncCacheMod = cacheMode.toSync(); <START> log.unsupportedAsyncCacheMode(cacheMode, syncCacheMod); <END> clustering().cacheMode(syncCacheMod); } recovery.validate(); }</code><technical_language>I more agressive: throw exception. do others</technical_language>

Target:
public void validate() { Attribute<Long> reaperWakeUpInterval = attributes.attribute(REAPER_WAKE_UP_INTERVAL); Attribute<Long> completedTxTimeout = attributes.attribute(COMPLETED_TX_TIMEOUT); if (reaperWakeUpInterval.get()< 0) throw log.invalidReaperWakeUpInterval(reaperWakeUpInterval.get()); if (completedTxTimeout.get() < 0) throw log.invalidCompletedTxTimeout(completedTxTimeout.get()); CacheMode cacheMode = clustering().cacheMode(); if(attributes.attribute(TRANSACTION_PROTOCOL).get() == TransactionProtocol.TOTAL_ORDER) { if(transactionMode() != TransactionMode.TRANSACTIONAL) { throw log.invalidTxModeForTotalOrder(transactionMode()); } if(!cacheMode.isReplicated() && !cacheMode.isDistributed()) { throw log.invalidCacheModeForTotalOrder(clustering().cacheMode().friendlyCacheModeString()); } if (lockingMode() != LockingMode.OPTIMISTIC) { throw log.invalidLockingModeForTotalOrder(lockingMode()); } } if (!attributes.attribute(NOTIFICATIONS).get()) { log.transactionNotificationsDisabled(); } if (attributes.attribute(TRANSACTION_MODE).get() == TransactionMode.TRANSACTIONAL && !cacheMode.isSynchronous()) { throw log.unsupportedAsyncCacheMode(cacheMode); } recovery.validate(); }
Source:
<code>protected void executeAppliedStereotypeCommentDeletion(final TransactionalEditingDomain domain, final View commentNode) { if <START> (commentNode != <END> null) { Display.getCurrent().asyncExec(new Runnable() { @Override public void run() { if (TransactionUtil.getEditingDomain(commentNode) == domain) { DeleteCommand command = new DeleteCommand(commentNode); try { GMFUnsafe.write(domain, command); } catch (Exception e) { Activator.log.error(e); } } } }); } }</code><technical_language>'null !=' is preferably</technical_language>

Target:
protected void executeAppliedStereotypeCommentDeletion(final TransactionalEditingDomain domain, final View commentNode) { if (null != commentNode) { Display.getCurrent().asyncExec(new Runnable() { @Override public void run() { if (TransactionUtil.getEditingDomain(commentNode) == domain) { DeleteCommand command = new DeleteCommand(commentNode); try { GMFUnsafe.write(domain, command); } catch (Exception e) { Activator.log.error(e); } } } }); } }