auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void drawArea(Set<MapWaypoint> area, Graphics2D g, JXMapViewer map) { if (area.isEmpty()) { return; } boolean first = true; GeneralPath polygon = new GeneralPath(GeneralPath.WIND_EVEN_ODD, area.size()); for (MapWaypoint wp : area) { Point2D p = map.getTileFactory().geoToPixel(wp.getPosition(), map.getZoom()); int thisX = (int) p.getX(); int thisY = (int) p.getY(); if (first) { polygon.moveTo(thisX, thisY); first = false; } else { polygon.lineTo(thisX, thisY); } } polygon.closePath(); Color areaColor = area.iterator().next().getColor(); g.setPaint(new Color((float)(areaColor.getRed() / 255.0), (float)(areaColor.getGreen() / 255.0), (float)(areaColor.getBlue() / 255.0), .2f)); g.fill(polygon); g.draw(polygon); }

Target:
private void drawArea(Set<MapWaypoint> area, Graphics2D g, JXMapViewer map) { if (area.isEmpty()) { return; } boolean first = true; GeneralPath polygon = new GeneralPath(GeneralPath.WIND_EVEN_ODD, area.size()); for (MapWaypoint wp : area) { Point2D p = map.getTileFactory().geoToPixel(wp.getPosition(), map.getZoom()); int thisX = (int) p.getX(); int thisY = (int) p.getY(); if (first) { polygon.moveTo(thisX, thisY); first = false; } else { polygon.lineTo(thisX, thisY); } } polygon.closePath(); Color areaColor = area.iterator().next().getColor(); final double maxColorValue = 255.0; g.setPaint(new Color((float)(areaColor.getRed() / maxColorValue), (float)(areaColor.getGreen() / maxColorValue), (float)(areaColor.getBlue() / maxColorValue), .2f)); g.fill(polygon); g.draw(polygon); }
Source:
public void executeAsync() { Replicas.checkFull(targetReplicas); makeDataRequests(targetReplicas.subList(0, targetReplicas.size() > 1 ? 2 : 1).asEndpoints()); if (targetReplicas.size() > 2) makeDigestRequests(targetReplicas.subList(2, targetReplicas.size()).asEndpoints()); cfs.metric.speculativeRetries.inc(); }

Target:
public void executeAsync() { Replicas.checkFull(targetReplicas); makeDataRequests(targetReplicas.subList(0, targetReplicas.size() > 1 ? 2 : 1)); if (targetReplicas.size() > 2) makeDigestRequests(targetReplicas.subList(2, targetReplicas.size())); cfs.metric.speculativeRetries.inc(); }
Source:
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1); Boolean clientMode = client.get(); client.set(null); if (clientMode == null || !clientMode) { cfg.setCacheConfiguration(cacheConfiguration(TX_CACHE1, TRANSACTIONAL), cacheConfiguration(TX_CACHE2, TRANSACTIONAL), cacheConfiguration(ATOMIC_CACHE, ATOMIC)); } return cfg; }

Target:
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName); ((TcpCommunicationSpi)cfg.getCommunicationSpi()).setSharedMemoryPort(-1); if (!cfg.isClientMode()) { cfg.setCacheConfiguration(cacheConfiguration(TX_CACHE1, TRANSACTIONAL), cacheConfiguration(TX_CACHE2, TRANSACTIONAL), cacheConfiguration(ATOMIC_CACHE, ATOMIC)); } return cfg; }
Source:
public SpongePluginContainer(String className, ModCandidate container, Map<String, Object> modDescriptor) { super(className, container, modDescriptor); this.fmlDescriptor = modDescriptor; this.source = container.getModContainer(); try { LANGUAGE_ADAPTER_FIELD.set(this, GuiceJavaAdapter.INSTANCE); } catch (IllegalAccessException e) { throw new ExceptionInInitializerError(e); } this.fmlDescriptor.put("acceptableRemoteVersions", "*"); this.selfInjector = SpongeMod.instance.getInjector().createChildInjector(new SpongePluginGuiceModule(this)); }

Target:
public SpongePluginContainer(String className, ModCandidate container, Map<String, Object> modDescriptor) { super(className, container, modDescriptor); this.fmlDescriptor = modDescriptor; this.source = container.getModContainer(); this.languageAdapter = GuiceJavaAdapter.INSTANCE; this.fmlDescriptor.put("acceptableRemoteVersions", "*"); this.selfInjector = SpongeMod.instance.getInjector().createChildInjector(new SpongePluginGuiceModule(this)); }
Source:
public boolean adjustFormula(Ptg[] ptgs, int currentExternSheetIx) { boolean refsWereChanged = false; for(int i=0; i<ptgs.length; i++) { Ptg newPtg; if(_rowModeElseColumn){ newPtg = adjustPtg(ptgs[i], currentExternSheetIx); if (newPtg != null) { refsWereChanged = true; ptgs[i] = newPtg; } } else { Ptg transposedPtg = transpose(ptgs[i]); newPtg = adjustPtg(transposedPtg, currentExternSheetIx); if (newPtg != null) { refsWereChanged = true; ptgs[i] = transpose(transposedPtg); } } } return refsWereChanged; }

Target:
public boolean adjustFormula(Ptg[] ptgs, int currentExternSheetIx) { boolean refsWereChanged = false; for(int i=0; i<ptgs.length; i++) { Ptg newPtg = adjustPtg(ptgs[i], currentExternSheetIx); if (newPtg != null) { refsWereChanged = true; ptgs[i] = newPtg; } } return refsWereChanged; }
Source:
protected RemoteNeo4jDatabaseIdentifier getDatabaseIdentifier() { if ( !configuration.getHosts().isSingleHost() ) { logger.doesNotSupportMultipleHosts( configuration.getHosts().toString() ); } Hosts.HostAndPort hostAndPort = configuration.getHosts().getFirst(); try { return new RemoteNeo4jDatabaseIdentifier( getProtocol(), getConfiguration() ); } catch (Exception e) { throw logger.malformedDataBaseUrl( e, hostAndPort.getHost(), hostAndPort.getPort(), configuration.getDatabaseName() ); } }

Target:
protected RemoteNeo4jDatabaseIdentifier getDatabaseIdentifier() { if ( !configuration.getHosts().isSingleHost() ) { logger.doesNotSupportMultipleHosts( configuration.getHosts().toString() ); } Hosts.HostAndPort hostAndPort = configuration.getHosts().getFirst(); try { return new RemoteNeo4jDatabaseIdentifier( protocol, configuration ); } catch (Exception e) { throw logger.malformedDataBaseUrl( e, hostAndPort.getHost(), hostAndPort.getPort(), configuration.getDatabaseName() ); } }
Source:
public PhilipsHueGatewayImpl(GatewayTable gatewayTable) { GatewayPhilipsHue gateway = (GatewayPhilipsHue) GatewayUtils.getGateway(gatewayTable); try { philipsHueGatewayPoller = new PhilipsHueGatewayPoller(gateway); new Thread(philipsHueGatewayPoller).start(); _logger.info("Connected successfully with philipsHueGatewayPoller[{}, PublicKey:{}]", gateway.getUrl(), gateway.getAuthorizedUser()); gateway.setStatus(STATE.UP, "Connected Successfully"); } catch (Exception ex) { _logger.error("Exception, ", ex); gateway.setStatus(STATE.DOWN, "ERROR: " + ex.getMessage()); } }

Target:
public PhilipsHueGatewayImpl(GatewayTable gatewayTable) { GatewayPhilipsHue gateway = (GatewayPhilipsHue) GatewayUtils.getGateway(gatewayTable); try { philipsHueGatewayPoller = new PhilipsHueGatewayPoller(gateway); new Thread(philipsHueGatewayPoller).start(); _logger.info("Connected successfully with philipsHueGatewayPoller[{}, AuthorizedUser:{}]", gateway.getUrl(), gateway.getAuthorizedUser()); gateway.setStatus(STATE.UP, "Connected Successfully"); } catch (Exception ex) { _logger.error("Exception, ", ex); gateway.setStatus(STATE.DOWN, "ERROR: " + ex.getMessage()); } }
Source:
public int decompress(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int maxOutputLength) throws MalformedInputException { try { Inflater inflater = new Inflater(true); inflater.setInput(input, inputOffset, inputLength); int resultLength = inflater.inflate(output, outputOffset, maxOutputLength); inflater.end(); return resultLength; } catch (DataFormatException e) { throw Throwables.propagate(e); } }

Target:
public int decompress(byte[] input, int inputOffset, int inputLength, byte[] output, int outputOffset, int maxOutputLength) throws MalformedInputException { try { Inflater inflater = new Inflater(true); inflater.setInput(input, inputOffset, inputLength); int resultLength = inflater.inflate(output, outputOffset, maxOutputLength); inflater.end(); return resultLength; } catch (DataFormatException e) { throw new RuntimeException(e); } }
Source:
public EntitlementCertificate createUeberCertificate(@Context Principal principal, @Verify(Owner.class) @PathParam("owner_key") String ownerKey) { Owner o = findOwner(ownerKey); if (o == null) { throw new NotFoundException(i18n.tr("owner with key: {0} was not found.", ownerKey)); } try { Consumer ueberConsumer = consumerCurator.findByName(o, Consumer.UEBER_CERT_CONSUMER); List<Entitlement> ueberEntitlements = entitlementCurator.listByConsumer(ueberConsumer); if (ueberConsumer != null && ueberEntitlements.size() > 0) { poolManager.regenerateCertificatesOf(ueberEntitlements.get(0), true, false); return entitlementCertCurator.listForConsumer(ueberConsumer).get(0); } return ueberCertGenerator.generate(o, principal); } catch (Exception e) { log.error("Problem generating ueber cert for owner: " + o.getKey(), e); throw new BadRequestException(i18n.tr( "Problem generating ueber cert for owner {0}", e)); } }

Target:
public EntitlementCertificate createUeberCertificate(@Context Principal principal, @Verify(Owner.class) @PathParam("owner_key") String ownerKey) { Owner o = findOwner(ownerKey); if (o == null) { throw new NotFoundException(i18n.tr("owner with key: {0} was not found.", ownerKey)); } try { Consumer ueberConsumer = consumerCurator.findByName(o, Consumer.UEBER_CERT_CONSUMER); if (ueberConsumer != null) { List<Entitlement> ueberEntitlements = entitlementCurator.listByConsumer(ueberConsumer); if (ueberEntitlements.size() > 0) { poolManager.regenerateCertificatesOf(ueberEntitlements.get(0), true, false); return entitlementCertCurator.listForConsumer(ueberConsumer).get(0); } } return ueberCertGenerator.generate(o, principal); } catch (Exception e) { log.error("Problem generating ueber cert for owner: " + o.getKey(), e); throw new BadRequestException(i18n.tr( "Problem generating ueber cert for owner {0}", e)); } }
Source:
public void testWithTrace() throws TmfAnalysisException, TmfTraceException, IOException { String tracePath; tracePath = FileLocator.toFileURL(CtfTestTrace.ARM_64_BIT_HEADER.getTraceURL()).getPath(); assertNotNull(tracePath); TmfTrace testTrace = new LttngKernelTrace(); SystemCallLatencyAnalysis module = new SystemCallLatencyAnalysis(); IAnalysisModule kernelModule = new KernelAnalysisModule(); final IAnalysisModuleSource source = new IAnalysisModuleSource() { @Override public @NonNull Iterable<IAnalysisModuleHelper> getAnalysisModules() { return Arrays.asList(new AnalysisModuleHelper(kernelModule), new AnalysisModuleHelper(module)); } }; TmfAnalysisManager.registerModuleSource(source); testTrace.initTrace(null, tracePath, CtfTmfEvent.class); kernelModule.setTrace(testTrace); module.setTrace(testTrace); try { testTrace.traceOpened(new TmfTraceOpenedSignal(this, testTrace, null)); } catch (NullPointerException e) { } kernelModule.schedule(); kernelModule.waitForCompletion(); module.schedule(); module.waitForCompletion(); final @Nullable ISegmentStore<@NonNull ISegment> segmentStore = module.getResults(); assertNotNull(segmentStore); assertEquals(1801, segmentStore.size()); UIThreadRunnable.syncExec(new VoidResult() { @Override public void run() { fTable.traceOpened(new TmfTraceOpenedSignal(this, testTrace, null)); } }); assertNotNull(fTable); SWTBotTable tableBot = new SWTBotTable(fTable.getTableViewer().getTable()); assertEquals("24100", tableBot.cell(0, 2)); tableBot.header("Duration").click(); assertEquals("1000", tableBot.cell(0, 2)); tableBot.header("Duration").click(); assertEquals("5904091700", tableBot.cell(0, 2)); UIThreadRunnable.asyncExec(new VoidResult() { @Override public void run() { fTable.traceClosed(new TmfTraceClosedSignal(this, testTrace)); } }); }

Target:
public void testWithTrace() throws IOException { String tracePath; tracePath = FileLocator.toFileURL(CtfTestTrace.ARM_64_BIT_HEADER.getTraceURL()).getPath(); SWTWorkbenchBot bot = new SWTWorkbenchBot(); SWTBotView view = bot.viewById(VIEW_ID); view.close(); bot.waitUntil(ConditionHelpers.ViewIsClosed(view)); SWTBotUtils.createProject(PROJECT_NAME); SWTBotUtils.openTrace(PROJECT_NAME, tracePath, TRACE_TYPE); SWTBotUtils.waitForJobs(); createTable(); SWTBotUtils.waitForJobs(); SWTBotTable tableBot = new SWTBotTable(fTable.getTableViewer().getTable()); assertEquals("24100", tableBot.cell(0, 2)); tableBot.header("Duration").click(); assertEquals("1000", tableBot.cell(0, 2)); tableBot.header("Duration").click(); assertEquals("5904091700", tableBot.cell(0, 2)); bot.closeAllEditors(); }
Source:
protected synchronized void shutdownProducer() { Producer<K, V> producer = _kafkaProducer; _kafkaProducer = null; if (producer != null) { producer.close(TIME_OUT, TimeUnit.MILLISECONDS); NUM_PRODUCERS.decrementAndGet(); } }

Target:
synchronized void shutdownProducer() { Producer<K, V> producer = _kafkaProducer; _kafkaProducer = null; if (producer != null) { producer.close(TIME_OUT, TimeUnit.MILLISECONDS); NUM_PRODUCERS.decrementAndGet(); } }
Source:
private Cost checkElement(IType type, IValue initialValue, Cost worstCost) throws DOMException { IType nestedType = SemanticUtil.getNestedType(type, SemanticUtil.TDEF); if (fIndex >= fInitializers.length) return checkInitializationFromDefaultMemberInitializer(nestedType, initialValue, worstCost); worstCost = new Cost(fInitializers[fIndex].getType(), nestedType, Rank.IDENTITY); if (initFromStringLiteral(nestedType, fInitializers[fIndex])) { Cost cost = new Cost(fInitializers[fIndex].getType(), nestedType, Rank.CONVERSION); fIndex++; if (cost.compareTo(worstCost) > 0) { worstCost = cost; } } else if (fInitializers[fIndex].isInitializerList() || !isAggregate(nestedType)) { ICPPEvaluation initializer = fInitializers[fIndex]; fIndex++; Cost cost = Conversions.checkImplicitConversionSequence(nestedType, initializer.getType(), initializer.getValueCategory(), UDCMode.ALLOWED, Context.ORDINARY); if (!cost.converts()) { return cost; } if (!(initializer.isConstantExpression()) && cost.isNarrowingConversion()) { return Cost.NO_CONVERSION; } if (cost.compareTo(worstCost) > 0) { worstCost = cost; } } else { Cost cost = checkInitializationOfElements(nestedType, worstCost); if (!cost.converts()) return cost; if (cost.compareTo(worstCost) > 0) { worstCost = cost; } } return worstCost; }

Target:
private Cost checkElement(IType type, IValue initialValue, Cost worstCost) throws DOMException { IType nestedType = SemanticUtil.getNestedType(type, SemanticUtil.TDEF); if (fIndex >= fInitializers.length) return checkInitializationFromDefaultMemberInitializer(nestedType, initialValue, worstCost); worstCost = new Cost(fInitializers[fIndex].getType(), nestedType, Rank.IDENTITY); if (fInitializers[fIndex].isInitializerList() || !isAggregate(nestedType)) { ICPPEvaluation initializer = fInitializers[fIndex]; fIndex++; Cost cost = Conversions.checkImplicitConversionSequence(nestedType, initializer.getType(), initializer.getValueCategory(), UDCMode.ALLOWED, Context.ORDINARY); if (!cost.converts()) { return cost; } if (!(initializer instanceof EvalInitList) && cost.isNarrowingConversion()) { return Cost.NO_CONVERSION; } if (cost.compareTo(worstCost) > 0) { worstCost = cost; } } else { Cost cost = checkInitializationOfElements(nestedType, worstCost); if (!cost.converts()) return cost; if (cost.compareTo(worstCost) > 0) { worstCost = cost; } } return worstCost; }
Source:
public boolean hasPostConstructMethods() { return hasPostConstructCallback(); }

Target:
public boolean hasPostConstructMethods() { return true; }
Source:
public static void computeLegalDestinations() { Team team = sGame.getTeams()[sGame.getTurnKeeper().getCurrentTeamIndex()]; mData = new ComputedPieceData(sGame.getTurnKeeper().getCurrentTeamIndex()); for (Piece piece : team.getPieces()) { int boardIndex = team.getRules() == null ? piece.getCoordinates().boardIndex : team.getRules().getDestinationBoardIndex(piece.getCoordinates().boardIndex); mData.computeLegalDestinations(piece, boardIndex); } }

Target:
public static void computeLegalDestinations() { Team[] teams = sGame.getTeams(); for (int teamIndex = 0; teamIndex < teams.length; teamIndex++) { mDataMap.put(teamIndex, new ComputedPieceData(teamIndex)); for (Piece piece : teams[teamIndex].getPieces()) { int boardIndex = teams[teamIndex].getRules() == null ? piece.getCoordinates().boardIndex : teams[teamIndex].getRules().getDestinationBoardIndex( piece.getCoordinates().boardIndex); mDataMap.get(teamIndex).computeLegalDestinations(piece, boardIndex); } } }
Source:
public ResponseEntity handleException(Locale locale, Exception ex) { LOGGER.error("Error while saving position changes", ex); HttpHeaders headers = new HttpHeaders(); headers.setContentType(TEXT_PLAIN_UTF8); return new ResponseEntity<>(messageSource.getMessage(TECHNICAL_ERROR_MESSAGE_KEY, null, locale), headers, HttpStatus.BAD_REQUEST); }

Target:
public ResponseEntity handleException(Locale locale, Exception ex) { LOGGER.error("Error while saving position changes", ex); HttpHeaders headers = new HttpHeaders(); headers.setContentType(MediaTypes.TEXT_PLAIN_UTF8); return new ResponseEntity<>(messageSource.getMessage(TECHNICAL_ERROR_MESSAGE_KEY, null, locale), headers, HttpStatus.BAD_REQUEST); }
Source:
public void onError(YouTubePlayer.ErrorReason errorReason) { if (previousYouTubePlayer != null){ previousYouTubePlayer.release(); } youTubePlayer.release(); initializeYoutubePlayer(); }

Target:
public void onError(YouTubePlayer.ErrorReason errorReason) { if (attempts <= 3) { releaseYoutubePlayer(); initializeYoutubePlayer(); attempts++; } else { Toast.makeText(getActivity(), errorReason.toString(), Toast.LENGTH_LONG).show(); } }
Source:
public void searchesMessages() throws Exception { final MkBase base = new MkBase(); final String urn = "urn:test:99"; final User user = base.user(new URN(urn)); user.aliases().add("test-user"); final Alias alias = user.aliases().iterate().iterator().next(); final Bout bout = alias.inbox().bout(alias.inbox().start()); bout.messages().post("test1"); bout.messages().post("test2"); bout.messages().post("fest"); bout.friends().invite(alias.name()); MatcherAssert.assertThat( XhtmlMatchers.xhtml( new RsPrint( new FkBout(".*", new TkIndex(base)).route( new RqWithAuth( urn, new RqFake( "GET", String.format( "/b/%d/search?q=test", bout.number() ) ) ) ).get() ).printBody() ), XhtmlMatchers.hasXPaths( "/page/bout[number=1]", "/page/bout[title='untitled']", "/page/bout[unread=0]", "/page/bout/friends/friend[alias='test-user']", "/page/bout/friends/friend/links/link[@rel='photo']", "/page/bout/friends/friend/links/link[@rel='kick']", "/page/bout/messages/message[text='test2']", "/page/bout/messages/message[text='test1']" ) ); }

Target:
public void searchesMessages() throws Exception { final MkBase base = new MkBase(); final String urn = "urn:test:99"; final User user = base.user(new URN(urn)); user.aliases().add("test-search-user"); final Alias alias = user.aliases().iterate().iterator().next(); final Bout bout = alias.inbox().bout(alias.inbox().start()); bout.messages().post("test1"); bout.messages().post("test2"); bout.messages().post("fest"); bout.friends().invite(alias.name()); MatcherAssert.assertThat( XhtmlMatchers.xhtml( new RsPrint( new FkBout(TkIndexTest.REGEX, new TkIndex(base)).route( new RqWithAuth( urn, new RqFake( RqMethod.GET, String.format( "/b/%d/search?q=test", bout.number() ) ) ) ).get() ).printBody() ), XhtmlMatchers.hasXPaths( "/page/bout/friends/friend[alias='test-search-user']", "/page/bout/messages/message[text='test2']", "/page/bout/messages/message[text='test1']" ) ); }
Source:
private void read(CorfuPayloadMsg<ReadRequest> msg, ChannelHandlerContext ctx, IServerRouter r) { long address = msg.getPayload().getAddress(); boolean cacheable = msg.getPayload().isCacheable(); log.trace("read: {}, cacheable: {}", msg.getPayload().getAddress(), cacheable); ReadResponse rr = new ReadResponse(); try { ILogData e = cacheable ? dataCache.get(address) : handleRetrieval(address); if (e == null) { rr.put(address, LogData.getEmpty(address)); } else { rr.put(address, (LogData) e); } r.sendResponse(ctx, msg, CorfuMsgType.READ_RESPONSE.payloadMsg(rr)); } catch (DataCorruptionException e) { r.sendResponse(ctx, msg, CorfuMsgType.ERROR_DATA_CORRUPTION.msg()); } }

Target:
public void read(CorfuPayloadMsg<ReadRequest> msg, ChannelHandlerContext ctx, IServerRouter r) { long address = msg.getPayload().getAddress(); boolean cacheable = msg.getPayload().isCacheReadResult(); log.trace("read: {}, cacheable: {}", msg.getPayload().getAddress(), cacheable); ReadResponse rr = new ReadResponse(); try { ILogData logData = dataCache.get(address, cacheable); if (logData == null) { rr.put(address, LogData.getEmpty(address)); } else { rr.put(address, (LogData) logData); } r.sendResponse(ctx, msg, CorfuMsgType.READ_RESPONSE.payloadMsg(rr)); } catch (DataCorruptionException e) { r.sendResponse(ctx, msg, CorfuMsgType.ERROR_DATA_CORRUPTION.msg()); } }
Source:
public void delete(Long poolOrderId) throws IOException { PoolOrder poolOrder = poolOrderDao.getPoolOrder(poolOrderId); if (poolOrder != null) poolOrderDao.deletePoolOrder(poolOrder); }

Target:
public void delete(Long poolOrderId) throws IOException { PoolOrder poolOrder = poolOrderDao.getPoolOrder(poolOrderId); Pool<?> pool = requestManager.getPoolById(poolOrder.getPoolId()); authorizationManager.throwIfNotWritable(pool); if (poolOrder != null) poolOrderDao.deletePoolOrder(poolOrder); }
Source:
protected Object doExecute() throws Exception { printInitCommand("clear resources"); try { getResourceManager().destroyAllResources(); } catch (Exception e) { printError("Error celaring resources"); printError(e); } printEndCommand(); return null; }

Target:
protected Object doExecute() throws Exception { printInitCommand("clear resources"); try { getResourceManager().destroyAllResources(); } catch (Exception e) { printError("Error clearing resources"); printError(e); } printEndCommand(); return null; }
Source:
private Set<List<JavaFileScannerContext.Location>> flowFromYields(ExplodedGraph.Edge edge) { Set<MethodYield> methodYields = edge.yields(); if (methodYields.isEmpty()) { return ImmutableSet.of(ImmutableList.of()); } Preconditions.checkState(isMethodInvocationNode(edge.parent), "Yield present on edge where parent is not MIT"); List<Integer> argumentIndices = correspondingArgumentIndices(symbolicValues, edge.parent); SymbolicValue returnSV = edge.child.programState.peekValue(); if (symbolicValues.contains(returnSV)) { argumentIndices.add(-1); } return methodYields.stream() .map(y -> y.flow(argumentIndices, domains)) .flatMap(Set::stream) .collect(Collectors.toSet()); }

Target:
private Set<List<JavaFileScannerContext.Location>> flowFromYields(ExplodedGraph.Edge edge) { Set<MethodYield> methodYields = edge.yields(); if (methodYields.isEmpty()) { return ImmutableSet.of(ImmutableList.of()); } List<Integer> argumentIndices = correspondingArgumentIndices(symbolicValues, edge.parent); SymbolicValue returnSV = edge.child.programState.peekValue(); if (symbolicValues.contains(returnSV)) { argumentIndices.add(-1); } return methodYields.stream() .map(y -> y.flow(argumentIndices, domains)) .flatMap(Set::stream) .collect(Collectors.toSet()); }
Source:
ServiceAccountCredentials( String clientId, String clientEmail, PrivateKey privateKey, String privateKeyId, Collection<String> scopes, HttpTransportFactory transportFactory, URI tokenServerUri, String serviceAccountUser, String projectId, String quotaProjectId, int lifetime) { this.clientId = clientId; this.clientEmail = Preconditions.checkNotNull(clientEmail); this.privateKey = Preconditions.checkNotNull(privateKey); this.privateKeyId = privateKeyId; this.scopes = (scopes == null) ? ImmutableSet.<String>of() : ImmutableSet.copyOf(scopes); this.transportFactory = firstNonNull( transportFactory, getFromServiceLoader(HttpTransportFactory.class, OAuth2Utils.HTTP_TRANSPORT_FACTORY)); this.transportFactoryClassName = this.transportFactory.getClass().getName(); this.tokenServerUri = (tokenServerUri == null) ? OAuth2Utils.TOKEN_SERVER_URI : tokenServerUri; this.serviceAccountUser = serviceAccountUser; this.projectId = projectId; this.quotaProjectId = quotaProjectId; if (lifetime > TWELVE_HOURS_IN_SECONDS) { throw new IllegalStateException(LIFETIME_EXCEEDED_ERROR); } this.lifetime = lifetime == 0 ? DEFAULT_LIFETIME_IN_SECONDS : lifetime; }

Target:
ServiceAccountCredentials( String clientId, String clientEmail, PrivateKey privateKey, String privateKeyId, Collection<String> scopes, HttpTransportFactory transportFactory, URI tokenServerUri, String serviceAccountUser, String projectId, String quotaProjectId, int lifetime) { this.clientId = clientId; this.clientEmail = Preconditions.checkNotNull(clientEmail); this.privateKey = Preconditions.checkNotNull(privateKey); this.privateKeyId = privateKeyId; this.scopes = (scopes == null) ? ImmutableSet.<String>of() : ImmutableSet.copyOf(scopes); this.transportFactory = firstNonNull( transportFactory, getFromServiceLoader(HttpTransportFactory.class, OAuth2Utils.HTTP_TRANSPORT_FACTORY)); this.transportFactoryClassName = this.transportFactory.getClass().getName(); this.tokenServerUri = (tokenServerUri == null) ? OAuth2Utils.TOKEN_SERVER_URI : tokenServerUri; this.serviceAccountUser = serviceAccountUser; this.projectId = projectId; this.quotaProjectId = quotaProjectId; if (lifetime > TWELVE_HOURS_IN_SECONDS) { throw new IllegalStateException("lifetime must be less than or equal to 43200"); } this.lifetime = lifetime; }
Source:
private ValidationResult validateMountOptions() { String mountOptions = getConnection().getMountOptions(); if (StringUtils.isBlank(mountOptions)) { return ValidationResult.VALID; } List<String> disallowedOptions = getConnection().getstorage_type() == StorageType.POSIXFS ? POSIX_MANAGED_OPTIONS : NFS_MANAGED_OPTIONS; Map<String, String> optionsMap = XmlRpcStringUtils.string2Map(mountOptions); Set<String> optionsKeys = new HashSet<>(); for (String optionName : optionsMap.keySet()) { optionsKeys.add(optionName.toLowerCase()); } optionsKeys.retainAll(disallowedOptions); if (!optionsKeys.isEmpty()) { addCanDoActionMessageVariable("invalidOptions", StringUtils.join(optionsKeys, ", ")); return new ValidationResult(VdcBllMessages.VALIDATION_STORAGE_CONNECTION_MOUNT_OPTIONS_CONTAINS_MANAGED_PROPERTY); } return ValidationResult.VALID; }

Target:
private ValidationResult validateMountOptions() { String mountOptions = getConnection().getMountOptions(); if (StringUtils.isBlank(mountOptions)) { return ValidationResult.VALID; } List<String> disallowedOptions = getConnection().getstorage_type() == StorageType.POSIXFS ? POSIX_MANAGED_OPTIONS : NFS_MANAGED_OPTIONS; Map<String, String> optionsMap = XmlRpcStringUtils.string2Map(mountOptions); Set<String> optionsKeys = new TreeSet<>(String.CASE_INSENSITIVE_ORDER); optionsKeys.addAll(optionsMap.keySet()); optionsKeys.retainAll(disallowedOptions); if (!optionsKeys.isEmpty()) { addCanDoActionMessageVariable("invalidOptions", StringUtils.join(optionsKeys, ", ")); return new ValidationResult(VdcBllMessages.VALIDATION_STORAGE_CONNECTION_MOUNT_OPTIONS_CONTAINS_MANAGED_PROPERTY); } return ValidationResult.VALID; }
Source:
public void init() { setLabel("Decorator Configuration"); setPackage(decoratorPackage); setDescription( "Configuration entity to configurate which dynamic decorators should be applied to an entity types."); addAttribute(ID, ROLE_ID).setAuto(true).setVisible(false).setLabel("Identifier"); addAttribute(ENTITY_TYPE_ID).setNillable(false).setUnique(true).setLabel("Entity Type Identifier"); addAttribute(DYNAMIC_DECORATORS).setNillable(true) .setDataType(AttributeType.MREF) .setRefEntity(dynamicDecoratorMetadata) .setLabel("Decorators"); }

Target:
public void init() { setLabel("Decorator Configuration"); setPackage(decoratorPackage); setDescription( "Configuration entity to configure which dynamic decorators should be applied to an entity type."); addAttribute(ID, ROLE_ID).setAuto(true).setVisible(false).setLabel("Identifier"); addAttribute(ENTITY_TYPE_ID).setNillable(false).setUnique(true).setLabel("Entity Type Identifier"); addAttribute(DYNAMIC_DECORATORS).setNillable(true) .setDataType(AttributeType.MREF) .setRefEntity(dynamicDecoratorMetadata) .setLabel("Decorators"); }
Source:
public Decision decideOnTest(WorkloadTaskData workloadTaskData) { if (Double.compare(workloadTaskData.getSuccessRate().doubleValue(), successRateThreshold) <= 0) { return Decision.OK; } return Decision.FATAL; }

Target:
public Decision decideOnTest(WorkloadTaskData workloadTaskData) { if (MathUtils.compareTo(workloadTaskData.getSuccessRate().doubleValue(), successRateThreshold, epsilon) >= 0) { return Decision.OK; } return Decision.FATAL; }
Source:
private void receiveTokenFromKeycloak(final String content) throws IOException { LOG.debug("receiving new token from keycloak server"); final byte[] rawContent = content.getBytes(PlatformConstants.CHARSET); final URL url = new URL(authEndpoint + "/auth/realms/" + realmName + "/protocol/openid-connect/token"); final HttpURLConnection connection = new DefaultHttpURLConnectionFactory().create(url); connection.setRequestMethod(RequestMethod.POST.getRawName()); connection.setRequestProperty("charset", "UTF-8"); connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); connection.setRequestProperty("Content-Length", rawContent.length + ""); connection.setDoOutput(true); connection.setDoInput(true); final OutputStream w = connection.getOutputStream(); w.write(rawContent); w.close(); final int responseCode = connection.getResponseCode(); final InputStream is = connection.getInputStream(); final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); int read = is.read(); while (read != -1) { byteArrayOutputStream.write(read); read = is.read(); } final byte[] rawInput = byteArrayOutputStream.toByteArray(); final String input = new String(rawInput); final Gson gson = PlatformClient.getService(Gson.class); final KeycloakOpenidConnectResult result = gson.fromJson(input, KeycloakOpenidConnectResult.class); connectResult = result; tokenCreation = System.currentTimeMillis(); }

Target:
private void receiveTokenFromKeycloak(final String content) throws IOException { LOG.debug("receiving new token from keycloak server"); final byte[] rawContent = content.getBytes(PlatformConstants.CHARSET); final URL url = new URL(authEndpoint + "/auth/realms/" + realmName + "/protocol/openid-connect/token"); final HttpURLConnection connection = new DefaultHttpURLConnectionFactory().create(url); connection.setRequestMethod(RequestMethod.POST.getRawName()); connection.setRequestProperty("charset", "UTF-8"); connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); connection.setRequestProperty("Content-Length", rawContent.length + ""); connection.setDoOutput(true); connection.setDoInput(true); final OutputStream w = connection.getOutputStream(); w.write(rawContent); w.close(); final InputStream is = connection.getInputStream(); final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); int read = is.read(); while (read != -1) { byteArrayOutputStream.write(read); read = is.read(); } final byte[] rawInput = byteArrayOutputStream.toByteArray(); final String input = new String(rawInput); final Gson gson = PlatformClient.getService(Gson.class); final KeycloakOpenidConnectResult result = gson.fromJson(input, KeycloakOpenidConnectResult.class); connectResult = result; tokenCreation = System.currentTimeMillis(); }
Source:
public void stop(boolean stopGracefully) { Preconditions.checkState(started, "not started"); log.info("Beginning shutdown of KafkaSupervisor[%s]", dataSource); try { scheduledExec.shutdownNow(); Optional<TaskRunner> taskRunner = taskMaster.getTaskRunner(); if (taskRunner.isPresent()) { taskRunner.get().unregisterListener(supervisorId); } synchronized (stopLock) { if (stopGracefully) { log.info("Posting GracefulShutdownNotice, signalling managed tasks to complete and publish"); notices.add(new GracefulShutdownNotice()); } else { log.info("Posting ShutdownNotice"); notices.add(new ShutdownNotice()); } while (!stopped) { stopLock.wait(); } } log.info("Shutdown notice handled"); exec.shutdownNow(); started = false; log.info("KafkaSupervisor[%s] has stopped", dataSource); } catch (Exception e) { log.makeAlert(e, "Exception stopping KafkaSupervisor[%s]", dataSource) .emit(); } }

Target:
public void stop(boolean stopGracefully) { synchronized (stateChangeLock) { Preconditions.checkState(started, "not started"); log.info("Beginning shutdown of KafkaSupervisor[%s]", dataSource); try { scheduledExec.shutdownNow(); Optional<TaskRunner> taskRunner = taskMaster.getTaskRunner(); if (taskRunner.isPresent()) { taskRunner.get().unregisterListener(supervisorId); } synchronized (stopLock) { if (stopGracefully) { log.info("Posting GracefulShutdownNotice, signalling managed tasks to complete and publish"); notices.add(new GracefulShutdownNotice()); } else { log.info("Posting ShutdownNotice"); notices.add(new ShutdownNotice()); } long endTime = System.currentTimeMillis() + SHUTDOWN_TIMEOUT_MILLIS; while (!stopped) { long sleepTime = endTime - System.currentTimeMillis(); if (sleepTime <= 0) { log.info("Timed out while waiting for shutdown"); stopped = true; break; } stopLock.wait(sleepTime); } } log.info("Shutdown notice handled"); exec.shutdownNow(); started = false; log.info("KafkaSupervisor[%s] has stopped", dataSource); } catch (Exception e) { log.makeAlert(e, "Exception stopping KafkaSupervisor[%s]", dataSource) .emit(); } } }
Source:
private boolean hasServiceClientAnnotation(DetailAST classDefToken) { final DetailAST modifiersToken = classDefToken.findFirstToken(TokenTypes.MODIFIERS); final Optional<DetailAST> serviceClientAnnotationOption = TokenUtil.findFirstTokenByPredicate(modifiersToken, node -> node.getType() == TokenTypes.ANNOTATION && node.findFirstToken(TokenTypes.IDENT) != null && SERVICE_CLIENT.equals(node.findFirstToken(TokenTypes.IDENT).getText())); if (serviceClientAnnotationOption.isPresent()) { isAsync = isAsyncServiceClient(serviceClientAnnotationOption.get()); return true; } return false; }

Target:
private boolean hasServiceClientAnnotation(DetailAST classDefToken) { final DetailAST modifiersToken = classDefToken.findFirstToken(TokenTypes.MODIFIERS); final Optional<DetailAST> serviceClientAnnotationOption = TokenUtil.findFirstTokenByPredicate(modifiersToken, node -> { if (node.getType() != TokenTypes.ANNOTATION) { return false; } final DetailAST annotationIdentToken = node.findFirstToken(TokenTypes.IDENT); return annotationIdentToken != null && SERVICE_CLIENT.equals(annotationIdentToken.getText()); } ); if (serviceClientAnnotationOption.isPresent()) { isAsync = isAsyncServiceClient(serviceClientAnnotationOption.get()); return true; } return false; }
Source:
public <C> C getCacheManager(Config.Scope config) { try { InputStream configurationStream = loadConfiguration(config); ConfigurationBuilderHolder builder = new ParserRegistry().parse(configurationStream); boolean isClustered = builder.getNamedConfigurationBuilders().get("sessions").clustering().cacheMode().isClustered(); if (isClustered) { configureTransportStack(config, builder); } return (C) new DefaultCacheManager(builder, isClustered); } catch (Exception e) { throw new RuntimeException(e); } }

Target:
public <C> C getCacheManager(Config.Scope config) { try { InputStream configurationStream = loadConfiguration(config); ConfigurationBuilderHolder builder = new ParserRegistry().parse(configurationStream); if (builder.getNamedConfigurationBuilders().get("sessions").clustering().cacheMode().isClustered()) { configureTransportStack(config, builder); } return (C) new DefaultCacheManager(builder, true); } catch (Exception e) { throw new RuntimeException(e); } }
Source:
public static void main(String[] args) { example(false); try { example(true); } catch (Exception ignore) { } breakStatement(); catchNotExecuted(); emptyCatch(); nested(); emptyTry(); alwaysCompletesAbruptly(); }

Target:
public static void main(String[] args) { example(false); try { example(true); } catch (Exception ignore) { } breakStatement(); catchNotExecuted(); emptyCatch(); twoRegions(); nested(); emptyTry(); alwaysCompletesAbruptly(); }
Source:
public Row map(Row value) throws Exception { assert value.getField(1).equals(currentTaskIndex); return value; }

Target:
public Row map(Row value) throws Exception { int expectedPartitionIndex = (Integer) (value.getField(1)) % getRuntimeContext() .getNumberOfParallelSubtasks(); if (expectedPartitionIndex != currentTaskIndex) { throw new RuntimeException(String.format("the data: Row<%s> was sent to the wrong partition[%d], " + "expected partition is [%d].", value.toString(), currentTaskIndex, expectedPartitionIndex)); } return value; }
Source:
public String getFileContents(String filePath, String branch, String repositoryId) { Repository repo; try { repo = service.getRepository(gitUsername, repositoryId); } catch (IOException ex) { LOG.info(gitUsername + ": Repo: has no descriptor file "); return null; } return readFileFromRepo(filePath, branch, repo); }

Target:
public String getFileContents(String filePath, String branch, String repositoryId) { Repository repo; try { repo = service.getRepository(gitUsername, repositoryId); } catch (IOException ex) { LOG.info(gitUsername + ": Repo " + repositoryId + " does not contain " + filePath + " on " + branch); return null; } return readFileFromRepo(filePath, branch, repo); }
Source:
public boolean isNetmaskValid(String netmask) { long addressInBits = IpAddressConverter.getInstance().covnertIpToLong(netmask); long mask = 1; boolean isFirstOneFound = false; for (int i = 0; i < 32; i++) { if (isFirstOneFound && (mask & addressInBits) != 1) { return false; } if ((mask & addressInBits) == 1) { isFirstOneFound = true; } addressInBits >>= 1; } return true; }

Target:
private boolean isNetmaskValid(String netmask) { long addressInBits = IpAddressConverter.getInstance().convertIpToLong(netmask); long mask = 1; boolean isFirstOneFound = false; for (int i = 0; i < 32; i++) { if (isFirstOneFound && (mask & addressInBits) != 1) { return false; } if ((mask & addressInBits) == 1) { isFirstOneFound = true; } addressInBits >>= 1; } return true; }
Source:
private BasicInvocationStage visitGetCommand(InvocationContext ctx, AbstractDataCommand command) throws Throwable { Object key = command.getKey(); CacheEntry entry = ctx.lookupEntry(key); if (entry == null) { if (ctx.isOriginLocal()) { if (readNeedsRemoteValue(ctx, command)) { return invokeNextAsync(ctx, command, remoteGet(ctx, command, false)); } } else { CacheTopology cacheTopology = checkTopologyId(command); if (!cacheTopology.getReadConsistentHash().isKeyLocalToNode(rpcManager.getAddress(), key)) { if (trace) log.tracef("In topology %d this (%s) is not an owner of %s, owners are %s", cacheTopology.getTopologyId(), rpcManager.getAddress(), key, cacheTopology.getReadConsistentHash().locateOwners(key)); return returnWith(UnsuccessfulResponse.INSTANCE); } } } return invokeNext(ctx, command); }

Target:
private BasicInvocationStage visitGetCommand(InvocationContext ctx, AbstractDataCommand command) throws Throwable { Object key = command.getKey(); CacheEntry entry = ctx.lookupEntry(key); if (entry == null) { if (ctx.isOriginLocal()) { if (readNeedsRemoteValue(ctx, command)) { return invokeNextAsync(ctx, command, remoteGet(ctx, command, command.getKey(), false)); } else { return returnWith(null); } } else { return handleMissingEntryOnRead(command); } } return invokeNext(ctx, command); }
Source:
public void run() { try { log.info(format("[Task %d] >> Sleep start", actionId)); for ( int i = 0 ; i < 10 ; i++ ) Lib.sleep(sleepMilli/10); log.info(format("[Task %d] << Sleep finish", actionId)); } catch (Exception ex) { log.info(format("[Task %d] **** Exception", actionId), ex); } }

Target:
public void run() { try { log.info(format("[Task %d] >> Sleep start", actionId)); Lib.sleep(sleepMilli); log.info(format("[Task %d] << Sleep finish", actionId)); } catch (Exception ex) { log.info(format("[Task %d] **** Exception", actionId), ex); } }
Source:
private CisConversionResult convertToPdf(File file, String filename, ConversionOption conversionOption) { CisConversionResult result = null; MediaType mediaType = getMediaType(file, filename); if (isPasswordProtected(mediaType)) { result = CisConversionResult.createPasswordFailureResult(filename, conversionOption, mediaType); } else { Convertor convertor = convertorFactory.getConvertor(mediaType); if (convertor == null) { String message = "Omzetten naar PDF mislukt! Reden: bestandstype wordt niet ondersteund (mediaType: " + mediaType + ")"; result = createFailureResult(filename, conversionOption, mediaType, message); } else { long startTime = System.currentTimeMillis(); result = convertor.convertToPdf(mediaType, filename, file, conversionOption); LOGGER.info(String.format("Convert (in %d msec): mediatype: %s, filename: %s, attachmentoptions: %s", System.currentTimeMillis() - startTime, mediaType, filename, conversionOption)); } } return result; }

Target:
private CisConversionResult convertToPdf(File file, String filename, ConversionOption conversionOption) { CisConversionResult result = null; MediaType mediaType = getMediaType(file, filename); if (isPasswordProtected(mediaType)) { result = CisConversionResult.createPasswordFailureResult(filename, conversionOption, mediaType); } else { Convertor convertor = convertorFactory.getConvertor(mediaType); if (convertor == null) { String message = "Omzetten naar PDF mislukt! Reden: bestandstype wordt niet ondersteund (mediaType: " + mediaType + ")"; result = createFailureResult(filename, conversionOption, mediaType, message); } else { long startTime = System.currentTimeMillis(); result = convertor.convertToPdf(mediaType, filename, file, conversionOption); LOGGER.debug(String.format("Convert (in %d msec): mediatype: %s, filename: %s, attachmentoptions: %s", System.currentTimeMillis() - startTime, mediaType, filename, conversionOption)); } } return result; }
Source:
public void run() throws InterruptedException { final int fieldCount = rel.getLeft().getRowType().getFieldCount() + rel.getRight().getRowType().getFieldCount(); context.values = new Object[fieldCount]; Source baseSource = leftSource; Source joinSource = rightSource; if (rel.getJoinType() == JoinRelType.RIGHT) { baseSource = rightSource; joinSource = leftSource; } Row baseRow = null; List<Row> joinRows = null; Set<Row> matchRowSet = new HashSet<>(); while ((baseRow = baseSource.receive()) != null) { if (joinRows == null) { joinRows = new ArrayList<Row>(); Row joinRow = null; while ((joinRow = joinSource.receive()) != null) { joinRows.add(joinRow); } } matchRowSet.addAll(doJoin(baseRow, joinRows, rel.getJoinType())); } if (rel.getJoinType() == JoinRelType.FULL) { List<Row> empty = new ArrayList<>(); for (Row row: joinRows) { if (matchRowSet.contains(row)) { continue; } doSend(row, empty, JoinRelType.RIGHT); } } }

Target:
public void run() throws InterruptedException { final int fieldCount = rel.getLeft().getRowType().getFieldCount() + rel.getRight().getRowType().getFieldCount(); context.values = new Object[fieldCount]; Source outerSource = leftSource; Source innerSource = rightSource; if (rel.getJoinType() == JoinRelType.RIGHT) { outerSource = rightSource; innerSource = leftSource; } Row outerRow = null; List<Row> innerRows = null; Set<Row> matchRowSet = new HashSet<>(); while ((outerRow = outerSource.receive()) != null) { if (innerRows == null) { innerRows = new ArrayList<Row>(); Row innerRow = null; while ((innerRow = innerSource.receive()) != null) { innerRows.add(innerRow); } } matchRowSet.addAll(doJoin(outerRow, innerRows, rel.getJoinType())); } if (rel.getJoinType() == JoinRelType.FULL) { List<Row> empty = new ArrayList<>(); for (Row row: innerRows) { if (matchRowSet.contains(row)) { continue; } doSend(row, empty, JoinRelType.RIGHT); } } }
Source:
public void sendMessage(byte[] message) { waitForConnect(); send(new Message().send() .withHeader(HEADER_DESTINATION, REQUEST_QUEUE) .withContent(new String(message, Charset.forName("UTF-8"))) .build()); }

Target:
public void sendMessage(byte[] message) { waitForConnect(); send(new Message().send() .withHeader(HEADER_DESTINATION, REQUEST_QUEUE) .withContent(new String(message,UTF8)) .build()); }
Source:
private boolean containsTokens(String searchString, SyntaxObjectType... tokens) { String upperSearchString = searchString.toUpperCase(); ISyntaxChecker syntaxChecker = getAutoCompleteModel().getSyntaxChecker(); SyntaxContainer syntaxCont = syntaxChecker.analyzeSyntaxState(upperSearchString, true); Set<SyntaxObjectType> searchStringSet = new HashSet<SyntaxObjectType>(); Iterator<SyntaxObject> iterator = syntaxCont.iterator(); while(iterator.hasNext()) { searchStringSet.add(iterator.next().getType()); } Set<SyntaxObjectType> tokenSet = new HashSet<SyntaxObjectType>(); tokenSet.addAll(Arrays.asList(tokens)); searchStringSet.retainAll(tokenSet); return !searchStringSet.isEmpty(); }

Target:
private boolean containsTokens(String searchString, SyntaxObjectType... tokens) { if (tokens == null) { return false; } ISyntaxChecker syntaxChecker = getAutoCompleteModel().getSyntaxChecker(); SyntaxContainer syntaxCont = syntaxChecker.analyzeSyntaxState(searchString, true); Set<SyntaxObjectType> searchTokenSet = new HashSet<SyntaxObjectType>(); Iterator<SyntaxObject> iterator = syntaxCont.iterator(); while(iterator.hasNext()) { searchTokenSet.add(iterator.next().getType()); } Set<SyntaxObjectType> tokenSet = new HashSet<SyntaxObjectType>(); tokenSet.addAll(Arrays.asList(tokens)); searchTokenSet.retainAll(tokenSet); return !searchTokenSet.isEmpty(); }
Source:
public ServerContext(Map<String, Object> serverConfig) { this.serverConfig = serverConfig; this.dataStore = new DataStore(serverConfig, this::dataStoreFileCleanup); generateNodeId(); this.failureHandlerPolicy = new ConservativeFailureHandlerPolicy(); final boolean providedEventLoops = getChannelImplementation().equals(ChannelImplementation.LOCAL); if (providedEventLoops) { clientGroup = getServerConfig(EventLoopGroup.class, "client"); workerGroup = getServerConfig(EventLoopGroup.class, "worker"); bossGroup = getServerConfig(EventLoopGroup.class, "boss"); } else { clientGroup = getNewClientGroup(); workerGroup = getNewWorkerGroup(); bossGroup = getNewBossGroup(); } nodeLocator = NodeLocator .parseString(serverConfig.get("--address") + ":" + serverConfig.get("<port>")); localEndpoint = nodeLocator.toEndpointUrl(); if (!isMetricsReportingSetUp(metrics)) { MetricsUtils.metricsReportingSetup(metrics); logMetricsSize(); } FileChannelPerf.setupParameters(OP_SPIKE_CNT, OP_SPIKE_LATENCY, false); logMetricsSize (); }

Target:
public ServerContext(Map<String, Object> serverConfig) { this.serverConfig = serverConfig; this.dataStore = new DataStore(serverConfig, this::dataStoreFileCleanup); generateNodeId(); this.failureHandlerPolicy = new ConservativeFailureHandlerPolicy(); final boolean providedEventLoops = getChannelImplementation().equals(ChannelImplementation.LOCAL); if (providedEventLoops) { clientGroup = getServerConfig(EventLoopGroup.class, "client"); workerGroup = getServerConfig(EventLoopGroup.class, "worker"); bossGroup = getServerConfig(EventLoopGroup.class, "boss"); } else { clientGroup = getNewClientGroup(); workerGroup = getNewWorkerGroup(); bossGroup = getNewBossGroup(); } nodeLocator = NodeLocator .parseString(serverConfig.get("--address") + ":" + serverConfig.get("<port>")); localEndpoint = nodeLocator.toEndpointUrl(); if (!isMetricsReportingSetUp(metrics)) { MetricsUtils.metricsReportingSetup(metrics); } FileChannelPerf.setupParameters(OP_SPIKE_CNT, OP_SPIKE_LATENCY, false); logMetricsSize(); }
Source:
private void doPoll() { try { messageProcessingManager .processMessage(new SchedulerFlowProcessingTemplate(listener, notificationFunctions, this), new SchedulerProcessContext()); } catch (Exception e) { muleContext.getExceptionListener().handleException(e); } }

Target:
private void doPoll() { try { setCurrentEvent(InternalEvent.builder(EventContextFactory.create(flowConstruct, getLocation())).message(Message.of(null)) .build()); messageProcessingManager.processMessage(flowProcessingTemplate, flowProcessContext); } catch (Exception e) { muleContext.getExceptionListener().handleException(e); } }