auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void subscribeStateChanges(final org.I0Itec.zkclient.IZkStateListener listener) { subscribeStateChanges(new IZkStateListener() { @Override public void handleStateChanged(KeeperState state) throws Exception { listener.handleStateChanged(state); } @Override public void handleNewSession() throws Exception { listener.handleNewSession(); } @Override public void handleSessionEstablishmentError(Throwable error) throws Exception { listener.handleSessionEstablishmentError(error); } }); }

Target:
public void subscribeStateChanges(final org.I0Itec.zkclient.IZkStateListener listener) { subscribeStateChanges(new IZkStateListenerI0ItecImpl(listener)); }
Source:
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { String[] beanNames = beanFactory.getBeanNamesForType(Provider.class); for (String beanName : beanNames) { BeanDefinition beanDefinition = beanFactory.getBeanDefinition(beanName); beanDefinition.setScope(BeanDefinition.SCOPE_PROTOTYPE); } }

Target:
public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) throws BeansException { String[] beanNames = beanFactory.getBeanNamesForType(Provider.class); for (String beanName : beanNames) { BeanDefinition beanDefinition = beanFactory.getBeanDefinition(beanName); if ("".equals(beanDefinition.getScope())){ beanDefinition.setScope(BeanDefinition.SCOPE_PROTOTYPE); } } }
Source:
public boolean isInfoboxDisplayed() { wait.forElementVisible(infobox); return infobox.isDisplayed(); }

Target:
public boolean isInfoboxDisplayed() { wait.forElementPresent(By.cssSelector(".portable-infobox")); return infobox.isDisplayed(); }
Source:
public double getHetPercent() { return (double) abCalls / (double) numCalls * 100d; }

Target:
public double getHetPercent() { return (double) abCalls / (double) numCalls; }
Source:
public void start() { if ( cluster == null ) { try { log.connectingToCassandra( config.getHost(), config.getPort() ); cluster = new Cluster.Builder() .addContactPoint( config.getHost() ) .withPort( config.getPort() ) .build(); Session bootstrapSession = cluster.connect(); bootstrapSession.execute( "CREATE KEYSPACE IF NOT EXISTS " + config.getDatabaseName() + " WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1 }" ); bootstrapSession.close(); session = cluster.connect( config.getDatabaseName() ); sequenceHandler = new CassandraSequenceHandler(this); } catch (RuntimeException e) { throw log.unableToInitializeCassandra( e ); } } }

Target:
public void start() { if ( cluster == null ) { try { log.connectingToCassandra( config.getHost(), config.getPort() ); cluster = new Cluster.Builder() .addContactPoint( config.getHost() ) .withPort( config.getPort() ) .withCredentials( config.getUsername(), config.getPassword() ) .build(); Session bootstrapSession = cluster.connect(); bootstrapSession.execute( "CREATE KEYSPACE IF NOT EXISTS " + config.getDatabaseName() + " WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1 }" ); bootstrapSession.close(); session = cluster.connect( config.getDatabaseName() ); sequenceHandler = new CassandraSequenceHandler(this); } catch (RuntimeException e) { throw log.unableToInitializeCassandra( e ); } } }
Source:
public void testGetChangeInfo() throws Exception { if (!isVersion26OrLater()) { return; } int reviewId = Integer.parseInt(reviewHarness.shortId); ChangeInfo changeInfo = reviewHarness.client.getChangeInfo(reviewId, new NullProgressMonitor()); if (reviewHarness.client.isVersion29OrLater(new NullProgressMonitor())) { ChangeInfoTest.assertHasCodeReviewLabels29(changeInfo, true); } else { ChangeInfoTest.assertHasCodeReviewLabels29(changeInfo, false); } }

Target:
public void testGetChangeInfo() throws Exception { if (!isVersion26OrLater()) { return; } int reviewId = Integer.parseInt(reviewHarness.shortId); ChangeInfo changeInfo = reviewHarness.client.getChangeInfo(reviewId, new NullProgressMonitor()); if (reviewHarness.client.isVersion29OrLater(new NullProgressMonitor())) { ChangeInfoTest.assertHasCodeReviewLabels(changeInfo, true); } else { ChangeInfoTest.assertHasCodeReviewLabels(changeInfo, false); } }
Source:
public Object getAdditionalProposalInfo(IProgressMonitor monitor) { ServerCapabilities capabilities = info.getCapabilites(); if (capabilities != null) { CompletionOptions options = capabilities.getCompletionProvider(); if (options != null && Boolean.TRUE.equals(options.getResolveProvider())) { try { updateCompletionItem(info.getInitializedLanguageClient().get(50, TimeUnit.MILLISECONDS) .getTextDocumentService() .resolveCompletionItem(item) .get(500, TimeUnit.MILLISECONDS)); } catch (InterruptedException | ExecutionException | TimeoutException e) { LanguageServerPlugin.logError(e); } } } StringBuilder res = new StringBuilder(); if (this.item.getDetail() != null) { res.append("<p>" + this.item.getDetail() + "</p>"); } if (res.length() > 0) { res.append("<br/>"); } if (this.item.getDocumentation() != null) { res.append("<p>" + this.item.getDocumentation() + "</p>"); } return res.toString(); }

Target:
public Object getAdditionalProposalInfo(IProgressMonitor monitor) { ServerCapabilities capabilities = info.getCapabilites(); if (capabilities != null) { CompletionOptions options = capabilities.getCompletionProvider(); if (options != null && Boolean.TRUE.equals(options.getResolveProvider())) { try { updateCompletionItem(info.getInitializedLanguageClient() .thenCompose(ls -> ls.getTextDocumentService().resolveCompletionItem(item)) .get(500, TimeUnit.MILLISECONDS)); } catch (InterruptedException | ExecutionException | TimeoutException e) { LanguageServerPlugin.logError(e); } } } StringBuilder res = new StringBuilder(); if (this.item.getDetail() != null) { res.append("<p>" + this.item.getDetail() + "</p>"); } if (res.length() > 0) { res.append("<br/>"); } if (this.item.getDocumentation() != null) { res.append("<p>" + this.item.getDocumentation() + "</p>"); } return res.toString(); }
Source:
public List<FiringGroup> apply(final BattleState battleState) { final Collection<Unit> canFire = battleState.getBombardingUnits(); final Collection<Unit> enemyUnits = CollectionUtils.getMatches( battleState.filterUnits(ALIVE, OFFENSE.getOpposite()), Matches.unitIsNotInfrastructureAndNotCapturedOnEntering( battleState.getPlayer(OFFENSE), battleState.getBattleSite(), battleState.getGameData())); return FiringGroup.groupBySuicideOnHit(NAVAL_BOMBARD, canFire, enemyUnits); }

Target:
public List<FiringGroup> apply(final BattleState battleState) { final Collection<Unit> enemyUnits = CollectionUtils.getMatches( battleState.filterUnits(ALIVE, OFFENSE.getOpposite()), Matches.unitIsNotInfrastructureAndNotCapturedOnEntering( battleState.getPlayer(OFFENSE), battleState.getBattleSite(), battleState.getGameData())); return FiringGroup.groupBySuicideOnHit( NAVAL_BOMBARD, battleState.getBombardingUnits(), enemyUnits); }
Source:
private EntityDescriptor entityDescriptor(InputStream inputStream) { try { Document document = this.parserPool.parse(inputStream); Element element = document.getDocumentElement(); return (EntityDescriptor) this.unmarshaller.unmarshall(element); } catch (Exception ex) { throw new Saml2Exception(ex); } }

Target:
private EntityDescriptor entityDescriptor(InputStream inputStream) { Document document = document(inputStream); Element element = document.getDocumentElement(); Unmarshaller unmarshaller = this.registry.getUnmarshallerFactory().getUnmarshaller(element); if (unmarshaller == null) { throw new Saml2Exception("Unsupported element of type " + element.getTagName()); } try { XMLObject object = unmarshaller.unmarshall(element); if (object instanceof EntitiesDescriptor) { return ((EntitiesDescriptor) object).getEntityDescriptors().get(0); } if (object instanceof EntityDescriptor) { return (EntityDescriptor) object; } } catch (Exception ex) { throw new Saml2Exception(ex); } throw new Saml2Exception("Unsupported element of type " + element.getTagName()); }
Source:
void setChangeInfo(ChangeInfo info) { GitwebLink gw = Gerrit.getGitwebLink(); if (gw != null) { JsArray<RevisionInfo> revisions = info.revisions().values(); for (int i = 0; i < revisions.length(); i++) { if (revisions.get(i)._number() == patchSetId.get()) { String c = revisions.get(i).name(); SafeHtml.setInnerHTML(filePath, formatPath(path, info.project(), c)); SafeHtml.setInnerHTML(project, new SafeHtmlBuilder() .openAnchor() .setAttribute("href", gw.toFile(info.project(), c, "")) .setAttribute("title", gw.getLinkName()) .append(info.project()) .closeAnchor()); return; } } } project.setInnerText(info.project()); }

Target:
void setChangeInfo(ChangeInfo info) { GitwebLink gw = Gerrit.getGitwebLink(); if (gw != null) { for (RevisionInfo rev : Natives.asList(info.revisions().values())) { if (rev._number() == patchSetId.get()) { String c = rev.name(); SafeHtml.setInnerHTML(filePath, formatPath(path, info.project(), c)); SafeHtml.setInnerHTML(project, new SafeHtmlBuilder() .openAnchor() .setAttribute("href", gw.toFile(info.project(), c, "")) .setAttribute("title", gw.getLinkName()) .append(info.project()) .closeAnchor()); return; } } } project.setInnerText(info.project()); }
Source:
public void reset() throws Exception { HTTP2Client http2Client = new HTTP2Client(); http2Client.start(); SocketAddress serverAddress = new InetSocketAddress("localhost", 8080); CompletableFuture<Session> sessionCF = http2Client.connect(serverAddress, new Session.Listener.Adapter()); Session session = sessionCF.get(); HttpFields requestHeaders = HttpFields.build() .add(HttpHeader.USER_AGENT, "Jetty HTTP2Client {version}"); MetaData.Request request = new MetaData.Request("GET", HttpURI.from("http://localhost:8080/path"), HttpVersion.HTTP_2, requestHeaders); HeadersFrame headersFrame = new HeadersFrame(request, null, true); CompletableFuture<Stream> streamCF = session.newStream(headersFrame, new Stream.Listener.Adapter() { @Override public void onReset(Stream stream, ResetFrame frame) { } }); Stream stream = streamCF.get(); stream.reset(new ResetFrame(stream.getId(), ErrorCode.CANCEL_STREAM_ERROR.code), Callback.NOOP); }

Target:
public void reset() throws Exception { HTTP2Client http2Client = new HTTP2Client(); http2Client.start(); SocketAddress serverAddress = new InetSocketAddress("localhost", 8080); CompletableFuture<Session> sessionCF = http2Client.connect(serverAddress, new Session.Listener.Adapter()); Session session = sessionCF.get(); HttpFields requestHeaders = HttpFields.build() .put(HttpHeader.USER_AGENT, "Jetty HTTP2Client {version}"); MetaData.Request request = new MetaData.Request("GET", HttpURI.from("http://localhost:8080/path"), HttpVersion.HTTP_2, requestHeaders); HeadersFrame headersFrame = new HeadersFrame(request, null, true); CompletableFuture<Stream> streamCF = session.newStream(headersFrame, new Stream.Listener.Adapter() { @Override public void onReset(Stream stream, ResetFrame frame) { } }); Stream stream = streamCF.get(); stream.reset(new ResetFrame(stream.getId(), ErrorCode.CANCEL_STREAM_ERROR.code), Callback.NOOP); }
Source:
public SamzaSqlRelMessage convertToRelMessage(KV<Object, Object> samzaMessage) { List<Object> values = new ArrayList<>(); List<String> fieldNames = new ArrayList<>(); Object value = samzaMessage.getValue(); if (value instanceof IndexedRecord) { IndexedRecord record = (IndexedRecord) value; fieldNames.addAll(relationalSchema.getFieldNames()); Schema recordSchema = record.getSchema(); values.addAll(relationalSchema.getFieldList() .stream() .map(x -> getRelField(x.getType(), record.get(recordSchema.getField(x.getName()).pos()))) .collect(Collectors.toList())); } else if (value == null) { fieldNames.addAll(relationalSchema.getFieldNames()); IntStream.range(0, fieldNames.size() - 1).forEach(x -> values.add(null)); } else { String msg = "Avro message converter doesn't support messages of type " + value.getClass(); LOG.error(msg); throw new SamzaException(msg); } return new SamzaSqlRelMessage(samzaMessage.getKey(), fieldNames, values); }

Target:
public SamzaSqlRelMessage convertToRelMessage(KV<Object, Object> samzaMessage) { List<Object> values = new ArrayList<>(); List<String> fieldNames = new ArrayList<>(); Object value = samzaMessage.getValue(); if (value instanceof IndexedRecord) { IndexedRecord record = (IndexedRecord) value; fieldNames.addAll(relationalSchema.getFieldNames()); values.addAll(relationalSchema.getFieldList() .stream() .map(x -> getRelField(x.getType(), record.get(this.avroSchema.getField(x.getName()).pos()))) .collect(Collectors.toList())); } else if (value == null) { fieldNames.addAll(relationalSchema.getFieldNames()); IntStream.range(0, fieldNames.size() - 1).forEach(x -> values.add(null)); } else { String msg = "Avro message converter doesn't support messages of type " + value.getClass(); LOG.error(msg); throw new SamzaException(msg); } return new SamzaSqlRelMessage(samzaMessage.getKey(), fieldNames, values); }
Source:
JanusGraphServer embeddedDbServer(CassandraEmbeddedConfiguration cassandraConfiguration, JanusGraphConfiguration janusGraphConfiguration) { if (!Files.exists(Paths.get(cassandraConfiguration.getStorageFolder()))) { logger.info(String.format("Extract storage from [%s].", PATH_STRONGBOX_DB)); initStorage(cassandraConfiguration); logger.info(String.format("Sotorage extracted to [%s].", cassandraConfiguration.getStorageFolder())); } return new JanusGraphWithEmbeddedCassandra(cassandraConfiguration, janusGraphConfiguration); }

Target:
JanusGraphServer embeddedDbServer(CassandraEmbeddedConfiguration cassandraConfiguration, JanusGraphConfiguration janusGraphConfiguration) { if (!Files.exists(Paths.get(cassandraConfiguration.getStorageRoot()))) { logger.info(String.format("Extract storage from [%s].", PATH_STRONGBOX_DB)); initStorage(cassandraConfiguration); logger.info(String.format("Storage extracted to [%s].", cassandraConfiguration.getStorageRoot())); } return new JanusGraphWithEmbeddedCassandra(cassandraConfiguration, janusGraphConfiguration); }
Source:
private static void handleIdManager(final String[] args) { if ("label".equals(args[1])) { CreateLabel.main(Arrays.copyOfRange(args, 2, args.length)); } }

Target:
private static void handleIdManager(final String[] args) { if ("create".equals(args[1])) { CreateLabel.main(Arrays.copyOfRange(args, 2, args.length)); } }
Source:
void deactivateTopology(SchedulerStateManagerAdaptor stateManager, final TopologyAPI.Topology topology) throws InterruptedException { List<TopologyAPI.Config.KeyValue> topologyConfig = topology.getTopologyConfig().getKvsList(); long deactivateSleepSeconds = TopologyUtils.getConfigWithDefault( topologyConfig, TOPOLOGY_UPDATE_DEACTIVATE_WAIT_SECS, 0L); logInfo("Deactivating topology %s before handling update request", topology.getName()); assertTrue(TMasterUtils.transitionTopologyState( topology.getName(), TMasterUtils.TMasterCommand.DEACTIVATE, stateManager, TopologyAPI.TopologyState.RUNNING, TopologyAPI.TopologyState.PAUSED), "Failed to deactivate topology %s. Aborting update request", topology.getName()); if (deactivateSleepSeconds > 0) { logInfo("Deactivated topology %s. Sleeping for %d seconds before handling update request", topology.getName(), deactivateSleepSeconds); Thread.sleep(deactivateSleepSeconds * 1000); } else { logInfo("Deactivated topology %s.", topology.getName()); } }

Target:
void deactivateTopology(SchedulerStateManagerAdaptor stateManager, final TopologyAPI.Topology topology) throws InterruptedException { List<TopologyAPI.Config.KeyValue> topologyConfig = topology.getTopologyConfig().getKvsList(); long deactivateSleepSeconds = TopologyUtils.getConfigWithDefault( topologyConfig, TOPOLOGY_UPDATE_DEACTIVATE_WAIT_SECS, 0L); logInfo("Deactivating topology %s before handling update request: %d", topology.getName(), deactivateSleepSeconds); NetworkUtils.TunnelConfig tunnelConfig = NetworkUtils.TunnelConfig.build(config, NetworkUtils.HeronSystem.SCHEDULER); assertTrue(TMasterUtils.transitionTopologyState( topology.getName(), TMasterUtils.TMasterCommand.DEACTIVATE, stateManager, TopologyAPI.TopologyState.RUNNING, TopologyAPI.TopologyState.PAUSED, tunnelConfig), "Failed to deactivate topology %s. Aborting update request", topology.getName()); if (deactivateSleepSeconds > 0) { logInfo("Deactivated topology %s. Sleeping for %d seconds before handling update request", topology.getName(), deactivateSleepSeconds); Thread.sleep(deactivateSleepSeconds * 1000); } else { logInfo("Deactivated topology %s.", topology.getName()); } }
Source:
public Token appendCheckpoint(Token snapshotTimestamp) { return appendCheckpointOnSnapshot(snapshotTimestamp); }

Target:
public Token appendCheckpoint(Token snapshotTimestamp) { long start = System.currentTimeMillis(); if (!Address.isAddress(snapshotTimestamp.getSequence())) { snapshotTimestamp = forceHole(); } try { rt.getAddressSpaceView().read(snapshotTimestamp.getSequence()); } catch (TrimmedException te) { log.info("appendCheckpointOnSnapshot: stream tail at has been trimmed. Checkpoint on same state" + "as previous checkpoint.", snapshotTimestamp); } rt.getObjectsView().TXBuild() .type(TransactionType.SNAPSHOT) .snapshot(snapshotTimestamp) .build() .begin(); try (Timer.Context context = MetricsUtils.getConditionalContext(appendCheckpointTimer)) { log.info("appendCheckpoint: Started checkpoint for at snapshot {}", streamId, snapshotTimestamp); ICorfuSMR<T> corfuObject = (ICorfuSMR<T>) this.map; Set<Map.Entry> entries = this.map.entrySet(); long vloVersion = snapshotTimestamp.getSequence(); startCheckpoint(snapshotTimestamp, vloVersion); appendObjectState(entries); finishCheckpoint(); long cpDuration = System.currentTimeMillis() - start; log.info("appendCheckpoint: completed checkpoint for {}, entries({}), tableSize({}) bytes, " + "cpSize({}) bytes at snapshot in ms", streamId, entries.size(), MetricsUtils.sizeOf.deepSizeOf(entries), numBytes, snapshotTimestamp, cpDuration); } finally { rt.getObjectsView().TXEnd(); } return snapshotTimestamp; }
Source:
protected void doUpdateStatus( RuntimeIdentity id, Predicate<WorkspaceStatus> predicate, WorkspaceStatus newStatus) throws InfrastructureException { EntityManager entityManager = managerProvider.get(); KubernetesRuntimeState existingState = entityManager.find(KubernetesRuntimeState.class, new RuntimeId(id)); Optional<KubernetesRuntimeState> runtimeStateOpt = get(id); if (!runtimeStateOpt.isPresent()) { throw new InfrastructureException( "Runtime state for workspace with id '" + id.getWorkspaceId() + "' was not found"); } if (!predicate.test(existingState.getStatus())) { throw new IllegalStateException("Runtime status doesn't match to the specified predicate"); } existingState.setStatus(newStatus); entityManager.flush(); }

Target:
protected void doUpdateStatus( RuntimeIdentity id, Predicate<WorkspaceStatus> predicate, WorkspaceStatus newStatus) throws InfrastructureException { EntityManager entityManager = managerProvider.get(); Optional<KubernetesRuntimeState> existingStateOpt = get(id); if (!existingStateOpt.isPresent()) { throw new InfrastructureException( "Runtime state for workspace with id '" + id.getWorkspaceId() + "' was not found"); } KubernetesRuntimeState existingState = existingStateOpt.get(); if (!predicate.test(existingState.getStatus())) { throw new IllegalStateException("Runtime status doesn't match to the specified predicate"); } existingState.setStatus(newStatus); entityManager.flush(); }
Source:
private void loadWiki() { final Callback<LastFmAlbum> wikiCallback = new Callback<LastFmAlbum>(){ @Override public void onResponse(Call<LastFmAlbum> call, Response<LastFmAlbum> response) { LastFmAlbum lastFmAlbum = response.body(); if (lastFmAlbum.getAlbum().getWiki() != null) { String wik = lastFmAlbum.getAlbum().getWiki().getContent(); if (wik != null && !wik.trim().equals("")) { wiki = Html.fromHtml(wik); wikiReady(); return; } } if(call.request().url().queryParameter("lang") != null) { lastFMRestClient.getApiService().getAlbumInfo(getAlbum().getTitle(), getAlbum().getArtistName(), null).enqueue(this); return; } wiki = null; wikiReady(); } @Override public void onFailure(Call<LastFmAlbum> call, Throwable t) { t.printStackTrace(); wiki = null; } }; lastFMRestClient.getApiService().getAlbumInfo(getAlbum().getTitle(), getAlbum().getArtistName(), Locale.getDefault().getLanguage()).enqueue(wikiCallback); }

Target:
private void loadWiki() { loadWiki(Locale.getDefault().getLanguage()); }
Source:
@Test public void compileJavaFile() throws Exception { final String value = "Hello World!"; TypeSpec type = TypeSpec.classBuilder("Test") .addModifiers(Modifier.PUBLIC) .addSuperinterface(ParameterizedTypeName.get(Callable.class, String.class)) .addMethod(MethodSpec.methodBuilder("call") .returns(String.class) .addModifiers(Modifier.PUBLIC) .addStatement("return $S", value) .build()) .build(); JavaFile javaFile = JavaFile.builder("foo", type).build(); JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); DiagnosticCollector<JavaFileObject> diagnosticCollector = new DiagnosticCollector<>(); StandardJavaFileManager fileManager = compiler.getStandardFileManager(diagnosticCollector, Locale.getDefault(), StandardCharsets.UTF_8); File classOutput = tmp.newFolder(); fileManager.setLocation(StandardLocation.CLASS_OUTPUT, Collections.singleton(classOutput)); CompilationTask task = compiler.getTask(null, fileManager, diagnosticCollector, Collections.<String>emptySet(), Collections.<String>emptySet(), Collections.singleton(javaFile.toJavaFileObject())); assertThat(task.call()).isTrue(); assertThat(diagnosticCollector.getDiagnostics()).isEmpty(); ClassLoader loader = new URLClassLoader(new URL[] { classOutput.toURI().toURL() }); Callable<?> test = Class.forName("foo.Test", true, loader).asSubclass(Callable.class).newInstance(); assertThat(Callable.class.getMethod("call").invoke(test)).isEqualTo(value); }

Target:
@Test public void compileJavaFile() throws Exception { final String value = "Hello World!"; TypeSpec type = TypeSpec.classBuilder("Test") .addModifiers(Modifier.PUBLIC) .addSuperinterface(ParameterizedTypeName.get(Callable.class, String.class)) .addMethod(MethodSpec.methodBuilder("call") .returns(String.class) .addModifiers(Modifier.PUBLIC) .addStatement("return $S", value) .build()) .build(); JavaFile javaFile = JavaFile.builder("foo", type).build(); JavaCompiler compiler = ToolProvider.getSystemJavaCompiler(); DiagnosticCollector<JavaFileObject> diagnosticCollector = new DiagnosticCollector<>(); StandardJavaFileManager fileManager = compiler.getStandardFileManager(diagnosticCollector, Locale.getDefault(), StandardCharsets.UTF_8); File classOutput = temporaryFolder.newFolder(); fileManager.setLocation(StandardLocation.CLASS_OUTPUT, Collections.singleton(classOutput)); CompilationTask task = compiler.getTask(null, fileManager, diagnosticCollector, Collections.<String>emptySet(), Collections.<String>emptySet(), Collections.singleton(javaFile.toJavaFileObject())); assertThat(task.call()).isTrue(); assertThat(diagnosticCollector.getDiagnostics()).isEmpty(); ClassLoader loader = new URLClassLoader(new URL[] { classOutput.toURI().toURL() }); Callable<?> test = Class.forName("foo.Test", true, loader).asSubclass(Callable.class).newInstance(); assertThat(Callable.class.getMethod("call").invoke(test)).isEqualTo(value); }
Source:
public Model getGETModel(Representation rep) { ModelImpl modelImpl = (ModelImpl) super.getGETModel(rep); if (rep instanceof DefaultRepresentation) { modelImpl .property("display", new StringProperty()) .property("uuid", new StringProperty()) .property("drug", new RefProperty("#/definitions/DrugGetRef")) .property("conceptReferenceTerm", new RefProperty("#/definitions/ConceptreferencetermGetRef")) .property("conceptMapType", new RefProperty("#/definitions/ConceptmaptypeGetRef")); } else if (rep instanceof FullRepresentation) { modelImpl .property("display", new StringProperty()) .property("uuid", new StringProperty()) .property("auditInfo", new StringProperty()) .property("drug", new RefProperty("#/definitions/DrugGet")) .property("conceptReferenceTerm", new RefProperty("#/definitions/ConceptreferencetermGet")) .property("conceptMapType", new RefProperty("#/definitions/ConceptmaptypeGet")); ; } return modelImpl; }

Target:
public Model getGETModel(Representation rep) { ModelImpl modelImpl = (ModelImpl) super.getGETModel(rep); if (rep instanceof DefaultRepresentation) { modelImpl.property("display", new StringProperty()).property("uuid", new StringProperty()) .property("drug", new RefProperty("#/definitions/DrugGetRef")) .property("conceptReferenceTerm", new RefProperty("#/definitions/ConceptreferencetermGetRef")) .property("conceptMapType", new RefProperty("#/definitions/ConceptmaptypeGetRef")); } else if (rep instanceof FullRepresentation) { modelImpl.property("display", new StringProperty()).property("uuid", new StringProperty()) .property("auditInfo", new StringProperty()).property("drug", new RefProperty("#/definitions/DrugGet")) .property("conceptReferenceTerm", new RefProperty("#/definitions/ConceptreferencetermGet")) .property("conceptMapType", new RefProperty("#/definitions/ConceptmaptypeGet")); } return modelImpl; }
Source:
private IdleStrategy parseIdleStrategy(final String arg) throws ParseException { if (arg == null || arg.equalsIgnoreCase("NULL")) { return null; } IdleStrategy strategy; if (arg.startsWith(BackoffIdleStrategy.class.getName())) { strategy = parseBackoffIdleStrategy(arg); } else { try { final Class clazz = Class.forName(arg); strategy = (IdleStrategy)clazz.newInstance(); } catch (final ClassNotFoundException ex) { throw new ParseException("Class not found: " + ex.getMessage()); } catch (final IllegalAccessException ex) { throw new ParseException("Illegal access of class '" + arg + "': " + ex.getMessage()); } catch (final InstantiationException ex) { throw new ParseException("Could not instantiate class '" + arg + "': " + ex.getMessage()); } catch (final ClassCastException ex) { throw new ParseException("Class was not an IdleStrategy. " + ex.getMessage()); } } return strategy; }

Target:
private IdleStrategy parseIdleStrategy(final String arg) throws ParseException { if (arg == null || arg.equalsIgnoreCase(NULL_VALUE)) { return null; } IdleStrategy strategy; if (arg.startsWith(BackoffIdleStrategy.class.getName())) { strategy = parseBackoffIdleStrategy(arg); } else { try { final Class clazz = Class.forName(arg); strategy = (IdleStrategy)clazz.newInstance(); } catch (final ClassNotFoundException | IllegalAccessException | InstantiationException | ClassCastException ex) { throw new ParseException("Error creating new instance of '" + arg + "': " + ex.getMessage()); } } return strategy; }
Source:
public void review(final PendingCertifiedProductDTO listing) { for (PendingCertificationResultDTO cert : listing.getCertificationCriterion()) { if (cert.getMeetsCriteria() != null && cert.getMeetsCriteria()) { if (cert.getTestTools() != null && cert.getTestTools().size() > 0) { Iterator<PendingCertificationResultTestToolDTO> testToolIter = cert.getTestTools().iterator(); while (testToolIter.hasNext()) { PendingCertificationResultTestToolDTO testTool = testToolIter.next(); if (!StringUtils.isEmpty(testTool.getName()) && StringUtils.isEmpty(testTool.getVersion())) { listing.getErrorMessages() .add(msgUtil.getMessage("listing.criteria.missingTestToolVersion", testTool.getName(), cert.getNumber())); } } } } } }

Target:
public void review(final PendingCertifiedProductDTO listing) { for (PendingCertificationResultDTO cert : listing.getCertificationCriterion()) { if (cert.getMeetsCriteria() != null && cert.getMeetsCriteria() && cert.getTestTools() != null && cert.getTestTools().size() > 0) { for (PendingCertificationResultTestToolDTO testTool : cert.getTestTools()) if (!StringUtils.isEmpty(testTool.getName()) && StringUtils.isEmpty(testTool.getVersion())) { listing.getErrorMessages() .add(msgUtil.getMessage("listing.criteria.missingTestToolVersion", testTool.getName(), cert.getNumber())); } } } }
Source:
private Set<String> getOccupiedProperties() { Set<String> propertiesMitWerten = new HashSet<>(); for (ProcessProperty pp : processPropertyList) if (isEmptyString(pp.getValue())) propertiesMitWerten.add(pp.getName()); return propertiesMitWerten; }

Target:
private Set<String> getOccupiedProperties() { Set<String> occupiedProperties = new HashSet<>(); for (ProcessProperty processProperty : processPropertyList) { if (StringUtils.isNotBlank(processProperty.getValue())) { occupiedProperties.add(processProperty.getName()); } } return occupiedProperties; }
Source:
public ArrayList<SrlProblem> getCourseProblem(final List<String> problemID, final String userId) throws AuthenticationException, DatabaseAccessException { final long currentTime = System.currentTimeMillis(); final ArrayList<SrlProblem> allCourses = new ArrayList<SrlProblem>(); for (int index = 0; index < problemID.size(); index++) { try { allCourses.add(CourseProblemManager.mongoGetCourseProblem(getInstance().auth, getInstance().database, problemID.get(index), userId, currentTime)); } catch (DatabaseAccessException e) { LOG.info(LoggingConstants.EXCEPTION_MESSAGE, e); if (!e.isRecoverable()) { throw e; } } catch (AuthenticationException e) { if (e.getType() != AuthenticationException.INVALID_DATE) { throw e; } } } return allCourses; }

Target:
public ArrayList<SrlProblem> getCourseProblem(final List<String> problemID, final String userId) throws AuthenticationException, DatabaseAccessException { final long currentTime = System.currentTimeMillis(); final ArrayList<SrlProblem> allCourses = new ArrayList<SrlProblem>(); for (int index = 0; index < problemID.size(); index++) { try { allCourses.add(CourseProblemManager.mongoGetCourseProblem(getInstance().auth, getInstance().database, problemID.get(index), userId, currentTime)); } catch (DatabaseAccessException e) { LOG.error(LoggingConstants.EXCEPTION_MESSAGE, e); if (!e.isRecoverable()) { throw e; } } catch (AuthenticationException e) { if (e.getType() != AuthenticationException.INVALID_DATE) { throw e; } } } return allCourses; }
Source:
public DatasetException(String message, String dataset, Throwable cause) { super("Load dataset " + asList(dataset) + " failed: " + message, cause); this.datasets = asList(dataset); }

Target:
public DatasetException(String message, String dataset, Throwable cause) { this(message, asList(dataset), cause); }
Source:
public Object[][] VCFCompData() { return new Object[][]{ new Object[]{TEST_DIR.resolve("IntervalListFromVCFTest.vcf"), TEST_DIR.resolve("IntervalListFromVCFTestComp.interval_list"), false}, new Object[]{TEST_DIR.resolve("IntervalListFromVCFTest.vcf"), TEST_DIR.resolve("IntervalListFromVCFTestCompInverse.interval_list"), true}, new Object[]{TEST_DIR.resolve("IntervalListFromVCFTestManual.vcf"), TEST_DIR.resolve("IntervalListFromVCFTestManualComp.interval_list"), false}, new Object[]{TEST_DIR.resolve("IntervalListFromVCFTestManual.vcf"), TEST_DIR.resolve("IntervalListFromVCFTestCompInverseManual.interval_list"), true} }; }

Target:
public Object[][] VCFCompData() { final Path intervalListFromVcf = TEST_DIR.resolve("IntervalListFromVCFTest.vcf"); final Path intervalListFromVcfManual = TEST_DIR.resolve("IntervalListFromVCFTestManual.vcf"); return new Object[][]{ new Object[]{intervalListFromVcf, TEST_DIR.resolve("IntervalListFromVCFTestComp.interval_list"), false}, new Object[]{intervalListFromVcf, TEST_DIR.resolve("IntervalListFromVCFTestCompInverse.interval_list"), true}, new Object[]{intervalListFromVcfManual, TEST_DIR.resolve("IntervalListFromVCFTestManualComp.interval_list"), false}, new Object[]{intervalListFromVcfManual, TEST_DIR.resolve("IntervalListFromVCFTestCompInverseManual.interval_list"), true} }; }
Source:
private void printAssignments(NodeRepresentation nodeOutput, Assignments assignments) { for (Map.Entry<Symbol, RowExpression> entry : assignments.getMap().entrySet()) { if (entry.getValue() instanceof VariableReferenceExpression && ((VariableReferenceExpression) entry.getValue()).getName().equals(entry.getKey().getName())) { continue; } if (isExpression(entry.getValue())) { nodeOutput.appendDetailsLine("%s := %s", entry.getKey(), castToExpression(entry.getValue())); } else { nodeOutput.appendDetailsLine("%s := %s", entry.getKey(), formatter.formatRowExpression(entry.getValue())); } } }

Target:
private void printAssignments(NodeRepresentation nodeOutput, Assignments assignments) { for (Map.Entry<VariableReferenceExpression, RowExpression> entry : assignments.getMap().entrySet()) { if (entry.getValue() instanceof VariableReferenceExpression && ((VariableReferenceExpression) entry.getValue()).getName().equals(entry.getKey().getName())) { continue; } nodeOutput.appendDetailsLine("%s := %s", entry.getKey(), formatter.formatRowExpression(entry.getValue())); } }
Source:
public void setup() throws Exception { URL resource = getClass().getResource("/projects/multi-module-java-with-ext-libs"); testProjectServiceClient.importProject( workspace.getId(), Paths.get(resource.toURI()), PROJECT, ProjectTemplates.CONSOLE_JAVA_SIMPLE); ide.open(workspace); loader.waitOnClosed(); projectExplorer.waitItem(PROJECT); projectExplorer.selectItem(PROJECT); notificationsPopupPanel.waitProgressPopupPanelClose(); projectExplorer.expandPathInProjectExplorerAndOpenFile( PATH_FOR_EXPAND_APP_CLASS, APP_CLASS_NAME + ".java"); projectExplorer.openItemByPath(PROJECT + "/model"); projectExplorer.openItemByPath(PROJECT + "/model/src"); projectExplorer.openItemByPath(PROJECT + "/model/src/main"); projectExplorer.openItemByPath(PROJECT + "/model/src/main/java"); projectExplorer.openItemByPath(PROJECT + "/model/src/main/java/multimodule/model"); projectExplorer.openItemByPath( PROJECT + "/model/src/main/java/multimodule/model/" + BOOK_IMPL_CLASS_NAME + ".java"); }

Target:
public void setup() throws Exception { URL resource = getClass().getResource("/projects/multi-module-java-with-ext-libs"); testProjectServiceClient.importProject( workspace.getId(), Paths.get(resource.toURI()), PROJECT, ProjectTemplates.CONSOLE_JAVA_SIMPLE); ide.open(workspace); loader.waitOnClosed(); projectExplorer.waitItem(PROJECT); projectExplorer.selectItem(PROJECT); notificationsPopupPanel.waitProgressPopupPanelClose(); projectExplorer.expandPathInProjectExplorerAndOpenFile( PATH_FOR_EXPAND_APP_CLASS, APP_CLASS_NAME + ".java"); projectExplorer.openItemByPath(PROJECT); projectExplorer.expandPathInProjectExplorerAndOpenFile( PROJECT + "/model/src/main/java/multimodule.model", BOOK_IMPL_CLASS_NAME + ".java"); }
Source:
public UserPrefBooleanPaletteEntry(BooleanValue val, UserPrefPaletteItem item) { super(val, item); prefItem_ = item; boolean initial = false; initial = val.getGlobalValue(); checkbox_ = new CheckBox(); checkbox_.setValue(initial); Style style = checkbox_.getElement().getStyle(); syncLabel(); style.setWidth(45, Unit.PX); style.setDisplay(Display.INLINE_BLOCK); style.setTextAlign(TextAlign.LEFT); style.setCursor(Cursor.POINTER); checkbox_.addValueChangeHandler((newVal) -> { BooleanValue pref = (BooleanValue)pref_; pref.setGlobalValue(newVal.getValue()); syncLabel(); prefItem_.nudgeWriter(); }); initialize(); Roles.getCheckboxRole().setAriaLabelledbyProperty(checkbox_.getElement(), Id.of(name_.getElement())); }

Target:
public UserPrefBooleanPaletteEntry(BooleanValue val, UserPrefPaletteItem item) { super(val, item); prefItem_ = item; boolean initial = val.getGlobalValue(); checkbox_ = new CheckBox(); checkbox_.setValue(initial); Style style = checkbox_.getElement().getStyle(); syncLabel(); style.setWidth(45, Unit.PX); style.setDisplay(Display.INLINE_BLOCK); style.setTextAlign(TextAlign.LEFT); style.setCursor(Cursor.POINTER); checkbox_.addValueChangeHandler((newVal) -> { BooleanValue pref = (BooleanValue)pref_; pref.setGlobalValue(newVal.getValue()); syncLabel(); prefItem_.nudgeWriter(); }); initialize(); Roles.getCheckboxRole().setAriaLabelledbyProperty(checkbox_.getElement(), Id.of(name_.getElement())); }
Source:
public ActionResult execute() { String idOfCourseToBin = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); try { CourseAttributes courseAttributes = logic.getCourse(idOfCourseToBin); logic.moveCourseToRecycleBin(idOfCourseToBin); return new JsonResult(new CourseData(courseAttributes)); } catch (EntityDoesNotExistException e) { return new JsonResult(e.getMessage(), HttpStatus.SC_INTERNAL_SERVER_ERROR); } }

Target:
public ActionResult execute() { String idOfCourseToBin = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); try { CourseAttributes courseAttributes = logic.getCourse(idOfCourseToBin); logic.moveCourseToRecycleBin(idOfCourseToBin); return new JsonResult(new CourseData(courseAttributes)); } catch (EntityDoesNotExistException e) { throw new EntityNotFoundException(e); } }
Source:
public SunburstRingSegment(final PhylogeneticTreeItem value, final int layer, final double degreeStart, final double degreeEnd, final Point2D center, final double scale) { setValue(value); String name = getValue().getName(); String tooltip; if (name == null) { tooltip = "Distance: " + getValue().getDistance(); } else { tooltip = name + "\nDistance: " + getValue().getDistance(); } setName(new Tooltip(tooltip)); setDisplay(createRing(layer, degreeStart, degreeEnd , center, scale)); getChildren().add(getDisplay()); }

Target:
public SunburstRingSegment(final PhylogeneticTreeItem value, final int layer, final double degreeStart, final double degreeEnd, final Point2D center, final double scale) { setValue(value); String name = getValue().getName(); double distance = getValue().getDistance(); String tooltip; if (name == null) { tooltip = "Distance: " + distance; } else { tooltip = name + "\nDistance: " + distance; } setName(new Tooltip(tooltip)); setDisplay(createRing(layer, degreeStart, degreeEnd , center, scale)); getChildren().add(getDisplay()); }
Source:
void checkNeedsPropertiesReloading(long now) { if (CACHING_VALIDITY_MS > 0 && now - lastCachedTime > CACHING_VALIDITY_MS) { this.rampUp = owner.getRampUpSeconds(); this.hold = owner.getHoldSeconds(); this.steps = owner.getStepsAsLong(); this.maxConcurr = Math.round(owner.getTargetLevelAsDouble()); this.lastCachedTime = System.currentTimeMillis(); } }

Target:
void checkNeedsPropertiesReloading(long now) { if (CACHING_VALIDITY_MS > 0 && now - lastCachedTime > CACHING_VALIDITY_MS) { this.rampUp = owner.getRampUpSeconds(); this.hold = owner.getHoldSeconds(); this.steps = owner.getStepsAsLong(); this.maxConcurr =owner.getTargetLevelAsDouble(); this.defaultShiftRampup = JMeterUtils.getPropDefault("dynamic_tg.shift_rampup_start", 0L); this.lastCachedTime = System.currentTimeMillis(); } }
Source:
public void partHidden(IWorkbenchPartReference partRef) { setActive(partRef, false); }

Target:
public void partHidden(IWorkbenchPartReference partRef) { }
Source:
public void testUpdate() { TaskReviewsMappingsStore taskReviewsMappingStore = getEmptyTaskReviewStore(); addReviewData(review1, descriptionWithTaskUrl1); TaskContainerDelta delta = new TaskContainerDelta(review1, Kind.ADDED); taskReviewsMappingStore.containersChanged(ImmutableSet.of(delta)); assertTrue(taskReviewsMappingStore.getReviewUrls(taskUrl1).contains(reviewUrl1)); addReviewData(review1, descriptionWithTaskUrl2); delta = new TaskContainerDelta(review1, Kind.CONTENT); taskReviewsMappingStore.containersChanged(ImmutableSet.of(delta)); assertFalse(taskReviewsMappingStore.getReviewUrls(taskUrl1).contains(reviewUrl1)); assertTrue(taskReviewsMappingStore.getReviewUrls(taskUrl2).contains(reviewUrl1)); }

Target:
public void testUpdate() throws CoreException { TaskReviewsMappingsStore taskReviewsMappingStore = getEmptyTaskReviewStore(); addReviewData(review1, descriptionWithTaskUrl1); TaskContainerDelta delta = new TaskContainerDelta(review1, Kind.ADDED); taskReviewsMappingStore.containersChanged(ImmutableSet.of(delta)); assertTrue(taskReviewsMappingStore.getReviewUrls(taskUrl1).contains(reviewUrl1)); addReviewData(review1, descriptionWithTaskUrl2); delta = new TaskContainerDelta(review1, Kind.CONTENT); taskReviewsMappingStore.containersChanged(ImmutableSet.of(delta)); assertFalse(taskReviewsMappingStore.getReviewUrls(taskUrl1).contains(reviewUrl1)); assertTrue(taskReviewsMappingStore.getReviewUrls(taskUrl2).contains(reviewUrl1)); }
Source:
public MessageBuffer slice(int offset, int length) { if(offset == 0 && length == size()) return this; else return new MessageBuffer(base, address + offset, length, reference); }

Target:
public MessageBuffer slice(int offset, int length) { if(offset == 0 && length == size()) return this; else { checkArgument(offset + length <= size()); return new MessageBuffer(base, address + offset, length, reference); } }
Source:
public void run() { PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() { public void run() { ScriptConsole console = ScriptConsole.getActive(); if(null != console && console.isRunning()){ console.stop(); } } }); }

Target:
public void run() { PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() { public void run() { if(null != console && console.isRunning()){ console.stop(); } } }); }
Source:
public Object[] factory() { return new Object[] { new TotalOrderStateTransferFunctionalTest("dist-to-1pc-nbst", CacheMode.DIST_SYNC, false, false, StorageType.OBJECT), new TotalOrderStateTransferFunctionalTest("dist-to-2pc-nbst", CacheMode.DIST_SYNC, true, false, StorageType.OBJECT), new TotalOrderStateTransferFunctionalTest("dist-to-1pc-nbst-off-heap", CacheMode.DIST_SYNC, false, false, StorageType.OBJECT), new TotalOrderStateTransferFunctionalTest("dist-to-2pc-nbst-off-heap", CacheMode.DIST_SYNC, false, true, StorageType.OBJECT), new TotalOrderStateTransferFunctionalTest("repl-to-1pc-nbst", CacheMode.REPL_SYNC, true, true, StorageType.OBJECT), new TotalOrderStateTransferFunctionalTest("repl-to-2pc-nbst", CacheMode.REPL_SYNC, true, false, StorageType.OBJECT), new TotalOrderStateTransferFunctionalTest("repl-to-1pc-nbst-off-heap", CacheMode.REPL_SYNC, false, false, StorageType.OBJECT), new TotalOrderStateTransferFunctionalTest("repl-to-1pc-nbst-off-heap", CacheMode.REPL_SYNC, false, true, StorageType.OBJECT) }; }

Target:
public Object[] factory() { return new Object[] { new TotalOrderStateTransferFunctionalTest("dist-to-1pc-nbst", CacheMode.DIST_SYNC, false, false, StorageType.OBJECT), new TotalOrderStateTransferFunctionalTest("dist-to-2pc-nbst", CacheMode.DIST_SYNC, true, false, StorageType.OBJECT), new TotalOrderStateTransferFunctionalTest("dist-to-1pc-nbst-off-heap", CacheMode.DIST_SYNC, false, false, StorageType.OFF_HEAP), new TotalOrderStateTransferFunctionalTest("dist-to-2pc-nbst-off-heap", CacheMode.DIST_SYNC, false, true, StorageType.OFF_HEAP), new TotalOrderStateTransferFunctionalTest("repl-to-1pc-nbst", CacheMode.REPL_SYNC, true, true, StorageType.OBJECT), new TotalOrderStateTransferFunctionalTest("repl-to-2pc-nbst", CacheMode.REPL_SYNC, true, false, StorageType.OBJECT), new TotalOrderStateTransferFunctionalTest("repl-to-1pc-nbst-off-heap", CacheMode.REPL_SYNC, false, false, StorageType.OFF_HEAP), new TotalOrderStateTransferFunctionalTest("repl-to-1pc-nbst-off-heap", CacheMode.REPL_SYNC, false, true, StorageType.OFF_HEAP) }; }
Source:
private static JsonNode applyConfigWithEnvVariables(JsonNode jsonNode) { final JsonNodeType nodeType = jsonNode.getNodeType(); switch (nodeType) { case OBJECT: if (jsonNode.size() > 0) { Iterator<Map.Entry<String, JsonNode>> iterator = jsonNode.fields(); while (iterator.hasNext()) { final Map.Entry<String, JsonNode> next = iterator.next(); next.setValue(applyConfigWithEnvVariables(next.getValue())); } } break; case ARRAY: if (jsonNode.isArray()) { ArrayNode arrayNode = (ArrayNode) jsonNode; for (int i = 0; i < arrayNode.size(); i++) { JsonNode arrayElement = arrayNode.get(i); arrayNode.set(i, applyConfigWithEnvVariables(arrayElement)); } } break; case STRING: final String field = jsonNode.asText(); if (field.startsWith("${") && field.endsWith("}")) { final String envVarKey = field.substring(2, field.length() - 1); if (ENVIRONMENT_VARIABLES.containsKey(envVarKey)) { return JsonNodeFactory.instance.textNode(ENVIRONMENT_VARIABLES.get(envVarKey)); } throw new RuntimeException("Missing environment Variable: " + field); } break; } return jsonNode; }

Target:
private static JsonNode applyConfigWithEnvVariables(JsonNode jsonNode) { final JsonNodeType nodeType = jsonNode.getNodeType(); switch (nodeType) { case OBJECT: if (jsonNode.size() > 0) { Iterator<Map.Entry<String, JsonNode>> iterator = jsonNode.fields(); while (iterator.hasNext()) { final Map.Entry<String, JsonNode> next = iterator.next(); next.setValue(applyConfigWithEnvVariables(next.getValue())); } } break; case ARRAY: if (jsonNode.isArray()) { ArrayNode arrayNode = (ArrayNode) jsonNode; for (int i = 0; i < arrayNode.size(); i++) { JsonNode arrayElement = arrayNode.get(i); arrayNode.set(i, applyConfigWithEnvVariables(arrayElement)); } } break; case STRING: final String field = jsonNode.asText(); if (field.startsWith("${") && field.endsWith("}")) { String[] envVarSplits = field.substring(2, field.length() - 1).split(":", 2); String envVarKey = envVarSplits[0]; if (ENVIRONMENT_VARIABLES.containsKey(envVarKey)) { return JsonNodeFactory.instance.textNode(ENVIRONMENT_VARIABLES.get(envVarKey)); } else if (envVarSplits.length > 1) { return JsonNodeFactory.instance.textNode(envVarSplits[1]); } throw new RuntimeException("Missing environment Variable: " + envVarKey); } break; default: break; } return jsonNode; }
Source:
public PrimitiveLongResourceIterator query( IndexQuery... predicates ) throws IndexNotApplicableKernelException { if ( predicates[0] instanceof ExistsPredicate ) { PrimitiveLongResourceIterator[] iterators = new PrimitiveLongResourceIterator[readerMap.size()]; int i = 0; for ( IndexReader reader : readerMap.values() ) { iterators[i] = reader.query( predicates[0] ); ++i; } return PrimitiveLongResourceCollections.concat( iterators ); } else { NodeValueIterator nodeValueIterator = new NodeValueIterator(); query( nodeValueIterator, IndexOrder.NONE, predicates ); return nodeValueIterator; } }

Target:
public PrimitiveLongResourceIterator query( IndexQuery... predicates ) throws IndexNotApplicableKernelException { if ( predicates[0] instanceof ExistsPredicate ) { PrimitiveLongResourceIterator[] iterators = new PrimitiveLongResourceIterator[readerMap.size()]; int i = 0; for ( IndexReader reader : readerMap.values() ) { iterators[i++] = reader.query( predicates[0] ); } return PrimitiveLongResourceCollections.concat( iterators ); } else { NodeValueIterator nodeValueIterator = new NodeValueIterator(); query( nodeValueIterator, IndexOrder.NONE, predicates ); return nodeValueIterator; } }
Source:
private void handleException(RuntimeException runtimeException) { final Throwable cause = ExceptionUtils.getRootCause(runtimeException); if (cause instanceof TimeoutException || cause instanceof IllegalStateException || cause instanceof NetworkException) { log.warn("WorkflowRequest: Error while running with cause:", this, runtimeException); } else { throw runtimeException; } }

Target:
private void handleException(RuntimeException runtimeException) { final Throwable cause = runtimeException.getCause(); if (cause instanceof TimeoutException || runtimeException instanceof NetworkException) { log.warn("WorkflowRequest: Error while running with cause:", this, runtimeException); } else { throw runtimeException; } }
Source:
public void report(SortedMap<String, Gauge> gauges, SortedMap<String, Counter> counters, SortedMap<String, Histogram> histograms, SortedMap<String, Meter> meters, SortedMap<String, Timer> timers) { for (Map.Entry<String, Counter> entry : counters.entrySet()) { reportCounter(entry.getKey(), entry.getValue()); } meters .entrySet() .stream() .filter(meterEntry -> meterEntry.getKey().startsWith(Meters.THROUGHPUT_BYTES)) .forEach(meterEntry -> reportVolumeCounter(meterEntry.getKey(), meterEntry.getValue().getCount())); }

Target:
public void report(SortedMap<String, Gauge> gauges, SortedMap<String, Counter> counters, SortedMap<String, Histogram> histograms, SortedMap<String, Meter> meters, SortedMap<String, Timer> timers) { counters.forEach((name, counter) -> reportCounter(name, counter)); meters .entrySet() .stream() .filter(meterEntry -> meterEntry.getKey().startsWith(Meters.THROUGHPUT_BYTES)) .forEach(meterEntry -> reportVolumeCounter(meterEntry.getKey(), meterEntry.getValue().getCount())); }