auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static String getGrobidCRFEngineName(final String modelName) { String defaultEngineName = GrobidProperties.getGrobidCRFEngine().name(); if ( GrobidProperties.getGrobidCRFEngine() == GrobidCRFEngine.DELFT && ( modelName.equals("fulltext") || modelName.equals("segmentation") ) ) { defaultEngineName = GrobidCRFEngine.WAPITI.name(); } return getPropertyValue( GrobidPropertyKeys.PROP_GROBID_CRF_ENGINE + "." + modelName, defaultEngineName ); }

Target:
private static String getGrobidCRFEngineName(final String modelName) { String defaultEngineName = GrobidProperties.getGrobidCRFEngine().name(); return getPropertyValue( GrobidPropertyKeys.PROP_GROBID_CRF_ENGINE + "." + getModelPropertySuffix(modelName), defaultEngineName ); }
Source:
public ProductDTO addBatchContent( @PathParam("owner_key") String ownerKey, @PathParam("product_id") String productId, @ApiParam(name = "contentMap", required = true) Map<String, Boolean> contentMap) { Owner owner = this.getOwnerByKey(ownerKey); Product product = this.fetchProduct(owner, productId); Collection<ProductContent> productContent = new LinkedList<>(); if (product.isLocked()) { throw new ForbiddenException(i18n.tr("product \"{0}\" is locked", product.getId())); } ProductDTO pdto = this.translator.translate(product, ProductDTO.class); boolean changed = false; for (Entry<String, Boolean> entry : contentMap.entrySet()) { Content content = this.fetchContent(owner, entry.getKey()); boolean enabled = entry.getValue() != null ? entry.getValue() : ProductContent.DEFAULT_ENABLED_STATE; ContentDTO cdto = this.translator.translate(content, ContentDTO.class); changed |= pdto.addContent(cdto, enabled); } if (changed) { product = this.productManager.updateProduct(pdto, owner, true); } return this.translator.translate(product, ProductDTO.class); }

Target:
public ProductDTO addBatchContent( @PathParam("owner_key") String ownerKey, @PathParam("product_id") String productId, @ApiParam(name = "contentMap", required = true) Map<String, Boolean> contentMap) { Owner owner = this.getOwnerByKey(ownerKey); OwnerProduct ownerProduct = ownerProductCurator.getOwnerProductByProductId(owner, productId); ownerProductCurator.lock(ownerProduct); ownerProductCurator.refresh(ownerProduct); Product product = ownerProduct.getProduct(); Collection<ProductContent> productContent = new LinkedList<>(); if (product.isLocked()) { throw new ForbiddenException(i18n.tr("product \"{0}\" is locked", product.getId())); } ProductDTO pdto = this.translator.translate(product, ProductDTO.class); boolean changed = false; for (Entry<String, Boolean> entry : contentMap.entrySet()) { Content content = this.fetchContent(owner, entry.getKey()); boolean enabled = entry.getValue() != null ? entry.getValue() : ProductContent.DEFAULT_ENABLED_STATE; ContentDTO cdto = this.translator.translate(content, ContentDTO.class); changed |= pdto.addContent(cdto, enabled); } if (changed) { product = this.productManager.updateProduct(pdto, owner, true); } return this.translator.translate(product, ProductDTO.class); }
Source:
public synchronized void skipNextPacket() throws IOException, BadPcapFileException { if (getFileChannel().size() - getFileChannel().position() == 0) { return; } if (getFileChannel().size() - getFileChannel().position() < PcapFileValues.PACKET_HEADER_SIZE) { throw new BadPcapFileException("A pcap header is invalid."); } ByteBuffer pcapPacketHeader = ByteBuffer.allocate(PcapFileValues.PACKET_HEADER_SIZE); pcapPacketHeader.clear(); getFileChannel().read(pcapPacketHeader); pcapPacketHeader.flip(); pcapPacketHeader.position(PcapFileValues.INCLUDED_LENGTH_POSITION); long includedPacketLength = ConversionHelper.unsignedIntToLong(pcapPacketHeader.getInt()); if (getFileChannel().size() - getFileChannel().position() < includedPacketLength) { throw new BadPcapFileException("A packet header is invalid."); } getFileChannel().position(getFileChannel().position() + includedPacketLength); fFileIndex.put(++fCurrentRank, getFileChannel().position()); }

Target:
public synchronized void skipNextPacket() throws IOException, BadPcapFileException { if (getFileChannel().size() - getFileChannel().position() == 0) { return; } if (getFileChannel().size() - getFileChannel().position() < PcapFileValues.PACKET_HEADER_SIZE) { throw new BadPcapFileException("A pcap header is invalid."); } ByteBuffer pcapPacketHeader = ByteBuffer.allocate(PcapFileValues.PACKET_HEADER_SIZE); pcapPacketHeader.clear(); getFileChannel().read(pcapPacketHeader); pcapPacketHeader.flip(); pcapPacketHeader.position(PcapFileValues.INCLUDED_LENGTH_POSITION); long includedPacketLength = ConversionHelper.unsignedIntToLong(pcapPacketHeader.getInt()); if (getFileChannel().size() - getFileChannel().position() < includedPacketLength) { throw new BadPcapFileException("A packet header is invalid."); } getFileChannel().position(getFileChannel().position() + includedPacketLength); TreeMap<Long, Long> fFileIndex = super.getFileIndex(); fFileIndex.put(++fCurrentRank, getFileChannel().position()); }
Source:
public void onCreateProject(FolderEntry baseFolder, Map<String, AttributeValue> attributes, Map<String, String> options) throws ForbiddenException, ConflictException, ServerException { InputStream packageJson = null; InputStream personJson = null; try { FolderEntry myJsonFiles = baseFolder.createFolder("myJsonFiles"); packageJson = getClass().getClassLoader().getResourceAsStream("files/default_package"); personJson = getClass().getClassLoader().getResourceAsStream("files/default_person"); baseFolder.createFile(FILE_NAME, packageJson); myJsonFiles.createFile("person.json", personJson); } finally { Closeables.closeQuietly(packageJson); Closeables.closeQuietly(personJson); } }

Target:
public void onCreateProject(FolderEntry baseFolder, Map<String, AttributeValue> attributes, Map<String, String> options) throws ForbiddenException, ConflictException, ServerException { try (InputStream packageJson = getClass().getClassLoader().getResourceAsStream("files/default_package"); InputStream personJson = getClass().getClassLoader().getResourceAsStream("files/default_person")) { FolderEntry myJsonFiles = baseFolder.createFolder("myJsonFiles"); baseFolder.createFile(FILE_NAME, packageJson); myJsonFiles.createFile("person.json", personJson); } catch (IOException ioEx) { throw new ServerException(ioEx.getLocalizedMessage(), ioEx); } }
Source:
public static boolean isUserExist(String username) throws APIManagementException { if (username == null) { throw new APIManagementException("Attempt to execute privileged operation as" + " the anonymous user"); } String tenantDomain = MultitenantUtils.getTenantDomain(username); String tenantAwareUserName = MultitenantUtils.getTenantAwareUsername(username); try { int tenantId = ServiceReferenceHolder.getInstance().getRealmService().getTenantManager().getTenantId(tenantDomain); UserStoreManager manager = ServiceReferenceHolder.getInstance().getRealmService().getTenantUserRealm(tenantId) .getUserStoreManager(); return manager.isExistingUser(tenantAwareUserName); } catch (UserStoreException e) { throw new APIManagementException("UserStoreException while trying the user existence " + username, e); } }

Target:
public static boolean isUserExist(String username) throws APIManagementException { if (username == null) { throw new APIManagementException("Attempt to execute privileged operation as the anonymous user"); } String tenantDomain = MultitenantUtils.getTenantDomain(username); String tenantAwareUserName = MultitenantUtils.getTenantAwareUsername(username); try { int tenantId = ServiceReferenceHolder.getInstance().getRealmService().getTenantManager().getTenantId(tenantDomain); UserStoreManager manager = ServiceReferenceHolder.getInstance().getRealmService().getTenantUserRealm(tenantId) .getUserStoreManager(); return manager.isExistingUser(tenantAwareUserName); } catch (UserStoreException e) { throw new APIManagementException("UserStoreException while trying the user existence " + username, e); } }
Source:
public void pass_headers_Test() throws Exception { respondWith(JSON_USERS); Map header = new HashMap(); String key = "X-Domain-Id"; String value = "default"; header.put(key, value); KeystoneToken token = new KeystoneToken(); token.setEndpoint(authURL("/v3")); OSClient.OSClientV3 osClient = OSFactory.clientFromToken(token).headers(header); osClient.identity().users().list(); RecordedRequest request = server.takeRequest(); assertEquals(request.getHeader(key), value); }

Target:
public void pass_headers_Test() throws Exception { respondWith(JSON_USERS); OSClient.OSClientV3 osClient = OSFactory.builderV3() .endpoint(authURL("/v3")) .scopeToDomain(Identifier.byId(DOMAIN_ID)) .authenticate(); osClient.identity().users().list(); RecordedRequest request = server.takeRequest(); assertEquals(request.getHeader(ClientConstants.HEADER_X_DOMAIN_ID), DOMAIN_ID); }
Source:
private long insertDocumentHistoryToNewTree(SQLDatabase db, DocumentRevision newRevision, List<String> revisions, Long docNumericID) throws AttachmentException, DocumentNotFoundException, DatastoreException { Preconditions.checkArgument(checkCurrentRevisionIsInRevisionHistory(newRevision, revisions), "Current revision must exist in revision history."); long previousLeafSeq = getSequenceInQueue(db, newRevision.getId(), null); logger.finer("Inserting a brand new tree for an existing document."); long parentSequence = 0L; for(int i = 0 ; i < revisions.size() - 1 ; i ++) { parentSequence = insertStubRevision(db,docNumericID, revisions.get(i), parentSequence); } String newLeafRev = newRevision.getRevision(); InsertRevisionCallable callable = new InsertRevisionCallable(); callable.docNumericId = docNumericID; callable.revId = newLeafRev; callable.parentSequence = parentSequence; callable.deleted = newRevision.isDeleted(); callable.current = false; callable.data = newRevision.asBytes(); callable.available = !newRevision.isDeleted(); long newLeafSeq = callable.call(db); pickWinnerOfConflicts(db, docNumericID, newRevision.getId()); return newLeafSeq; }

Target:
private long insertDocumentHistoryToNewTree(SQLDatabase db, DocumentRevision newRevision, List<String> revisions, Long docNumericID) throws AttachmentException, DocumentNotFoundException, DatastoreException { Preconditions.checkArgument(checkCurrentRevisionIsInRevisionHistory(newRevision, revisions), "Current revision must exist in revision history."); logger.finer("Inserting a brand new tree for an existing document."); long parentSequence = 0L; for(int i = 0 ; i < revisions.size() - 1 ; i ++) { parentSequence = insertStubRevision(db,docNumericID, revisions.get(i), parentSequence); } String newLeafRev = newRevision.getRevision(); InsertRevisionCallable callable = new InsertRevisionCallable(); callable.docNumericId = docNumericID; callable.revId = newLeafRev; callable.parentSequence = parentSequence; callable.deleted = newRevision.isDeleted(); callable.current = false; callable.data = newRevision.asBytes(); callable.available = !newRevision.isDeleted(); long newLeafSeq = callable.call(db); pickWinnerOfConflicts(db, docNumericID); return newLeafSeq; }
Source:
public Map<String, Object> getResponseHeaders() { if (!responseMetadata.has(RESPONSE_HEADERS_KEY)) { return Collections.emptyMap(); } JSONObject headers = responseMetadata.getJSONObject(RESPONSE_HEADERS_KEY); Map<String, Object> ret = new HashMap<>(); headers.keySet().forEach(s -> ret.put(s, headers.get(s))); return ret; }

Target:
public Map<String, Object> getResponseHeaders() { return responseMetadata.has(RESPONSE_HEADERS_KEY) ? responseMetadata.getJSONObject(RESPONSE_HEADERS_KEY).toMap() : Collections.emptyMap(); }
Source:
public TestFixedHistogramJacknifeStateStrategy() { super(new StrategyCreator()); }

Target:
public TestFixedHistogramJacknifeStateStrategy() { super(size -> new FixedHistogramJacknifeStateStrategy(size, AbstractTestStateStrategy.MIN, AbstractTestStateStrategy.MAX)); }
Source:
public void testExecuteQueryComplete() throws InterruptedException { AsyncQuery queryObj = mock(AsyncQuery.class); String query = "/group?sort=commonName&fields%5Bgroup%5D=commonName,description"; String id = "edc4a871-dff2-4054-804e-d80075cf827d"; ElideResponse response = mock(ElideResponse.class); when(queryObj.getQuery()).thenReturn(query); when(queryObj.getId()).thenReturn(id); when(queryObj.getQueryType()).thenReturn(QueryType.JSONAPI_V1_0); when(response.getResponseCode()).thenReturn(200); when(response.getBody()).thenReturn("ResponseBody"); when(queryObj.getAsyncAfterSeconds()).thenReturn(10); service.executeQuery(queryObj, testUser, NO_VERSION); verify(queryObj, times(1)).setStatus(QueryStatus.PROCESSING); verify(queryObj, times(1)).setStatus(QueryStatus.COMPLETE); }

Target:
public void testExecuteQueryComplete() throws InterruptedException { AsyncQuery queryObj = mock(AsyncQuery.class); String query = "/group?sort=commonName&fields%5Bgroup%5D=commonName,description"; String id = "edc4a871-dff2-4054-804e-d80075cf827d"; when(queryObj.getQuery()).thenReturn(query); when(queryObj.getId()).thenReturn(id); when(queryObj.getQueryType()).thenReturn(QueryType.JSONAPI_V1_0); when(queryObj.getAsyncAfterSeconds()).thenReturn(10); service.executeQuery(queryObj, testUser, NO_VERSION); verify(queryObj, times(1)).setStatus(QueryStatus.PROCESSING); verify(queryObj, times(1)).setStatus(QueryStatus.COMPLETE); }
Source:
public void initialize(final URL location, final ResourceBundle resources) { listen(Message.OPENED, (controller, subject, args) -> { assert controller instanceof MenuController; if (!"tree".equals(subject)) { return; } assert args.length == 1; assert args[0] instanceof File; try { loadTree((File) args[0]); } catch (FileNotFoundException e) { Logging.exception(e); } }); listen(Message.LOADED, (controller, subject, args) -> { if (!"sequences".equals(subject)) { return; } assert args[0] instanceof Map<?, ?>; @SuppressWarnings("unchecked") Map<String, Sequence> newSequences = (Map<String, Sequence>) args[0]; sequences = newSequences; repaint(); }); listen(Message.FILTERED, (controller, subject, args) -> { assert args.length == 1; assert args[0] instanceof Set<?>; if (!(controller instanceof TreeController)) { @SuppressWarnings("unchecked") Set<Sequence> newSequences = (Set<Sequence>) args[0]; setVisible(newSequences); } }); view.setController(this); view.setBounds(wrapper.layoutBoundsProperty().get()); wrapper.layoutBoundsProperty().addListener( (observableBounds, oldValue, newValue) -> { view.setBounds(newValue); }); }

Target:
public void initialize(final URL location, final ResourceBundle resources) { listen(Message.OPENED, (controller, subject, args) -> { assert controller instanceof MenuController; if (!"tree".equals(subject)) { return; } assert args.length == 1; assert args[0] instanceof File; try { loadTree((File) args[0]); } catch (FileNotFoundException e) { Logging.exception(e); } }); listen(Message.LOADED, (controller, subject, args) -> { if (!"sequences".equals(subject)) { return; } assert args[0] instanceof Map<?, ?>; @SuppressWarnings("unchecked") Map<String, Sequence> newSequences = (Map<String, Sequence>) args[0]; sequences = newSequences; repaint(); }); listen(Message.FILTERED, (controller, subject, args) -> { assert args.length == 1; assert args[0] instanceof Set<?>; if (!(controller instanceof TreeController)) { @SuppressWarnings("unchecked") Set<Sequence> newSequences = (Set<Sequence>) args[0]; setVisible(newSequences); } }); view.setController(this); view.setBounds(wrapper.layoutBoundsProperty().get()); wrapper.layoutBoundsProperty().addListener( (observableBounds, oldValue, newValue) -> view .setBounds(newValue)); }
Source:
private void forceAcquire() { try { lockStore.forceAcquire(lock.getLockId()); } catch (Exception e) { log.error("Lock: could not force-acquire lease {}", lock.getLockId(), e); } }

Target:
private void forceAcquire() throws LockStoreException { lockStore.forceAcquire(lock.getLockId()); }
Source:
public void open() throws Exception { this.joinCondition = generatedJoinCondition.newInstance(getRuntimeContext().getUserCodeClassLoader()); FunctionUtils.setFunctionRuntimeContext(joinCondition, getRuntimeContext()); FunctionUtils.openFunction(joinCondition, new Configuration()); ValueStateDescriptor<RowData> rightStateDesc = new ValueStateDescriptor<>("right", rightType); this.rightState = getRuntimeContext().getState(rightStateDesc); this.collector = new TimestampedCollector<>(output); this.outRow = new JoinedRowData(); super.processWatermark2(Watermark.MAX_WATERMARK); super.open(); }

Target:
public void open() throws Exception { super.open(); this.joinCondition = generatedJoinCondition.newInstance(getRuntimeContext().getUserCodeClassLoader()); FunctionUtils.setFunctionRuntimeContext(joinCondition, getRuntimeContext()); FunctionUtils.openFunction(joinCondition, new Configuration()); ValueStateDescriptor<RowData> rightStateDesc = new ValueStateDescriptor<>("right", rightType); this.rightState = getRuntimeContext().getState(rightStateDesc); this.collector = new TimestampedCollector<>(output); this.outRow = new JoinedRowData(); super.processWatermark2(Watermark.MAX_WATERMARK); }
Source:
protected void ExecuteVdsBrokerCommand() { boolean isFilled = false; if (getParameters().getStoragePoolId() != null) { if (FeatureSupported.saferGetAllTasksRequest(getVds().getVdsGroupCompatibilityVersion())) { _result = getBroker().getAllTasksInfo(getParameters().getStoragePoolId().toString()); isFilled = true; } } if (!isFilled) { _result = getBroker().getAllTasksInfo(); } ProceedProxyReturnValue(); setReturnValue(ParseTaskInfoList(_result.TaskInfoList)); }

Target:
protected void ExecuteVdsBrokerCommand() { Version compatibilityVersion = getParameters().getCompatibilityVersion(); if ((getParameters().getStoragePoolId() != null) && (compatibilityVersion != null) && FeatureSupported.saferGetAllTasksRequest(compatibilityVersion)) { _result = getBroker().getAllTasksInfo(getParameters().getStoragePoolId().toString()); } else { _result = getBroker().getAllTasksInfo(); } ProceedProxyReturnValue(); setReturnValue(ParseTaskInfoList(_result.TaskInfoList)); }
Source:
public static byte[] getSaltedKey(ImmutableBytesWritable key, int bucketNum) { byte[] keyBytes = new byte[key.getSize()]; byte saltByte = getSaltingByte(key.get(), key.getOffset() + 1, key.getLength() - 1, bucketNum); keyBytes[0] = saltByte; System.arraycopy(key.get(), key.getOffset() + 1, keyBytes, 1, key.getSize() - 1); return keyBytes; }

Target:
public static byte[] getSaltedKey(ImmutableBytesWritable key, int bucketNum) { byte[] keyBytes = new byte[key.getLength()]; byte saltByte = getSaltingByte(key.get(), key.getOffset() + 1, key.getLength() - 1, bucketNum); keyBytes[0] = saltByte; System.arraycopy(key.get(), key.getOffset() + 1, keyBytes, 1, key.getLength() - 1); return keyBytes; }
Source:
private void parseResourceArray(Element element, Map<TypeElement, BindingClass> targetClassMap, Set<String> erasedTargetNames) { boolean hasError = false; TypeElement enclosingElement = (TypeElement) element.getEnclosingElement(); String methodName = getArrayResourceMethodName(element); if (methodName == null) { error(element, "@%s field type must be one of: " + "'String[], int[], CharSequence[], %s'. (%s.%s)", BindArray.class.getSimpleName(), TYPED_ARRAY_TYPE, enclosingElement.getQualifiedName(), element.getSimpleName()); hasError = true; } hasError |= isInaccessibleViaGeneratedCode(BindArray.class, "fields", element); hasError |= isBindingInWrongPackage(BindArray.class, element); if (hasError) { return; } String name = element.getSimpleName().toString(); int id = element.getAnnotation(BindArray.class).value(); BindingClass bindingClass = getOrCreateTargetClass(targetClassMap, enclosingElement); FieldResourceBinding binding = new FieldResourceBinding(id, name, methodName); bindingClass.addResource(binding); erasedTargetNames.add(enclosingElement.toString()); }

Target:
private void parseResourceArray(Element element, Map<TypeElement, BindingClass> targetClassMap, Set<String> erasedTargetNames) { boolean hasError = false; TypeElement enclosingElement = (TypeElement) element.getEnclosingElement(); String methodName = getArrayResourceMethodName(element); if (methodName == null) { error(element, "@%s field type must be one of: String[], int[], CharSequence[], %s. (%s.%s)", BindArray.class.getSimpleName(), TYPED_ARRAY_TYPE, enclosingElement.getQualifiedName(), element.getSimpleName()); hasError = true; } hasError |= isInaccessibleViaGeneratedCode(BindArray.class, "fields", element); hasError |= isBindingInWrongPackage(BindArray.class, element); if (hasError) { return; } String name = element.getSimpleName().toString(); int id = element.getAnnotation(BindArray.class).value(); BindingClass bindingClass = getOrCreateTargetClass(targetClassMap, enclosingElement); FieldResourceBinding binding = new FieldResourceBinding(id, name, methodName); bindingClass.addResource(binding); erasedTargetNames.add(enclosingElement.toString()); }
Source:
public void checkChain(X509Certificate[] chain) throws CertificateException { for (int i = 0; i < chain.length - 1; i++) { X509Certificate certificate = chain[i]; X509Certificate issuer = chain[i + 1]; try { CertId certId = CertId.fromCertificate(certificate, issuer); OcspStatus status = checker.obtainStatus(certId, issuer, getResponder(certificate), signatureVerifier); ElytronMessages.ocsp.tracef("OCSP status of %s: %s", certificate, status); if (status.getStatus() == OcspStatus.CertStatus.REVOKED || (status.getStatus() == OcspStatus.CertStatus.UNKNOWN && ! acceptUnknownCertificates)) { throw ElytronMessages.ocsp.certificateIsRevoked(certificate.getSerialNumber(), responder); } } catch (IOException e) { ElytronMessages.ocsp.trace("OCSP validation has failed", e); if (! acceptWhenStatusUnavailable) { throw ElytronMessages.ocsp.ocspValidationHasFailed(certificate.toString(), e); } } } }

Target:
public void checkChain(X509Certificate[] chain) throws CertificateException { ElytronMessages.ocsp.tracef("OCSP validation of chain of %d certificates", chain.length); for (int i = 0; i < chain.length - 1; i++) { X509Certificate certificate = chain[i]; X509Certificate issuer = chain[i + 1]; try { URL responder = getResponder(certificate); if (responder == null) { ElytronMessages.ocsp.tracef("OCSP validation of %s skipped - no OCSP responder", certificate); continue; } CertId certId = CertId.fromCertificate(certificate, issuer); OcspStatus status = checker.obtainStatus(certId, issuer, responder, signatureVerifier); ElytronMessages.ocsp.tracef("OCSP status of %s: %s", certificate, status); if (status.getStatus() == OcspStatus.CertStatus.REVOKED || (status.getStatus() == OcspStatus.CertStatus.UNKNOWN && ! acceptUnknownCertificates)) { throw ElytronMessages.ocsp.certificateIsRevoked(certificate.getSerialNumber(), responder); } } catch (IOException e) { ElytronMessages.ocsp.tracef(e, "OCSP validation of %s has failed", certificate); if (! acceptWhenStatusUnavailable) { throw ElytronMessages.ocsp.ocspValidationHasFailed(certificate.toString(), e); } } } }
Source:
static void addInternalClassesToWhiteList(ClassWhiteList list) { list.addClasses( BackupSender.BringSiteOnlineResponse.class, BackupSender.TakeSiteOfflineResponse.class, CacheMode.class, XSiteAdminCommand.AdminOperation.class, XSiteAdminCommand.Status.class ); list.addClasses(Enum.class, Number.class, Object.class, Object[].class, SerializedLambda.class); }

Target:
static void addInternalClassesToWhiteList(ClassWhiteList list) { list.addClasses(Number.class, Object.class, Object[].class, SerializedLambda.class); }
Source:
public void testJMXServiceRegisterMBean() throws Exception { TestObject testObject = new TestObject(); ObjectName testObjectName = new ObjectName("org.apache.flink.management", "key", "value"); MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer(); try { JMXServer server = JMXService.getInstance(); mBeanServer.registerMBean(testObject, testObjectName); JMXServiceURL url = new JMXServiceURL("service:jmx:rmi://localhost:" + server.getPort() + "/jndi/rmi://localhost:" + server.getPort() + "/jmxrmi"); JMXConnector jmxConn = JMXConnectorFactory.connect(url); MBeanServerConnection mbeanConnConn = jmxConn.getMBeanServerConnection(); assertEquals(1, mbeanConnConn.getAttribute(testObjectName, "Foo")); mBeanServer.unregisterMBean(testObjectName); try { mbeanConnConn.getAttribute(testObjectName, "Foo"); } catch (Exception e) { assertTrue(e instanceof InstanceNotFoundException); } } finally { JMXService.stopInstance(); } }

Target:
public void testJMXServiceRegisterMBean() throws Exception { TestObject testObject = new TestObject(); ObjectName testObjectName = new ObjectName("org.apache.flink.management", "key", "value"); MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer(); try { Optional<JMXServer> server = JMXService.getInstance(); assertTrue(server.isPresent()); mBeanServer.registerMBean(testObject, testObjectName); JMXServiceURL url = new JMXServiceURL("service:jmx:rmi://localhost:" + server.get().getPort() + "/jndi/rmi://localhost:" + server.get().getPort() + "/jmxrmi"); JMXConnector jmxConn = JMXConnectorFactory.connect(url); MBeanServerConnection mbeanConnConn = jmxConn.getMBeanServerConnection(); assertEquals(1, mbeanConnConn.getAttribute(testObjectName, "Foo")); mBeanServer.unregisterMBean(testObjectName); try { mbeanConnConn.getAttribute(testObjectName, "Foo"); } catch (Exception e) { assertTrue(e instanceof InstanceNotFoundException); } } finally { JMXService.stopInstance(); } }
Source:
protected boolean shouldValidateOnBudgetTotal() { Boolean validateOnBudgetTotal = parameterService.getParameterValueAsBoolean(ArConstants.AR_NAMESPACE_CODE, ArConstants.CONTRACTS_GRANTS_INVOICE_COMPONENT, CuArConstants.CG_INVOICE_AMT_BILLED_SUSPENION_BY_BUDGET_TOTAL); if (LOG.isDebugEnabled()) { if (validateOnBudgetTotal == null) { LOG.debug("shouldValidateOnBudgetTotal, no parameter named " + CuArConstants.CG_INVOICE_AMT_BILLED_SUSPENION_BY_BUDGET_TOTAL + " in KFS-AR name space, so defaulting to true."); } else { LOG.debug("shouldValidateOnBudgetTotal, the value of " + CuArConstants.CG_INVOICE_AMT_BILLED_SUSPENION_BY_BUDGET_TOTAL + " is " + validateOnBudgetTotal.booleanValue()); } } return validateOnBudgetTotal == null ? true : validateOnBudgetTotal.booleanValue(); }

Target:
protected boolean shouldValidateOnBudgetTotal() { Boolean validateOnBudgetTotal = parameterService.getParameterValueAsBoolean(ArConstants.AR_NAMESPACE_CODE, ArConstants.CONTRACTS_GRANTS_INVOICE_COMPONENT, CuArConstants.CG_INVOICE_AMT_BILLED_SUSPENSION_BY_BUDGET_TOTAL, Boolean.TRUE.booleanValue()); if (LOG.isDebugEnabled()) { LOG.debug("shouldValidateOnBudgetTotal, the value of " + CuArConstants.CG_INVOICE_AMT_BILLED_SUSPENSION_BY_BUDGET_TOTAL + " is " + validateOnBudgetTotal.booleanValue()); } return validateOnBudgetTotal.booleanValue(); }
Source:
public synchronized void configureBackground(IFigure fig) { if (resolveDDiagram().some() && fig != null) { DSemanticDiagram dSemanticDiagram = (DSemanticDiagram) this.resolveDDiagram().get(); ColorDescription colorDesc = dSemanticDiagram.getDescription().getBackgroundColor(); RGBValues rgb = WHITE; if (colorDesc != null) { rgb = new AbstractColorUpdater().getRGBValuesFromColorDescription(dSemanticDiagram.getTarget(), colorDesc); } Color previousColor = fig.getBackgroundColor(); if (!sameColor(previousColor, rgb)) { EditPartViewer viewer = this.getViewer(); Color backgroundColor; if (WHITE.equals(rgb)) { backgroundColor = null; } else { backgroundColor = new Color(viewer.getControl().getDisplay(), rgb.getRed(), rgb.getGreen(), rgb.getBlue()); } fig.setBackgroundColor(backgroundColor); fig.setOpaque(backgroundColor != null); if (viewer instanceof SiriusDiagramGraphicalViewer) ((SiriusDiagramGraphicalViewer) viewer).setBackgroundColor(backgroundColor); } } }

Target:
public synchronized void configureBackground(IFigure fig) { if (resolveDDiagram().some() && fig != null) { DSemanticDiagram dSemanticDiagram = (DSemanticDiagram) this.resolveDDiagram().get(); ColorDescription colorDesc = dSemanticDiagram.getDescription().getBackgroundColor(); RGBValues rgb = WHITE; if (colorDesc != null) { rgb = new AbstractColorUpdater().getRGBValuesFromColorDescription(dSemanticDiagram.getTarget(), colorDesc); } Color previousColor = fig.getBackgroundColor(); if (!sameColor(previousColor, rgb)) { EditPartViewer viewer = this.getViewer(); if (viewer instanceof SiriusDiagramGraphicalViewer) { Color backgroundColor; if (WHITE.equals(rgb)) { backgroundColor = null; } else { backgroundColor = new Color(viewer.getControl().getDisplay(), rgb.getRed(), rgb.getGreen(), rgb.getBlue()); } fig.setBackgroundColor(backgroundColor); fig.setOpaque(backgroundColor != null); ((SiriusDiagramGraphicalViewer) viewer).setBackgroundColor(backgroundColor); } } } }
Source:
public String getMapLink(int mapIndex) { String mapLink = mapList.get(mapIndex).getAttribute("href"); return mapLink; }

Target:
public String getMapLink(int mapIndex) { return mapList.get(mapIndex).getAttribute("href"); }
Source:
private Model constructModel() { File file = path.toFile(); Model model = new Model(); model.setModelVersion(POM_MODEL_VERSION); if (publishable.getPomTemplate().isPresent()) { model = constructModel(publishable.getPomTemplate().get().toFile(), model); } if (file.isFile()) { Model fromFile = constructModel(file, model); model = merge(model, fromFile); } return model; }

Target:
private Model constructModel() { File file = path.toFile(); Model model = new Model(); model.setModelVersion(POM_MODEL_VERSION); if (publishable.getPomTemplate().isPresent()) { model = constructModel(publishable.getPomTemplate().get().toFile(), model); } if (file.isFile()) { model = constructModel(file, model); } return model; }
Source:
public static String implodeStrings(String[] strings) { StringBuffer buffer = new StringBuffer(); for( int i = 0; i < strings.length; i++ ) buffer.append(strings[i]).append(','); return buffer.toString(); }

Target:
public static String implodeStrings(String[] strings) { StringBuilder buffer = new StringBuilder(); for( int i = 0; i < strings.length; i++ ) buffer.append(strings[i]).append(','); return buffer.toString(); }
Source:
private Mono<Void> sendInternalTracingEnabled(Flux<EventData> events, String partitionKey) { return sendLinkMono.flatMap(link -> { final AtomicReference<Context> sendSpanContext = new AtomicReference<>(Context.NONE); return link.getLinkSize() .flatMap(size -> { final int batchSize = size > 0 ? size : MAX_MESSAGE_LENGTH_BYTES; final BatchOptions batchOptions = new BatchOptions() .setPartitionKey(partitionKey) .setMaximumSizeInBytes(batchSize); final AtomicReference<Boolean> isFirst = new AtomicReference<>(true); return events.map(eventData -> { Context parentContext = eventData.getContext(); if (isFirst.getAndSet(false)) { Context entityContext = parentContext.addData("entity-Path", link.getEntityPath()); sendSpanContext.set(tracerProvider.startSpan( entityContext.addData("hostname", link.getHostname()), ProcessKind.SEND)); } return setSpanContext(eventData, parentContext); }).collect(new EventDataCollector(batchOptions, 1, link::getErrorContext)); }) .flatMap(list -> sendInternal(Flux.fromIterable(list))) .doOnEach(signal -> { tracerProvider.endSpan(sendSpanContext.get(), signal); }); }); }

Target:
private Mono<Void> sendInternalTracingEnabled(Flux<EventData> events, String partitionKey) { return sendLinkMono.flatMap(link -> { final AtomicReference<Context> sendSpanContext = new AtomicReference<>(Context.NONE); return link.getLinkSize() .flatMap(size -> { final int batchSize = size > 0 ? size : MAX_MESSAGE_LENGTH_BYTES; final BatchOptions batchOptions = new BatchOptions() .setPartitionKey(partitionKey) .setMaximumSizeInBytes(batchSize); final AtomicReference<Boolean> isFirst = new AtomicReference<>(true); return events.map(eventData -> { Context parentContext = eventData.getContext(); if (isFirst.getAndSet(false)) { Context entityContext = parentContext.addData(ENTITY_PATH_KEY, link.getEntityPath()); sendSpanContext.set(tracerProvider.startSpan( entityContext.addData(HOST_NAME_KEY, link.getHostname()), ProcessKind.SEND)); } return setSpanContext(eventData, parentContext); }).collect(new EventDataCollector(batchOptions, 1, link::getErrorContext)); }) .flatMap(list -> sendInternal(Flux.fromIterable(list))) .doOnEach(signal -> { tracerProvider.endSpan(sendSpanContext.get(), signal); }); }); }
Source:
public int compareTo(NumberOrString that) { int cmp = compareBooleans(that.isNumeric, this.isNumeric); if (cmp != 0) { return cmp; } if (isNumeric) { return this.number - that.number; } return this.original.compareTo(that.original); }

Target:
public int compareTo(NumberOrString that) { int cmp = compareBooleans(that.isNumeric, this.isNumeric); if (cmp != 0) { return cmp; } if (isNumeric) { return compareIntegers(this.number, that.number); } return this.original.compareTo(that.original); }
Source:
public HashSet<AbstractLocation> getLocations(SkillMetadata skillMetadata) { BukkitTagContext tagContext = new BukkitTagContext(null, null, null, false, null); tagContext.contextSource = source; source.contexts.put("entity", new EntityTag(skillMetadata.getCaster().getEntity().getBukkitEntity())); ObjectTag object = TagManager.tagObject( tag , tagContext); List<LocationTag> list = (object.asType(ListTag.class, tagContext)).filter(LocationTag.class, tagContext); HashSet<AbstractLocation> locations = new HashSet<AbstractLocation>(); for (LocationTag location : list) { locations.add(BukkitAdapter.adapt(location)); } return locations; }

Target:
public HashSet<AbstractLocation> getLocations(SkillMetadata skillMetadata) { TagContext tagContext = CoreUtilities.noDebugContext.clone(); tagContext.contextSource = source; source.contexts.put("entity", new EntityTag(skillMetadata.getCaster().getEntity().getBukkitEntity())); ObjectTag object = TagManager.tagObject( tag , tagContext); List<LocationTag> list = (object.asType(ListTag.class, tagContext)).filter(LocationTag.class, tagContext); HashSet<AbstractLocation> locations = new HashSet<AbstractLocation>(); for (LocationTag location : list) { locations.add(BukkitAdapter.adapt(location)); } return locations; }
Source:
public boolean canSubmit() { Collection<RefRight> refRights = getRefRights(); final Set<AccountGroup.Id> groups = projectControl.getCurrentUser().getEffectiveGroups(); int val = Integer.MIN_VALUE; for (final RefRight right : refRights) { if (right.getApprovalCategoryId().equals(SUBMIT) && groups.contains(right.getAccountGroupId()) && matches(refName, right.getRefPattern())) { if (val < 0 && right.getMaxValue() > 0) { val = right.getMaxValue(); } else { val = Math.max(right.getMaxValue(), val); } } } return val >= 1; }

Target:
public boolean canSubmit() { return canPerform(SUBMIT, (short) 1); }
Source:
public void testGetAllVersionsDuringStateTransfer() throws Exception { final int key = 1; final int value = 1; createCluster(); getCache(2).put(key, value); splitCluster(); delayStateTransferCompletion(); RehashListener listener = new RehashListener(); getCache(2).addListener(listener); Future<Map<Address, InternalCacheValue<Object>>> versionFuture = fork(() -> { while (!listener.isRehashInProgress.get()) TestingUtil.sleepThread(100); return getAllVersions(0, key); }); fork(() -> partition(0).merge(partition(1))); Map<Address, InternalCacheValue<Object>> versionMap = versionFuture.get(STATE_TRANSFER_DELAY * 16, TimeUnit.MILLISECONDS); assertTrue(versionMap != null); assertTrue(!versionMap.isEmpty()); assertEquals(String.format("Returned versionMap %s", versionMap),2, versionMap.size()); versionMap.values().forEach(icv -> assertEquals(value, icv.getValue())); }

Target:
public void testGetAllVersionsDuringStateTransfer() throws Exception { final int key = 1; final int value = 1; createCluster(); getCache(2).put(key, value); splitCluster(); RehashListener listener = new RehashListener(); getCache(0).addListener(listener); CountDownLatch latch = new CountDownLatch(1); delayStateTransferCompletion(latch); Future<?> mergeFuture = fork(() -> partition(0).merge(partition(1))); assertTrue(listener.latch.await(10, TimeUnit.SECONDS)); Future<Map<Address, InternalCacheValue<Object>>> versionFuture = fork(() -> getAllVersions(0, key)); Exceptions.expectException(TimeoutException.class, () -> versionFuture.get(100, TimeUnit.MILLISECONDS)); latch.countDown(); mergeFuture.get(30, TimeUnit.SECONDS); Map<Address, InternalCacheValue<Object>> versionMap = versionFuture.get(60, TimeUnit.SECONDS); assertTrue(versionMap != null); assertTrue(!versionMap.isEmpty()); assertEquals(String.format("Returned versionMap %s", versionMap),2, versionMap.size()); versionMap.values().forEach(icv -> assertEquals(value, icv.getValue())); }
Source:
public long getArea() { long area = 1; for ( int i = 0; i < min.length; i++ ) { area *= max[i] - min[i]; } return area; }

Target:
public long getArea() { long area = 1; for ( int i = 0; i < nbrDim; i++ ) { area *= max[i] - min[i]; } return area; }
Source:
public CommitInfoSearchRequestBuilder filterByTimeStamp(final long timeStamp) { return addOption(TIME_STAMP, TIME_STAMP); }

Target:
public CommitInfoSearchRequestBuilder filterByTimeStamp(final long timeStamp) { return addOption(TIME_STAMP, timeStamp); }
Source:
public void testInflateAndRender() throws InitializationException, ParserConfigurationException, IOException, SAXException { VirtualFile myLayout = myFixture.copyFileToProject("themeEditor/theme_preview_layout.xml", "res/layout/theme_preview_layout.xml"); Configuration configuration = myFacet.getConfigurationManager().getConfiguration(myLayout); DomPullParser parser = new DomPullParser( DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(myLayout.getInputStream()).getDocumentElement()); BufferedImage image = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB); GraphicsLayoutRenderer renderer = GraphicsLayoutRenderer.create(configuration, parser, false, false); assertEquals("Expected (0,0) before render", EMPTY_DIMENSION, renderer.getPreferredSize()); assertTrue(renderer.render((Graphics2D)image.getGraphics())); assertNotEquals(EMPTY_DIMENSION, renderer.getPreferredSize()); renderer.setSize(new Dimension(50, 50)); assertTrue(renderer.render((Graphics2D)image.getGraphics())); }

Target:
public void testInflateAndRender() throws InitializationException, ParserConfigurationException, IOException, SAXException { VirtualFile layout = myFixture.copyFileToProject("themeEditor/theme_preview_layout.xml", "res/layout/theme_preview_layout.xml"); Configuration configuration = myFacet.getConfigurationManager().getConfiguration(layout); DomPullParser parser = new DomPullParser( DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(layout.getInputStream()).getDocumentElement()); BufferedImage image = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB); GraphicsLayoutRenderer renderer = GraphicsLayoutRenderer.create(configuration, parser, false, false); assertEquals("Expected (0,0) before render", EMPTY_DIMENSION, renderer.getPreferredSize()); assertTrue(renderer.render((Graphics2D)image.getGraphics())); assertNotEquals(EMPTY_DIMENSION, renderer.getPreferredSize()); renderer.setSize(new Dimension(50, 50)); assertTrue(renderer.render((Graphics2D)image.getGraphics())); }
Source:
public void ArticleFeaturesCRUDUser_012_modifyTable( int border, int width, int height, int cellspacing, int cellpadding, Alignment alignment ) { WikiBasePageObject base = new WikiBasePageObject(driver); base.logInCookie(credentials.userName, credentials.password, wikiURL); ArticlePageObject article = base.openRandomArticle(wikiURL); SourceEditModePageObject sourceEditMode = article.openCurrectArticleSourceMode(); sourceEditMode.clearSource(); String table = sourceEditMode.buildTablePropertiesContent( border, width, height, cellspacing, cellpadding, alignment ); sourceEditMode.addContent(table); sourceEditMode.submitArticle(); article.verifyTableBorder(border); article.verifyTableCellspacing(cellspacing); article.verifyTableCellpadding(cellpadding); VisualEditModePageObject visualEditMode = article.goToCurrentArticleEditPage(); visualEditMode.clickPropertiesTableButton(); TableBuilderComponentObject addTable = new TableBuilderComponentObject(driver); addTable.typeBorderSize(border + 10); addTable.typeCellSpacing(cellspacing + 10); addTable.typeCellPadding(cellpadding +10); addTable.submitTable(); visualEditMode.submitArticle(); article.verifyTableBorder(border + 10); article.verifyTableCellspacing(cellspacing + 10); article.verifyTableCellpadding(cellpadding + 10); }

Target:
public void ArticleFeaturesCRUDUser_012_modifyTable( int border, int width, int height, int cellspacing, int cellpadding, Alignment alignment ) { WikiBasePageObject base = new WikiBasePageObject(driver); base.logInCookie(credentials.userName, credentials.password, wikiURL); ArticlePageObject article = base.openRandomArticle(wikiURL); SourceEditModePageObject sourceEditMode = article.openCurrectArticleSourceMode(); sourceEditMode.clearSource(); String table = sourceEditMode.buildTablePropertiesContent( border, width, height, cellspacing, cellpadding, alignment ); sourceEditMode.addContent(table); sourceEditMode.submitArticle(); article.verifyTableBorder(border); article.verifyTableCellspacing(cellspacing); article.verifyTableCellpadding(cellpadding); VisualEditModePageObject visualEditMode = article.goToCurrentArticleEditPage(); visualEditMode.clickPropertiesTableButton(); TableBuilderComponentObject addTable = new TableBuilderComponentObject(driver); addTable.typeBorderSize(border + additionalPropertyValue); addTable.typeCellSpacing(cellspacing + additionalPropertyValue); addTable.typeCellPadding(cellpadding +additionalPropertyValue); addTable.submitTable(); visualEditMode.submitArticle(); article.verifyTableBorder(border + additionalPropertyValue); article.verifyTableCellspacing(cellspacing + additionalPropertyValue); article.verifyTableCellpadding(cellpadding + additionalPropertyValue); }
Source:
public Mono<Key> createKey(KeyCreateOptions keyCreateOptions) { return withContext(context -> createKey(keyCreateOptions, context)) .flatMap(keyResponse -> Mono.justOrEmpty(keyResponse.value())); }

Target:
public Mono<Key> createKey(KeyCreateOptions keyCreateOptions) { return withContext(context -> createKeyWithResponse(keyCreateOptions)) .flatMap(FluxUtil::toMono); }
Source:
public void onBindParentViewHolder(ParentViewHolder parentViewHolder, int position) { CustomParentViewHolder customParentViewHolder = (CustomParentViewHolder) parentViewHolder; CustomParentObject parentObject = (CustomParentObject) mItemList.get(position); customParentViewHolder.numberText.setText(parentObject.getNumber() + ""); customParentViewHolder.dataText.setText(parentObject.getData()); }

Target:
public void onBindParentViewHolder(ParentViewHolder parentViewHolder, int position) { CustomParentViewHolder customParentViewHolder = (CustomParentViewHolder) parentViewHolder; CustomParentObject parentObject = (CustomParentObject) mItemList.get(position); customParentViewHolder.numberText.setText(Integer.toString(parentObject.getNumber())); customParentViewHolder.dataText.setText(parentObject.getData()); }
Source:
public void setPortParameters(SerialPortParameters parameters) throws XBeeException, InvalidOperatingModeException { baudRate = parameters.baudrate; this.parameters = parameters; if (isConnected()) { disconnect(); connect(); } }

Target:
public void setPortParameters(SerialPortParameters parameters) throws XBeeException, InvalidOperatingModeException { if (parameters == null) throw new NullPointerException("Serial port parameters cannot be null."); baudRate = parameters.baudrate; this.parameters = parameters; if (isOpen()) { close(); open(); } }
Source:
public SnipeData(Sniper vs) { owner = vs; voxelState = Sponge.getRegistry().getType(BlockState.class, VoxelSniperConfiguration.DEFAULT_VOXEL_ID) .orElse(BlockTypes.AIR.getDefaultState()); replaceState = Sponge.getRegistry().getType(BlockState.class, VoxelSniperConfiguration.DEFAULT_REPLACE_ID) .orElse(BlockTypes.AIR.getDefaultState()); brushSize = VoxelSniperConfiguration.DEFAULT_BRUSH_SIZE; voxelList = new VoxelList(); voxelHeight = VoxelSniperConfiguration.DEFAULT_VOXEL_HEIGHT; cCen = VoxelSniperConfiguration.DEFAULT_CYLINDER_CENTER; range = 0; ranged = false; lightning = false; voxelInkTraits = new HashMap<>(); replaceInkTraits = new HashMap<>(); }

Target:
public SnipeData(Sniper vs) { this.owner = vs; this.voxelState = Sponge.getRegistry().getType(BlockState.class, VoxelSniperConfiguration.DEFAULT_VOXEL_ID) .orElse(BlockTypes.AIR.getDefaultState()); this.replaceState = Sponge.getRegistry().getType(BlockState.class, VoxelSniperConfiguration.DEFAULT_REPLACE_ID) .orElse(BlockTypes.AIR.getDefaultState()); this.brushSize = VoxelSniperConfiguration.DEFAULT_BRUSH_SIZE; this.voxelList = new VoxelList(); this.voxelHeight = VoxelSniperConfiguration.DEFAULT_VOXEL_HEIGHT; this.cylinderCenter = VoxelSniperConfiguration.DEFAULT_CYLINDER_CENTER; this.range = 0; voxelInkTraits = new HashMap<>(); replaceInkTraits = new HashMap<>(); }
Source:
public void deleteCreatedStacks() { dashboard.selectStacksItemOnDashboard(); stacks.waitToolbarTitleName(); stacks.selectAllStacksByBulk(); stacks.clickOnDeleteStackButton(); stacks.clickOnDeleteDialogButton(); dashboard.waitNotificationMessage("Selected stacks have been successfully removed."); dashboard.waitNotificationIsClosed(); }

Target:
public void deleteCreatedStacks() { dashboard.selectStacksItemOnDashboard(); stacks.waitToolbarTitleName(); stacks.selectAllStacksByBulk(); if (stacks.isDeleteStackButtonEnabled()) { stacks.clickOnDeleteStackButton(); stacks.clickOnDeleteDialogButton(); dashboard.waitNotificationMessage("Selected stacks have been successfully removed."); dashboard.waitNotificationIsClosed(); } }
Source:
public void testContainsKeyNull() throws Exception { final MockStore realStore = new MockStore(Collections.<String, String>emptyMap()); this.store = spy(realStore); final Ehcache<String, String> ehcache = this.getEhcache(); try { ehcache.containsKey(null); fail(); } catch (Exception e) { } verifyZeroInteractions(this.cacheLoader); verifyZeroInteractions(this.cacheWriter); verifyZeroInteractions(this.spiedResilienceStrategy); }

Target:
public void testContainsKeyNull() throws Exception { final FakeStore realStore = new FakeStore(Collections.<String, String>emptyMap()); this.store = spy(realStore); final Ehcache<String, String> ehcache = this.getEhcache(); try { ehcache.containsKey(null); fail(); } catch (NullPointerException e) { } verifyZeroInteractions(this.cacheLoader); verifyZeroInteractions(this.cacheWriter); verifyZeroInteractions(this.spiedResilienceStrategy); }
Source:
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if ("equals".equals(method.getName())) { try { Object otherHandler = args.length > 0 && args[0] != null ? Proxy.getInvocationHandler(args[0]) : null; return equals(otherHandler); } catch (IllegalArgumentException e) { return false; } } else if ("hashCode".equals(method.getName())) { return hashCode(); } else if ("toString".equals(method.getName())) { return toString(); } else if (Util.isDefault(method)) { return invokeDefault(proxy,method, args); } return dispatch.get(method).invoke(args); }

Target:
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if ("equals".equals(method.getName())) { try { Object otherHandler = args.length > 0 && args[0] != null ? Proxy.getInvocationHandler(args[0]) : null; return equals(otherHandler); } catch (IllegalArgumentException e) { return false; } } else if ("hashCode".equals(method.getName())) { return hashCode(); } else if ("toString".equals(method.getName())) { return toString(); } return dispatch.get(method).invoke(args); }
Source:
private static boolean isEnclosingClassFinal(ExpressionTree expressionTree) { if (expressionTree.is(IDENTIFIER)) { Tree parent = expressionTree.parent(); while (!parent.is(METHOD)) { parent = parent.parent(); } return ((MethodTree) parent).symbol().owner().isFinal(); } else { return ((MemberSelectExpressionTree) expressionTree).expression().symbolType().symbol().isFinal(); } }

Target:
private static boolean isEnclosingClassFinal(ExpressionTree expressionTree) { if (expressionTree.is(IDENTIFIER)) { Tree parent = expressionTree.parent(); while (!parent.is(METHOD)) { parent = parent.parent(); } return ((MethodTree) parent).symbol().owner().isFinal(); } return ((MemberSelectExpressionTree) expressionTree).expression().symbolType().symbol().isFinal(); }