auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public long restoreMessagesFromDeadLetterQueue(long[] messageIDs, String destinationQueueName) throws QueueManagerException { long unavailableMessageCount = 0L; MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer(); try { ObjectName objectName = new ObjectName("org.wso2.andes:type=QueueManagementInformation,name=QueueManagementInformation"); String operationName = "restoreMessagesFromDeadLetterQueue"; Object[] parameters = new Object[]{messageIDs, destinationQueueName}; String[] signature = new String[]{long[].class.getName(), String.class.getName()}; Object result = mBeanServer.invoke( objectName, operationName, parameters, signature); <START> if (result != null) { <END> unavailableMessageCount = (Long) result; } return unavailableMessageCount; } catch (MalformedObjectNameException | ReflectionException | MBeanException | InstanceNotFoundException e) { throw new QueueManagerException("Error restoring messages from Dead Letter Queue : " + destinationQueueName, e); } }</code><technical_language>flip null check. Also, if result null</technical_language>

Target:
public long restoreMessagesFromDeadLetterQueue(long[] messageIDs, String destinationQueueName) throws QueueManagerException { long unavailableMessageCount = 0L; MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer(); try { ObjectName objectName = new ObjectName("org.wso2.andes:type=QueueManagementInformation,name=QueueManagementInformation"); String operationName = "restoreMessagesFromDeadLetterQueue"; Object[] parameters = new Object[]{messageIDs, destinationQueueName}; String[] signature = new String[]{long[].class.getName(), String.class.getName()}; Object result = mBeanServer.invoke( objectName, operationName, parameters, signature); if (null != result) { unavailableMessageCount = (Long) result; } return unavailableMessageCount; } catch (MalformedObjectNameException | ReflectionException | MBeanException | InstanceNotFoundException e) { throw new QueueManagerException("Error restoring messages from Dead Letter Queue : " + destinationQueueName, e); } }
Source:
<code>public String onPlaceholderRequest(Player p, String identifier) { if (identifier.equalsIgnoreCase("total_achievements")) { return getTotalAchievements(); } <START> <END> if (p == null) { return null; } UUID uuid = p.getUniqueId(); if (identifier.equalsIgnoreCase("achievements")) { return getAchievements(uuid); } if (identifier.equalsIgnoreCase("achievements_percentage")) { return getAchievementsPercentage(uuid); } if (identifier.toLowerCase().startsWith("unlocked_")) { return unlockedPlaceholder(uuid, identifier.replaceFirst("(?i)unlocked_", "")); } String returnValue = getNormalAchievements(identifier, uuid); if (returnValue == null) { returnValue = getMultipleAchievements(identifier, uuid); } return returnValue; }</code><technical_language>In Java, generally considered practice constant left hand-side of comparisons. If identifier is null for reason, end a NullPointerException swapping arguments this</technical_language>

Target:
public String onPlaceholderRequest(Player p, String identifier) { if (globalPlaceholders.containsKey(identifier)) { return globalPlaceholders.get(identifier).get(); } if (p == null) { return null; } UUID uuid = p.getUniqueId(); String[] splitId = identifier.split("_"); if (placeholderWithArgs.containsKey(splitId[0])) { return placeholderWithArgs.get(splitId[0]).apply(uuid, Arrays.copyOfRange(splitId, 1, splitId.length)); } else if (placeholderWithoutArgs.containsKey(identifier)) { return placeholderWithoutArgs.get(identifier).apply(uuid); } String returnValue = getNormalAchievements(identifier, uuid); if (returnValue == null) { returnValue = getMultipleAchievements(identifier, uuid); } return returnValue; }
Source:
<code>protected void ExecuteVdsBrokerCommand() { if (Config.<Boolean> GetValue(ConfigValues.SendVmTicketUID, getVds().getVdsGroupCompatibilityVersion().toString())) { Map<String, String> params = new HashMap<String, String>(); params.put("userName", getParameters().getUserName()); params.put("userId", getParameters().getUserId().toString()); <START> status = getBroker().setVmTicket(mVmId.toString(), mTicket, (Integer.valueOf(mValidTime)).toString(), <END> connectionAction, params); } else { status = getBroker().setVmTicket(mVmId.toString(), mTicket, (Integer.valueOf(mValidTime)).toString()); } ProceedProxyReturnValue(); }</code><technical_language>Instead of Integer.valueOf(int).toString(), String.valueOf(int)</technical_language>

Target:
protected void ExecuteVdsBrokerCommand() { if (Config.<Boolean> GetValue(ConfigValues.SendVmTicketUID, getVds().getVdsGroupCompatibilityVersion().toString())) { Map<String, String> params = new HashMap<String, String>(); params.put("userName", getParameters().getUserName()); params.put("userId", getParameters().getUserId().toString()); status = getBroker().setVmTicket(mVmId.toString(), mTicket, String.valueOf(mValidTime), connectionAction, params); } else { status = getBroker().setVmTicket(mVmId.toString(), mTicket, String.valueOf(mValidTime)); } ProceedProxyReturnValue(); }
Source:
<code>public InternalAccess internalAccess() { <START> Security.allowOnlyFrameworkServer(); <END> return this.internalAccess; }</code><technical_language>allow read-only access users. consider making a non-internal API. is bind repositories, e.g. for routing purposes</technical_language>

Target:
public final InternalAccess internalAccess() { Security.allowOnlyFrameworkServer(); return this.internalAccess; }
Source:
<code>public void invalidLoginTest() throws InterruptedException { <START> find("#repoOwnerField"); <END> selectAll(); push(KeyCode.BACK_SPACE).type("abc").push(KeyCode.TAB); push(KeyCode.BACK_SPACE).type("abc").push(KeyCode.TAB); push(KeyCode.BACK_SPACE).type("abc").push(KeyCode.TAB); push(KeyCode.BACK_SPACE).type("abc"); click("Sign in"); sleep(1000); assertNodeExists(hasText("Failed to sign in. Please try again.")); click("OK"); }</code><technical_language>find calls needed more. want click in fields in focus</technical_language>

Target:
public void invalidLoginTest() throws InterruptedException { selectAll(); push(KeyCode.BACK_SPACE).type("abc").push(KeyCode.TAB); push(KeyCode.BACK_SPACE).type("abc").push(KeyCode.TAB); push(KeyCode.BACK_SPACE).type("abc").push(KeyCode.TAB); push(KeyCode.BACK_SPACE).type("abc"); click("Sign in"); sleep(1000); assertNodeExists(hasText("Failed to sign in. Please try again.")); click("OK"); }
Source:
<code>public boolean isNoDiscard() { <START> ICPPClassType clazz = getSpecializedBinding(); <END> if (clazz != null) { return clazz.isNoDiscard(); } return false; }</code><technical_language>OK, I misremembering CPPClassSpecialization worked. I guess need a change code :) now, I get explicit specializations wrong: // Primary template is nodiscard template <typename T> struct Foo {}; // Explicit specialization is nodiscard template <> struct [[nodicard]] Foo<int> {}; Foo<int> var1; // explicit specialization I works is: * A CPPClassSpecialization represents explicit specialization non-null getDefinition() getCompositeTypeSpecifier(), a null getSpecializationScope(). Operations typically performed composite type specifier for a regular class. * A CPPClassSpecialization instantiated a primary template a partial specialization a null getDefinition() getCompositeTypeSpecifier(), a non-null getSpecializationScope(). Operations typically performed specialization scope (or getSpecializedBinding() directly). Note getSpecializedBinding() for explicit instantiation is wrong, return primary template. (Whereas, for a partial specialization, getSpecializedBinding() return ICPPClassTemplatePartialSpecialization representing (uninstantiated) partial specialization pattern.) Anyways, for long winded. Templates complicated... point is, I correct implementation be: // handle explicit specialization case CPPASTCompositeTypeSpecifier typeSpecifier = getCompositeTypeSpecifier(); if (typeSpecifier != null) { return AttributeUtil.hasNodiscardAttribute(typeSpecifier); } // handle partial spec primary template case ICPPClassType clazz = getSpecializedBinding(); if (clazz != null) { return clazz.isNoDiscard(); } return false;</technical_language>

Target:
public boolean isNoDiscard() { ICPPASTCompositeTypeSpecifier typeSpecifier = getCompositeTypeSpecifier(); if (typeSpecifier != null) { return AttributeUtil.hasNodiscardAttribute(typeSpecifier); } ICPPClassType clazz = getSpecializedBinding(); if (clazz != null) { return clazz.isNoDiscard(); } return false; }
Source:
<code>public AuditLogType getAuditLogTypeValue() { switch (getActionState()) { case EXECUTE: if (getSucceeded()) { if (getParameters().getSnapshotAction() == SnapshotActionEnum.UNDO) { return AuditLogType.USER_UNDO_RESTORE_FROM_SNAPSHOT_START; } <START> else { <END> return AuditLogType.USER_COMMIT_RESTORE_FROM_SNAPSHOT_START; } } else { if (getParameters().getSnapshotAction() == SnapshotActionEnum.UNDO) { return AuditLogType.USER_UNDO_RESTORE_FROM_SNAPSHOT_FINISH_FAILURE; } else { return AuditLogType.USER_COMMIT_RESTORE_FROM_SNAPSHOT_FINISH_FAILURE; } } default: if (getParameters().getSnapshotAction() == SnapshotActionEnum.UNDO) { return AuditLogType.USER_UNDO_RESTORE_FROM_SNAPSHOT_FINISH_SUCCESS; } else { return AuditLogType.USER_COMMIT_RESTORE_FROM_SNAPSHOT_FINISH_SUCCESS; } } }</code><technical_language>else statement is redundant, a return if. consider ? operator: return getParameters().getSnapshotAction() == SnapshotActionEnum.UNDO ? AuditLogType.USER_UNDO_RESTORE_FROM_SNAPSHOT_START : AuditLogType.USER_COMMIT_RESTORE_FROM_SNAPSHOT_START;</technical_language>

Target:
public AuditLogType getAuditLogTypeValue() { switch (getActionState()) { case EXECUTE: if (getSucceeded()) { if (getParameters().getSnapshotAction() == SnapshotActionEnum.UNDO) { return AuditLogType.USER_UNDO_RESTORE_FROM_SNAPSHOT_START; } return AuditLogType.USER_COMMIT_RESTORE_FROM_SNAPSHOT_START; } if (getParameters().getSnapshotAction() == SnapshotActionEnum.UNDO) { return AuditLogType.USER_UNDO_RESTORE_FROM_SNAPSHOT_FINISH_FAILURE; } return AuditLogType.USER_COMMIT_RESTORE_FROM_SNAPSHOT_FINISH_FAILURE; default: if (getParameters().getSnapshotAction() == SnapshotActionEnum.UNDO) { return AuditLogType.USER_UNDO_RESTORE_FROM_SNAPSHOT_FINISH_SUCCESS; } return AuditLogType.USER_COMMIT_RESTORE_FROM_SNAPSHOT_FINISH_SUCCESS; } }
Source:
<code>private static void appendComposite(UriComponentsBuilder builder, String name, Object value) { <START> if (value instanceof List) { <END> for (Object valuePart : (List) value) { builder.queryParam(name, valuePart); } } else if (value instanceof Map) { Set<Map.Entry> valueEntries = ((Map) value).entrySet(); for (Map.Entry queryParam : valueEntries) { builder.queryParam(queryParam.getKey().toString(), queryParam.getValue()); } } }</code><technical_language>I Iterable instead of List is type supported Java 5 for loop</technical_language>

Target:
private static void appendComposite(UriComponentsBuilder builder, String name, Object value) { if (value instanceof Iterable) { for (Object valuePart : (Iterable) value) { builder.queryParam(name, valuePart); } } else if (value instanceof Map) { Set<Map.Entry> valueEntries = ((Map) value).entrySet(); for (Map.Entry queryParam : valueEntries) { builder.queryParam(queryParam.getKey().toString(), queryParam.getValue()); } } else { builder.queryParam(name, value); } }
Source:
<code>private User(Parcel in) { this.userID = in.readInt(); this.fullName = in.readString(); this.gender = in.readInt(); this.age = in.readInt(); this.phoneNumber = in.readString(); this.email = in.readString(); this.status = in.readInt(); this.housingPrice = in.readDouble(); this.bio = in.readString(); <START> this.favoritesUserIDS = new ArrayList<Integer>(); <END> in.readList(favoritesUserIDS, null); }</code><technical_language>_sigh_</technical_language>

Target:
private User(Parcel in) { this.userID = in.readInt(); this.fullName = in.readString(); this.gender = in.readInt(); this.age = in.readInt(); this.phoneNumber = in.readString(); this.email = in.readString(); this.status = in.readInt(); this.housingPrice = in.readDouble(); this.bio = in.readString(); this.favoritedUserIDS = new ArrayList<Integer>(); in.readList(favoritedUserIDS, null); }
Source:
<code>public String getAllReleasePlanWithAllItem() throws SQLException { List<IReleasePlanDesc> releaseDescs = mReleasePlanHelper.loadReleasePlansList(); List<ReleasePlanObject> releases = new ArrayList<ReleasePlanObject>(); for (IReleasePlanDesc releaseDesc : releaseDescs) { ReleasePlanObject releaseObject = new ReleasePlanObject(releaseDesc); List<SprintObject> sprints = releaseObject.getSprintPlan(); List<SprintObject> sprintsWithAllItem = new ArrayList<SprintObject>(); for (SprintObject sprint : sprints) { <START> sprintsWithAllItem.add(mSprintPlanHelper.getSprint(sprint.mId)); <END> } releaseObject.setSprintPlan(sprintsWithAllItem); releases.add(releaseObject); } return new Gson().toJson(releases); }</code><technical_language>mId public</technical_language>

Target:
public String getAllReleasePlanWithAllItem() throws SQLException { List<IReleasePlanDesc> releaseDescs = mReleasePlanHelper.loadReleasePlansList(); List<ReleasePlanObject> releases = new ArrayList<ReleasePlanObject>(); for (IReleasePlanDesc releaseDesc : releaseDescs) { ReleasePlanObject releaseObject = new ReleasePlanObject(releaseDesc); List<SprintObject> sprints = releaseObject.getSprintPlan(); List<SprintObject> sprintsWithAllItem = new ArrayList<SprintObject>(); for (SprintObject sprint : sprints) { sprintsWithAllItem.add(mSprintPlanHelper.getSprint(String.valueOf(sprint.getId()))); } releaseObject.setSprintPlan(sprintsWithAllItem); releases.add(releaseObject); } return new Gson().toJson(releases); }
Source:
<code>private String getGMTOffsetString(long millis) { long absmillis = (millis < 0) ? -millis : millis; int minutes = (int) ((absmillis / (1000 * 60)) % 60); int hours = (int) ((absmillis / (1000 * 60 * 60)) % 24); String builder = "(GMT" + ((millis >= 0) ? '+' : '-') + String.format("%02d:%02d", hours, minutes) + ") "; <START> return builder; <END> }</code><technical_language>this now, I this: return String.format("(GMT%c%02d:%02d) ", millis >= 0 ? '+' : '-', hours, minutes) i.e. String.format entire thing</technical_language>

Target:
private String getGMTOffsetString(long millis) { long absmillis = (millis < 0) ? -millis : millis; int minutes = (int) ((absmillis / (1000 * 60)) % 60); int hours = (int) ((absmillis / (1000 * 60 * 60)) % 24); return String.format("(GMT%c%02d:%02d) ", millis >= 0 ? '+' : '-', hours, minutes); }
Source:
<code>private int computeMessageScore(int messageNo, IMessage message) { <START> return messageNo * (TransferSongMessage.class.isAssignableFrom( <END> message.getClass()) ? TRANSFER_SONG_SCORE_MULTIPLIER : NORMAL_SCORE_MULTIPLIER); }</code><technical_language>multiple line ternary operator :thumbsdown: Is a cleaner do this</technical_language>

Target:
private int computeMessageScore(int messageNo, IMessage message) { int mult = NORMAL_SCORE_MULTIPLIER; if (TransferSongMessage.class.isAssignableFrom( message.getClass())) { mult = TRANSFER_SONG_SCORE_MULTIPLIER; } return messageNo * mult; }
Source:
<code>protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder c = TestCacheManagerFactory.getDefaultCacheConfiguration(true); c.transaction().cacheStopTimeout(10000); <START> c.memory().storageType(StorageType.OFF_HEAP); <END> return TestCacheManagerFactory.createCacheManager(c); }</code><technical_language>this supposed storage</technical_language>

Target:
protected EmbeddedCacheManager createCacheManager() throws Exception { ConfigurationBuilder c = TestCacheManagerFactory.getDefaultCacheConfiguration(true); c.transaction().cacheStopTimeout(10000); c.memory().storageType(storage); return TestCacheManagerFactory.createCacheManager(c); }
Source:
<code>public int hashCode() { final int prime = 31; int result = 1; result = prime * result <START> + ((entityId == null) ? 0 : entityId.hashCode()); <END> result = prime * result + ((entityType == null) ? 0 : entityType.hashCode()); return result; }</code><technical_language>in previous file - consider Objects.hashCode()</technical_language>

Target:
public int hashCode() { final int prime = 31; int result = 1; result = prime * result + Objects.hashCode(entityId); result = prime * result + Objects.hashCode(entityType); return result; }
Source:
<code>public String toString() { if (name.isPresent()) { <START> String pattern = delimited ? "\"%s\" %s" : "%s %s"; <END> return format(pattern, name.get(), typeSignature); } return typeSignature.toString(); }</code><technical_language>Quotes name need escaped. ExpressionFormatter.visitIdentifier</technical_language>

Target:
public String toString() { if (fieldName.isPresent()) { return format("%s %s", fieldName.get(), typeSignature); } return typeSignature.toString(); }
Source:
<code>private List<Integer> getAlleles(final int PLIndex) { while(PLIndex >= allelesList.size()) { final List<Integer> nextPLs; final int alleleToIncrement; if (alleleToIncrementForNextIndex < 0) { <START> alleleToIncrement = availableAllelesToIncrementDeque.isEmpty() ? ploidy - 1 : availableAllelesToIncrementDeque.pollLast(); <END> nextPLs = new ArrayList<>(Collections.nCopies(alleleToIncrement, 0)); nextPLs.addAll(allelesList.get(allelesList.size() - 1).subList(alleleToIncrement, ploidy)); } else { alleleToIncrement = alleleToIncrementForNextIndex; nextPLs = new ArrayList<>(allelesList.get(allelesList.size() - 1)); } final int incrementedValue = nextPLs.get(alleleToIncrement) + 1; nextPLs.set(alleleToIncrement, incrementedValue); alleleToIncrementForNextIndex = alleleToIncrement - 1; if (alleleToIncrement < ploidy - 1 && nextPLs.get(alleleToIncrement) < nextPLs.get(alleleToIncrement + 1)) { availableAllelesToIncrementDeque.add(alleleToIncrement); } allelesList.add(nextPLs); } return allelesList.get(PLIndex); }</code><technical_language>I want removeLast instead of pollLast get exception in unexpected (and impossible) case of empty queue this point</technical_language>

Target:
private List<Integer> getAlleles(final int PLIndex) { while(PLIndex >= allelesList.size()) { final List<Integer> nextPLs; final int alleleToIncrement; if (alleleToIncrementForNextIndex < 0) { alleleToIncrement = availableAllelesToIncrementDeque.isEmpty() ? ploidy - 1 : availableAllelesToIncrementDeque.removeLast(); nextPLs = new ArrayList<>(Collections.nCopies(alleleToIncrement, 0)); nextPLs.addAll(allelesList.get(allelesList.size() - 1).subList(alleleToIncrement, ploidy)); } else { alleleToIncrement = alleleToIncrementForNextIndex; nextPLs = new ArrayList<>(allelesList.get(allelesList.size() - 1)); } final int incrementedValue = nextPLs.get(alleleToIncrement) + 1; nextPLs.set(alleleToIncrement, incrementedValue); alleleToIncrementForNextIndex = alleleToIncrement - 1; if (alleleToIncrement < ploidy - 1 && nextPLs.get(alleleToIncrement) < nextPLs.get(alleleToIncrement + 1)) { availableAllelesToIncrementDeque.add(alleleToIncrement); } allelesList.add(nextPLs); } return allelesList.get(PLIndex); }
Source:
<code>public void testReplaceVariableWithTTLAndScheduleRestart() { EasyMock.expect(worker.herder()).andReturn(herder); <START> EasyMock.expect(herder.restartConnector(eq(1L), eq(MY_CONNECTOR), anyObject())).andReturn(requestId); <END> replayAll(); Map<String, String> result = configTransformer.transform(MY_CONNECTOR, Collections.singletonMap(MY_KEY, "${test:testPath:testKeyWithTTL}")); assertEquals(TEST_RESULT_WITH_TTL, result.get(MY_KEY)); }</code><technical_language>Hmm.. tests pass if callback is null. EasyMock.notNull()</technical_language>

Target:
public void testReplaceVariableWithTTLAndScheduleRestart() { EasyMock.expect(worker.herder()).andReturn(herder); EasyMock.expect(herder.restartConnector(eq(1L), eq(MY_CONNECTOR), notNull())).andReturn(requestId); replayAll(); Map<String, String> result = configTransformer.transform(MY_CONNECTOR, Collections.singletonMap(MY_KEY, "${test:testPath:testKeyWithTTL}")); assertEquals(TEST_RESULT_WITH_TTL, result.get(MY_KEY)); }
Source:
<code>public void bridgeStatusChanged(ThingStatusInfo bridgeStatusInfo) { if (bridgeStatusInfo.getStatus() == ThingStatus.OFFLINE) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE); stop(); connection = null; return; } if (bridgeStatusInfo.getStatus() != ThingStatus.ONLINE) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR); stop(); return; } AbstractBrokerHandler h = getBridgeHandler(); if (h == null) { logger.warn("Bridge handler not found!"); return; } this.connection = h.getConnection(); MqttBrokerConnection connection = this.connection; if (connection == null) { <START> logger.warn("Bridge handler has no valid broker connection!"); <END> return; } try { start(connection).thenApply(e -> true).exceptionally(e -> { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getLocalizedMessage()); return null; }).get(subscribeTimeout, TimeUnit.MILLISECONDS); } catch (InterruptedException | ExecutionException | TimeoutException ignored) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Did not receive all required topics"); } }</code><technical_language>This reflected in status. this happen? call this method a working ONLINE bridge this line? I setting OFFLINE a detailed message nice</technical_language>

Target:
public void bridgeStatusChanged(ThingStatusInfo bridgeStatusInfo) { if (bridgeStatusInfo.getStatus() == ThingStatus.OFFLINE) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_OFFLINE); stop(); connection = null; return; } if (bridgeStatusInfo.getStatus() != ThingStatus.ONLINE) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR); stop(); return; } AbstractBrokerHandler h = getBridgeHandler(); if (h == null) { logger.warn("Bridge handler not found!"); return; } final MqttBrokerConnection connection; try { connection = h.getConnectionAsync().get(500, TimeUnit.MILLISECONDS); } catch (InterruptedException | ExecutionException | TimeoutException ignored) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.BRIDGE_UNINITIALIZED, "Bridge handler has no valid broker connection!"); return; } this.connection = connection; try { start(connection).thenApply(e -> true).exceptionally(e -> { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, e.getLocalizedMessage()); return null; }).get(subscribeTimeout, TimeUnit.MILLISECONDS); } catch (InterruptedException | ExecutionException | TimeoutException ignored) { updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.COMMUNICATION_ERROR, "Did not receive all required topics"); } }
Source:
<code>public void onActivityPaused(Activity activity) { if (null != mCurInAppNotification) { <START> mCurInAppNotification.dismiss(); <END> } }</code><technical_language>is safe call dismiss multiple times, in source for dismiss(), a nice global if check lines of (mView != null && isVisible()) something</technical_language>

Target:
public void onActivityPaused(Activity activity)
Source:
<code>public boolean skip(String id, ESObjectContainer<ModelElementId> collection) { if <START> (id.contains(ID_SUFFIX)) <END> { final String containerId = id.substring(0, id.lastIndexOf(SEPARATOR)); final ModelElementId containerModelElementId = ModelFactory.eINSTANCE.createModelElementId(); containerModelElementId.setId(containerId); return collection.contains(containerModelElementId); } return false; }</code><technical_language>endsWith instead</technical_language>

Target:
public boolean skip(String id, ESObjectContainer<ModelElementId> collection) { if (id.endsWith(ID_SUFFIX)) { final String containerId = id.substring(0, id.lastIndexOf(SEPARATOR)); final ModelElementId containerModelElementId = ModelFactory.eINSTANCE.createModelElementId(); containerModelElementId.setId(containerId); return collection.contains(containerModelElementId); } return false; }
Source:
<code>public static PathValue path( NodeValue[] nodes, EdgeValue[] edges ) { assert nodes != null; assert edges != null; <START> if ( nodes.length + edges.length % 2 == 0 ) <END> { throw new IllegalArgumentException( "Tried to construct a path that is not built like a path: even number of elements" ); } return new PathValue( nodes, edges ); }</code><technical_language>want if ( ( nodes.length + edges.length ) % 2 == 0 ) nodes.length != edges.length + 1</technical_language>

Target:
public static PathValue path( NodeValue[] nodes, EdgeValue[] edges ) { assert nodes != null; assert edges != null; if ( (nodes.length + edges.length) % 2 == 0 ) { throw new IllegalArgumentException( "Tried to construct a path that is not built like a path: even number of elements" ); } return new PathValue( nodes, edges ); }
Source:
<code>public void writeLac(final BookieSocketAddress addr, final long ledgerId, final byte[] masterKey, final long lac, final ByteBufList toSend, final WriteLacCallback cb, final Object ctx) { final PerChannelBookieClientPool client = lookupClient(addr); if (client == null) { cb.writeLacComplete(getRc(BKException.Code.BookieHandleNotAvailableException), ledgerId, addr, ctx); return; } toSend.retain(); <START> client.obtain(new GenericCallback<PerChannelBookieClient>() { <END> @Override public void operationComplete(final int rc, PerChannelBookieClient pcbc) { if (rc != BKException.Code.OK) { try { executor.submitOrdered(ledgerId, new SafeRunnable() { @Override public void safeRun() { cb.writeLacComplete(rc, ledgerId, addr, ctx); } }); } catch (RejectedExecutionException re) { cb.writeLacComplete(getRc(BKException.Code.InterruptedException), ledgerId, addr, ctx); } } else { pcbc.writeLac(ledgerId, masterKey, lac, toSend, cb, ctx); } toSend.release(); } }, ledgerId); }</code><technical_language>nit: lambdas</technical_language>

Target:
public void writeLac(final BookieSocketAddress addr, final long ledgerId, final byte[] masterKey, final long lac, final ByteBufList toSend, final WriteLacCallback cb, final Object ctx) { final PerChannelBookieClientPool client = lookupClient(addr); if (client == null) { cb.writeLacComplete(getRc(BKException.Code.BookieHandleNotAvailableException), ledgerId, addr, ctx); return; } toSend.retain(); client.obtain((rc, pcbc) -> { if (rc != BKException.Code.OK) { try { executor.submitOrdered(ledgerId, safeRun(() -> { cb.writeLacComplete(rc, ledgerId, addr, ctx); })); } catch (RejectedExecutionException re) { cb.writeLacComplete(getRc(BKException.Code.InterruptedException), ledgerId, addr, ctx); } } else { pcbc.writeLac(ledgerId, masterKey, lac, toSend, cb, ctx); } toSend.release(); }, ledgerId); }
Source:
<code>public String toString() { String str = "ErrorReport{code=" + code; <START> if (message != null) { <END> str = str.concat(", message='" + message + "'"); } else { str = str.concat(", description='" + description + "'"); str = str.concat(", parameter='" + parameter + "'"); } str = str.concat("}"); return str; }</code><technical_language>Beside null check, I check isEmpty method well</technical_language>

Target:
public String toString() { String str = "ErrorReport{code=" + code; if (message != null && !message.isEmpty()) { str = str.concat(", message='" + message + "'"); } else { str = str.concat(", description='" + description + "'"); str = str.concat(", parameter='" + parameter + "'"); } str = str.concat("}"); return str; }
Source:
<code>public TaskVariableDeleteBuilder dateRangeStart(Date rangeStart) { if (checkIfNull(rangeStart)) { return this; } <START> addRangeParameter(TASK_VARIABLE_DATE_ID_LIST, "created on date range end", ensureDateNotTimestamp(rangeStart)[0], true); <END> return this; }</code><technical_language>"created date range start" I think</technical_language>

Target:
public TaskVariableDeleteBuilder dateRangeStart(Date rangeStart) { if (checkIfNull(rangeStart)) { return this; } addRangeParameter(TASK_VARIABLE_DATE_ID_LIST, "created on date range start", ensureDateNotTimestamp(rangeStart)[0], true); return this; }
Source:
<code>private static void upgradeMap(final Map<IMember, Set<IMember>> result, final Map<IMember, Set<IMember>> map) { for (Entry<IMember, Set<IMember>> entry : map.entrySet()) { final IMember key= entry.getKey(); if (!result.containsKey(key)) { <START> final Set<IMember> mapSet= map.get(key); <END> final Set<IMember> resultSet= new HashSet<>(mapSet); result.put(key, resultSet); } } }</code><technical_language>more reasonable entry.getValue() here,</technical_language>

Target:
private static void upgradeMap(final Map<IMember, Set<IMember>> result, final Map<IMember, Set<IMember>> map) { for (Entry<IMember, Set<IMember>> entry : map.entrySet()) { final IMember key= entry.getKey(); if (!result.containsKey(key)) { final Set<IMember> mapSet= entry.getValue(); final Set<IMember> resultSet= new HashSet<>(mapSet); result.put(key, resultSet); } } }
Source:
<code>public void close() { Throwable thrown = null; for (MappedByteBuffer mappedByteBuffer : buffersList) { if (mappedByteBuffer == null) { continue; } try { ByteBufferUtils.unmap(mappedByteBuffer); } catch (Throwable t) { if (thrown == null) { thrown = t; } else { thrown.addSuppressed(t); } } } buffersList.clear(); <START> Throwables.propagateIfPossible(thrown); <END> }</code><technical_language>This right. Throwables.propagateIfPossible suppress exception is a RuntimeException Error. I reason throw specific error types suppress others, I assume a bug. Instead, be, java Throwables.propagateIfPossible(thrown); throw new RuntimeException(thrown); I this is unrelated patch, wrong in nearby code fix too</technical_language>

Target:
public void close() { Throwable thrown = null; for (MappedByteBuffer mappedByteBuffer : buffersList) { if (mappedByteBuffer == null) { continue; } try { ByteBufferUtils.unmap(mappedByteBuffer); } catch (Throwable t) { if (thrown == null) { thrown = t; } else { thrown.addSuppressed(t); } } } buffersList.clear(); if (thrown != null) { throw new RuntimeException(thrown); } }
Source:
<code>public DimensionsSpec( <START> @JsonProperty("dimensions") List<DimensionSchema> dimensions, <END> @JsonProperty("dimensionExclusions") List<String> dimensionExclusions, @Deprecated @JsonProperty("spatialDimensions") List<SpatialDimensionSchema> spatialDimensions ) { this.dimensions = dimensions == null ? Lists.<DimensionSchema>newArrayList() : Lists.newArrayList(dimensions); this.dimensionExclusions = (dimensionExclusions == null) ? Sets.<String>newHashSet() : Sets.newHashSet(dimensionExclusions); this.spatialDimensions = (spatialDimensions == null) ? Lists.<SpatialDimensionSchema>newArrayList() : spatialDimensions; verify(); this.dimensionSchemaMap = new HashMap<>(); for (DimensionSchema schema : this.dimensions) { dimensionSchemaMap.put(schema.getName(), schema); } for(SpatialDimensionSchema spatialSchema : this.spatialDimensions) { DimensionSchema newSchema = DimensionsSpec.convertSpatialSchema(spatialSchema); this.dimensions.add(newSchema); dimensionSchemaMap.put(newSchema.getName(), newSchema); } this.spatialDimensions = null; }</code><technical_language>is this incompatible</technical_language>

Target:
public DimensionsSpec( @JsonProperty("dimensions") List<DimensionSchema> dimensions, @JsonProperty("dimensionExclusions") List<String> dimensionExclusions, @Deprecated @JsonProperty("spatialDimensions") List<SpatialDimensionSchema> spatialDimensions ) { this.dimensions = dimensions == null ? Lists.<DimensionSchema>newArrayList() : Lists.newArrayList(dimensions); this.dimensionExclusions = (dimensionExclusions == null) ? Sets.<String>newHashSet() : Sets.newHashSet(dimensionExclusions); List<SpatialDimensionSchema> spatialDims = (spatialDimensions == null) ? Lists.<SpatialDimensionSchema>newArrayList() : spatialDimensions; verify(spatialDims); this.dimensionSchemaMap = new HashMap<>(); for (DimensionSchema schema : this.dimensions) { dimensionSchemaMap.put(schema.getName(), schema); } for(SpatialDimensionSchema spatialSchema : spatialDims) { DimensionSchema newSchema = DimensionsSpec.convertSpatialSchema(spatialSchema); this.dimensions.add(newSchema); dimensionSchemaMap.put(newSchema.getName(), newSchema); } }
Source:
<code>public IStatus unloadAtResourceSetDispose(Resource resource, IProgressMonitor monitor) { TreeIterator<EObject> allContents = <START> resource.getAllContents(); <END> while (allContents.hasNext()) { EObject eObject = allContents.next(); eObject.eAdapters().clear(); } return new Status(IStatus.INFO, SiriusPlugin.ID, ""); }</code><technical_language>this EcoreUtil.getAllProperContents(resource, false)</technical_language>

Target:
public IStatus unloadAtResourceSetDispose(Resource resource, IProgressMonitor monitor) { if (!isFromPackageRegistry(resource)) { TreeIterator<EObject> allContents = EcoreUtil.getAllProperContents(resource, false); while (allContents.hasNext()) { EObject eObject = allContents.next(); eObject.eAdapters().clear(); } } return new Status(IStatus.INFO, SiriusPlugin.ID, ""); }
Source:
<code>private CreateVolumeVDSCommandParameters getCreateVDSCommandParameters() { CreateVolumeVDSCommandParameters parameters = new CreateVolumeVDSCommandParameters(getStoragePoolId(), getDestinationStorageDomainId(), getImageGroupId(), getImage().getImageId(), getDiskImage().getSize(), newDiskImage.getVolumeType(), newDiskImage.getVolumeFormat(), getDiskImage().getId(), getDestinationImageId(), "", getStoragePool().getCompatibilityVersion(), getDiskImage().getContentType()); <START> if (getStorageDomain().getStorageType().isBlockDomain()) { <END> parameters.setImageInitialSizeInBytes(newDiskImage.getActualSizeInBytes()); } return parameters; }</code><technical_language>set initialSize regeardless of storage type. in file domains avoid slow preallocation uploading disk preallocate entire image anyway</technical_language>

Target:
private CreateVolumeVDSCommandParameters getCreateVDSCommandParameters() { CreateVolumeVDSCommandParameters parameters = new CreateVolumeVDSCommandParameters(getStoragePoolId(), getDestinationStorageDomainId(), getImageGroupId(), getImage().getImageId(), getDiskImage().getSize(), newDiskImage.getVolumeType(), newDiskImage.getVolumeFormat(), getDiskImage().getId(), getDestinationImageId(), "", getStoragePool().getCompatibilityVersion(), getDiskImage().getContentType()); parameters.setImageInitialSizeInBytes(newDiskImage.getActualSizeInBytes()); return parameters; }
Source:
<code>public void checkSpecificAccessControl() { if (!userInfo.isInstructor && !userInfo.isAdmin) { throw new UnauthorizedAccessException("Instructor or Admin privilege is required to access this resource."); } String entity = getNonNullRequestParamValue(Const.ParamsNames.ENTITY_TYPE); <START> if (!userInfo.isAdmin && "admin".equals(entity)) { <END> throw new UnauthorizedAccessException("Admin privilege is required to access this resource."); } if (!userInfo.isInstructor && "instructor".equals(entity)) { throw new UnauthorizedAccessException("Instructor privilege is required to access this resource."); } }</code><technical_language>extract admin 'instructor' string a variable/const if possible? suggestion if (!userInfo.isAdmin && entity.equals("admin")) {</technical_language>

Target:
public void checkSpecificAccessControl() { if (!userInfo.isInstructor && !userInfo.isAdmin) { throw new UnauthorizedAccessException("Instructor or Admin privilege is required to access this resource."); } }
Source:
<code>protected Request send(Request request, Endpoint outEndpoint) { OSCoreEndpoint ep = (OSCoreEndpoint) outEndpoint; <START> request.getOptions().setOscore(new byte[0]); <END> ep.sendRequest(request); return request; }</code><technical_language>Please reuse empty byte[0]</technical_language>

Target:
protected Request send(Request request, Endpoint outEndpoint) { OSCoreEndpoint ep = (OSCoreEndpoint) outEndpoint; request.getOptions().setOscore(EMPTY); ep.sendRequest(request); return request; }
Source:
<code>protected JsonObject doBuild(ElasticsearchSearchPredicateContext context, JsonObject outerObject, JsonObject innerObject) { <START> context.explicitNested(); <END> PATH_ACCESSOR.set( innerObject, absoluteFieldPath ); QUERY_ACCESSOR.set( innerObject, nestedBuilder.build( context ) ); outerObject.add( "nested", innerObject ); return outerObject; }</code><technical_language>I another path in LuceneSearchPredicateContext: context is immutable, create another needed. safer me. need some internal state too, this instead: ElasticsearchSearchPredicateContext childContext = context.nest( absoluteFieldPath ); // Returns a new context below: QUERY_ACCESSOR.set( innerObject, nestedBuilder.build( childContext ) );</technical_language>

Target:
protected JsonObject doBuild(ElasticsearchSearchPredicateContext context, JsonObject outerObject, JsonObject innerObject) { ElasticsearchSearchPredicateContext nestedContext = context.explicitNested( absoluteFieldPath ); PATH_ACCESSOR.set( innerObject, absoluteFieldPath ); QUERY_ACCESSOR.set( innerObject, nestedBuilder.build( nestedContext ) ); outerObject.add( "nested", innerObject ); return outerObject; }
Source:
<code>public byte[] toBytes() { ByteBuffer idBuf = ByteBuffer.allocate(sizeInBytes()); idBuf.putShort(version); switch (version) { case BLOB_ID_V1: break; case BLOB_ID_V2: case BLOB_ID_V3: <START> idBuf.put((byte)(type.ordinal())); <END> idBuf.put(datacenterId); idBuf.putShort(accountId); idBuf.putShort(containerId); break; default: throw new IllegalArgumentException("blobId version=" + version + " not supported"); } idBuf.put(partitionId.getBytes()); idBuf.putInt(uuid.getBytes().length); idBuf.put(uuid.getBytes()); return idBuf.array(); }</code><technical_language>setting right bit in flag writing? I is correct setting bit "clearer"</technical_language>

Target:
public byte[] toBytes() { ByteBuffer idBuf = ByteBuffer.allocate(sizeInBytes()); idBuf.putShort(version); switch (version) { case BLOB_ID_V1: break; case BLOB_ID_V2: case BLOB_ID_V3: idBuf.put((byte) (type.ordinal() & 0x3)); idBuf.put(datacenterId); idBuf.putShort(accountId); idBuf.putShort(containerId); break; default: throw new IllegalArgumentException("blobId version=" + version + " not supported"); } idBuf.put(partitionId.getBytes()); idBuf.putInt(uuid.getBytes().length); idBuf.put(uuid.getBytes()); return idBuf.array(); }
Source:
<code>private void setHeaders(ArtifactInputStream ais, HttpServletResponse response, RepositoryFileAttributes fileAttributes, String path) throws IOException { response.setHeader("Accept-Ranges", "bytes"); long totalBytes = 0L; int readLength; byte[] bytes = new byte[4096]; while ((readLength = ais.read(bytes, 0, bytes.length)) != -1) { totalBytes += readLength; } response.setHeader("Content-Length", Long.toString(totalBytes)); <START> response.setHeader("Last-Updated",fileAttributes.lastModifiedTime().toString()); <END> ArtifactControllerHelper.setHeadersForChecksums(ais, response); setMediaTypeHeader(path, response); }</code><technical_language>Cosmetic: Spaces parameters, please</technical_language>

Target:
private void setHeaders(ArtifactInputStream ais, HttpServletResponse response, RepositoryFileAttributes fileAttributes, String path) throws IOException { response.setHeader("Accept-Ranges", "bytes"); if(!response.containsHeader("Content-Length")) { long totalBytes = 0L; int readLength; byte[] bytes = new byte[4096]; while ((readLength = ais.read(bytes, 0, bytes.length)) != -1) { totalBytes += readLength; } response.setHeader("Content-Length", Long.toString(totalBytes)); } response.setHeader("Last-Updated",fileAttributes.lastModifiedTime().toString()); ArtifactControllerHelper.setHeadersForChecksums(ais, response); setMediaTypeHeader(path, response); }
Source:
<code><START> public PasteDescription createPasteDescription() { <END> PasteDescriptionImpl pasteDescription = new PasteDescriptionImpl(); return pasteDescription; }</code><technical_language>Lost @not-generated code</technical_language>

Target:
public PasteDescription createPasteDescription() { PasteDescriptionImpl pasteDescription = new PasteDescriptionSpec(); ContainerViewVariable newViewContainer = createContainerViewVariable(); newViewContainer.setName(IInterpreterSiriusVariables.CONTAINER_VIEW); DropContainerVariable newContainer = createDropContainerVariable(); newContainer.setName(IInterpreterSiriusVariables.CONTAINER); ElementVariable copiedElement = createElementVariable(); copiedElement.setName(IInterpreterSiriusVariables.COPIED_ELEMENT); ElementViewVariable copiedView = createElementViewVariable(); copiedView.setName(IInterpreterSiriusVariables.COPIED_VIEW); pasteDescription.setCopiedElement(copiedElement); pasteDescription.setCopiedView(copiedView); pasteDescription.setContainer(newContainer); pasteDescription.setContainerView(newViewContainer); pasteDescription.setInitialOperation(createInitialOperation()); pasteDescription.setForceRefresh(true); return pasteDescription; }
Source:
<code>protected void setFetchTaskAttributes(Map attributeMap) { this.artifactId = (String) attributeMap.get(ARTIFACT_ID); if (StringUtils.isBlank(this.artifactId)) { return; } String pluginId = (String) attributeMap.get("pluginId"); if (StringUtils.isBlank(pluginId)) { return; } ArtifactPluginInfo artifactPluginInfo = getArtifactPluginInfo(pluginId); if (artifactPluginInfo == null) { return; } <START> for (PluginConfiguration pluginConfiguration : artifactPluginInfo.getFetchArtifactSettings().getConfigurations()) { <END> String key = pluginConfiguration.getKey(); if (attributeMap.containsKey(key)) { if (configuration.getProperty(key) == null) { configuration.addNewConfiguration(pluginConfiguration.getKey(), pluginConfiguration.isSecure()); } configuration.getProperty(key).setConfigurationValue(new ConfigurationValue((String) attributeMap.get(key))); configuration.getProperty(key).handleSecureValueConfiguration(pluginConfiguration.isSecure()); } } }</code><technical_language>Extract a method</technical_language>

Target:
protected void setFetchTaskAttributes(Map attributeMap) { this.artifactId = (String) attributeMap.get(ARTIFACT_ID); if (StringUtils.isBlank(this.artifactId)) { return; } final Map<String, Object> userSpecifiedConfiguration = (Map<String, Object>) attributeMap.get(CONFIGURATION); if (userSpecifiedConfiguration == null) { return; } final String pluginId = (String) attributeMap.get("pluginId"); if (StringUtils.isBlank(pluginId)) { for (String key : userSpecifiedConfiguration.keySet()) { Map<String, String> configurationMetadata = (Map<String, String>) userSpecifiedConfiguration.get(key); if (configurationMetadata != null) { boolean isSecure = Boolean.parseBoolean(configurationMetadata.get("isSecure")); if (configuration.getProperty(key) == null) { configuration.addNewConfiguration(key, isSecure); } if (isSecure) { configuration.getProperty(key).setEncryptedValue(new EncryptedConfigurationValue(configurationMetadata.get("value"))); } else { configuration.getProperty(key).setConfigurationValue(new ConfigurationValue(configurationMetadata.get("value"))); } } } } else { for (Map.Entry<String, Object> configuration : userSpecifiedConfiguration.entrySet()) { this.configuration.addNewConfigurationWithValue(configuration.getKey(), String.valueOf(configuration.getValue()), false); } } }
Source:
<code>public void onCreate() { super.onCreate(); TriggerReceiver.register(this); database = new GcmDatabase(this); heartbeatIntent = PendingIntent.getService(this, 0, new Intent(ACTION_HEARTBEAT, null, this, McsService.class), 0); alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE); powerManager = (PowerManager) getSystemService(POWER_SERVICE); if(mDeviceIdleController == null && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { try { java.lang.reflect.Method method = Class.forName("android.os.ServiceManager").getMethod("getService", String.class); java.lang.reflect.Field field = Context.class.getField("DEVICE_IDLE_CONTROLLER"); IBinder binder = (IBinder) method.invoke(null, field.get(null)); if(binder != null) mDeviceIdleController = IDeviceIdleController.Stub.asInterface(binder); <START> } catch (NoSuchFieldException e) { <END> e.printStackTrace(); } catch (NoSuchMethodException e) { e.printStackTrace(); } catch (ClassNotFoundException e) { e.printStackTrace(); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (java.lang.reflect.InvocationTargetException e) { e.printStackTrace(); } } synchronized (McsService.class) { if (handlerThread == null) { handlerThread = new HandlerThread(); handlerThread.start(); } } }</code><technical_language>If is multiple exceptions care of is thrown handler wildcard catch catch (Exception e)</technical_language>

Target:
public void onCreate() { super.onCreate(); TriggerReceiver.register(this); database = new GcmDatabase(this); heartbeatIntent = PendingIntent.getService(this, 0, new Intent(ACTION_HEARTBEAT, null, this, McsService.class), 0); alarmManager = (AlarmManager) getSystemService(ALARM_SERVICE); powerManager = (PowerManager) getSystemService(POWER_SERVICE); synchronized (McsService.class) { if (handlerThread == null) { handlerThread = new HandlerThread(); handlerThread.start(); } } }
Source:
<code>private static void setCode(Node attrNode, CeType ce, String codeId) { <START> if (attrNode.getNodeName().equalsIgnoreCase(NhincConstants.CE_CODE_ID)) { <END> ce.setCode(attrNode.getNodeValue()); if (LOG.isTraceEnabled()) { LOG.trace(codeId + ": ce.Code = " + ce.getCode()); } } if (attrNode.getNodeName().equalsIgnoreCase(NhincConstants.CE_CODESYS_ID)) { ce.setCodeSystem(attrNode.getNodeValue()); if (LOG.isTraceEnabled()) { LOG.trace(codeId + ": ce.CodeSystem = " + ce.getCodeSystem()); } } if (attrNode.getNodeName().equalsIgnoreCase(NhincConstants.CE_CODESYSNAME_ID)) { ce.setCodeSystemName(attrNode.getNodeValue()); if (LOG.isTraceEnabled()) { LOG.trace(codeId + ": ce.CodeSystemName = " + ce.getCodeSystemName()); } } if (attrNode.getNodeName().equalsIgnoreCase(NhincConstants.CE_DISPLAYNAME_ID)) { ce.setDisplayName(attrNode.getNodeValue()); if (LOG.isTraceEnabled()) { LOG.trace(codeId + ": ce.DisplayName = " + ce.getDisplayName()); } } }</code><technical_language>attrNOde.getNodeName is multiple time, try assign variable compare there. performance due lookup. Also, "constant.equalsIgnoreName("string") prevent NPE (just in cases)</technical_language>

Target:
private static void setCode(Node attrNode, CeType ce, String codeId) { String nodeName = attrNode.getNodeName(); if (NhincConstants.CE_CODE_ID.equalsIgnoreCase(nodeName)) { ce.setCode(attrNode.getNodeValue()); LOG.trace("{}: ce.Code = {}", codeId, ce.getCode()); } if (NhincConstants.CE_CODESYS_ID.equalsIgnoreCase(nodeName)) { ce.setCodeSystem(attrNode.getNodeValue()); LOG.trace("{}: ce.CodeSystem = {}", codeId, ce.getCodeSystem()); } if (NhincConstants.CE_CODESYSNAME_ID.equalsIgnoreCase(nodeName)) { ce.setCodeSystemName(attrNode.getNodeValue()); LOG.trace("{}: ce.CodeSystemName = {}", codeId, ce.getCodeSystemName()); } if (NhincConstants.CE_DISPLAYNAME_ID.equalsIgnoreCase(nodeName)) { ce.setDisplayName(attrNode.getNodeValue()); LOG.trace("{}: ce.DisplayName = {}", codeId, ce.getDisplayName()); } }
Source:
<code>public void findAllSCC(BitSet exception) { ISet nodes = graph.getNodes(); <START> for (int i = 0; i < n; i++) { <END> if (!exception.get(i)) { restriction.set(i, nodes.contains(i)); } } findAllSCCOf(restriction); }</code><technical_language>Iteration bits set false is better: for(int i = exception.nextClearBit(0); i >=0; i = exception.nextClearBit(i)) {</technical_language>

Target:
public void findAllSCC(BitSet exception) { ISet nodes = graph.getNodes(); for (int i = exception.nextClearBit(0); i >= 0 && i < n; i = exception.nextClearBit(i + 1)) { restriction.set(i, nodes.contains(i)); } findAllSCCOf(restriction); }
Source:
<code>public NettyHttpRequestWrapper(HttpRequest httpRequest) { checkNotNull(httpRequest); <START> this.httpRequest = httpRequest; <END> }</code><technical_language>Note put line: this.httpRequest = checkNotNull(httpRequest); This improve readability arguments (and helps spot unchecked arguments)</technical_language>

Target:
public NettyHttpRequestWrapper(HttpRequest httpRequest) { this.httpRequest = checkNotNull(httpRequest); }
Source:
<code>private String getHtmlBegin() { return "<!DOCTYPE html>\n" + "<html>\n" + <START> "<head>\n" + <END> "<meta charset=\"UTF-8\">\n" + "<title>sampleFile - OpenGrok cross reference" + " for /sampleFile</title></head><body>\n"; }</code><technical_language>discarded .xref class, javascript depend this</technical_language>

Target:
private String getHtmlBegin() { return "<!DOCTYPE html>\n" + "<html lang=\"en\">\n" + "<head>\n" + "<meta charset=\"UTF-8\">\n" + "<title>sampleFile - OpenGrok cross reference" + " for /sampleFile</title></head><body>\n"; }