auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public TableStatistics(Schema schema) { this.schema = schema; minValues = new VTuple(schema.size()); maxValues = new VTuple(schema.size()); numNulls = new long[schema.size()]; comparable = new boolean[schema.size()]; DataType type; for (int i = 0; i < schema.size(); i++) { type = schema.getColumn(i).getDataType(); if (type.getType() == Type.PROTOBUF) { comparable[i] = false; } else { comparable[i] = true; } } <START> stat = new TableStats(); <END> }</code><technical_language>a mistake</technical_language>

Target:
public TableStatistics(Schema schema) { this.schema = schema; minValues = new VTuple(schema.size()); maxValues = new VTuple(schema.size()); numNulls = new long[schema.size()]; comparable = new boolean[schema.size()]; DataType type; for (int i = 0; i < schema.size(); i++) { type = schema.getColumn(i).getDataType(); if (type.getType() == Type.PROTOBUF) { comparable[i] = false; } else { comparable[i] = true; } } }
Source:
<code>public CacheManager createCacheManager(CacheConfig cacheConfig, CacheStats cacheStats) { return cacheConfig.getBaseDirectory() == null ? new NoOpCacheManager() : new LocalRangeCacheManager( cacheConfig, cacheStats, newScheduledThreadPool(5, <START> daemonThreadsNamed("hdfs-cache-flusher-%s")), <END> newScheduledThreadPool(1, daemonThreadsNamed("hdfs-cache-remover-%s"))); }</code><technical_language>same, name raptor-..</technical_language>

Target:
public CacheManager createCacheManager(CacheConfig cacheConfig, CacheStats cacheStats) { return cacheConfig.getBaseDirectory() == null ? new NoOpCacheManager() : new LocalRangeCacheManager( cacheConfig, cacheStats, newScheduledThreadPool(5, daemonThreadsNamed("raptor-cache-flusher-%s")), newScheduledThreadPool(1, daemonThreadsNamed("raptor-cache-remover-%s"))); }
Source:
<code>private String getRootPath(String rootRamlFileUrl) { <START> List<String> urlSegments = Lists.newArrayList(rootRamlFileUrl.split("/")); <END> if (urlSegments.isEmpty()) { return ""; } urlSegments.remove(urlSegments.size() - 1); return StringUtils.join(urlSegments, "/"); }</code><technical_language>assuming path separator is '/'. I this work for URLs Unix file systems Windows FS</technical_language>

Target:
private String getRootPath(String rootRamlFileUrl) { final List<String> urlSegments = Splitter.on("/").splitToList(rootRamlFileUrl); if (urlSegments.isEmpty()) { return ""; } return Joiner.on("/").join(limit(urlSegments, urlSegments.size() - 1)); }
Source:
<code>public void launch() { entity.setAttribute(HazelcastNode.PID_FILE, Os.mergePathsUnix(getRunDir(), PID_FILENAME)); StringBuilder commandBuilder = new StringBuilder() <START> .append(format("nohup java -cp ./lib/hazelcast-%s.jar", getVersion())); <END> if (entity.getConfig(HazelcastNode.TEMPLATE_CONFIGURATION_URL) != null) { commandBuilder.append(" -Dhazelcast.config=" + Os.mergePaths(getRunDir(), "conf", getConfigFile())); } commandBuilder.append(" com.hazelcast.core.server.StartServer >> ./log/out.log 2>&1 </dev/null &"); newScript(MutableMap.of(USE_PID_FILE, true), LAUNCHING) .updateTaskAndFailOnNonZeroResultCode() .body.append(commandBuilder.toString()) .execute(); }</code><technical_language>This jar file is referred name in install() (as resolver.getFilename()), in customize() (again calling resolver.getFilename(), hazelcast-%s.jar. Suggest changing this name resolution technique install launch</technical_language>

Target:
public void launch() { entity.setAttribute(HazelcastNode.PID_FILE, Os.mergePathsUnix(getRunDir(), PID_FILENAME)); String maxHeapMemorySize = getHeapMemorySize(); if (LOG.isInfoEnabled()) { LOG.info("Launching with heap memory of {}", entity, maxHeapMemorySize); } String initialHeapMemorySize = maxHeapMemorySize; StringBuilder commandBuilder = new StringBuilder() .append(format("nohup java -cp ./lib/%s", resolver.getFilename())) .append(format(" -Xmx%s -Xms%s", maxHeapMemorySize, initialHeapMemorySize)) .append(format(" -Dhazelcast.config=./conf/%s", getConfigFileName())) .append(format(" com.hazelcast.core.server.StartServer >> %s 2>&1 </dev/null &", getLogFileLocation())); newScript(MutableMap.of(USE_PID_FILE, true), LAUNCHING) .updateTaskAndFailOnNonZeroResultCode() .body.append(commandBuilder.toString()) .execute(); }
Source:
<code><START> void printGitProperties() { <END> if (gitPropertiesPrinted) { return; } gitPropertiesPrinted = true; try (InputStream in = getClass().getResourceAsStream("/git.properties"); BufferedReader reader = new BufferedReader(new InputStreamReader(in)); ) { String line; while ((line = reader.readLine()) != null) { System.out.println(line); } } catch (IOException e) { System.out.println("IOException while reading git.properties: " + e.getMessage()); } }</code><technical_language>this method private? protected? I a need for package visibility</technical_language>

Target:
private void printGitProperties() { if (gitPropertiesPrinted) { return; } gitPropertiesPrinted = true; try (InputStream in = getClass().getResourceAsStream("/git.properties"); BufferedReader reader = new BufferedReader(new InputStreamReader(in)); ) { String line; while ((line = reader.readLine()) != null) { System.out.println(line); } } catch (IOException e) { System.out.println("IOException while reading git.properties: " + e.getMessage()); } }
Source:
<code>protected synchronized void modified(Map<String, Object> config) { final String language = toStringOrNull(config.get(LANGUAGE)); final String script = toStringOrNull(config.get(SCRIPT)); final String region = toStringOrNull(config.get(REGION)); final String variant = toStringOrNull(config.get(VARIANT)); final String location = toStringOrNull(config.get(LOCATION)); final String zoneId = toStringOrNull(config.get(TIMEZONE)); final String measurementSystem = toStringOrNull(config.get(MEASUREMENT_SYSTEM)); setTimeZone(zoneId); setLocation(location); setLocale(language, script, region, variant); setMeasurementSystem(measurementSystem); <START> logger.info("Locale set to {}, Location set to {}, Time zone set to {}", locale, this.location, this.timeZone); <END> }</code><technical_language>move this modified here</technical_language>

Target:
protected synchronized void modified(Map<String, Object> config) { final String language = toStringOrNull(config.get(LANGUAGE)); final String script = toStringOrNull(config.get(SCRIPT)); final String region = toStringOrNull(config.get(REGION)); final String variant = toStringOrNull(config.get(VARIANT)); final String location = toStringOrNull(config.get(LOCATION)); final String zoneId = toStringOrNull(config.get(TIMEZONE)); final String measurementSystem = toStringOrNull(config.get(MEASUREMENT_SYSTEM)); setTimeZone(zoneId); setLocation(location); setLocale(language, script, region, variant); setMeasurementSystem(measurementSystem); }
Source:
<code>private void parseProperties() { for(String arg : getPrefixArguments()) { Argument argument = new Argument(); argument.setName( getArgAttrValue(arg, "name") ); if (argument.getName() == null) { throw new IllegalArgumentException( String.format("Invalid configuration. Parameter '%1$s' has no name", arg) ); } argument.setMetavar( getArgAttrValue(arg, "metavar") ); argument.setHelp( getArgAttrValue(arg, "help") ); argument.setDefaultValue( getArgAttrValue(arg, "default") ); argument.setValue( getArgAttrValue(arg, "value") ); argument.setMultivalue( Boolean.parseBoolean( getArgAttrValue(arg, "multivalue") ) ); argument.setMandatory( Boolean.parseBoolean( getArgAttrValue(arg, "mandatory") ) ); argument.setType( Argument.Type.valueOfIgnoreCase( getArgAttrValue(arg, "type") ) ); argument.setMatcher( Pattern.compile( getArgAttrValue(arg, "matcher") ) ); try { argument.setValueType( Class.forName( getArgAttrValue(arg, "valuetype"), true, Thread.currentThread().getContextClassLoader() ) ); } catch (ClassNotFoundException ex) { throw new IllegalArgumentException( String.format("Can't convert argument: '%1$s'. Please check valuetype in properties file.", arg) ); } for(Map.Entry<String, String> constant : constants.entrySet()) { <START> if(argument.getDefaultValue() != null) { <END> argument.setDefaultValue( argument.getDefaultValue().replace(constant.getKey(), constant.getValue()) ); } } if (argument.isMandatory()) { mandatory.add(argument.getName()); } arguments.put(argument.getName(), argument); } }</code><technical_language>ask if default is null loop</technical_language>

Target:
private void parseProperties() { for(String arg : getPrefixArguments()) { Argument argument = new Argument(); argument.setName( getArgAttrValue(arg, "name") ); if (argument.getName() == null) { throw new IllegalArgumentException( String.format("Invalid configuration. Parameter '%1$s' has no name", arg) ); } argument.setMetavar( getArgAttrValue(arg, "metavar") ); argument.setHelp( getArgAttrValue(arg, "help") ); argument.setDefaultValue( getArgAttrValue(arg, "default") ); argument.setValue( getArgAttrValue(arg, "value") ); argument.setMultivalue( Boolean.parseBoolean( getArgAttrValue(arg, "multivalue") ) ); argument.setMandatory( Boolean.parseBoolean( getArgAttrValue(arg, "mandatory") ) ); argument.setType( Argument.Type.valueOfIgnoreCase( getArgAttrValue(arg, "type") ) ); argument.setMatcher( Pattern.compile( getArgAttrValue(arg, "matcher") ) ); try { argument.setValueType( Class.forName( getArgAttrValue(arg, "valuetype"), true, Thread.currentThread().getContextClassLoader() ) ); } catch (ClassNotFoundException ex) { throw new IllegalArgumentException( String.format("Can't convert argument: '%1$s'. Please check valuetype in properties file.", arg) ); } if (argument.isMandatory()) { mandatory.add(argument.getName()); } arguments.put(argument.getName(), argument); } }
Source:
<code>protected void configure(HttpSecurity http) throws Exception { http.csrf().disable(); http .authorizeRequests() .antMatchers("/admin resources/**").permitAll() .antMatchers("/js/toggle.js").permitAll() .anyRequest().authenticated() .and() .formLogin() .loginPage("/pages/Main.jsf") .loginProcessingUrl("/login") .defaultSuccessUrl("/pages/Main.jsf") .permitAll() .and() .logout() .logoutUrl("/logout") .logoutSuccessUrl("/pages/Main.jsf"); }</code><technical_language>Hard coded values bad. Is other archive this</technical_language>

Target:
protected void configure(HttpSecurity http) throws Exception { http.csrf().disable(); http .authorizeRequests() .antMatchers("/admin resources/**").permitAll() .antMatchers("/js/toggle.js").permitAll() .antMatchers("/pages/aktiveNutzer.jsf").permitAll() .anyRequest().authenticated() .and() .formLogin() .loginPage("/pages/Main.jsf") .loginProcessingUrl("/login") .defaultSuccessUrl("/pages/Main.jsf") .permitAll() .and() .logout() .logoutUrl("/logout") .logoutSuccessUrl("/pages/Main.jsf"); }
Source:
<code>public void setVisible(boolean visible) { if (!removed_ && visible != visible_) { visible_ = visible; handlers_.fireEvent(new VisibleChangedEvent(this)); } <START> if (Desktop.isDesktop()) <END> DesktopMenuCallback.setCommandVisible(id_, visible_); }</code><technical_language>AppCommand is supposed notify desktop state changes. This here: <LINK_0></technical_language>

Target:
public void setVisible(boolean visible) { if (!removed_ && visible != visible_) { visible_ = visible; handlers_.fireEvent(new VisibleChangedEvent(this)); } }
Source:
<code>private SafeHtml navigateDiff() { SafeHtmlBuilder b = new SafeHtmlBuilder(); if (Gerrit.isSignedIn() && DiffView.UNIFIED_DIFF.equals(Gerrit.getUserAccount() .getGeneralPreferences().getDiffView())) { b.openAnchor().setAttribute("title", <START> "Switch to Side-By-Side view") <END> .append("Side-by-Side").closeAnchor(); } else if (Gerrit.isSignedIn() && DiffView.SIDE_BY_SIDE.equals(Gerrit.getUserAccount() .getGeneralPreferences().getDiffView())) { b.openAnchor().setAttribute("title", "Switch to Unified view") .append("Unified").closeAnchor(); } return b; }</code><technical_language>a constant</technical_language>

Target:
private SafeHtml navigateDiff() { SafeHtmlBuilder b = new SafeHtmlBuilder(); if (Gerrit.isSignedIn()) { if (DiffView.UNIFIED_DIFF.equals(Gerrit.getUserAccount() .getGeneralPreferences().getDiffView())) { b.openAnchor().setAttribute("title", Util.C.sideBySideView()) .append("Side-by-Side").closeAnchor(); } else if (DiffView.SIDE_BY_SIDE.equals(Gerrit.getUserAccount() .getGeneralPreferences().getDiffView())) { b.openAnchor().setAttribute("title", Util.C.unifiedView()) .append("Unified").closeAnchor(); } } return b; }
Source:
<code>public void getExperimentAsUser(final String userId, final String problemId, final String sessionInfo, final MultiConnectionManager internalConnections) throws DatabaseAccessException { <START> LOG.info("Getting experiment for user: ", userId); <END> LOG.error("Problem: ", problemId); SubmissionManager.mongoGetExperiment(getInstance().database, userId, problemId, sessionInfo, internalConnections); }</code><technical_language>missing {}</technical_language>

Target:
public void getExperimentAsUser(final String userId, final String problemId, final String sessionInfo, final MultiConnectionManager internalConnections) throws DatabaseAccessException { LOG.debug("Getting experiment for user: {}", userId); LOG.info("Problem: {}", problemId); SubmissionManager.mongoGetExperiment(getInstance().database, userId, problemId, sessionInfo, internalConnections); }
Source:
<code>public boolean canConvert(final Class aClass) { <START> return aClass.equals(DMNExternalLink.class) || aClass.equals(TDMNExternalLink.class); <END> }</code><technical_language>please Objects.equals for comparing? throw exception if aClass is null</technical_language>

Target:
public boolean canConvert(final Class aClass) { return Objects.equals(aClass, DMNExternalLink.class) || Objects.equals(aClass, TDMNExternalLink.class); }
Source:
<code>public RealmObjectSchema setClassName(String className) { checkEmpty(className); <START> if (57 < className.length()) { <END> throw new IllegalArgumentException("Class name length exceeds 57 characters."); } String internalTableName = Table.TABLE_PREFIX + className; if (transaction.hasTable(internalTableName)) { throw new IllegalArgumentException("Class already exists: " + className); } String oldTableName = null; String pkField = null; if (table.hasPrimaryKey()) { oldTableName = table.getName(); pkField = getPrimaryKey(); table.setPrimaryKey(null); } transaction.renameTable(table.getName(), internalTableName); if (pkField != null && !pkField.isEmpty()) { try { table.setPrimaryKey(pkField); } catch (Exception e) { transaction.renameTable(table.getName(), oldTableName); throw e; } } return this; }</code><technical_language>throw core? I check in java</technical_language>

Target:
public RealmObjectSchema setClassName(String className) { checkEmpty(className); String internalTableName = Table.TABLE_PREFIX + className; if (internalTableName.length() > Table.TABLE_MAX_LENGTH) { throw new IllegalArgumentException("Class name is to long. Limit is 56 characters: \'" + className + "\' (" + Integer.toString(className.length()) + ")"); } if (transaction.hasTable(internalTableName)) { throw new IllegalArgumentException("Class already exists: " + className); } String oldTableName = null; String pkField = null; if (table.hasPrimaryKey()) { oldTableName = table.getName(); pkField = getPrimaryKey(); table.setPrimaryKey(null); } transaction.renameTable(table.getName(), internalTableName); if (pkField != null && !pkField.isEmpty()) { try { table.setPrimaryKey(pkField); } catch (Exception e) { transaction.renameTable(table.getName(), oldTableName); throw e; } } return this; }
Source:
<code>protected Mono<Void> handleMessageInternal(Message<?> message) { initStreamOperations(); if (!StringUtils.hasText(this.streamKey)) { this.streamKey = this.streamKeyExpression.getValue(this.evaluationContext, message, String.class); } Object value = message; if (this.extractPayload) { value = message.getPayload(); } <START> <END> ObjectRecord<String, Object> record = StreamRecords .<String, Object>objectBacked(value) .withStreamKey(this.streamKey); return this.reactiveStreamOperations.add(record); }</code><technical_language>Consider do this in onInit(). if is void method call, is a CPU tick single incoming message</technical_language>

Target:
protected Mono<Void> handleMessageInternal(Message<?> message) { String streamKey = this.streamKeyExpression.getValue(this.evaluationContext, message, String.class); Assert.notNull(streamKey, "'streamKey' must not be null"); Object value = message; if (this.extractPayload) { value = message.getPayload(); } ObjectRecord record = StreamRecords .objectBacked(value) .withStreamKey(streamKey); return this.reactiveStreamOperations.add(record); }
Source:
<code>public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) { ITypedRegion partition = null; IDocument document = viewer.getDocument(); try { partition = document.getPartition(offset); } catch (BadLocationException e1) { e1.printStackTrace(); } String prefix = ""; String prePrefix = ""; try { prefix = getPrefix(document, offset); prePrefix = getPrecedingToken(document, prefix, offset); } catch (BadLocationException e) { return NO_COMPLETIONS; } if (prePrefix.startsWith("probe")){ <START> return getProbeCompletionList(prefix, offset); <END> } if (partition.getType() == IDocument.DEFAULT_CONTENT_TYPE ){ return getGlobalKeywordCompletion(prefix, offset); } return NO_COMPLETIONS; }</code><technical_language>If prefix is invalid (e.g. "probe <invalid tapset><period>") a npe is thrown in STPMetadataSingleton#getProbeCompletionList (line 82 of this patch set), metadata map is returning null</technical_language>

Target:
public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) { return computeCompletionProposals(viewer.getDocument(), offset); }
Source:
<code>public void verifyCorrectService() { assertNotNull(homeDir); assertTrue(new Path(homeDir).toFile().exists()); String rtType = ParameterUtils.serverHomeToRuntimeType.get(homeDir); assertNotNull(rtType); IJBoss7ManagerService service = AS7ManagerTestUtils.findService(rtType); assertNotNull("Management Service for runtime type " + rtType + " not found.", service); IJBoss7ManagerService service2 = JBoss7ManagerUtil.getService(rtType); <START> assertNotNull("Management Service for runtime type " + rtType + " not found.", service); <END> assertTrue(service instanceof JBoss7ManagerServiceProxy); assertTrue(service instanceof ServiceTracker); Object o = ((ServiceTracker)service).getService(); assertNotNull(o); }</code><technical_language>wrong assertion, check service2</technical_language>

Target:
public void verifyCorrectService() { assertNotNull(homeDir); assertTrue(new Path(homeDir).toFile().exists()); String rtType = ParameterUtils.serverHomeToRuntimeType.get(homeDir); assertNotNull(rtType); IJBoss7ManagerService service = AS7ManagerTestUtils.findService(rtType); assertNotNull("Management Service for runtime type " + rtType + " not found.", service); IJBoss7ManagerService service2 = JBoss7ManagerUtil.getService(rtType); assertNotNull("Management Service for runtime type " + rtType + " not found.", service2); assertTrue(service instanceof JBoss7ManagerServiceProxy); assertTrue(service instanceof ServiceTracker); Object o = ((ServiceTracker)service).getService(); assertNotNull(o); }
Source:
<code>public void onReceive(Context context, Intent intent) { Intent service = new Intent(context, SwrveWakefulService.class); if(intent.hasExtra(SwrveWakefulService.EXTRA_EVENTS)) { ArrayList<String> events = intent.getExtras().getStringArrayList(SwrveWakefulService.EXTRA_EVENTS); SwrveLogger.i(LOG_TAG, "SwrveWakefulReceiver. Events: " + events); service.putExtras(intent); } if(intent.hasExtra(SwrveWakefulService.EXTRA_LOCATIONS_IMPRESSION_IDS)) { ArrayList<Integer> events = intent.getExtras().getIntegerArrayList(SwrveWakefulService.EXTRA_LOCATIONS_IMPRESSION_IDS); SwrveLogger.i(LOG_TAG, "SwrveWakefulReceiver. Location impression events: " + events); service.putExtras(intent); } if(intent.hasExtra(SwrveWakefulService.EXTRA_LOCATIONS_ENGAGED_IDS)) { ArrayList<Integer> events = intent.getExtras().getIntegerArrayList(SwrveWakefulService.EXTRA_LOCATIONS_ENGAGED_IDS); <START> SwrveLogger.i(LOG_TAG, "SwrveWakefulReceiver. Location engagement events: " + events); <END> service.putExtras(intent); } startWakefulService(context, service); }</code><technical_language>Do need EXTRA_LOCATIONS_IMPRESSION_IDS EXTRA_LOCATIONS_ENGAGED_IDS</technical_language>

Target:
public void onReceive(Context context, Intent intent) { Intent service = new Intent(context, SwrveWakefulService.class); if(intent.hasExtra(SwrveWakefulService.EXTRA_EVENTS)) { ArrayList<String> events = intent.getExtras().getStringArrayList(SwrveWakefulService.EXTRA_EVENTS); SwrveLogger.i(LOG_TAG, "SwrveWakefulReceiver. Events: " + events); service.putExtras(intent); } startWakefulService(context, service); }
Source:
<code>public void updateContext(JexlContext context, CollectionResource resource) { try { <START> ObjectName oname = new ObjectName(resource.getUnmodifiedInstance()); <END> context.set("ObjectName", oname); context.set("domain", oname.getDomain() == null ? "" : oname.getDomain()); oname.getKeyPropertyList().entrySet().forEach((entry) -> { final String value = entry.getValue(); if (value.startsWith(QUOTE) && value.endsWith(QUOTE)) { context.set(entry.getKey(), ObjectName.unquote(entry.getValue())); } else { context.set(entry.getKey(), entry.getValue()); } }); } catch (javax.management.MalformedObjectNameException e) { LOG.debug("getResourceNameFromIndex(): malformed object name: {}", resource.getInstance(), e); } }</code><technical_language>I thinking of inline cover this problem. i.e. test case fail if this line reverted</technical_language>

Target:
public void updateContext(JexlContext context, CollectionResource resource) throws IllegalArgumentException { try { ObjectName oname = new ObjectName(resource.getUnmodifiedInstance()); context.set("ObjectName", oname); context.set("domain", oname.getDomain() == null ? "" : oname.getDomain()); oname.getKeyPropertyList().entrySet().forEach((entry) -> { final String value = entry.getValue(); if (value.startsWith(QUOTE) && value.endsWith(QUOTE)) { context.set(entry.getKey(), ObjectName.unquote(entry.getValue())); } else { context.set(entry.getKey(), entry.getValue()); } }); } catch (javax.management.MalformedObjectNameException e) { final String msg = "Malformed ObjectName: " + resource.getUnmodifiedInstance(); LOG.error("getResourceNameFromIndex(): {}", msg, e); throw new IllegalArgumentException(msg); } }
Source:
<code>public Set<? extends Volume> findNonremovedVolumesWithNoOtherMounts(long instanceId) { List<VolumeRecord> vols = create() .selectDistinct(VOLUME.fields()) .from(MOUNT) .join(VOLUME) .on(VOLUME.ID.eq(MOUNT.VOLUME_ID).and(VOLUME.REMOVED.isNull())) <START> .where(MOUNT.VOLUME_ID.in( <END> create().select(MOUNT.VOLUME_ID).from(MOUNT).where(MOUNT.INSTANCE_ID.eq(instanceId)))) .groupBy(MOUNT.VOLUME_ID) .having(count(MOUNT.VOLUME_ID).eq(1).or(countDistinct(MOUNT.INSTANCE_ID).eq(1))) .fetchInto(VolumeRecord.class); Set<? extends Volume> volumes = new HashSet<Volume>(vols); return volumes; }</code><technical_language>a similar subselect in @alena1108's code (can't remember where), killed mysql. faster do select(), get result pass result in. This approach work fine long data set select typically smallish (less 100)</technical_language>

Target:
public Set<? extends Volume> findNonremovedVolumesWithNoOtherMounts(long instanceId) { List<Long> instanceVolumeIds = create() .select(MOUNT.VOLUME_ID) .from(MOUNT) .where(MOUNT.INSTANCE_ID.eq(instanceId)) .fetchInto(Long.class); List<Long> inelligibleVolumeIds = create() .select(MOUNT.VOLUME_ID) .from(MOUNT) .where(MOUNT.VOLUME_ID.in(instanceVolumeIds) .and(MOUNT.INSTANCE_ID.ne(instanceId)) .and(MOUNT.STATE.in(INELLIGIBLE_STATES))) .fetchInto(Long.class); Set<Long> volumeIds = new HashSet<Long>(instanceVolumeIds); volumeIds.removeAll(inelligibleVolumeIds); List<VolumeRecord> vols = create() .select(VOLUME.fields()) .from(VOLUME) .where(VOLUME.ID.in(volumeIds)) .and(VOLUME.REMOVED.isNull()) .fetchInto(VolumeRecord.class); Set<? extends Volume> volumes = new HashSet<Volume>(vols); return volumes; }
Source:
<code>private void updateCache(final Request req, final Response rsp) { if (rsp.headers().containsKey(this.scvh)) { this.cache.put(req, rsp); <START> } else { <END> this.cache.remove(req); } }</code><technical_language>@westonized task says: "Evict cache entry if If-Modified-Since request responded HTTP_OK code Last-Modified header". This suggest if conditions somewhere... is</technical_language>

Target:
private void updateCache(final Request req, final Response rsp) { if (rsp.headers().containsKey(this.scvh)) { this.cache.put(req, rsp); } else if (rsp.status() == HttpURLConnection.HTTP_OK) { this.cache.remove(req); } }
Source:
<code>void registerCustomInterceptor(@Observes ProcessAnnotatedType<SimpleBean> pat) { final AnnotatedType<SimpleBean> oldAnnotatedType = pat.getAnnotatedType(); AnnotatedType<SimpleBean> modifiedSimpleAnnotatedType = new ForwardingAnnotatedType<SimpleBean>() { private final AnnotationLiteral<Interceptors> interceptorsAnnotation = new InterceptorsLiteral(); @Override public AnnotatedType<SimpleBean> delegate() { return oldAnnotatedType; } @Override public Set<Annotation> getAnnotations() { Set<Annotation> annotations = new HashSet<Annotation>(); annotations.add(interceptorsAnnotation); return annotations; } @Override public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) { return Interceptors.class.equals(annotationType); <START> } <END> }; pat.setAnnotatedType(modifiedSimpleAnnotatedType); }</code><technical_language>This AnnotatedType implementation needs override method: getAnnotation(Class<T> annotationType); is a mismatch isAnnotationPresent() getAnnotation() returns</technical_language>

Target:
void registerCustomInterceptor(@Observes ProcessAnnotatedType<SimpleBean> pat) { final AnnotatedType<SimpleBean> oldAnnotatedType = pat.getAnnotatedType(); AnnotatedType<SimpleBean> modifiedSimpleAnnotatedType = new ForwardingAnnotatedType<SimpleBean>() { private final AnnotationLiteral<Interceptors> interceptorsAnnotation = new InterceptorsLiteral(); @Override public AnnotatedType<SimpleBean> delegate() { return oldAnnotatedType; } @Override public Set<Annotation> getAnnotations() { Set<Annotation> annotations = new HashSet<Annotation>(); annotations.add(interceptorsAnnotation); return annotations; } @SuppressWarnings("unchecked") @Override public <T extends Annotation> T getAnnotation(final Class<T> annType) { if (Interceptors.class.equals(annType)) { return (T) interceptorsAnnotation; } return null; } @Override public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) { return Interceptors.class.equals(annotationType); } }; pat.setAnnotatedType(modifiedSimpleAnnotatedType); }
Source:
<code>public void close() throws IOException { try (Closer closer = Closer.create()) { closer.register(super::close); <START> closer.register(s3::shutdown); <END> if (credentialsProvider instanceof Closeable) { closer.register((Closeable) credentialsProvider); } } }</code><technical_language>nit: s3 closed closing credentials providers (because a dependent resource), add closer</technical_language>

Target:
public void close() throws IOException { try (Closer closer = Closer.create()) { closer.register(super::close); if (credentialsProvider instanceof Closeable) { closer.register((Closeable) credentialsProvider); } closer.register(s3::shutdown); } }
Source:
<code>private Collection<CHGraphImpl> getAllCHGraphs() { List<CHGraphImpl> result = new ArrayList<>(); result.addAll(nodeBasedCHGraphs); <START> result.addAll(edgeBasedCHGraphs); <END> return result; }</code><technical_language>A minor optimization is create new ArrayList nodeBasedCHGraphs init size node+edge</technical_language>

Target:
private Collection<CHGraphImpl> getAllCHGraphs() { List<CHGraphImpl> result = new ArrayList<>(nodeBasedCHGraphs.size() + edgeBasedCHGraphs.size()); result.addAll(nodeBasedCHGraphs); result.addAll(edgeBasedCHGraphs); return result; }
Source:
<code>private void createChildren(CoreSession s, DocumentModel p, int depth) { if (depth > 0) { for (int i = 0; i < SIZE; i++) { DocumentModel child = s.createDocumentModel(p.getPathAsString(), p.getName() + "doc" + i, "ComplexDoc"); child.setProperty("dublincore", "modified", new Date()); child = s.createDocument(child); s.saveDocument(child); s.createProxy(child.getRef(), p.getRef()); <START> s.saveDocument(child); <END> DocumentModel folder = s.createDocumentModel(p.getPathAsString(), p.getName() + "folder" + i, "Folder"); folder = s.createDocument(folder); s.saveDocument(folder); createChildren(s, folder, depth - 1); } } }</code><technical_language>child need re-saved</technical_language>

Target:
private void createChildren(CoreSession s, DocumentModel p, int depth) { if (depth > 0) { for (int i = 0; i < SIZE; i++) { DocumentModel child = s.createDocumentModel(p.getPathAsString(), p.getName() + "doc" + i, "ComplexDoc"); child.setProperty("dublincore", "modified", new Date()); child = s.createDocument(child); s.createProxy(child.getRef(), p.getRef()); DocumentModel folder = s.createDocumentModel(p.getPathAsString(), p.getName() + "folder" + i, "Folder"); folder = s.createDocument(folder); createChildren(s, folder, depth - 1); } } }
Source:
<code>public void setSubordinateTransactionImporterClassName(String importerClassName) { synchronized(this) { if(importerClassName == null) { this.subordinateTransactionImporter = null; } else if(!importerClassName.equals(this.subordinateTransactionImporterClassName)) { <START> this.subordinateTransactionImporter = null; <END> } this.subordinateTransactionImporterClassName = importerClassName; } }</code><technical_language>need nulled if new values different? (which is simpler semantically identical): java if (!subordinateTransactionImporterClassName.equals(importerClassName)) subordinateTransactionImporter = null;</technical_language>

Target:
public void setSubordinateTransactionImporterClassName(String importerClassName) { synchronized(this) { if (!subordinateTransactionImporterClassName.equals(importerClassName)) { subordinateTransactionImporter = null; } if(importerClassName == null) { subordinateTransactionImporterClassName = defaultSubordinateTransactionImporterClassName; } else { subordinateTransactionImporterClassName = importerClassName; } } }
Source:
<code>public LabelTypes getLabelTypes() { String destBranch = getChange().getDest().get(); List<LabelType> all = getProjectControl().getLabelTypes().getLabelTypes(); List<LabelType> accessSectionsLabels = getRefControl().getLabelTypes().getLabelTypes(); List<LabelType> r = Lists.newArrayListWithCapacity(all.size()); for (LabelType l : all) { List<String> refs = l.getRefPatterns(); boolean branchSameAsAccess = l.branchSameAsAccess(); if <START> (refs == null && <END> !branchSameAsAccess) { r.add(l); } else { if (branchSameAsAccess) { if (accessSectionsLabels.contains(l)) { r.add(l); continue; } } if (refs != null) { for (String refPattern : refs) { if (RefConfigSection.isValid(refPattern) && match(destBranch, refPattern)) { r.add(l); break; } } } } } return new LabelTypes(r); }</code><technical_language>Is supposed some difference refs == null case refs.isEmpty() case? ProjectControl populated is empty, non-null list, is obvious in this portion of code</technical_language>

Target:
public LabelTypes getLabelTypes() { String destBranch = getChange().getDest().get(); List<LabelType> all = getProjectControl().getLabelTypes().getLabelTypes(); List<LabelType> accessSectionsLabels = getRefControl().getLabelTypes().getLabelTypes(); List<LabelType> r = Lists.newArrayListWithCapacity(all.size()); for (LabelType l : all) { List<String> refs = l.getRefPatterns(); boolean branchSameAsAccess = l.branchSameAsAccess(); if (((refs == null || refs.isEmpty()) && !branchSameAsAccess) || (branchSameAsAccess && accessSectionsLabels.contains(l))) { r.add(l); continue; } if (refs != null) { for (String refPattern : refs) { if (RefConfigSection.isValid(refPattern) && match(destBranch, refPattern)) { r.add(l); break; } } } } return new LabelTypes(r); }
Source:
<code>public void rowsCanBeReset() throws IOException { String rowKey = "row-1"; Chunk contentChunk = createContentChunk("Family1", "c1", randomBytes(10), 10L); Chunk contentChunk2 = createContentChunk("Family1", "c2", randomBytes(10), 100L); <START> Chunk rowResetChunk = Chunk.newBuilder().setResetRow(true).build(); <END> Chunk rowCompleteChunk = Chunk.newBuilder().setCommitRow(true).build(); ReadRowsResponse response = createReadRowsResponse(rowKey, contentChunk); ReadRowsResponse response2 = createReadRowsResponse(rowKey, rowResetChunk); ReadRowsResponse response3 = createReadRowsResponse(rowKey, contentChunk2); ReadRowsResponse response4 = createReadRowsResponse(rowKey, rowCompleteChunk); Iterator<ReadRowsResponse> iterator = getIterator(response, response2, response3, response4); Row resultRow = RowMerger.readNextRow(iterator); Assert.assertEquals(1, resultRow.getFamiliesCount()); Family resultFamily = resultRow.getFamilies(0); Assert.assertEquals("Family1", resultFamily.getName()); Assert.assertEquals(1, resultFamily.getColumnsCount()); Column resultColumn = resultFamily.getColumns(0); Assert.assertEquals(ByteString.copyFromUtf8("c2"), resultColumn.getQualifier()); Assert.assertFalse(iterator.hasNext()); }</code><technical_language>Sorry, do assert row is reset</technical_language>

Target:
public void rowsCanBeReset() throws IOException { String rowKey = "row-1"; ReadRowsResponse response = createReadRowsResponse(rowKey, Family1_c1_CHUNK); ReadRowsResponse response2 = createReadRowsResponse(rowKey, RESET_CHUNK); ReadRowsResponse response3 = createReadRowsResponse(rowKey, Family1_c2_CHUNK); ReadRowsResponse response4 = createReadRowsResponse(rowKey, COMPLETE_CHUNK); Iterator<ReadRowsResponse> iterator = getIterator(response, response2, response3, response4); Row resultRow = RowMerger.readNextRow(iterator); Assert.assertEquals(1, resultRow.getFamiliesCount()); Family resultFamily = resultRow.getFamilies(0); Assert.assertEquals("Family1", resultFamily.getName()); Assert.assertEquals(1, resultFamily.getColumnsCount()); Column resultColumn = resultFamily.getColumns(0); Assert.assertEquals(ByteString.copyFromUtf8("c2"), resultColumn.getQualifier()); Assert.assertFalse(iterator.hasNext()); }
Source:
<code>public boolean addNode(PlatformServer sender, String[] parents, String name, Serializable value) { LOGGER.trace("[{}] addNode({}, {})", consumerId, name, String.valueOf(value)); if (RELIABLE_CHANNEL_KEY.equals(name)) { if (value instanceof ManagementMessage) { fire((ManagementMessage) value); } else if (value != null) { <START> Utils.warnOrAssert(LOGGER, "[0] addNode(from={}) IGNORED: wrong get type: {}", value.getClass().getSimpleName()); <END> } } return false; }</code><technical_language>bad replacement</technical_language>

Target:
public boolean addNode(PlatformServer sender, String[] parents, String name, Serializable value) { LOGGER.trace("[{}] addNode({}, {})", consumerId, name, String.valueOf(value)); if (RELIABLE_CHANNEL_KEY.equals(name)) { if (value instanceof ManagementMessage) { fire((ManagementMessage) value); } else if (value != null) { Utils.warnOrAssert(LOGGER, "[0] addNode(from={}) IGNORED: wrong value type: {}", value.getClass().getSimpleName()); } } return false; }
Source:
<code>public void testTlsDefaults() throws Exception { CertStores serverCertStores = new CertStores(true, "server", "localhost"); CertStores clientCertStores = new CertStores(false, "client", "localhost"); Map<String, Object> sslClientConfigs = getTrustingConfig(clientCertStores, serverCertStores, tlsClientProtocols); Map<String, Object> sslServerConfigs = getTrustingConfig(serverCertStores, clientCertStores, tlsServerProtocols); NioEchoServer server = NetworkTestUtils.createEchoServer(ListenerName.forSecurityProtocol(SecurityProtocol.SSL), SecurityProtocol.SSL, new TestSecurityConfig(sslServerConfigs), null, TIME); Selector selector = createSelector(sslClientConfigs); String node = "0"; selector.connect(node, new InetSocketAddress("localhost", server.port()), BUFFER_SIZE, BUFFER_SIZE); <START> if (tlsServerProtocols.contains(tlsClientProtocols.get(0))) { <END> NetworkTestUtils.waitForChannelReady(selector, node); int msgSz = 1024 * 1024; String message = TestUtils.randomString(msgSz); selector.send(new NetworkSend(node, ByteBuffer.wrap(message.getBytes()))); while (selector.completedReceives().isEmpty()) { selector.poll(100L); } int totalBytes = msgSz + 4; server.waitForMetric("incoming-byte", totalBytes); server.waitForMetric("outgoing-byte", totalBytes); server.waitForMetric("request", 1); server.waitForMetric("response", 1); } else { NetworkTestUtils.waitForChannelClose(selector, node, ChannelState.State.AUTHENTICATION_FAILED); } }</code><technical_language>this check if intersection of server client protocols is empty</technical_language>

Target:
public void testTlsDefaults() throws Exception { CertStores serverCertStores = new CertStores(true, "server", "localhost"); CertStores clientCertStores = new CertStores(false, "client", "localhost"); Map<String, Object> sslClientConfigs = getTrustingConfig(clientCertStores, serverCertStores, clientProtocols); Map<String, Object> sslServerConfigs = getTrustingConfig(serverCertStores, clientCertStores, serverProtocols); NioEchoServer server = NetworkTestUtils.createEchoServer(ListenerName.forSecurityProtocol(SecurityProtocol.SSL), SecurityProtocol.SSL, new TestSecurityConfig(sslServerConfigs), null, TIME); Selector selector = createClientSelector(sslClientConfigs); String node = "0"; selector.connect(node, new InetSocketAddress("localhost", server.port()), BUFFER_SIZE, BUFFER_SIZE); if (isCompatible(serverProtocols, clientProtocols)) { NetworkTestUtils.waitForChannelReady(selector, node); int msgSz = 1024 * 1024; String message = TestUtils.randomString(msgSz); selector.send(new NetworkSend(node, ByteBuffer.wrap(message.getBytes()))); while (selector.completedReceives().isEmpty()) { selector.poll(100L); } int totalBytes = msgSz + 4; server.waitForMetric("incoming-byte", totalBytes); server.waitForMetric("outgoing-byte", totalBytes); server.waitForMetric("request", 1); server.waitForMetric("response", 1); } else { NetworkTestUtils.waitForChannelClose(selector, node, ChannelState.State.AUTHENTICATION_FAILED); server.verifyAuthenticationMetrics(0, 1); } }
Source:
<code>public void onModelBake(ModelBakeEvent event) { for (Entry<String, String[]> e : blockVariants.entrySet()) { for (String variant : e.getValue()) { ModelResourceLocation loc = new ModelResourceLocation(Info.MODID + ":" + e.getKey(), variant); <START> IModel bambooFrame = ModelLoaderRegistry.getModelOrLogError(loc, "Could not load arbitrary block variant " + variant + " for block " + e.getKey()); <END> event.getModelRegistry().putObject(loc, bambooFrame.bake(bambooFrame.getDefaultState(), DefaultVertexFormats.ITEM, ModelLoader.defaultTextureGetter())); } } }</code><technical_language>If this is a generic object call more generic bambooFrame</technical_language>

Target:
public void onModelBake(ModelBakeEvent event) { for (Entry<String, String[]> e : blockVariants.entrySet()) { for (String variant : e.getValue()) { ModelResourceLocation loc = new ModelResourceLocation(Info.MODID + ":" + e.getKey(), variant); IModel model = ModelLoaderRegistry.getModelOrLogError(loc, "Could not load arbitrary block variant " + variant + " for block " + e.getKey()); event.getModelRegistry().putObject(loc, model.bake(model.getDefaultState(), DefaultVertexFormats.ITEM, ModelLoader.defaultTextureGetter())); } } }
Source:
<code>public Person(String username, String password, String email, <START> int puzzle) { <END> user = new ParseUser(); user.setUsername(username); user.setPassword(password); user.setEmail(email); user.put("points", 0); user.put("levelAt", 1); user.put("stateAt", 0); user.put("puzzleID", puzzle); user.put("currentItem", "coffee"); user.put("currentIngredient", "water"); }</code><technical_language>I a puzzle parameter helpful puzzle item's ingredient</technical_language>

Target:
public Person(String username, String password, String email, int puzzle) { user = new ParseUser(); user.setUsername(username); user.setPassword(password); user.setEmail(email); user.put("points", 0); user.put("levelAt", 1); user.put("stateAt", 0); user.put("puzzleID", puzzle); user.put("currentItem", "coffee"); user.put("currentIngredient", "water"); ParseACL acl = new ParseACL(); acl.setPublicReadAccess(true); user.setACL(acl); }
Source:
<code>public void openSpecialPromoteOnCurrentWiki() { String url = getCurrentUrl(); <START> int indexStart = url.indexOf("wiki/"); <END> url = url.substring(0, indexStart); getUrl(url + URLsContent.specialPromote); PageObjectLogging.log("openSpecialPromote", "special promote page opened", true); }</code><technical_language>run this test www.wowwiki.com fail. is wgServer variable in this case, append Special:Promote path URL</technical_language>

Target:
public void openSpecialPromoteOnCurrentWiki() { JavascriptExecutor js = (JavascriptExecutor) driver; String url = (String) js.executeScript("return wgServer"); getUrl(url + "/" + URLsContent.specialPromote); PageObjectLogging.log("openSpecialPromote", "special promote page opened", true); }
Source:
<code>public static <E> ListDiff<E> createListDiff( final List<ListDiffEntry<E>> differences) { final ListDiffEntry<?>[] differencesArray <START> = <END> differences .toArray(new ListDiffEntry[differences.size()]); return new ListDiff<E>() { @Override public ListDiffEntry<?>[] getDifferences() { return differencesArray; } }; }</code><technical_language>break equal sign</technical_language>

Target:
public static <E> ListDiff<E> createListDiff(final List<ListDiffEntry<E>> differences) { final ListDiffEntry<E>[] differencesArray = differences.toArray(new ListDiffEntry[differences.size()]); return new ListDiff<E>() { @Override public ListDiffEntry<E>[] getDifferences() { return differencesArray; } }; }
Source:
<code>private Address findHostPhysicalAddress(String nodeAddress) { Address result = null; Transport t = cacheManager.getTransport(); if (t == null) { <START> result = cacheManager.getAddress(); <END> } else { for (Address add : t.getPhysicalAddresses()) { if (add.toString().contains(nodeAddress)) { result = add; break; } } } return result; }</code><technical_language>getAddress() implementation this returns null if Transport is null..</technical_language>

Target:
private Address findHostPhysicalAddress(String nodeAddress) { Address result = null; Transport t = cacheManager.getTransport(); if (t != null) { for (Address add : t.getPhysicalAddresses()) { if (add.toString().contains(nodeAddress)) { result = add; break; } } } return result; }
Source:
<code>public CProfilingTab() { super(); IExtensionPoint extPoint = Platform.getExtensionRegistry() .getExtensionPoint(LaunchUIPlugin.PLUGIN_ID, "profilingProvider"); IConfigurationElement[] configs = extPoint.getConfigurationElements(); for (IConfigurationElement config : configs) { if (config.getName().equals("provider")) { try { Object obj = config .createExecutableExtension("tab"); <START> if (obj instanceof ILaunchConfigurationTab) { <END> tab = (ILaunchConfigurationTab)obj; break; } } catch (CoreException e) { } } } }</code><technical_language>expecting more ILaunchConfigurationTab? exsd file mentions get CLaunchConfigurationTab, I AbstractLaunchConfigurationTab</technical_language>

Target:
public CProfilingTab() { super(); IExtensionPoint extPoint = Platform.getExtensionRegistry() .getExtensionPoint(LaunchUIPlugin.PLUGIN_ID, "profilingProvider"); IConfigurationElement[] configs = extPoint.getConfigurationElements(); for (IConfigurationElement config : configs) { if (config.getName().equals("provider")) { try { Object obj = config .createExecutableExtension("tabDelegate"); if (obj instanceof AbstractLaunchConfigurationTab) { tabDelegate = (AbstractLaunchConfigurationTab)obj; break; } } catch (CoreException e) { } } } }
Source:
<code>public ZonedDateTime getExceptionTimestamp() { <START> return exceptionMoment.atZone(getConfig(Time.class).getClock().getZone()); <END> }</code><technical_language>This a NPE if exceptionMoment set yet</technical_language>

Target:
public ZonedDateTime getExceptionTimestamp() { return exceptionMoment == null ? null : exceptionMoment.atZone(getConfig(Time.class).getClock().getZone()); }
Source:
<code>protected List<String> listFiles() { GetImagesListParameters queryParams = new GetImagesListParameters(asGuid(storageDomainId), ImageFileType.All); queryParams.setForceRefresh(true); List<RepoImage> files = getBackendCollection(RepoImage.class, VdcQueryType.GetImagesList, queryParams); return <START> files.stream().map(RepoImage::getRepoImageId).collect(Collectors.toList()); <END> }</code><technical_language>Static import of Collectors.toList nicer</technical_language>

Target:
protected List<String> listFiles() { GetImagesListParameters queryParams = new GetImagesListParameters(asGuid(storageDomainId), ImageFileType.All); queryParams.setForceRefresh(true); List<RepoImage> files = getBackendCollection(RepoImage.class, VdcQueryType.GetImagesList, queryParams); return files.stream().map(RepoImage::getRepoImageId).collect(toList()); }
Source:
<code>public boolean isVf() { <START> return vf; <END> }</code><technical_language>I 'vf' data meber is redundant. 'isVf()' method return- physicalFunction != null</technical_language>

Target:
public boolean isVf() { return physicalFunction != null; }
Source:
<code>public Map<String, String> getEnvironment() { Map<String, String> envs = new HashMap(super.getEnvironment()); if (java != null) { if (envs.containsKey(JAVA_HOME)) { log.warn("Overwriting " + JAVA_HOME + ": " + envs.get(JAVA_HOME) + " with " + java); } envs.put(JAVA_HOME, java); } overwriteJavaOpts(envs, javaOpts); if (flightRecorder.isEnabled()) { List<String> flightRecorderArgs = new ArrayList<>(1); flightRecorder.setArgs(flightRecorderArgs); StringBuilder flightRecorderArgBuilder = new StringBuilder(); flightRecorderArgs.forEach(arg -> { flightRecorderArgBuilder.append(arg).append(" "); }); <START> overwriteJavaOpts(envs, flightRecorderArgBuilder.toString()); <END> } return envs; }</code><technical_language>This adding flight recorder overrides javaOpts parameter. Please add instead (don't worry duplicate args here). javaOpts overwrites JAVA_OPTS env var a do thing</technical_language>

Target:
public Map<String, String> getEnvironment() { Map<String, String> envs = new HashMap(super.getEnvironment()); if (java != null) { if (envs.containsKey(JAVA_HOME)) { log.warn("Overwriting " + JAVA_HOME + ": " + envs.get(JAVA_HOME) + " with " + java); } envs.put(JAVA_HOME, java); } if (javaOpts != null) { if (envs.containsKey(JAVA_OPTS)) { log.warn("Overwriting " + JAVA_OPTS + ": " + envs.get(JAVA_OPTS) + " with " + javaOpts); } envs.put(JAVA_OPTS, javaOpts); } if (flightRecorder.isEnabled()) { List<String> flightRecorderArgs = new ArrayList<>(1); flightRecorder.setArgs(flightRecorderArgs); StringBuilder flightRecorderArgBuilder = new StringBuilder(); flightRecorderArgs.forEach(arg -> flightRecorderArgBuilder.append(arg).append(" ")); appendJavaOpts(envs, flightRecorderArgBuilder); } return envs; }
Source:
<code>public boolean hasEnforcedAppVersion(){ <START> return this.enforcedAppVersion !=0; <END> }</code><technical_language>This right. enforcedAppVersion is Integer, default is null, assumption is zero in a default setting</technical_language>

Target:
public boolean hasEnforcedAppVersion() { return this.enforcedAppVersion > 0; }
Source:
<code>public static void set(Header header, String value) { <START> set(header.toString(), value); <END> }</code><technical_language>toString() result in .getHeader()</technical_language>

Target:
public static void set(Header header, String value) { set(header.getHeader(), value); }
Source:
<code>private static Object nullSafeGet(Optional<?> optional) { <START> return optional.isPresent() ? optional.orElse(null) : null; <END> }</code><technical_language>This change breaks null-safety. null.isPresent() crash burn</technical_language>

Target:
private static Object nullSafeGet(Optional<?> optional) { return optional != null ? optional.orElse(null) : null; }
Source:
<code>public List<Kind> nodesToVisit() { <START> return ImmutableList.of(Kind.METHOD); <END> }</code><technical_language>I Tree.Kind.Method in order avoid import of org.sonar.plugins.java.api.tree.Tree.Kind (L#30)</technical_language>

Target:
public List<Tree.Kind> nodesToVisit() { return ImmutableList.of(Tree.Kind.METHOD); }