auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public ValueType typeCheck(TypeContext ctx) { List<DeclType> dts = new LinkedList<DeclType>(); TypeContext thisCtx = ctx.extend(selfName, getExprType()); boolean isResource = false; for (Declaration d : decls_ExceptDelegate()) { DeclType dt = d.typeCheck(ctx, thisCtx); if (d instanceof DefDeclaration && ((DefDeclaration)d).isResource()) { isResource = true; } dts.add(dt); } ValueType type = getExprType(); if (hasDelegate) { ValueType delegateObjectType = ctx.lookupType(delegateDeclaration.getFieldName()); StructuralType delegateStructuralType = delegateObjectType.getStructuralType(thisCtx); for (DeclType declType : delegateStructuralType.getDeclTypes()) { if (!dts.stream().anyMatch(newDefDeclType-> newDefDeclType.isSubtypeOf(declType, thisCtx))) { dts.add(declType); } } } StructuralType requiredT = type.getStructuralType(ctx); StructuralType actualT = new StructuralType(selfName, dts); if (!actualT.isSubtypeOf(requiredT, ctx)) { ToolError.reportError(ErrorMessage.NOT_SUBTYPE, this, actualT.getSelfName(), requiredT.getSelfName());; } if (isResource && !requiredT.isResource()) { ToolError.reportError(ErrorMessage.MUST_BE_RESOURCE_TYPE, this, requiredT.getSelfName()); } return type; }

Target:
public ValueType typeCheck(TypeContext ctx) { List<DeclType> dts = new LinkedList<DeclType>(); TypeContext thisCtx = ctx.extend(selfName, getExprType()); boolean isResource = false; for (Declaration d : decls_ExceptDelegate()) { DeclType dt = d.typeCheck(ctx, thisCtx); dts.add(dt); if (d.containsResource()) { isResource = true; } } ValueType type = getExprType(); if (hasDelegate) { ValueType delegateObjectType = ctx.lookupType(delegateDeclaration.getFieldName()); StructuralType delegateStructuralType = delegateObjectType.getStructuralType(thisCtx); for (DeclType declType : delegateStructuralType.getDeclTypes()) { if (!dts.stream().anyMatch(newDefDeclType-> newDefDeclType.isSubtypeOf(declType, thisCtx))) { dts.add(declType); } } } StructuralType requiredT = type.getStructuralType(ctx); StructuralType actualT = new StructuralType(selfName, dts); if (!actualT.isSubtypeOf(requiredT, ctx)) { ToolError.reportError(ErrorMessage.NOT_SUBTYPE, this, actualT.getSelfName(), requiredT.getSelfName());; } if (isResource && !requiredT.isResource(GenContext.empty())) { ToolError.reportError(ErrorMessage.MUST_BE_RESOURCE_TYPE, this, requiredT.getSelfName()); } return type; }
Source:
public ChannelFuture writeToChannel(RedisResponse response) { if (response == null) { return null; } return channel.writeAndFlush(response.encode(byteBufAllocator), channel.newPromise()) .addListener((ChannelFutureListener) f -> { response.afterWrite(); logResponse(response); }); }

Target:
public ChannelFuture writeToChannel(RedisResponse response) { return channel.writeAndFlush(response.encode(byteBufAllocator), channel.newPromise()) .addListener((ChannelFutureListener) f -> { response.afterWrite(); logResponse(response, channel.remoteAddress().toString(), f.cause()); }); }
Source:
public Object parse(ElementInstance instance, Node node, Object value) throws Exception { Expression[] operands = OGCUtils.spatial(node, filterFactory, geometryFactory); double distance = ((Double) node.getChildValue(Double.class)).doubleValue(); String units = node.getChild("Distance").getAttributeValue("units").toString(); return filterFactory.beyond(operands[0], operands[1], distance, units); }

Target:
public Object parse(ElementInstance instance, Node node, Object value) throws Exception { Expression[] operands = OGCUtils.spatial(node, filterFactory, geometryFactory); double distance = ((Double) node.getChildValue(Double.class)).doubleValue(); Object units = node.getChild("Distance").getAttributeValue("units"); return filterFactory.beyond(operands[0], operands[1], distance, units==null? null : units.toString()); }
Source:
void notifyError(Throwable cause) { notifyError(new ErrorResponse(cause, op.getCallId(), op.isUrgent())); }

Target:
void notifyError(Throwable cause) { assert cause != null; switch (onException(cause)) { case RETRY_INVOCATION: if (invokeCount < tryCount) { handleRetry(cause); break; } case THROW_EXCEPTION: completeExceptionally(cause); break; default: throw new IllegalStateException("Unhandled ExceptionAction"); } }
Source:
public void addBadge(Object projectIdOrPath, Badge badge) throws GitLabApiException { Form formData = new Form(); formData.param("id", String.valueOf(getProjectIdOrPath(projectIdOrPath))); formData.param("link_url", badge.getLink_url()); formData.param("image_url", badge.getImage_url()); post(Response.Status.OK, formData, "projects", getProjectIdOrPath(projectIdOrPath), "badges"); }

Target:
public void addBadge(Object projectIdOrPath, Badge badge) throws GitLabApiException { Form formData = new Form(); formData.param("id", String.valueOf(getProjectIdOrPath(projectIdOrPath))); formData.param("link_url", badge.getLinkUrl()); formData.param("image_url", badge.getImageUrl()); post(Response.Status.OK, formData, "projects", getProjectIdOrPath(projectIdOrPath), "badges"); }
Source:
private static boolean hasUnbracedStatements(DetailAST ast) { final DetailAST nextSibling = ast.getNextSibling(); final DetailAST parent = ast.getParent(); boolean result = false; if (parent.getType() == TokenTypes.SWITCH_RULE) { final DetailAST lastSibling = getLastSibling(ast); result = lastSibling.getType() != TokenTypes.SLIST; } else if (nextSibling != null && nextSibling.getType() == TokenTypes.SLIST && nextSibling.getFirstChild().getType() != TokenTypes.SLIST) { result = true; } return result; }

Target:
private static boolean hasUnbracedStatements(DetailAST ast) { final DetailAST nextSibling = ast.getNextSibling(); boolean result = false; if (isInSwitchRule(ast)) { final DetailAST parent = ast.getParent(); result = parent.getLastChild().getType() != TokenTypes.SLIST; } else if (nextSibling != null && nextSibling.getType() == TokenTypes.SLIST && nextSibling.getFirstChild().getType() != TokenTypes.SLIST) { result = true; } return result; }
Source:
public TerminalInfoView() { addToList(this); }

Target:
public TerminalInfoView() { super(); addToList(this); }
Source:
public void doPolling(Guid cmdId, List<Guid> childCmdIds) { RemoveImageCommand<RemoveImageParameters> cmd = CommandCoordinatorUtil.retrieveCommand(cmdId); if (asyncRetVal == null) { DiskImage diskImage = cmd.getDiskImage(); Guid storagePoolId = diskImage.getStoragePoolId() != null ? diskImage.getStoragePoolId() : Guid.Empty; Guid storageDomainId = Guid.isNullOrEmpty(cmd.getParameters().getStorageDomainId()) && cmd.getDiskImage() != null ? diskImage.getStorageIds().get(0) : cmd.getParameters().getStorageDomainId(); asyncRetVal = ResourceManager.getInstance().runAsyncVdsCommand(VDSCommandType.GetImageInfo, new GetImageInfoVDSCommandParameters(storagePoolId, storageDomainId, diskImage.getId(), diskImage.getImageId())); } if (asyncRetVal != null && asyncRetVal.isRequestCompleted()) { Object retVal = asyncRetVal.getReturnValue(); if (retVal != null) { DiskImage di = (DiskImage) retVal; log.info("DiskImage retrieved " + di.getId()); log.info("DiskImage In command " + cmd.getDiskImage().getId()); } if (!asyncRetVal.getSucceeded()) { cmd.setCommandStatus(CommandStatus.SUCCEEDED); } else { asyncRetVal = null; } } }

Target:
public void doPolling(Guid cmdId, List<Guid> childCmdIds) { RemoveImageCommand<RemoveImageParameters> cmd = CommandCoordinatorUtil.retrieveCommand(cmdId); if (asyncRetVal == null) { DiskImage diskImage = cmd.getDiskImage(); Guid storagePoolId = diskImage.getStoragePoolId() != null ? diskImage.getStoragePoolId() : Guid.Empty; Guid storageDomainId = Guid.isNullOrEmpty(cmd.getParameters().getStorageDomainId()) && cmd.getDiskImage() != null ? diskImage.getStorageIds().get(0) : cmd.getParameters().getStorageDomainId(); asyncRetVal = ResourceManager.getInstance().runAsyncVdsCommand(VDSCommandType.GetImageInfo, new GetImageInfoVDSCommandParameters(storagePoolId, storageDomainId, diskImage.getId(), diskImage.getImageId())); } if (asyncRetVal != null && asyncRetVal.isRequestCompleted()) { asyncRetVal.getReturnValue(); cmd.setCommandStatus(asyncRetVal.getSucceeded() ? CommandStatus.SUCCEEDED : CommandStatus.FAILED); } }
Source:
public Map<String, Set<DatastreamTask>> assign(List<DatastreamGroup> datastreams, List<String> instances, Map<String, Set<DatastreamTask>> currentAssignment) { LOG.info("Trying to assign datastreams to instances and the current assignment is {}", datastreams, instances, currentAssignment); Map<String, Set<DatastreamTask>> newAssignment = new HashMap<>(); for (String instance : instances) { newAssignment.put(instance, new HashSet<>()); currentAssignment.putIfAbsent(instance, new HashSet<>()); } Map<String, Set<DatastreamTask>> currentAssignmentCopy = new HashMap<>(currentAssignment.size()); currentAssignment.forEach((k, v) -> currentAssignmentCopy.put(k, new HashSet<>(v))); int instancePos = 0; for (DatastreamGroup dg : datastreams) { int numTasks = getNumTasks(dg, instances.size()); for (int taskPos = 0; taskPos < numTasks; taskPos++) { String instance = instances.get(instancePos); DatastreamTask foundDatastreamTask = currentAssignmentCopy.get(instance) .stream() .filter(x -> x.getTaskPrefix().equals(dg.getTaskPrefix())) .findFirst() .orElse(new DatastreamTaskImpl(dg.getDatastreams())); currentAssignmentCopy.get(instance).remove(foundDatastreamTask); newAssignment.get(instance).add(foundDatastreamTask); instancePos = (instancePos + 1) % instances.size(); } } LOG.info("New assignment is {}", newAssignment); return newAssignment; }

Target:
public Map<String, Set<DatastreamTask>> assign(List<DatastreamGroup> datastreams, List<String> instances, Map<String, Set<DatastreamTask>> currentAssignment) { LOG.info("Trying to assign datastreams to instances and the current assignment is {}", datastreams, instances, currentAssignment); Map<String, Set<DatastreamTask>> newAssignment = new HashMap<>(); Map<String, Set<DatastreamTask>> currentAssignmentCopy = new HashMap<>(currentAssignment.size()); currentAssignment.forEach((k, v) -> currentAssignmentCopy.put(k, new HashSet<>(v))); for (String instance : instances) { newAssignment.put(instance, new HashSet<>()); currentAssignmentCopy.putIfAbsent(instance, new HashSet<>()); } int instancePos = 0; for (DatastreamGroup dg : datastreams) { int numTasks = getNumTasks(dg, instances.size()); for (int taskPos = 0; taskPos < numTasks; taskPos++) { String instance = instances.get(instancePos); DatastreamTask foundDatastreamTask = currentAssignmentCopy.get(instance) .stream() .filter(x -> x.getTaskPrefix().equals(dg.getTaskPrefix())) .findFirst() .orElse(new DatastreamTaskImpl(dg.getDatastreams())); currentAssignmentCopy.get(instance).remove(foundDatastreamTask); newAssignment.get(instance).add(foundDatastreamTask); instancePos = (instancePos + 1) % instances.size(); } } LOG.info("New assignment is {}", newAssignment); return newAssignment; }
Source:
public List<TopicPartition> partitions() { return Builder.getPartitions(data); }

Target:
public List<TopicPartition> partitions() { if (cachedPartitions != null) { return cachedPartitions; } cachedPartitions = Builder.getPartitions(data); return cachedPartitions; }
Source:
protected boolean processCurrentFileAndExtractPdpFeedFromSAEFile(String saeFileName) { boolean success = true; LOG.debug("processCurrentFileAndExtractPdpFeedFromSAEFile, current File: " + saeFileName); ConcurStandardAccountingExtractFile concurStandardAccoutingExtractFile = getConcurStandardAccountingExtractService() .parseStandardAccoutingExtractFile(saeFileName); if (getConcurStandardAccountingExtractValidationService().validateConcurStandardAccountExtractFile(concurStandardAccoutingExtractFile)) { String outputFileName = getConcurStandardAccountingExtractService().extractPdpFeedFromStandardAccounitngExtract(concurStandardAccoutingExtractFile); if (StringUtils.isEmpty(outputFileName)) { success = false; LOG.error("processCurrentFileAndExtractPdpFeedFromSAEFile, could not produce a PDP XML file for " + saeFileName); } if (success) { success &= getConcurStandardAccountingExtractService() .extractCollectorFeedFromStandardAccountingExtract(concurStandardAccoutingExtractFile); } if (success) { try { getConcurStandardAccountingExtractService().createDoneFileForPdpFile(outputFileName); } catch (IOException e) { LOG.error("processCurrentFileAndExtractPdpFeedFromSAEFile, unable to create .done file: ", e); success = false; } } } else { success = false; LOG.error("processCurrentFileAndExtractPdpFeedFromSAEFile, the SAE file failed high level validation."); } return success; }

Target:
protected boolean processCurrentFileAndExtractPdpFeedFromSAEFile(String saeFileName) { boolean success = true; LOG.debug("processCurrentFileAndExtractPdpFeedFromSAEFile, current File: " + saeFileName); ConcurStandardAccountingExtractFile concurStandardAccoutingExtractFile = getConcurStandardAccountingExtractService() .parseStandardAccoutingExtractFile(saeFileName); if (getConcurStandardAccountingExtractValidationService().validateConcurStandardAccountExtractFile(concurStandardAccoutingExtractFile)) { String outputFileName = getConcurStandardAccountingExtractService().extractPdpFeedFromStandardAccountingExtract(concurStandardAccoutingExtractFile); if (StringUtils.isEmpty(outputFileName)) { success = false; LOG.error("processCurrentFileAndExtractPdpFeedFromSAEFile, could not produce a PDP XML file for " + saeFileName); } if (success) { success &= getConcurStandardAccountingExtractService() .extractCollectorFeedFromStandardAccountingExtract(concurStandardAccoutingExtractFile); } if (success) { try { getConcurStandardAccountingExtractService().createDoneFileForPdpFile(outputFileName); } catch (IOException e) { LOG.error("processCurrentFileAndExtractPdpFeedFromSAEFile, unable to create .done file: ", e); success = false; } } } else { success = false; LOG.error("processCurrentFileAndExtractPdpFeedFromSAEFile, the SAE file failed high level validation."); } return success; }
Source:
public static Type canonicalize(Type type) { if (type instanceof Class) { Class<?> c = (Class<?>) type; return c.isArray() ? new GenericArrayTypeImpl(canonicalize(c.getComponentType())) : c; } else if (type instanceof ParameterizedType) { if (type instanceof ParameterizedTypeImpl) return type; ParameterizedType p = (ParameterizedType) type; return new ParameterizedTypeImpl(p.getOwnerType(), p.getRawType(), p.getActualTypeArguments()); } else if (type instanceof GenericArrayType) { if (type instanceof GenericArrayTypeImpl) return type; GenericArrayType g = (GenericArrayType) type; return new GenericArrayTypeImpl(g.getGenericComponentType()); } else if (type instanceof WildcardType) { Type[] upperBounds = ((WildcardType) type).getUpperBounds(); Type[] lowerBounds = ((WildcardType) type).getLowerBounds(); if (lowerBounds.length == 0) { if (upperBounds.length != 1) throw new IllegalArgumentException(); return canonicalize(upperBounds[0]); } else { if (type instanceof WildcardTypeImpl) return type; return new WildcardTypeImpl(upperBounds, lowerBounds); } } else { return type; } }

Target:
public static Type canonicalize(Type type) { if (type instanceof Class) { Class<?> c = (Class<?>) type; return c.isArray() ? new GenericArrayTypeImpl(canonicalize(c.getComponentType())) : c; } else if (type instanceof ParameterizedType) { if (type instanceof ParameterizedTypeImpl) return type; ParameterizedType p = (ParameterizedType) type; return new ParameterizedTypeImpl(p.getOwnerType(), p.getRawType(), p.getActualTypeArguments()); } else if (type instanceof GenericArrayType) { if (type instanceof GenericArrayTypeImpl) return type; GenericArrayType g = (GenericArrayType) type; return new GenericArrayTypeImpl(g.getGenericComponentType()); } else if (type instanceof WildcardType) { if (type instanceof WildcardTypeImpl) return type; WildcardType w = (WildcardType) type; return new WildcardTypeImpl(w.getUpperBounds(), w.getLowerBounds()); } else { return type; } }
Source:
public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final Image image = (Image) o; if (!uri.equals(image.uri)) { return false; } if (title != null ? !title.equals(image.title) : image.title != null) { return false; } return !(description != null ? !description.equals(image.description) : image.description != null); }

Target:
public boolean equals(final Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } final Image image = (Image) o; return uri.equals(image.uri) && StringUtils.equals(title, image.title) && StringUtils.equals(description, image.description); }
Source:
private boolean isPhysicalPlacementRequest(final Ds3Request ds3Request) { return ds3Request.getOperation() != null && ( ds3Request.getOperation() == Operation.GET_PHYSICAL_PLACEMENT || ds3Request.getOperation() == Operation.VERIFY_PHYSICAL_PLACEMENT); }

Target:
private static boolean isPhysicalPlacementRequest(final Ds3Request ds3Request) { return ds3Request.getOperation() != null && ( ds3Request.getOperation() == Operation.GET_PHYSICAL_PLACEMENT || ds3Request.getOperation() == Operation.VERIFY_PHYSICAL_PLACEMENT); }
Source:
public boolean shouldWarn(SolGame game) { hero = game.getHero(); if (!hero.isPresent()) { return false; } Vector2 pos = hero.orElseThrow(SolNullOptionalException::new).getPosition(); Vector2 spd = hero.orElseThrow(SolNullOptionalException::new).getSpd(); float acc = hero.orElseThrow(SolNullOptionalException::new).getAcc(); float spdLen = spd.len(); float spdAngle = SolMath.angle(spd); if (acc <= 0 || spdLen < 2 * acc) { return false; } float breakWay = spdLen * spdLen / acc / 2; breakWay += 2 * spdLen; Vector2 finalPos = SolMath.getVec(0, 0); SolMath.fromAl(finalPos, spdAngle, breakWay); finalPos.add(pos); warnCallback.show = false; game.getObjectManager().getWorld().rayCast(warnCallback, pos, finalPos); SolMath.free(finalPos); return warnCallback.show; }

Target:
public boolean shouldWarn(SolGame game) { hero = game.getHero(); return hero.map(y -> { Vector2 spd = y.getSpd(); float acc = y.getAcc(); float spdLen = spd.len(); if (acc <= 0 || spdLen < 2 * acc) { return false; } float spdAngle = SolMath.angle(spd); Vector2 pos = y.getPosition(); float breakWay = spdLen * spdLen / acc / 2; breakWay += 2 * spdLen; Vector2 finalPos = SolMath.getBoundVector2(0, 0); SolMath.fromAl(finalPos, spdAngle, breakWay); finalPos.add(pos); warnCallback.show = false; game.getObjectManager().getWorld().rayCast(warnCallback, pos, finalPos); SolMath.free(finalPos); return warnCallback.show; }).orElse(false); }
Source:
private JavaResolveResult[] multiResolve(boolean incompleteCode, boolean resolveToParents) { boolean skipCaching = true; List<? extends PsiElement> cachedNames = skipCaching ? (HaxeResolver.INSTANCE).resolve(this, incompleteCode) : ResolveCache.getInstance(getProject()).resolveWithCaching(this, HaxeResolver.INSTANCE, true, incompleteCode); JavaResolveResult result = toCandidateInfoArray(resolveToParents ? resolveNamesToParents(cachedNames) : cachedNames); return result; }

Target:
private JavaResolveResult[] multiResolve(boolean incompleteCode, boolean resolveToParents) { boolean skipCaching = false; List<? extends PsiElement> cachedNames = skipCaching ? (HaxeResolver.INSTANCE).resolve(this, incompleteCode) : ResolveCache.getInstance(getProject()).resolveWithCaching(this, HaxeResolver.INSTANCE, true, incompleteCode); JavaResolveResult result = toCandidateInfoArray(resolveToParents ? resolveNamesToParents(cachedNames) : cachedNames); return result; }
Source:
private ICompletionProposal[] computeProposals(int offset) { ICompletionProposal[] proposals = null; boolean succeeded = false; try { if (fContentAssistSubjectControl != null) { proposals = fContentAssistant.computeCompletionProposals(fContentAssistSubjectControl, offset); } else { proposals = fContentAssistant.computeCompletionProposals(fViewer, offset); } succeeded = true; } finally { if (!succeeded) { hide(); } } return proposals; }

Target:
private ICompletionProposal[] computeProposals(int offset) { if (fContentAssistSubjectControl != null) return fContentAssistant.computeCompletionProposals(fContentAssistSubjectControl, offset); return fContentAssistant.computeCompletionProposals(fViewer, offset); }
Source:
public synchronized void setToBeKeptToArrayList(ArrayList<Sequence> sequences) { for (Sequence s : sequences) { sequencesStorage.get(s.getId()).setStatus("uploadedAndKeep"); } }

Target:
public synchronized void setToBeKeptToArrayList(ArrayList<Sequence> sequences) { for (Sequence s : sequences) { sequencesStorage.get(s.getId()).setStatus(Sequence.STATUS_UPLOADED_AND_KEEP); } }
Source:
protected ODatabaseDocumentTx getDB() { return db; }

Target:
ODatabaseDocumentTx getDB() { return db; }
Source:
public void completeBootstrap(RowMap completeBootstrapRow, AbstractProducer producer, MaxwellReplicator replicator) throws Exception { String databaseName = ( String ) completeBootstrapRow.getData("database_name"); String tableName = ( String ) completeBootstrapRow.getData("table_name"); Database database = findDatabase(replicator.getSchema(), databaseName); ensureTable(tableName, database); Table table = findTable(tableName, database); OpenReplicator openReplicator = replicator.getOpenReplicator(); BinlogPosition position = new BinlogPosition(openReplicator.getBinlogPosition(), openReplicator.getBinlogFileName()); producer.push(completeBootstrapRow); producer.push(bootstrapCompleteRowMap(table, position)); LOGGER.info(String.format("bootstrapping ended for %s.%s", databaseName, tableName)); }

Target:
public void completeBootstrap(RowMap completeBootstrapRow, AbstractProducer producer, MaxwellReplicator replicator) throws Exception { String databaseName = ( String ) completeBootstrapRow.getData("database_name"); String tableName = ( String ) completeBootstrapRow.getData("table_name"); Database database = findDatabase(replicator.getSchema(), databaseName); ensureTable(tableName, database); Table table = findTable(tableName, database); BinlogPosition position = completeBootstrapRow.getPosition(); producer.push(completeBootstrapRow); producer.push(bootstrapCompleteRowMap(table, position)); LOGGER.info(String.format("bootstrapping ended for %s.%s", databaseName, tableName)); }
Source:
public void testUpdateGlusterServerHookStatus() { dao.updateGlusterServerHookStatus(FixturesTool.HOOK_ID, SERVER_ID, GlusterHookStatus.ENABLED); GlusterServerHook serverhook = dao.getGlusterServerHook(FixturesTool.HOOK_ID, SERVER_ID); assertNotNull(serverhook); assertEquals(GlusterHookStatus.ENABLED, serverhook.getStatus()); }

Target:
public void testUpdateGlusterServerHookStatus() { GlusterServerHook serverhookExisting = dao.getGlusterServerHook(FixturesTool.HOOK_ID, SERVER_ID); assertEquals(GlusterHookStatus.ENABLED, serverhookExisting.getStatus()); dao.updateGlusterServerHookStatus(FixturesTool.HOOK_ID, SERVER_ID, GlusterHookStatus.DISABLED); GlusterServerHook serverhookUpdated = dao.getGlusterServerHook(FixturesTool.HOOK_ID, SERVER_ID); assertNotNull(serverhookUpdated); assertEquals(GlusterHookStatus.DISABLED, serverhookUpdated.getStatus()); }
Source:
public CompositeSend(List<Send> compositeSendList) { this.compositeSendList = compositeSendList; this.currentIndexInProgress = 0; for (Send messageFormatSend : compositeSendList) { totalSizeToWrite += messageFormatSend.sizeInBytes(); } if (compositeSendList.isEmpty()) { compositeSendContent = Unpooled.EMPTY_BUFFER; } else { if (compositeSendList.size() == 1) { compositeSendContent = compositeSendList.get(0).content(); } else { int numComponents = 0; boolean allContentPresent = true; List<ByteBuf> byteBufs = new ArrayList<>(compositeSendList.size()); for (Send send : compositeSendList) { ByteBuf content = send.content(); if (content == null) { allContentPresent = false; break; } if (content instanceof CompositeByteBuf) { numComponents += ((CompositeByteBuf) content).numComponents(); } else { numComponents++; } byteBufs.add(content); } if (allContentPresent) { compositeSendContent = byteBufs.get(0).alloc().compositeHeapBuffer(numComponents); for (ByteBuf content : byteBufs) { if (content instanceof CompositeByteBuf) { Iterator<ByteBuf> iterator = ((CompositeByteBuf) content).iterator(); while (iterator.hasNext()) { ((CompositeByteBuf) compositeSendContent).addComponent(true, iterator.next().retain()); } content.release(); } else { ((CompositeByteBuf) compositeSendContent).addComponent(true, content); } } } else { compositeSendContent = null; } } } }

Target:
public CompositeSend(List<Send> compositeSendList) { this.compositeSendList = compositeSendList; this.currentIndexInProgress = 0; for (Send messageFormatSend : compositeSendList) { totalSizeToWrite += messageFormatSend.sizeInBytes(); } if (compositeSendList.isEmpty()) { compositeSendContent = Unpooled.EMPTY_BUFFER; } else { if (compositeSendList.size() == 1) { compositeSendContent = compositeSendList.get(0).content(); } else { boolean allContentPresent = true; List<ByteBuf> byteBufs = new ArrayList<>(compositeSendList.size()); for (Send send : compositeSendList) { ByteBuf content = send.content(); if (content == null) { allContentPresent = false; break; } byteBufs.add(content); } if (allContentPresent) { compositeSendContent = byteBufs.get(0).alloc().compositeDirectBuffer(compositeSendList.size()); for (ByteBuf content : byteBufs) { ((CompositeByteBuf) compositeSendContent).addComponent(true, content); } } else { compositeSendContent = null; } } } }
Source:
void onMouseEnterUsername() { if (playerInfoBean.getChatOnly()) { return; } else { PlayerCardTooltipController playerCardTooltipController = applicationContext.getBean(PlayerCardTooltipController.class); playerCardTooltipController.setPlayer(playerInfoBean); Tooltip statusTooltip = new Tooltip(); statusTooltip.setGraphic(playerCardTooltipController.getRoot()); Tooltip.install(usernameLabel, statusTooltip); } }

Target:
void onMouseEnterUsername() { if (playerInfoBean.getChatOnly()) { return; } if (playerCardTooltipController != null) { return; } playerCardTooltipController = applicationContext.getBean(PlayerCardTooltipController.class); playerCardTooltipController.setPlayer(playerInfoBean); Tooltip statusTooltip = new Tooltip(); statusTooltip.setGraphic(playerCardTooltipController.getRoot()); Tooltip.install(usernameLabel, statusTooltip); }
Source:
public static ImmutableList<Path> listObjectsForDirectory(final Path directory) throws IOException { final List<Path> objects = new ArrayList<>(); Files.walkFileTree(directory, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException { objects.add(file); return FileVisitResult.CONTINUE; } }); return ImmutableList.copyOf(objects); }

Target:
public static ImmutableList<Path> listObjectsForDirectory(final Path directory) throws IOException { final ImmutableList.Builder<Path> objectsBuilder = ImmutableList.builder(); Files.walkFileTree(directory, new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(final Path file, final BasicFileAttributes attrs) throws IOException { objectsBuilder.add(file); return FileVisitResult.CONTINUE; } }); return objectsBuilder.build(); }
Source:
public HelixClusterAgentsFactory(ClusterMapConfig clusterMapConfig, MetricRegistry metricRegistry) { this.clusterMapConfig = clusterMapConfig; this.instanceName = ClusterMapUtils.getInstanceName(clusterMapConfig.clusterMapHostName, clusterMapConfig.clusterMapPort); helixFactory = new HelixFactory(); this.metricRegistry = metricRegistry; }

Target:
HelixClusterAgentsFactory(ClusterMapConfig clusterMapConfig, MetricRegistry metricRegistry) { this.clusterMapConfig = clusterMapConfig; this.instanceName = ClusterMapUtils.getInstanceName(clusterMapConfig.clusterMapHostName, clusterMapConfig.clusterMapPort); helixFactory = new HelixFactory(); this.metricRegistry = metricRegistry; }
Source:
public void paintControl(PaintEvent e) { if (fIsHighlight && e != null) { e.gc.setBackground(Display.getDefault().getSystemColor( SWT.COLOR_RED)); e.gc.setAlpha(128); e.gc.fillOval(fHighlightX - 5, fHighlightY - 5, 10, 10); } }

Target:
public void paintControl(PaintEvent e) { if (fIsHighlight && e != null) { e.gc.setBackground(Display.getDefault().getSystemColor( SWT.COLOR_RED)); e.gc.setAlpha(ALPHA); e.gc.fillOval(fHighlightX - HIGHLIGHT_RADIUS, fHighlightY - HIGHLIGHT_RADIUS, 2 * HIGHLIGHT_RADIUS, 2 * HIGHLIGHT_RADIUS); } }
Source:
public void close() { try { httpClient.close(); } catch (IOException e) { log.debug("close() threw IOException"); } }

Target:
public void close() { try { if (httpClient != null) { httpClient.close(); httpClient = null; log.debug("closed httpClient"); } } catch (IOException e) { log.debug("close() threw IOException"); } }
Source:
public synchronized void stop() throws ConnectorException { try { if (controller != null) { this.controller.stop(2000, TimeUnit.MILLISECONDS); this.controller = null; } } catch (InterruptedException e) { log.error("KafkaConnector interrupted while stopping"); } if (kafkaProducer != null) { this.kafkaProducer.close(); this.kafkaProducer = null; } }

Target:
public synchronized void stop() throws ConnectorException { try { if (controller != null) { controller.stop(2000, TimeUnit.MILLISECONDS); controller = null; } } catch (InterruptedException e) { log.error("KafkaConnector interrupted while stopping"); } if (kafkaProducer != null) { kafkaProducer.close(); kafkaProducer = null; } }
Source:
protected void checkFile(@NotNull ErlangFile file, @NotNull ProblemsHolder problemsHolder) { for (ErlangBehaviour behaviour : file.getBehaviours()) { ErlangModuleRef behaviourRef = behaviour.getModuleRef(); ErlangFile behaviourModule = ErlangPsiImplUtil.resolveToFile(behaviourRef); if (behaviourModule == null) continue; List<ErlangCallbackSpec> undefinedCallbacks = ContainerUtil.newArrayList(); Map<String, ErlangCallbackSpec> callbackMap = behaviourModule.getCallbackMap(); for (ErlangCallbackSpec spec : callbackMap.values()) { if (spec.isOptional()) continue; String name = ErlangPsiImplUtil.getCallbackSpecName(spec); int arity = ErlangPsiImplUtil.getCallbackSpecArity(spec); ErlangFunction function = name != null ? file.getFunction(name, arity) : null; if (function == null || !function.isExported()) { undefinedCallbacks.add(spec); } } if (undefinedCallbacks.isEmpty()) continue; boolean multiple = undefinedCallbacks.size() != 1; StringBuilder builder = new StringBuilder(); builder.append("Undefined or non-exported callback function").append(multiple ? "s" : "").append(": "); for (ErlangCallbackSpec spec : undefinedCallbacks) { builder.append("'").append(ErlangPsiImplUtil.createFunctionPresentationFromCallbackSpec(spec)).append("', "); } String message = builder.substring(0, builder.length() - 2); registerProblem(problemsHolder, behaviourRef, message, new CreateAndExportFunctionsFix(undefinedCallbacks, file.getProject())); } }

Target:
protected void checkFile(@NotNull ErlangFile file, @NotNull ProblemsHolder problemsHolder) { ErlangSdkRelease release = ErlangSdkType.getRelease(file); boolean supportOptionalCallbacks = release == null || !ErlangSdkRelease.V_18_0.isNewerThan(release); for (ErlangBehaviour behaviour : file.getBehaviours()) { ErlangModuleRef behaviourRef = behaviour.getModuleRef(); ErlangFile behaviourModule = ErlangPsiImplUtil.resolveToFile(behaviourRef); if (behaviourModule == null) continue; List<ErlangCallbackSpec> undefinedCallbacks = ContainerUtil.newArrayList(); Map<String, ErlangCallbackSpec> callbackMap = behaviourModule.getCallbackMap(); for (ErlangCallbackSpec spec : callbackMap.values()) { if (supportOptionalCallbacks && spec.isOptional()) continue; String name = ErlangPsiImplUtil.getCallbackSpecName(spec); int arity = ErlangPsiImplUtil.getCallbackSpecArity(spec); ErlangFunction function = name != null ? file.getFunction(name, arity) : null; if (function == null || !function.isExported()) { undefinedCallbacks.add(spec); } } if (undefinedCallbacks.isEmpty()) continue; boolean multiple = undefinedCallbacks.size() != 1; StringBuilder builder = new StringBuilder(); builder.append("Undefined or non-exported callback function").append(multiple ? "s" : "").append(": "); for (ErlangCallbackSpec spec : undefinedCallbacks) { builder.append("'").append(ErlangPsiImplUtil.createFunctionPresentationFromCallbackSpec(spec)).append("', "); } String message = builder.substring(0, builder.length() - 2); registerProblem(problemsHolder, behaviourRef, message, new CreateAndExportFunctionsFix(undefinedCallbacks, file.getProject())); } }
Source:
private void protocolViolation(ChannelHandlerContext ctx, ByteBuf in, CorruptedWebSocketFrameException ex) { state = State.CORRUPT; int readableBytes = in.readableBytes(); if (readableBytes > 0) { in.skipBytes(readableBytes); } if (ctx.channel().isActive() && config.closeOnProtocolViolation()) { Object closeMessage; if (receivedClosingHandshake) { closeMessage = Unpooled.EMPTY_BUFFER; } else { WebSocketCloseStatus closeStatus = ex.getCloseStatus(); String reasonText = ex.getMessage(); if (reasonText == null) { reasonText = closeStatus.reasonText(); } closeMessage = new CloseWebSocketFrame(closeStatus, reasonText); } ctx.writeAndFlush(closeMessage).addListener(ChannelFutureListener.CLOSE); } throw ex; }

Target:
private void protocolViolation(ChannelHandlerContext ctx, ByteBuf in, CorruptedWebSocketFrameException ex) { state = State.CORRUPT; int readableBytes = in.readableBytes(); if (readableBytes > 0) { in.skipBytes(readableBytes); } if (ctx.channel().isActive() && config.closeOnProtocolViolation()) { Object closeMessage; if (receivedClosingHandshake) { closeMessage = Unpooled.EMPTY_BUFFER; } else { WebSocketCloseStatus closeStatus = ex.closeStatus(); String reasonText = ex.getMessage(); if (reasonText == null) { reasonText = closeStatus.reasonText(); } closeMessage = new CloseWebSocketFrame(closeStatus, reasonText); } ctx.writeAndFlush(closeMessage).addListener(ChannelFutureListener.CLOSE); } throw ex; }
Source:
void openStreamAndCancel(CommonHttpMethod3 method) throws Exception { StubProgressMonitor monitor = new StubProgressMonitor(); HttpClient client = new HttpClient(); String url = "<LINK_0>"; WebLocation location = new WebLocation(url); HostConfiguration hostConfiguration = WebUtil.createHostConfiguration(client, location, monitor); InputStream in; try { WebUtil.execute(client, hostConfiguration, method, monitor); in = method.getResponseBodyAsStream(monitor); } finally { monitor.setCanceled(true); method.releaseConnection(monitor); } assertNotNull(in); Thread.sleep(500); assertEquals(0, ((ThreadPoolExecutor) CommonsNetPlugin.getExecutorService()).getActiveCount()); }

Target:
void openStreamAndCancel(CommonHttpMethod3 method) throws Exception { StubProgressMonitor monitor = new StubProgressMonitor(); HttpClient client = new HttpClient(); String url = "<LINK_1>"; WebLocation location = new WebLocation(url); HostConfiguration hostConfiguration = WebUtil.createHostConfiguration(client, location, monitor); InputStream in; try { WebUtil.execute(client, hostConfiguration, method, monitor); in = method.getResponseBodyAsStream(monitor); } finally { monitor.setCanceled(true); method.releaseConnection(monitor); } assertNotNull(in); Thread.sleep(500); assertEquals(0, ((ThreadPoolExecutor) CommonsNetPlugin.getExecutorService()).getActiveCount()); try { in.read(); fail("Expected channel to be closed"); } catch (IOException e) { } }
Source:
public AnswerBox(double nXStart, double nYStart, int nCharacterLimit, boolean nRetry, String nCorrectAnswers, int nMarks, boolean nIsNumerical, Group nGroup) { answerField = new TextField(); this.marks = nMarks; this.correctAnswers = nCorrectAnswers; this.characterLimit = nCharacterLimit; this.xStart = nXStart; this.yStart = nYStart; this.group = nGroup; this.retry = nRetry; this.isNumerical = nIsNumerical; box = new HBox(); checkAnswerButton = new Button("Check answer"); checkAnswerButton.setId("check answer"); checkAnswerButton.setOnAction(new ButtonEventHandler()); feedbackLabel = new Label(); createAnswerBox(characterLimit, nRetry); answerField.setOnKeyPressed(new EventHandler<KeyEvent>() { public void handle(KeyEvent key) { if (key.getCode().equals(KeyCode.ENTER) && answerField.isEditable() == true) { answerIsCorrect = checkAnswer(marks); displayFeedback(); } } }); box.relocate(xStart, yStart); box.getChildren().addAll(answerField, checkAnswerButton, feedbackLabel); group.getChildren().add(box); }

Target:
public AnswerBox(double nXStart, double nYStart, int nCharacterLimit, boolean nRetry, String nCorrectAnswers, int nMarks, boolean nIsNumerical, Group nGroup) { this.marks = nMarks; this.correctAnswers = nCorrectAnswers; this.characterLimit = nCharacterLimit; this.xStart = nXStart; this.yStart = nYStart; this.group = nGroup; this.retry = nRetry; this.isNumerical = nIsNumerical; answerField = new TextField(); checkAnswerButton = new Button("Check answer"); checkAnswerButton.setId("check answer"); checkAnswerButton.setOnAction(new ButtonEventHandler()); feedbackLabel = new Label(); box = new HBox(); createAnswerBox(characterLimit, nRetry); answerField.setOnKeyPressed(new KeyEventHandler()); box.relocate(xStart, yStart); box.getChildren().addAll(answerField, checkAnswerButton, feedbackLabel); group.getChildren().add(box); }
Source:
public String forIngestFromFile(String tableNameWithType, String batchConfigMapStr) throws UnsupportedEncodingException { return String.format("%s?tableName=%s&batchConfigMapStr=%s", StringUtil.join("/", _baseUrl, "ingestFromFile"), tableNameWithType, URLEncoder.encode(batchConfigMapStr, StandardCharsets.UTF_8.toString())); }

Target:
public String forIngestFromFile(String tableNameWithType, String batchConfigMapStr) throws UnsupportedEncodingException { return String.format("%s?tableNameWithType=%s&batchConfigMapStr=%s", StringUtil.join("/", _baseUrl, "ingestFromFile"), tableNameWithType, URLEncoder.encode(batchConfigMapStr, StandardCharsets.UTF_8.toString())); }
Source:
public void setDisableAcl(boolean disableAcl) { this.disableAcl = disableAcl; }

Target:
void setDisableAcl(boolean disableAcl) { this.disableAcl = disableAcl; }
Source:
private void validateThenCreateAccount() { clearErrors(); ValidateResult result = validateInput(getText(usernameInput), getText(passwordInput), getText(passwordRepeatInput), getText(emailInput)); switch (result) { case INVALID_USERNAME: usernameInput.requestFocus(); usernameInput.setError(getString(R.string.create_account_username_error)); return; case INVALID_PASSWORD: passwordInput.requestFocus(); passwordInput.setError(getString(R.string.create_account_password_error)); return; case PASSWORD_MISMATCH: passwordRepeatInput.requestFocus(); passwordRepeatInput.setError(getString(R.string.create_account_passwords_mismatch_error)); return; case INVALID_EMAIL: emailInput.requestFocus(); emailInput.setError(getString(R.string.create_account_email_error)); return; case NO_EMAIL: new AlertDialog.Builder(this) .setCancelable(false) .setTitle(R.string.email_recommendation_dialog_title) .setMessage(StringUtil.fromHtml(getResources().getString(R.string.email_recommendation_dialog_message))) .setPositiveButton(R.string.email_recommendation_dialog_create_without_email_action, (dialogInterface, i) -> { dialogInterface.dismiss(); createAccount(); }) .setNegativeButton(R.string.email_recommendation_dialog_create_with_email_action, (dialogInterface, i) -> { dialogInterface.dismiss(); emailInput.requestFocus(); }) .setOnDismissListener(DialogInterface::dismiss) .show(); break; case SUCCESS: createAccount(); default: break; } }

Target:
private void validateThenCreateAccount() { clearErrors(); ValidateResult result = validateInput(getText(usernameInput), getText(passwordInput), getText(passwordRepeatInput), getText(emailInput)); switch (result) { case INVALID_USERNAME: usernameInput.requestFocus(); usernameInput.setError(getString(R.string.create_account_username_error)); return; case INVALID_PASSWORD: passwordInput.requestFocus(); passwordInput.setError(getString(R.string.create_account_password_error)); return; case PASSWORD_MISMATCH: passwordRepeatInput.requestFocus(); passwordRepeatInput.setError(getString(R.string.create_account_passwords_mismatch_error)); return; case INVALID_EMAIL: emailInput.requestFocus(); emailInput.setError(getString(R.string.create_account_email_error)); return; case NO_EMAIL: new AlertDialog.Builder(this) .setCancelable(false) .setTitle(R.string.email_recommendation_dialog_title) .setMessage(StringUtil.fromHtml(getResources().getString(R.string.email_recommendation_dialog_message))) .setPositiveButton(R.string.email_recommendation_dialog_create_without_email_action, (dialogInterface, i) -> { dialogInterface.dismiss(); createAccount(); }) .setNegativeButton(R.string.email_recommendation_dialog_create_with_email_action, (dialogInterface, i) -> { dialogInterface.dismiss(); emailInput.requestFocus(); }) .show(); break; case SUCCESS: createAccount(); default: break; } }
Source:
public boolean performAction() { saveDialogSettings(); String key = keyText.getText(); if (key != null && key.trim().length() > 0) { key = key.trim(); boolean openSuccessful = TasksUiInternal.openTaskWithIdOrKey(repository, key, null); if (!openSuccessful) { MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), Messages.TaskSearchPage_Task_Search, Messages.TaskSearchPage_No_task_found_matching_key_ + key); } return openSuccessful; } else { ITaskSearchPage page = (ITaskSearchPage) queryPages[currentPageIndex].getData(PAGE_KEY); return page.performSearch(); } }

Target:
public boolean performAction() { saveDialogSettings(); String key = keyText.getText(); if (key != null && key.trim().length() > 0) { key = key.trim(); boolean openSuccessful = TasksUiInternal.openTaskByIdOrKey(repository, key, null); if (!openSuccessful) { MessageDialog.openInformation(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), Messages.TaskSearchPage_Task_Search, Messages.TaskSearchPage_No_task_found_matching_key_ + key); } return openSuccessful; } else { ITaskSearchPage page = (ITaskSearchPage) queryPages[currentPageIndex].getData(PAGE_KEY); return page.performSearch(); } }
Source:
private PaginatedArrayList<Host> convertToHostPaginatedArrayList(PaginatedArrayList<Contentlet> list) { List<Host> temp = new ArrayList<Host>(); for(Contentlet c : list) { temp.add(new Host(c)); } PaginatedArrayList<Host> hosts = new PaginatedArrayList<Host>(); hosts.addAll(temp); hosts.setQuery(list.getQuery()); hosts.setTotalResults(list.getTotalResults()); return hosts; }

Target:
private PaginatedArrayList<Host> convertToHostPaginatedArrayList(PaginatedArrayList<Contentlet> list) { PaginatedArrayList<Host> hosts = new PaginatedArrayList<Host>(); hosts.addAll(list.stream().map( content -> new Host(content)).collect(Collectors.toList())); hosts.setQuery(list.getQuery()); hosts.setTotalResults(list.getTotalResults()); return hosts; }
Source:
public void extractTraces(File root) throws IOException { if (root == null || root.getParentFile() == null) { throw new OseeArgumentException(String.format("The path [%s] is invalid.", root)); } checkDirectory(root); if (root.isFile()) { for (String path : Lib.readListFromFile(root, true)) { traceFile(new File(path)); } } else if (root.isDirectory()) { traceFile(root); } else { throw new OseeArgumentException(String.format("Invalid directory path [%s]", root.getCanonicalPath())); } fileToTraceMarks = Multimaps.invertFrom(traceMarkToFiles, HashMultimap.<String, String> create()); }

Target:
public void extractTraces(File root) throws IOException { if (root == null || root.getParentFile() == null) { throw new OseeArgumentException("The path [%s] is invalid.", root); } checkDirectory(root); if (root.isFile()) { for (String path : Lib.readListFromFile(root, true)) { traceFile(new File(path)); } } else if (root.isDirectory()) { traceFile(root); } else { throw new OseeArgumentException("Invalid directory path [%s]", root.getCanonicalPath()); } fileToTraceMarks = Multimaps.invertFrom(traceMarkToFiles, HashMultimap.<String, String> create()); }
Source:
private boolean readCache(Queue<CircularElement<E>> cache) throws IOException { CircularElement<E> element; while (isRunning()) { try { element = this.dispatcher.take(SortStage.SPILL); } catch (InterruptedException e) { throw wrapWithIOException(e); } if (element == SPILLING_MARKER) { return false; } else if (element == EOF_MARKER) { return true; } cache.add(element); } return false; }

Target:
private boolean readCache(Queue<CircularElement<E>> cache) throws InterruptedException { while (isRunning()) { final CircularElement<E> element = this.dispatcher.take(SortStage.SPILL); if (element == SPILLING_MARKER) { return false; } else if (element == EOF_MARKER) { return true; } cache.add(element); } return false; }
Source:
private void addNetworkInterfaceCard() { List<IpConfiguration> ipConfigurations = new ArrayList<IpConfiguration>(); String ipConfigurationName = name + "ipconfig"; variables.put("ipConfigurationName", ipConfigurationName); IpConfiguration ipConfig = IpConfiguration.create(ipConfigurationName, null, null, null, IpConfigurationProperties.builder() .privateIPAllocationMethod("Dynamic") .publicIPAddress(IdReference.create("[variables('publicIPAddressReference')]")) .subnet(IdReference.create("[variables('subnetReference')]")) .build()); ipConfigurations.add(ipConfig); NetworkInterfaceCardProperties networkInterfaceCardProperties = NetworkInterfaceCardProperties.builder() .ipConfigurations(ipConfigurations) .build(); String networkInterfaceCardName = name + "nic"; variables.put("networkInterfaceCardName", networkInterfaceCardName); variables.put("networkInterfaceCardReference", "[resourceId('Microsoft.Network/networkInterfaces',variables('networkInterfaceCardName'))]"); ResourceDefinition networkInterfaceCard = ResourceDefinition.builder() .name("[variables('networkInterfaceCardName')]") .type("Microsoft.Network/networkInterfaces") .location(location) .apiVersion("2015-06-15") .dependsOn(Arrays.asList("[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]", "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]")) .properties(networkInterfaceCardProperties) .build(); resources.add(networkInterfaceCard); }

Target:
private void addNetworkInterfaceCard() { List<IpConfiguration> ipConfigurations = new ArrayList<IpConfiguration>(); String ipConfigurationName = name + "ipconfig"; variables.put("ipConfigurationName", ipConfigurationName); IpConfiguration ipConfig = IpConfiguration.create(ipConfigurationName, null, null, null, IpConfigurationProperties.builder() .privateIPAllocationMethod("Dynamic") .publicIPAddress(IdReference.create("[variables('publicIPAddressReference')]")) .subnet(IdReference.create("[variables('subnetReference')]")) .build()); ipConfigurations.add(ipConfig); NetworkInterfaceCardProperties networkInterfaceCardProperties = NetworkInterfaceCardProperties.builder() .ipConfigurations(ipConfigurations) .build(); String networkInterfaceCardName = name + "nic"; variables.put("networkInterfaceCardName", networkInterfaceCardName); variables.put("networkInterfaceCardReference", "[resourceId('Microsoft.Network/networkInterfaces',variables('networkInterfaceCardName'))]"); ResourceDefinition networkInterfaceCard = ResourceDefinition.builder() .name("[variables('networkInterfaceCardName')]") .type("Microsoft.Network/networkInterfaces") .location(location) .apiVersion(STORAGE_API_VERSION) .dependsOn(Arrays.asList("[concat('Microsoft.Network/publicIPAddresses/', variables('publicIPAddressName'))]", "[concat('Microsoft.Network/virtualNetworks/', variables('virtualNetworkName'))]")) .properties(networkInterfaceCardProperties) .build(); resources.add(networkInterfaceCard); }
Source:
protected void stopBackgroundDiscovery() { if (usbSerialDiscovery != null) { usbSerialDiscovery.stopBackgroundScanning(); } else { logger.info("Could not stop background discovery, as there is no usb serial discovery service configured."); } }

Target:
protected void stopBackgroundDiscovery() { if (usbSerialDiscovery != null) { usbSerialDiscovery.stopBackgroundScanning(); } else { logger.info("Could not stop background discovery, as there is no USB-Serial discovery service configured."); } }
Source:
private boolean architecturesMatch() { return getCluster().getArchitecture() != ArchitectureType.undefined && getCluster().getArchitecture() == getMaxServerCpu().getArchitecture(); }

Target:
private boolean architecturesMatch() { return getCluster().getArchitecture() == ArchitectureType.undefined || getCluster().getArchitecture() == getMaxServerCpu().getArchitecture(); }