auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); Prefs.crashedBeforeActivityCreated(false); ActivityUtil.requestFullUserOrientation(this); setTheme(); removeSplashBackground(); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); } forceOverflowMenuIcon(this); }

Target:
public void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); ActivityUtil.requestFullUserOrientation(this); setTheme(); removeSplashBackground(); if (getSupportActionBar() != null) { getSupportActionBar().setDisplayHomeAsUpEnabled(true); } forceOverflowMenuIcon(this); }
Source:
public void VEAddMapTests_003_InsertMapFromZeroState() { wikiURL = urlBuilder.getUrlForWiki(URLsContent.veDisabledTestMainPage); int expectedMapNum = 1; VisualEditorPageObject ve = base.launchVisualEditorWithMainEdit(articleName, wikiURL); VisualEditorAddMapDialog mapDialog = (VisualEditorAddMapDialog) ve.openDialogFromMenu(InsertDialog.MAP); CreateAMapComponentObject map = mapDialog.clickCreateAMapButton(); CreateRealMapComponentObject realMap = map.clickRealMap(); realMap.verifyRealMapPreviewImage(); realMap.typeMapName(InteractiveMapsContent.mapName); CreatePinTypesComponentObject pinDialog = realMap.clickNext(); pinDialog.typePinTypeTitle(InteractiveMapsContent.pinTypeName, InteractiveMapsContent.pinTypeIndex); InteractiveMapPageObject createdMap = pinDialog.clickSave(); createdMap.verifyMapOpened(); mapID = createdMap.getEmbedMapID(); createdMap.verifyControButtonsAreVisible(); }

Target:
public void VEAddMapTests_003_InsertMapFromZeroState() { wikiURL = urlBuilder.getUrlForWiki(URLsContent.veDisabledTestMainPage); int expectedMapNum = 1; VisualEditorPageObject ve = base.launchVisualEditorWithMainEdit(articleName, wikiURL); VisualEditorAddMapDialog mapDialog = (VisualEditorAddMapDialog) ve.openDialogFromMenu(InsertDialog.MAP); CreateAMapComponentObject map = mapDialog.clickCreateAMapButton(); CreateRealMapComponentObject realMap = map.clickRealMap(); realMap.verifyRealMapPreviewImage(); realMap.typeMapName(InteractiveMapsContent.mapName); CreatePinTypesComponentObject pinDialog = realMap.clickNext(); pinDialog.typePinTypeTitle(InteractiveMapsContent.pinTypeName, InteractiveMapsContent.pinTypeIndex); createdMap = pinDialog.clickSave(); createdMap.verifyMapOpened(); mapID = createdMap.getEmbedMapID(); createdMap.verifyControlButtonsAreVisible(); }
Source:
private void parseChunkHeader(String line, HashMap<String, String> chunkOptions) { String modeId = display_.getModeId(); Pattern pattern = null; if (modeId == "mode/rmarkdown") pattern = RegexUtil.RE_RMARKDOWN_CHUNK_BEGIN; else if (modeId == "mode/sweave") pattern = RegexUtil.RE_SWEAVE_CHUNK_BEGIN; else if (modeId == "mode/rhtml") pattern = RegexUtil.RE_RHTML_CHUNK_BEGIN; if (pattern == null) return; Match match = pattern.match(line, 0); if (match == null) return; String extracted = match.getGroup(1); chunkPreamble_ = extractChunkPreamble(extracted, modeId); String chunkLabel = ChunkContextUi.extractChunkLabel(extracted); if (!StringUtil.isNullOrEmpty(chunkLabel)) tbChunkLabel_.setText(ChunkContextUi.extractChunkLabel(extracted)); int argsStartIdx = StringUtil.isNullOrEmpty(chunkLabel) ? extracted.indexOf(' ') : extracted.indexOf(','); String arguments = extracted.substring(argsStartIdx + 1); TextCursor cursor = new TextCursor(arguments); cursor.consumeUntilRegex("[^\\s,]"); int startIndex = 0; do { if (!cursor.fwdToCharacter('=', false)) break; int equalsIndex = cursor.getIndex(); int endIndex = arguments.length(); if (cursor.fwdToCharacter(',', true) || cursor.fwdToCharacter(' ', true)) { endIndex = cursor.getIndex(); } chunkOptions.put( arguments.substring(startIndex, equalsIndex).trim(), arguments.substring(equalsIndex + 1, endIndex).trim()); startIndex = cursor.getIndex() + 1; } while (cursor.moveToNextCharacter()); }

Target:
private void parseChunkHeader(String line, HashMap<String, String> chunkOptions) { String modeId = display_.getModeId(); Pattern pattern = null; if (modeId == "mode/rmarkdown") pattern = RegexUtil.RE_RMARKDOWN_CHUNK_BEGIN; else if (modeId == "mode/sweave") pattern = RegexUtil.RE_SWEAVE_CHUNK_BEGIN; else if (modeId == "mode/rhtml") pattern = RegexUtil.RE_RHTML_CHUNK_BEGIN; if (pattern == null) return; Match match = pattern.match(line, 0); if (match == null) return; String extracted = match.getGroup(1); chunkPreamble_ = extractChunkPreamble(extracted, modeId); String chunkLabel = ChunkContextUi.extractChunkLabel(extracted); if (!StringUtil.isNullOrEmpty(chunkLabel)) tbChunkLabel_.setText(chunkLabel); int argsStartIdx = StringUtil.isNullOrEmpty(chunkLabel) ? extracted.indexOf(' ') : extracted.indexOf(','); String arguments = extracted.substring(argsStartIdx + 1); TextCursor cursor = new TextCursor(arguments); cursor.consumeUntilRegex("[^\\s,]"); int startIndex = 0; do { if (!cursor.fwdToCharacter('=', false)) break; int equalsIndex = cursor.getIndex(); int endIndex = arguments.length(); if (cursor.fwdToCharacter(',', true) || cursor.fwdToCharacter(' ', true)) { endIndex = cursor.getIndex(); } chunkOptions.put( arguments.substring(startIndex, equalsIndex).trim(), arguments.substring(equalsIndex + 1, endIndex).trim()); startIndex = cursor.getIndex() + 1; } while (cursor.moveToNextCharacter()); }
Source:
private void zipFiles() { Logger.log(TAG, "Zipping Files"); ZipTask mZipTask = new ZipTask(toBeTransferredDirectory, zipFilePath) { @Override protected void deliverUpdate(CommCareWiFiDirectActivity receiver, String... update) { receiver.updateProgress(update[0], taskId); receiver.myStatusText.setText(update[0]); } @Override protected void deliverError(CommCareWiFiDirectActivity receiver, Exception e) { receiver.myStatusText.setText(localize("wifi.direct.zip.unsuccessful", e.getMessage())); receiver.transplantStyle(receiver.myStatusText, R.layout.template_text_notification_problem); } @Override protected void deliverResult(CommCareWiFiDirectActivity receiver, Integer result) { if (result == ZipTask.RESULT_SUCCESS) { receiver.onZipSuccesful(); } else { receiver.onZipError(); receiver.transplantStyle(receiver.myStatusText, R.layout.template_text_notification_problem); } } }; mZipTask.connect(CommCareWiFiDirectActivity.this); mZipTask.execute(); }

Target:
private void zipFiles() { Logger.log(TAG, "Zipping Files"); ZipTask mZipTask = new ZipTask(toBeTransferredDirectory, zipFilePath) { @Override protected void deliverUpdate(CommCareWiFiDirectActivity receiver, String... update) { receiver.updateProgress(update[0], taskId); receiver.myStatusText.setText(update[0]); } @Override protected void deliverError(CommCareWiFiDirectActivity receiver, Exception e) { receiver.myStatusText.setText(localize("wifi.direct.zip.unsuccessful", e.getMessage())); receiver.transplantStyle(receiver.myStatusText, R.layout.template_text_notification_problem); } @Override protected void deliverResult(CommCareWiFiDirectActivity receiver, ZipTaskResult result) { if (result == ZipTaskResult.Success) { receiver.onZipSuccesful(); } else { receiver.onZipError(); receiver.transplantStyle(receiver.myStatusText, R.layout.template_text_notification_problem); } } }; mZipTask.connect(CommCareWiFiDirectActivity.this); mZipTask.execute(); }
Source:
public void run() { while (running) { if (holder.getSurface().isValid()) { Canvas canvas = holder.lockCanvas(); updateField(); onDraw(canvas); holder.unlockCanvasAndPost(canvas); } } }

Target:
public void run() { while (running) { if (holder.getSurface().isValid()) { long startTime = System.nanoTime(); Canvas canvas = holder.lockCanvas(); updateField(); onDraw(canvas); holder.unlockCanvasAndPost(canvas); long finishTime = System.nanoTime(); Log.i("TIME", "Circle: " + (finishTime - startTime) / 1000000); } } }
Source:
public void readRateLimitShouldBeRespectedByConcurrentReadingThreads() throws InterruptedException { int numThreads = 5; int numReadsPerThread = 10; ExecutorService executorService = Executors.newFixedThreadPool(numThreads); List<Future<List<Todo>>> futures = new ArrayList<>(numThreads); long start = System.nanoTime(); IntStream.range(0, numThreads).forEach(i -> futures.add(executorService.submit(() -> { List<Todo> results = new ArrayList<>(numReadsPerThread); IntStream.range(0, numReadsPerThread) .forEach(j -> results.addAll(readOneBatchOfSize(1))); return results; }))); executorService.shutdown(); Preconditions.checkState(executorService.awaitTermination(30L, TimeUnit.SECONDS), "Read tasks did not finish in 30s"); long timeTakenToReadInSeconds = TimeUnit.NANOSECONDS.toSeconds(System.nanoTime() - start); assertThatAllReadsWereSuccessful(futures, numReadsPerThread); long actualReadRate = (numThreads * numReadsPerThread * ONE_TODO_SIZE_IN_BYTES) / timeTakenToReadInSeconds; assertThat(actualReadRate).isLessThan(readBytesPerSecond + (readBytesPerSecond / 10 )); }

Target:
public void readRateLimitShouldBeRespectedByConcurrentReadingThreads() throws InterruptedException { int numThreads = 5; int numReadsPerThread = 10; ExecutorService executorService = Executors.newFixedThreadPool(numThreads); List<Future<List<Todo>>> futures = new ArrayList<>(numThreads); long start = System.nanoTime(); IntStream.range(0, numThreads).forEach(i -> futures.add(executorService.submit(() -> { List<Todo> results = new ArrayList<>(numReadsPerThread); IntStream.range(0, numReadsPerThread) .forEach(j -> results.addAll(readOneBatchOfSize(1))); return results; }))); executorService.shutdown(); Preconditions.checkState(executorService.awaitTermination(30L, TimeUnit.SECONDS), "Read tasks did not finish in 30s"); long readTime = System.nanoTime() - start; assertThatAllReadsWereSuccessful(futures, numReadsPerThread); double actualBytesRead = numThreads * numReadsPerThread * ONE_TODO_SIZE_IN_BYTES; double maxReadBytesLimit = readBytesPerSecond * ((double) readTime / TimeUnit.SECONDS.toNanos(1) + 5 ); assertThat(actualBytesRead).isLessThan(maxReadBytesLimit); }
Source:
public synchronized void start() throws IOException { if (started) { LOGGER.debug("Endpoint at is already started", getUri()); return; } if (!this.coapstack.hasDeliverer()) { setMessageDeliverer(new ClientMessageDeliverer()); } if (this.executor == null) { int threadCount = config.getInt(Keys.PROTOCOL_STAGE_THREAD_COUNT); ThreadFactory factory = new DaemonThreadFactory("CoapEndpoint-" + connector + '#'); LOGGER.info("Endpoint requires an executor to start, using default daemon thread executor", getUri(), threadCount); setExecutor(ExecutorsUtil.newScheduledThreadPool(threadCount, factory)); addObserver(new EndpointObserver() { @Override public void started(final Endpoint endpoint) { } @Override public void stopped(final Endpoint endpoint) { } @Override public void destroyed(final Endpoint endpoint) { executor.shutdown(); } }); } if (exchangeExecutor == null) { exchangeExecutor = ExecutorsUtil.stripes(executor); } try { LOGGER.debug("Starting endpoint at {}", getUri()); started = true; matcher.start(); connector.start(); for (EndpointObserver obs : observers) { obs.started(this); } startExecutor(); LOGGER.info("Started endpoint at {}", getUri()); } catch (IOException e) { stop(); throw e; } }

Target:
public synchronized void start() throws IOException { if (running) { LOGGER.debug("Endpoint at is already started", getUri()); return; } if (!this.coapstack.hasDeliverer()) { setMessageDeliverer(new ClientMessageDeliverer()); } if (this.executor == null) { int threadCount = config.getInt(Keys.PROTOCOL_STAGE_THREAD_COUNT); ThreadFactory factory = new DaemonThreadFactory("CoapEndpoint-" + connector + '#'); LOGGER.info("Endpoint requires an executor to start, using default daemon thread executor", getUri(), threadCount); setExecutor(ExecutorsUtil.newScheduledThreadPool(threadCount, factory)); addObserver(new EndpointObserver() { @Override public void started(final Endpoint endpoint) { } @Override public void stopped(final Endpoint endpoint) { } @Override public void destroyed(final Endpoint endpoint) { exchangeExecutor.shutdown(); } }); } exchangeExecutor = ExecutorsUtil.stripes(executor); try { LOGGER.debug("Starting endpoint at {}", getUri()); running = true; matcher.start(); connector.start(); for (EndpointObserver obs : observers) { obs.started(this); } startExecutor(); LOGGER.info("Started endpoint at {}", getUri()); } catch (IOException e) { stop(); throw e; } }
Source:
public static HaxeComponentType typeOf(PsiElement element) { if (element instanceof HaxeClassDeclaration || element instanceof HaxeExternClassDeclaration || element instanceof HaxeGenericListPart || element instanceof HaxeAbstractClassDeclaration) { return CLASS; } if (element instanceof HaxeEnumDeclaration) { return ENUM; } if (element instanceof HaxeInterfaceDeclaration || element instanceof HaxeExternInterfaceDeclaration) { return INTERFACE; } if (element instanceof HaxeTypedefDeclaration) { return TYPEDEF; } if (element instanceof HaxeMethodDeclaration) { return METHOD; } if (element instanceof HaxeLocalFunctionDeclaration || element instanceof HaxeFunctionLiteral) { return FUNCTION; } if (element instanceof HaxeFieldDeclaration || element instanceof HaxeEnumValueDeclaration || element instanceof HaxeAnonymousTypeField) { return FIELD; } if (element instanceof HaxeLocalVarDeclaration || element instanceof HaxeForStatement) { return VARIABLE; } if (element instanceof HaxeParameter) { return PARAMETER; } if (element instanceof HaxeFieldDeclaration) { return CLASSVARIABLE; } return null; }

Target:
public static HaxeComponentType typeOf(PsiElement element) { if (element instanceof HaxeClassDeclaration || element instanceof HaxeExternClassDeclaration || element instanceof HaxeGenericListPart || element instanceof HaxeAbstractClassDeclaration) { return CLASS; } if (element instanceof HaxeEnumDeclaration) { return ENUM; } if (element instanceof HaxeInterfaceDeclaration || element instanceof HaxeExternInterfaceDeclaration) { return INTERFACE; } if (element instanceof HaxeTypedefDeclaration) { return TYPEDEF; } if (element instanceof HaxeMethodDeclaration) { return METHOD; } if (element instanceof HaxeLocalFunctionDeclaration || element instanceof HaxeFunctionLiteral) { return FUNCTION; } if (element instanceof HaxeFieldDeclaration || element instanceof HaxeEnumValueDeclaration || element instanceof HaxeAnonymousTypeField) { return FIELD; } if (element instanceof HaxeLocalVarDeclaration || element instanceof HaxeForStatement) { return VARIABLE; } if (element instanceof HaxeParameter) { return PARAMETER; } return null; }
Source:
public Iterator<Object[]> pLohData(){ List<Object[]> listOfDoubles = new ArrayList<>(); for(int i=1;i<20; i++) { listOfDoubles.add(new Object[]{i/40D}); } return listOfDoubles.iterator(); }

Target:
public Iterator<Object[]> pLohData() { final List<Object[]> listOfDoubles = new ArrayList<>(); for (int i = 1; i < 20; i++) { listOfDoubles.add(new Object[]{i / 40D}); } return listOfDoubles.iterator(); }
Source:
protected <T> T get(String url, TypeReference<T> type) { HttpResponse response = get(url); JsonNode node = getJsonNode(response); return mapper.convertValue(node, type); }

Target:
protected <T> T get(String url, TypeReference<T> type) { HttpResponse response = get(url); return getResponseBodyAsType(response, type); }
Source:
private int getJsonFieldPotentialOverhead(String fieldName, Map<String, Object> descriptionMap) { return String.format("\"%s\":\"\"", fieldName).length() + (descriptionMap.size() >= 1 ? 1 : 0); }

Target:
private int getJsonFieldPotentialOverhead(String fieldName, Map<String, Object> descriptionMap) { return String.format("\"%s\":\"\"", fieldName).length() + (descriptionMap.isEmpty() ? 0 : 1); }
Source:
public static String getProjectAbsolutePath(String... path) { StringBuilder builder = new StringBuilder(); for (String fragment : path) { builder.append("/" + fragment); } String filePath = ""; filePath = System.getProperty("user.dir"); File file = new File(filePath + builder.toString()); if (!file.exists()) { throw new RedDeerException("Resource file does not exists within project path " + filePath + builder.toString()); } return file.getAbsolutePath(); }

Target:
public static String getProjectAbsolutePath(String... path) { StringBuilder builder = new StringBuilder(); for (String fragment : path) { builder.append("/" + fragment); } String filePath = System.getProperty("user.dir"); File file = new File(filePath + builder.toString()); if (!file.exists()) { throw new RedDeerException("Resource file does not exists within project path " + filePath + builder.toString()); } return file.getAbsolutePath(); }
Source:
protected void visitLiteralGeometry(Literal expression) throws IOException { Geometry geom = (Geometry) evaluateLiteral(expression, Geometry.class); if (geom instanceof LinearRing) { geom = geom.getFactory().createLineString(((LinearRing) geom).getCoordinateSequence()); } Optional<Object> typenameOpt = Optional.ofNullable(currentGeometry) .map(GeometryDescriptor::getUserData) .map(m -> m.get(JDBCDataStore.JDBC_NATIVE_TYPENAME)); if (typenameOpt.filter(t -> "geography".equals(t)).isPresent()) { out.write("ST_GeogFromText('"); out.write(geom.toText()); out.write("')"); } else { out.write("ST_GeomFromText('"); out.write(geom.toText()); if (currentSRID == null && currentGeometry != null) { out.write("', ST_SRID(\"" + currentGeometry.getLocalName() + "\"))"); } else { out.write("', " + currentSRID + ")"); } } }

Target:
protected void visitLiteralGeometry(Literal expression) throws IOException { Geometry geom = (Geometry) evaluateLiteral(expression, Geometry.class); if (geom instanceof LinearRing) { geom = geom.getFactory().createLineString(((LinearRing) geom).getCoordinateSequence()); } Object typename = currentGeometry.getUserData().get(JDBCDataStore.JDBC_NATIVE_TYPENAME); if ("geography".equals(typename)) { out.write("ST_GeogFromText('"); out.write(geom.toText()); out.write("')"); } else { out.write("ST_GeomFromText('"); out.write(geom.toText()); if (currentSRID == null && currentGeometry != null) { out.write("', ST_SRID(\"" + currentGeometry.getLocalName() + "\"))"); } else { out.write("', " + currentSRID + ")"); } } }
Source:
private static <T> void addOsgiServices(Class<T> contract, Map<String, T> services) { if (!Util.isOSGiContext()) { return; } ClassLoader loader = ServiceFinder.class.getClassLoader(); if ((loader != null) && (loader instanceof org.osgi.framework.BundleReference)) { final BundleContext bundleContext = ((BundleReference) loader).getBundle().getBundleContext(); final ServiceTracker<T, T> serviceTracker = new ServiceTracker<T, T>(bundleContext, contract.getName(), null); serviceTracker.open(); try { final Object[] osgiServices = serviceTracker.getServices(); if (osgiServices != null) { for (Object osgiService : osgiServices) { services.putIfAbsent(osgiService.getClass().getName(), (T) osgiService); } } } catch (Exception e) { } } }

Target:
private static <T> void addOsgiServices(Class<T> contract, Map<String, T> services) { if (!Util.isOSGiContext()) { return; } ClassLoader loader = ServiceFinder.class.getClassLoader(); if ((loader != null) && (loader instanceof org.osgi.framework.BundleReference)) { final BundleContext bundleContext = ((BundleReference) loader).getBundle().getBundleContext(); final ServiceTracker<T, T> serviceTracker = new ServiceTracker<T, T>(bundleContext, contract.getName(), null); serviceTracker.open(); try { final Object[] osgiServices = serviceTracker.getServices(); if (osgiServices != null) { for (Object osgiService : osgiServices) { if (services.putIfAbsent(osgiService.getClass().getName(), (T) osgiService) == null) { LOG.debugf("Loading service impl: %s", osgiService.getClass().getSimpleName()); } else { LOG.debugf("Ignoring already loaded service: %s", osgiService.getClass().getSimpleName()); } } } } catch (Exception e) { } } }
Source:
public void setEndpointState(InputStream endpointState) { checkCallContext(); callContext.withEndpointState(NodeConverter.InputStreamToBytes(endpointState)); }

Target:
public void setEndpointState(InputStream endpointState) { setEndpointState(NodeConverter.InputStreamToBytes(endpointState)); }
Source:
public int first() { if(size == 0) { return 0; } short firstKey = keys[0]; Container container = values[0]; return firstKey << 16 | container.first(); }

Target:
public int first() { assertNonEmpty(); short firstKey = keys[0]; Container container = values[0]; return firstKey << 16 | container.first(); }
Source:
public static void smite(Player player, CommandSender sender, String reason) { FUtil.bcastMsg(player.getName() + " has been a naughty, naughty boy.", ChatColor.RED); if (reason != null) { FUtil.bcastMsg(" Reason: " + reason + " (" + sender.getName() + ")", ChatColor.RED); }else { FUtil.bcastMsg("Smited by: " + sender.getName(), ChatColor.RED); } player.setOp(false); player.setGameMode(GameMode.SURVIVAL); player.getInventory().clear(); final Location targetPos = player.getLocation(); final World world = player.getWorld(); for (int x = -1; x <= 1; x++) { for (int z = -1; z <= 1; z++) { final Location strike_pos = new Location(world, targetPos.getBlockX() + x, targetPos.getBlockY(), targetPos.getBlockZ() + z); world.strikeLightning(strike_pos); } } player.setHealth(0.0); player.sendMessage(ChatColor.YELLOW + "You've been smitten by: " + sender.getName()); if (reason != null) { player.sendMessage(ChatColor.YELLOW + sender.getName() + " smited you for, " + reason); } }

Target:
public static void smite(Player player, CommandSender sender, String reason) { FUtil.bcastMsg(player.getName() + " has been a naughty, naughty boy.", ChatColor.RED); if (reason != null) { FUtil.bcastMsg(" Reason: " + reason + " (" + sender.getName() + ")", ChatColor.RED); } else { FUtil.bcastMsg("Smitten by: " + sender.getName(), ChatColor.RED); } player.setOp(false); player.setGameMode(GameMode.SURVIVAL); player.getInventory().clear(); final Location targetPos = player.getLocation(); final World world = player.getWorld(); for (int x = -1; x <= 1; x++) { for (int z = -1; z <= 1; z++) { final Location strike_pos = new Location(world, targetPos.getBlockX() + x, targetPos.getBlockY(), targetPos.getBlockZ() + z); world.strikeLightning(strike_pos); } } player.setHealth(0.0); if (reason != null) { player.sendMessage(ChatColor.YELLOW + "You were smitten for, " + reason); } }
Source:
public void testPurgeDeletedVault() { api().purgeVault(LOCATION, vaultName); Object[] args = { resourceGroupName, vaultName, false }; checkState(deletedVaultStatus.create(resourceGroupName, true).apply(vaultName), "vault was not purged before timeout"); }

Target:
public void testPurgeDeletedVault() { api().purgeVault(LOCATION, vaultName); checkState(deletedVaultStatus.create(resourceGroupName, true).apply(vaultName), "vault was not purged before timeout"); }
Source:
public void visitMethod(MethodTree tree) { if (isExcluded(tree)) { return; } Symbol.MethodSymbol symbol = tree.symbol(); methodReferences.push(new MethodReference(symbol)); scan(tree.parameters()); scan(tree.block()); MethodReference reference = methodReferences.pop(); ClassTree classTree = (ClassTree) tree.parent(); if ((tree.isOverriding() != null && tree.isOverriding()) || classTree.is(Tree.Kind.ENUM)) { return; } if ((symbol.isPrivate() || symbol.isFinal() || classTree.symbol().isFinal()) && !symbol.isStatic() && !reference.hasNonStaticReference()) { context.reportIssue(this, tree.simpleName(), "Make \"" + symbol.name() + "\" a \"static\" method."); } }

Target:
public void visitMethod(MethodTree tree) { if (isExcluded(tree)) { return; } Symbol.MethodSymbol symbol = tree.symbol(); methodReferences.push(new MethodReference(symbol)); scan(tree.parameters()); scan(tree.block()); MethodReference reference = methodReferences.pop(); ClassTree classTree = (ClassTree) tree.parent(); if (Boolean.TRUE.equals(tree.isOverriding()) || classTree.is(Tree.Kind.ENUM)) { return; } if ((symbol.isPrivate() || symbol.isFinal() || classTree.symbol().isFinal()) && !symbol.isStatic() && !reference.hasNonStaticReference()) { context.reportIssue(this, tree.simpleName(), "Make \"" + symbol.name() + "\" a \"static\" method."); } }
Source:
protected boolean canDetect(JsonPointer pointer) { return pointer != null && (pointer.toString().endsWith("$ref") || pointer.toString().endsWith("operationRef")); }

Target:
protected boolean canDetect(JsonPointer pointer) { return pointer != null && pointer.toString().endsWith("$ref"); }
Source:
void checkConnected(long timeout) { if (_zkclient == null || _zkclient.isClosed()) { throw new HelixException( "HelixManager (ZkClient) is not connected. Call HelixManager#connect()"); } boolean isConnected = isConnected(); if (!isConnected && timeout > 0) { LOG.warn( "zkClient to " + _zkAddress + " is not connected, wait for " + _waitForConnectedTimeout + "ms."); isConnected = _zkclient.waitUntilConnected(_waitForConnectedTimeout, TimeUnit.MILLISECONDS); } if (!isConnected) { LOG.error("zkClient is not connected after waiting " + timeout + "ms." + ", clusterName: " + _clusterName + ", zkAddress: " + _zkAddress); throw new HelixException( "HelixManager is not connected within retry timeout for cluster " + _clusterName); } _sessionId = ZKUtil.toHexSessionId(_zkclient.getSessionId()); }

Target:
void checkConnected(long timeout) { if (_zkclient == null || _zkclient.isClosed()) { throw new HelixException( "HelixManager (ZkClient) is not connected. Call HelixManager#connect()"); } boolean isConnected = isConnected(); if (!isConnected && timeout > 0) { LOG.warn("zkClient to " + getZkConnectionInfo() + " is not connected, wait for " + _waitForConnectedTimeout + "ms."); isConnected = _zkclient.waitUntilConnected(_waitForConnectedTimeout, TimeUnit.MILLISECONDS); } if (!isConnected) { LOG.error("zkClient is not connected after waiting " + timeout + "ms." + ", clusterName: " + _clusterName + ", zkAddress: " + getZkConnectionInfo()); throw new HelixException( "HelixManager is not connected within retry timeout for cluster " + _clusterName); } }
Source:
public void apply(Project project) { SarosIntellijExtension e = project.getExtensions().create("sarosIntellij", SarosIntellijExtension.class); createIntelliJConfigurationTask(project); disableBuildSearchableOptions(project); }

Target:
public void apply(Project project) { SarosIntellijExtension sarosExtension = project.getExtensions().create(EXTENSION_NAME, SarosIntellijExtension.class); project.afterEvaluate(p -> configureIntellijAfterEvaluate(p, sarosExtension)); project.getPluginManager().apply(IntelliJPlugin.class); }
Source:
public List<LogLag> getLagPerPartition(String name, String group) { LogLag[] ret; Properties props = (Properties) consumerProperties.clone(); props.put(ConsumerConfig.GROUP_ID_CONFIG, group); try (KafkaConsumer<String, Bytes> consumer = new KafkaConsumer<>(props)) { List<TopicPartition> topicPartitions = new ArrayList<>(); consumer.partitionsFor(getTopicName(name)).forEach( meta -> topicPartitions.add(new TopicPartition(meta.topic(), meta.partition()))); ret = new LogLag[topicPartitions.size()]; Map<TopicPartition, Long> endOffsets = consumer.endOffsets(topicPartitions); for (TopicPartition topicPartition : topicPartitions) { long committedOffset = 0L; OffsetAndMetadata committed = consumer.committed(topicPartition); if (committed != null) { committedOffset = committed.offset(); } Long endOffset = endOffsets.get(topicPartition); if (endOffset == null) { endOffset = 0L; } ret[topicPartition.partition()] = new LogLag(committedOffset, endOffset); } } return Arrays.asList(ret); }

Target:
public List<LogLag> getLagPerPartition(String name, String group) { Properties props = (Properties) consumerProperties.clone(); props.put(ConsumerConfig.GROUP_ID_CONFIG, group); try (KafkaConsumer<String, Bytes> consumer = new KafkaConsumer<>(props)) { List<TopicPartition> topicPartitions = consumer.partitionsFor(getTopicName(name)) .stream() .map(meta -> new TopicPartition(meta.topic(), meta.partition())) .collect(Collectors.toList()); LogLag[] ret = new LogLag[topicPartitions.size()]; Map<TopicPartition, Long> endOffsets = consumer.endOffsets(topicPartitions); for (TopicPartition topicPartition : topicPartitions) { long committedOffset = 0L; OffsetAndMetadata committed = consumer.committed(topicPartition); if (committed != null) { committedOffset = committed.offset(); } Long endOffset = endOffsets.get(topicPartition); if (endOffset == null) { endOffset = 0L; } ret[topicPartition.partition()] = new LogLag(committedOffset, endOffset); } return Arrays.asList(ret); } }
Source:
private RntbdRequestRecord addPendingRequestRecord(final ChannelHandlerContext context, final RntbdRequestRecord record) { return this.pendingRequests.compute(record.transportRequestId(), (id, current) -> { reportIssueUnless(current == null, context, "id: {}, current: {}, request: {}", record); final Timeout pendingRequestTimeout = record.newTimeout(timeout -> { requestExpirator.execute(record::expire); }); record.whenComplete((response, error) -> { this.pendingRequests.remove(id); pendingRequestTimeout.cancel(); }); return record; }); }

Target:
private RntbdRequestRecord addPendingRequestRecord(final ChannelHandlerContext context, final RntbdRequestRecord record) { return this.pendingRequests.compute(record.transportRequestId(), (id, current) -> { reportIssueUnless(current == null, context, "id: {}, current: {}, request: {}", record); final Timeout pendingRequestTimeout = record.newTimeout(timeout -> { requestExpirationExecutor.execute(record::expire); }); record.whenComplete((response, error) -> { this.pendingRequests.remove(id); pendingRequestTimeout.cancel(); }); return record; }); }
Source:
private static Profile fetch(final XML xml) { final Profile profile = new GithubProfile( Profiles.github().repos().get( new Coordinates.Simple( xml.xpath( " ).get(0) ) ), xml.xpath( " ).get(0) ); return profile; }

Target:
private Profile fetch(final XML xml) throws IOException { final Profile profile; final List<String> type = xml.xpath(" if (type.isEmpty() || !Profiles.MERGE.equals(type.get(0))) { profile = new GithubProfile( new TalkIssues(Profiles.github(), xml).get().repo() ); } else { final Profile master = new GithubProfile( new TalkIssues(Profiles.github(), xml).get().repo() ); profile = this.merged( master, xml.xpath(" xml.xpath( " ).get(0) ); } return profile; }
Source:
public void initIsolatedDomainGroup() { account = gd.getAccountService().createAccount(new Account(LOGIN, "nnPvcGXU7f", "FistName", "LastName"), getProperty("domain")); }

Target:
public void initIsolatedDomainGroup() { account = gd.getAccountService().createAccount(new Account(LOGIN, "nnPvcGXU7f", "FirstName", "LastName"), getProperty("domain")); }
Source:
private void validate(final MultivaluedMap<String, String> data) throws RuntimeException { if (!data.containsKey("Login")) { throw new NullPointerException("Login can not be null."); } else if (!data.containsKey("Password")) { throw new NullPointerException("Password can not be null."); } for (char ch: ClientLoginConstrains.NOT_ALLOWED_CHARS) { if (data.getFirst("Login").indexOf(ch) > -1) { String msg = String.format("Login %s contains invalid character: %s ",data.getFirst("Login"), ch); if (logger.isDebugEnabled()) { logger.debug(msg); } throw new IllegalArgumentException(msg); } } }

Target:
private void validate(final MultivaluedMap<String, String> data) throws RuntimeException { if (!data.containsKey("Login")) { throw new NullPointerException("Login can not be null."); } else if (!data.containsKey("Password")) { throw new NullPointerException("Password can not be null."); } if (!ClientLoginConstrains.isValidClientLogin(data.getFirst("Login"))) { String msg = String.format("Login %s contains invalid character(s)",data.getFirst("Login")); if (logger.isDebugEnabled()) { logger.debug(msg); } throw new IllegalArgumentException(msg); } }
Source:
public void commitTransaction() throws Exception { int statusCode = 0, triesCount = 0; HttpResponse response = null; LOGGER.info("Sending bulk request to elasticsearch cluster"); String entity; synchronized (bulkBuilder) { entity = bulkBuilder.toString(); bulkBuilder = new StringBuilder(); } while (statusCode != HttpStatus.SC_OK && triesCount < serversList.size()) { triesCount++; String host = serversList.get(); String url = host + "/" + BULK_ENDPOINT; HttpPost httpRequest = new HttpPost(url); httpRequest.setEntity(new StringEntity(entity)); response = httpClient.execute(httpRequest); statusCode = response.getStatusLine().getStatusCode(); LOGGER.info("Status code from elasticsearch: " + statusCode); if (response.getEntity() != null) { LOGGER.debug("Status message from elasticsearch: " + EntityUtils.toString(response.getEntity(), "UTF-8")); } } if (statusCode != HttpStatus.SC_OK) { if (response.getEntity() != null) { throw new MorphlineRuntimeException(EntityUtils.toString(response.getEntity(), "UTF-8")); } else { throw new MorphlineRuntimeException("Elasticsearch status code was: " + statusCode); } } }

Target:
public void commitTransaction() throws Exception { int statusCode = 0, triesCount = 0; HttpResponse response = null; LOGGER.debug("Sending bulk request to elasticsearch cluster"); String entity; entity = bulkBuilder.toString(); bulkBuilder = new StringBuilder(); while (statusCode != HttpStatus.SC_OK && triesCount < serversList.size()) { triesCount++; String host = serversList.get(); String url = host + "/" + BULK_ENDPOINT; HttpPost httpRequest = new HttpPost(url); httpRequest.setEntity(new StringEntity(entity)); response = httpClient.execute(httpRequest); statusCode = response.getStatusLine().getStatusCode(); LOGGER.debug("Status code from elasticsearch: " + statusCode); if (response.getEntity() != null) { LOGGER.debug("Status message from elasticsearch: " + EntityUtils.toString(response.getEntity(), "UTF-8")); } } if (statusCode != HttpStatus.SC_OK) { if (response.getEntity() != null) { throw new MorphlineRuntimeException(EntityUtils.toString(response.getEntity(), "UTF-8")); } else { throw new MorphlineRuntimeException("Elasticsearch status code was: " + statusCode); } } }
Source:
public String getFooter(@NonNull List<Receipt> receipts) { if (!receipts.isEmpty()) { final PriceCurrency tripCurrency = receipts.get(0).getTrip().getTripCurrency(); final List<Price> prices = new ArrayList<>(); for (final Receipt receipt : receipts) { prices.add(receipt.getPrice()); } final Price netPrice = new PriceBuilderFactory().setPrices(prices, tripCurrency).build(); if (netPrice instanceof ImmutableNetPriceImpl) { return ((ImmutableNetPriceImpl) netPrice).getCurrencyCodeFormattedNotExchangedPrice(); } else { return netPrice.getDecimalFormattedPrice(); } } else { return ""; } }

Target:
public String getFooter(@NonNull List<Receipt> receipts) { if (!receipts.isEmpty()) { final PriceCurrency tripCurrency = receipts.get(0).getTrip().getTripCurrency(); final List<Price> prices = new ArrayList<>(); for (final Receipt receipt : receipts) { prices.add(receipt.getPrice()); } return new PriceBuilderFactory().setPrices(prices, tripCurrency).build() .getCurrencyCodeFormattedPrice(); } else { return ""; } }
Source:
public HcVaultKmsAead(Vault vault, String keyUri) { this.vault = vault; this.encryptPath = PathBuilder.encryptionPath(keyUri); this.decryptPath = PathBuilder.decryptionPath(keyUri); }

Target:
public HcVaultKmsAead(Vault vault, String keyUri) throws GeneralSecurityException { this.vault = vault; this.encryptPath = getEncryptPath(keyUri); this.decryptPath = getDecryptionPath(keyUri); }
Source:
public String getOvnCentralByClusterId(Guid clusterId) { List<Network> clusterNetworks = networkDao.getAllForCluster(clusterId); for (Provider provider : providerDao.getAllByTypes(ProviderType.EXTERNAL_NETWORK)) { for (Network network : clusterNetworks) { ProviderNetwork providerNetwork = network.getProvidedBy(); if (providerNetwork != null && (providerNetwork.getProviderId().equals(provider.getId()))) { return NetworkUtils.getIpAddress(provider.getUrl()); } } } return null; }

Target:
public String getOvnCentralByClusterId(Guid clusterId) { List<Network> clusterNetworks = networkDao.getAllForCluster(clusterId); for (Provider provider : providerDao.getAllByTypes(ProviderType.EXTERNAL_NETWORK)) { for (Network network : clusterNetworks) { ProviderNetwork providerNetwork = network.getProvidedBy(); if (providerNetwork != null && providerNetwork.getProviderId().equals(provider.getId())) { return NetworkUtils.getIpAddress(provider.getUrl()); } } } return null; }
Source:
public void writeBatchToAllNonTxStores(Iterable<MarshallableEntry> entries, Predicate<? super StoreConfiguration> predicate, long flags) { if (!entries.iterator().hasNext()) return; storesMutex.readLock().lock(); try { checkStoreAvailability(); CompletableFuture batchFutures = CompletableFuture.allOf( nonTxWriters.stream() .filter(writer -> !(writer instanceof FlagAffectedStore) || FlagAffectedStore.class.cast(writer).shouldWrite(flags)) .filter(writer -> predicate.test(getStoreConfig(writer))) .map(writer -> writer.writeBatch(Flowable.fromIterable(entries))) .map(CompletionStage::toCompletableFuture) .toArray(CompletableFuture[]::new) ); try { batchFutures.get(); } catch (ExecutionException e) { throw new PersistenceException(e.getCause()); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PersistenceException(e); } } finally { storesMutex.readLock().unlock(); } }

Target:
public void writeBatchToAllNonTxStores(Iterable<MarshallableEntry> entries, Predicate<? super StoreConfiguration> predicate, long flags) { if (!entries.iterator().hasNext()) return; storesMutex.readLock().lock(); try { checkStoreAvailability(); CompletableFuture batchFutures = CompletableFuture.allOf( nonTxWriters.stream() .filter(writer -> !(writer instanceof FlagAffectedStore) || FlagAffectedStore.class.cast(writer).shouldWrite(flags)) .filter(writer -> predicate.test(getStoreConfig(writer))) .map(writer -> writer.bulkUpdate(Flowable.fromIterable(entries))) .map(CompletionStage::toCompletableFuture) .toArray(CompletableFuture[]::new) ); try { batchFutures.get(); } catch (ExecutionException e) { throw new PersistenceException(e.getCause()); } catch (InterruptedException e) { Thread.currentThread().interrupt(); throw new PersistenceException(e); } } finally { storesMutex.readLock().unlock(); } }
Source:
private static boolean tryCdata(Scanner scanner) { scanner.next(); if (scanner.next('C') && scanner.next('D') && scanner.next('A') && scanner.next('T') && scanner.next('A') && scanner.next('[')) { while (scanner.find(']') >= 0) { if (scanner.next(']') && scanner.next(']') && scanner.next('>')) { return true; } } } return false; }

Target:
private static boolean tryCdata(Scanner scanner) { scanner.next(); if (scanner.next("CDATA[")) { while (scanner.find(']') >= 0) { if (scanner.next("]]>")) { return true; } else { scanner.next(); } } } return false; }
Source:
public String format(final T e) { String message = "Error (" + e.getClass().getSimpleName() + "): " + e.getMessage(); if (e.getCause() != null && !Guard.isStringNullOrEmpty(e.getCause().getMessage())) { message += "\nCause: " + e.getCause().getMessage(); } return message; }

Target:
public String format(final T e) { final StringBuilder message = new StringBuilder("Error ("); message.append(e.getClass().getSimpleName()); message.append("): "); message.append(e.getMessage()); if (e.getCause() != null && !Guard.isStringNullOrEmpty(e.getCause().getMessage())) { message.append("\nCause: "); message.append(e.getCause().getMessage()); } return message.toString(); }
Source:
private void rightClickBook(GlowPlayer player, ItemStack holding) { if (holding.getItemMeta() instanceof KnowledgeBookMeta) { KnowledgeBookMeta recipes = (KnowledgeBookMeta) holding.getItemMeta(); if (recipes.hasRecipes()) { for (NamespacedKey recipe : recipes.getRecipes()) { player.learnRecipe(((GlowServer) Bukkit.getServer()).getCraftingManager() .getRecipeByKey(recipe), true); } } holding.setAmount(0); } }

Target:
private void rightClickBook(GlowPlayer player, ItemStack holding) { if (holding.getItemMeta() instanceof KnowledgeBookMeta) { KnowledgeBookMeta recipes = (KnowledgeBookMeta) holding.getItemMeta(); if (recipes.hasRecipes()) { for (NamespacedKey recipe : recipes.getRecipes()) { player.learnRecipe(((GlowServer) Bukkit.getServer()).getCraftingManager() .getRecipeByKey(recipe), true); } } if (player.getGameMode() != GameMode.CREATIVE) { holding.setAmount(0); } } }
Source:
public Result<TopNResultValue> apply(Cursor cursor) { final DimensionSelector dimSelector = cursor.makeDimensionSelector( query.getDimensionSpec().getDimension(), query.getDimensionSpec().getExtractionFn() ); if (dimSelector == null) { return null; } TopNParams params = null; try { params = topNAlgorithm.makeInitParams(dimSelector, cursor); TopNResultBuilder resultBuilder = BaseTopNAlgorithm.makeResultBuilder(params, query); topNAlgorithm.run(params, resultBuilder, null); return resultBuilder.build(); } finally { if (params != null) { topNAlgorithm.cleanup(params); } } }

Target:
public Result<TopNResultValue> apply(Cursor cursor) { final DimensionSelector dimSelector = cursor.makeDimensionSelector( query.getDimensionSpec().getDimension(), query.getDimensionSpec().getExtractionFn() ); if (dimSelector == null) { return null; } TopNParams params = null; try { params = topNAlgorithm.makeInitParams(dimSelector, cursor); TopNResultBuilder resultBuilder = BaseTopNAlgorithm.makeResultBuilder(params, query); topNAlgorithm.run(params, resultBuilder, null); return resultBuilder.build(); } finally { topNAlgorithm.cleanup(params); } }
Source:
public StorageServerConnections(String connection, String id, String iqn, String password, StorageType storageType, String userName, String port, String portal, String vfsType, String mountOptions, NfsVersion nfsVersion, Short nfsRetrans, Short nfsTimeo) { this.connection = connection; this.id = id; this.iqn = iqn; this.password = password; this.storageType = storageType; this.username = userName; this.port = port; this.portal = portal; this.vfsType = vfsType; this.mountOptions = mountOptions; this.nfsVersion = nfsVersion; this.nfsRetrans = nfsRetrans; this.nfsTimeo = nfsTimeo; }

Target:
public StorageServerConnections(String connection, String id, String iqn, String password, StorageType storageType, String userName, String port, String portal, String vfsType, String mountOptions, NfsVersion nfsVersion, Short nfsRetrans, Short nfsTimeo) { setconnection(connection); setid(id); setiqn(iqn); setpassword(password); setstorage_type(storageType); setuser_name(userName); setport(port); setportal(portal); setVfsType(vfsType); setMountOptions(mountOptions); setNfsVersion(nfsVersion); setNfsRetrans(nfsRetrans); setNfsTimeo(nfsTimeo); }
Source:
private static void validateHeaders(Dictionary<String, String> manifest, boolean jreBundle) throws BundleException { for (String DEFINED_OSGI_VALIDATE_HEADERS1 : DEFINED_OSGI_VALIDATE_HEADERS) { String header = manifest.get(DEFINED_OSGI_VALIDATE_HEADERS1); if (header != null) { ManifestElement[] elements = ManifestElement.parseHeader(DEFINED_OSGI_VALIDATE_HEADERS1, header); checkForDuplicateDirectivesAttributes(DEFINED_OSGI_VALIDATE_HEADERS1, elements); if (DEFINED_OSGI_VALIDATE_HEADERS1 == Constants.IMPORT_PACKAGE) { checkImportExportSyntax(DEFINED_OSGI_VALIDATE_HEADERS1, elements, false, false, jreBundle); } if (DEFINED_OSGI_VALIDATE_HEADERS1 == Constants.DYNAMICIMPORT_PACKAGE) { checkImportExportSyntax(DEFINED_OSGI_VALIDATE_HEADERS1, elements, false, true, jreBundle); } if (DEFINED_OSGI_VALIDATE_HEADERS1 == Constants.EXPORT_PACKAGE) { checkImportExportSyntax(DEFINED_OSGI_VALIDATE_HEADERS1, elements, true, false, jreBundle); } if (DEFINED_OSGI_VALIDATE_HEADERS1 == Constants.FRAGMENT_HOST) { checkExtensionBundle(DEFINED_OSGI_VALIDATE_HEADERS1, elements); } } else if (DEFINED_OSGI_VALIDATE_HEADERS1 == Constants.BUNDLE_SYMBOLICNAME) { throw new BundleException(NLS.bind(StateMsg.HEADER_REQUIRED, Constants.BUNDLE_SYMBOLICNAME), BundleException.MANIFEST_ERROR); } } }

Target:
private static void validateHeaders(Dictionary<String, String> manifest, boolean jreBundle) throws BundleException { for (String definedOSGiValidateHeader : DEFINED_OSGI_VALIDATE_HEADERS) { String header = manifest.get(definedOSGiValidateHeader); if (header != null) { ManifestElement[] elements = ManifestElement.parseHeader(definedOSGiValidateHeader, header); checkForDuplicateDirectivesAttributes(definedOSGiValidateHeader, elements); if (definedOSGiValidateHeader == Constants.IMPORT_PACKAGE) { checkImportExportSyntax(definedOSGiValidateHeader, elements, false, false, jreBundle); } if (definedOSGiValidateHeader == Constants.DYNAMICIMPORT_PACKAGE) { checkImportExportSyntax(definedOSGiValidateHeader, elements, false, true, jreBundle); } if (definedOSGiValidateHeader == Constants.EXPORT_PACKAGE) { checkImportExportSyntax(definedOSGiValidateHeader, elements, true, false, jreBundle); } if (definedOSGiValidateHeader == Constants.FRAGMENT_HOST) { checkExtensionBundle(definedOSGiValidateHeader, elements); } } else if (definedOSGiValidateHeader == Constants.BUNDLE_SYMBOLICNAME) { throw new BundleException(NLS.bind(StateMsg.HEADER_REQUIRED, Constants.BUNDLE_SYMBOLICNAME), BundleException.MANIFEST_ERROR); } } }
Source:
protected void internalReceiveCommand(String itemName, Command command) { logger.debug("internalReceiveCommand({},{}) is called!", itemName, command); }

Target:
protected void internalReceiveCommand(String itemName, Command command) { writeToGiraHomeServerBuffered(itemName, command); }
Source:
@Override public RexNode visitCall(RexCall call) { if (call.getOperator().getKind() == SqlKind.NOT) { RexNode child = call.getOperands().get(0); if (child.getKind() == SqlKind.LIKE) { List<RexNode> operands = FluentIterable.from(((RexCall) child).getOperands()) .transform(new Function<RexNode, RexNode>() { @Override public RexNode apply(RexNode rexNode) { return rexNode.accept(NotLikeConverter.this); } }).toList(); return rexBuilder.makeCall(SqlStdOperatorTable.NOT_LIKE, operands); } } return super.visitCall(call); }

Target:
@Override public RexNode visitCall(RexCall call) { if (call.getOperator().getKind() == SqlKind.NOT) { RexNode child = call.getOperands().get(0); if (child.getKind() == SqlKind.LIKE) { List<RexNode> operands = ((RexCall) child).getOperands() .stream() .map(rexNode -> rexNode.accept(NotLikeConverter.this)) .collect(Collectors.toList()); return rexBuilder.makeCall(SqlStdOperatorTable.NOT_LIKE, operands); } } return super.visitCall(call); }
Source:
public ResponderServer listen() { ChannelManager channelManager = msbContext.getChannelManager(); boolean isAlreadySubscribed = channelManager.subscribe(namespace, message -> { LOG.debug("Received message with id from topic {}", message.getId(), namespace); ResponderImpl responder = new ResponderImpl(messageTemplate, message, msbContext); onResponder(responder); }); if(isAlreadySubscribed) { throw new IllegalStateException("Only one instance of ResponderServer should be created"); } return this; }

Target:
public ResponderServer listen() { ChannelManager channelManager = msbContext.getChannelManager(); channelManager.subscribe(namespace, message -> { LOG.debug("Received message with id from topic {}", message.getId(), namespace); ResponderImpl responder = new ResponderImpl(messageTemplate, message, msbContext); onResponder(responder); }); return this; }
Source:
private void addCrossCompilationOptions(ImmutableList.Builder<String> command) { if (shouldCrossCompile()) { command.add("-j"); javacOptions.appendOptionsTo( new OptionsConsumer() { @Override public void addOptionValue(String option, String value) { if (option.equals("sourcepath")) { return; } if (option.equals("classpath") && value.equals("''")) { return; } if (!Strings.isNullOrEmpty(value)) { command.add("-J" + String.format("%s=%s", option, value)); } } @Override public void addFlag(String flagName) { command.add("-F" + flagName); } @Override public void addExtras(Collection<String> extras) { for (String extra : extras) { if (extra.startsWith("-")) { addFlag(extra.substring(1)); } else { addFlag(extra); } } } }, resolver, filesystem); } }

Target:
private void addCrossCompilationOptions(ImmutableList.Builder<String> command) { if (shouldCrossCompile()) { command.add("-j"); javacOptions.appendOptionsTo( new OptionsConsumer() { @Override public void addOptionValue(String option, String value) { if (option.equals("sourcepath")) { return; } if (!Strings.isNullOrEmpty(value)) { command.add("-J" + String.format("%s=%s", option, value)); } } @Override public void addFlag(String flagName) { command.add("-F" + flagName); } @Override public void addExtras(Collection<String> extras) { for (String extra : extras) { if (extra.startsWith("-")) { addFlag(extra.substring(1)); } else { addFlag(extra); } } } }, resolver, filesystem); } }