auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void verifyConnector(ClassTree classTree, IdentifierTree connectorAnnotation) { for (AnnotationTree annotationTree : Iterables.filter(classTree.modifiers().annotations(), ClassParserUtils.ANNOTATION_TREE_PREDICATE)) { if (ClassParserUtils.is(annotationTree, "org.mule.api.annotations.Connector")) { for(ExpressionTree expression : annotationTree.arguments()){ if(expression.kind().name().equals("ASSIGNMENT")){ if(((IdentifierTreeImpl) ((AssignmentExpressionTreeImpl) expression).variable()).name().equals("minMuleVersion")){ return; } } } logAndRaiseIssue(annotationTree, "The connector should specify a minMuleVersion"); return; } } }

Target:
protected void verifyConnector(ClassTree classTree, IdentifierTree connectorAnnotation) { for (AnnotationTree annotationTree : filter(classTree.modifiers().annotations(), ANNOTATION_TREE_PREDICATE)) { if (is(annotationTree, "org.mule.api.annotations.Connector")) { if(isEmpty(annotationTree.arguments()) || isEmpty(filter(annotationTree.arguments(), new Predicate<ExpressionTree>() { @Override public boolean apply(@Nullable ExpressionTree expression) { return expression.kind().name().equals("ASSIGNMENT") && ((IdentifierTreeImpl) ((AssignmentExpressionTreeImpl) expression).variable()).name().equals("minMuleVersion") && hasValidFormat(replace((((LiteralTreeImpl) ((AssignmentExpressionTreeImpl) expression).expression()).token().text()), "\"", "")); } }))) { logAndRaiseIssue(annotationTree, "@Connector should declare a 'minMuleVersion'."); } } } }
Source:
private void tick(ItemStack stack, EntityPlayer player) { if (ItemHelper.getOrCreateCompound(stack).getInteger(TAG_MODE) > 1) { WorldHelper.repelEntitiesInAABBFromPoint(player.getEntityWorld(), player.getEntityBoundingBox().grow(5), player.posX, player.posY, player.posZ, true); } if (player.getEntityWorld().isRemote) { return; } EntityPlayerMP playerMP = (EntityPlayerMP) player; if (getEmc(stack) == 0 && !consumeFuel(player, stack, 64, false)) { if (stack.getTagCompound().getInteger(TAG_MODE) > 0) { changeMode(stack, 0); } if (playerMP.capabilities.allowFlying) { playerMP.getCapability(InternalAbilities.CAPABILITY, null).disableSwrgFlightOverride(); } return; } if (!playerMP.capabilities.allowFlying) { playerMP.getCapability(InternalAbilities.CAPABILITY, null).enableSwrgFlightOverride(); } if (playerMP.capabilities.isFlying) { if (!isFlyingEnabled(stack)) { changeMode(stack, stack.getTagCompound().getInteger(TAG_MODE) == 0 ? 1 : 3); } } else { if (isFlyingEnabled(stack)) { changeMode(stack, stack.getTagCompound().getInteger(TAG_MODE) == 1 ? 0 : 2); } } float toRemove = 0; if (playerMP.capabilities.isFlying) { toRemove = 0.32F; } if (stack.getTagCompound().getInteger(TAG_MODE) == 2) { toRemove = 0.32F; } else if (stack.getTagCompound().getInteger(TAG_MODE) == 3) { toRemove = 0.64F; } unprocessedEMC += toRemove; if (unprocessedEMC > 1) { removeEmc(stack, 1); unprocessedEMC--; } playerMP.fallDistance = 0; }

Target:
private void tick(ItemStack stack, EntityPlayer player) { if (ItemHelper.getOrCreateCompound(stack).getInteger(TAG_MODE) > 1) { WorldHelper.repelEntitiesInAABBFromPoint(player.getEntityWorld(), player.getEntityBoundingBox().grow(5), player.posX, player.posY, player.posZ, true); } if (player.getEntityWorld().isRemote) { return; } EntityPlayerMP playerMP = (EntityPlayerMP) player; if (getEmc(stack) == 0 && !consumeFuel(player, stack, 64, false)) { if (stack.getTagCompound().getInteger(TAG_MODE) > 0) { changeMode(stack, 0); } if (playerMP.capabilities.allowFlying) { playerMP.getCapability(InternalAbilities.CAPABILITY, null).disableSwrgFlightOverride(); } return; } if (!playerMP.capabilities.allowFlying) { playerMP.getCapability(InternalAbilities.CAPABILITY, null).enableSwrgFlightOverride(); } if (playerMP.capabilities.isFlying) { if (!isFlyingEnabled(stack)) { changeMode(stack, stack.getTagCompound().getInteger(TAG_MODE) == 0 ? 1 : 3); } } else { if (isFlyingEnabled(stack)) { changeMode(stack, stack.getTagCompound().getInteger(TAG_MODE) == 1 ? 0 : 2); } } float toRemove = 0; if (playerMP.capabilities.isFlying) { toRemove = 0.32F; } if (stack.getTagCompound().getInteger(TAG_MODE) == 2) { toRemove = 0.32F; } else if (stack.getTagCompound().getInteger(TAG_MODE) == 3) { toRemove = 0.64F; } removeEmc(stack, EMCHelper.removeFractionalEMC(stack, toRemove)); playerMP.fallDistance = 0; }
Source:
public String getParameterTypeName() { return parameterTypeSignature.toString(); }

Target:
public String getParameterTypeName() { return typeInfo.getTypeSignature().toString(); }
Source:
@Override public String toString() { return "JsonAdapter(" + elementClass.getSimpleName() + ").array()"; }

Target:
@Override public String toString() { return elementAdapter + ".array()"; }
Source:
public static boolean canUse( final boolean isRoot, final CommandDispatcher<CommandSource> dispatcher, final CommandNode<CommandSource> node, final CommandSource source ) { final Supplier<String> supplier; if (SpongeNodePermissionCache.PERMISSION_MAP.containsKey(node)) { supplier = SpongeNodePermissionCache.PERMISSION_MAP.get(node); } else { supplier = new CachingStringSupplier(() -> SpongeNodePermissionCache.createFromNode(dispatcher, node)); } try { ((CommandSourceBridge) source).bridge$setPotentialPermissionNode(supplier); final boolean result = node.canUse(source); if (isRoot && node instanceof SpongePermissionWrappedLiteralCommandNode && ((CommandSourceBridge) source).bridge$getICommandSource() instanceof ServerPlayer) { SpongePermissions.registerPermission(supplier.get(), 0); } return result; } finally { ((CommandSourceBridge) source).bridge$setPotentialPermissionNode(null); } }

Target:
public static boolean canUse( final boolean isRoot, final CommandDispatcher<CommandSource> dispatcher, final CommandNode<CommandSource> node, final CommandSource source ) { Supplier<String> supplier = SpongeNodePermissionCache.PERMISSION_MAP.get(node); if (supplier == null) { supplier = new CachingStringSupplier(() -> SpongeNodePermissionCache.createFromNode(dispatcher, node)); } try { ((CommandSourceBridge) source).bridge$setPotentialPermissionNode(supplier); final boolean result = node.canUse(source); if (isRoot && node instanceof SpongePermissionWrappedLiteralCommandNode && ((CommandSourceBridge) source).bridge$getICommandSource() instanceof ServerPlayer) { SpongePermissions.registerPermission(supplier.get(), 0); } return result; } finally { ((CommandSourceBridge) source).bridge$setPotentialPermissionNode(null); } }
Source:
public void testToEntity() { AccountAttributes account = createValidAccountAttributesObject(); Account expectedAccount = new Account(account.googleId, account.name, account.isInstructor, account.email, account.institute, StudentProfileAttributes.builder(account.googleId).build().toEntity()); new ProfilesDb().saveEntity(account.studentProfile.toEntity()); Account actualAccount = new AccountAttributes(expectedAccount).toEntity(); assertEquals(expectedAccount.getGoogleId(), actualAccount.getGoogleId()); assertEquals(expectedAccount.getName(), actualAccount.getName()); assertEquals(expectedAccount.getEmail(), actualAccount.getEmail()); assertEquals(expectedAccount.getInstitute(), actualAccount.getInstitute()); assertEquals(expectedAccount.isInstructor(), actualAccount.isInstructor()); String expectedProfile = StudentProfileAttributes.valueOf(expectedAccount.getStudentProfile()).toString(); String actualProfile = StudentProfileAttributes.valueOf(actualAccount.getStudentProfile()).toString(); assertEquals(expectedProfile, actualProfile); }

Target:
public void testToEntity() { AccountAttributes account = createValidAccountAttributesObject(); Account expectedAccount = new Account(account.googleId, account.name, account.isInstructor, account.email, account.institute, account.studentProfile.toEntity()); Account actualAccount = account.toEntity(); assertEquals(expectedAccount.getGoogleId(), actualAccount.getGoogleId()); assertEquals(expectedAccount.getName(), actualAccount.getName()); assertEquals(expectedAccount.getEmail(), actualAccount.getEmail()); assertEquals(expectedAccount.getInstitute(), actualAccount.getInstitute()); assertEquals(expectedAccount.isInstructor(), actualAccount.isInstructor()); ProfilesDb profilesDb = new ProfilesDb(); profilesDb.saveEntity(account.studentProfile.toEntity()); String expectedProfile = StudentProfileAttributes.valueOf(expectedAccount.getStudentProfile()).toString(); String actualProfile = StudentProfileAttributes.valueOf(actualAccount.getStudentProfile()).toString(); assertEquals(expectedProfile, actualProfile); profilesDb.deleteEntity(account.studentProfile); }
Source:
public int hashCode() { int hashcode = (subjectIsConstant ? 1 : 0) + type.hashCode() + subjectVar.hashCode() + subjectConstant.hashCode(); for(final StatementPattern sp : getPatterns()) { hashcode += sp.hashCode(); } return hashcode; }

Target:
public int hashCode() { return Objects.hash(subjectIsConstant, type, subjectVar, subjectConstant, getPatterns()); }
Source:
public void fromPreviousCustomSetup() { assumeFalse(Functions.isWindows()); final String newBuildsDirValueBySysprop = "/tmp/${ITEM_ROOTDIR}/bluh"; story.then(j -> { assertEquals("${ITEM_ROOTDIR}/ze-previous-custom-builds", j.jenkins.getRawBuildsDir()); setBuildsDirProperty(newBuildsDirValueBySysprop); }); story.then(j -> { assertEquals(newBuildsDirValueBySysprop, j.jenkins.getRawBuildsDir()); assertThat(FileUtils.readFileToString(new File(j.jenkins.getRootDir(), "config.xml")), containsString("<buildsDir>" + newBuildsDirValueBySysprop + "</buildsDir>")); String rootDirBeforeRestart = j.jenkins.getRootDir().toString(); clearSystemProperties(); j.jenkins.restart(); int maxLoops = 50; while (j.jenkins.getInitLevel() != InitMilestone.COMPLETED && maxLoops-- > 0) { Thread.sleep(300); } assertEquals(rootDirBeforeRestart, j.jenkins.getRootDir().toString()); assertThat(FileUtils.readFileToString(new File(j.jenkins.getRootDir(), "config.xml")), containsString("<buildsDir>" + newBuildsDirValueBySysprop + "</buildsDir>")); assertEquals(newBuildsDirValueBySysprop, j.jenkins.getRawBuildsDir()); END HACK ** }); }

Target:
public void fromPreviousCustomSetup() { assumeFalse("Default Windows lifecycle does not support restart.", Functions.isWindows()); final String newBuildsDirValueBySysprop = "/tmp/${ITEM_ROOTDIR}/bluh"; story.then(j -> { assertEquals("${ITEM_ROOTDIR}/ze-previous-custom-builds", j.jenkins.getRawBuildsDir()); setBuildsDirProperty(newBuildsDirValueBySysprop); }); story.then(j -> { assertEquals(newBuildsDirValueBySysprop, j.jenkins.getRawBuildsDir()); assertThat(FileUtils.readFileToString(new File(j.jenkins.getRootDir(), "config.xml")), containsString("<buildsDir>" + newBuildsDirValueBySysprop + "</buildsDir>")); String rootDirBeforeRestart = j.jenkins.getRootDir().toString(); clearSystemProperties(); j.jenkins.restart(); int maxLoops = 50; while (j.jenkins.getInitLevel() != InitMilestone.COMPLETED && maxLoops-- > 0) { Thread.sleep(300); } assertEquals(rootDirBeforeRestart, j.jenkins.getRootDir().toString()); assertThat(FileUtils.readFileToString(new File(j.jenkins.getRootDir(), "config.xml")), containsString("<buildsDir>" + newBuildsDirValueBySysprop + "</buildsDir>")); assertEquals(newBuildsDirValueBySysprop, j.jenkins.getRawBuildsDir()); END HACK ** }); }
Source:
DeclaredTypeNode getNNode(@Nonnull NodeLevel minimumLevel) throws LibraryFormatException, LibraryIOException { DeclaredTypeNode type = nnode.get(); if (type == null || !type.getLevel().keep(minimumLevel)) { InputStream in = null; try { in = new BufferedInputStream(source.getInputStream()); NodeLevel loadLevel = getLevelForLoading(minimumLevel); type = JayceReaderFactory.get(inputJackLibrary, in).readType(loadLevel); nnode = new SoftReference<DeclaredTypeNode>(type); } catch (WrongPermissionException e) { throw new LibraryIOException(inputJackLibrary.getLocation(), e); } catch (IOException e) { throw new LibraryIOException(inputJackLibrary.getLocation(), e); } catch (JayceFormatException e) { logger.log(Level.SEVERE, "Library " + inputJackLibrary.getLocation().getDescription() + " is invalid", e); throw new LibraryFormatException(inputJackLibrary.getLocation()); } finally { try { if (in != null) { in.close(); } } catch (IOException e) { logger.log(Level.WARNING, "Failed to close input stream on " + source.getLocation().getDescription(), e); } } tracer.getStatistic(NNODE_RELOAD).add(loadCount > 0); loadCount++; } return type; }

Target:
DeclaredTypeNode getNNode(@Nonnull NodeLevel minimumLevel) throws LibraryFormatException, LibraryIOException { DeclaredTypeNode type = nnode.get(); if (type == null || !type.getLevel().keep(minimumLevel)) { InputStream in = null; try { in = new BufferedInputStream(source.getInputStream()); NodeLevel loadLevel = getLevelForLoading(minimumLevel); type = JayceReaderFactory.get(inputJackLibrary, in).readType(loadLevel); nnode = new SoftReference<DeclaredTypeNode>(type); } catch (IOException | WrongPermissionException e) { throw new LibraryIOException(inputJackLibrary.getLocation(), e); } catch (JayceFormatException e) { logger.log(Level.SEVERE, "Library " + inputJackLibrary.getLocation().getDescription() + " is invalid", e); throw new LibraryFormatException(inputJackLibrary.getLocation()); } finally { try { if (in != null) { in.close(); } } catch (IOException e) { logger.log(Level.WARNING, "Failed to close input stream on " + source.getLocation().getDescription(), e); } } tracer.getStatistic(NNODE_RELOAD).add(loadCount > 0); loadCount++; } return type; }
Source:
void calculate(final MethodCoverageImpl coverage) { int firstLine = ISourceFileCoverage.UNKNOWN_LINE; int lastLine = ISourceFileCoverage.UNKNOWN_LINE; for (final Map.Entry<AbstractInsnNode, Instruction> entry : instructions .entrySet()) { final Instruction i = entry.getValue(); final AbstractInsnNode n = entry.getKey(); final AbstractInsnNode r = findRepresentative(n); if (r != n) { ignored.add(n); instructions.put(r, instructions.get(r).merge(i)); } if (!ignored.contains(n)) { final int line = i.getLine(); if (line != ISourceNode.UNKNOWN_LINE) { if (firstLine > line || lastLine == ISourceNode.UNKNOWN_LINE) { firstLine = line; } if (lastLine < line) { lastLine = line; } } } } coverage.ensureCapacity(firstLine, lastLine); for (final Map.Entry<AbstractInsnNode, Instruction> i : instructions .entrySet()) { if (ignored.contains(i.getKey())) { continue; } Instruction insn = i.getValue(); final Set<AbstractInsnNode> r = replacements.get(i.getKey()); if (r != null) { final List<Instruction> newBranches = new ArrayList<Instruction>( r.size()); for (final AbstractInsnNode b : r) { newBranches.add(instructions.get(b)); } insn = insn.replaceBranches(newBranches); } coverage.increment(insn.getInstructionCounter(), insn.getBranchCounter(), insn.getLine()); } coverage.incrementMethodCounter(); }

Target:
void calculate(final MethodCoverageImpl coverage) { applyMerges(); applyReplacements(); ensureCapacity(coverage); for (final Entry<AbstractInsnNode, Instruction> entry : instructions .entrySet()) { if (!ignored.contains(entry.getKey())) { final Instruction instruction = entry.getValue(); coverage.increment(instruction.getInstructionCounter(), instruction.getBranchCounter(), instruction.getLine()); } } coverage.incrementMethodCounter(); }
Source:
private boolean uploadDependencyToBlobStore(String key, File dependency) throws KeyAlreadyExistsException, AuthorizationException, IOException { boolean uploadNew = false; try { getBlobStore().getBlobMeta(key); } catch (KeyNotFoundException e) { List<AccessControl> acls = new ArrayList<>(); acls.add(new AccessControl(AccessControlType.USER, BlobStoreAclHandler.READ | BlobStoreAclHandler.WRITE | BlobStoreAclHandler.ADMIN)); acls.add(new AccessControl(AccessControlType.OTHER, BlobStoreAclHandler.READ)); AtomicOutputStream blob = null; try { blob = getBlobStore().createBlob(key, new SettableBlobMeta(acls)); Files.copy(dependency.toPath(), blob); blob.close(); uploadNew = true; } finally { try { if (blob != null) { blob.cancel(); } } catch (IOException throwaway) { } } } return uploadNew; }

Target:
private boolean uploadDependencyToBlobStore(String key, File dependency) throws KeyAlreadyExistsException, AuthorizationException, IOException { boolean uploadNew = false; try { getBlobStore().getBlobMeta(key); } catch (KeyNotFoundException e) { List<AccessControl> acls = new ArrayList<>(); acls.add(new AccessControl(AccessControlType.USER, BlobStoreAclHandler.READ | BlobStoreAclHandler.WRITE | BlobStoreAclHandler.ADMIN)); acls.add(new AccessControl(AccessControlType.OTHER, BlobStoreAclHandler.READ)); AtomicOutputStream blob = null; try { blob = getBlobStore().createBlob(key, new SettableBlobMeta(acls)); Files.copy(dependency.toPath(), blob); blob.close(); blob = null; uploadNew = true; } finally { try { if (blob != null) { blob.cancel(); } } catch (IOException throwaway) { } } } return uploadNew; }
Source:
GreetInfo( String m, String c, String h) { country = c; message = m; href = h; }

Target:
GreetInfo(String m, String c, String h) { message = m; country = c; href = h; }
Source:
public boolean uploadIfNotExists(BlobId blobId, long inputLength, CloudBlobMetadata cloudBlobMetadata, InputStream blobInputStream) throws BlobStorageException, IOException { BlobRequestConditions blobRequestConditions = new BlobRequestConditions().setIfNoneMatch("*"); azureMetrics.blobUploadRequestCount.inc(); Timer.Context storageTimer = azureMetrics.blobUploadTime.time(); try { BlockBlobClient blobClient = getAzureBlobReference(blobId, true); cloudBlobMetadata.setCloudBlobName(getAzureBlobName(blobId)); Map<String, String> metadata = getMetadataMap(cloudBlobMetadata); Response<BlockBlobItem> response = blobClient.uploadWithResponse(blobInputStream, inputLength, null, metadata, null, null, blobRequestConditions, null, Context.NONE); logger.debug("Uploaded blob to ABS", blobId); azureMetrics.blobUploadSuccessCount.inc(); return true; } catch (UncheckedIOException e) { throw e.getCause(); } catch (BlobStorageException e) { if (e.getErrorCode() == BlobErrorCode.BLOB_ALREADY_EXISTS) { logger.debug("Skipped upload of existing blob {}", blobId); azureMetrics.blobUploadConflictCount.inc(); return false; } else { throw e; } } finally { storageTimer.stop(); } }

Target:
public boolean uploadIfNotExists(BlobId blobId, long inputLength, CloudBlobMetadata cloudBlobMetadata, InputStream blobInputStream) throws BlobStorageException, IOException { BlobRequestConditions blobRequestConditions = new BlobRequestConditions().setIfNoneMatch("*"); azureMetrics.blobUploadRequestCount.inc(); Timer.Context storageTimer = azureMetrics.blobUploadTime.time(); try { BlockBlobClient blobClient = getAzureBlobReference(blobId, true); cloudBlobMetadata.setCloudBlobName(getAzureBlobName(blobId)); Map<String, String> metadata = getMetadataMap(cloudBlobMetadata); blobClient.uploadWithResponse(blobInputStream, inputLength, null, metadata, null, null, blobRequestConditions, null, Context.NONE); logger.debug("Uploaded blob to ABS", blobId); azureMetrics.blobUploadSuccessCount.inc(); return true; } catch (UncheckedIOException e) { throw e.getCause(); } catch (BlobStorageException e) { if (e.getErrorCode() == BlobErrorCode.BLOB_ALREADY_EXISTS) { logger.debug("Skipped upload of existing blob {}", blobId); azureMetrics.blobUploadConflictCount.inc(); return false; } else { throw e; } } finally { storageTimer.stop(); } }
Source:
protected boolean canDoAction() { final ClusterValidator validator = new ClusterValidator(getDbFacade(), getVdsGroup()); if (!validateClusterPolicy()) { return false; } return validate(validator.nameNotUsed()) && validate(validator.cpuTypeSupportsVirtService()) && validate(validator.versionSupported()) && validate(validator.dataCenterVersionMismatch()) && validate(validator.dataCenterExists()) && validate(validator.localStoragePoolAttachedToSingleCluster()) && validate(validator.qosBaloonSupported()) && validate(validator.glusterServiceSupported()) && validate(validator.clusterServiceDefined()) && validate(validator.mixedClusterServicesSupported()) && validate(validator.attestationServerConfigured()) && validate(validator.migrationSupported(getArchitecture())) && validate(validator.virtIoRngSupported()); }

Target:
protected boolean canDoAction() { if (!validateClusterPolicy()) { return false; } final ClusterValidator validator = new ClusterValidator(getDbFacade(), getVdsGroup()); return validate(validator.nameNotUsed()) && validate(validator.cpuTypeSupportsVirtService()) && validate(validator.versionSupported()) && validate(validator.dataCenterVersionMismatch()) && validate(validator.dataCenterExists()) && validate(validator.localStoragePoolAttachedToSingleCluster()) && validate(validator.qosBaloonSupported()) && validate(validator.glusterServiceSupported()) && validate(validator.clusterServiceDefined()) && validate(validator.mixedClusterServicesSupported()) && validate(validator.attestationServerConfigured()) && validate(validator.migrationSupported(getArchitecture())) && validate(validator.virtIoRngSupported()); }
Source:
public Object run() { RequestContext context = RequestContext.getCurrentContext(); HttpServletRequest request = context.getRequest(); if(context.get("warning") != null){ System.out.printf("should not stop here"); } MultiValueMap<String, String> headers = this.helper .buildZuulRequestHeaders(request); MultiValueMap<String, String> params = this.helper .buildZuulRequestQueryParams(request); String verb = getVerb(request); InputStream requestEntity = getRequestBody(request); if (request.getContentLength() < 0) { context.setChunkedRequestBody(); } String uri = this.helper.buildZuulRequestURI(request); this.helper.addIgnoredHeaders(); try { HttpResponse response = forward(this.httpClient, verb, uri, request, headers, params, requestEntity); setResponse(response); } catch (Exception ex) { context.set("error.status_code", HttpServletResponse.SC_INTERNAL_SERVER_ERROR); context.set("error.exception", ex); } return null; }

Target:
public Object run() { RequestContext context = RequestContext.getCurrentContext(); HttpServletRequest request = context.getRequest(); if(context.get("warning") != null){ log.info("should not stop here"); } MultiValueMap<String, String> headers = this.helper .buildZuulRequestHeaders(request); MultiValueMap<String, String> params = this.helper .buildZuulRequestQueryParams(request); String verb = getVerb(request); InputStream requestEntity = getRequestBody(request); if (request.getContentLength() < 0) { context.setChunkedRequestBody(); } String uri = this.helper.buildZuulRequestURI(request); this.helper.addIgnoredHeaders(); try { HttpResponse response = forward(this.httpClient, verb, uri, request, headers, params, requestEntity); setResponse(response); } catch (Exception ex) { context.set("error.status_code", HttpServletResponse.SC_INTERNAL_SERVER_ERROR); context.set("error.exception", ex); } return null; }
Source:
public void addInput(Page page) { requireNonNull(page, "page is null"); if (page.getPositionCount() == 0) { return; } page = pagePreprocessor.apply(page); pagePartitioner.partitionPage(page); System.out.println(pagePartitioner.getRetainedSizeInBytes()); operatorContext.recordOutput(page.getSizeInBytes(), page.getPositionCount()); systemMemoryContext.setBytes(pagePartitioner.getRetainedSizeInBytes()); }

Target:
public void addInput(Page page) { requireNonNull(page, "page is null"); if (page.getPositionCount() == 0) { return; } page = pagePreprocessor.apply(page); pagePartitioner.partitionPage(page); operatorContext.recordOutput(page.getSizeInBytes(), page.getPositionCount()); systemMemoryContext.setBytes(pagePartitioner.getRetainedSizeInBytes()); }
Source:
public ResourceTable updateEntity(RequestDetails theRequest, IBaseResource theResource, IBasePersistedResource theEntity, Date theDeletedTimestampOrNull, boolean thePerformIndexing, boolean theUpdateVersion, TransactionDetails theTransactionDetails, boolean theForceUpdate, boolean theCreateNewHistoryEntry) { ResourceTable retVal = super.updateEntity(theRequest, theResource, theEntity, theDeletedTimestampOrNull, thePerformIndexing, theUpdateVersion, theTransactionDetails, theForceUpdate, theCreateNewHistoryEntry); if (!retVal.isUnchangedInCurrentOperation()) { if (retVal.getDeleted() == null) { Observation observation = (Observation) theResource; myObservationLastNIndexPersistSvc.indexObservation(observation); } else { myObservationLastNIndexPersistSvc.deleteObservationIndex(theEntity); } } return retVal; }

Target:
public ResourceTable updateEntity(RequestDetails theRequest, IBaseResource theResource, IBasePersistedResource theEntity, Date theDeletedTimestampOrNull, boolean thePerformIndexing, boolean theUpdateVersion, TransactionDetails theTransactionDetails, boolean theForceUpdate, boolean theCreateNewHistoryEntry) { return updateObservationEntity(theRequest, theResource, theEntity, theDeletedTimestampOrNull, thePerformIndexing, theUpdateVersion, theTransactionDetails, theForceUpdate, theCreateNewHistoryEntry); }
Source:
private void writeStreamToFile(ByteArrayOutputStream bos, String filename, byte[] key) throws IOException { DataOutputStream fileOutputStream = null; try { fileOutputStream = getOutputFileStream(filename, key); bos.writeTo(fileOutputStream); } finally { if (fileOutputStream != null) { fileOutputStream.close(); } } }

Target:
private void writeStreamToFile(ByteArrayOutputStream bos, String filename, byte[] key) throws IOException { DataOutputStream fileOutputStream = null; try { fileOutputStream = getOutputFileStream(filename, key); bos.writeTo(fileOutputStream); } finally { if (fileOutputStream != null) { try { fileOutputStream.close(); } catch (IOException e) { e.printStackTrace(); } } } }
Source:
private void applyModeCustomizations() { if (ApplicationModeHelper.getUiMode() == ApplicationMode.GlusterOnly) { optimizationTab.setVisible(false); resiliencePolicyTab.setVisible(false); clusterPolicyTab.setVisible(true); dataCenterPanel.addStyleName(style.generalTabTopDecoratorEmpty()); } }

Target:
private void applyModeCustomizations() { if (ApplicationModeHelper.getUiMode() == ApplicationMode.GlusterOnly) { optimizationTab.setVisible(false); resiliencePolicyTab.setVisible(false); clusterPolicyTab.setVisible(false); dataCenterPanel.addStyleName(style.generalTabTopDecoratorEmpty()); } }
Source:
PRED_change_topic_1(Term a1, Operation n) { arg1 = a1; cont = n; }

Target:
public PRED_change_topic_1(Term a1, Operation n) { arg1 = a1; cont = n; }
Source:
public RetryCacheMetrics(RetryCache retryCache) { name = "RetryCache."+ retryCache.getCacheName(); registry = new MetricsRegistry(name); if (LOG.isDebugEnabled()) { LOG.debug("Initialized "+ registry); } }

Target:
RetryCacheMetrics(RetryCache retryCache) { name = "RetryCache."+ retryCache.getCacheName(); registry = new MetricsRegistry(name); if (LOG.isDebugEnabled()) { LOG.debug("Initialized "+ registry); } }
Source:
@Nullable public String getComment() { return comment; }

Target:
@NonNull public String getComment() { return StringUtils.defaultString(comment); }
Source:
public Object readChunk( ByteBufAllocator allocator ) throws Exception { assert !endOfInput; if ( pending != null ) { if ( noMoreTransactions ) { endOfInput = true; } return consumePending(); } else if ( noMoreTransactions ) { throw new IllegalStateException(); } else if ( txCursor.next() ) { assert pending == null; CommittedTransactionRepresentation tx = txCursor.get(); lastTxId = tx.getCommitEntry().getTxId(); if ( lastTxId != expectedTxId ) { throw new IllegalStateException( "Transaction cursor out of order." ); } expectedTxId++; pending = new TxPullResponse( storeId, tx ); return ResponseMessageType.TX; } else { assert pending == null; noMoreTransactions = true; protocol.expect( CatchupServerProtocol.State.MESSAGE_TYPE ); pending = new TxStreamFinishedResponse( SUCCESS_END_OF_STREAM, lastTxId ); return ResponseMessageType.TX_STREAM_FINISHED; } }

Target:
public Object readChunk( ByteBufAllocator allocator ) throws Exception { assert !endOfInput; if ( pending != null ) { if ( noMoreTransactions ) { endOfInput = true; } return consumePending(); } else if ( noMoreTransactions ) { throw new IllegalStateException(); } else if ( txCursor.next() ) { assert pending == null; CommittedTransactionRepresentation tx = txCursor.get(); lastTxId = tx.getCommitEntry().getTxId(); if ( lastTxId != expectedTxId ) { String msg = format( "Transaction cursor out of order. Expected %d but was %d", expectedTxId, lastTxId ); throw new IllegalStateException( msg ); } expectedTxId++; pending = new TxPullResponse( storeId, tx ); return ResponseMessageType.TX; } else { assert pending == null; noMoreTransactions = true; protocol.expect( CatchupServerProtocol.State.MESSAGE_TYPE ); pending = new TxStreamFinishedResponse( SUCCESS_END_OF_STREAM, lastTxId ); return ResponseMessageType.TX_STREAM_FINISHED; } }
Source:
private ValidationResult validateDuplicatesConfiguration() { try { TransactionSupport.executeInNewTransaction( (TransactionMethod<Void>) () -> { macPoolPerCluster.testCreateMacPool(getParameters().getMacPool()); return null; } ); } catch (Exception e) { if (e.getCause() instanceof EngineException) { e = (EngineException) e.getCause(); } if (e.getMessage() != null && e.getMessage().contains(UNABLE_TO_INITIALIZE_MAC_POOL_DUE_TO_EXISTING_DUPLICATES)) { return new ValidationResult(EngineMessage.ACTION_TYPE_FAILED_MAC_POOL_CONTAINS_DUPLICATES); } } return ValidationResult.VALID; }

Target:
private ValidationResult validateDuplicatesConfiguration() { return TransactionSupport.executeInNewTransaction( () -> ValidationResult.failWith(EngineMessage.ACTION_TYPE_FAILED_MAC_POOL_CONTAINS_DUPLICATES) .when(macPoolPerCluster.containsForbiddenDuplicates(getParameters().getMacPool())) ); }
Source:
protected Map<Integer, ResolvedDbType> getLobFieldsDataTypeInfo(String typeName) throws SQLException { if(this.resolvedDbTypesCache.containsKey(typeName)){ if(logger.isDebugEnabled()) { logger.info("Returning chached LobFieldsDataTypeInfo"); } return resolvedDbTypesCache.get(typeName); } if(logger.isDebugEnabled()){ logger.info("Obtaining LobFieldsDataTypeInfo"); } synchronized (this){ if(this.resolvedDbTypesCache.containsKey(typeName)){ return resolvedDbTypesCache.get(typeName); } Map<Integer, ResolvedDbType> dataTypes = new HashMap<>(); String owner = getOwnerFrom(typeName); String type = getTypeSimpleName(typeName); String query = QUERY_TYPE_ATTRS + (owner != null ? QUERY_OWNER_CONDITION : ""); try (PreparedStatement ps = this.prepareStatement(query)) { ps.setString(1, type); if (owner != null) { ps.setString(2, owner); } try (ResultSet resultSet = ps.executeQuery()) { while (resultSet.next()) { ResolvedDbType resolvedDbType = new ResolvedDbType(UNKNOWN_DATA_TYPE, resultSet.getString(ATTR_TYPE_NAME_PARAM)); dataTypes.put(resultSet.getInt(ATTR_NO_PARAM), resolvedDbType); } } resolvedDbTypesCache.put(typeName,dataTypes); return dataTypes; } } }

Target:
protected Map<Integer, ResolvedDbType> getLobFieldsDataTypeInfo(String typeName) throws SQLException { if (this.resolvedDbTypesCache.containsKey(typeName)) { if (logger.isDebugEnabled()) { logger.info("Returning chached LobFieldsDataTypeInfo"); } return resolvedDbTypesCache.get(typeName); } if (logger.isDebugEnabled()) { logger.info("Obtaining LobFieldsDataTypeInfo"); } synchronized (resolvedDbTypesCache) { if (this.resolvedDbTypesCache.containsKey(typeName)) { return resolvedDbTypesCache.get(typeName); } Map<Integer, ResolvedDbType> dataTypes = new HashMap<>(); String owner = getOwnerFrom(typeName); String type = getTypeSimpleName(typeName); String query = QUERY_TYPE_ATTRS + (owner != null ? QUERY_OWNER_CONDITION : ""); try (PreparedStatement ps = this.prepareStatement(query)) { ps.setString(1, type); if (owner != null) { ps.setString(2, owner); } try (ResultSet resultSet = ps.executeQuery()) { while (resultSet.next()) { ResolvedDbType resolvedDbType = new ResolvedDbType(UNKNOWN_DATA_TYPE, resultSet.getString(ATTR_TYPE_NAME_PARAM)); dataTypes.put(resultSet.getInt(ATTR_NO_PARAM), resolvedDbType); } } resolvedDbTypesCache.put(typeName, dataTypes); return dataTypes; } } }
Source:
public <T> UpdateResults update(final Query<T> query, final UpdateOperations<T> operations, final UpdateOptions options) { DBCollection dbColl = query.getCollection(); if (dbColl == null) { dbColl = getCollection(query.getEntityClass()); } final MappedClass mc = getMapper().getMappedClass(query.getEntityClass()); final List<MappedField> fields = mc.getFieldsAnnotatedWith(Version.class); DBObject queryObject = query.getQueryObject(); if (operations.isIsolated()) { queryObject.put("$isolated", true); } if (!fields.isEmpty()) { final MappedField versionField = fields.get(0); if (queryObject.get(versionField.getNameToStore()) == null) { operations.inc(versionField.getNameToStore(), 1); } } final BasicDBObject update = (BasicDBObject) ((UpdateOpsImpl) operations).getOps(); if (LOG.isTraceEnabled()) { LOG.trace(format("Executing update(%s) for query: %s, ops: %s, multi: %s, upsert: %s", dbColl.getName(), queryObject, update, options.isMulti(), options.isUpsert())); } return new UpdateResults(dbColl.update(queryObject, update, options.getOptions())); }

Target:
public <T> UpdateResults update(final Query<T> query, final UpdateOperations<T> operations, final UpdateOptions options) { DBCollection dbColl = query.getCollection(); if (dbColl == null) { dbColl = getCollection(query.getEntityClass()); } final MappedClass mc = getMapper().getMappedClass(query.getEntityClass()); final List<MappedField> fields = mc.getFieldsAnnotatedWith(Version.class); DBObject queryObject = query.getQueryObject(); if (operations.isIsolated()) { queryObject.put("$isolated", true); } if (!fields.isEmpty()) { operations.inc(fields.get(0).getNameToStore(), 1); } final BasicDBObject update = (BasicDBObject) ((UpdateOpsImpl) operations).getOps(); if (LOG.isTraceEnabled()) { LOG.trace(format("Executing update(%s) for query: %s, ops: %s, multi: %s, upsert: %s", dbColl.getName(), queryObject, update, options.isMulti(), options.isUpsert())); } return new UpdateResults(dbColl.update(queryObject, update, options.getOptions())); }
Source:
private Table getTableByName(String tableName) { for (Table table : this.elideTableConfig.getTables()) { if (table.getName().equals(tableName)) { return table; } else { log.warn("Table " + tableName + " is not defined in Dynamic Config."); return null; } } return null; }

Target:
private Table getTableByName(String tableName) { Table tableByName = this.elideTableConfig.getTables().stream().filter( table -> table.getName().equals(tableName)).findFirst().orElse(null); if (tableByName != null) { return tableByName; } throw new IllegalStateException("Table " + tableName + " is not defined in Dynamic Config."); }
Source:
private void initBottomSheetBehaviour() { transparentView.setAlpha(0); bottomSheet.getLayoutParams().height = getActivity().getWindowManager() .getDefaultDisplay().getHeight() / 16 * 9; bottomSheetBehavior = BottomSheetBehavior.from(bottomSheet); bottomSheetBehavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() { @Override public void onStateChanged(View bottomSheet, int newState) { prepareViewsForSheetPosition(); } @Override public void onSlide(View bottomSheet, float slideOffset) { } }); bottomSheetBehavior.setState(BottomSheetBehavior.STATE_HIDDEN); bottomSheetBehaviorForDetails = BottomSheetBehavior.from(bottomSheetDetails); bottomSheetBehaviorForDetails.setState(BottomSheetBehavior.STATE_HIDDEN); }

Target:
private void initBottomSheetBehaviour() { transparentView.setAlpha(0); bottomSheet.getLayoutParams().height = getActivity().getWindowManager() .getDefaultDisplay().getHeight() / 16 * 9; bottomSheetBehavior = BottomSheetBehavior.from(bottomSheet); bottomSheetBehavior.setBottomSheetCallback(new BottomSheetBehavior.BottomSheetCallback() { @Override public void onStateChanged(View bottomSheet, int unusedNewState) { prepareViewsForSheetPosition(); } @Override public void onSlide(View bottomSheet, float slideOffset) { } }); bottomSheetBehavior.setState(BottomSheetBehavior.STATE_HIDDEN); bottomSheetBehaviorForDetails = BottomSheetBehavior.from(bottomSheetDetails); bottomSheetBehaviorForDetails.setState(BottomSheetBehavior.STATE_HIDDEN); }
Source:
private void searchByQuery(SearchConfig searchConfig) { this.query = searchConfig.getSearchQuery() + ";latestVersion.hidden==\"false\""; this.sortConfig = searchConfig.getSortConfig(); enterLoadingState(); displayMapsFromSupplier(() -> mapService.findByQuery(query, ++currentPage, MAX_SEARCH_RESULTS, sortConfig)); }

Target:
private void searchByQuery(SearchConfig searchConfig) { this.query = searchConfig.getSearchQuery(); this.sortConfig = searchConfig.getSortConfig(); enterLoadingState(); displayMapsFromSupplier(() -> mapService.findByQuery(query, ++currentPage, MAX_SEARCH_RESULTS, sortConfig)); }
Source:
boolean isCQRoutingNeeded(CacheEvent event) { if (!isTransactionalEvent(event)) { return true; } FilterInfo localFilterInfo = getLocalFilterInfo(event); if (localFilterInfo != null) { return false; } return true; }

Target:
boolean isCQRoutingNeeded(CacheEvent event) { if (!isTransactionalEvent(event)) { return true; } FilterInfo localFilterInfo = getLocalFilterInfo(event); return localFilterInfo == null; }
Source:
public static String fullyQualifiedNameDiff(TypeRef typeRef, TypeDef originType) { Map<String, String> map = DefinitionRepository.getRepository().getReferenceMap(); String currentPackage = originType != null ? originType.getPackageName() : null; if (typeRef instanceof ClassRef) { ClassRef classRef = (ClassRef) TypeAs.combine(UNWRAP_COLLECTION_OF, UNWRAP_ARRAY_OF, UNWRAP_OPTIONAL_OF).apply(typeRef); String candidateFqn = classRef.getFullyQualifiedName().replace(classRef.getDefinition().getPackageName(), currentPackage); if (candidateFqn.equals(classRef.getFullyQualifiedName())) { return ""; } if (originType.getImports().contains(candidateFqn) && !classRef.getDefinition().getFullyQualifiedName().equals(candidateFqn)) { return captializeFirst(TypeUtils.fullyQualifiedNameDiff(candidateFqn, classRef.getFullyQualifiedName())); } String fqn = map.get(classRef.getDefinition().getName()); if (!classRef.getDefinition().getFullyQualifiedName().equals(fqn)) { return captializeFirst(TypeUtils.fullyQualifiedNameDiff(fqn, classRef.getFullyQualifiedName())); } } return ""; }

Target:
public static String fullyQualifiedNameDiff(TypeRef typeRef, TypeDef originType) { Map<String, String> map = DefinitionRepository.getRepository().getReferenceMap(); String currentPackage = originType != null ? originType.getPackageName() : null; if (typeRef instanceof ClassRef) { TypeRef unwrapped = TypeAs.combine(UNWRAP_COLLECTION_OF, UNWRAP_ARRAY_OF, UNWRAP_OPTIONAL_OF).apply(typeRef); if (unwrapped instanceof ClassRef) { ClassRef classRef = (ClassRef) unwrapped; String candidateFqn = classRef.getFullyQualifiedName().replace(classRef.getDefinition().getPackageName(), currentPackage); if (candidateFqn.equals(classRef.getFullyQualifiedName())) { return ""; } if (originType.getImports().contains(candidateFqn) && !classRef.getDefinition().getFullyQualifiedName().equals(candidateFqn)) { return captializeFirst(TypeUtils.fullyQualifiedNameDiff(candidateFqn, classRef.getFullyQualifiedName())); } String fqn = map.get(classRef.getDefinition().getName()); if (!classRef.getDefinition().getFullyQualifiedName().equals(fqn)) { return captializeFirst(TypeUtils.fullyQualifiedNameDiff(fqn, classRef.getFullyQualifiedName())); } } } return ""; }
Source:
private void showDaysOfMonth() { int row = 0; int column = 0; for (int i = 0; i < LAST_DAY_OF_MONTH_INDEX; i++) { if ((i + 1) % DAYS_IN_WEEK == 1 && i != 1) { row++; column = 0; } daysOfMonth.setWidget(row, column, new Label(Integer.toString(i + 1))); daysOfMonth.getCellFormatter().getElement(row, column).addClassName("normalFlexTableCell"); clickedList.add(i, false); column++; } Label widget = new Label(constants.lastDay()); clickedList.add(LAST_DAY_OF_MONTH_INDEX, false); daysOfMonth.setWidget(row, column, widget); daysOfMonth.getFlexCellFormatter().setColSpan(row, column, 4); wrapperPanel.add(daysOfMonth); }

Target:
private void showDaysOfMonth() { int row = 0; int column = 0; for (int i = 0; i < LAST_DAY_OF_MONTH_INDEX; i++) { if ((i + 1) % DAYS_IN_WEEK == 1 && i != 1) { row++; column = 0; } daysOfMonth.setWidget(row, column, new Label(Integer.toString(i + 1))); daysOfMonth.getCellFormatter().getElement(row, column).addClassName(style.normalFlexTableCell()); clickedList.add(i, false); column++; } Label widget = new Label(constants.lastDay()); clickedList.add(LAST_DAY_OF_MONTH_INDEX, false); daysOfMonth.setWidget(row, column, widget); daysOfMonth.getFlexCellFormatter().setColSpan(row, column, 4); wrapperPanel.add(daysOfMonth); }
Source:
public Multimap<String, Object> getMetadata() { String label = getLabel(); if (label != null && !fMetaData.containsKey(IElementResolver.LABEL_KEY)) { fMetaData.put(IElementResolver.LABEL_KEY, label); } if (!fMetaData.containsKey(TmfStrings.startTime())) { fMetaData.put(TmfStrings.startTime(), fStartTime); } if (!fMetaData.containsKey(TmfStrings.endTime())) { fMetaData.put(TmfStrings.endTime(), fStartTime + fDuration); } if (!fMetaData.containsKey(TmfStrings.duration())) { fMetaData.put(TmfStrings.duration(), fDuration); } return fMetaData; }

Target:
public synchronized Multimap<String, Object> getMetadata() { Multimap<String, Object> metadata = fMetadata; if (metadata == null) { metadata = HashMultimap.create(); String label = getLabel(); if (label != null) { metadata.put(IElementResolver.LABEL_KEY, label); } metadata.put(TmfStrings.startTime(), fStartTime); metadata.put(TmfStrings.endTime(), fStartTime + fDuration); metadata.put(TmfStrings.duration(), fDuration); fMetadata = metadata; } return metadata; }
Source:
protected void controlBulkOperations(final ListTable<T> extendedPagedTable) { enableWidgets( Streams.stream(extendedPagedTable.getRightActionsToolbar()).findFirst().orElse(null), extendedPagedTable.hasSelectedItems()); }

Target:
protected void controlBulkOperations(final ListTable<T> extendedPagedTable) { enableWidgets(StreamSupport.stream(extendedPagedTable.getRightActionsToolbar().spliterator(), false).findFirst().orElse(null), extendedPagedTable.hasSelectedItems()); }
Source:
public boolean performOk() { this.registry.setAssociations(this.workingCopy); EnableDisableLSJob enableDisableLSJob = new EnableDisableLSJob(changedDefinitions, getEditors()); enableDisableLSJob.schedule(); IPreferenceStore store = LanguageServerPlugin.getDefault().getPreferenceStore(); if (logToStdErrCheckbox.getSelection() != store .getBoolean(LoggingStreamConnectionProviderProxy.STDERR_KEY) || logToFileCheckbox.getSelection() != store .getBoolean(LoggingStreamConnectionProviderProxy.FILE_KEY)) { store.setValue(LoggingStreamConnectionProviderProxy.STDERR_KEY, logToStdErrCheckbox.getSelection()); store.setValue(LoggingStreamConnectionProviderProxy.FILE_KEY, logToFileCheckbox.getSelection()); MessageDialog dialog = new MessageDialog(getShell(), Messages.PreferencesPage_restartWarning_title, null, Messages.PreferencesPage_restartWarning_message, MessageDialog.WARNING, new String[] { Messages.PreferencesPage_restartWarning_no, Messages.PreferencesPage_restartWarning_restart }, 1); if (dialog.open() == 1) { PlatformUI.getWorkbench().restart(); } } return super.performOk(); }

Target:
public boolean performOk() { this.registry.setAssociations(this.workingCopy); EnableDisableLSJob enableDisableLSJob = new EnableDisableLSJob(changedDefinitions, getEditors()); enableDisableLSJob.schedule(); IPreferenceStore store = LanguageServerPlugin.getDefault().getPreferenceStore(); if (logToStdErrCheckbox.getSelection() != store .getBoolean(LoggingStreamConnectionProviderProxy.STDERR_KEY) || logToFileCheckbox.getSelection() != store .getBoolean(LoggingStreamConnectionProviderProxy.FILE_KEY)) { store.setValue(LoggingStreamConnectionProviderProxy.STDERR_KEY, logToStdErrCheckbox.getSelection()); store.setValue(LoggingStreamConnectionProviderProxy.FILE_KEY, logToFileCheckbox.getSelection()); MessageDialog dialog = new MessageDialog(getShell(), Messages.PreferencesPage_restartWarning_title, null, Messages.PreferencesPage_restartWarning_message, MessageDialog.WARNING, new String[] { IDialogConstants.NO_LABEL, Messages.PreferencesPage_restartWarning_restart }, 1); if (dialog.open() == 1) { PlatformUI.getWorkbench().restart(); } } return super.performOk(); }
Source:
public Value propertyValue() { if ( stateValue != null ) { return stateValue.value(); } Value value = readValue(); assertOpen.assertOpen(); return value; }

Target:
public Value propertyValue() { if ( txStateValue != null ) { return txStateValue.value(); } Value value = readValue(); assertOpen.assertOpen(); return value; }
Source:
public static boolean isNotDefault(Message object) { checkNotNull(object); return !isDefault(object); }

Target:
public static boolean isNotDefault(Message object) { checkNotNull(object); final boolean result = !isDefault(object); return result; }
Source:
public SourceMethod build() { MappingOptions mappingOptions = null; if ( (mappings != null && !mappings.isEmpty()) || iterableMapping != null || mapMapping != null || beanMapping != null || valueMappings != null ) { mappingOptions = new MappingOptions( mappings, iterableMapping, mapMapping, beanMapping, valueMappings ); } SourceMethod sourceMethod = new SourceMethod( declaringMapper, executable, parameters, returnType, exceptionTypes, mappingOptions, typeUtils, typeFactory, mapperConfig, prototypeMethods, definingType ); if ( mappings != null ) { for ( Map.Entry<String, List<Mapping>> entry : mappings.entrySet() ) { for ( Mapping mapping : entry.getValue() ) { mapping.init( sourceMethod, messager, typeFactory, false ); } } } return sourceMethod; }

Target:
public SourceMethod build() { MappingOptions mappingOptions = new MappingOptions( mappings, iterableMapping, mapMapping, beanMapping, valueMappings ); SourceMethod sourceMethod = new SourceMethod( declaringMapper, executable, parameters, returnType, exceptionTypes, mappingOptions, typeUtils, typeFactory, mapperConfig, prototypeMethods, definingType ); if ( mappings != null ) { for ( Map.Entry<String, List<Mapping>> entry : mappings.entrySet() ) { for ( Mapping mapping : entry.getValue() ) { mapping.init( sourceMethod, messager, typeFactory, false ); } } } return sourceMethod; }
Source:
public void theSetAlarmNotificationsRequestIsReceived(final Map<String, String> requestData) throws Throwable { final Map<String, String> settings = new HashMap<>(); settings.put(PlatformSmartmeteringKeys.KEY_DEVICE_IDENTIFICATION, requestData.get(PlatformSmartmeteringKeys.KEY_DEVICE_IDENTIFICATION)); settings.put(PlatformSmartmeteringKeys.ALARM_TYPE, requestData.get(PlatformSmartmeteringKeys.ALARM_TYPE)); settings.put(PlatformSmartmeteringKeys.ALARM_TYPE_ENABLED, requestData.get(PlatformSmartmeteringKeys.ALARM_TYPE_ENABLED)); final SetAlarmNotificationsRequest setAlarmNotificationsRequest = SetAlarmNotificationsRequestFactory .fromParameterMap(settings); final SetAlarmNotificationsAsyncResponse setAlarmNotificationsAsyncResponse = this.smartMeteringConfigurationClient .setAlarmNotifications(setAlarmNotificationsRequest); LOGGER.info("Set alarm notifications response is received {}", setAlarmNotificationsAsyncResponse); assertNotNull("Set alarm notifications response should not be null", setAlarmNotificationsAsyncResponse); ScenarioContext.current().put(PlatformSmartmeteringKeys.KEY_CORRELATION_UID, setAlarmNotificationsAsyncResponse.getAsyncResponse().getCorrelationUid()); }

Target:
public void theSetAlarmNotificationsRequestIsReceived(final Map<String, String> requestData) throws Throwable { final SetAlarmNotificationsRequest setAlarmNotificationsRequest = SetAlarmNotificationsRequestFactory .fromParameterMap(requestData); final SetAlarmNotificationsAsyncResponse setAlarmNotificationsAsyncResponse = this.smartMeteringConfigurationClient .setAlarmNotifications(setAlarmNotificationsRequest); LOGGER.info("Set alarm notifications response is received {}", setAlarmNotificationsAsyncResponse); assertNotNull("Set alarm notifications response should not be null", setAlarmNotificationsAsyncResponse); ScenarioContext.current().put(PlatformSmartmeteringKeys.KEY_CORRELATION_UID, setAlarmNotificationsAsyncResponse.getAsyncResponse().getCorrelationUid()); }