auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void main(String[] args) throws Exception { int labelIndex = 4; int numClasses = 3; int batchSizeTraining = 30; DataSet trainingData = readCSVDataset( "/DataExamples/animals/animals_train.csv", batchSizeTraining, labelIndex, numClasses); int batchSizeTest = 44; DataSet testData = readCSVDataset("/DataExamples/animals/animals.csv", batchSizeTest, labelIndex, numClasses); Map<Integer, Map<String, Object>> animals = makeAnimalsForTesting(testData); DataNormalization normalizer = new NormalizerStandardize(); normalizer.fit(trainingData); normalizer.transform(trainingData); normalizer.transform(testData); final int numInputs = 4; int outputNum = 3; int epochs = 1000; long seed = 6; LOGGER.info("Build model...."); MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder() .seed(seed) .activation(Activation.TANH) .weightInit(WeightInit.XAVIER) .updater(new Sgd(0.1)) .l2(1e-4) .list() .layer(new DenseLayer.Builder() .nIn(numInputs) .nOut(3) .build()) .layer(new DenseLayer .Builder() .nIn(3) .nOut(3) .build()) .layer(new OutputLayer.Builder(LossFunctions.LossFunction.NEGATIVELOGLIKELIHOOD) .activation(Activation.SOFTMAX) .nIn(3) .nOut(outputNum).build()) .build(); MultiLayerNetwork model = new MultiLayerNetwork(conf); model.init(); model.setListeners(new ScoreIterationListener(100)); for( int i=0; i<epochs; i++ ) { model.fit(trainingData); } Evaluation eval = new Evaluation(3); INDArray output = model.output(testData.getFeatures()); eval.eval(testData.getLabels(), output); LOGGER.info(eval.stats()); setFittedClassifiers(output, animals); logAnimals(animals); }

Target:
public static void main(String[] args) throws Exception { int labelIndex = 4; int numClasses = 3; int batchSizeTraining = 30; DataSet trainingData = readCSVDataset( "/DataExamples/animals/animals_train.csv", batchSizeTraining, labelIndex, numClasses); int batchSizeTest = 44; DataSet testData = readCSVDataset("/DataExamples/animals/animals.csv", batchSizeTest, labelIndex, numClasses); Map<Integer, Map<String, Object>> animals = makeAnimalsForTesting(testData); DataNormalization normalizer = new NormalizerStandardize(); normalizer.fit(trainingData); normalizer.transform(trainingData); normalizer.transform(testData); final int numInputs = 4; int outputNum = 3; int epochs = 1000; long seed = 6; log.info("Build model...."); MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder() .seed(seed) .activation(Activation.TANH) .weightInit(WeightInit.XAVIER) .updater(new Sgd(0.1)) .l2(1e-4) .list() .layer(new DenseLayer.Builder() .nIn(numInputs) .nOut(3) .build()) .layer(new DenseLayer .Builder() .nOut(3) .build()) .layer(new OutputLayer.Builder(LossFunctions.LossFunction.NEGATIVELOGLIKELIHOOD) .activation(Activation.SOFTMAX) .nOut(outputNum).build()) .build(); MultiLayerNetwork model = new MultiLayerNetwork(conf); model.init(); model.setListeners(new ScoreIterationListener(100)); for( int i=0; i<epochs; i++ ) { model.fit(trainingData); } Evaluation eval = new Evaluation(3); INDArray output = model.output(testData.getFeatures()); eval.eval(testData.getLabels(), output); log.info(eval.stats()); setFittedClassifiers(output, animals); logAnimals(animals); }
Source:
private void parseSni(final XMLExtendedStreamReader reader, final ModelNode encryption, final List<ModelNode> operations) throws XMLStreamException { ParseUtils.requireAttributes(reader, Attribute.HOST_NAME.getLocalName(), Attribute.SECURITY_REALM.getLocalName()); String hostName = reader.getAttributeValue(null, Attribute.HOST_NAME.getLocalName()); PathAddress sniOpAddress = PathAddress.pathAddress(encryption.get(OP_ADDR)).append(ModelKeys.SNI, hostName); ModelNode sniOp = Util.createAddOperation(sniOpAddress); SniResource.HOST_NAME.parseAndSetParameter(hostName, sniOp, reader); String securityRealm = reader.getAttributeValue(null, Attribute.SECURITY_REALM.getLocalName()); SniResource.SECURITY_REALM.parseAndSetParameter(securityRealm, sniOp, reader); ParseUtils.requireNoContent(reader); operations.add(sniOp); }

Target:
private void parseSni(final XMLExtendedStreamReader reader, final ModelNode encryption, final List<ModelNode> operations) throws XMLStreamException { ParseUtils.requireAttributes(reader, Attribute.HOST_NAME.getLocalName()); String hostName = reader.getAttributeValue(null, Attribute.HOST_NAME.getLocalName()); PathAddress sniOpAddress = PathAddress.pathAddress(encryption.get(OP_ADDR)).append(ModelKeys.SNI, hostName); ModelNode sniOp = Util.createAddOperation(sniOpAddress); SniResource.HOST_NAME.parseAndSetParameter(hostName, sniOp, reader); String securityRealm = reader.getAttributeValue(null, Attribute.SECURITY_REALM.getLocalName()); SniResource.SECURITY_REALM.parseAndSetParameter(securityRealm, sniOp, reader); ParseUtils.requireNoContent(reader); operations.add(sniOp); }
Source:
public static @Nullable TmfCallsite getSourceCallsite(LttngUstTrace trace, BinaryCallsite bc) { Iterable<TmfCallsite> callsites = FileOffsetMapper.getCallsiteFromOffset(new File(bc.getBinaryFilePath()), bc.getOffset()); if (callsites == null || Iterables.isEmpty(callsites)) { return null; } TmfCallsite callsite = Iterables.getLast(callsites); String pathPrefix = trace.getSymbolProviderConfig().getActualRootDirPath(); if (pathPrefix == "") { return callsite; } String fullFileName = (pathPrefix + callsite.getFileName()); return new TmfCallsite(fullFileName, callsite.getFunctionName(), callsite.getLineNumber()); }

Target:
public static @Nullable TmfCallsite getSourceCallsite(LttngUstTrace trace, BinaryCallsite bc) { Iterable<TmfCallsite> callsites = FileOffsetMapper.getCallsiteFromOffset(new File(bc.getBinaryFilePath()), bc.getOffset()); if (callsites == null || Iterables.isEmpty(callsites)) { return null; } TmfCallsite callsite = Iterables.getLast(callsites); String pathPrefix = trace.getSymbolProviderConfig().getActualRootDirPath(); if (pathPrefix.isEmpty()) { return callsite; } String fullFileName = (pathPrefix + callsite.getFileName()); return new TmfCallsite(fullFileName, callsite.getFunctionName(), callsite.getLineNumber()); }
Source:
public EventRegistration registerLocalListener(@Nonnull String serviceName, @Nonnull String topic, @Nonnull EventFilter filter, @Nonnull Object listener) { return registerListenerInternalLocally(serviceName, topic, filter, listener, true); }

Target:
public EventRegistration registerLocalListener(@Nonnull String serviceName, @Nonnull String topic, @Nonnull EventFilter filter, @Nonnull Object listener) { return registerListener0(serviceName, topic, filter, listener, true); }
Source:
public void deregisterCacheEventListener(CacheEventListener<? super K, ? super V> listener) { EventListenerWrapper wrapper = new EventListenerWrapper(listener, EventFiring.ASYNCHRONOUS, EventOrdering.UNORDERED, EnumSet.allOf(EventType.class)); boolean removed = false; for (EventListenerWrapper listenerWrapper : aSyncListenersSet) { if(listenerWrapper.equals(wrapper)) { aSyncListenersSet.remove(listenerWrapper); removed = true; if(listenerWrapper.config.orderingMode() == EventOrdering.ORDERED) { orderedListenerCount.decrementAndGet(); } break; } } if (!removed) { for (EventListenerWrapper listenerWrapper : syncListenersSet) { if(listenerWrapper.equals(wrapper)) { syncListenersSet.remove(listenerWrapper); removed = true; if(listenerWrapper.config.orderingMode() == EventOrdering.ORDERED) { orderedListenerCount.decrementAndGet(); } break; } } } if (!hasListeners()) { synchronized (this) { if (eventThreadLocal instanceof EventThreadLocalImpl) { eventThreadLocal = new NoOpEventThreadLocalImpl(); } } store.disableStoreEventNotifications(); } if(!removed) { throw new IllegalStateException("Unknown cache event listener: " + listener); } }

Target:
public void deregisterCacheEventListener(CacheEventListener<? super K, ? super V> listener) { EventListenerWrapper wrapper = new EventListenerWrapper(listener, EventFiring.ASYNCHRONOUS, EventOrdering.UNORDERED, EnumSet.allOf(EventType.class)); boolean removed = false; for (EventListenerWrapper listenerWrapper : aSyncListenersSet) { if(listenerWrapper.equals(wrapper)) { aSyncListenersSet.remove(listenerWrapper); removed = true; if(listenerWrapper.config.orderingMode() == EventOrdering.ORDERED) { orderedListenerCount.decrementAndGet(); } break; } } if (!removed) { for (EventListenerWrapper listenerWrapper : syncListenersSet) { if(listenerWrapper.equals(wrapper)) { syncListenersSet.remove(listenerWrapper); removed = true; if(listenerWrapper.config.orderingMode() == EventOrdering.ORDERED) { orderedListenerCount.decrementAndGet(); } break; } } } synchronized (this) { if (!hasListeners()) { if (eventThreadLocal instanceof EventThreadLocalImpl) { eventThreadLocal = new NoOpEventThreadLocalImpl(); } store.disableStoreEventNotifications(); } } if(!removed) { throw new IllegalStateException("Unknown cache event listener: " + listener); } }
Source:
public void initialize() { var gameSorter = Comparator.comparing( (Game game) -> game.getStartTime(), Comparator.nullsFirst(Comparator.naturalOrder())) .reversed(); initializeGameTable(gameService.getGames() .filtered(game -> game.getStatus() == GameStatus.PLAYING) .sorted(gameSorter)); }

Target:
public void initialize() { Comparator gameSorter = Comparator.comparing( (Game game) -> game.getStartTime(), Comparator.nullsFirst(Comparator.naturalOrder())) .reversed(); initializeGameTable(gameService.getGames() .filtered(game -> game.getStatus() == GameStatus.PLAYING) .sorted(gameSorter)); }
Source:
public void setUp() throws Exception { factoryPath = TestUtils.createTempTestingDir(AbstractIndexTestBase.class.getName()); assertThat(factoryPath, is(notNullValue())); factory = DatastoreManager.getInstance(factoryPath); assertThat(factory, is(notNullValue())); ds = (DatastoreImpl) factory.openDatastore(AbstractIndexTestBase.class.getSimpleName()); assertThat(ds, is(notNullValue())); im = new IndexManager(ds); assertThat(im, is(notNullValue())); assertThat(im.getDatabaseQueue(), is(notNullValue())); String[] metadataTableList = new String[] { IndexManager.INDEX_METADATA_TABLE_NAME }; SQLDatabaseTestUtils.assertTablesExist(im.getDatabaseQueue(), metadataTableList); }

Target:
public void setUp() throws Exception { factoryPath = TestUtils.createTempTestingDir(AbstractIndexTestBase.class.getName()); assertThat(factoryPath, is(notNullValue())); factory = DatastoreManager.getInstance(factoryPath); assertThat(factory, is(notNullValue())); ds = (DatastoreImpl) factory.openDatastore(AbstractIndexTestBase.class.getSimpleName()); assertThat(ds, is(notNullValue())); im = new IndexManager(ds); assertThat(im, is(notNullValue())); indexManagerDatabaseQueue = TestUtils.getDBQueue(im); assertThat(indexManagerDatabaseQueue, is(notNullValue())); String[] metadataTableList = new String[] { IndexManager.INDEX_METADATA_TABLE_NAME }; SQLDatabaseTestUtils.assertTablesExist(indexManagerDatabaseQueue, metadataTableList); }
Source:
private int getAndSetNetworkTimeout(final Connection connection, final long timeoutMs) { if (isNetworkTimeoutSupported != FALSE) { try { final int originalTimeout = connection.getNetworkTimeout(); connection.setNetworkTimeout(netTimeoutExecutor, (int) timeoutMs); isNetworkTimeoutSupported = TRUE; return originalTimeout; } catch (Throwable e) { if (isNetworkTimeoutSupported == UNINITIALIZED) { isNetworkTimeoutSupported = FALSE; LOGGER.warn("{} - Failed to get/set network timeout for connection. ({})", poolName, e.getMessage()); if (validationTimeout < SECONDS.toMillis(1)) { LOGGER.warn("{} - A validationTimeout of less than 1 second cannot be honored on drivers without setNetworkTimeout() support.", poolName); } } } } return 0; }

Target:
private int getAndSetNetworkTimeout(final Connection connection, final long timeoutMs) { if (isNetworkTimeoutSupported != FALSE) { try { final int originalTimeout = connection.getNetworkTimeout(); connection.setNetworkTimeout(netTimeoutExecutor, (int) timeoutMs); isNetworkTimeoutSupported = TRUE; return originalTimeout; } catch (Throwable e) { if (isNetworkTimeoutSupported == UNINITIALIZED) { isNetworkTimeoutSupported = FALSE; LOGGER.info("{} - Failed to get/set network timeout for connection. ({})", poolName, e.getMessage()); if (validationTimeout < SECONDS.toMillis(1)) { LOGGER.info("{} - A validationTimeout of less than 1 second cannot be honored on drivers without setNetworkTimeout() support.", poolName); } } } } return 0; }
Source:
public BigMoney getWrapped() { return wrapped; }

Target:
private BigMoney getWrapped() { return wrapped; }
Source:
public String prettyPrintJournal() { StringBuilder sb = new StringBuilder(); for (int i = 0; i < journal.size(); i++) { StatusJournalEntry je = journal.get(i); sb.append(je.toString()); if (i != 0) { StatusJournalEntry jep = journal.get(i-1); long delta = je.getTimeStamp() - jep.getTimeStamp(); if (delta != 0) { sb.append(" (+" + delta + " ms)"); } } sb.append("\n"); } return sb.toString(); }

Target:
public String prettyPrintJournal() { if (!journalEnabled) { return ""; } StringBuilder sb = new StringBuilder(); for (int i = 0; i < journal.size(); i++) { StatusJournalEntry je = journal.get(i); sb.append(je.toString()); if (i != 0) { StatusJournalEntry jep = journal.get(i-1); long delta = je.getTimeStamp() - jep.getTimeStamp(); if (delta != 0) { sb.append(" (+" + delta + " ms)"); } } sb.append("\n"); } return sb.toString(); }
Source:
private static String getArtist(ExtMetadata metadata) { try { final String anchorStartTagTerminalChars = "\">"; final String anchorCloseTag = "</a>"; String artistHtml = metadata.artist(); return artistHtml .substring( artistHtml.indexOf(anchorStartTagTerminalChars), artistHtml.indexOf(anchorCloseTag) ) .substring(anchorStartTagTerminalChars.length()); } catch (Exception ex) { return ""; } }

Target:
private static String getArtist(ExtMetadata metadata) { try { final String anchorStartTagTerminalChars = "\">"; final String anchorCloseTag = "</a>"; String artistHtml = metadata.artist(); return artistHtml .substring( artistHtml.indexOf(anchorStartTagTerminalChars) + anchorStartTagTerminalChars.length(), artistHtml.indexOf(anchorCloseTag) ); } catch (Exception ex) { return ""; } }
Source:
public void start() { synchronized (lock) { if (!started) { log.info("OverlordHelperManager is starting."); for (OverlordHelper helper : helpers) { if (helper.isEnabled()) { if (exec == null) { exec = execFactory.create(1, "Overlord-Helper-Manager-Exec--%d"); } helper.schedule(exec); } } started = true; log.info("OverlordHelperManager is started."); } } }

Target:
public void start() { synchronized (startStopLock) { if (!started) { log.info("OverlordHelperManager is starting."); for (OverlordHelper helper : helpers) { if (helper.isEnabled()) { if (exec == null) { exec = execFactory.create(1, "Overlord-Helper-Manager-Exec--%d"); } helper.schedule(exec); } } started = true; log.info("OverlordHelperManager is started."); } } }
Source:
public boolean isSatisfied() { if (this.profileTypeRegistry == null) { return false; } return true; }

Target:
public boolean isSatisfied() { return this.profileTypeRegistry != null; }
Source:
private CompletableFuture<QueueDescription> putQueueAsync(QueueDescription queueDescription, boolean isUpdate) { if (queueDescription == null) { throw new IllegalArgumentException("queueDescription passed cannot be null."); } QueueDescriptionSerializer.normalizeDescription(queueDescription, this.namespaceEndpointURI); String atomRequest = null; try { atomRequest = QueueDescriptionSerializer.serialize(queueDescription); } catch (ServiceBusException e) { final CompletableFuture<QueueDescription> exceptionFuture = new CompletableFuture<>(); exceptionFuture.completeExceptionally(e); return exceptionFuture; } CompletableFuture<QueueDescription> responseFuture = new CompletableFuture<>(); putEntityAsync(queueDescription.path, atomRequest, isUpdate, queueDescription.getForwardTo(), queueDescription.getForwardDeadLetteredMessagesTo()) .handleAsync((content, ex) -> { if (ex != null) { responseFuture.completeExceptionally(ex); } else { try { responseFuture.complete(QueueDescriptionSerializer.parseFromContent(content)); } catch (MessagingEntityNotFoundException e) { responseFuture.completeExceptionally(e); } } return null; }, MessagingFactory.INTERNAL_THREAD_POOL); return responseFuture; }

Target:
private CompletableFuture<QueueDescription> putQueueAsync(QueueDescription queueDescription, boolean isUpdate) { if (queueDescription == null) { throw new IllegalArgumentException("queueDescription passed cannot be null"); } QueueDescriptionSerializer.normalizeDescription(queueDescription, this.namespaceEndpointURI); String atomRequest = null; try { atomRequest = QueueDescriptionSerializer.serialize(queueDescription); } catch (ServiceBusException e) { final CompletableFuture<QueueDescription> exceptionFuture = new CompletableFuture<>(); exceptionFuture.completeExceptionally(e); return exceptionFuture; } CompletableFuture<QueueDescription> responseFuture = new CompletableFuture<>(); putEntityAsync(queueDescription.path, atomRequest, isUpdate, queueDescription.getForwardTo(), queueDescription.getForwardDeadLetteredMessagesTo()) .handleAsync((content, ex) -> { if (ex != null) { responseFuture.completeExceptionally(ex); } else { try { responseFuture.complete(QueueDescriptionSerializer.parseFromContent(content)); } catch (MessagingEntityNotFoundException e) { responseFuture.completeExceptionally(e); } } return null; }, MessagingFactory.INTERNAL_THREAD_POOL); return responseFuture; }
Source:
public static double calculatePosteriorMode(final List<Double> samples, final JavaSparkContext ctx) { Utils.nonNull(samples); Utils.validateArg(samples.size() > 0, "Number of samples must be greater than zero."); final double sampleMin = Collections.min(samples); final double sampleMax = Collections.max(samples); final double sampleMean = new Mean().evaluate(Doubles.toArray(samples)); final double sampleStandardDeviation = new StandardDeviation().evaluate(Doubles.toArray(samples)); if (sampleStandardDeviation == 0.0 || Double.isNaN(sampleMean)) { return sampleMean; } final double bandwidth = 1.06 * sampleStandardDeviation * Math.pow(samples.size(), -0.2); final KernelDensity pdf = new KernelDensity().setSample(ctx.parallelize(samples, 1)).setBandwidth(bandwidth); final BrentOptimizer optimizer = new BrentOptimizer(RELATIVE_TOLERANCE, RELATIVE_TOLERANCE * (sampleMax - sampleMin)); final UnivariateObjectiveFunction objective = new UnivariateObjectiveFunction(f -> pdf.estimate(new double[] {f})[0]); final SearchInterval searchInterval = new SearchInterval(sampleMin, sampleMax, sampleMean); return optimizer.optimize(objective, GoalType.MAXIMIZE, searchInterval, BRENT_MAX_EVAL).getPoint(); }

Target:
public static double calculatePosteriorMode(final List<Double> samples, final JavaSparkContext ctx) { Utils.nonNull(samples); Utils.validateArg(samples.size() > 0, "Number of samples must be greater than zero."); final double sampleMin = Collections.min(samples); final double sampleMax = Collections.max(samples); final double sampleMean = new Mean().evaluate(Doubles.toArray(samples)); final double sampleStandardDeviation = new StandardDeviation().evaluate(Doubles.toArray(samples)); if (sampleStandardDeviation == 0. || Double.isNaN(sampleMean)) { return sampleMean; } final double bandwidth = SILVERMANS_RULE_CONSTANT * sampleStandardDeviation * Math.pow(samples.size(), SILVERMANS_RULE_EXPONENT); final KernelDensity pdf = new KernelDensity().setSample(ctx.parallelize(samples, 1)).setBandwidth(bandwidth); final BrentOptimizer optimizer = new BrentOptimizer(RELATIVE_TOLERANCE, RELATIVE_TOLERANCE * (sampleMax - sampleMin)); final UnivariateObjectiveFunction objective = new UnivariateObjectiveFunction(f -> pdf.estimate(new double[] {f})[0]); final SearchInterval searchInterval = new SearchInterval(sampleMin, sampleMax, sampleMean); return optimizer.optimize(objective, GoalType.MAXIMIZE, searchInterval, BRENT_MAX_EVAL).getPoint(); }
Source:
protected void validatePorts() { for (PortType portType : ports.keySet()) { int portNo = ports.get(portType); if (portNo < MinPort) { throw new IllegalStateException("Invalid " + portType + " port : " + portNo + " is less than " + MinPort); } else if (portNo > MaxPort) { throw new IllegalStateException("Invalid " + portType + " port : " + portNo + " is greater than " + MaxPort); } } }

Target:
protected void validatePorts() { Set<Integer> portNumbers = new HashSet<Integer>(); for (PortType portType : ports.keySet()) { int portNo = ports.get(portType); if (portNumbers.contains(portNo)) { throw new IllegalStateException("Same port number " + portNo + " found for two port types"); } portNumbers.add(portNo); if (portNo < MinPort) { throw new IllegalStateException("Invalid " + portType + " port : " + portNo + " is less than " + MinPort); } else if (portNo > MaxPort) { throw new IllegalStateException("Invalid " + portType + " port : " + portNo + " is greater than " + MaxPort); } } }
Source:
public void handleInvocation(EJBClientInvocationContext context) throws Exception { log.info("In the client interceptor handleInvocation : " + this.getClass().getName() + " " + context.getViewClass() + " " + context.getLocator()); context.getContextData().put("ClientInterceptorInvoked", this.getClass().getName() + " " + context.getViewClass() + " " + context.getLocator()); log.info("Added to contextData: ClientInterceptorInvoked => " + this.getClass().getName() + " " + context.getViewClass() + " " + context.getLocator()); if(context.getParameters().length > 0) { String id = (String) context.getParameters()[0]; String interceptorInvocationCounterKey = id + "-COUNT"; Integer count = (Integer) context.getContextData().get(interceptorInvocationCounterKey); if(count == null) count = 0; count++; context.getContextData().put(interceptorInvocationCounterKey, count); } context.sendRequest(); }

Target:
public void handleInvocation(EJBClientInvocationContext context) throws Exception { context.getContextData().put("ClientInterceptorInvoked", this.getClass().getName() + " " + context.getViewClass() + " " + context.getLocator()); if(context.getParameters().length > 0) { String id = (String) context.getParameters()[0]; String interceptorInvocationCounterKey = id + "-COUNT"; Integer count = (Integer) context.getContextData().get(interceptorInvocationCounterKey); if(count == null) count = 0; count++; context.getContextData().put(interceptorInvocationCounterKey, count); } context.sendRequest(); }
Source:
public void sweepCells( TableReference tableRef, Multimap<Cell, Long> cellTsPairsToSweep, Collection<Cell> sentinelsToAdd) { if (cellTsPairsToSweep.isEmpty()) { return; } for (Follower follower : followers) { follower.run(txManager, tableRef, cellTsPairsToSweep.keySet(), Transaction.TransactionType.HARD_DELETE); } if (!sentinelsToAdd.isEmpty()) { keyValueService.addGarbageCollectionSentinelValues( tableRef, sentinelsToAdd); } if (cellTsPairsToSweep.entries().stream().anyMatch(entry -> entry.getValue() == null)) { log.error("When sweeping table found cells to sweep with the start timestamp null." + " This is unexpected. The cellTs pairs to sweep were: {}.", SafeArg.of("tableRef", LoggingArgs.tableRef(tableRef)), UnsafeArg.of("cellTsPairsToSweep", getLoggingMessageFromMap(cellTsPairsToSweep))); } persistentLockManager.acquirePersistentLockWithRetry(); try { keyValueService.delete(tableRef, cellTsPairsToSweep); } finally { persistentLockManager.releasePersistentLock(); } }

Target:
public void sweepCells( TableReference tableRef, Multimap<Cell, Long> cellTsPairsToSweep, Collection<Cell> sentinelsToAdd) { if (cellTsPairsToSweep.isEmpty()) { return; } for (Follower follower : followers) { follower.run(txManager, tableRef, cellTsPairsToSweep.keySet(), Transaction.TransactionType.HARD_DELETE); } if (!sentinelsToAdd.isEmpty()) { keyValueService.addGarbageCollectionSentinelValues( tableRef, sentinelsToAdd); } if (cellTsPairsToSweep.entries().stream().anyMatch(entry -> entry.getValue() == null)) { log.error("When sweeping table found cells to sweep with the start timestamp null." + " This is unexpected. The cellTs pairs to sweep were: {}.", LoggingArgs.tableRef(tableRef), getLoggingArgForCells(tableRef, cellTsPairsToSweep)); } persistentLockManager.acquirePersistentLockWithRetry(); try { keyValueService.delete(tableRef, cellTsPairsToSweep); } finally { persistentLockManager.releasePersistentLock(); } }
Source:
public void shouldReadWriteSelfLoopingEdges() throws Exception { final Configuration sourceConf = graphProvider.newGraphConfiguration("source", this.getClass(), name.getMethodName(), null); final Graph source = GraphFactory.open(sourceConf); final Vertex v1 = source.addVertex(); final Vertex v2 = source.addVertex(); v1.addEdge("CONTROL", v2); v1.addEdge("SELF-LOOP", v1); final Configuration targetConf = graphProvider.newGraphConfiguration("target", this.getClass(), name.getMethodName(), null); final Graph target = GraphFactory.open(targetConf); try (ByteArrayOutputStream os = new ByteArrayOutputStream()) { source.io(IoCore.graphml()).writer().create().writeGraph(os, source); try (ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray())) { target.io(IoCore.graphml()).reader().create().readGraph(is, target); } } catch (IOException ioe) { throw new RuntimeException(ioe); } assertEquals(IteratorUtils.count(source.vertices()), IteratorUtils.count(target.vertices())); assertEquals(IteratorUtils.count(source.edges()), IteratorUtils.count(target.edges())); }

Target:
public void shouldReadWriteSelfLoopingEdges() throws Exception { final Graph source = graph; final Vertex v1 = source.addVertex(); final Vertex v2 = source.addVertex(); v1.addEdge("CONTROL", v2); v1.addEdge("SELF-LOOP", v1); final Configuration targetConf = graphProvider.newGraphConfiguration("target", this.getClass(), name.getMethodName(), null); final Graph target = GraphFactory.open(targetConf); try (ByteArrayOutputStream os = new ByteArrayOutputStream()) { source.io(IoCore.graphml()).writer().create().writeGraph(os, source); try (ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray())) { target.io(IoCore.graphml()).reader().create().readGraph(is, target); } } catch (IOException ioe) { throw new RuntimeException(ioe); } assertEquals(IteratorUtils.count(source.vertices()), IteratorUtils.count(target.vertices())); assertEquals(IteratorUtils.count(source.edges()), IteratorUtils.count(target.edges())); }
Source:
private TableFeed getTableFeed(final String feedName, final String tableName, final String clusterName) throws FalconException { JSONObject tableExtendedProperties = getTableExtendedProperties(tableName); String tableFeedName; String partitions; try { tableFeedName = tableExtendedProperties.getString(ADFJsonConstants.ADF_REQUEST_TABLE_NAME); if (StringUtils.isBlank(tableFeedName)) { throw new FalconException("JSON object " + ADFJsonConstants.ADF_REQUEST_TABLE_NAME + " cannot" + " be empty in ADF request."); } partitions = tableExtendedProperties.getString(ADFJsonConstants.ADF_REQUEST_TABLE_PARTITION); if (StringUtils.isBlank(partitions)) { throw new FalconException("JSON object " + ADFJsonConstants.ADF_REQUEST_TABLE_PARTITION + " cannot" + " be empty in ADF request."); } } catch (JSONException e) { throw new FalconException("Error when parsing ADF JSON message: " + tableExtendedProperties, e); } return new TableFeed.Builder().withFeedName(feedName).withFrequency(frequency) .withClusterName(clusterName).withStartTime(startTime).withEndTime(endTime). withAclOwner(proxyUser).withTableName(tableFeedName).withPartitions(partitions).build(); }

Target:
private TableFeed getTableFeed(final String feedName, final String tableName, final String clusterName) throws FalconException { JSONObject tableExtendedProperties = getTableExtendedProperties(tableName); String tableFeedName; String partitions; try { tableFeedName = tableExtendedProperties.getString(ADFJsonConstants.ADF_REQUEST_TABLE_NAME); if (StringUtils.isBlank(tableFeedName)) { throw new FalconException("JSON object " + ADFJsonConstants.ADF_REQUEST_TABLE_NAME + " cannot" + " be empty in ADF request."); } partitions = tableExtendedProperties.getString(ADFJsonConstants.ADF_REQUEST_TABLE_PARTITION); if (StringUtils.isBlank(partitions)) { throw new FalconException("JSON object " + ADFJsonConstants.ADF_REQUEST_TABLE_PARTITION + " cannot" + " be empty in ADF request."); } } catch (JSONException e) { throw new FalconException("Error while parsing ADF JSON message: " + tableExtendedProperties, e); } return new TableFeed.Builder().withFeedName(feedName).withFrequency(frequency) .withClusterName(clusterName).withStartTime(startTime).withEndTime(endTime). withAclOwner(proxyUser).withTableName(tableFeedName).withPartitions(partitions).build(); }
Source:
public void testRefreshDoesntHang() throws Exception, TimeoutException { long start = HeaderCacheElement.TOKEN_STALENESS_MS * 10; setTime(start); final long expiration = start + HeaderCacheElement.TOKEN_EXPIRES_MS + 1; final Object lock = new String(""); Mockito.when(credentials.refreshAccessToken()).thenAnswer(new Answer<AccessToken>() { @Override public AccessToken answer(InvocationOnMock invocation) throws Throwable { synchronized (lock) { lock.wait(); } return new AccessToken("", new Date(expiration)); } }); Callable<Void> syncRefreshCallable = new Callable<Void>() { @Override public Void call() throws Exception { underTest.syncRefresh(); return null; } }; underTest = new RefreshingOAuth2CredentialsInterceptor(executorService, credentials, new RetryOptions.Builder().build()); Assert.assertEquals(CacheState.Expired, RefreshingOAuth2CredentialsInterceptor.getCacheState(underTest.headerCache.get())); syncCall(lock, syncRefreshCallable); Assert.assertEquals(CacheState.Stale, RefreshingOAuth2CredentialsInterceptor.getCacheState(underTest.headerCache.get())); Assert.assertFalse(underTest.isRefreshing.get()); underTest.asyncRefresh(); underTest.asyncRefresh(); underTest.asyncRefresh(); syncCall(lock, syncRefreshCallable); Assert.assertFalse(underTest.isRefreshing.get()); }

Target:
public void testRefreshDoesntHang() throws Exception, TimeoutException { long start = HeaderCacheElement.TOKEN_STALENESS_MS * 10; setTimeInMillieconds(start); final long expiration = start + HeaderCacheElement.TOKEN_EXPIRES_MS + 1; final Object lock = new String(""); Mockito.when(credentials.refreshAccessToken()).thenAnswer(new Answer<AccessToken>() { @Override public AccessToken answer(InvocationOnMock invocation) throws Throwable { synchronized (lock) { lock.wait(); } return new AccessToken("", new Date(expiration)); } }); Callable<Void> syncRefreshCallable = new Callable<Void>() { @Override public Void call() throws Exception { underTest.syncRefresh(); return null; } }; underTest = new RefreshingOAuth2CredentialsInterceptor(executorService, credentials, new RetryOptions.Builder().build()); Assert.assertEquals(CacheState.Expired, RefreshingOAuth2CredentialsInterceptor.getCacheState(underTest.headerCache.get())); syncCall(lock, syncRefreshCallable); Assert.assertEquals(CacheState.Stale, RefreshingOAuth2CredentialsInterceptor.getCacheState(underTest.headerCache.get())); Assert.assertFalse(underTest.isRefreshing.get()); underTest.asyncRefresh(); underTest.asyncRefresh(); underTest.asyncRefresh(); syncCall(lock, syncRefreshCallable); Assert.assertFalse(underTest.isRefreshing.get()); }
Source:
public final void updateSessionLastActiveTime(String sessionId) { if (StringUtils.isNotEmpty(sessionId) && isSessionExists(sessionId)) { setData(sessionId, SESSION_LAST_ACTIVE_TIME, new Date()); } }

Target:
public final void updateSessionLastActiveTime(String sessionId) { if (isSessionExists(sessionId)) { setData(sessionId, SESSION_LAST_ACTIVE_TIME, new Date()); } }
Source:
public void executeCommand(UICommand command) { super.executeCommand(command); if(command.equals(getNewSessionCommand())) { createNewGeoRepSession(); } else if(command.equals(getRemoveSessionCommand())) { } else if(command.equals(getStartSessionCommand())) { } else if(command.equals(getStopSessionCommand())) { } else if(command.equals(getSessionOptionsCommand())) { } else if(command.equals(getViewSessionDetailsCommand())) { } else if(command.getName().equalsIgnoreCase("onCreateSession")) { setWindow(null); } else if(command.getName().equalsIgnoreCase("close")) { setWindow(null); } else if(command.getName().equalsIgnoreCase("closeConfirmWindow")) { setConfirmWindow(null); } }

Target:
public void executeCommand(UICommand command) { super.executeCommand(command); if(command.equals(getNewSessionCommand())) { createNewGeoRepSession(); } else if(command.equals(getRemoveSessionCommand())) { } else if(command.equals(getStartSessionCommand())) { } else if(command.equals(getStopSessionCommand())) { } else if(command.equals(getSessionOptionsCommand())) { } else if(command.equals(getViewSessionDetailsCommand())) { } else if (command.equals(getRefreshSessionsCommand())) { refreshSessions(); } else if(command.getName().equalsIgnoreCase("onCreateSession")) { setWindow(null); } else if(command.getName().equalsIgnoreCase("close")) { setWindow(null); } else if(command.getName().equalsIgnoreCase("closeConfirmWindow")) { setConfirmWindow(null); } }
Source:
public void testDumpNonReplDatabase() throws IOException { String dbName = createDBNonRepl(testName.getMethodName(), driver); verifyFail("REPL DUMP " + dbName, driver); verifyFail("REPL DUMP " + dbName + " from 1 ", driver); }

Target:
public void testDumpNonReplDatabase() throws IOException { String dbName = createDBNonRepl(testName.getMethodName(), driver); verifyFail("REPL DUMP " + dbName, driver); verifyFail("REPL DUMP " + dbName + " from 1 ", driver); run("alter database " + dbName + " set dbproperties ('repl.source.for' = '1, 2, 3')", driver); assertTrue(run("REPL DUMP " + dbName, true, driver)); assertTrue(run("REPL DUMP " + dbName + " from 1 ", true, driver)); dbName = createDBNonRepl(testName.getMethodName() + "_case", driver); run("alter database " + dbName + " set dbproperties ('repl.SOURCE.for' = '1, 2, 3')", driver); assertTrue(run("REPL DUMP " + dbName, true, driver)); assertTrue(run("REPL DUMP " + dbName + " from 1 ", true, driver)); }
Source:
public void onFailure(Throwable t) { }

Target:
public void onFailure(Throwable t) { log.error("GetHardwareInfo failed: {}", ExceptionUtils.getRootCauseMessage(t)); log.debug("Exception", t); }
Source:
public static void main(String[] args) throws Exception { Connection connection = connection() .url("<LINK_0>") .user("admin@internal") .password("redhat123") .trustStoreFile("truststore.jks") .build(); VmsService vmsService = connection.systemService().vmsService(); Vm vm = vmsService.list() .search("name=myvm") .send() .vms() .get(0); Cluster cluster = connection.followLink(vm.cluster()); Template template = connection.followLink(vm.template()); List<Permission> permissions = connection.followLink(vm.permissions()); System.out.printf("cluster: %s\n", cluster.name()); System.out.printf("template: %s\n", template.name()); for (Permission permission : permissions) { System.out.printf("Permission role id: %s\n", permission.role().id()); } connection.close(); }

Target:
public static void main(String[] args) throws Exception { Connection connection = connection() .url("<LINK_0>") .user("admin@internal") .password("redhat123") .trustStoreFile("truststore.jks") .build(); VmsService vmsService = connection.systemService().vmsService(); Vm vm = vmsService.list() .search("name=myvm") .send() .vms() .get(0); Cluster cluster = connection.followLink(vm.cluster()); Template template = connection.followLink(vm.template()); List<Permission> permissions = connection.followLink(vm.permissions()); System.out.printf("cluster: %s\n", cluster.name()); System.out.printf("template: %s\n", template.name()); for (Permission permission : permissions) { System.out.printf("role: %s\n", permission.role().id()); } connection.close(); }
Source:
public Stream<PropertyKeyResult> listPropertyKeys() { try ( Statement statement = tx.acquireStatement() ) { return asList( TokenAccess.PROPERTY_KEYS.inUse( statement ).map( PropertyKeyResult::new ) ).stream(); } }

Target:
public Stream<PropertyKeyResult> listPropertyKeys() { try ( Statement statement = tx.acquireStatement() ) { List<PropertyKeyResult> propertyKeys = asList( TokenAccess.PROPERTY_KEYS.inUse( statement ).map( PropertyKeyResult::new ) ); statement.close(); return propertyKeys.stream(); } }
Source:
public QueryPlan limit(Integer limit, Integer offset) { if (limit == this.limit || (limit != null && limit.equals(this.limit))) { return this; } if (offset == this.offset || (offset != null && offset.equals(this.offset))) { return new ClientScanPlan(this.context, this.statement, this.table, this.projector, limit, this.offset, this.where, this.orderBy, this.delegate); } return new ClientScanPlan(this.context, this.statement, this.table, this.projector, limit, offset, this.where, this.orderBy, this.delegate); }

Target:
public QueryPlan limit(Integer limit, Integer offset) { if ((limit == this.limit || (limit != null && limit.equals(this.limit))) && (offset == this.offset || (offset != null && offset.equals(this.offset)))) { return this; } return new ClientScanPlan(this.context, this.statement, this.table, this.projector, limit, offset, this.where, this.orderBy, this.delegate); }
Source:
private String getStackTraceString(Exception e) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); return sw.toString(); }

Target:
private static String getStackTraceString(Exception e) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); e.printStackTrace(pw); return sw.toString(); }
Source:
public String showNewQuestionPage(@RequestParam(BRANCH_ID) Long branchId, Model model, HttpServletRequest request) throws NotFoundException { VelocityEngine engine = new VelocityEngine(getProperties()); engine.init(); TopicDto dto; TopicDraft draft = getPluginTopicDraftService().getDraft(); if (draft != null) { dto = new TopicDto(draft); } else { Topic topic = new Topic(); topic.setPoll(new Poll()); dto = new TopicDto(topic); } Branch branch = getPluginBranchService().get(branchId); dto.getTopic().setBranch(branch); Map<String, Object> data = getDefaultModel(request); data.put(BREADCRUMB_LIST, breadcrumbBuilder.getForumBreadcrumb(dto.getTopic())); data.put(TOPIC_DTO, dto); data.put(EDIT_MODE, false); model.addAttribute(CONTENT, getMergedTemplate(engine, QUESTION_FORM_TEMPLATE_PATH, "UTF-8", data)); return PLUGIN_VIEW_NAME; }

Target:
public String showNewQuestionPage(@RequestParam(BRANCH_ID) Long branchId, Model model, HttpServletRequest request) throws NotFoundException { VelocityEngine engine = new VelocityEngine(getProperties()); engine.init(); TopicDraft draft = ObjectUtils.defaultIfNull( getPluginTopicDraftService().getDraft(), new TopicDraft()); TopicDto dto = new TopicDto(draft); Branch branch = getPluginBranchService().get(branchId); dto.getTopic().setBranch(branch); Map<String, Object> data = getDefaultModel(request); data.put(BREADCRUMB_LIST, breadcrumbBuilder.getForumBreadcrumb(dto.getTopic())); data.put(TOPIC_DTO, dto); data.put(EDIT_MODE, false); model.addAttribute(CONTENT, getMergedTemplate(engine, QUESTION_FORM_TEMPLATE_PATH, "UTF-8", data)); return PLUGIN_VIEW_NAME; }
Source:
protected VdcActionParametersBase getAddParameters(VmWatchdog entity, WatchDog device) { WatchdogParameters watchdogParameters = new WatchdogParameters(); validateEnums(WatchDog.class, device); watchdogParameters.setAction(getMapper(WatchdogAction.class, VmWatchdogAction.class).map(WatchdogAction.fromValue(StringUtils.upperCase(device.getAction())), null)); watchdogParameters.setModel(getMapper(WatchdogModel.class, VmWatchdogType.class).map(WatchdogModel.fromValue(StringUtils.upperCase(device.getModel())), null)); watchdogParameters.setId(parentId); watchdogParameters.setVm(isVm(parentId)); return watchdogParameters; }

Target:
protected VdcActionParametersBase getAddParameters(VmWatchdog entity, WatchDog device) { WatchdogParameters watchdogParameters = new WatchdogParameters(); validateEnums(WatchDog.class, device); watchdogParameters.setAction(getMapper(WatchdogAction.class, VmWatchdogAction.class).map(WatchdogAction.fromValue(device.getAction()), null)); watchdogParameters.setModel(getMapper(WatchdogModel.class, VmWatchdogType.class).map(WatchdogModel.fromValue(device.getModel()), null)); watchdogParameters.setId(parentId); watchdogParameters.setVm(isVm(parentId)); return watchdogParameters; }
Source:
private static void injectGatewayServices(final ServiceDiscovery serviceDiscovery, Service... gatewayServices) { if (ArrayUtils.isNotEmpty(gatewayServices)) { try { for (Field field : serviceDiscovery.getClass().getDeclaredFields()) { if (field.getDeclaredAnnotation(GatewayService.class) != null) { for (Service gatewayService : gatewayServices) { if (gatewayService != null) { if (field.getType().isAssignableFrom(gatewayService.getClass())) { field.setAccessible(true); field.set(serviceDiscovery, gatewayService); } } } } } } catch (Exception e) { e.printStackTrace(); } } }

Target:
private static void injectGatewayServices(final ServiceDiscovery serviceDiscovery, Service... gatewayServices) { if (ArrayUtils.isNotEmpty(gatewayServices)) { try { for (Field field : serviceDiscovery.getClass().getDeclaredFields()) { if (field.getDeclaredAnnotation(GatewayService.class) != null) { for (Service gatewayService : gatewayServices) { if (gatewayService != null) { if (field.getType().isAssignableFrom(gatewayService.getClass())) { field.setAccessible(true); field.set(serviceDiscovery, gatewayService); } } } } } } catch (Exception e) { LOG.error("Error while injecting Gateway Services in service discoveries", e); } } }
Source:
public void addUnsafe(long markerAddress, List<SMRRecordLocator> locators) { if (!rt.getParameters().isGarbageCollectionEnable()) { return; } if (locators.isEmpty()) { return; } List<SMRGarbageEntry> garbageEntries = generateGarbageEntries(markerAddress, locators); try { for (SMRGarbageEntry garbageEntry : garbageEntries) { garbageReceivingQueue.put(garbageEntry); if (garbageReceivingQueue.size() >= RECEIVING_QUEUE_CAPACITY) { submitGCTask(); } } } catch (InterruptedException ie) { throw new UnrecoverableCorfuInterruptedError( "Interrupted during adding locators to GarbageInformer", ie); } }

Target:
public void addUnsafe(long markerAddress, List<SMRRecordLocator> locators) { if (locators.isEmpty()) { return; } List<SMRGarbageEntry> garbageEntries = generateGarbageEntries(markerAddress, locators); try { for (SMRGarbageEntry garbageEntry : garbageEntries) { garbageReceivingQueue.put(garbageEntry); if (garbageReceivingQueue.size() >= RECEIVING_QUEUE_CAPACITY) { submitGCTask(); } } } catch (InterruptedException ie) { throw new UnrecoverableCorfuInterruptedError( "Interrupted during adding locators to GarbageInformer", ie); } }
Source:
public void deactivate() { logger.debug("Deactivate"); closeAllConnections(); }

Target:
public void deactivate() { closeAllConnections(); }
Source:
private String parseString(LocalDocument doc, Map<String, String> regexConf, Matcher regexMatcher) { String substitute = regexConf.get("substitute"); for (int i = 1; i <= regexMatcher.groupCount(); i++) { substitute = substitute.replace("$" + i, regexMatcher.group(i)); System.out.println(regexMatcher.group(i)); if (regexMatcher.groupCount() == 1) { while (regexMatcher.find()) { substitute += regexMatcher.group(i); System.out.println(regexMatcher.group(i)); } } } return substitute; }

Target:
private String parseString(LocalDocument doc, Map<String, String> regexConf, Matcher regexMatcher) { String substitute = regexConf.get("substitute"); for (int i = 1; i <= regexMatcher.groupCount(); i++) { substitute = substitute.replace("$" + i, regexMatcher.group(i)); if (regexMatcher.groupCount() == 1) { while (regexMatcher.find()) { substitute += regexMatcher.group(i); } } } return substitute; }
Source:
public List<AsyncJobStatus> getJobsInState(Collection<AsyncJobStatus.JobState> states) { if (states != null && !states.isEmpty()) { String jpql = "SELECT aj FROM AsyncJobStatus aj WHERE aj.state IN (:states)"; return this.getEntityManager() .createQuery(jpql, AsyncJobStatus.class) .setParameter("states", states) .getResultList(); } return new LinkedList<>(); }

Target:
public List<AsyncJobStatus> getJobsInState(Collection<AsyncJobStatus.JobState> states) { if (states != null && !states.isEmpty()) { String jpql = "SELECT aj FROM AsyncJobStatus aj WHERE aj.state IN (:states)"; return this.getEntityManager() .createQuery(jpql, AsyncJobStatus.class) .setParameter("states", states) .getResultList(); } return new ArrayList<>(); }
Source:
public Void visitNewClass(NewClassTree node, Void p) { if (checker.shouldSkipUses(TreeUtils.constructor(node))) { return super.visitNewClass(node, p); } ParameterizedExecutableType fromUse = atypeFactory.constructorFromUse(node); AnnotatedExecutableType constructor = fromUse.executableType; List<AnnotatedTypeMirror> typeargs = fromUse.typeArgs; List<? extends ExpressionTree> passedArguments = node.getArguments(); List<AnnotatedTypeMirror> params = AnnotatedTypes.expandVarArgs(atypeFactory, constructor, passedArguments); ExecutableElement method = TreeUtils.elementFromUse(node); Name methodName = method.getSimpleName(); checkArguments(params, passedArguments, methodName, method.getParameters()); checkVarargs(constructor, node); List<AnnotatedTypeParameterBounds> paramBounds = new ArrayList<>(); for (AnnotatedTypeVariable param : constructor.getTypeVariables()) { paramBounds.add(param.getBounds()); } checkTypeArguments( node, paramBounds, typeargs, node.getTypeArguments(), methodName, method.getTypeParameters()); boolean valid = validateTypeOf(node); if (valid) { AnnotatedDeclaredType dt = atypeFactory.getAnnotatedType(node); if (atypeFactory.getDependentTypesHelper() != null) { atypeFactory.getDependentTypesHelper().checkType(dt, node); } checkConstructorInvocation(dt, constructor, node); } scan(node.getEnclosingExpression(), p); scan(node.getIdentifier(), p); scan(node.getClassBody(), p); return null; }

Target:
public Void visitNewClass(NewClassTree node, Void p) { if (checker.shouldSkipUses(TreeUtils.constructor(node))) { return super.visitNewClass(node, p); } ParameterizedExecutableType fromUse = atypeFactory.constructorFromUse(node); AnnotatedExecutableType constructorType = fromUse.executableType; List<AnnotatedTypeMirror> typeargs = fromUse.typeArgs; List<? extends ExpressionTree> passedArguments = node.getArguments(); List<AnnotatedTypeMirror> params = AnnotatedTypes.expandVarArgs(atypeFactory, constructorType, passedArguments); ExecutableElement constructor = constructorType.getElement(); Name constructorName = constructor.getSimpleName(); checkArguments(params, passedArguments, constructorName, constructor.getParameters()); checkVarargs(constructorType, node); List<AnnotatedTypeParameterBounds> paramBounds = new ArrayList<>(); for (AnnotatedTypeVariable param : constructorType.getTypeVariables()) { paramBounds.add(param.getBounds()); } checkTypeArguments( node, paramBounds, typeargs, node.getTypeArguments(), constructorName, constructor.getTypeParameters()); boolean valid = validateTypeOf(node); if (valid) { AnnotatedDeclaredType dt = atypeFactory.getAnnotatedType(node); if (atypeFactory.getDependentTypesHelper() != null) { atypeFactory.getDependentTypesHelper().checkType(dt, node); } checkConstructorInvocation(dt, constructorType, node); } scan(node.getEnclosingExpression(), p); scan(node.getIdentifier(), p); scan(node.getClassBody(), p); return null; }