auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void test_tokens() { TestPythonCheck check = new TestPythonCheck() { <START> private List<Token> ignoreList; <END> @Override public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.FILE_INPUT, ctx -> { ignoreList = new ArrayList<>(); }); context.registerSyntaxNodeConsumer(Tree.Kind.TOKEN, ctx -> { PyToken pyToken = (PyToken) ctx.syntaxNode(); if (ignoreList.contains(pyToken.token())) { return; } ignoreList.add(pyToken.token()); for (Trivia trivia : pyToken.trivia()) { if (trivia.isComment()) { ctx.addIssue(new PyTokenImpl(trivia.getToken()), MESSAGE); } } }); } }; List<PreciseIssue> issues = scanFileForIssues(FILE, check); assertThat(issues).hasSize(1); assertThat(issues.get(0).primaryLocation().startLine()).isEqualTo(5); assertThat(issues.get(0).primaryLocation().endLine()).isEqualTo(5); }</code><technical_language>remark, SSLR token leak PyToken api. IMO mark token() method in PyToken deprecated : this method is for issue location in checks leak SSLR API in checks</technical_language>

Target:
public void test_tokens() { TestPythonCheck check = new TestPythonCheck() { @Override public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.TOKEN, ctx -> { Token pyToken = (Token) ctx.syntaxNode(); if (pyToken.value().equals("def")) { ctx.addIssue(pyToken, MESSAGE); } }); } }; List<PreciseIssue> issues = scanFileForIssues(FILE, check); assertThat(issues).hasSize(2); assertThat(issues.get(0).primaryLocation().startLine()).isEqualTo(1); assertThat(issues.get(1).primaryLocation().startLine()).isEqualTo(7); }
Source:
<code>public void getParameterName_NewAnnotation() throws NoSuchMethodException { <START> String actualResult = getParameterNameWithMethodNameAndParamIndex(TEST_METHOD_6, FIRST_INDEX); <END> assertEquals(SECOND_NAME_PARAM_ANNOTATION, actualResult); }</code><technical_language>Abbreviation for variable name: Result -> res. abbreviation rules</technical_language>

Target:
public void getParameterName_NewAnnotation() throws NoSuchMethodException { String actualRes = getParameterNameWithMethodNameAndParamIndex(TEST_METHOD_6, FIRST_INDEX); assertEquals(SECOND_NAME_PARAM_ANNOTATION, actualRes); }
Source:
<code>private void updateCommitButtons() { <START> final IndexDiffData indexDiff = doReload(currentRepository); <END> boolean indexDiffAvailable = indexDiffAvailable(indexDiff); boolean noConflicts = noConflicts(indexDiff); boolean hasErrorsOrWarnings = hasErrorsOrWarnings(); boolean commitEnabled = commitEnabled(indexDiffAvailable, noConflicts, hasErrorsOrWarnings); boolean commitAndPushEnabled = commitAndPushEnabled(commitEnabled); commitButton.setEnabled(commitEnabled); commitAndPushButton.setEnabled(commitAndPushEnabled); }</code><technical_language>doReload() more want here. pass cacheEntry.getIndexDiff() argument this method (if cacheEntry exists of course). I prefer code in job started reload() method re-uses this method update commit buttons</technical_language>

Target:
private void updateCommitButtons() { IndexDiffData indexDiff; if (cacheEntry != null) { indexDiff = cacheEntry.getIndexDiff(); } else { indexDiff = doReload(currentRepository); } boolean indexDiffAvailable = indexDiffAvailable(indexDiff); boolean noConflicts = noConflicts(indexDiff); boolean hasErrorsOrWarnings = hasErrorsOrWarnings(); boolean commitEnabled = commitEnabled(indexDiffAvailable, noConflicts, hasErrorsOrWarnings); boolean commitAndPushEnabled = commitAndPushEnabled(commitEnabled); commitButton.setEnabled(commitEnabled); commitAndPushButton.setEnabled(commitAndPushEnabled); }
Source:
<code><START> private void listenToSetDnsConfigurationCheckboxChanges() { <END> Event<EventArgs> entityChangedEvent = setDnsConfiguration.getEntityChangedEvent(); entityChangedEvent.clearListeners(); entityChangedEvent.addListener(new IEventListener<EventArgs>() { @Override public void eventRaised(Event<? extends EventArgs> ev, Object sender, EventArgs args) { nameServerModelListModel.setIsChangeable(setDnsConfiguration.getEntity()); } }); }</code><technical_language>I is need re-register listener entity assignment field setDnsConfiguration is final. clearing listeners omited</technical_language>

Target:
private void listenToSetDnsConfigurationCheckboxChanges() { Event<EventArgs> entityChangedEvent = shouldSetDnsConfiguration.getEntityChangedEvent(); entityChangedEvent.addListener(new IEventListener<EventArgs>() { @Override public void eventRaised(Event<? extends EventArgs> ev, Object sender, EventArgs args) { nameServerModelListModel.setIsChangeable(shouldSetDnsConfiguration.getEntity()); } }); }
Source:
<code>@Test void testSortCalcWhenCastLeadingToMonotonic() { <START> final String sql = "select deptno from sales.emp order by cast(deptno as float) desc"; <END> Query.create(sql) .addRule(ProjectToCalcRule.INSTANCE) .addRule(EnumerableRules.ENUMERABLE_CALC_RULE) .removeRule(EnumerableRules.ENUMERABLE_SORT_RULE) .removeRule(EnumerableRules.ENUMERABLE_PROJECT_RULE) .check(); }</code><technical_language>I I a mistake tests. improve readability, do select cast(deptno float) sales.emp order deptno desc. queries testing thing</technical_language>

Target:
@Test void testSortCalcWhenCastLeadingToMonotonic() { final String sql = "select cast(deptno as float) from sales.emp order by deptno desc"; Query.create(sql) .addRule(ProjectToCalcRule.INSTANCE) .addRule(EnumerableRules.ENUMERABLE_CALC_RULE) .removeRule(EnumerableRules.ENUMERABLE_SORT_RULE) .removeRule(EnumerableRules.ENUMERABLE_PROJECT_RULE) .check(); }
Source:
<code>private Properties streamsConfiguration() { final String safeTestName = safeUniqueTestName(getClass(), testName); final Properties config = new Properties(); config.put(StreamsConfig.TOPOLOGY_OPTIMIZATION, StreamsConfig.OPTIMIZE); config.put(StreamsConfig.APPLICATION_ID_CONFIG, "app-" + safeTestName); config.put(StreamsConfig.APPLICATION_SERVER_CONFIG, "localhost:" + (++port)); config.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, cluster.bootstrapServers()); config.put(StreamsConfig.STATE_DIR_CONFIG, TestUtils.tempDirectory().getPath()); config.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.Integer().getClass()); config.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.Integer().getClass()); config.put(StreamsConfig.NUM_STANDBY_REPLICAS_CONFIG, 1); config.put(ConsumerConfig.MAX_POLL_RECORDS_CONFIG, 100); config.put(ConsumerConfig.HEARTBEAT_INTERVAL_MS_CONFIG, 200); config.put(ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG, 1000); config.put(StreamsConfig.COMMIT_INTERVAL_MS_CONFIG, 100); <START> config.put(StreamsConfig.NUM_STREAM_THREADS_CONFIG, 2); <END> return config; }</code><technical_language>write a proper test case instead of "piggy-backing" existing test</technical_language>

Target:
private Properties streamsConfiguration() { final String safeTestName = safeUniqueTestName(getClass(), testName); final Properties config = new Properties(); config.put(StreamsConfig.TOPOLOGY_OPTIMIZATION, StreamsConfig.OPTIMIZE); config.put(StreamsConfig.APPLICATION_ID_CONFIG, "app-" + safeTestName); config.put(StreamsConfig.APPLICATION_SERVER_CONFIG, "localhost:" + (++port)); config.put(StreamsConfig.BOOTSTRAP_SERVERS_CONFIG, cluster.bootstrapServers()); config.put(StreamsConfig.STATE_DIR_CONFIG, TestUtils.tempDirectory().getPath()); config.put(StreamsConfig.DEFAULT_KEY_SERDE_CLASS_CONFIG, Serdes.Integer().getClass()); config.put(StreamsConfig.DEFAULT_VALUE_SERDE_CLASS_CONFIG, Serdes.Integer().getClass()); config.put(StreamsConfig.NUM_STANDBY_REPLICAS_CONFIG, 1); config.put(ConsumerConfig.MAX_POLL_RECORDS_CONFIG, 100); config.put(ConsumerConfig.HEARTBEAT_INTERVAL_MS_CONFIG, 200); config.put(ConsumerConfig.SESSION_TIMEOUT_MS_CONFIG, 1000); config.put(StreamsConfig.COMMIT_INTERVAL_MS_CONFIG, 100); return config; }
Source:
<code>public Timer setDelay(long delay, TimeUnit timeUnit) { if (delay < 0) { throw new IllegalArgumentException("Delay must be greater than zero"); } long millis = timeUnit.toMillis(delay); int factor = ConfigurationFactory.get().getTestTimeoutFactor(); <START> <END> if (factor == 100) { this.delay = millis; } else { long numerator = millis * factor; if (numerator % 100 == 0) { this.delay = numerator / 100; } else { this.delay = (numerator / 100) + 1; } } return this; }</code><technical_language>Instead of rows 100 - 109 I prefer this: -> this.delay = Math.round(millis \* factor / 100.0); another option: this.delay = millis \* factor / 100 + 1; 1 millisecond difference ;) exact effect original code's achieved using: this.delay = (millis \* factor - 1)/ 100 + 1;</technical_language>

Target:
public Timer setDelay(long delay, TimeUnit timeUnit) { if (delay <= 0) { throw new IllegalArgumentException("Delay must be greater than zero"); } this.delay = (timeUnit.toMillis(delay) * ConfigurationFactory.get().getTestTimeoutFactor() -1) / 100 + 1; return this; }
Source:
<code>public static File writeToTempFile(InputStream is, String prefix, String suffix) { File tmpWarFile; try { tmpWarFile = File.createTempFile(prefix, suffix); } catch (IOException e) { throw Throwables.propagate(e); } tmpWarFile.deleteOnExit(); OutputStream out = null; try { <START> if (is == null) throw new NullPointerException(); <END> out = new FileOutputStream(tmpWarFile); ByteStreams.copy(is, out); } catch (IOException e) { throw Throwables.propagate(e); } finally { Closeables.closeQuietly(is); Closeables.closeQuietly(out); } return tmpWarFile; }</code><technical_language>do checkNotNull(is, "is") start of method, creating temporary file</technical_language>

Target:
public static File writeToTempFile(InputStream is, String prefix, String suffix) { if (is == null) throw new NullPointerException("Input stream required to create temp file for "+prefix+"*"+suffix); File tempFile; try { tempFile = File.createTempFile(prefix, suffix); } catch (IOException e) { throw Throwables.propagate(e); } tempFile.deleteOnExit(); OutputStream out = null; try { out = new FileOutputStream(tempFile); ByteStreams.copy(is, out); } catch (IOException e) { throw Throwables.propagate(e); } finally { Closeables.closeQuietly(is); Closeables.closeQuietly(out); } return tempFile; }
Source:
<code>public static <V extends View<GenericData.Record>> V load(URI uri) { <START> return Datasets.<GenericData.Record, V>load(uri, GenericData.Record.class); <END> }</code><technical_language>I assume explicit type is required satisfy OpenJDK6 travis</technical_language>

Target:
public static <V extends View<GenericRecord>> V load(URI uri) { return Datasets.<GenericRecord, V>load(uri, GenericRecord.class); }
Source:
<code><START> private Diff findMasterEquivalence(Diff diff, boolean mergeRightToLeft) { <END> Diff masterDiff; final List<Diff> equivalentDiffs = diff.getEquivalence().getDifferences(); final Optional<Diff> firstConflicting = Iterables.tryFind(equivalentDiffs, hasConflict(ConflictKind.REAL)); if (diff instanceof ReferenceChange) { final ReferenceChange referenceChange = (ReferenceChange)diff; masterDiff = getMasterEquivalenceForReferenceChange(referenceChange, mergeRightToLeft); } else if (diff instanceof FeatureMapChange) { final FeatureMapChange featureMapChange = (FeatureMapChange)diff; masterDiff = getMasterEquivalenceForFeatureMapChange(featureMapChange, mergeRightToLeft); } else { masterDiff = null; } if (!hasRealConflict(masterDiff)) { if (hasRealConflict(diff)) { masterDiff = null; } else if (firstConflicting.isPresent()) { masterDiff = firstConflicting.get(); } } return masterDiff; }</code><technical_language>This variable remain final</technical_language>

Target:
private Diff findMasterEquivalence(Diff diff, boolean mergeRightToLeft) { final List<Diff> equivalentDiffs = diff.getEquivalence().getDifferences(); final Optional<Diff> firstConflicting = Iterables.tryFind(equivalentDiffs, hasConflict(ConflictKind.REAL)); final Diff idealMasterDiff; if (diff instanceof ReferenceChange) { final ReferenceChange referenceChange = (ReferenceChange)diff; idealMasterDiff = getMasterEquivalenceForReferenceChange(referenceChange, mergeRightToLeft); } else if (diff instanceof FeatureMapChange) { final FeatureMapChange featureMapChange = (FeatureMapChange)diff; idealMasterDiff = getMasterEquivalenceForFeatureMapChange(featureMapChange, mergeRightToLeft); } else { idealMasterDiff = null; } final Diff masterDiff; if (firstConflicting.isPresent() && !hasRealConflict(idealMasterDiff)) { if (hasRealConflict(diff)) { masterDiff = null; } else { masterDiff = firstConflicting.get(); } } else { masterDiff = idealMasterDiff; } return masterDiff; }
Source:
<code>public void setTechOfficer(Person p) { <START> setTechOfficer(Objects.requireNonNull(p), false); <END> }</code><technical_language>this duplicate nonNull check</technical_language>

Target:
public void setTechOfficer(Person p) { setTechOfficer(p, false); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setTitle(R.string.announcement_title); <START> <END> setApplyPrevTransitionOnRestart(true); bundle = getIntent().getBundleExtra(Router.EXTRA_BUNDLE); offlineBar = findViewById(R.id.offline_bar); if (!(NetworkUtil.isConnected(this))) { AppConstants.offline_flag = true; invalidateOptionsMenu(); if(offlineBar!=null){ offlineBar.setVisibility(View.VISIBLE); } } try{ EnrolledCoursesResponse courseData = (EnrolledCoursesResponse) bundle .getSerializable(Router.EXTRA_ENROLLMENT); if ( courseData != null ) { activityTitle = courseData.getCourse().getName(); try{ environment.getSegment().screenViewsTracking(courseData.getCourse().getName()); }catch(Exception e){ logger.error(e); } } else { boolean handleFromNotification = handleIntentFromNotification(); if (!handleFromNotification) { environment.getRouter().showMyCourses(this); finish(); } } }catch(Exception ex){ environment.getRouter().showMyCourses(this); finish(); logger.error(ex); } }</code><technical_language>This changed in label attribute in manifest entry for this Activity, instead of dynamically setting it</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setApplyPrevTransitionOnRestart(true); bundle = getIntent().getBundleExtra(Router.EXTRA_BUNDLE); offlineBar = findViewById(R.id.offline_bar); if (!(NetworkUtil.isConnected(this))) { AppConstants.offline_flag = true; invalidateOptionsMenu(); if(offlineBar!=null){ offlineBar.setVisibility(View.VISIBLE); } } try{ EnrolledCoursesResponse courseData = (EnrolledCoursesResponse) bundle .getSerializable(Router.EXTRA_ENROLLMENT); if ( courseData != null ) { activityTitle = courseData.getCourse().getName(); try{ environment.getSegment().screenViewsTracking(courseData.getCourse().getName()); }catch(Exception e){ logger.error(e); } } else { boolean handleFromNotification = handleIntentFromNotification(); if (!handleFromNotification) { environment.getRouter().showMyCourses(this); finish(); } } }catch(Exception ex){ environment.getRouter().showMyCourses(this); finish(); logger.error(ex); } }
Source:
<code>public void removeCron(String id) { try { quartzSched.deleteJob(new JobKey(id, "note")); } catch (SchedulerException e) { logger.error("Can't remove quertz " + id, e); } Note notebook = getNote(id); Map<String, Object> config = notebook.getConfig(); <START> config.put("cron", null); <END> }</code><technical_language>is note run if quartzSched.deleteJob is called</technical_language>

Target:
public void removeCron(String id) { try { quartzSched.deleteJob(new JobKey(id, "note")); } catch (SchedulerException e) { logger.error("Can't remove quertz " + id, e); } }
Source:
<code>public static void invokeFor(Object target, Message eventMessage, EventContext context) { checkNotNull(target); checkNotNull(eventMessage); checkNotNull(context); try { final EventSubscriberMethod method = getMethod(target.getClass(), eventMessage); method.invoke(target, eventMessage, context); <START> } catch (RuntimeException e) { <END> log().error("Exception handling event. Event message: {}, context: {}, cause: {}", eventMessage, context, e.getCause()); } }</code><technical_language>this. catching suppose handle this level? discuss tomorrow in person</technical_language>

Target:
public static void invokeFor(Object target, Message eventMessage, EventContext context) { checkNotNull(target); checkNotNull(eventMessage); checkNotNull(context); final EventSubscriberMethod method = getMethod(target.getClass(), eventMessage); method.invoke(target, eventMessage, context); }
Source:
<code>private PutStatus silentPut(final K key, final V value) throws StoreAccessException { try { PutOperation<K, V> operation = new PutOperation<K, V>(key, value, timeSource.getTimeMillis()); ByteBuffer payload = codec.encode(operation); Chain chain = storeProxy.getAndAppend(key.hashCode(), payload); ResolvedChain<K, V> resolvedChain = resolver.resolve(chain, key, timeSource.getTimeMillis()); if(resolvedChain.getResolvedResult(key) == null) { return PutStatus.PUT; } else { return PutStatus.UPDATE; } } catch (RuntimeException re) { handleRuntimeException(re); <START> return null; <END> } }</code><technical_language>bizzare sound, I return PutStatus.NOOP here. This zero difference runtime code checkers understand this method return null</technical_language>

Target:
private PutStatus silentPut(final K key, final V value) throws StoreAccessException { try { PutOperation<K, V> operation = new PutOperation<K, V>(key, value, timeSource.getTimeMillis()); ByteBuffer payload = codec.encode(operation); Chain chain = storeProxy.getAndAppend(key.hashCode(), payload); ResolvedChain<K, V> resolvedChain = resolver.resolve(chain, key, timeSource.getTimeMillis()); if(resolvedChain.getResolvedResult(key) == null) { return PutStatus.PUT; } else { return PutStatus.UPDATE; } } catch (RuntimeException re) { handleRuntimeException(re); return PutStatus.NOOP; } }
Source:
<code>protected void processCommunication(String tenantId, TraceCompletionInformation item, Communication c, CommunicationDetails cd) { long targetFragmentBaseDuration = c.getBaseDuration() + cd.getLatency(); long durationWithTargetFragment = targetFragmentBaseDuration + cd.getTargetFragmentDuration(); if (durationWithTargetFragment > item.getCompletionTime().getDuration()) { item.getCompletionTime().setDuration(durationWithTargetFragment); } if (!cd.getProperties().isEmpty()) { item.getCompletionTime().getProperties().addAll(cd.getProperties()); } for (int j = 0; j < cd.getOutbound().size(); j++) { CommunicationDetails.Outbound ob = cd.getOutbound().get(j); Communication newc = new Communication(); newc.setIds(ob.getLinkIds()); newc.setMultipleConsumers(ob.isMultiConsumer()); newc.setBaseDuration(targetFragmentBaseDuration + ob.getProducerOffset()); <START> long baseTimeStamp = TimeUnit.MICROSECONDS.toMillis(ob.isMultiConsumer() ? <END> cd.getTimestamp() : TimeUnit.MILLISECONDS.toMicros(System.currentTimeMillis())); newc.setExpire(baseTimeStamp + Communication.DEFAULT_EXPIRY_WINDOW_MILLIS); if (log.isLoggable(Level.FINEST)) { log.finest("Completion info " + item + ": new communication = " + newc); } item.getCommunications().add(newc); } }</code><technical_language>this long baseTimeStamp = ob.isMultiConsumer() ? TimeUnit.MICROSECONDS.toMillis(cd.getTimestamp()) : System.currentTimeMillis()</technical_language>

Target:
protected void processCommunication(String tenantId, TraceCompletionInformation item, Communication c, CommunicationDetails cd) { long targetFragmentBaseDuration = c.getBaseDuration() + cd.getLatency(); long durationWithTargetFragment = targetFragmentBaseDuration + cd.getTargetFragmentDuration(); if (durationWithTargetFragment > item.getCompletionTime().getDuration()) { item.getCompletionTime().setDuration(durationWithTargetFragment); } if (!cd.getProperties().isEmpty()) { item.getCompletionTime().getProperties().addAll(cd.getProperties()); } for (int j = 0; j < cd.getOutbound().size(); j++) { CommunicationDetails.Outbound ob = cd.getOutbound().get(j); Communication newc = new Communication(); newc.setIds(ob.getLinkIds()); newc.setMultipleConsumers(ob.isMultiConsumer()); newc.setBaseDuration(targetFragmentBaseDuration + ob.getProducerOffset()); long baseTimeStamp = ob.isMultiConsumer() ? TimeUnit.MICROSECONDS.toMillis(cd.getTimestamp()) : System.currentTimeMillis(); newc.setExpire(baseTimeStamp + Communication.DEFAULT_EXPIRY_WINDOW_MILLIS); if (log.isLoggable(Level.FINEST)) { log.finest("Completion info " + item + ": new communication = " + newc); } item.getCommunications().add(newc); } }
Source:
<code>private Region3i getBuildingExtents(BuildingType buildingType, Region3i region) { Prefab buildingPrefab; switch (buildingType) { case Diner: <START> buildingPrefab = prefabManager.getPrefab("MasterOfOreon:inn"); <END> break; default: buildingPrefab = prefabManager.getPrefab("MasterOfOreon:storage"); } SpawnBlockRegionsComponent blockRegionsComponent = buildingPrefab.getComponent(SpawnBlockRegionsComponent.class); List<SpawnBlockRegionsComponent.RegionToFill> regionsToFill = blockRegionsComponent.regionsToFill; int minX = Integer.MAX_VALUE; int maxX = Integer.MIN_VALUE; int minZ = Integer.MAX_VALUE; int maxZ = Integer.MIN_VALUE; for (SpawnBlockRegionsComponent.RegionToFill regionToFill : regionsToFill) { minX = Math.min(minX, regionToFill.region.minX()); maxX = Math.max(maxX, regionToFill.region.maxX()); minZ = Math.min(minZ, regionToFill.region.minZ()); maxZ = Math.max(maxZ, regionToFill.region.maxZ()); } Vector3f center = region.center(); Vector3f extents = new Vector3f((maxX - minX) / 2, 0, (maxZ - minZ) / 2); return Region3i.createFromCenterExtents(center, extents); }</code><technical_language>this a constant</technical_language>

Target:
private Region3i getBuildingExtents(BuildingType buildingType, Region3i region) { Prefab buildingPrefab; switch (buildingType) { case Diner: buildingPrefab = prefabManager.getPrefab(Constants.DINER_PREFAB); break; default: buildingPrefab = prefabManager.getPrefab(Constants.STORAGE_PREFAB); } SpawnBlockRegionsComponent blockRegionsComponent = buildingPrefab.getComponent(SpawnBlockRegionsComponent.class); List<SpawnBlockRegionsComponent.RegionToFill> regionsToFill = blockRegionsComponent.regionsToFill; int minX = Integer.MAX_VALUE; int maxX = Integer.MIN_VALUE; int minZ = Integer.MAX_VALUE; int maxZ = Integer.MIN_VALUE; for (SpawnBlockRegionsComponent.RegionToFill regionToFill : regionsToFill) { minX = Math.min(minX, regionToFill.region.minX()); maxX = Math.max(maxX, regionToFill.region.maxX()); minZ = Math.min(minZ, regionToFill.region.minZ()); maxZ = Math.max(maxZ, regionToFill.region.maxZ()); } Vector3f center = region.center(); Vector3f extents = new Vector3f((maxX - minX) / 2, 0, (maxZ - minZ) / 2); return Region3i.createFromCenterExtents(center, extents); }
Source:
<code>private Map<String, String> defaultAtlasConfMap() { Map<String, String> confMap = new HashMap<>(); <START> confMap.put("hive.in.test", "true"); <END> confMap.put("hive.repl.include.atlas.metadata", "true"); confMap.put("hive.repl.atlas.endpoint", "http://localhost:21000/atlas"); confMap.put("hive.repl.atlas.replicatedto", replicatedDbName); confMap.put("hive.repl.source.cluster.name", "cluster0"); confMap.put("hive.repl.target.cluster.name", "cluster1"); return confMap; }</code><technical_language>conf constants</technical_language>

Target:
private Map<String, String> defaultAtlasConfMap() { Map<String, String> confMap = new HashMap<>(); confMap.put(HiveConf.ConfVars.HIVE_IN_TEST.varname, "true"); confMap.put(HiveConf.ConfVars.REPL_INCLUDE_ATLAS_METADATA.varname, "true"); confMap.put(HiveConf.ConfVars.REPL_ATLAS_ENDPOINT.varname, "http://localhost:21000/atlas"); confMap.put(HiveConf.ConfVars.REPL_ATLAS_REPLICATED_TO_DB.varname, replicatedDbName); confMap.put(HiveConf.ConfVars.REPL_SOURCE_CLUSTER_NAME.varname, "cluster0"); confMap.put(HiveConf.ConfVars.REPL_TARGET_CLUSTER_NAME.varname, "cluster1"); return confMap; }
Source:
<code>public int writeMessage(ByteBuffer message) throws IOException { if (!message.hasRemaining()) { return 0; } CompositeByteBuf outbuf = Unpooled.compositeBuffer(); ByteBuf msg = Unpooled.wrappedBuffer(message); final int needed = CipherExecutor.framesFor(msg.readableBytes()); for (int have = 0; have < needed; ++have) { final int slicesz = Math.min(CipherExecutor.FRAME_SIZE, msg.readableBytes()); ByteBuf clear = msg.readSlice(slicesz).writerIndex(slicesz); ByteBuf encr = m_ce.allocator().ioBuffer(packetBufferSize()).writerIndex(packetBufferSize()); ByteBuffer src = clear.nioBuffer(); ByteBuffer dst = encr.nioBuffer(); try { m_encrypter.tlswrap(src, dst); } catch (TLSException e) { outbuf.release(); encr.release(); throw new IOException("failed to encrypt tls frame", e); } assert !src.hasRemaining() : "encryption wrap did not consume the whole source buffer"; encr.writerIndex(dst.limit()); outbuf.addComponent(true, encr); } int bytesWritten = 0; try { while (outbuf.isReadable()) { bytesWritten += outbuf.readBytes(m_socketChannel, outbuf.readableBytes()); } } catch (IOException e) { outbuf.release(); throw e; <START> } <END> outbuf.release(); message.position(message.position() + msg.readerIndex()); return bytesWritten; }</code><technical_language>outbuf.release in finally get rid of next release</technical_language>

Target:
public int writeMessage(ByteBuffer message) throws IOException { if (!message.hasRemaining()) { return 0; } CompositeByteBuf outbuf = Unpooled.compositeBuffer(); ByteBuf msg = Unpooled.wrappedBuffer(message); final int needed = CipherExecutor.framesFor(msg.readableBytes()); for (int have = 0; have < needed; ++have) { final int slicesz = Math.min(CipherExecutor.FRAME_SIZE, msg.readableBytes()); ByteBuf clear = msg.readSlice(slicesz).writerIndex(slicesz); ByteBuf encr = m_ce.allocator().ioBuffer(packetBufferSize()).writerIndex(packetBufferSize()); ByteBuffer src = clear.nioBuffer(); ByteBuffer dst = encr.nioBuffer(); try { m_encrypter.tlswrap(src, dst); } catch (TLSException e) { outbuf.release(); encr.release(); throw new IOException("failed to encrypt tls frame", e); } assert !src.hasRemaining() : "encryption wrap did not consume the whole source buffer"; encr.writerIndex(dst.limit()); outbuf.addComponent(true, encr); } int bytesWritten = 0; try { while (outbuf.isReadable()) { bytesWritten += outbuf.readBytes(m_socketChannel, outbuf.readableBytes()); } } catch (IOException e) { throw e; } finally { outbuf.release(); } message.position(message.position() + msg.readerIndex()); return bytesWritten; }
Source:
<code>protected Map<String, Object> addSection(ParameterParser params, SessionState state) { String message; Map<String, Object> results = new HashMap<String, Object>(); try { String addSectionHTML = params.getString("addSectionHTML"); int locationId = params.getInt("locationId"); CitationCollection collection = getCitationCollection(state, false); CitationCollectionOrder citationCollectionOrder = new CitationCollectionOrder(collection.getId(), locationId, "heading1", addSectionHTML); getCitationService().save(citationCollectionOrder); message = "Resource updated"; } catch (Exception e){ message = e.getMessage(); <START> logger.warn("Exception in addSection() " + e); <END> } if(message != null && ! message.trim().equals("")) { results.put("message", message); } return results; }</code><technical_language>log full exception log.warn(String, Exception) if unexpected need debugged, if expected logged warn level</technical_language>

Target:
protected Map<String, Object> addSection(ParameterParser params, SessionState state) { String message; Map<String, Object> results = new HashMap<String, Object>(); try { String addSectionHTML = params.getString("addSectionHTML"); String cleanAddSectionHTML = getFormattedText().processFormattedText(addSectionHTML, new StringBuilder(), true, true); int locationId = params.getInt("locationId"); CitationCollection collection = getCitationCollection(state, false); CitationCollectionOrder citationCollectionOrder = new CitationCollectionOrder(collection.getId(), locationId, CitationCollectionOrder.SectionType.HEADING1, cleanAddSectionHTML); getCitationService().save(citationCollectionOrder); message = rb.getString("resource.updated"); } catch (Exception e){ message = e.getMessage(); logger.warn("Exception in addSection() " + e); } if(message != null && ! message.trim().equals("")) { results.put("message", message); } return results; }
Source:
<code>protected void runInternal() { final List<Data> keyValueSequence = this.loadingSequence; if (keyValueSequence == null || keyValueSequence.isEmpty()) { return; } for (int i = 0; i < keyValueSequence.size();) { final Data key = keyValueSequence.get(i++); final Data value = keyValueSequence.get(i++); if (includesExpirationTime) { long expirationTime = (long) mapServiceContext.toObject(keyValueSequence.get(i++)); <START> final Object object = mapServiceContext.toObject(value); <END> recordStore.putFromLoadBackup(key, object, expirationTime); } else { final Object object = mapServiceContext.toObject(value); recordStore.putFromLoadBackup(key, object); } if (!recordStore.existInMemory(key)) { continue; } publishLoadAsWanUpdate(key, value); } }</code><technical_language>Minor: this line (and L64) moved if statement</technical_language>

Target:
protected void runInternal() { final List<Data> keyValueSequence = this.loadingSequence; if (keyValueSequence == null || keyValueSequence.isEmpty()) { return; } for (int i = 0; i < keyValueSequence.size();) { final Data key = keyValueSequence.get(i++); final Data value = keyValueSequence.get(i++); final Object object = mapServiceContext.toObject(value); if (includesExpirationTime) { long expirationTime = (long) mapServiceContext.toObject(keyValueSequence.get(i++)); recordStore.putFromLoadBackup(key, object, expirationTime); } else { recordStore.putFromLoadBackup(key, object); } if (!recordStore.existInMemory(key)) { continue; } publishLoadAsWanUpdate(key, value); } }
Source:
<code>private boolean isManagementNetworkChanged(){ List<NetworkAttachment> newAttachments = getParameters().getNetworkAttachments(); List<NetworkAttachment> existingAttachments = this.existingAttachments; String mgmtNetworkName = managementNetworkUtil.getManagementNetwork(getVds().getVdsGroupId()).getName(); for (HostNetwork network : getNetworksToConfigure()) { if (mgmtNetworkName.equals(network.getNetworkName())){ return true; } } for (Bond bond : getParameters().getBonds()) { <START> VdsNetworkInterface bondNic = existingNicsBusinessEntityMap.get(bond.getId()); <END> if (bondNic != null && mgmtNetworkName.equals(bondNic.getNetworkName())) { return true; } } return false; }</code><technical_language>Please -'getExistingNicsBusinessEntityMap()' instead of directly- 'existingNicsBusinessEntityMap'</technical_language>

Target:
private boolean isManagementNetworkChanged(){ List<NetworkAttachment> newAttachments = getParameters().getNetworkAttachments(); List<NetworkAttachment> existingAttachments = this.existingAttachments; String mgmtNetworkName = managementNetworkUtil.getManagementNetwork(getVds().getVdsGroupId()).getName(); for (HostNetwork network : getNetworksToConfigure()) { if (mgmtNetworkName.equals(network.getNetworkName())){ return true; } } for (Bond bond : getParameters().getBonds()) { VdsNetworkInterface bondNic = getExistingNicsBusinessEntityMap().get(bond.getId()); if (bondNic != null && mgmtNetworkName.equals(bondNic.getNetworkName())) { return true; } } return false; }
Source:
<code>private void <START> disableCrossReferencerResolve(Resource <END> resource) { disableCrossReferencerResolve((Notifier) resource); EList<EObject> contents = resource.getContents(); if (contents.size() > 0 && contents.get(0) != null) { disableCrossReferencerResolve(contents.get(0)); } }</code><technical_language>a good idea methods signature for type, espcially is a subtype of other</technical_language>

Target:
private void disableCrossReferencerResolve(Resource resource) { disableCrossReferencerResolveOnNotifer(resource); EList<EObject> contents = resource.getContents(); if (contents.size() > 0 && contents.get(0) != null) { disableCrossReferencerResolveOnNotifer(contents.get(0)); } }
Source:
<code>public Fragment getItem(int i) { switch (i) { case DETAILS_TAB_POS: PatientDetailsFragment patientDetailsFragment = PatientDetailsFragment.newInstance(); new PatientDashboardDetailsPresenter(mPatientId, patientDetailsFragment); return patientDetailsFragment; case DETAILS_TAB_ALLERGY: PatientAllergyFragment patientAllergyFragment = PatientAllergyFragment.newInstance(); new PatientDashboardAllergyPresenter(mPatientId, patientAllergyFragment); return patientAllergyFragment; case DIAGNOSIS_TAB_POS: <START> PatientDiagnosisFragment patientDiagnosisFragment = PatientDiagnosisFragment.newInstance(); <END> new PatientDashboardDiagnosisPresenter(mPatientId, patientDiagnosisFragment); return patientDiagnosisFragment; case VISITS_TAB_POS: PatientVisitsFragment patientVisitsFragment = PatientVisitsFragment.newInstance(); new PatientDashboardVisitsPresenter(mPatientId, patientVisitsFragment); return patientVisitsFragment; case VITALS_TAB_POS: PatientVitalsFragment patientVitalsFragment = PatientVitalsFragment.newInstance(); new PatientDashboardVitalsPresenter(mPatientId, patientVitalsFragment); return patientVitalsFragment; case CHARTS_TAB_POS: PatientChartsFragment patientChartsFragment = PatientChartsFragment.newInstance(); new PatientDashboardChartsPresenter(mPatientId, patientChartsFragment); return patientChartsFragment; default: return null; } }</code><technical_language>uniform ALLERGY_TAB_POS ?</technical_language>

Target:
public Fragment getItem(int i) { switch (i) { case DETAILS_TAB_POS: PatientDetailsFragment patientDetailsFragment = PatientDetailsFragment.newInstance(); new PatientDashboardDetailsPresenter(mPatientId, patientDetailsFragment); return patientDetailsFragment; case ALLERGY_TAB_POS: PatientAllergyFragment patientAllergyFragment = PatientAllergyFragment.newInstance(); new PatientDashboardAllergyPresenter(mPatientId, patientAllergyFragment); return patientAllergyFragment; case DIAGNOSIS_TAB_POS: PatientDiagnosisFragment patientDiagnosisFragment = PatientDiagnosisFragment.newInstance(); new PatientDashboardDiagnosisPresenter(mPatientId, patientDiagnosisFragment); return patientDiagnosisFragment; case VISITS_TAB_POS: PatientVisitsFragment patientVisitsFragment = PatientVisitsFragment.newInstance(); new PatientDashboardVisitsPresenter(mPatientId, patientVisitsFragment); return patientVisitsFragment; case VITALS_TAB_POS: PatientVitalsFragment patientVitalsFragment = PatientVitalsFragment.newInstance(); new PatientDashboardVitalsPresenter(mPatientId, patientVitalsFragment); return patientVitalsFragment; case CHARTS_TAB_POS: PatientChartsFragment patientChartsFragment = PatientChartsFragment.newInstance(); new PatientDashboardChartsPresenter(mPatientId, patientChartsFragment); return patientChartsFragment; default: return null; } }
Source:
<code>public void run() { try { Injector injector = makeInjector(); <START> Lifecycle lifecycle = initLifecycle(injector); <END> try { injector.getInstance(ExecutorLifecycle.class).join(); lifecycle.stop(); } catch (Throwable t) { log.error(t, "Error when starting up. Failing."); System.exit(1); } } catch (Exception e) { throw Throwables.propagate(e); } }</code><technical_language>moving exception catching out of try{} this area. Is intentional</technical_language>

Target:
public void run() { try { Injector injector = makeInjector(); try { Lifecycle lifecycle = initLifecycle(injector); injector.getInstance(ExecutorLifecycle.class).join(); lifecycle.stop(); } catch (Throwable t) { log.error(t, "Error when starting up. Failing."); System.exit(1); } } catch (Exception e) { throw Throwables.propagate(e); } }
Source:
<code>IReportContent regenerateCache( final MasterReport report, final int yieldRate, final String key, final int acceptedPage ) throws ReportProcessingException { logger.warn( "Regenerating report data for " + key ); final IReportContent result = produceCacheablePages( report, yieldRate, key, acceptedPage ); <START> persistContent( key, result, null ); <END> return result; }</code><technical_language>This backfire. storing content a totalRows indicator, next time retrieve cache, missing information. "produceCachablePages" method update listener state events get fired report processing, persisting information, producing invalid state. Create a unit-test replay scenario (retrieve cache, "listener.isFirstPageMode") check cache contains. find totalRows stored subsequent cache-retrievals set correct totalRows counter</technical_language>

Target:
IReportContent regenerateCache( final MasterReport report, final int yieldRate, final String key, final int acceptedPage ) throws ReportProcessingException { logger.warn( "Regenerating report data for " + key ); final IReportContent result = produceCacheablePages( report, yieldRate, key, acceptedPage ); final IAsyncReportListener listener = ReportListenerThreadHolder.getListener(); persistContent( key, result, listener.getTotalRows() ); return result; }
Source:
<code><START> CommitValidationResult(boolean validated, String why) { <END> this.validated = validated; this.why = why; }</code><technical_language>consider making this protected plugins subclass if want to</technical_language>

Target:
protected CommitValidationResult(boolean validated, String why) { this.validated = validated; this.why = why; }
Source:
<code>public void updateProperties(String name, Consumer<Block> properties) { materialProperties.put(name, properties); <START> blockMap.forEach((spec, id) -> { Block block = spec.toBlock(); applyMaterial(block); palette.set(id, block); }); <END> }</code><technical_language>Hmmm, this efficient i is a get a BlockSpec name (to get id blockMap), leMaik thinks</technical_language>

Target:
public void updateProperties(String name, Consumer<Block> properties) { materialProperties.put(name, properties); blockMap.forEach((spec, id) -> { Block block = palette.get(id); applyMaterial(block); palette.set(id, block); }); }
Source:
<code><START> public void runPercentiles() throws Exception { <END> storeLongTimeSeriesSeconds(false, true); HashMap<String, String> tags = new HashMap<String, String>(0); query.setStartTime(1356998400); query.setEndTime(1357041600); query.setTimeSeries("sys.cpu.user", tags, Aggregators.p50, false); final DataPoints[] dps = query.run(); assertNotNull(dps); assertEquals("sys.cpu.user", dps[0].metricName()); assertEquals("host", dps[0].getAggregatedTags().get(0)); assertNull(dps[0].getAnnotations()); assertTrue(dps[0].getTags().isEmpty()); long v1 = 151; long v2 = 150; long ts = 1356998430000L; int counter = 0; int size = dps[0].size(); for (DataPoint dp : dps[0]) { assertEquals(ts, dp.timestamp()); ts += 15000; if (counter == 0 || counter == size - 1) { assertEquals(1, dp.longValue()); } else if (counter % 2 == 0) { assertEquals(v1, dp.longValue()); } else { assertEquals(v2, dp.longValue()); } counter++; } assertEquals(600, size); }</code><technical_language>need tests for type of new aggregator making CTors throw proper exceptions if hack source construct aggregator some funky -42.5 percentile. Aggregators need more UTs :(</technical_language>

Target:
public void runPercentiles() throws Exception { storeLongTimeSeriesSeconds(false, true); testPercentile(Aggregators.p50, 150, 150); testPercentile(Aggregators.p75, 150, 150); testPercentile(Aggregators.p90, 150, 150); testPercentile(Aggregators.p95, 150, 150); testPercentile(Aggregators.p99, 150, 150); testPercentile(Aggregators.p999, 150, 150); testPercentile(Aggregators.ep50, 150, 150); testPercentile(Aggregators.ep75, 150, 150); testPercentile(Aggregators.ep90, 150, 150); testPercentile(Aggregators.ep95, 150, 150); testPercentile(Aggregators.ep99, 150, 150); testPercentile(Aggregators.ep999, 150, 150); }
Source:
<code>private boolean gbyTablesEqual(MaterializedViewInfo mv) { if (m_selectStmt.hasComplexGroupby() ^ mv.getGroupbyexpressionsjson().isEmpty()) { if (m_selectStmt.hasComplexGroupby()) { <START> return getGbyExpressions(mv).equals( <END> m_selectStmt.groupByColumns().stream() .map(ci -> copyAsCVE(ci.m_expression).anonymize()) .collect(Collectors.toList())); } else { return m_selectStmt.groupByColumns().get(0).m_tableName .equals(mv.getDest().getMaterializer().getTypeName()); } } else return false; }</code><technical_language>checking group expressions here? Is this getViewColumnMaps()? This method is called gbyTablesEqual() for complex group case, ignore table names here? other hand, views select query target table's metadata. views defined table. is impossible a table name mismatch talking multi-table view</technical_language>

Target:
private boolean gbyTablesEqual(MaterializedViewInfo mv) { if (m_selectStmt.hasComplexGroupby() != mv.getGroupbyexpressionsjson().isEmpty()) { if (m_selectStmt.hasComplexGroupby()) { final Set<AbstractExpression> selGby = m_selectStmt.groupByColumns().stream() .map(ci -> transformExpressionRidofPVE(ci.m_expression).anonymize()) .collect(Collectors.toSet()), viewGby = new HashSet<>(getGbyExpressions(mv)); return selGby.equals(viewGby) && selGby.stream().map(MVQueryRewriter::extractTVEIndices).collect(Collectors.toSet()).equals( viewGby.stream().map(MVQueryRewriter::extractTVEIndices).collect(Collectors.toSet())); } else { return true; } } else { return false; } }
Source:
<code>public void stop() { <START> Log.i(TAG, <END> "stop"); mCodec.stop(); }</code><technical_language>check if started here</technical_language>

Target:
public void stop() { if(mConfigured) { Log.i(TAG, "stop"); mCodec.stop(); mConfigured = false; } }
Source:
<code>private static OMClientRequest getOMAclRequest(OMRequest omRequest) { Type cmdType = omRequest.getCmdType(); if (Type.AddAcl == cmdType) { ObjectType type = omRequest.getAddAclRequest().getObj().getResType(); if (ObjectType.VOLUME == type) { return new OMVolumeAddAclRequest(omRequest); } else if (ObjectType.BUCKET == type) { return new OMBucketAddAclRequest(omRequest); <START> } else if (type == ObjectType.KEY) { <END> return new OMKeyAddAclRequest(omRequest); } } else if (Type.RemoveAcl == cmdType) { ObjectType type = omRequest.getRemoveAclRequest().getObj().getResType(); if (ObjectType.VOLUME == type) { return new OMVolumeRemoveAclRequest(omRequest); } else if (ObjectType.BUCKET == type) { return new OMBucketRemoveAclRequest(omRequest); } else if (type == ObjectType.KEY) { return new OMKeyRemoveAclRequest(omRequest); } } else if (Type.SetAcl == cmdType) { ObjectType type = omRequest.getSetAclRequest().getObj().getResType(); if (ObjectType.VOLUME == type) { return new OMVolumeSetAclRequest(omRequest); } else if (ObjectType.BUCKET == type) { return new OMBucketSetAclRequest(omRequest); } else if (ObjectType.KEY == type) { return new OMKeySetAclRequest(omRequest); } } return null; }</code><technical_language>code is reverse order for equality. same</technical_language>

Target:
private static OMClientRequest getOMAclRequest(OMRequest omRequest) { Type cmdType = omRequest.getCmdType(); if (Type.AddAcl == cmdType) { ObjectType type = omRequest.getAddAclRequest().getObj().getResType(); if (ObjectType.VOLUME == type) { return new OMVolumeAddAclRequest(omRequest); } else if (ObjectType.BUCKET == type) { return new OMBucketAddAclRequest(omRequest); } else if (ObjectType.KEY == type) { return new OMKeyAddAclRequest(omRequest); } } else if (Type.RemoveAcl == cmdType) { ObjectType type = omRequest.getRemoveAclRequest().getObj().getResType(); if (ObjectType.VOLUME == type) { return new OMVolumeRemoveAclRequest(omRequest); } else if (ObjectType.BUCKET == type) { return new OMBucketRemoveAclRequest(omRequest); } else if (ObjectType.KEY == type) { return new OMKeyRemoveAclRequest(omRequest); } } else if (Type.SetAcl == cmdType) { ObjectType type = omRequest.getSetAclRequest().getObj().getResType(); if (ObjectType.VOLUME == type) { return new OMVolumeSetAclRequest(omRequest); } else if (ObjectType.BUCKET == type) { return new OMBucketSetAclRequest(omRequest); } else if (ObjectType.KEY == type) { return new OMKeySetAclRequest(omRequest); } } return null; }
Source:
<code>private boolean miniBatchEnabled() { return !"1".equals(this.modelConfig.getTrain().getParams().getOrDefault(CommonConstants.MINI_BATCH, "1").toString()); <START> } <END></code><technical_language>This condition is weird:)</technical_language>

Target:
private boolean miniBatchEnabled() { return null != this.modelConfig.getTrain().getParams().get(CommonConstants.MINI_BATCH); }
Source:
<code>public CuratorFramework provideCurator(ZooKeeperConfiguration config, BaragonConnectionStateListener connectionStateListener) { CuratorFramework client = CuratorFrameworkFactory.builder() .connectString(config.getQuorum()) .sessionTimeoutMs(config.getSessionTimeoutMillis()) .connectionTimeoutMs(config.getConnectTimeoutMillis()) .retryPolicy(new ExponentialBackoffRetry(config.getRetryBaseSleepTimeMilliseconds(), config.getRetryMaxTries())) <START> .defaultData(new byte[] {}) <END> .build(); client.getConnectionStateListenable().addListener(connectionStateListener); client.start(); return client.usingNamespace(config.getZkNamespace()); }</code><technical_language>nit: new byte[0]</technical_language>

Target:
public CuratorFramework provideCurator(ZooKeeperConfiguration config, BaragonConnectionStateListener connectionStateListener) { CuratorFramework client = CuratorFrameworkFactory.builder() .connectString(config.getQuorum()) .sessionTimeoutMs(config.getSessionTimeoutMillis()) .connectionTimeoutMs(config.getConnectTimeoutMillis()) .retryPolicy(new ExponentialBackoffRetry(config.getRetryBaseSleepTimeMilliseconds(), config.getRetryMaxTries())) .defaultData(new byte[0]) .build(); client.getConnectionStateListenable().addListener(connectionStateListener); client.start(); return client.usingNamespace(config.getZkNamespace()); }
Source:
<code>public DDF[] listDDFs() { <START> return mDDFCache.asMap().values().toArray(new DDF[]{}); <END> }</code><technical_language>I suggest change this signature Iterator. Currently listDDFs() in a loop condition: for(ddf : listDDFS()) { ...} return Iterator here</technical_language>

Target:
public DDF[] listDDFs() { List<DDF> ddfs = new ArrayList<DDF>(); ddfs.addAll(mDDFCache.asMap().values()); ddfs.addAll(mDDFwithNameCache.asMap().values()); return ddfs.toArray(new DDF[] {}); }
Source:
<code><START> Collection<String> getBundleCategories() { <END> if(bundle!=null) { String categories = bundle.getHeaders().get(Constants.BUNDLE_CATEGORY); if(categories!=null) { String[] catArray = categories.split(","); if(catArray.length==1) { return Arrays.asList(new String[]{categories}); } else { return Arrays.asList(catArray); } } } return new ArrayList<String>(); }</code><technical_language>methods package private purpose</technical_language>

Target:
public Collection<String> getBundleCategories() { if(bundle!=null) { String categories = bundle.getHeaders().get(Constants.BUNDLE_CATEGORY); if(categories!=null) { String[] catArray = categories.split(","); if(catArray.length==1) { return Arrays.asList(new String[]{categories}); } else { return Arrays.asList(catArray); } } } else if(obrResource!=null && obrResource.getCategories()!=null) { return Arrays.asList(obrResource.getCategories()); } return new ArrayList<String>(); }
Source:
<code>public EntitlerJobConfig setOwner(final Owner owner) { if (owner == null) { throw new IllegalArgumentException("Owner is null"); } <START> this.setJobArgument(OWNER_KEY, owner.getKey()) <END> .setLogLevel(owner.getLogLevel()); return this; }</code><technical_language>This instead this.setJobMetadata(LoggingFilter.OWNER_KEY, owner.getKey()), owner is argument in execute method, is part of metadata</technical_language>

Target:
public EntitlerJobConfig setOwner(final Owner owner) { if (owner == null) { throw new IllegalArgumentException("Owner is null"); } this.setJobMetadata(OWNER_KEY, owner.getKey()) .setLogLevel(owner.getLogLevel()); return this; }
Source:
<code>private static Link getConfirmMobileLink(UUID userID) { ControllerLinkBuilder linkBuilder = linkTo( methodOn(UserController.class).confirmMobileNumber(Optional.empty(), userID, null)); <START> return linkBuilder.withSelfRel(); <END> }</code><technical_language>This is correct. link is inserted in user json object "self" refer user href. Suggestion: return a LinkBuilder method .withRel("confirmMobileNumber") in UserResourceAssembler</technical_language>

Target:
private static Link getConfirmMobileLink(UUID userID) { ControllerLinkBuilder linkBuilder = linkTo( methodOn(UserController.class).confirmMobileNumber(Optional.empty(), userID, null)); return linkBuilder.withRel("confirmMobileNumber"); }