auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void sendMessageToAll(String message) { sessions.forEach( session -> { try { session.getBasicRemote().sendText(message); } catch (IOException e) { LOGGER.error(e.toString()); } } ); }

Target:
private void sendMessageToAll(String message) { sessions.forEach(session -> { try { session.getBasicRemote().sendText(message); } catch (IOException e) { logger.error(e.toString()); } }); }
Source:
RequestContext enter(Plugin plugin) { return local.setContext(new PluginRequestContext( userFactory.create(plugin.getName()))); }

Target:
RequestContext enter(Plugin plugin) { return local.setContext(new PluginRequestContext(plugin.getPluginUser())); }
Source:
private void setUpFAB(FloatingActionButton fab) { fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent shareIntent = new Intent(Intent.ACTION_SEND); String text; if (news.getUrl() != null && !news.getUrl().isEmpty()) { text = news.getUrl(); } else { text = Constants.HN_BASE_URL + news.getId(); } shareIntent.putExtra(Intent.EXTRA_TEXT, text); shareIntent.setType(Constants.MIME_TEXT_PLAIN); startActivity(Intent.createChooser(shareIntent, getResources().getString(R.string.share))); } }); }

Target:
private void setUpFAB(FloatingActionButton fab) { fab.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent shareIntent = new Intent(Intent.ACTION_SEND); shareIntent.putExtra(Intent.EXTRA_SUBJECT, news.getTitle()); String text; if (news.getUrl() != null && !news.getUrl().isEmpty()) { text = news.getUrl(); } else { text = Constants.HN_BASE_URL + news.getId(); } shareIntent.putExtra(Intent.EXTRA_TEXT, text); shareIntent.setType(Constants.MIME_TEXT_PLAIN); startActivity(Intent.createChooser(shareIntent, getResources().getString(R.string.share))); } }); }
Source:
public Map<String, DbParameterAccessor> getAllProcedureParameters( String procName) throws SQLException { String[] qualifiers = NameNormaliser.normaliseName(procName).split( "\\."); String cols = "case parmtype when 4 then NULL else parmname end as parmname, parmdomain, length, rtrim(parmmode), parm_id "; String qry = "select " + cols + " from sys.SYSPROCPARMS where 1=1 and "; if (qualifiers.length == 2) { qry += " (upper(creator)=upper(?) and upper(procname)=upper(?)) "; } else { qry += " (creator=user and upper(procname) = upper(?))"; } return readIntoParams(procName, qry); }

Target:
public Map<String, DbParameterAccessor> getAllProcedureParameters( String procName) throws SQLException { String[] qualifiers = NameNormaliser.normaliseName(procName).split( "\\."); String cols = "case parmtype when 4 then NULL else parmname end as parmname, parmdomain, length, rtrim(parmmode), parm_id "; String qry = "select " + cols + " from sys.SYSPROCPARMS where 1=1 and "; if (qualifiers.length == 2) { qry += " (upper(creator)=upper(?) and upper(procname)=upper(?)) "; } else { qry += " (creator=user and upper(procname) = upper(?))"; } qry += " order by parm_id "; return readIntoParams(procName, qry); }
Source:
public void pushFileToReview(String testIdent, String refSpec, PrivilegeLevel privilegeLevel, String fileName) throws Exception { changeId = "I" + StringUtils.rightPad(testIdent, 40, "a"); CommitCommand command = createCommitCommand(changeId); addFile(fileName); CommitResult result = commitAndPush(command, refSpec, privilegeLevel); String testMessage = result.push.getMessages(); System.out.println(testMessage); shortId = StringUtils.trimToEmpty(StringUtils.substringAfterLast(result.push.getMessages(), "/")); shortId = StringUtils.removeEnd(shortId, " [DRAFT]"); commitId = result.commit.getId().toString(); assertThat("Bad Push: " + result.push.getMessages(), shortId.length(), greaterThan(0)); }

Target:
public void pushFileToReview(String testIdent, String refSpec, PrivilegeLevel privilegeLevel, String fileName) throws Exception { changeId = "I" + StringUtils.rightPad(testIdent, 40, "a"); CommitCommand command = createCommitCommand(changeId); addFile(fileName); CommitResult result = commitAndPush(command, refSpec, privilegeLevel); shortId = StringUtils.trimToEmpty(StringUtils.substringAfterLast(result.push.getMessages(), "/")); shortId = StringUtils.removeEnd(shortId, " [DRAFT]"); commitId = result.commit.getId().toString(); assertThat("Bad Push: " + result.push.getMessages(), shortId.length(), greaterThan(0)); }
Source:
private HttpMessage createMessage() { HttpMessage message = new HttpMessage(); try { message.getRequestHeader().setURI(new URI("<LINK_0>", false)); } catch (URIException | NullPointerException e) { } return message; }

Target:
private static HttpMessage createMessage() { HttpMessage message = new HttpMessage(); try { message.getRequestHeader().setURI(new URI("<LINK_0>", false)); } catch (URIException | NullPointerException e) { } return message; }
Source:
public Properties getKafkaProducerProperties() { final Properties producerProps = getKafkaProperties(); producerProps.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer"); producerProps.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer"); producerProps.put("acks", "all"); producerProps.put("request.timeout.ms", kafkaSettings.getRequestTimeoutMs()); producerProps.put("batch.size", kafkaSettings.getBatchSize()); producerProps.put("linger.ms", kafkaSettings.getLingerMs()); return producerProps; }

Target:
public Properties getKafkaProducerProperties() { final Properties producerProps = getKafkaConsumerProperties(); producerProps.put("value.serializer", "org.apache.kafka.common.serialization.StringSerializer"); producerProps.put("key.serializer", "org.apache.kafka.common.serialization.StringSerializer"); producerProps.put("acks", "all"); producerProps.put("request.timeout.ms", kafkaSettings.getRequestTimeoutMs()); producerProps.put("batch.size", kafkaSettings.getBatchSize()); producerProps.put("linger.ms", kafkaSettings.getLingerMs()); return producerProps; }
Source:
public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.EXCEPT_CLAUSE, ctx -> { ExceptClause exceptClause = (ExceptClause) ctx.syntaxNode(); Map<String, List<Expression>> caughtExceptionsByFQN = new HashMap<>(); Expression exceptionExpression = exceptClause.exception(); if (exceptionExpression == null || !exceptionExpression.is(Tree.Kind.TUPLE)) { return; } Tuple exceptionsTuple = (Tuple) exceptionExpression; exceptionsTuple.elements().forEach(e -> addExceptionExpression(e, caughtExceptionsByFQN)); checkCaughtExceptions(ctx, caughtExceptionsByFQN); }); }

Target:
public void initialize(Context context) { context.registerSyntaxNodeConsumer(Tree.Kind.EXCEPT_CLAUSE, ctx -> { ExceptClause exceptClause = (ExceptClause) ctx.syntaxNode(); Map<ClassSymbol, List<Expression>> caughtExceptionsBySymbol = new HashMap<>(); Expression exceptionExpression = exceptClause.exception(); if (exceptionExpression == null) { return; } TreeUtils.flattenTuples(exceptionExpression).forEach(e -> addExceptionExpression(e, caughtExceptionsBySymbol)); checkCaughtExceptions(ctx, caughtExceptionsBySymbol); }); }
Source:
public synchronized UserFromAuthProvider getUserInfo(final String internalProviderReference) throws NoUserException, IOException, AuthenticatorSecurityException { Credential credentials = credentialStore.get(internalProviderReference); twitter.setOAuthAccessToken(new AccessToken(credentials.getAccessToken(), credentials.getRefreshToken())); try { twitter4j.User userInfo = twitter.verifyCredentials(); if (userInfo != null) { String givenName = null; String familyName = null; if (userInfo.getName() != null) { String[] names = userInfo.getName().split(" "); if (names.length > 0) { givenName = names[0]; } if (names.length > 1) { familyName = names[1]; } } String email = userInfo.getEmail(); if (null == email) { email = userInfo.getId() + "-twitter"; } return new UserFromAuthProvider(String.valueOf(userInfo.getId()), givenName, familyName, email, EmailVerificationStatus.NOT_VERIFIED, null, null, null); } else { throw new NoUserException(); } } catch (TwitterException e) { throw new IOException(e.getMessage()); } }

Target:
public synchronized UserFromAuthProvider getUserInfo(final String internalProviderReference) throws NoUserException, IOException, AuthenticatorSecurityException { Credential credentials = credentialStore.get(internalProviderReference); twitter.setOAuthAccessToken(new AccessToken(credentials.getAccessToken(), credentials.getRefreshToken())); try { twitter4j.User userInfo = twitter.verifyCredentials(); if (userInfo != null) { String givenName = null; String familyName = null; if (userInfo.getName() != null) { String[] names = userInfo.getName().split(" "); if (names.length > 0) { givenName = names[0]; } if (names.length > 1) { familyName = names[1]; } } EmailVerificationStatus emailStatus = EmailVerificationStatus.NOT_VERIFIED; String email = userInfo.getEmail(); if (null == email) { email = userInfo.getId() + "-twitter"; emailStatus = EmailVerificationStatus.DELIVERY_FAILED; } return new UserFromAuthProvider(String.valueOf(userInfo.getId()), givenName, familyName, email, emailStatus, null, null, null); } else { throw new NoUserException(); } } catch (TwitterException e) { throw new IOException(e.getMessage()); } }
Source:
void onUpdate(ClickEvent event) { update(); if (Gerrit.isSignedIn()) { persistDiffPreferences(); } }

Target:
void onUpdate(ClickEvent event) { update(); }
Source:
public Response toolsIdVersionsVersionIdTypeTestsGet(String type, String id, String versionId, SecurityContext securityContext) throws NotFoundException { if (type == null) { return Response.status(Response.Status.BAD_REQUEST).build(); } SourceFile.FileType fileType = getFileType(type); if (fileType == null) { return Response.status(Response.Status.NOT_FOUND).build(); } switch (fileType) { case DOCKSTORE_CWL: return getFileByToolVersionID(id, versionId, CWL_TEST_JSON, null, false); case DOCKSTORE_WDL: return Response.status(Response.Status.BAD_REQUEST).build(); case DOCKERFILE: return Response.status(Response.Status.BAD_REQUEST).build(); case CWL_TEST_JSON: return getFileByToolVersionID(id, versionId, CWL_TEST_JSON, null, false); case WDL_TEST_JSON: return getFileByToolVersionID(id, versionId, WDL_TEST_JSON, null, false); default: return Response.status(Response.Status.BAD_REQUEST).build(); } }

Target:
public Response toolsIdVersionsVersionIdTypeTestsGet(String type, String id, String versionId, SecurityContext securityContext) throws NotFoundException { if (type == null) { return Response.status(Response.Status.BAD_REQUEST).build(); } SourceFile.FileType fileType = getFileType(type); if (fileType == null) { return Response.status(Response.Status.NOT_FOUND).build(); } switch (fileType) { case CWL_TEST_JSON: case DOCKSTORE_CWL: return getFileByToolVersionID(id, versionId, CWL_TEST_JSON, null, false); case WDL_TEST_JSON: case DOCKSTORE_WDL: return getFileByToolVersionID(id, versionId, WDL_TEST_JSON, null, false); case DOCKERFILE: return Response.status(Response.Status.BAD_REQUEST).build(); default: return Response.status(Response.Status.BAD_REQUEST).build(); } }
Source:
public DatabaseClient connect(RuntimeContainer container) throws IOException { MarkLogicConnectionProperties properties = getMarkLogicConnectionProperties(); if (properties.getReferencedComponentId() != null && container != null) { DatabaseClient client = (DatabaseClient) container.getComponentData(container.getCurrentComponentId(), CONNECTION); if (client != null) { return client; } throw new IOException("Referenced component: " + properties.getReferencedComponentId() + " not connected"); } SecurityContext context = "BASIC".equals(properties.authentication.getValue()) ? new DatabaseClientFactory.BasicAuthContext(properties.username.getValue(), properties.password.getValue()) : new DatabaseClientFactory.DigestAuthContext(properties.username.getValue(), properties.password.getValue()); DatabaseClient client = DatabaseClientFactory.newClient(properties.host.getValue(), properties.port.getValue(), properties.database.getValue(), context); client.openTransaction().commit(); LOGGER.info("Connected to MarkLogic server"); if (container != null) { container.setComponentData(container.getCurrentComponentId(), CONNECTION, client); LOGGER.info("Connection stored in container"); } return client; }

Target:
public DatabaseClient connect(RuntimeContainer container) throws IOException { MarkLogicConnectionProperties properties = getMarkLogicConnectionProperties(); if (properties.getReferencedComponentId() != null && container != null) { DatabaseClient client = (DatabaseClient) container.getComponentData(container.getCurrentComponentId(), CONNECTION); if (client != null) { return client; } throw new IOException("Referenced component: " + properties.getReferencedComponentId() + " not connected"); } SecurityContext context = "BASIC".equals(properties.authentication.getValue()) ? new DatabaseClientFactory.BasicAuthContext(properties.username.getValue(), properties.password.getValue()) : new DatabaseClientFactory.DigestAuthContext(properties.username.getValue(), properties.password.getValue()); DatabaseClient client = DatabaseClientFactory.newClient(properties.host.getValue(), properties.port.getValue(), properties.database.getValue(), context); testConnection(client); LOGGER.info("Connected to MarkLogic server"); if (container != null) { container.setComponentData(container.getCurrentComponentId(), CONNECTION, client); LOGGER.info("Connection stored in container"); } return client; }
Source:
private void connect(final WebSocket webSocket) { new Thread(new Runnable() { @Override public void run() { if (authenticator.getAccessToken() != null) { accessToken = "Bearer " + authenticator.getAccessToken().getAccessToken(); webSocket.addHeader("Authorization", accessToken); try { webSocket.connect(); } catch (WebSocketException e) { e.printStackTrace(); } } } }).start(); }

Target:
private void connect(final WebSocket webSocket) { new Thread(new Runnable() { @Override public void run() { if (authenticator.getAccessToken() != null) { accessToken = "Bearer " + authenticator.getAccessToken().getAccessToken(); webSocket.addHeader("Authorization", accessToken); webSocket.connectAsynchronously(); } } }).start(); }
Source:
public Node visitUnarySend(UnarySendContext ctx) { StatNode statement = (StatNode) visit(ctx.stmt()); String selector = ctx.method.getText(); List<ExprNode> arguments = new ArrayList<>(); return new SendNode(statement, selector, arguments); }

Target:
public Node visitUnarySend(UnarySendContext ctx) { ExprNode expression = (ExprNode) visit(ctx.expr()); String selector = buildSelector(ctx.ID()); List<ExprNode> arguments = new ArrayList<>(); return new SendNode(expression, selector, arguments); }
Source:
public List<MetricFamilySamples> collect() { List<MetricFamilySamples> mfs = new ArrayList<MetricFamilySamples>(); try { Method method = osBean.getClass().getMethod("getProcessCpuTime", null); if (!method.isAccessible()) { method.setAccessible(true); } Long l = (Long) method.invoke(osBean); mfs.add(new CounterMetricFamily("process_cpu_seconds_total", "Total user and system CPU time spent in seconds.", l / NANOSECONDS_PER_SECOND)); } catch ( Exception e ) { LOGGER.log(Level.WARNING, "Could not access process cpu time", e); } mfs.add(new GaugeMetricFamily("process_start_time_seconds","Start time of the process since unix epoch in seconds.", runtimeBean.getStartTime() / MILLISECONDS_PER_SECOND)); if (unix) { UnixOperatingSystemMXBean unixBean = (UnixOperatingSystemMXBean) osBean; mfs.add(new GaugeMetricFamily("process_open_fds", "Number of open file descriptors.", unixBean.getOpenFileDescriptorCount())); mfs.add(new GaugeMetricFamily("process_max_fds", "Maximum number of open file descriptors.", unixBean.getMaxFileDescriptorCount())); } if (linux) { try { collectMemoryMetricsLinux(mfs); } catch (Exception e) { LOGGER.warning(e.toString()); } } return mfs; }

Target:
public List<MetricFamilySamples> collect() { List<MetricFamilySamples> mfs = new ArrayList<MetricFamilySamples>(); try { Method method = osBean.getClass().getMethod("getProcessCpuTime", null); if (!method.isAccessible()) { method.setAccessible(true); } Long l = (Long) method.invoke(osBean); mfs.add(new CounterMetricFamily("process_cpu_seconds_total", "Total user and system CPU time spent in seconds.", l / NANOSECONDS_PER_SECOND)); } catch (Exception e) { LOGGER.log(Level.FINE,"Could not access process cpu time", e); } mfs.add(new GaugeMetricFamily("process_start_time_seconds", "Start time of the process since unix epoch in seconds.", runtimeBean.getStartTime() / MILLISECONDS_PER_SECOND)); if (unix) { UnixOperatingSystemMXBean unixBean = (UnixOperatingSystemMXBean) osBean; mfs.add(new GaugeMetricFamily("process_open_fds", "Number of open file descriptors.", unixBean.getOpenFileDescriptorCount())); mfs.add(new GaugeMetricFamily("process_max_fds", "Maximum number of open file descriptors.", unixBean.getMaxFileDescriptorCount())); } if (linux) { try { collectMemoryMetricsLinux(mfs); } catch (Exception e) { LOGGER.warning(e.toString()); } } return mfs; }
Source:
public UnderFileSystem create(String path, UnderFileSystemConfiguration conf) { if (mUfs == null) { Preconditions.checkArgument(path != null, "path may not be null"); return new ManagedBlockingUfsForwarder( new SleepingUnderFileSystem(new AlluxioURI(path), mOptions, conf)); } else { return mUfs; } }

Target:
public UnderFileSystem create(String path, UnderFileSystemConfiguration conf) { conf.set(PropertyKey.MASTER_UFS_MANAGED_BLOCKING_ENABLED, true); if (mUfs == null) { Preconditions.checkArgument(path != null, "path may not be null"); return new SleepingUnderFileSystem(new AlluxioURI(path), mOptions, conf); } else { return mUfs; } }
Source:
protected Response unwrapException(HttpRequest request, Throwable e, RESTEasyTracingLogger logger) { Response jaxrsResponse = null; Throwable unwrappedException = e.getCause(); if (unwrappedException instanceof WebApplicationException) { WebApplicationException wae = (WebApplicationException) unwrappedException; Response response = wae.getResponse(); if (response != null) { try { if (response.getEntity() != null) return response; } catch(IllegalStateException ise) { return response; } } } jaxrsResponse = executeExceptionMapper(unwrappedException, logger); if (jaxrsResponse != null) { return jaxrsResponse; } if (unwrappedException instanceof WebApplicationException) { return handleWebApplicationException((WebApplicationException) unwrappedException); } else if (unwrappedException instanceof Failure) { return handleFailure(request, (Failure) unwrappedException); } else { if (unwrappedExceptions.contains(unwrappedException.getClass().getName()) && unwrappedException.getCause() != null) { return unwrapException(request, unwrappedException, logger); } else { return null; } } }

Target:
protected Response unwrapException(HttpRequest request, Throwable e, RESTEasyTracingLogger logger) { Response jaxrsResponse = null; Throwable unwrappedException = e.getCause(); if (unwrappedException instanceof WebApplicationException) { WebApplicationException wae = (WebApplicationException) unwrappedException; Response response = wae.getResponse(); if (response != null) { try { if (response.getEntity() != null) return response; } catch(IllegalStateException ise) { } } } jaxrsResponse = executeExceptionMapper(unwrappedException, logger); if (jaxrsResponse != null) { return jaxrsResponse; } if (unwrappedException instanceof WebApplicationException) { return handleWebApplicationException((WebApplicationException) unwrappedException); } else if (unwrappedException instanceof Failure) { return handleFailure(request, (Failure) unwrappedException); } else { if (unwrappedExceptions.contains(unwrappedException.getClass().getName()) && unwrappedException.getCause() != null) { return unwrapException(request, unwrappedException, logger); } else { return null; } } }
Source:
public Response createFile( @PathParam ( "pathId" ) String pathId, InputStream fileContents ) { try { checkCorrectExtension( pathId ); fileService.createFile( httpServletRequest.getCharacterEncoding(), pathId, fileContents ); return buildOkResponse(); } catch ( FileService.InvalidNameException t ) { return Response.status( Response.Status.FORBIDDEN ).entity( "containsIllegalCharacters" ).build(); } catch ( Throwable t ) { return buildServerErrorResponse( t ); } }

Target:
public Response createFile( @PathParam ( "pathId" ) String pathId, InputStream fileContents ) { try { checkCorrectExtension( pathId ); fileService.createFile( httpServletRequest.getCharacterEncoding(), pathId, fileContents ); return buildOkResponse(); } catch ( FileService.InvalidNameException e ) { return Response.status( Response.Status.FORBIDDEN ).entity( "containsIllegalCharacters" ).build(); } catch ( Throwable t ) { return buildServerErrorResponse( t ); } }
Source:
public void testBasePathOK() throws Exception { FreeStyleProject p = j.createFreeStyleProject(); p.getBuildersList().replaceBy(Collections.singleton(new CreateFilesForBasePathTest())); ArtifactArchiver archiver = new ArtifactArchiver("**"); archiver.setBasePath("module/dist"); p.getPublishersList().replaceBy(Collections.singleton(archiver)); assertEquals(Result.SUCCESS, build(p)); VirtualFile artifacts = p.getBuildByNumber(1).getArtifactManager().root(); assertTrue(artifacts.child("target").child("file").exists()); }

Target:
public void testBasePathOK() throws Exception { FreeStyleProject p = j.createFreeStyleProject(); p.getBuildersList().replaceBy(Collections.singleton(new CreateFilesForBasePathTest())); ArtifactArchiver archiver = new ArtifactArchiver("**"); archiver.setBasePath("module/dist"); p.getPublishersList().replaceBy(Collections.singleton(archiver)); j.buildAndAssertSuccess(p); VirtualFile artifacts = p.getBuildByNumber(1).getArtifactManager().root(); assertTrue("file was archived", artifacts.child("target").child("file").exists()); }
Source:
private void buildGraphWithHadoop(GenomixJobConf conf) throws Exception { LOG.info("Building Graph using Hadoop..."); manager.startCluster(ClusterType.HADOOP); GenomixJobConf.tick("buildGraphWithHadoop"); edu.uci.ics.genomix.hadoop.contrailgraphbuilding.GenomixHadoopDriver hadoopDriver = new edu.uci.ics.genomix.hadoop.contrailgraphbuilding.GenomixHadoopDriver(); hadoopDriver.run(prevOutput, curOutput, numCoresPerMachine * numMachines, Integer.parseInt(conf.get(GenomixJobConf.KMER_LENGTH)), 4 * 100000, true, conf); followingBuild = true; manager.stopCluster(ClusterType.HADOOP); LOG.info("Building the graph took " + GenomixJobConf.tock("buildGraphWithHadoop") + "ms"); }

Target:
private void buildGraphWithHadoop(GenomixJobConf conf) throws Exception { LOG.info("Building Graph using Hadoop..."); manager.startCluster(ClusterType.HADOOP); GenomixJobConf.tick("buildGraphWithHadoop"); GenomixHadoopDriver hadoopDriver = new GenomixHadoopDriver(); hadoopDriver.run(prevOutput, curOutput, numCoresPerMachine * numMachines, Integer.parseInt(conf.get(GenomixJobConf.KMER_LENGTH)), 4 * 100000, true, conf); followingBuild = true; manager.stopCluster(ClusterType.HADOOP); LOG.info("Building the graph took " + GenomixJobConf.tock("buildGraphWithHadoop") + "ms"); }
Source:
ApolloDynamicConfiguration(URL url) { this.url = url; String configEnv = url.getParameter(APOLLO_ENV_KEY); String configAddr = getAddressWithProtocolPrefix(url); String configCluster = url.getParameter(CLUSTER_KEY); if (configEnv != null) { System.setProperty(APOLLO_ENV_KEY, configEnv); } if (StringUtils.isEmpty(System.getProperty(APOLLO_ENV_KEY)) && !ANYHOST_VALUE.equals(configAddr)) { System.setProperty(APOLLO_ADDR_KEY, configAddr); } if (configCluster != null) { System.setProperty(APOLLO_CLUSTER_KEY, configCluster); } dubboConfig = ConfigService.getConfig(url.getParameter(CONFIG_NAMESPACE_KEY, DEFAULT_GROUP)); dubboConfigFile = ConfigService.getConfigFile(url.getParameter(CONFIG_NAMESPACE_KEY, DEFAULT_GROUP), ConfigFileFormat.Properties); governanceConfig = ConfigService.getConfig(url.getParameter(CONFIG_GOVERNANCE_NAMESPACE_KEY, DEFAULT_DUBBO_CONFIG_GOVERNANCCE_NAMESPACE)); boolean check = url.getParameter(CHECK_KEY, true); if (dubboConfig.getSourceType() != ConfigSourceType.REMOTE) { if (check) { throw new IllegalStateException("Failed to connect to config center, the config center is Apollo, " + "the address is: " + (StringUtils.isNotEmpty(configAddr) ? configAddr : configEnv)); } else { logger.warn("Failed to connect to config center, the config center is Apollo, " + "the address is: " + (StringUtils.isNotEmpty(configAddr) ? configAddr : configEnv) + ", will use the local cache value instead before eventually the connection is established."); } } }

Target:
ApolloDynamicConfiguration(URL url) { this.url = url; String configEnv = url.getParameter(APOLLO_ENV_KEY); String configAddr = getAddressWithProtocolPrefix(url); String configCluster = url.getParameter(CLUSTER_KEY); if (configEnv != null) { System.setProperty(APOLLO_ENV_KEY, configEnv); } if (StringUtils.isEmpty(System.getProperty(APOLLO_ENV_KEY)) && !ANYHOST_VALUE.equals(configAddr)) { System.setProperty(APOLLO_ADDR_KEY, configAddr); } if (configCluster != null) { System.setProperty(APOLLO_CLUSTER_KEY, configCluster); } dubboConfig = ConfigService.getConfig(url.getParameter(CONFIG_NAMESPACE_KEY, DEFAULT_GROUP)); dubboConfigFile = ConfigService.getConfigFile(url.getParameter(CONFIG_NAMESPACE_KEY, DEFAULT_GROUP), ConfigFileFormat.Properties); governanceConfig = ConfigService.getConfig(url.getParameter(CONFIG_NAMESPACE_KEY, DEFAULT_GROUP) + CONFIG_GOVERNANCE_NAMESPACE_SUFFIX); boolean check = url.getParameter(CHECK_KEY, true); if (dubboConfig.getSourceType() != ConfigSourceType.REMOTE) { if (check) { throw new IllegalStateException("Failed to connect to config center, the config center is Apollo, " + "the address is: " + (StringUtils.isNotEmpty(configAddr) ? configAddr : configEnv)); } else { logger.warn("Failed to connect to config center, the config center is Apollo, " + "the address is: " + (StringUtils.isNotEmpty(configAddr) ? configAddr : configEnv) + ", will use the local cache value instead before eventually the connection is established."); } } }
Source:
void processReplicaRemovalTask(HashMismatchMessage message) { final RealVoltDB db = (RealVoltDB) VoltDB.instance(); if (db.rejoining() || db.isJoining()) { VoltDB.crashLocalVoltDB("Hash mismatch found before this node could finish " + (db.rejoining() ? "rejoin" : "join") + "As a result, the rejoin operation has been canceled."); return; } if (db.m_leaderAppointer == null || !db.m_leaderAppointer.isLeader()) { return; } synchronized(m_lock) { if (m_replicaRemovalExecutor == null) { m_replicaRemovalExecutor = Executors.newSingleThreadScheduledExecutor( CoreUtils.getThreadFactory("ReplicaRemoval")); } m_replicaRemovalExecutor.schedule(() -> { if (!decommissionReplicas()) { if (tmLog.isDebugEnabled()) { tmLog.debug("@StopReplicas is blocked, reshchedule it."); } m_mailbox.deliver(new HashMismatchMessage()); } }, 2, TimeUnit.SECONDS); } }

Target:
void processReplicaRemovalTask(HashMismatchMessage message) { final RealVoltDB db = (RealVoltDB) VoltDB.instance(); if (db.rejoining() || db.isJoining()) { VoltDB.crashLocalVoltDB("Hash mismatch found before this node could finish " + (db.rejoining() ? "rejoin" : "join") + "As a result, the rejoin operation has been canceled."); return; } if (db.m_leaderAppointer == null || !db.m_leaderAppointer.isLeader()) { return; } synchronized(m_lock) { if (m_replicaRemovalExecutor == null) { m_replicaRemovalExecutor = Executors.newSingleThreadScheduledExecutor( CoreUtils.getThreadFactory("ReplicaRemoval")); } if (message.isReschedule()) { if (tmLog.isDebugEnabled()) { tmLog.debug("@StopReplicas is blocked, reshcheduled."); } m_replicaRemovalExecutor.schedule(() -> { if (!decommissionReplicas()) { m_mailbox.deliver(new HashMismatchMessage(true)); } }, 2, TimeUnit.SECONDS); } else { m_replicaRemovalExecutor.submit(() -> { if (!decommissionReplicas()) { m_mailbox.deliver(new HashMismatchMessage(true)); } }); } } }
Source:
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { logger.trace("Found bean: {}", beanName); if(displayMessages.containsKey(beanName) || beanName.contains("org.springframework.security.authentication.DefaultAuthenticationEventPublisher")) { String displayMessage = displayMessages.getOrDefault(beanName, displayMessages.get("fallback")); progress.onNext(displayMessage); } return bean; }

Target:
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException { logger.trace("Found bean: {}", beanName); if(displayMessages.containsKey(beanName) || beanName.contains(DefaultAuthenticationEventPublisher.class.getName())) { String displayMessage = displayMessages.getOrDefault(beanName, displayMessages.get("fallback")); progress.onNext(displayMessage); } return bean; }
Source:
private ControlGroup(String line) throws NumberFormatException, IndexOutOfBoundsException { String[] fields = line.split(":"); if (fields.length > 1) { id = Integer.parseInt(fields[0]); subsystems = fields[1]; group = fields[2]; } else { id = -1; subsystems = "None"; group = fields[0]; } }

Target:
private ControlGroup(String line) throws NumberFormatException, IndexOutOfBoundsException { String[] fields = line.split(":"); id = Integer.parseInt(fields[0]); subsystems = fields[1]; group = fields[2]; }
Source:
public static Set<String> readTerms(String field, Directory directory) throws IOException { DirectoryReader reader = DirectoryReader.open(directory); Set<String> termStrings = new TreeSet<>(); for (AtomicReaderContext atomicReaderContext : reader.leaves()) { AtomicReader atomicReader = atomicReaderContext.reader(); TermsEnum iterator = atomicReader.terms(field).iterator(null); BytesRef next = iterator.next(); while (next != null) { termStrings.add(iterator.term().utf8ToString()); next = iterator.next(); } } return termStrings; }

Target:
public static Set<String> readTerms(String field, Directory directory) throws IOException { try (DirectoryReader reader = DirectoryReader.open(directory)) { Set<String> termStrings = new TreeSet<>(); for (AtomicReaderContext atomicReaderContext : reader.leaves()) { AtomicReader atomicReader = atomicReaderContext.reader(); TermsEnum iterator = atomicReader.terms(field).iterator(null); BytesRef next = iterator.next(); while (next != null) { termStrings.add(iterator.term().utf8ToString()); next = iterator.next(); } } return termStrings; } }
Source:
public void shutdown() { fShutdown = true; Job.getJobManager().cancel(AbstractDispatchJob.class); }

Target:
public void shutdown() { fShutdown = true; Job.getJobManager().cancel(this); }
Source:
private void renderFlatTable(StringBuilder tableBuilder, String id, String header, ModelUsageData treeItem) { tableBuilder.append("<table id='summary-" + id + "' class='tablesorter nicetable noauto'>"); tableBuilder.append(renderCaption(id, header, true)); tableBuilder.append( "<thead><tr><th>Class</th><th>Instances Injected</th><th>Total Init Time [ms]</th class=\"{sorter: 'floating'}\"><th>Avg. Init Time [ms]</th></tr></thead><tbody>"); for (Entry<Class<?>, ModelUsageData> entry : flattenStats(treeItem).entrySet()) { ModelUsageData stats = entry.getValue(); Long instancesCount = stats.getCount(); Long totalTime = stats.getTotalTime(); double avgTime = stats.getAverageTime(); tableBuilder.append("<tr><td>"); tableBuilder.append(entry.getKey().getName()); tableBuilder.append("</td><td>"); tableBuilder.append(instancesCount.toString()); tableBuilder.append("</td><td>"); tableBuilder.append(totalTime.toString()); tableBuilder.append("</td><td>"); tableBuilder.append(String.format("%.3f", avgTime)); tableBuilder.append("</td></tr>"); } tableBuilder.append("</tbody></table>"); tableBuilder.append("<script>$(document).ready(function() {$('#summary-" + id + "').tablesorter({sortList:[[2,1]]})});</script>"); }

Target:
private void renderFlatTable(StringBuilder tableBuilder, String id, String header, ModelUsageData treeItem) { tableBuilder.append("<table id='summary-" + id + "' class='tablesorter nicetable noauto'>"); tableBuilder.append(renderCaption(id, header, true)); tableBuilder.append( "<thead><tr><th>Class</th><th>Instances Injected</th><th>Total Init Time [ms]</th class=\"{sorter: 'floating'}\"><th>Avg. Init Time [ms]</th></tr></thead><tbody>"); for (Entry<Class<?>, ModelUsageData> entry : flattenStats(treeItem).entrySet()) { ModelUsageData stats = entry.getValue(); Long instancesCount = stats.getCount(); Long totalTime = stats.getTotalTimeInMillis(); double avgTime = stats.getAverageTimeInMillis(); tableBuilder.append("<tr><td>"); tableBuilder.append(entry.getKey().getName()); tableBuilder.append("</td><td>"); tableBuilder.append(instancesCount.toString()); tableBuilder.append("</td><td>"); tableBuilder.append(totalTime.toString()); tableBuilder.append("</td><td>"); tableBuilder.append(String.format("%.3f", avgTime)); tableBuilder.append("</td></tr>"); } tableBuilder.append("</tbody></table>"); tableBuilder.append("<script>$(document).ready(function() {$('#summary-" + id + "').tablesorter({sortList:[[2,1]]})});</script>"); }
Source:
public void setUp() { dummyRequest = new DummyHttpServletRequestUser(); dummyRequest.setHeader("authorization", "Basic Zm9vOmJhcg=="); }

Target:
public void setUp() { dummyRequest = new DummyHttpServletRequestUser(); }
Source:
private static long parseUnsignedHex(String s) { final long a = Long.parseLong(s.substring(1), 16); long b = Long.parseLong(s.substring(0, 1), 16); b <<= 60; return a | b; }

Target:
private static long parseUnsignedHex(String s) { final long h = Long.parseLong(s.substring(0, 1), 16); final long l = Long.parseLong(s.substring(1), 16); return (h << 60) | l; }
Source:
private void serverAddedSegment(final DruidServerMetadata server, final DataSegment segment) { String segmentId = segment.getIdentifier(); synchronized (lock) { log.debug("Adding segment[%s] for server[%s]", segment, server); Set<DruidServerMetadata> servers = this.servers.get(segmentId); if (servers == null) { servers = Sets.newConcurrentHashSet(); VersionedIntervalTimeline<String, SegmentLoadInfo> timeline = timelines.get(segment.getDataSource()); if (timeline == null) { timeline = new VersionedIntervalTimeline<>(Ordering.natural()); timelines.put(segment.getDataSource(), timeline); } timeline.add( segment.getInterval(), segment.getVersion(), segment.getShardSpec().createChunk(new SegmentLoadInfo(segment, servers)) ); this.servers.put(segmentId, servers); } servers.add(server); } }

Target:
private void serverAddedSegment(final DruidServerMetadata server, final DataSegment segment) { String segmentId = segment.getIdentifier(); synchronized (lock) { log.debug("Adding segment[%s] for server[%s]", segment, server); SegmentLoadInfo segmentLoadInfo = segmentLoadInfos.get(segmentId); if (segmentLoadInfo == null) { segmentLoadInfo = new SegmentLoadInfo(segment); VersionedIntervalTimeline<String, SegmentLoadInfo> timeline = timelines.get(segment.getDataSource()); if (timeline == null) { timeline = new VersionedIntervalTimeline<>(Ordering.natural()); timelines.put(segment.getDataSource(), timeline); } timeline.add( segment.getInterval(), segment.getVersion(), segment.getShardSpec().createChunk(segmentLoadInfo) ); segmentLoadInfos.put(segmentId, segmentLoadInfo); } segmentLoadInfo.addServer(server); } }
Source:
@Override Bitmap decode(Uri uri, PicassoBitmapOptions options) throws IOException { options.exifRotation = Utils.getFileExifRotation(uri.getPath()); return super.decode(uri, options); }

Target:
@Override Bitmap decode(Uri uri, PicassoBitmapOptions options) throws IOException { if (options != null) { options.exifRotation = getFileExifRotation(uri.getPath()); } return super.decode(uri, options); }
Source:
private MirrorOptions createMirrorOptions() { MirrorOptions options = new MirrorOptions(); options.setFollowOnlyFilteredRequirements(followOnlyFilteredRequirements); options.setFollowStrictOnly(followStrictOnly); options.setIncludeFeatures(includeFeature); options.setIncludeNonGreedy(includeNonGreedy); options.setIncludeOptional(includeOptional); options.setLatestVersionOnly(latestVersionOnly); return options; }

Target:
private MirrorOptions createMirrorOptions() { MirrorOptions options = new MirrorOptions(); options.setFollowOnlyFilteredRequirements(this.followOnlyFilteredRequirements); options.setFollowStrictOnly(this.followStrictOnly); options.setIncludeFeatures(this.includeFeature); options.setIncludeNonGreedy(this.includeNonGreedy); options.setIncludeOptional(this.includeOptional); options.setLatestVersionOnly(this.latestVersionOnly); return options; }
Source:
public static void main(String... args) throws InterruptedException { System.out.println(">>> Decision tree regression trainer example started."); try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) { System.out.println(">>> Ignite grid started."); IgniteThread igniteThread = new IgniteThread(ignite.configuration().getIgniteInstanceName(), DecisionTreeRegressionTrainerExample.class.getSimpleName(), () -> { CacheConfiguration<Integer, Point> trainingSetCfg = new CacheConfiguration<>(); trainingSetCfg.setName("TRAINING_SET"); trainingSetCfg.setAffinity(new RendezvousAffinityFunction(false, 1)); IgniteCache<Integer, Point> trainingSet = ignite.createCache(trainingSetCfg); generatePoints(trainingSet); DecisionTreeRegressionTrainer trainer = new DecisionTreeRegressionTrainer(10, 0, false); DecisionTreeNode mdl = trainer.fit( ignite, trainingSet, (k, v) -> VectorUtils.of(v.x), (k, v) -> v.y ); System.out.println(">>> Decision tree regression model: " + mdl); System.out.println(">>> ---------------------------------"); System.out.println(">>> | Prediction\t| Ground Truth\t|"); System.out.println(">>> ---------------------------------"); for (int x = 0; x < 10; x++) { double predicted = mdl.apply(VectorUtils.of(x)); System.out.printf(">>> | %.4f\t\t| %.4f\t\t|\n", predicted, Math.sin(x)); } System.out.println(">>> ---------------------------------"); System.out.println(">>> Decision tree regression trainer example completed."); }); igniteThread.start(); igniteThread.join(); } }

Target:
public static void main(String... args) throws InterruptedException { System.out.println(">>> Decision tree regression trainer example started."); try (Ignite ignite = Ignition.start("examples/config/example-ignite.xml")) { System.out.println(">>> Ignite grid started."); IgniteThread igniteThread = new IgniteThread(ignite.configuration().getIgniteInstanceName(), DecisionTreeRegressionTrainerExample.class.getSimpleName(), () -> { CacheConfiguration<Integer, Point> trainingSetCfg = new CacheConfiguration<>(); trainingSetCfg.setName("TRAINING_SET"); trainingSetCfg.setAffinity(new RendezvousAffinityFunction(false, 10)); IgniteCache<Integer, Point> trainingSet = ignite.createCache(trainingSetCfg); generatePoints(trainingSet); DecisionTreeRegressionTrainer trainer = new DecisionTreeRegressionTrainer(10, 0); DecisionTreeNode mdl = trainer.fit( ignite, trainingSet, (k, v) -> VectorUtils.of(v.x), (k, v) -> v.y ); System.out.println(">>> Decision tree regression model: " + mdl); System.out.println(">>> ---------------------------------"); System.out.println(">>> | Prediction\t| Ground Truth\t|"); System.out.println(">>> ---------------------------------"); for (int x = 0; x < 10; x++) { double predicted = mdl.apply(VectorUtils.of(x)); System.out.printf(">>> | %.4f\t\t| %.4f\t\t|\n", predicted, Math.sin(x)); } System.out.println(">>> ---------------------------------"); System.out.println(">>> Decision tree regression trainer example completed."); }); igniteThread.start(); igniteThread.join(); } }
Source:
public boolean equals(final Object o) { if (o instanceof CSCMatrix) { return breezeMatrix.equals(((CSCMatrix) o).breezeMatrix); } if (o instanceof DenseMatrix) { return breezeMatrix.equals(((DenseMatrix) o).getBreezeMatrix()); } return false; }

Target:
public boolean equals(final Object o) { if (this == o) { return true; } else if (o instanceof CSCMatrix) { return breezeMatrix.equals(((CSCMatrix) o).breezeMatrix); } else if (o instanceof DenseMatrix) { return breezeMatrix.equals(((DenseMatrix) o).getBreezeMatrix()); } else { return false; } }
Source:
protected void certificateSanity(String certificatePem) { Certificate certificate = getCertificateFromString(certificatePem); if (certificate instanceof X509CertImpl) { X509CertImpl x509Cert = (X509CertImpl) certificate; try { x509Cert.checkValidity(); } catch (CertificateExpiredException | CertificateNotYetValidException e) { e.printStackTrace(); throw new CloudRuntimeException("Certificate is invalid. Please provide a valid certificate. Error: " + e.getMessage()); } if (x509Cert.getSubjectDN() != null) { s_logger.info("Valid certificate for domain name: " + x509Cert.getSubjectDN().getName()); } } }

Target:
protected void certificateSanity(String certificatePem) { Certificate certificate = getCertificateFromString(certificatePem); if (certificate instanceof X509CertImpl) { X509CertImpl x509Cert = (X509CertImpl) certificate; try { x509Cert.checkValidity(); } catch (CertificateExpiredException | CertificateNotYetValidException e) { String msg = "Certificate is invalid. Please provide a valid certificate. Error: " + e.getMessage(); s_logger.error(msg); throw new CloudRuntimeException(msg); } if (x509Cert.getSubjectDN() != null) { s_logger.debug("Valid certificate for domain name: " + x509Cert.getSubjectDN().getName()); } } }
Source:
private IPv4Addr vxlanTunnelEndpointForInternal(Bridge b, BridgePort port) throws SerializationException, StateAccessException { if (b.getVxLanPortIds() == null) { return null; } VxLanPort vxlanPort = null; int i = 0; while (vxlanPort == null && i < b.getVxLanPortIds().size()) { vxlanPort = (VxLanPort)portsGet(b.getVxLanPortIds().get(i++)); if (vxlanPort == null) { log.warn("VxLanPort at bridge does not exist anymore", b.getVxLanPortIds(), b.getId()); } } if (vxlanPort == null) { log.warn("Can't find VTEP tunnel zone on bridge - is it even " + "bound to a VTEP?", b.getId()); return null; } IPv4Addr vtepMgmtIp = vxlanPort.getMgmtIpAddr(); log.debug("Port's bridge is bound to one or more VTEPs"); UUID hostId = port.getHostId(); if (hostId == null) { log.error("Port is not bound to a host", port.getId()); return null; } VTEP vtep = vtepGet(vtepMgmtIp); if (vtep == null) { log.warn("Vtep bound to bridge does not exist anymore", vtepMgmtIp, b.getId()); return null; } UUID tzId = vtep.getTunnelZoneId(); TunnelZone.HostConfig hostCfg = this.tunnelZonesGetMembership(tzId, hostId); if (hostCfg == null) { log.error("Port on bridge bount to an interface in host " + "was expected to belong to tunnel zone through " + "binding to VTEP {}", port.getId(), b.getId(), hostId, tzId, vtepMgmtIp); return null; } return hostCfg.getIp(); }

Target:
private IPv4Addr vxlanTunnelEndpointForInternal(Bridge b, BridgePort port) throws SerializationException, StateAccessException { if (b.getVxLanPortIds() == null) { return null; } VxLanPort vxlanPort = null; int i = 0; while (vxlanPort == null && i < b.getVxLanPortIds().size()) { vxlanPort = (VxLanPort)portsGet(b.getVxLanPortIds().get(i++)); if (vxlanPort == null) { log.warn("VxLanPort at bridge does not exist anymore", b.getVxLanPortIds(), b.getId()); } } if (vxlanPort == null) { log.warn("Can't find VTEP tunnel zone on bridge - is it even " + "bound to a VTEP?", b.getId()); return null; } IPv4Addr vtepMgmtIp = vxlanPort.getMgmtIpAddr(); log.debug("Port's bridge is bound to one or more VTEPs", b.getId()); UUID hostId = port.getHostId(); if (hostId == null) { log.error("Port is not bound to a host", port.getId()); return null; } VTEP vtep = vtepGet(vtepMgmtIp); if (vtep == null) { log.warn("Vtep bound to bridge does not exist anymore", vtepMgmtIp, b.getId()); return null; } UUID tzId = vtep.getTunnelZoneId(); TunnelZone.HostConfig hostCfg = this.tunnelZonesGetMembership(tzId, hostId); if (hostCfg == null) { log.error("Port on bridge bount to an interface in host " + "was expected to belong to tunnel zone through " + "binding to VTEP {}", port.getId(), b.getId(), hostId, tzId, vtepMgmtIp); return null; } return hostCfg.getIp(); }
Source:
private String name(final Request file) throws IOException { final Matcher matcher = FILE_NAME_PATTERN.matcher( new RqHeaders.Smart( new RqHeaders.Base(file) ).single("Content-Disposition") ); if (!matcher.find()) { throw new RsFailure("Filename was not provided"); } final String name = URLDecoder.decode( matcher.group(5), CharEncoding.UTF_8 ); return name; }

Target:
private String name(final Request file) throws IOException { final Matcher matcher = TkAttach.FILE_NAME_PATTERN.matcher( new RqHeaders.Smart( new RqHeaders.Base(file) ).single("Content-Disposition") ); if (!matcher.find()) { throw new RsFailure("Filename was not provided"); } return URLDecoder.decode(matcher.group(5), CharEncoding.UTF_8); }
Source:
public static <T> T retry(Supplier<T> func, Duration period, Duration timeout) { final List<T> returnValue = new ArrayList<>(); final Exception[] lastException = new Exception[1]; boolean result = PollUtils.poll(() -> { try { returnValue.add(func.get()); } catch (Exception e) { if (e instanceof RetriableException) { lastException[0] = e; LOG.info("Method threw a retriable exception.", e); return false; } throw e; } return true; }, period.toMillis(), timeout.toMillis()); if (!result) { LOG.error("Retries exhausted.", lastException[0]); throw new RetriesExhaustedExeption(lastException[0]); } return returnValue.get(0); }

Target:
public static <T> T retry(Supplier<T> func, Duration period, Duration timeout) { ExceptionTrackingMethodCaller<T> supplier = new ExceptionTrackingMethodCaller<>(func); boolean result = PollUtils.poll(supplier, period.toMillis(), timeout.toMillis()); if (!result) { LOG.error("Retries exhausted.", supplier.getLastException()); throw new RetriesExhaustedExeption(supplier.getLastException()); } return supplier.getValue(); }
Source:
protected List<IdealState> setupIdealState(int nodes, String[] resources, int partitions, int replicas, RebalanceMode rebalanceMode) { return setupIdealState(nodes, resources, partitions, replicas, rebalanceMode, BuiltInStateModelDefinitions.MasterSlave.name(), null, null, -1); }

Target:
protected List<IdealState> setupIdealState(int nodes, String[] resources, int partitions, int replicas, RebalanceMode rebalanceMode) { return setupIdealState(nodes, resources, partitions, replicas, rebalanceMode, BuiltInStateModelDefinitions.MasterSlave.name(), null, null, MIN_ACTIVE_REPLICA_NOT_SET); }
Source:
void insertFieldAbove() { closeEditMode(); final DataType newDataType = newDataType(); final List<DataType> updatedDataTypes = newDataType.create(getDataType(), ABOVE); if (newDataType.isTopLevel()) { dataTypeList.insertBefore(newDataType, getDataType()); } else { dataTypeList.refreshItemsByUpdatedDataTypes(updatedDataTypes); } }

Target:
void insertFieldAbove() { closeEditMode(); final DataType newDataType = newDataType(); final List<DataType> updatedDataTypes = newDataType.create(getDataType(), ABOVE); if (newDataType.isTopLevel()) { dataTypeList.insertAbove(newDataType, getDataType()); } else { dataTypeList.refreshItemsByUpdatedDataTypes(updatedDataTypes); } }
Source:
public List<Plan> planQueries(BenchmarkData benchmarkData) { return benchmarkData.queryRunner.inTransaction(txSession -> benchmarkData.getQueries() .map(query -> plan(benchmarkData, txSession, query)) .collect(toImmutableList())); }

Target:
public List<Plan> planQueries(BenchmarkData benchmarkData) { return benchmarkData.queryRunner.inTransaction(transactionSession -> { LogicalPlanner.Stage stage = LogicalPlanner.Stage.valueOf(benchmarkData.stage.toUpperCase()); return benchmarkData.queries.stream() .map(query -> benchmarkData.queryRunner.createPlan(transactionSession, query, stage)) .collect(toImmutableList()); }); }