auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private SymbolicConstraint simplifyConstraint(SymbolicConstraint constraint) { constraint.normalize(); SymbolicConstraint simplifiedConstraint = new SymbolicConstraint(constraint.termContext()); simplifiedConstraint.addAll( <START> Maps.difference(constraint.substitution(), substitution()).entriesOnlyOnLeft()); <END> List<Equality> equalities = new LinkedList<>(constraint.equalities()); equalities.removeAll(equalities()); for (Equality equality : equalities) { simplifiedConstraint.add(equality.leftHandSide, equality.rightHandSide); } simplifiedConstraint.simplify(); Map<Term, Term> substitution = new HashMap<>(); for (Equality e1:equalities()) { if (e1.rightHandSide.isGround()) { substitution.put(e1.leftHandSide,e1.rightHandSide); } if (e1.leftHandSide.isGround()) { substitution.put(e1.rightHandSide,e1.leftHandSide); } } simplifiedConstraint = (SymbolicConstraint) substituteTerms(simplifiedConstraint, substitution); simplifiedConstraint.renormalize(); simplifiedConstraint.simplify(); return simplifiedConstraint; }</code><technical_language>want check Maps.difference(...).entriesDiffering()</technical_language>

Target:
private SymbolicConstraint simplifyConstraint(SymbolicConstraint constraint) { constraint.normalize(); SymbolicConstraint simplifiedConstraint = new SymbolicConstraint(constraint.termContext()); MapDifference<Variable, Term> mapDifference = Maps.difference( constraint.substitution(), substitution()); simplifiedConstraint.addAll(mapDifference.entriesOnlyOnLeft()); for (Entry<Variable, ValueDifference<Term>> entry : mapDifference.entriesDiffering().entrySet()) { simplifiedConstraint.add(entry.getKey(), entry.getValue().leftValue()); } List<Equality> equalities = new LinkedList<>(constraint.equalities()); equalities.removeAll(equalities()); simplifiedConstraint.addAll(equalities); simplifiedConstraint.simplify(); Map<Term, Term> substitution = new HashMap<>(); for (Equality e1:equalities()) { if (e1.rightHandSide.isGround()) { substitution.put(e1.leftHandSide,e1.rightHandSide); } if (e1.leftHandSide.isGround()) { substitution.put(e1.rightHandSide,e1.leftHandSide); } } simplifiedConstraint = (SymbolicConstraint) substituteTerms(simplifiedConstraint, substitution); simplifiedConstraint.renormalize(); simplifiedConstraint.simplify(); return simplifiedConstraint; }
Source:
<code>private BlackboardAttribute.Type getLastWriteAttribute() throws TskCoreException { if (shellBagLastWriteAttributeType == null) { try { shellBagLastWriteAttributeType = tskCase.getBlackboard().getOrAddAttributeType(SHELLBAG_ATTRIBUTE_LAST_WRITE, BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.DATETIME, Bundle.Shellbag_Last_Write_Attribute_Display_Name()); } catch (BlackboardException ex) { <START> throw new TskCoreException(String.format("Failed to get costume attribute %s", SHELLBAG_ATTRIBUTE_LAST_WRITE), ex); <END> } } return shellBagLastWriteAttributeType; }</code><technical_language>assuming "custom"</technical_language>

Target:
private BlackboardAttribute.Type getLastWriteAttribute() throws TskCoreException { if (shellBagLastWriteAttributeType == null) { try { shellBagLastWriteAttributeType = tskCase.getBlackboard().getOrAddAttributeType(SHELLBAG_ATTRIBUTE_LAST_WRITE, BlackboardAttribute.TSK_BLACKBOARD_ATTRIBUTE_VALUE_TYPE.DATETIME, Bundle.Shellbag_Last_Write_Attribute_Display_Name()); } catch (BlackboardException ex) { throw new TskCoreException(String.format("Failed to get custom attribute %s", SHELLBAG_ATTRIBUTE_LAST_WRITE), ex); } } return shellBagLastWriteAttributeType; }
Source:
<code>private ExecutionGraphNode downsampler(final Metric metric, final String interpolator, final Downsampler downsampler) { FillPolicy policy = downsampler.getFillPolicy().getPolicy(); DownsampleConfig.Builder ds = (DownsampleConfig.Builder) DownsampleConfig.newBuilder() .setAggregator(downsampler.getAggregator()) .setInterval(downsampler.getInterval()) <START> .setFill(policy != null && policy != FillPolicy.NONE ? true : false) <END> .setId("downsample_" + metric.getId()) .addInterpolatorConfig(NumericInterpolatorConfig.newBuilder() .setFillPolicy(policy) .setRealFillPolicy(FillWithRealPolicy.NONE) .setId(interpolator) .setType(NumericType.TYPE.toString()) .build()); if (!Strings.isNullOrEmpty(downsampler.getTimezone())) { ds.setTimeZone(downsampler.getTimezone()); } return ExecutionGraphNode.newBuilder() .setId(metric.getId() + "_Downsampler") .setType("Downsample") .setConfig(ds.build()) .addSource(metric.getId()) .build(); }</code><technical_language>policy != null && policy != FillPolicy.NONE is enough. need of ?true:false</technical_language>

Target:
private ExecutionGraphNode downsampler(final Metric metric, final String interpolator, final Downsampler downsampler) { FillPolicy policy = downsampler.getFillPolicy().getPolicy(); DownsampleConfig.Builder ds = (DownsampleConfig.Builder) DownsampleConfig.newBuilder() .setAggregator(downsampler.getAggregator()) .setInterval(downsampler.getInterval()) .setFill(policy != null && policy != FillPolicy.NONE) .setId("downsample_" + metric.getId()) .addInterpolatorConfig(NumericInterpolatorConfig.newBuilder() .setFillPolicy(policy) .setRealFillPolicy(FillWithRealPolicy.NONE) .setId(interpolator) .setType(NumericType.TYPE.toString()) .build()); if (!Strings.isNullOrEmpty(downsampler.getTimezone())) { ds.setTimeZone(downsampler.getTimezone()); } return ExecutionGraphNode.newBuilder() .setId(metric.getId() + "_Downsampler") .setType("Downsample") .setConfig(ds.build()) .addSource(metric.getId()) .build(); }
Source:
<code>protected List<MimeMessage> prepareMailToBeSent() throws MessagingException, IOException, EntityDoesNotExistException { Emails emailManager = new Emails(); log.info("Fetching recipient emails for pending comments in course : " + courseId); Set<String> recipients = commentsLogic.getRecipientEmailsForSendingComments(courseId); if (recipients == null) { log.severe("Recipient emails for pending comments in course : " + courseId + " could not be fetched"); } <START> return emailManager.generatePendingCommentsClearedEmails(courseId, recipients); <END> }</code><technical_language>move instantiation of emailManager</technical_language>

Target:
protected List<MimeMessage> prepareMailToBeSent() throws MessagingException, IOException, EntityDoesNotExistException { log.info("Fetching recipient emails for pending comments in course : " + courseId); Set<String> recipients = commentsLogic.getRecipientEmailsForSendingComments(courseId); if (recipients == null) { log.severe("Recipient emails for pending comments in course : " + courseId + " could not be fetched"); } return new Emails().generatePendingCommentsClearedEmails(courseId, recipients); }
Source:
<code>public void onReceive(Context context, Intent intent) { Log.i(BackupNotificationAlarmReceiver.class.getName(),"Inside alarm receiver"); NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); long masterKeyId = intent.getLongExtra(MASTER_KEY_ID,0); String name = intent.getStringExtra(NAME); String email = intent.getStringExtra(EMAIL); <START> String masterKeyIds = Preferences.getPreferences(context).getBackupReminders(); <END> if (masterKeyIds == null || !masterKeyIds.contains(masterKeyId+"") || masterKeyId == 0) { Intent intentAlarm = new Intent(context, BackupNotificationAlarmReceiver.class); intentAlarm.putExtra(MASTER_KEY_ID, masterKeyId); intentAlarm.putExtra(NAME, name); intentAlarm.putExtra(EMAIL, email); AlarmManager alarmManager = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE); PendingIntent pendingIntent = PendingIntent.getBroadcast(context,1,intentAlarm, PendingIntent.FLAG_UPDATE_CURRENT); alarmManager.cancel(pendingIntent); return; } notificationManager.notify(((Long)masterKeyId).hashCode(), getNotification(context, masterKeyId,name,email)); }</code><technical_language>storing this in preferences _and_ intents redundant. simply data intent? elaborate this decision</technical_language>

Target:
public void onReceive(Context context, Intent intent) { Log.i(Constants.TAG, "Inside backup notification alarm receiver"); NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); long masterKeyId = intent.getLongExtra(MASTER_KEY_ID, 0); String name = intent.getStringExtra(NAME); String email = intent.getStringExtra(EMAIL); String masterKeyIds = Preferences.getPreferences(context).getBackupReminders(); if (masterKeyIds == null || !masterKeyIds.contains(Long.toString(masterKeyId)) || masterKeyId == 0) { Intent intentAlarm = new Intent(context, BackupNotificationAlarmReceiver.class); intentAlarm.putExtra(MASTER_KEY_ID, masterKeyId); intentAlarm.putExtra(NAME, name); intentAlarm.putExtra(EMAIL, email); AlarmManager alarmManager = (AlarmManager)context.getSystemService(Context.ALARM_SERVICE); PendingIntent pendingIntent = PendingIntent.getBroadcast(context, 1, intentAlarm, PendingIntent.FLAG_UPDATE_CURRENT); alarmManager.cancel(pendingIntent); return; } notificationManager.notify(Long.valueOf(masterKeyId).hashCode(), getNotification(context, masterKeyId, name, email)); }
Source:
<code>public void onMoveItem(int fromPosition, int toPosition) { if (fromPosition == toPosition) return; int realFromPosition = items.indexOf(((ReceiptContentItem) listItems.get(fromPosition)).getReceipt()); int realToPosition = items.indexOf(((ReceiptContentItem) listItems.get(toPosition)).getReceipt()); Logger.debug(this, "Moving receipt from position to position {}", realFromPosition, realToPosition); if (!orderingPreferencesManager.isReceiptsTableOrdered()) setDefaultOrderIds(); if (isOldCustomOrderIdFormatUsed()) { setDefaultOrderIds(); writeUpdatedItems(items); <START> Toast.makeText(context, "Sorry, your receipts now are ordered by date.", Toast.LENGTH_SHORT).show(); <END> return; } List<Receipt> originalItemsList = new ArrayList<>(items); final Receipt movedReceipt = items.remove(realFromPosition); items.add(realToPosition, movedReceipt); updateListItems(); final List<Receipt> changedReceipts = ReceiptCustomOrderIdHelper.INSTANCE .updateReceiptsCustomOrderIds(originalItemsList, realFromPosition, realToPosition); writeUpdatedItems(changedReceipts); }</code><technical_language>remove this. I if this change error message</technical_language>

Target:
public void onMoveItem(int fromPosition, int toPosition) { if (fromPosition == toPosition) return; int realFromPosition = items.indexOf(((ReceiptContentItem) listItems.get(fromPosition)).getReceipt()); int realToPosition = items.indexOf(((ReceiptContentItem) listItems.get(toPosition)).getReceipt()); Logger.debug(this, "Moving receipt from position to position {}", realFromPosition, realToPosition); if (!orderingPreferencesManager.isReceiptsTableOrdered()) setDefaultOrderIds(); if (isOldCustomOrderIdFormatUsed()) { setDefaultOrderIds(); writeUpdatedItems(items); return; } List<Receipt> originalItemsList = new ArrayList<>(items); final Receipt movedReceipt = items.remove(realFromPosition); items.add(realToPosition, movedReceipt); updateListItems(); final List<Receipt> changedReceipts = ReceiptCustomOrderIdHelper.INSTANCE .updateReceiptsCustomOrderIds(originalItemsList, realFromPosition, realToPosition); writeUpdatedItems(changedReceipts); }
Source:
<code><START> public void process(IncomingMessageEnvelope envelope) { <END> SystemStreamPartition envelopeSSP = envelope.getSystemStreamPartition(); String envelopeOffset = envelope.getOffset(); for (String store: this.sspToStores.get(envelopeSSP)) { SideInputsProcessor storeProcessor = this.storeToProcessor.get(store); KeyValueStore keyValueStore = (KeyValueStore) this.taskSideInputStorageManager.getStore(store); Collection<Entry<?, ?>> entriesToBeWritten = storeProcessor.process(envelope, keyValueStore); for (Entry entry : entriesToBeWritten) { if (entry.getKey() != null) { if (entry.getValue() != null) { keyValueStore.put(entry.getKey(), entry.getValue()); } else { keyValueStore.delete(entry.getKey()); } } } } this.lastProcessedOffsets.put(envelopeSSP, envelopeOffset); }</code><technical_language>Nit: please add doc for this method in original code. I feel is helpful</technical_language>

Target:
public synchronized void process(IncomingMessageEnvelope envelope) { SystemStreamPartition envelopeSSP = envelope.getSystemStreamPartition(); String envelopeOffset = envelope.getOffset(); for (String store: this.sspToStores.get(envelopeSSP)) { SideInputsProcessor storeProcessor = this.storeToProcessor.get(store); KeyValueStore keyValueStore = (KeyValueStore) this.taskSideInputStorageManager.getStore(store); Collection<Entry<?, ?>> entriesToBeWritten = storeProcessor.process(envelope, keyValueStore); for (Entry entry : entriesToBeWritten) { if (entry.getKey() != null) { if (entry.getValue() != null) { keyValueStore.put(entry.getKey(), entry.getValue()); } else { keyValueStore.delete(entry.getKey()); } } } } this.lastProcessedOffsets.put(envelopeSSP, envelopeOffset); }
Source:
<code>public void addRowkeyRangesFilter(List<Pair<byte[],byte[]>> rowkeyPairs) throws IOException { if (rowkeyPairs == null || rowkeyPairs.size() < 1) { return; } Filter currentFilter = scan.getFilter(); if (currentFilter != null && !(currentFilter instanceof MultiRowRangeFilter)) return; List<MultiRowRangeFilter.RowRange> ranges = new ArrayList<>(rowkeyPairs.size()); byte[] startKey; byte[] stopKey; for (Pair<byte[],byte[]> startStopKey: rowkeyPairs) { startKey=startStopKey.getFirst(); stopKey=startStopKey.getSecond(); MultiRowRangeFilter.RowRange rr = new MultiRowRangeFilter.RowRange(startKey, true, <START> stopKey, false); <END> ranges.add(rr); } if (ranges.size() > 0) { MultiRowRangeFilter filter = new MultiRowRangeFilter(ranges); scan.setFilter(filter); List<MultiRowRangeFilter.RowRange> sortedRanges = filter.getRowRanges(); scan.withStartRow(sortedRanges.get(0).getStartRow()); scan.withStopRow(sortedRanges.get(sortedRanges.size()-1).getStopRow()); } }</code><technical_language>stopKey exclusive? If is a point range, stopKey inclusive</technical_language>

Target:
public void addRowkeyRangesFilter(List<Pair<byte[],byte[]>> rowkeyPairs) throws IOException { if (rowkeyPairs == null || rowkeyPairs.size() < 1) { return; } Filter currentFilter = scan.getFilter(); if (currentFilter != null && !(currentFilter instanceof MultiRowRangeFilter)) return; List<MultiRowRangeFilter.RowRange> ranges = new ArrayList<>(rowkeyPairs.size()); byte[] startKey; byte[] stopKey; for (Pair<byte[],byte[]> startStopKey: rowkeyPairs) { startKey=startStopKey.getFirst(); stopKey=startStopKey.getSecond(); MultiRowRangeFilter.RowRange rr = new MultiRowRangeFilter.RowRange(startKey, true, stopKey, false); ranges.add(rr); } if (ranges.size() > 0) { MultiRowRangeFilter filter = new MultiRowRangeFilter(ranges); scan.setFilter(filter); List<MultiRowRangeFilter.RowRange> sortedRanges = filter.getRowRanges(); byte[] currentStartRow = scan.getStartRow(); byte[] currentStopRow = scan.getStopRow(); byte[] filterStartRow = sortedRanges.get(0).getStartRow(); byte[] filterStopRow = sortedRanges.get(sortedRanges.size()-1).getStopRow(); if (currentStartRow == null || currentStartRow.length == 0 || Bytes.compareTo(currentStartRow, filterStartRow) < 0) scan.withStartRow(filterStartRow); if (currentStopRow == null || currentStopRow.length == 0 || Bytes.compareTo(currentStopRow, filterStopRow) > 0) scan.withStopRow(filterStopRow); } }
Source:
<code>public HostPoller(TimeBoundPollVDSCommandParameters parameters) { <START> Objects.requireNonNull(parameters); this.parameters = parameters; <END> }</code><technical_language>this is splitted in lines, not: this.parameters = Objects.requireNonNull(parameters)</technical_language>

Target:
public HostPoller(TimeBoundPollVDSCommandParameters parameters) { this.parameters = Objects.requireNonNull(parameters); }
Source:
<code>static void handleRightClickAir(GlowPlayer player, ItemStack holding, EquipmentSlot slot) { PlayerInteractEvent event = EventFactory.onPlayerInteract( player, Action.RIGHT_CLICK_AIR, slot); if (event.useItemInHand() == null || event.useItemInHand() == Event.Result.DENY) { return; } if (!InventoryUtil.isEmpty(holding)) { ItemType type = ItemTable.instance().getItem(holding.getType()); if (type != null) { if (type.getContext().isAirApplicable()) { type.rightClickAir(player, holding); } else { <START> if ((holding.getType() == Material.WATER_BUCKET <END> || holding.getType() == Material.LAVA_BUCKET) && player.getGameMode() != GameMode.CREATIVE) { holding.setType(Material.BUCKET); } else if (type instanceof ItemTimedUsage) { ((ItemTimedUsage) type).startUse(player, holding); } else if (type instanceof ItemProjectile) { ((ItemProjectile) type).use(player, holding); } } } if (holding.getAmount() <= 0) { holding = InventoryUtil.createEmptyStack(); } player.getInventory().setItem(slot, holding); } }</code><technical_language>this incorrectly reverted ender pearl PR</technical_language>

Target:
static void handleRightClickAir(GlowPlayer player, ItemStack holding, EquipmentSlot slot) { PlayerInteractEvent event = EventFactory.onPlayerInteract( player, Action.RIGHT_CLICK_AIR, slot); if (event.useItemInHand() == null || event.useItemInHand() == Event.Result.DENY) { return; } if (!InventoryUtil.isEmpty(holding)) { ItemType type = ItemTable.instance().getItem(holding.getType()); if (type != null) { if (type.getContext().isAirApplicable()) { type.rightClickAir(player, holding); } } if (holding.getAmount() <= 0) { holding = InventoryUtil.createEmptyStack(); } player.getInventory().setItem(slot, holding); } }
Source:
<code>public void updateNeighbors() { VertexValueWritable vertex = getVertexValue(); short state = vertex.getState(); EDGETYPE edgeType = EDGETYPE.fromByte(state); if ((state & State.MERGE) == 0) { return; } DIR mergeDir = edgeType.dir(); EnumSet<EDGETYPE> mergeEdges = mergeDir.edgeTypes(); DIR updateDir = mergeDir.mirror(); EnumSet<EDGETYPE> updateEdges = updateDir.edgeTypes(); for (EDGETYPE updateEdge : updateEdges) { outgoingMsg.reset(); outgoingMsg.setSourceVertexId(getVertexId()); outFlag = 0; outFlag |= MESSAGETYPE.UPDATE.get() | updateEdge.mirror().get(); outgoingMsg.setFlag(outFlag); <START> for (EDGETYPE mergeEdge : mergeEdges) { <END> EDGETYPE newEdgetype = EDGETYPE.resolveEdgeThroughPath(updateEdge, mergeEdge); for (VKmer dest : vertex.getEdges(updateEdge)) { if (verbose) LOG.fine("Iteration " + getSuperstep() + "\r\n" + "send update message from " + getVertexId() + " to " + dest + ": " + outgoingMsg); for (VKmer kmer : vertex.getEdges(mergeEdge)) { VKmerList msgList = outgoingMsg.getNode().getEdges(updateEdge); msgList.clear(); msgList.append(kmer); sendMsg(dest, outgoingMsg); } } } } }</code><technical_language>change this mergeEdge/mergeEdges name mergeEdgeEdgeType/mergeEdgeEdgeTypes. good names</technical_language>

Target:
public void updateNeighbors() { VertexValueWritable vertex = getVertexValue(); short state = vertex.getState(); EDGETYPE edgeType = EDGETYPE.fromByte(state); if ((state & State.MERGE) == 0) { return; } DIR mergeDir = edgeType.dir(); EDGETYPE[] mergeEdges = mergeDir.edgeTypes(); DIR updateDir = mergeDir.mirror(); EDGETYPE[] updateEdges = updateDir.edgeTypes(); for (EDGETYPE updateEdge : updateEdges) { outgoingMsg.reset(); outgoingMsg.setSourceVertexId(getVertexId()); outFlag = 0; outFlag |= MESSAGETYPE.UPDATE.get() | updateEdge.mirror().get(); outgoingMsg.setFlag(outFlag); for (EDGETYPE mergeEdge : mergeEdges) { EDGETYPE newEdgetype = EDGETYPE.resolveEdgeThroughPath(updateEdge, mergeEdge); for (VKmer dest : vertex.getEdges(updateEdge)) { if (verbose) LOG.fine("Iteration " + getSuperstep() + "\r\n" + "send update message from " + getVertexId() + " to " + dest + ": " + outgoingMsg); for (VKmer kmer : vertex.getEdges(mergeEdge)) { VKmerList msgList = outgoingMsg.getNode().getEdges(updateEdge); msgList.clear(); msgList.append(kmer); sendMsg(dest, outgoingMsg); } } } } }
Source:
<code>public static List<ITmfStateInterval> getStatusIntervalsForThread(KernelAnalysisModule module, Integer threadId, long start, long end, long resolution, IProgressMonitor monitor) { ITmfStateSystem ss = module.getStateSystem(); if (ss == null) { <START> return Collections.EMPTY_LIST; <END> } try { int threadQuark = ss.getQuarkAbsolute(Attributes.THREADS, threadId.toString()); List<ITmfStateInterval> statusIntervals = StateSystemUtils.queryHistoryRange(ss, threadQuark, Math.max(start, ss.getStartTime()), Math.min(end - 1, ss.getCurrentEndTime()), resolution, monitor); return statusIntervals; } catch (AttributeNotFoundException | StateSystemDisposedException | TimeRangeException e) { } return Collections.EMPTY_LIST; }</code><technical_language>Collections.emptyList();</technical_language>

Target:
public static List<ITmfStateInterval> getStatusIntervalsForThread(KernelAnalysisModule module, Integer threadId, long start, long end, long resolution, IProgressMonitor monitor) { ITmfStateSystem ss = module.getStateSystem(); if (ss == null) { return Collections.emptyList(); } try { int threadQuark = ss.getQuarkAbsolute(Attributes.THREADS, threadId.toString()); List<ITmfStateInterval> statusIntervals = StateSystemUtils.queryHistoryRange(ss, threadQuark, Math.max(start, ss.getStartTime()), Math.min(end - 1, ss.getCurrentEndTime()), resolution, monitor); return statusIntervals; } catch (AttributeNotFoundException | StateSystemDisposedException | TimeRangeException e) { } return Collections.emptyList(); }
Source:
<code>protected SnapshotImpl doUpdate(SnapshotImpl update) { <START> return managerProvider.get().merge(update); <END> }</code><technical_language>1. update managed jpa 2. if update is managed, inserted updated, consider get + merge 3. update methods throw NotFoundException is entity identifier</technical_language>

Target:
protected SnapshotImpl doUpdate(SnapshotImpl update) throws NotFoundException, SnapshotException, ConflictException { SnapshotImpl oldSnapshot = managerProvider.get().find(SnapshotImpl.class, update.getId()); if (oldSnapshot == null) { throw new NotFoundException(format("Snapshot with id '%s' doesn't exist", update.getId())); } if (!oldSnapshot.getWorkspaceId().equals(update.getWorkspaceId())) { throw new ConflictException(format("Cannot move '%s' snapshot to another workspace", oldSnapshot)); } return managerProvider.get().merge(update); }
Source:
<code>private OnmsNode getNode(final OnmsResource resource, final Source source) { OnmsNode node = null; try { node = ResourceTypeUtils.getNodeFromResourceRoot(resource); } catch (final ObjectRetrievalFailureException e) { } if (node == null) { <START> final String resourceId = source.getResourceId().split("\\.")[0]; <END> final OnmsResource otherResource = m_resourceDao.getResourceById(ResourceId.fromString(resourceId)); node = ResourceTypeUtils.getNodeFromResource(otherResource); } return node; }</code><technical_language>ResourceId class parse this instead of tokenizing ourself here? ResourceId.fromString(resourceId).getParent()</technical_language>

Target:
private OnmsNode getNode(final OnmsResource resource, final Source source) { OnmsNode node = null; try { node = ResourceTypeUtils.getNodeFromResourceRoot(resource); } catch (final ObjectRetrievalFailureException e) { } if (node == null) { final OnmsResource otherResource = m_resourceDao.getResourceById(ResourceId.fromString(source.getResourceId()).getParent()); node = ResourceTypeUtils.getNodeFromResource(otherResource); } return node; }
Source:
<code>public JsonNode getBodyJson() { ObjectNode root = JsonNodeFactory.instance.objectNode(); ArrayNode reqs = JsonNodeFactory.instance.arrayNode(); for (AbstractLightblueDataRequest req : requests) { ObjectNode seqNode = JsonNodeFactory.instance.objectNode(); seqNode.set("seq", JsonNodeFactory.instance.numberNode(reqs.size())); String op = ""; if (req instanceof DataDeleteRequest) { op = "delete"; } else if (req instanceof DataFindRequest) { op = "find"; } else if (req instanceof DataInsertRequest) { op = "insert"; } else if (req instanceof DataSaveRequest) { op = "save"; } else if (req instanceof DataUpdateRequest) { op = "update"; <START> } <END> seqNode.set("op", JsonNodeFactory.instance.textNode(op)); ObjectNode request = (ObjectNode) req.getBodyJson(); request.set("entity", JsonNodeFactory.instance.textNode(req.getEntityName())); request.set("entityVersion", JsonNodeFactory.instance.textNode(req.getEntityVersion())); seqNode.set("request", request); reqs.add(seqNode); } root.set("requests", reqs); return root; }</code><technical_language>I suggest calling getOperationPathParam() instead of this method operations are</technical_language>

Target:
public JsonNode getBodyJson() { ObjectNode root = JsonNodeFactory.instance.objectNode(); ArrayNode reqs = JsonNodeFactory.instance.arrayNode(); for (AbstractLightblueDataRequest req : requests) { ObjectNode seqNode = JsonNodeFactory.instance.objectNode(); seqNode.set("seq", JsonNodeFactory.instance.numberNode(reqs.size())); seqNode.set("op", JsonNodeFactory.instance.textNode(req.getOperation().name().toLowerCase())); ObjectNode request = (ObjectNode) req.getBodyJson(); request.set("entity", JsonNodeFactory.instance.textNode(req.getEntityName())); request.set("entityVersion", JsonNodeFactory.instance.textNode(req.getEntityVersion())); seqNode.set("request", request); reqs.add(seqNode); } root.set("requests", reqs); return root; }
Source:
<code>protected void addNullToKeep(int position, int inputIndex) { <START> if (nullsToAdd == null || nullsToAdd.length <= numNullsToAdd) { <END> nullsToAdd = resize(nullsToAdd, numNullsToAdd); } if (nullsToAddIndexes == null || nullsToAddIndexes.length < nullsToAdd.length) { nullsToAddIndexes = resize(nullsToAddIndexes, numNullsToAdd); } nullsToAdd[numNullsToAdd] = position; nullsToAddIndexes[numNullsToAdd] = inputIndex; numNullsToAdd++; }</code><technical_language>check < instead of <=</technical_language>

Target:
protected void addNullToKeep(int position, int inputIndex) { if (nullsToAdd == null || nullsToAdd.length <= numNullsToAdd) { nullsToAdd = resize(nullsToAdd, numNullsToAdd); } if (nullsToAddIndexes == null || nullsToAddIndexes.length <= nullsToAdd.length) { nullsToAddIndexes = resize(nullsToAddIndexes, numNullsToAdd); } nullsToAdd[numNullsToAdd] = position; nullsToAddIndexes[numNullsToAdd] = inputIndex; numNullsToAdd++; }
Source:
<code>private Object objectInstance(Class<?> clazz, Boolean bool, Date date, DateTime dateTime, String str) { Object instance; try { instance = clazz.newInstance(); PropertyUtils.setProperty(instance, BOOL_FIELD, bool); PropertyUtils.setProperty(instance, DATE_FIELD, date); PropertyUtils.setProperty(instance, DATETIME_FIELD, dateTime); PropertyUtils.setProperty(instance, STRING_FIELD, str); <START> } catch (Exception e) { <END> LOGGER.error("Cannot create instance", e); return null; } return instance; }</code><technical_language>point in this catch? expecting this</technical_language>

Target:
private Object objectInstance(Class<?> clazz, Boolean bool, Date date, DateTime dateTime, String str) throws Exception { Object instance = clazz.newInstance(); PropertyUtils.setProperty(instance, BOOL_FIELD, bool); PropertyUtils.setProperty(instance, DATE_FIELD, date); PropertyUtils.setProperty(instance, DATETIME_FIELD, dateTime); PropertyUtils.setProperty(instance, STRING_FIELD, str); return instance; }
Source:
<code>public Record putReplicatedRecord(Record replicatedRecord, long nowInMillis, boolean populateIndexes) { Record newRecord = createRecord(replicatedRecord, nowInMillis); markRecordStoreExpirable(replicatedRecord.getTtl(), replicatedRecord.getMaxIdle()); storage.put(replicatedRecord.getKey(), newRecord); <START> mutationObserver.onReplicationPutRecord(newRecord.getKey(), newRecord, !populateIndexes); <END> updateStatsOnPut(replicatedRecord.getHits(), nowInMillis); return newRecord; }</code><technical_language>change meaning of populateIndexes. onReplicationPutRecord accepts a backup parameter IndexingMutationObserver internally original meaning of populateIndex. populateIndex false for other reasons too. passing a MutationEvent parameter object carrying index backup info (we need others too) more flexible extensible</technical_language>

Target:
public Record putReplicatedRecord(Record replicatedRecord, long nowInMillis, boolean populateIndexes) { Record newRecord = createRecord(replicatedRecord, nowInMillis); markRecordStoreExpirable(replicatedRecord.getTtl(), replicatedRecord.getMaxIdle()); storage.put(replicatedRecord.getKey(), newRecord); mutationObserver.onReplicationPutRecord(newRecord.getKey(), newRecord, populateIndexes); updateStatsOnPut(replicatedRecord.getHits(), nowInMillis); return newRecord; }
Source:
<code>public void onHungerDamage(EntityDamageEvent e) { if (cooler == null || cooler.isDisabled()) { return; } <START> if (e.getCause() == EntityDamageEvent.DamageCause.STARVATION) { <END> checkAndConsume((Player) e.getEntity()); } }</code><technical_language>remove "EntityDamageEvent" here, imported</technical_language>

Target:
public void onHungerDamage(EntityDamageEvent e) { if (cooler == null || cooler.isDisabled() || !(e.getEntity() instanceof Player)) { return; } if (e.getCause() == DamageCause.STARVATION) { checkAndConsume((Player) e.getEntity()); } }
Source:
<code>public static void startChartboostBanner(Context context, AbstractChartboostAdapterDelegate adapterDelegate, ChartboostBannerErrorListener bannerErrorListener) { String location = adapterDelegate.getChartboostParams().getLocation(); WeakReference<AbstractChartboostAdapterDelegate> delegate = getBannerDelegate(location); if (delegate != null && delegate.get() != null) { Log.w(ChartboostMediationAdapter.TAG, "An ad has already been requested for the location: " + location); bannerErrorListener.notifyBannerInitializationError(AdRequest.ERROR_CODE_INVALID_REQUEST); return; } <START> addBannerDelegate(adapterDelegate.getChartboostParams().getLocation(), adapterDelegate); <END> startChartboost(context, adapterDelegate.getChartboostParams(), adapterDelegate); }</code><technical_language>String var location here</technical_language>

Target:
public static void startChartboostBanner(Context context, AbstractChartboostAdapterDelegate adapterDelegate, ChartboostBannerErrorListener bannerErrorListener) { String location = adapterDelegate.getChartboostParams().getLocation(); WeakReference<AbstractChartboostAdapterDelegate> delegate = getBannerDelegate(location); if (delegate != null && delegate.get() != null) { Log.w(TAG, "An ad has already been requested for the location: " + location); bannerErrorListener.notifyBannerInitializationError(AdRequest.ERROR_CODE_INVALID_REQUEST); return; } addBannerDelegate(location, adapterDelegate); startChartboost(context, adapterDelegate.getChartboostParams(), adapterDelegate); }
Source:
<code>private boolean contains(List<Method> methods, String methodName) { return methods.stream() .map(Method::getName) .anyMatch(name -> name.equals(methodName)); <START> } <END></code><technical_language>@mmerdes I formatting is a bit here. :)</technical_language>

Target:
private boolean contains(List<Method> methods, String methodName) { return methods.stream() .map(Method::getName) .anyMatch(methodName::equals); }
Source:
<code>public void testPixmapAndTextureRegionDisposal() { LookData lookData = new LookData(); Pixmap pixmap = new Pixmap(1, 1, Pixmap.Format.Alpha); lookData.setPixmap(pixmap); TextureRegion textureRegion = lookData.getTextureRegion(); lookData.setTextureRegion(textureRegion); assertFalse(lookData.getPixmap() == null); assertFalse(lookData.getTextureRegion() == null); assertTrue(lookData.isPixmapDisposed()); <START> assertTrue(lookData.isTextureRegionDisposed()); <END> }</code><technical_language>* resetLookData is called. * afraid mocks :wink: * Test a newly created LookData a Pixmap TextureRegion throw exception calling resetLookData well</technical_language>

Target:
public void testPixmapAndTextureRegionDisposal() { LookData lookData = new LookData(); Pixmap pixmap = mock(Pixmap.class); Texture texture = mock(Texture.class); TextureRegion textureRegion = new TextureRegion(texture); lookData.setPixmap(pixmap); lookData.setTextureRegion(textureRegion); lookData.resetLookData(); verify(pixmap, times(1)).dispose(); verify(textureRegion.getTexture(), times(1)).dispose(); }
Source:
<code>protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); realm = Realm.getDefaultInstance(); dbaccess = new RealmHelper(getApplicationContext()); RealmResults<SmsData> msgitems = realm.where(SmsData.class).findAll(); listViewAdv.setAdapter(new SmsDataAdapter(getApplicationContext(), msgitems, true)); listViewAdv.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> a, View v, int position, long id) { Object o = listViewAdv.getItemAtPosition(position); SmsData obj_itemDetails = (SmsData) o; <START> obj_itemDetails.removeFromRealm(); <END> Toast.makeText(a.getContext(), "Deleted Sms", LENGTH_SHORT).show(); return true; } }); }</code><technical_language>Same, wrapped in a transaction</technical_language>

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); realm = Realm.getDefaultInstance(); dbaccess = new RealmHelper(getApplicationContext()); RealmResults<SmsData> msgitems = realm.where(SmsData.class).findAllSorted("timestamp"); listViewAdv.setAdapter(new SmsDataAdapter(getApplicationContext(), msgitems, true)); listViewAdv.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> a, View v, int position, long id) { final SmsData smsData = (SmsData) listViewAdv.getItemAtPosition(position); realm.executeTransaction(new Realm.Transaction() { @Override public void execute(Realm realm) { smsData.removeFromRealm(); } }); Toast.makeText(a.getContext(), "Deleted Sms", LENGTH_SHORT).show(); return true; } }); }
Source:
<code>public void ensureCreated(String path, byte[] value, CreateMode createMode) throws InterruptedException, KeeperException { if (!path.isEmpty() && exists(path, false) == null) { <START> ensureCreated(getParent(path), null, createMode); <END> create(path, value, DEFAULT_ACL, createMode); NodeCreationBarrier.block(ZooKeeperPlus.this, path); } }</code><technical_language>want null for parent nodes? -- wanted check :)</technical_language>

Target:
public void ensureCreated(String path, byte[] value, CreateMode createMode) throws InterruptedException, KeeperException { if (!path.isEmpty() && exists(path, false) == null) { ensureCreated(new File(path).getParent(), null, createMode); create(path, value, DEFAULT_ACL, createMode); NodeCreationBarrier.block(ZooKeeperPlus.this, path); } }
Source:
<code>public void testCheckAndUpdateConfigMapWithEmptyResult() throws Exception { this.flinkKubeClient.createConfigMap(buildTestingConfigMap()); <START> this.flinkKubeClient.checkAndUpdateConfigMap(TESTING_CONFIG_MAP_NAME, c -> Optional.empty()).get(); <END> final Optional<KubernetesConfigMap> configMapOpt = this.flinkKubeClient.getConfigMap(TESTING_CONFIG_MAP_NAME); assertThat(configMapOpt.isPresent(), is(true)); assertThat(configMapOpt.get().getData().get(TESTING_CONFIG_MAP_KEY), is(TESTING_CONFIG_MAP_VALUE)); }</code><technical_language>assert this returns false</technical_language>

Target:
public void testCheckAndUpdateConfigMapWithEmptyResult() throws Exception { this.flinkKubeClient.createConfigMap(buildTestingConfigMap()); final boolean updated = this.flinkKubeClient.checkAndUpdateConfigMap( TESTING_CONFIG_MAP_NAME, c -> Optional.empty()).get(); assertThat(updated, is(false)); final Optional<KubernetesConfigMap> configMapOpt = this.flinkKubeClient.getConfigMap(TESTING_CONFIG_MAP_NAME); assertThat(configMapOpt.isPresent(), is(true)); assertThat(configMapOpt.get().getData().get(TESTING_CONFIG_MAP_KEY), is(TESTING_CONFIG_MAP_VALUE)); }
Source:
<code>private void resume(File file, UploadProgress uploadProgress, String objectId, boolean checksum) throws IOException { log.info("Resume from the previous upload..."); List<Part> parts = uploadProgress.getParts(); int completedParts = numCompletedParts(parts); int totalParts = parts.size(); if (!checksum) { parts.removeIf(new Predicate<Part>() { @Override public boolean test(Part part) { return part.isCompleted(); <START> } <END> }); } val progress = new Progress(terminal, quiet, totalParts, completedParts); uploadParts(parts, file, uploadProgress.getObjectId(), uploadProgress.getUploadId(), progress); cleanupState(file, objectId); }</code><technical_language>New line</technical_language>

Target:
private void resume(File file, UploadProgress uploadProgress, String objectId, boolean checksum) throws IOException { log.info("Resume from the previous upload..."); val parts = uploadProgress.getParts(); int completedParts = numCompletedParts(parts); int totalParts = parts.size(); if (!checksum) { parts.removeIf((Part part) -> part.isCompleted()); } if (!checksum) { parts.removeIf((Part part) -> part.isCompleted()); } val progress = new Progress(terminal, quiet, totalParts, completedParts); uploadParts(parts, file, uploadProgress.getObjectId(), uploadProgress.getUploadId(), progress); cleanupState(file, objectId); }
Source:
<code>public GlobMatcher(String pattern) { <START> matcher = getDefault().getPathMatcher(SYNTAX + ":" + pattern); <END> }</code><technical_language>validate empty for pattern</technical_language>

Target:
public GlobMatcher(String pattern) { checkArgument(pattern != null, "Pattern should not be null"); matcher = getDefault().getPathMatcher(SYNTAX + ":" + pattern); }
Source:
<code>public Boolean isDir(S3DDF s3DDF) throws DDFException { S3Object s3Object = mConn.getObject(s3DDF.getBucket(), s3DDF.getKey()); List<String> keys = this.listFiles(s3DDF.getBucket(), s3Object.getKey()); for (String key : keys) { if (key.endsWith("/") && !key.equals(s3DDF.getKey())) { <START> throw new DDFException("This folder contains subfolder, please recheck."); <END> } } return s3Object.getKey().endsWith("/"); }</code><technical_language>Instead of 'please recheck' 'S3 DDF support nested folders'</technical_language>

Target:
public Boolean isDir(S3DDF s3DDF) throws DDFException { S3Object s3Object = mConn.getObject(s3DDF.getBucket(), s3DDF.getKey()); List<String> keys = this.listFiles(s3DDF.getBucket(), s3Object.getKey()); for (String key : keys) { if (key.endsWith("/") && !key.equals(s3DDF.getKey())) { throw new DDFException("This folder contains subfolder, S3 DDF does not support nested folders"); } } return s3Object.getKey().endsWith("/"); }
Source:
<code>public Sequence<T> run(final Query<T> query) { final boolean isBySegment = query.getContextBySegment(false); final boolean shouldFinalize = query.getContextFinalize(true); if (shouldFinalize) { Function<T, T> finalizerFn; if (isBySegment) { finalizerFn = new Function<T, T>() { final Function<T, T> baseFinalizer = toolChest.makeFinalizerFn( query, new MetricManipulationFn() { @Override public Object manipulate(AggregatorFactory factory, Object object) { return factory.finalizeComputation(factory.deserialize(object)); } } ); @Override @SuppressWarnings("unchecked") public T apply(@Nullable T input) { Result<BySegmentResultValueClass<T>> result = (Result<BySegmentResultValueClass<T>>) input; BySegmentResultValueClass<T> resultsClass = result.getValue(); return (T) new Result<BySegmentResultValueClass>( result.getTimestamp(), new BySegmentResultValueClass( Lists.transform(resultsClass.getResults(), baseFinalizer), resultsClass.getSegmentId(), resultsClass.getInterval() ) ); } }; } else { finalizerFn = toolChest.makeFinalizerFn( query, new MetricManipulationFn() { @Override public Object manipulate(AggregatorFactory factory, Object object) { return factory.finalizeComputation(object); } } ); } return Sequences.map( <START> baseRunner.run(query.makeNonFinalizedQuery()), <END> finalizerFn ); } return baseRunner.run(query); }</code><technical_language>do need this change</technical_language>

Target:
public Sequence<T> run(final Query<T> query) { final boolean isBySegment = query.getContextBySegment(false); final boolean shouldFinalize = query.getContextFinalize(true); if (shouldFinalize) { Function<T, T> finalizerFn; if (isBySegment) { finalizerFn = new Function<T, T>() { final Function<T, T> baseFinalizer = toolChest.makeFinalizerFn( query, new MetricManipulationFn() { @Override public Object manipulate(AggregatorFactory factory, Object object) { return factory.finalizeComputation(factory.deserialize(object)); } } ); @Override @SuppressWarnings("unchecked") public T apply(@Nullable T input) { Result<BySegmentResultValueClass<T>> result = (Result<BySegmentResultValueClass<T>>) input; BySegmentResultValueClass<T> resultsClass = result.getValue(); return (T) new Result<BySegmentResultValueClass>( result.getTimestamp(), new BySegmentResultValueClass( Lists.transform(resultsClass.getResults(), baseFinalizer), resultsClass.getSegmentId(), resultsClass.getInterval() ) ); } }; } else { finalizerFn = toolChest.makeFinalizerFn( query, new MetricManipulationFn() { @Override public Object manipulate(AggregatorFactory factory, Object object) { return factory.finalizeComputation(object); } } ); } return Sequences.map( baseRunner.run(toolChest.makeNonFinalizedQuery(query)), finalizerFn ); } return baseRunner.run(query); }
Source:
<code>private void checkCellSizeLimit(final HRegion r, final Mutation m) throws IOException { if (r.maxCellSize > 0) { CellScanner cells = m.cellScanner(); while (cells.advance()) { int size = PrivateCellUtil.estimatedSerializedSizeOf(cells.current()); if (size > r.maxCellSize) { String msg = "Cell with size " + size + " exceeds limit of " + r.maxCellSize + " bytes"; if (LOG.isDebugEnabled()) { LOG.debug(msg); } throw new DoNotRetryIOException(msg); } } <START> } else { String msg = "Cell size check is disabled because of maxCellSize is set to" + r.maxCellSize; if (LOG.isDebugEnabled()) { LOG.debug(msg); } <END> } }</code><technical_language>log4j parameterized messages feature, need concatenation logic, if statement</technical_language>

Target:
private void checkCellSizeLimit(final HRegion r, final Mutation m) throws IOException { if (r.maxCellSize > 0) { CellScanner cells = m.cellScanner(); while (cells.advance()) { int size = PrivateCellUtil.estimatedSerializedSizeOf(cells.current()); if (size > r.maxCellSize) { String msg = "Cell with size " + size + " exceeds limit of " + r.maxCellSize + " bytes"; LOG.debug(msg); throw new DoNotRetryIOException(msg); } } } }
Source:
<code>public static Configuration injectSystemProperties(Configuration conf) { for (String propName : System.getProperties().stringPropertyNames()) { if (propName.startsWith("hadoop.")) { <START> String prop = propName.substring("hadoop.".length()); <END> if (prop.equals(JobContext.NUM_REDUCES)) { log.warn("Map-Reduce propery [%s] is ignored.", prop); } else { conf.set(propName.substring("hadoop.".length()), System.getProperty(propName)); } } } return conf; }</code><technical_language>this logic combined other method a similar thing, a "maybeAddJobProperty" method call</technical_language>

Target:
public static Configuration injectSystemProperties(Configuration conf) { for (String propName : System.getProperties().stringPropertyNames()) { if (propName.startsWith("hadoop.")) { conf.set(propName.substring("hadoop.".length()), System.getProperty(propName)); } } return conf; }
Source:
<code>private void InitializeHelpers() { <START> try { <END> for (String helperName : EnumCompat.GetNames(StorageType.class)) { Class<?> actionType = null; try { actionType = Class.forName(String.format("%1$s.%2$s%3$s", "org.ovirt.engine.core.bll.storage", helperName, "StorageHelper")); } catch (ClassNotFoundException cnfe) { } if (actionType != null) { Constructor<?> info = actionType.getConstructors()[0]; Object tempVar = info.newInstance(null); IStorageHelper currentHelper = (IStorageHelper) ((tempVar instanceof IStorageHelper) ? tempVar : null); if (currentHelper != null) { _helpers.put(StorageType.valueOf(helperName), currentHelper); } } } } catch (Exception ex) { throw new ApplicationException("JTODO missing exception", ex); } }</code><technical_language>Remove of EnumCompat.GetNames, is a leftovers C#</technical_language>

Target:
private void InitializeHelpers() { try { for (StorageType storageType : StorageType.values()) { Class<?> actionType = null; try { actionType = Class.forName(String.format("%1$s.%2$s%3$s", ACTION_TYPE_PACKAGE, storageType.name(), ACTION_TYPE_CLASS)); } catch (ClassNotFoundException cnfe) { } if (actionType != null) { Constructor<?> info = actionType.getConstructors()[0]; Object tempVar = info.newInstance(null); IStorageHelper currentHelper = (IStorageHelper) tempVar; if (currentHelper != null) { _helpers.put(storageType, currentHelper); } } } } catch (Exception ex) { throw new ApplicationException("JTODO missing exception", ex); } }
Source:
<code>protected boolean checkDomainCanBeAttached(StorageDomain storageDomain) { return checkStorageDomainType(storageDomain) && isStorageDomainFormatCorrectForPool(storageDomain, getStoragePool()) && checkStorageDomainSharedStatusNotLocked(storageDomain) && ((storageDomain.getStorageDomainType() == StorageDomainType.ISO || storageDomain.getStorageDomainType() == StorageDomainType.ImportExport) || isStorageDomainNotInPool(storageDomain)) && isStorageDomainTypeCorrect(storageDomain) && isStorageDomainTypeCompatibleWithPool(storageDomain) <START> && (isMixedTypesAllowedOnPool() || !isStoragePoolContainsOtherTypes(storageDomain)); <END> }</code><technical_language>this condition is impossible follow. Please split separate 'if's in isStorageDomainTypeCompatibleWithPool</technical_language>

Target:
protected boolean checkDomainCanBeAttached(StorageDomain storageDomain) { if (!validateAmountOfIsoAndExportDomainsInDC(storageDomain)) { return false; } if (!isStorageDomainFormatCorrectForDC(storageDomain, getStoragePool())) { return false; } if (!checkStorageDomainSharedStatusNotLocked(storageDomain)) { return false; } if (!(isStorageDomainOfTypeIsoOrExport(storageDomain) || isStorageDomainNotInPool(storageDomain))) { return false; } if (!isStorageDomainTypeCorrect(storageDomain)) { return false; } if (!isStorageDomainCompatibleWithDC(storageDomain)) { return false; } if (isMixedTypesAllowedInDC() || !isMixedTypeDC(storageDomain)) { return false; } return true; }
Source:
<code><START> public final void populate() { <END> XYChartConsumer chartConsumer = createChartConsumer(); fChartConsumer = chartConsumer; fData.getDataProvider().getSource().forEach(o -> { chartConsumer.accept(o); }); chartConsumer.finish(); createSeries(fSeriesMap); configureSeries(fObjectMap); getChart().getAxisSet().adjustRange(); configureAxes(); Arrays.stream(getChart().getAxisSet().getXAxes()).forEach(a -> a.enableLogScale(getModel().isXLogscale())); Arrays.stream(getChart().getAxisSet().getYAxes()).forEach(a -> a.enableLogScale(getModel().isYLogscale())); for (IAxis yAxis : getChart().getAxisSet().getYAxes()) { yAxis.getTick().setTickLabelAngle(1); } fXTitle = generateTitle(getXDescriptors(), getChart().getAxisSet().getXAxis(0)); fYTitle = generateTitle(getYDescriptors(), getChart().getAxisSet().getYAxis(0)); refreshDisplayTitles(); }</code><technical_language>need public if for abstract method, this in constructor (with smaller private methods)</technical_language>

Target:
protected final void populate() { XYChartConsumer chartConsumer = createChartConsumer(); fChartConsumer = chartConsumer; fData.getDataProvider().getSource().forEach(o -> { chartConsumer.accept(o); }); chartConsumer.finish(); createChartSeries(); configureSeries(fObjectMap); getChart().getAxisSet().adjustRange(); configureAxes(); Arrays.stream(getChart().getAxisSet().getXAxes()).forEach(a -> a.enableLogScale(getModel().isXLogscale())); Arrays.stream(getChart().getAxisSet().getYAxes()).forEach(a -> a.enableLogScale(getModel().isYLogscale())); for (IAxis yAxis : getChart().getAxisSet().getYAxes()) { yAxis.getTick().setTickLabelAngle(1); } fXTitle = generateTitle(getXDescriptors(), getChart().getAxisSet().getXAxis(0)); fYTitle = generateTitle(getYDescriptors(), getChart().getAxisSet().getYAxis(0)); refreshDisplayTitles(); }