auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void init(final ImmutableMap<String, Object> execEnvVars) { <START> uniqueTupleIndices = new IntObjectHashMap<IntArrayList>(); <END> uniqueTuples = new MutableTupleBuffer(getSchema()); tupleCounts = new MutableTupleBuffer(Schema.of(Arrays.asList(new Type[] { Type.INT_TYPE }), Arrays .asList(new String[] { "count" }))); doCount = new CountProcedure(); }</code><technical_language>I this is other hash aggregators do things, I perf impact (cache misses/RAM footprint/GC) of IntObjectMap vs. IntIntMap is here. hash function is MurmurHash3_128, collision probability is negligible (you need ~2^64 entries expected collision), I harm is in assuming collisions happen</technical_language>

Target:
public void init(final ImmutableMap<String, Object> execEnvVars) { uniqueTupleIndices = new IntObjectHashMap<IntArrayList>(); uniqueTuples = new MutableTupleBuffer(getSchema()); tupleCounts = new MutableTupleBuffer(Schema.ofFields(Type.INT_TYPE, "count")); doCount = new CountProcedure(); }
Source:
<code>public void adjustOffset(Message message, boolean isLegacyConsumer) throws IOException { TopicPartition topicPartition = new TopicPartition(message.getTopic(), message.getKafkaPartition()); long lastSeenOffset = mOffsetTracker.getLastSeenOffset(topicPartition); <START> if (isLegacyConsumer && message.getOffset() < lastSeenOffset + 1) { <END> StatsUtil.incr("secor.consumer_rebalance_count." + topicPartition.getTopic()); LOG.info("offset of message does not follow sequentially the last seen offset {}. " + "Deleting files in topic partition {}", message, lastSeenOffset, topicPartition.getTopic(), topicPartition.getPartition()); mFileRegistry.deleteTopicPartition(topicPartition); if (mDeterministicUploadPolicyTracker != null) { mDeterministicUploadPolicyTracker.reset(topicPartition); } } mOffsetTracker.setLastSeenOffset(topicPartition, message.getOffset()); }</code><technical_language>logic: 'message.getOffset() != lastSeenOffset +1' here</technical_language>

Target:
public void adjustOffset(Message message, boolean isLegacyConsumer) throws IOException { TopicPartition topicPartition = new TopicPartition(message.getTopic(), message.getKafkaPartition()); long lastSeenOffset = mOffsetTracker.getLastSeenOffset(topicPartition); if (isLegacyConsumer && message.getOffset() != lastSeenOffset + 1) { StatsUtil.incr("secor.consumer_rebalance_count." + topicPartition.getTopic()); LOG.info("offset of message does not follow sequentially the last seen offset {}. " + "Deleting files in topic partition {}", message, lastSeenOffset, topicPartition.getTopic(), topicPartition.getPartition()); mFileRegistry.deleteTopicPartition(topicPartition); if (mDeterministicUploadPolicyTracker != null) { mDeterministicUploadPolicyTracker.reset(topicPartition); } } mOffsetTracker.setLastSeenOffset(topicPartition, message.getOffset()); }
Source:
<code><START> private byte countOfNeighbour(int x, int y) { <END> byte count = 0; short posX, posY; for (int i = 0; i < 8; i++) { posX = X((short) (x + neighbourCell[i][0])); posY = Y((short) (y + neighbourCell[i][1])); count += currentGeneration[posX][posY]; } return count; }</code><technical_language>"positionX" "positionY"</technical_language>

Target:
private byte countOfNeighbour(int x, int y) { byte count = 0; short posX, posY; int neighbourCount = 8; for (int i = 0; i < neighbourCount; i++) { posX = X((short) (x + neighbourCell[i][0])); posY = Y((short) (y + neighbourCell[i][1])); count += currentGeneration[posX][posY]; } return count; }
Source:
<code>protected List<LUNs> getLunsToUpdateInDb(List<LUNs> lunsFromVgInfo, List<LUNs> lunsFromDb) { List<LUNs> lunsToUpdateInDb = new LinkedList<>(); Map<String, LUNs> lunsFromDbLunIdMap = lunsFromDb.stream().collect(Collectors.toMap(LUNs::getLUNId, Function.identity())); Map<String, LUNs> lunsFromDbPvIdMap = lunsFromDb.stream().collect(Collectors.toMap(LUNs::getPhysicalVolumeId, Function.identity())); for (LUNs lunFromVgInfo : lunsFromVgInfo) { boolean lunIdExistsInDb = lunsFromDbLunIdMap.containsKey(lunFromVgInfo.getLUNId()); boolean pvIdExistsInDb = lunsFromDbPvIdMap.containsKey(lunFromVgInfo.getPhysicalVolumeId()); if <START> (lunIdExistsInDb && pvIdExistsInDb) { <END> LUNs lunFromDb = lunsFromDbLunIdMap.get(lunFromVgInfo.getLUNId()); if (lunFromDb.getDeviceSize() != lunFromVgInfo.getDeviceSize()) { lunsToUpdateInDb.add(lunFromVgInfo); } } else { lunsToUpdateInDb.add(lunFromVgInfo); } } return lunsToUpdateInDb; }</code><technical_language>Highly unlikely, if lun storage lunIdX a pvIdX</technical_language>

Target:
protected Map<Consumer<List<LUNs>>, List<LUNs>> getLunsToUpdateInDb(List<LUNs> lunsFromVgInfo, List<LUNs> lunsFromDb) { Map<String, LUNs> lunsFromDbMap = lunsFromDb.stream().collect(Collectors.toMap(LUNs::getLUNId, Function.identity())); return lunsFromVgInfo.stream().collect(Collectors.groupingBy(lunFromVgInfo -> { LUNs lunFromDb = lunsFromDbMap.get(lunFromVgInfo.getLUNId()); if (lunFromDb == null) { return saveNewLuns; } boolean lunFromDbHasSamePvId = Objects.equals( lunFromDb.getPhysicalVolumeId(), lunFromVgInfo.getPhysicalVolumeId()); if (lunFromDbHasSamePvId) { if (lunFromDb.getDeviceSize() != lunFromVgInfo.getDeviceSize()) { return updateExistingLuns; } return noOp; } return updateExistingLuns; })); }
Source:
<code>private boolean updateShape(BundledImage bundledImage) { boolean updated = false; if (bundledImage != null && bundledImage.getShape() != null) { String newShapeName = bundledImage.getShape().getName(); if (!StringUtil.isEmpty(newShapeName) && !newShapeName.equals(getShapeName())) { if (newShapeName.equals(BundledImageShape.PROVIDED_SHAPE_LITERAL.getName())) { String providedShapeURI = bundledImage.getProvidedShapeURI(); <START> IExtensionRegistry reg1 = Platform.getExtensionRegistry(); IConfigurationElement[] elements = reg1.getConfigurationElementsFor("org.eclipse.sirius.diagram.bundleImageShape"); for (IConfigurationElement configurationElement : elements) { <END> String identifier = ((ExtensionHandle) configurationElement.getParent()).getSimpleIdentifier(); if (identifier != null && identifier.equals(providedShapeURI)) { final String path = configurationElement.getAttribute("imagePath"); String imageFileURI = "platform:/plugin" + path; this.setURI(imageFileURI, false); this.setShapeName(configurationElement.getAttribute("label")); } } } else { this.setURI(getImageFileURI(newShapeName), false); this.setShapeName(newShapeName); } updated = true; } } return updated; }</code><technical_language>Similar code other commits. preferable "centralize" access this extension point in a class</technical_language>

Target:
private boolean updateShape(BundledImage bundledImage) { boolean updated = false; if (bundledImage != null && bundledImage.getShape() != null) { String newShapeName = bundledImage.getShape().getName(); if (!StringUtil.isEmpty(newShapeName) && !newShapeName.equals(getShapeName())) { if (newShapeName.equals(BundledImageShape.PROVIDED_SHAPE_LITERAL.getName())) { String providedShapeURI = bundledImage.getProvidedShapeURI(); IConfigurationElement extension = getBundledImageExtensionQuery().getExtensionDefiningProvidedShapeURI(providedShapeURI); if (extension != null) { final String path = bundledImageExtensionQuery.getImagePath(extension); String imageFileURI = "platform:/plugin" + path; this.setURI(imageFileURI, false); this.setShapeName(BundledImageShape.PROVIDED_SHAPE_LITERAL.getName()); } } else { this.setURI(getImageFileURI(newShapeName), false); this.setShapeName(newShapeName); } updated = true; } } return updated; }
Source:
<code><START> private Summary(Builder b) { <END> super(b); this.quantiles = Collections.unmodifiableList(new ArrayList<Double>(b.quantiles)); this.highestToLowestValueRatio = b.highestToLowestValueRatio; this.numberOfSignificantValueDigits = b.numberOfSignificantValueDigits; this.maxAgeSeconds = b.maxAgeSeconds; this.ageBuckets = b.ageBuckets; initializeNoLabelsChild(); }</code><technical_language>Please leave visibility as-is</technical_language>

Target:
Summary(Builder b) { super(b); this.quantiles = Collections.unmodifiableList(new ArrayList<Double>(b.quantiles)); this.highestToLowestValueRatio = b.highestToLowestValueRatio; this.numberOfSignificantValueDigits = b.numberOfSignificantValueDigits; this.maxAgeSeconds = b.maxAgeSeconds; this.ageBuckets = b.ageBuckets; initializeNoLabelsChild(); }
Source:
<code>public String convertToDatabaseColumn(List<Checksum> checksums) { <START> StringBuilder sb = new StringBuilder(); <END> if (!checksums.isEmpty() && checksums != null) { try { for (Checksum c : checksums) { sb.append(c.getType().trim() + ":" + c.getChecksum().trim()); sb.append(","); } } catch (NullPointerException ex) { LOG.error("Could not convert checksum(s) to string for database", ex); return null; } return sb.toString().replaceAll(",$", ""); } return null; }</code><technical_language><LINK_0> a bit verbose, a high priority</technical_language>

Target:
public String convertToDatabaseColumn(List<Checksum> checksums) { if (checksums != null && !checksums.isEmpty()) { try { return checksums.stream().map(checksum -> checksum.getType().trim() + ":" + checksum.getChecksum().trim()).collect(Collectors.joining(",")); } catch (NullPointerException ex) { LOG.error("Could not convert checksum(s) to string for database", ex); return null; } } return null; }
Source:
<code>public void testNotificationSerialisation() throws Throwable { JsonNode payload = BugsnagTestUtils.mapReportToJson(config, this.report); JsonNode notifier = payload.get("notifier"); assertEquals("Bugsnag Spring", notifier.get("name").asText()); assertEquals("<LINK_0>", notifier.get("url").asText()); <START> assertNotNull(notifier.get("version").asText()); <END> }</code><technical_language>I check version is non-empty, for sessions other NotifierTest class</technical_language>

Target:
public void testNotificationSerialisation() throws Throwable { JsonNode payload = BugsnagTestUtils.mapReportToJson(config, this.report); JsonNode notifier = payload.get("notifier"); assertEquals("Bugsnag Spring", notifier.get("name").asText()); assertEquals("<LINK_0>", notifier.get("url").asText()); assertFalse(notifier.get("version").asText().isEmpty()); }
Source:
<code>private boolean doSend(MessageChannel channel, final Message<?> messageToSend) { try { this.messagingTemplate.send(channel, messageToSend); return true; } catch (MessagingException e) { if (!this.ignoreSendFailures) { throw e; } else if (this.logger.isDebugEnabled()) { <START> this.logger.debug(e); <END> } return false; } }</code><technical_language>I reason wrap isDebugEnabled() do logic argument log</technical_language>

Target:
private boolean doSend(MessageChannel channel, final Message<?> messageToSend) { try { this.messagingTemplate.send(channel, messageToSend); return true; } catch (MessagingException e) { if (!this.ignoreSendFailures) { throw e; } this.logger.debug("Send failure ignored", e); return false; } }
Source:
<code>public void accumulate(final long[] values, final int from, final int to) { if (double_accumulator == null && long_accumulator == null) { long_accumulator = Arrays.copyOfRange(values, from, to); return; } <START> if (long_accumulator != null) { <END> } else { if (to - from != double_accumulator.length) { throw new IllegalArgumentException("Values of length " + (to - from) + " did not match the original lengh of " + double_accumulator.length); } int idx = 0; for (int i = from; i < to; i++) { if (Double.isNaN(double_accumulator[idx])) { double_accumulator[idx] = values[i]; } idx++; } } }</code><technical_language>inverted condition instead of a no-op? And, understand this. array of long values filling array of doubles</technical_language>

Target:
public void accumulate(final long[] values, final int from, final int to) { if (double_accumulator == null && long_accumulator == null) { long_accumulator = Arrays.copyOfRange(values, from, to); return; } if (long_accumulator == null) { if (to - from != double_accumulator.length) { throw new IllegalArgumentException("Values of length " + (to - from) + " did not match the original lengh of " + double_accumulator.length); } int idx = 0; for (int i = from; i < to; i++) { if (Double.isNaN(double_accumulator[idx])) { double_accumulator[idx] = values[i]; } idx++; } } }
Source:
<code>public void renameScriptShell(String newName) throws PartInitException { Display.getDefault().asyncExec(() -> { try { final ScriptShell <START> scriptShellView = (ScriptShell) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage() <END> .showView(ScriptShell.VIEW_ID); scriptShellView.changePartName(newName); } catch (final PartInitException e) { throw new RuntimeException(e); } }); }</code><technical_language>work for views if multiple. pick current view if is a shell view. If not, try find out if is shell view rename one. If multiple of is active view rename</technical_language>

Target:
public void renameScriptShell(String newName) throws PartInitException { Display.getDefault().asyncExec(() -> { final IWorkbenchPart part = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart(); if (part instanceof ScriptShell) { ((ScriptShell) part).changePartName(newName); } else { ScriptShell scriptShellView = null; try { scriptShellView = (ScriptShell) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView(ScriptShell.VIEW_ID); } catch (final PartInitException e) { e.printStackTrace(); } scriptShellView.changePartName(newName); } }); }
Source:
<code>public void onSlotClick(int slotId, int clickedButton, int mode, EntityPlayer player, CallbackInfoReturnable<net.minecraft.item.ItemStack> ci) { if (slotId >= inventorySlots.size()) { if (player instanceof EntityPlayerMP) { ((EntityPlayerMP) player).playerNetServerHandler .kickPlayerFromServer("You have been kicked for attempting to click an out of bounds slot."); ci.setReturnValue(null); <START> ci.cancel(); <END> } } }</code><technical_language>setReturnValue cancels callback automatically, this method call is redundant</technical_language>

Target:
public void onSlotClick(int slotId, int clickedButton, int mode, EntityPlayer player, CallbackInfoReturnable<net.minecraft.item.ItemStack> ci) { if (slotId >= inventorySlots.size()) { if (player instanceof EntityPlayerMP) { ((EntityPlayerMP) player).playerNetServerHandler .kickPlayerFromServer("You have been kicked for attempting to click an out of bounds slot."); ci.setReturnValue(null); } } }
Source:
<code>public DirectPipelineWriter(long destConglomerate, TxnView txn, byte[] token, OperationContext opCtx, boolean skipIndex, String tableVersion){ <START> this.destConglomerate=destConglomerate; <END> this.txn=txn; this.token=token; this.opCtx=opCtx; this.skipIndex=skipIndex; }</code><technical_language>this.tableVersion = tableVersion is missing</technical_language>

Target:
public DirectPipelineWriter(long destConglomerate, TxnView txn, byte[] token, OperationContext opCtx, boolean skipIndex, String tableVersion){ this.destConglomerate=destConglomerate; this.txn=txn; this.token=token; this.opCtx=opCtx; this.skipIndex=skipIndex; this.tableVersion = tableVersion; }
Source:
<code>public void init() { if (org.bridj.Platform.isWindows() && WindowsUtil.isAdmin()) { CountDownLatch waitForUserInput = new CountDownLatch(1); Platform.runLater(() -> { Alert alert = new Alert(AlertType.WARNING, "Please don't run the client as admin. Because if you do you might need to delete C:\\ProgramData\\FAForever to be able to run it as a normal user again. Do you want to ignore the warning and continue?", ButtonType.YES, ButtonType.NO); Optional<ButtonType> buttonType = alert.showAndWait(); if (!buttonType.isPresent() || (buttonType.get() == ButtonType.NO)) { System.exit(EXIT_STATUS_RAN_AS_ADMIN); } waitForUserInput.countDown(); }); noCatch((NoCatchRunnable) waitForUserInput::await); } Font.loadFont(FafClientApplication.class.getResourceAsStream("/font/dfc-icons.ttf"), 10); JavaFxUtil.fixTooltipDuration(); <START> applicationContext = new SpringApplicationBuilder(FafClientApplication.class, ForgedAlliancePrefs.class) <END> .profiles(getAdditionalProfiles()) .bannerMode(Mode.OFF) .run(getParameters().getRaw().toArray(new String[0])); }</code><technical_language>is done</technical_language>

Target:
public void init() { if (org.bridj.Platform.isWindows() && WindowsUtil.isAdmin()) { CountDownLatch waitForUserInput = new CountDownLatch(1); Platform.runLater(() -> { Alert alert = new Alert(AlertType.WARNING, "Please don't run the client as admin. Because if you do you might need to delete C:\\ProgramData\\FAForever to be able to run it as a normal user again. Do you want to ignore the warning and continue?", ButtonType.YES, ButtonType.NO); Optional<ButtonType> buttonType = alert.showAndWait(); if (!buttonType.isPresent() || (buttonType.get() == ButtonType.NO)) { System.exit(EXIT_STATUS_RAN_AS_ADMIN); } waitForUserInput.countDown(); }); noCatch((NoCatchRunnable) waitForUserInput::await); } Font.loadFont(FafClientApplication.class.getResourceAsStream("/font/dfc-icons.ttf"), 10); JavaFxUtil.fixTooltipDuration(); applicationContext = new SpringApplicationBuilder(FafClientApplication.class) .profiles(getAdditionalProfiles()) .bannerMode(Mode.OFF) .run(getParameters().getRaw().toArray(new String[0])); }
Source:
<code>public final Object getData(String sessionId, String key, boolean refresh) { Date now = new Date(); SessionInfo sessionInfo = getSessionInfo(sessionId); Object value = null; if (sessionInfo != null) { if (refresh) { synchronized (sessionInfo) { Date softLimit = (Date) sessionInfo.sessionMap.get(SOFT_LIMIT_PARAMETER_NAME); if (softLimit == null) { softLimit = now; <START> } <END> softLimit = DateUtils.addMinutes(softLimit, 2 * Config.<Integer> getValue(ConfigValues.UserSessionTimeOutInterval)); sessionInfo.sessionMap.put(SOFT_LIMIT_PARAMETER_NAME, softLimit); } } value = sessionInfo.sessionMap.get(key); } return value; }</code><technical_language>null? if is null means soft limit, no</technical_language>

Target:
public final Object getData(String sessionId, String key, boolean refresh) { Date now = new Date(); SessionInfo sessionInfo = getSessionInfo(sessionId); Object value = null; if (sessionInfo != null) { if (refresh) { synchronized (sessionInfo) { Date softLimit = (Date) sessionInfo.contentOfSession.get(SOFT_LIMIT_PARAMETER_NAME); if (softLimit == null) { softLimit = now; } softLimit = DateUtils.addMinutes(softLimit, Config.<Integer> getValue(ConfigValues.UserSessionTimeOutInterval)); sessionInfo.contentOfSession.put(SOFT_LIMIT_PARAMETER_NAME, softLimit); } } value = sessionInfo.contentOfSession.get(key); } return value; }
Source:
<code>public void testGetPrivateKeyAsHex() throws Exception { ECKey key = ECKey.fromPrivate(BigInteger.TEN).decompress(); <START> assertEquals("a", key.getPrivateKeyAsHex()); <END> }</code><technical_language>expect "0a" honest. oldschool, hex viewers in hacking past</technical_language>

Target:
public void testGetPrivateKeyAsHex() throws Exception { ECKey key = ECKey.fromPrivate(BigInteger.TEN).decompress(); assertEquals("000000000000000000000000000000000000000000000000000000000000000a", key.getPrivateKeyAsHex()); }
Source:
<code>public void suggestChangeReviewer(final Change.Id change, final String query, final int limit, final AsyncCallback<List<ReviewerInfo>> callback) { run(callback, new Action<List<ReviewerInfo>>() { public List<ReviewerInfo> run(final ReviewDb db) throws OrmException { final ChangeControl changeControl; try { changeControl = changeControlFactory.controlFor(change); } catch (NoSuchChangeException e) { return Collections.emptyList(); } VisibilityControl visibilityControl = new VisibilityControl() { @Override public boolean isVisible(Account account) throws OrmException { IdentifiedUser who = identifiedUserFactory.create(reviewDbProvider, account.getId()); <START> return changeControl.getChange().getStatus() == Change.Status.DRAFT || <END> changeControl.forUser(who).isVisible(reviewDbProvider.get()); } }; final List<AccountInfo> suggestedAccounts = suggestAccount(db, query, Boolean.TRUE, limit, visibilityControl); final List<ReviewerInfo> reviewer = new ArrayList<ReviewerInfo>(suggestedAccounts.size()); for (final AccountInfo a : suggestedAccounts) { reviewer.add(new ReviewerInfo(a)); } final List<GroupReference> suggestedAccountGroups = suggestAccountGroup(db, query, limit); for (final GroupReference g : suggestedAccountGroups) { if (suggestGroupAsReviewer(changeControl.getProject().getNameKey(), g)) { reviewer.add(new ReviewerInfo(g)); } } Collections.sort(reviewer); if (reviewer.size() <= limit) { return reviewer; } else { return reviewer.subList(0, limit); } } }); }</code><technical_language>This needs based destination ref of change instead of change visibility draft status</technical_language>

Target:
public void suggestChangeReviewer(final Change.Id change, final String query, final int limit, final AsyncCallback<List<ReviewerInfo>> callback) { run(callback, new Action<List<ReviewerInfo>>() { public List<ReviewerInfo> run(final ReviewDb db) throws OrmException { final ChangeControl changeControl; try { changeControl = changeControlFactory.controlFor(change); } catch (NoSuchChangeException e) { return Collections.emptyList(); } VisibilityControl visibilityControl = new VisibilityControl() { @Override public boolean isVisible(Account account) throws OrmException { IdentifiedUser who = identifiedUserFactory.create(reviewDbProvider, account.getId()); return changeControl.forUser(who).isRefVisible(); } }; final List<AccountInfo> suggestedAccounts = suggestAccount(db, query, Boolean.TRUE, limit, visibilityControl); final List<ReviewerInfo> reviewer = new ArrayList<ReviewerInfo>(suggestedAccounts.size()); for (final AccountInfo a : suggestedAccounts) { reviewer.add(new ReviewerInfo(a)); } final List<GroupReference> suggestedAccountGroups = suggestAccountGroup(db, query, limit); for (final GroupReference g : suggestedAccountGroups) { if (suggestGroupAsReviewer(changeControl.getProject().getNameKey(), g)) { reviewer.add(new ReviewerInfo(g)); } } Collections.sort(reviewer); if (reviewer.size() <= limit) { return reviewer; } else { return reviewer.subList(0, limit); } } }); }
Source:
<code>public String toString() { StringBuilder sb = new StringBuilder(); sb.append("UndeleteRequest["); sb.append("BlobID=").append(blobId); sb.append(", ").append("PartitionId=").append(blobId.getPartition()); sb.append(", ").append("ClientId=").append(clientId); sb.append(", ").append("CorrelationId=").append(correlationId); sb.append(", ").append("AccountId=").append(blobId.getAccountId()); sb.append(", ").append("ContainerId=").append(blobId.getContainerId()); sb.append("]"); <START> return sb.toString(); <END> }</code><technical_language>append operationTimeMs</technical_language>

Target:
public String toString() { StringBuilder sb = new StringBuilder(); sb.append("UndeleteRequest["); sb.append("BlobID=").append(blobId); sb.append(", ").append("PartitionId=").append(blobId.getPartition()); sb.append(", ").append("ClientId=").append(clientId); sb.append(", ").append("CorrelationId=").append(correlationId); sb.append(", ").append("AccountId=").append(blobId.getAccountId()); sb.append(", ").append("ContainerId=").append(blobId.getContainerId()); sb.append(", ").append("OperationTimeMs=").append(operationTimeMs); sb.append("]"); return sb.toString(); }
Source:
<code>public void registerTransformers(SubsystemTransformerRegistration subsystem) { ResourceTransformationDescriptionBuilder builder = TransformationDescriptionBuilder.Factory.createSubsystemInstance(); builder.getAttributeBuilder().setDiscard(new DiscardAttributeChecker.DefaultDiscardAttributeChecker() { @Override protected boolean isValueDiscardable(PathAddress address, String attributeName, ModelNode attributeValue, TransformationContext context) { return attributeValue.isDefined() && attributeValue.equals(XTSSubsystemDefinition.HOST_NAME.getDefaultValue()); } }, XTSSubsystemDefinition.HOST_NAME) .setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(new ModelNode(false)), XTSSubsystemDefinition.DEFAULT_CONTEXT_PROPAGATION, XTSSubsystemDefinition.ASYNC_REGISTRATION) .addRejectCheck(RejectAttributeChecker.DEFINED, XTSSubsystemDefinition.HOST_NAME, XTSSubsystemDefinition.DEFAULT_CONTEXT_PROPAGATION, XTSSubsystemDefinition.ASYNC_REGISTRATION) .end(); <START> TransformationDescription.Tools.register(builder.build(), subsystem, ModelVersion.create(1, 1, 0)); <END> }</code><technical_language>need transform for attribute for version 2.1.0. I recommend for usage of ChainedTransformationDescriptionBuilder easier add transformers in place forward</technical_language>

Target:
public void registerTransformers(SubsystemTransformerRegistration subsystem) { ChainedTransformationDescriptionBuilder chainedBuilder = TransformationDescriptionBuilder.Factory.createChainedSubystemInstance(XTSExtension.CURRENT_MODEL_VERSION); ResourceTransformationDescriptionBuilder builderEap72 = chainedBuilder.createBuilder(XTSExtension.CURRENT_MODEL_VERSION, MODEL_VERSION_EAP71); builderEap72.getAttributeBuilder() .addRejectCheck(RejectAttributeChecker.DEFINED, XTSSubsystemDefinition.ASYNC_REGISTRATION) .setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(new ModelNode(false)), XTSSubsystemDefinition.ASYNC_REGISTRATION) .end(); ResourceTransformationDescriptionBuilder builderEap70 = chainedBuilder.createBuilder(MODEL_VERSION_EAP71, MODEL_VERSION_EAP64); builderEap70.getAttributeBuilder() .addRejectCheck(RejectAttributeChecker.DEFINED, XTSSubsystemDefinition.HOST_NAME, XTSSubsystemDefinition.DEFAULT_CONTEXT_PROPAGATION) .setDiscard(new DiscardAttributeChecker.DiscardAttributeValueChecker(new ModelNode(false)), XTSSubsystemDefinition.DEFAULT_CONTEXT_PROPAGATION) .setDiscard(new DiscardAttributeChecker.DefaultDiscardAttributeChecker() { @Override protected boolean isValueDiscardable(PathAddress address, String attributeName, ModelNode attributeValue, TransformationContext context) { return attributeValue.isDefined() && attributeValue.equals(XTSSubsystemDefinition.HOST_NAME.getDefaultValue()); } }, XTSSubsystemDefinition.HOST_NAME) .end(); chainedBuilder.buildAndRegister(subsystem, new ModelVersion[]{ MODEL_VERSION_EAP64, MODEL_VERSION_EAP71, }); }
Source:
<code>protected boolean isUnicityCheckEnabled() { <START> return Framework.getRuntime().getService(FileManager.class).isUnicityEnabled(); <END> }</code><technical_language>suggestion return Framework.getService(FileManager.class).isUnicityEnabled();</technical_language>

Target:
protected boolean isUnicityCheckEnabled() { return Framework.getService(FileManager.class).isUnicityEnabled(); }
Source:
<code>public void start() { JobModel jobModel = null; try { jobModel = getJobModel(); CheckpointManager checkpointManager = new TaskConfigJava(jobModel.getConfig()).getCheckpointManager(null); if (checkpointManager != null) { <START> checkpointManager.createStream(); <END> } } catch (Exception e) { LOGGER.error("Exception while trying to getJobModel.", e); if (coordinatorListener != null) { coordinatorListener.onCoordinatorFailure(e); } } if (jobModel != null && jobModel.getContainers().containsKey(processorId)) { if (coordinatorListener != null) { coordinatorListener.onNewJobModel(processorId, jobModel); } } else { stop(); } }</code><technical_language>this need create changelog/coordinator streams</technical_language>

Target:
public void start() { JobModel jobModel = null; try { jobModel = getJobModel(); CheckpointManager checkpointManager = new TaskConfigJava(jobModel.getConfig()).getCheckpointManager(null); if (checkpointManager != null) { checkpointManager.createResources(); } } catch (Exception e) { LOGGER.error("Exception while trying to getJobModel.", e); if (coordinatorListener != null) { coordinatorListener.onCoordinatorFailure(e); } } if (jobModel != null && jobModel.getContainers().containsKey(processorId)) { if (coordinatorListener != null) { coordinatorListener.onNewJobModel(processorId, jobModel); } } else { stop(); } }
Source:
<code>private void refreshTagsFromFile(final Path path) { <START> try (final Stream<String> lines = Files.lines(path)) { <END> lines.forEach(label -> { final String[] labelParts = label.split("=", 2); tags.put(labelParts[0], labelParts[1]); }); } catch (IOException e) { throw new RuntimeException(e); } }</code><technical_language>Is of executor justified ? a constructor tag reference is thread yet</technical_language>

Target:
private void refreshTagsFromFile(final Path path) { try (final Stream<String> lines = Files.lines(path)) { lines.forEach(label -> { final String[] labelParts = label.split("=", 2); if (tags.get(labelParts[0]) != null) { tags.put(labelParts[0], labelParts[1].replace("\"", "")); } }); } catch (IOException e) { } }
Source:
<code>public void testWordCount() throws Exception { int wordCount = 2732; String myFile = createFile(wordCount); BulkCommand command = new BulkCommand.Builder(WordCountAction.ACTION_NAME, myFile, "system").useGenericScrollerType().build(); String commandId = bulkService.submit(command); BulkStatus status = bulkService.getStatus(commandId); assertTrue(bulkService.await(commandId, Duration.ofSeconds(20))); status = bulkService.getStatus(commandId); assertEquals(COMPLETED, status.getState()); assertEquals(wordCount, status.getResult().get("wordCount")); <START> System.out.println(status); <END> }</code><technical_language>Remaining System out</technical_language>

Target:
public void testWordCount() throws Exception { int wordCount = 2732; String myFile = createFile(wordCount); BulkCommand command = new BulkCommand.Builder(WordCountAction.ACTION_NAME, myFile, "system").useGenericScroller().build(); String commandId = bulkService.submit(command); assertTrue(bulkService.await(commandId, Duration.ofSeconds(20))); BulkStatus status = bulkService.getStatus(commandId); assertEquals(COMPLETED, status.getState()); assertEquals(wordCount, status.getResult().get("wordCount")); }
Source:
<code><START> public int delete(ComplexEventChunk<StateEvent> deletingEventChunk, Object storeEvents) { <END> int numberOfEventsBeforeDelete = ((IndexedEventHolder) storeEvents).getAllEvents().size(); deletingEventChunk.reset(); while (deletingEventChunk.hasNext()) { StateEvent deletingEvent = deletingEventChunk.next(); collectionExecutor.delete(deletingEvent, (IndexedEventHolder) storeEvents); } return numberOfEventsBeforeDelete - ((IndexedEventHolder) storeEvents).getAllEvents().size(); }</code><technical_language>Delete return total events deleted number of events</technical_language>

Target:
public void delete(ComplexEventChunk<StateEvent> deletingEventChunk, Object storeEvents) { deletingEventChunk.reset(); while (deletingEventChunk.hasNext()) { StateEvent deletingEvent = deletingEventChunk.next(); collectionExecutor.delete(deletingEvent, (IndexedEventHolder) storeEvents); } }
Source:
<code>private Boolean checkSchemaVersion() { String sqlStatement = "SELECT a.value creationMajorVersion, b.value creationMinorVersion FROM tsk_db_info_extended a, tsk_db_info_extended b " + " WHERE a.name = 'CREATION_SCHEMA_MAJOR_VERSION' and b.name = 'CREATION_SCHEMA_MINOR_VERSION';"; try (CaseDbQuery query = Case.getCurrentCaseThrows().getSleuthkitCase().executeQuery(sqlStatement);) { ResultSet schemaVersion = query.getResultSet(); while (schemaVersion.next()) { int creationMajorVersion = schemaVersion.getInt("creationMajorVersion"); int creationMinorVersion = schemaVersion.getInt("creationMinorVersion"); if ((creationMajorVersion == 8 && creationMinorVersion >= 3) || creationMajorVersion > 8) { schemaVersion.close(); return true; } } <START> schemaVersion.close(); <END> } catch (SQLException | TskCoreException | NoCurrentCaseException ex) { logger.log(Level.SEVERE, "Failed to get the Create Major and Minor Schema Versions", ex); } return false; }</code><technical_language>SleuthkitCase.CaseDbQuery takes care of closing ResultSet</technical_language>

Target:
private Boolean checkSchemaVersion() { try { CaseDbSchemaVersionNumber creationVersion = Case.getCurrentCaseThrows().getSleuthkitCase().getDBSchemaCreationVersion(); if ((creationVersion.getMajor() == 8 && creationVersion.getMinor() >= 3) || creationVersion.getMajor() > 8) { return true; } } catch (NoCurrentCaseException ex) { logger.log(Level.WARNING, "Failed to get creation schema version: ", ex); } return false; }
Source:
<code>public String expand(Map<String, ?> variables) { String expanded = super.expand(variables); if (this.json) { expanded = expanded.substring( expanded.indexOf(JSON_TOKEN_START_ENCODED) + JSON_TOKEN_START_ENCODED.length()); expanded = JSON_TOKEN_START + expanded; expanded = expanded.substring(0, expanded.lastIndexOf(JSON_TOKEN_END_ENCODED)); <START> expanded += JSON_TOKEN_END; <END> } return expanded; }</code><technical_language>a StringBuilder</technical_language>

Target:
public String expand(Map<String, ?> variables) { String expanded = super.expand(variables); if (this.json) { StringBuilder sb = new StringBuilder(); sb.append(JSON_TOKEN_START); sb.append(expanded, expanded.indexOf(JSON_TOKEN_START_ENCODED) + JSON_TOKEN_START_ENCODED.length(), expanded.lastIndexOf(JSON_TOKEN_END_ENCODED)); sb.append(JSON_TOKEN_END); return sb.toString(); } return expanded; }
Source:
<code>public static Set<Class<?>> getFromJARFile(final ClassLoader loader, final String jar, final String packageName, final boolean ignoreSubPackages) throws IOException, ClassNotFoundException { final Set<Class<?>> classes = new HashSet<Class<?>>(); final JarInputStream jarFile = new JarInputStream(new FileInputStream(jar)); try { JarEntry jarEntry; do { jarEntry = jarFile.getNextJarEntry(); if (jarEntry != null) { String className = jarEntry.getName(); if (className.endsWith(".class")) { String classPackageName = getPackageName(className); if ((ignoreSubPackages && classPackageName.equals(packageName)) || (!ignoreSubPackages && isSubPackage( <START> classPackageName, packageName))) { <END> className = stripFilenameExtension(className); classes.add(Class.forName(className.replace('/', '.'), true, loader)); } } } } while (jarEntry != null); } finally { jarFile.close(); } return classes; }</code><technical_language>clause need check equals(). checking ignoreSubPackages is a bit redundant</technical_language>

Target:
public static Set<Class<?>> getFromJARFile(final ClassLoader loader, final String jar, final String packageName, final boolean ignoreSubPackages) throws IOException, ClassNotFoundException { final Set<Class<?>> classes = new HashSet<Class<?>>(); final JarInputStream jarFile = new JarInputStream(new FileInputStream(jar)); try { JarEntry jarEntry; do { jarEntry = jarFile.getNextJarEntry(); if (jarEntry != null) { String className = jarEntry.getName(); if (className.endsWith(".class")) { String classPackageName = getPackageName(className); if (classPackageName.equals(packageName) || (!ignoreSubPackages && isSubPackage(classPackageName, packageName))) { className = stripFilenameExtension(className); classes.add(Class.forName(className.replace('/', '.'), true, loader)); } } } } while (jarEntry != null); } finally { jarFile.close(); } return classes; }
Source:
<code>public MavenProject buildProjectFromArtifact(Artifact artifact) throws MojoExecutionException { MavenProject mavenProject; Artifact projectArtifact = repositorySystem.createProjectArtifact(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion()); try { mavenProject = projectBuilder.build(projectArtifact, projectBuildingRequest).getProject(); } catch (ProjectBuildingException e) { <START> log <END> .warn(format("The artifact [%s] seems to have some warnings, enable logs for more information", artifact.toString())); if (log.isDebugEnabled()) { log.warn(format("The artifact [%s] had the following issue ", artifact.toString()), e); } if (e.getResults() == null || e.getResults().size() != 1) { throw new MojoExecutionException( format("There was an issue while trying to create a maven project from the artifact [%s]", artifact.toString()), e); } final ProjectBuildingResult projectBuildingResult = e.getResults().get(0); final List<ModelProblem> collect = projectBuildingResult.getProblems().stream() .filter(modelProblem -> modelProblem.getSeverity().equals(ModelProblem.Severity.FATAL)).collect( Collectors.toList()); if (!collect.isEmpty()) { throw new MojoExecutionException(format( "There was an issue while trying to create a maven project from the artifact [%s], several FATAL errors were found", artifact.toString()), e); } mavenProject = projectBuildingResult.getProject(); } return mavenProject; }</code><technical_language>this if purpose? If please remove it, is sense in this kind of checks wanted show a warn if if debug is enabled</technical_language>

Target:
public MavenProject buildProjectFromArtifact(Artifact artifact) throws MojoExecutionException { MavenProject mavenProject; Artifact projectArtifact = repositorySystem.createProjectArtifact(artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion()); try { mavenProject = projectBuilder.build(projectArtifact, projectBuildingRequest).getProject(); } catch (ProjectBuildingException e) { if (log.isDebugEnabled()) { log.warn(format("The artifact [%s] had the following issue ", artifact.toString()), e); } if (e.getResults() == null || e.getResults().size() != 1) { throw new MojoExecutionException( format("There was an issue while trying to create a maven project from the artifact [%s]", artifact.toString()), e); } final ProjectBuildingResult projectBuildingResult = e.getResults().get(0); final List<ModelProblem> collect = projectBuildingResult.getProblems().stream() .filter(modelProblem -> modelProblem.getSeverity().equals(ModelProblem.Severity.FATAL)).collect( Collectors.toList()); if (!collect.isEmpty()) { throw new MojoExecutionException(format( "There was an issue while trying to create a maven project from the artifact [%s], several FATAL errors were found", artifact.toString()), e); } mavenProject = projectBuildingResult.getProject(); } return mavenProject; }
Source:
<code>public ByteBufferInputStream getStream() { if (stream != null) { return stream; } if (byteBuf == null) { return null; } ByteBuffer temp = ByteBuffer.allocate(byteBuf.readableBytes()); <START> byteBuf.writeBytes(temp); <END> byteBuf.release(); byteBuf = null; stream = new ByteBufferInputStream(temp); return stream; }</code><technical_language>writeBytes here? I feel supposed readBytes byteBuf temp, right</technical_language>

Target:
public ByteBufferInputStream getStream() { if (stream != null) { return stream; } if (byteBuf == null) { return null; } ByteBuffer temp = ByteBuffer.allocate(byteBuf.readableBytes()); byteBuf.readBytes(temp); byteBuf.release(); byteBuf = null; temp.flip(); stream = new ByteBufferInputStream(temp); return stream; }
Source:
<code>private void showContributions(@NonNull List<Contribution> contributions) { view.showProgress(false); <START> if (contributions.size() == 0) { <END> view.showWelcomeTip(true); view.showNoContributionsUI(true); } else { view.showWelcomeTip(false); view.showNoContributionsUI(false); view.setUploadCount(contributions.size()); view.showContributions(contributions); this.contributionList.clear(); this.contributionList.addAll(contributions); } }</code><technical_language>isEmpty</technical_language>

Target:
private void showContributions(@NonNull List<Contribution> contributions) { view.showProgress(false); if (contributions.isEmpty()) { view.showWelcomeTip(true); view.showNoContributionsUI(true); } else { view.showWelcomeTip(false); view.showNoContributionsUI(false); view.setUploadCount(contributions.size()); view.showContributions(contributions); this.contributionList.clear(); this.contributionList.addAll(contributions); } }
Source:
<code>private void verifyConfigs(StoreConfig storeConfig, DiskManagerConfig diskManagerConfig) throws StoreException { if (storeConfig.storeDeletedMessageRetentionHours < TimeUnit.SECONDS.toHours(storeConfig.storeDataFlushIntervalSeconds) + 1) { <START> throw new StoreException("Message retention days must be greater than the store flush interval period", <END> StoreErrorCodes.Initialization_Error); } if (diskManagerConfig.diskManagerReserveFileDirName.length() == 0) { throw new StoreException("Reserve file directory name is empty", StoreErrorCodes.Initialization_Error); } }</code><technical_language>minor: want change "Message retention hours" for exception message</technical_language>

Target:
private void verifyConfigs(StoreConfig storeConfig, DiskManagerConfig diskManagerConfig) throws StoreException { if (storeConfig.storeDeletedMessageRetentionHours < TimeUnit.SECONDS.toHours(storeConfig.storeDataFlushIntervalSeconds) + 1) { throw new StoreException("Message retention hours must be greater than the store flush interval period", StoreErrorCodes.Initialization_Error); } if (diskManagerConfig.diskManagerReserveFileDirName.length() == 0) { throw new StoreException("Reserve file directory name is empty", StoreErrorCodes.Initialization_Error); } }
Source:
<code>public String nextValue() { <START> int val = _gen.nextValue().intValue(); <END> _laststring = _values.get(val); return _laststring; }</code><technical_language>Is this line necessary</technical_language>

Target:
public String nextValue() { laststring = values.get(gen.nextValue()); return laststring; }
Source:
<code><START> public static List<ChangeMessage> sortChangeMessages( Iterable<ChangeMessage> changeMessage) { return ChangeNotes.MESSAGE_BY_TIME.sortedCopy(changeMessage); } <END></code><technical_language>Code organization: I static methods end of class</technical_language>

Target:
private static List<ChangeMessage> sortChangeMessages( Iterable<ChangeMessage> changeMessage) { return ChangeNotes.MESSAGE_BY_TIME.sortedCopy(changeMessage); }
Source:
<code>public void logMessage(int code, String message, Throwable t) { <START> new PluginLog(this).logMessage(code, message, t); <END> }</code><technical_language>create this invocation</technical_language>

Target:
public void logMessage(int code, String message, Throwable t) { getPluginLog().logMessage(code, message, t); }
Source:
<code>public static void setup() { <START> gitDaemonEnabled = System.getProperty("org.uberfire.nio.git.daemon.enabled"); <END> gitSshEnabled = System.getProperty("org.uberfire.nio.git.ssh.enabled"); System.setProperty("org.uberfire.nio.git.daemon.enabled", "false"); System.setProperty("org.uberfire.nio.git.ssh.enabled", "false"); }</code><technical_language>more unnecessary "save restore" of system property value. Please remove consistent in entire test suite clearProperty below</technical_language>

Target:
public static void setup() { System.setProperty("org.uberfire.nio.git.daemon.enabled", "false"); System.setProperty("org.uberfire.nio.git.ssh.enabled", "false"); }
Source:
<code>private void sanitizeIrrelevantComponents(AnalysisJobBuilder ajb, TransformerComponentBuilder<?> tjb) { final List<AnalysisJobBuilder> relevantAnalysisJobBuilders = createRelevantAnalysisJobBuildersList(ajb); for (AnalysisJobBuilder relevantAnalysisJobBuilder : relevantAnalysisJobBuilders) { final Collection<ComponentBuilder> componentBuilders = relevantAnalysisJobBuilder.getComponentBuilders(); for (ComponentBuilder componentBuilder : componentBuilders) { boolean importantComponent = componentBuilder == tjb; final List<OutputDataStream> streams = componentBuilder.getOutputDataStreams(); for (OutputDataStream stream : streams) { if (componentBuilder.isOutputDataStreamConsumed(stream)) { final AnalysisJobBuilder childJobBuilder = componentBuilder.getOutputDataStreamJobBuilder( stream); if (relevantAnalysisJobBuilders.contains(childJobBuilder)) { importantComponent = true; } else { childJobBuilder.removeAllComponents(); } } } if (!importantComponent && componentBuilder instanceof AnalyzerComponentBuilder) { relevantAnalysisJobBuilder.removeComponent(componentBuilder); } if (!importantComponent) { <START> if (componentBuilder.getInput().length == 0) { <END> relevantAnalysisJobBuilder.removeComponent(componentBuilder); } } } } }</code><technical_language>do this more generically asking if componentBuilder is configured. restricted input columns, missing configuration aspect</technical_language>

Target:
private void sanitizeIrrelevantComponents(AnalysisJobBuilder ajb, TransformerComponentBuilder<?> tjb) { final List<AnalysisJobBuilder> relevantAnalysisJobBuilders = createRelevantAnalysisJobBuildersList(ajb); for (AnalysisJobBuilder relevantAnalysisJobBuilder : relevantAnalysisJobBuilders) { final Collection<ComponentBuilder> componentBuilders = relevantAnalysisJobBuilder.getComponentBuilders(); for (ComponentBuilder componentBuilder : componentBuilders) { boolean importantComponent = componentBuilder == tjb; final List<OutputDataStream> streams = componentBuilder.getOutputDataStreams(); for (OutputDataStream stream : streams) { if (componentBuilder.isOutputDataStreamConsumed(stream)) { final AnalysisJobBuilder childJobBuilder = componentBuilder.getOutputDataStreamJobBuilder( stream); if (relevantAnalysisJobBuilders.contains(childJobBuilder)) { importantComponent = true; } else { childJobBuilder.removeAllComponents(); } } } if (!importantComponent && componentBuilder instanceof AnalyzerComponentBuilder) { relevantAnalysisJobBuilder.removeComponent(componentBuilder); } if (!importantComponent) { if (!componentBuilder.isConfigured(false)) { relevantAnalysisJobBuilder.removeComponent(componentBuilder); } } } } }
Source:
<code>private void createTable(Admin admin, TableName tableName) throws IOException { <START> HColumnDescriptor hcd = new HColumnDescriptor(COLUMN_FAMILY).setMaxVersions(MAX_VERSIONS); <END> HColumnDescriptor family2 = new HColumnDescriptor(COLUMN_FAMILY2).setMaxVersions(MAX_VERSIONS); admin.createTable( new HTableDescriptor(tableName) .addFamily(hcd) .addFamily(family2)); }</code><technical_language>family1</technical_language>

Target:
private void createTable(Admin admin, TableName tableName) throws IOException { Assert.assertFalse("Table should not exist", admin.tableExists(tableName)); HColumnDescriptor hcd = new HColumnDescriptor(COLUMN_FAMILY).setMaxVersions(MAX_VERSIONS); admin.createTable(new HTableDescriptor(tableName).addFamily(hcd)); Assert.assertTrue("Table does not exist", admin.tableExists(tableName)); }
Source:
<code>private String nestedResultMapId(Result result) { String resultMapId = result.one().resultMapId(); if (resultMapId.length() < 1) { resultMapId = result.many().resultMapId(); } if (!resultMapId.contains(".")) { <START> resultMapId = type.getName() + "." + resultMapId; <END> } return resultMapId; }</code><technical_language>a test covering this condition</technical_language>

Target:
private String nestedResultMapId(Result result) { String resultMapId = result.one().resultMap(); if (resultMapId.length() < 1) { resultMapId = result.many().resultMap(); } if (!resultMapId.contains(".")) { resultMapId = type.getName() + "." + resultMapId; } return resultMapId; }
Source:
<code>public MapLookupExtractor( @JsonProperty("map") Map<String, String> map, @JsonProperty("isOneToOne") boolean isOneToOne ) { this.isOneToOne = isOneToOne; <START> this.map = Preconditions.checkNotNull(this.isOneToOne ? HashBiMap.create(map) : map, "map"); <END> }</code><technical_language>HashBiMap#inverse creates a new object in a thread safe manner, object is pretty light weight. Due nature of lookups this a thundering of racy objects, benign map is immutable, annoying. sense create inverse map a Map<String, String> eagerly, null object if one-to-one, in unapply simply check for eager inverse map null do a Collections.singletonList result, if exists</technical_language>

Target:
public MapLookupExtractor( @JsonProperty("map") Map<String, String> map, @JsonProperty("isOneToOne") boolean isOneToOne ) { Preconditions.checkNotNull(map, "map"); this.isOneToOne = isOneToOne; if (this.isOneToOne) { this.map = HashBiMap.create(map); this.reverseMap = ((HashBiMap<String, String>) this.map).inverse(); } else { this.map = map; this.reverseMap = null; } }
Source:
<code>public ValidationResult defaultRouteNetworkCannotBeExternal(Network network) { return ValidationResult.failWith(EngineMessage.ACTION_TYPE_FAILED_DEFAULT_ROUTE_NETWORK_CANNOT_BE_EXTERNAL, String.format(NETWORK_NAME_REPLACEMENT, network.getName())).when( <START> networkCluster.isManagement() && <END> network.isExternal()); }</code><technical_language>'isManagement()'? Please fix</technical_language>

Target:
public ValidationResult defaultRouteNetworkCannotBeExternal(Network network) { return ValidationResult.failWith(EngineMessage.ACTION_TYPE_FAILED_DEFAULT_ROUTE_NETWORK_CANNOT_BE_EXTERNAL, String.format(NETWORK_NAME_REPLACEMENT, network.getName())).when( networkCluster.isDefaultRoute() && network.isExternal()); }