auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static <K extends WritableComparable<?>,V extends Writable> SortedKeyValueIterator<K,V> loadIteratorsHelper(IteratorScope scope, SortedKeyValueIterator<K,V> source, KeyExtent extent, AccumuloConfiguration conf, List<IterInfo> ssiList, Map<String,Map<String,String>> ssio, IteratorEnvironment env, boolean useAccumuloClassLoader, String classLoaderContext) throws IOException { List<IterInfo> iters = new ArrayList<>(ssiList); Map<String,Map<String,String>> allOptions = new HashMap<>(); parseIteratorConfiguration(scope, iters, ssio, allOptions, conf); if (classLoaderContext == null) { classLoaderContext = conf.get(Property.TABLE_CLASSPATH); } return loadIterators(source, iters, allOptions, env, useAccumuloClassLoader, classLoaderContext); }

Target:
private static <K extends WritableComparable<?>,V extends Writable> SortedKeyValueIterator<K,V> loadIteratorsHelper(IteratorScope scope, SortedKeyValueIterator<K,V> source, KeyExtent extent, AccumuloConfiguration conf, List<IterInfo> ssiList, Map<String,Map<String,String>> ssio, IteratorEnvironment env, boolean useAccumuloClassLoader, String classLoaderContext) throws IOException { List<IterInfo> iters = new ArrayList<>(ssiList); Map<String,Map<String,String>> allOptions = new HashMap<>(); parseIteratorConfiguration(scope, iters, ssio, allOptions, conf); return loadIterators(source, iters, allOptions, env, useAccumuloClassLoader, classLoaderContext); }
Source:
public byte[] getCacheKey() { final String tzId = tz == null ? "" : tz.getID(); final String localeTag = locale == null ? "" : locale.toLanguageTag(); final byte[] exprBytes = StringUtils.toUtf8(format + "\u0001" + tzId + "\u0001" + localeTag); final byte[] granularityCacheKey = granularity.getCacheKey(); return ByteBuffer.allocate(4 + exprBytes.length + granularityCacheKey.length) .put(ExtractionCacheHelper.CACHE_TYPE_ID_TIME_FORMAT) .put(exprBytes) .put((byte) 0xFF) .put(granularityCacheKey) .put((byte) 0xFF) .put(asMillis ? (byte) 1 : (byte) 0) .array(); }

Target:
public byte[] getCacheKey() { final String tzId = (tz == null ? DateTimeZone.UTC : tz).getID(); final String localeTag = (locale == null ? Locale.getDefault() : locale).toLanguageTag(); final byte[] exprBytes = StringUtils.toUtf8(format + "\u0001" + tzId + "\u0001" + localeTag); final byte[] granularityCacheKey = granularity.getCacheKey(); return ByteBuffer.allocate(4 + exprBytes.length + granularityCacheKey.length) .put(ExtractionCacheHelper.CACHE_TYPE_ID_TIME_FORMAT) .put(exprBytes) .put((byte) 0xFF) .put(granularityCacheKey) .put((byte) 0xFF) .put(asMillis ? (byte) 1 : (byte) 0) .array(); }
Source:
public void testSchemaRetrieval() throws IOException { InputStream stream = getClass().getClassLoader().getResourceAsStream("data/avro-schema-example.json"); Schema schema = new Schema.Parser().parse(stream); long fingerprint = SchemaNormalization.parsingFingerprint64(schema); Schema retrieved = service.findByFingerprint(fingerprint); assertEquals(schema, retrieved); }

Target:
public void testSchemaRetrieval() throws IOException { try (InputStream stream = getClass().getClassLoader().getResourceAsStream("data/avro-schema-example.json")) { Schema schema = new Schema.Parser().parse(stream); long fingerprint = SchemaNormalization.parsingFingerprint64(schema); Schema retrieved = service.findByFingerprint(fingerprint); assertEquals(schema, retrieved); } }
Source:
public void testWatchForCommitWithSmallerTimeoutValue() throws Exception { OzoneConfiguration conf = new OzoneConfiguration(); conf.setTimeDuration(OzoneConfigKeys.OZONE_CLIENT_WATCH_REQUEST_TIMEOUT, 3, TimeUnit.SECONDS); conf.setInt(OzoneConfigKeys.DFS_RATIS_CLIENT_REQUEST_MAX_RETRIES_KEY, 10); startCluster(conf); XceiverClientManager clientManager = new XceiverClientManager(conf); ContainerWithPipeline container1 = storageContainerLocationClient .allocateContainer(HddsProtos.ReplicationType.RATIS, HddsProtos.ReplicationFactor.THREE, containerOwner); XceiverClientSpi xceiverClient = clientManager .acquireClient(container1.getPipeline()); Assert.assertEquals(1, xceiverClient.getRefcount()); Assert.assertEquals(container1.getPipeline(), xceiverClient.getPipeline()); Pipeline pipeline = xceiverClient.getPipeline(); XceiverClientReply reply = xceiverClient.sendCommandAsync( ContainerTestHelper.getCreateContainerRequest( container1.getContainerInfo().getContainerID(), xceiverClient.getPipeline())); reply.getResponse().get(); long index = reply.getLogIndex(); cluster.shutdownHddsDatanode(pipeline.getNodes().get(0)); cluster.shutdownHddsDatanode(pipeline.getNodes().get(1)); try { xceiverClient .watchForCommit(index + new Random().nextInt(100) + 10, 3000); Assert.fail("expected exception not thrown"); } catch (Exception e) { System.out.println("exception " + e); Assert.assertTrue( HddsClientUtils.checkForException(e) instanceof TimeoutException); } clientManager.releaseClient(xceiverClient, false); shutdown(); }

Target:
public void testWatchForCommitWithSmallerTimeoutValue() throws Exception { OzoneConfiguration conf = new OzoneConfiguration(); conf.setTimeDuration(OzoneConfigKeys.OZONE_CLIENT_WATCH_REQUEST_TIMEOUT, 3, TimeUnit.SECONDS); conf.setInt(OzoneConfigKeys.DFS_RATIS_CLIENT_REQUEST_MAX_RETRIES_KEY, 20); startCluster(conf); XceiverClientManager clientManager = new XceiverClientManager(conf); ContainerWithPipeline container1 = storageContainerLocationClient .allocateContainer(HddsProtos.ReplicationType.RATIS, HddsProtos.ReplicationFactor.THREE, containerOwner); XceiverClientSpi xceiverClient = clientManager .acquireClient(container1.getPipeline()); Assert.assertEquals(1, xceiverClient.getRefcount()); Assert.assertEquals(container1.getPipeline(), xceiverClient.getPipeline()); Pipeline pipeline = xceiverClient.getPipeline(); XceiverClientReply reply = xceiverClient.sendCommandAsync( ContainerTestHelper.getCreateContainerRequest( container1.getContainerInfo().getContainerID(), xceiverClient.getPipeline())); reply.getResponse().get(); long index = reply.getLogIndex(); cluster.shutdownHddsDatanode(pipeline.getNodes().get(0)); cluster.shutdownHddsDatanode(pipeline.getNodes().get(1)); try { xceiverClient .watchForCommit(index + new Random().nextInt(100) + 10, 3000); Assert.fail("expected exception not thrown"); } catch (Exception e) { Assert.assertTrue( HddsClientUtils.checkForException(e) instanceof TimeoutException); } clientManager.releaseClient(xceiverClient, false); shutdown(); }
Source:
public void setUp() { fetcher = new CollectionOfComputerScienceBibliographiesFetcher(); bibEntry1 = new BibEntry(); bibEntry1.setField(StandardField.TITLE, "The relationship of code churn and architectural violations in the open source software JabRef"); bibEntry1.setField(StandardField.AUTHOR, "Tobias Olsson, Morgan Ericsson, Anna Wingkvist"); bibEntry1.setField(StandardField.DATE, "2017"); bibEntry1.setField(StandardField.URL, "<LINK_1>"); bibEntry2 = new BibEntry(); bibEntry2.setField(StandardField.TITLE, "Literaturverwaltungsprogramme im Überblick"); bibEntry2.setField(StandardField.AUTHOR, "Michaele Adam, Jutta Musiat, Kathleen Hoffmann, Sandra Rahm, Matti Stöhr, Christina Wenzel"); bibEntry2.setField(StandardField.DATE, "2018"); bibEntry2.setField(StandardField.URL, "<LINK_0>"); }

Target:
public void setUp() { ImportFormatPreferences importFormatPreferences = mock(ImportFormatPreferences.class, Answers.RETURNS_DEEP_STUBS); when(importFormatPreferences.getKeywordSeparator()).thenReturn(','); fetcher = new CollectionOfComputerScienceBibliographiesFetcher(importFormatPreferences); }
Source:
private void registerReceivers() { this.registrar = new BroadcastRegistrar(); this.registrar .addAction(MessagingService.ACTION_TRANSFER_SONG_MESSAGE, new IBroadcastActionHandler() { @Override public void onReceiveAction(Context context, Intent intent) { String fromAddr = intent.getStringExtra(MessagingService.EXTRA_ADDRESS); long songId = intent.getLongExtra( MessagingService.EXTRA_SONG_ID, -1 ); String fileName = intent.getStringExtra(MessagingService.EXTRA_SONG_FILE_NAME); byte[] fileData = intent.getByteArrayExtra(MessagingService.EXTRA_SONG_DATA); saveTempFileData(fromAddr, songId, fileName, fileData); new BroadcastIntent(PlaylistService.ACTION_PLAYLIST_UPDATED).send(playlistService); } }) .register(this.playlistService); }

Target:
private void registerReceivers() { this.registrar = new BroadcastRegistrar(); this.registrar .addAction(MessagingService.ACTION_TRANSFER_SONG_MESSAGE, new IBroadcastActionHandler() { @Override public void onReceiveAction(Context context, Intent intent) { String fromAddr = intent.getStringExtra(MessagingService.EXTRA_ADDRESS); long songId = intent.getLongExtra( MessagingService.EXTRA_SONG_ID, SongMetadata.UNKNOWN_SONG); String fileName = intent.getStringExtra(MessagingService.EXTRA_SONG_FILE_NAME); byte[] fileData = intent.getByteArrayExtra(MessagingService.EXTRA_SONG_DATA); if (songId == SongMetadata.UNKNOWN_SONG) { Log.wtf(TAG, "TRANSFER_SONG_MESSAGE action received without a valid song id"); } else { saveTempFileData(fromAddr, songId, fileName, fileData); new BroadcastIntent(PlaylistService.ACTION_PLAYLIST_UPDATED).send(playlistService); } } }) .register(this.playlistService); }
Source:
public void setUp() throws Exception { super.setUp(); configurationService.setProperty("citation-page.enable_globally", false); context.turnOffAuthorisationSystem(); bitstream = bitstreamService.create(context, new StringInputStream("test")); unknownFormat = bitstreamFormatService.create(context); unknownFormat.setMIMEType("unknown test mime type"); unknownFormat.setDescription("unknown test description"); unknownFormat.setShortDescription(context, "unknown test short description"); unknownFormat.setSupportLevel(UNKNOWN); knownFormat = bitstreamFormatService.create(context); knownFormat.setMIMEType("known test mime type"); knownFormat.setDescription("known test description"); knownFormat.setShortDescription(context, "known test short description"); knownFormat.setSupportLevel(KNOWN); supportedFormat = bitstreamFormatService.create(context); supportedFormat.setMIMEType("supported mime type"); supportedFormat.setDescription("supported description"); supportedFormat.setShortDescription(context, "supported short description"); supportedFormat.setSupportLevel(SUPPORTED); bitstream.setFormat(context, supportedFormat); context.commit(); }

Target:
public void setUp() throws Exception { super.setUp(); configurationService.setProperty("citation-page.enable_globally", false); context.turnOffAuthorisationSystem(); Community community = createCommunity(context).build(); Collection collection = createCollection(context, community).build(); Item item = createItem(context, collection).build(); bitstream = createBitstream(context, item, toInputStream("test", UTF_8)) .withFormat("test format") .build(); unknownFormat = bitstreamFormatService.findUnknown(context); knownFormat = createBitstreamFormat(context) .withMimeType("known test mime type") .withDescription("known test description") .withShortDescription("known test short description") .withSupportLevel(KNOWN) .build(); supportedFormat = createBitstreamFormat(context) .withMimeType("supported mime type") .withDescription("supported description") .withShortDescription("supported short description") .withSupportLevel(SUPPORTED) .build(); bitstream.setFormat(context, supportedFormat); context.restoreAuthSystemState(); }
Source:
private void cleanup(CacheAccessException from) { try { cache.obliterate(); } catch (CacheAccessException e) { inconsistent(from, e); } recovered(from); }

Target:
private void cleanup(CacheAccessException from) { try { cache.obliterate(); } catch (CacheAccessException e) { inconsistent(from, e); return; } recovered(from); }
Source:
public void testDrivingConnectedStateStoreInDifferentProcessorsTopology() { final String storeName = "connectedStore"; final StoreBuilder<KeyValueStore<String, String>> storeBuilder = Stores.keyValueStoreBuilder(Stores.inMemoryKeyValueStore(storeName), Serdes.String(), Serdes.String()); topology .addSource("source1", STRING_DESERIALIZER, STRING_DESERIALIZER, INPUT_TOPIC_1) .addSource("source2", STRING_DESERIALIZER, STRING_DESERIALIZER, INPUT_TOPIC_2) .addProcessor("processor1", defineWithStores(new StatefulProcessor(storeName), Collections.singleton(storeBuilder)), "source1") .addProcessor("processor2", defineWithStores(new StatefulProcessor(storeName), Collections.singleton(storeBuilder)), "source2") .addSink("counts", OUTPUT_TOPIC_1, "processor1", "processor2"); driver = new TopologyTestDriver(topology, props); driver.pipeInput(recordFactory.create(INPUT_TOPIC_1, "key1", "value1")); driver.pipeInput(recordFactory.create(INPUT_TOPIC_1, "key2", "value2")); driver.pipeInput(recordFactory.create(INPUT_TOPIC_2, "key3", "value3")); driver.pipeInput(recordFactory.create(INPUT_TOPIC_2, "key1", "value4")); assertNoOutputRecord(OUTPUT_TOPIC_1); assertNoOutputRecord(OUTPUT_TOPIC_1); final KeyValueStore<String, String> store = driver.getKeyValueStore("connectedStore"); assertEquals("value4", store.get("key1")); assertEquals("value2", store.get("key2")); assertEquals("value3", store.get("key3")); assertNull(store.get("key4")); }

Target:
public void testDrivingConnectedStateStoreInDifferentProcessorsTopology() { final String storeName = "connectedStore"; final StoreBuilder<KeyValueStore<String, String>> storeBuilder = Stores.keyValueStoreBuilder(Stores.inMemoryKeyValueStore(storeName), Serdes.String(), Serdes.String()); topology .addSource("source1", STRING_DESERIALIZER, STRING_DESERIALIZER, INPUT_TOPIC_1) .addSource("source2", STRING_DESERIALIZER, STRING_DESERIALIZER, INPUT_TOPIC_2) .addProcessor("processor1", defineWithStores(() -> new StatefulProcessor(storeName), Collections.singleton(storeBuilder)), "source1") .addProcessor("processor2", defineWithStores(() -> new StatefulProcessor(storeName), Collections.singleton(storeBuilder)), "source2") .addSink("counts", OUTPUT_TOPIC_1, "processor1", "processor2"); driver = new TopologyTestDriver(topology, props); final TestInputTopic<String, String> inputTopic = driver.createInputTopic(INPUT_TOPIC_1, STRING_SERIALIZER, STRING_SERIALIZER); final TestOutputTopic<Integer, String> outputTopic1 = driver.createOutputTopic(OUTPUT_TOPIC_1, Serdes.Integer().deserializer(), Serdes.String().deserializer()); inputTopic.pipeInput("key1", "value1"); inputTopic.pipeInput("key2", "value2"); inputTopic.pipeInput("key3", "value3"); inputTopic.pipeInput("key1", "value4"); assertTrue(outputTopic1.isEmpty()); final KeyValueStore<String, String> store = driver.getKeyValueStore("connectedStore"); assertEquals("value4", store.get("key1")); assertEquals("value2", store.get("key2")); assertEquals("value3", store.get("key3")); assertNull(store.get("key4")); }
Source:
public CompletableFuture<LogReplicationQueryMetadataResponse> sendQueryMetadataRequest() { return null; }

Target:
public CompletableFuture<LogReplicationQueryMetadataResponse> sendQueryMetadataRequest() { return new CompletableFuture<>(); }
Source:
public void testSaveGroup() { Group userGroup = builder.withGroup("testGroup1", "GROUP").buildGroup(); Group savedUSerGroup = groupRepository.saveAndFlush(userGroup); assertThat(savedUSerGroup.getId()).isNotNull(); assertThat(savedUSerGroup.getName()).isEqualTo(userGroup.getName()); assertThat(savedUSerGroup.getType()).isEqualTo(userGroup.getType()); }

Target:
public void testSaveGroup() { Group userGroup = builder.withGroup("testGroup1", "GROUP").buildGroup(); Group savedUserGroup = groupRepository.saveAndFlush(userGroup); assertThat(savedUserGroup.getId()).isNotNull(); assertThat(savedUserGroup.getName()).isEqualTo(userGroup.getName()); assertThat(savedUserGroup.getType()).isEqualTo(userGroup.getType()); }
Source:
public void changePassword() throws Exception { String username = "test" + (random.nextInt() % 10000); String password = "password"; UserContext userContext = ensureSignedUp(username, password, network, crypto); String newPassword = "newPassword"; userContext.changePassword(password, newPassword, UserGenerationAlgorithm.getDefault(), UserGenerationAlgorithm.getDefault()).get(); ensureSignedUp(username, newPassword, network, crypto); }

Target:
public void changePassword() throws Exception { String username = generateUsername(); String password = "password"; UserContext userContext = ensureSignedUp(username, password, network, crypto); String newPassword = "newPassword"; userContext.changePassword(password, newPassword, UserGenerationAlgorithm.getDefault(), UserGenerationAlgorithm.getDefault()).get(); ensureSignedUp(username, newPassword, network, crypto); }
Source:
public static void main(String[] args) throws Exception { double[] yData = new double[] {2.0, 1.0, 0.0}; XYChart chart = new XYChart(500, 400); chart.setTitle("Sample Chart"); chart.setXAxisTitle("X"); chart.setXAxisTitle("Y"); XYSeries series = chart.addSeries("y(x)", null, yData); series.setMarker(SeriesMarkers.CIRCLE); BitmapEncoder.saveBitmap(chart, "./Sample_Chart", BitmapFormat.PNG); BitmapEncoder.saveBitmap(chart, "./Sample_Chart", BitmapFormat.JPG); BitmapEncoder.saveJPGWithQuality(chart, "./Sample_Chart_With_Quality.jpg", 0.95f); BitmapEncoder.saveBitmap(chart, "./Sample_Chart", BitmapFormat.BMP); BitmapEncoder.saveBitmap(chart, "./Sample_Chart", BitmapFormat.GIF); BitmapEncoder.saveBitmapWithDPI(chart, "./Sample_Chart_300_DPI", BitmapFormat.PNG, 300); BitmapEncoder.saveBitmapWithDPI(chart, "./Sample_Chart_300_DPI", BitmapFormat.JPG, 300); BitmapEncoder.saveBitmapWithDPI(chart, "./Sample_Chart_300_DPI", BitmapFormat.GIF, 300); VectorGraphicsEncoder.saveVectorGraphic(chart, "./Sample_Chart", VectorGraphicsFormat.EPS); VectorGraphicsEncoder.saveVectorGraphic(chart, "./Sample_Chart", VectorGraphicsFormat.SVG); PdfboxGraphicsEncoder.savePdfboxGraphics(chart, "./Sample_Chart"); }

Target:
public static void main(String[] args) throws Exception { double[] yData = new double[] {2.0, 1.0, 0.0}; XYChart chart = new XYChart(500, 400); chart.setTitle("Sample Chart"); chart.setXAxisTitle("X"); chart.setXAxisTitle("Y"); XYSeries series = chart.addSeries("y(x)", null, yData); series.setMarker(SeriesMarkers.CIRCLE); BitmapEncoder.saveBitmap(chart, "./Sample_Chart", BitmapFormat.PNG); BitmapEncoder.saveBitmap(chart, "./Sample_Chart", BitmapFormat.JPG); BitmapEncoder.saveJPGWithQuality(chart, "./Sample_Chart_With_Quality.jpg", 0.95f); BitmapEncoder.saveBitmap(chart, "./Sample_Chart", BitmapFormat.BMP); BitmapEncoder.saveBitmap(chart, "./Sample_Chart", BitmapFormat.GIF); BitmapEncoder.saveBitmapWithDPI(chart, "./Sample_Chart_300_DPI", BitmapFormat.PNG, 300); BitmapEncoder.saveBitmapWithDPI(chart, "./Sample_Chart_300_DPI", BitmapFormat.JPG, 300); BitmapEncoder.saveBitmapWithDPI(chart, "./Sample_Chart_300_DPI", BitmapFormat.GIF, 300); VectorGraphicsEncoder.saveVectorGraphic(chart, "./Sample_Chart", VectorGraphicsFormat.EPS); VectorGraphicsEncoder.saveVectorGraphic(chart, "./Sample_Chart", VectorGraphicsFormat.PDF); VectorGraphicsEncoder.saveVectorGraphic(chart, "./Sample_Chart", VectorGraphicsFormat.SVG); }
Source:
private String getAddress() { String address; if (this.serverProperties != null && this.serverProperties.getAddress() != null) { address = this.serverProperties.getAddress().getHostAddress(); } else { address = this.localAdressResolver.getLocalIp4AddressAsString(); } return address; }

Target:
private String getAddress() { String address; if (this.serverProperties != null && this.serverProperties.getAddress() != null) { address = this.serverProperties.getAddress().getHostAddress(); } else { address = this.inetUtils.findFirstNonLoopbackAddress().getHostAddress(); } return address; }
Source:
public static MetadataExpirationStrategyType ofStrategy(String strategy) { return Stream.of(values()) .filter(e -> e.strategy.equalsIgnoreCase(strategy)) .findFirst() .orElse(null); }

Target:
public static MetadataExpirationStrategyType ofStrategy(String strategy) { return Stream.of(values()) .filter(e -> e.strategy.equals(strategy)) .findFirst() .orElse(null); }
Source:
CompletableFuture<Void> getFailureOp(CommitData cd) { return CompletableFuture.supplyAsync(() -> { getStats().setRejected(cd.getRejected()); try { checkForOrphanedLocks(cd); } catch (Exception e) { throw new CompletionException(e); } return null; }, env.getSharedResources().getSyncCommitExecutor()).thenCompose(v -> { try { return rollbackLocks(cd); } catch (Exception e) { throw new CompletionException(e); } }); }

Target:
CompletableFuture<Void> getFailureOp(CommitData cd) { return CompletableFuture.supplyAsync(() -> { getStats().setRejected(cd.getRejected()); try { checkForOrphanedLocks(cd); } catch (Exception e) { throw new CompletionException(e); } return null; }, env.getSharedResources().getSyncCommitExecutor()).thenCompose(v -> rollbackLocks(cd)); }
Source:
protected void onMention(ChatMessage chatMessage) { if (preferencesService.getPreferences().getNotification().getNotifyOnAtMentionOnlyEnabled() && !chatMessage.getMessage().contains("@" + this.userService.getUsername())) { return; } if (!hasFocus()) { audioService.playChatMentionSound(); showNotificationIfNecessary(chatMessage); incrementUnreadMessagesCount(1); setUnread(true); } }

Target:
protected void onMention(ChatMessage chatMessage) { if (preferencesService.getPreferences().getNotification().getNotifyOnAtMentionOnlyEnabled() && !chatMessage.getMessage().contains("@" + userService.getUsername())) { return; } if (!hasFocus()) { audioService.playChatMentionSound(); showNotificationIfNecessary(chatMessage); incrementUnreadMessagesCount(1); setUnread(true); } }
Source:
public static void main(String[] args) { boolean usingRI = false; try { Class.forName("dalvik.system.PathClassLoader"); } catch (ClassNotFoundException e) { usingRI = true; } try { invokeUserTest("Test1Derived"); invokeUserTest("Test1User"); invokeUserTest("Test1User2"); invokeUserTest("Test2User"); invokeUserTest("Test2User2"); invokeUserTest("Test3User"); invokeUserTest("Test4User"); invokeUserTest("Test5User"); invokeUserTest("Test5User2"); invokeUserTest("Test6User"); invokeUserTest("Test6User2"); if (usingRI) { System.out.println("Calling Test7User.test():\nTest7Interface.foo()"); } else { invokeUserTest("Test7User"); } } catch (Throwable t) { t.printStackTrace(System.out); } }

Target:
public static void main(String[] args) { usingRI = false; try { Class.forName("dalvik.system.PathClassLoader"); } catch (ClassNotFoundException e) { usingRI = true; } try { test1(); test2(); test3(); test4(); test5(); test6(); test7(); test8(); test9(); } catch (Throwable t) { t.printStackTrace(System.out); } }
Source:
public void login() { page.login(validAdminPassword, validAdminLogin); }

Target:
public void login() { page.login(validAdminLogin, validAdminPassword); }
Source:
protected void processWatchEvent(WatchEvent<?> event, Kind<?> kind, Path path) { logger.debug("New watch event for path {}.", kind, path); if (kind == OVERFLOW) { return; } final WatchEvent<Path> ev = (WatchEvent<Path>) event; final Path filename = ev.context(); logger.debug("Reloading javascript file {}.", filename.toString()); manager.removeFromCache(filename.toString()); }

Target:
protected void processWatchEvent(WatchEvent<?> event, Kind<?> kind, Path path) { logger.debug("New watch event for path {}.", kind, path); if (kind == OVERFLOW) { return; } final WatchEvent<Path> ev = (WatchEvent<Path>) event; final Path filename = ev.context(); logger.debug("Reloading javascript file {}.", filename); manager.removeFromCache(filename.toString()); }
Source:
protected void doInit() throws Exception { super.doInit(); String placeholder = getEndpoint().isUsePlaceholder() ? getEndpoint().getPlaceholder() : null; resolvedQuery = SqlHelper.resolveQuery(getEndpoint().getCamelContext(), query, placeholder); }

Target:
protected void doInit() throws Exception { super.doInit(); if (ResourceHelper.isClasspathUri(query)) { String placeholder = getEndpoint().isUsePlaceholder() ? getEndpoint().getPlaceholder() : null; resolvedQuery = SqlHelper.resolveQuery(getEndpoint().getCamelContext(), query, placeholder); } }
Source:
public boolean isMotionBlur() { return motionBlur; }

Target:
public boolean isMotionBlur() { return motionBlur && !isVrSupport(); }
Source:
public List<ExternalSubnet> getSubnets() { return subnets; }

Target:
private List<ExternalSubnet> getSubnets() { return subnets; }
Source:
public static String getSingular(Class<? extends CustomResource> clazz) { final Singular fromAnnotation = clazz.getAnnotation(Singular.class); return (fromAnnotation != null ? fromAnnotation.value().toLowerCase(Locale.ROOT) : HasMetadata.getKind(clazz)).toLowerCase(Locale.ROOT); }

Target:
public static String getSingular(Class<? extends CustomResource> clazz) { final Singular fromAnnotation = clazz.getAnnotation(Singular.class); return (fromAnnotation != null ? fromAnnotation.value() : HasMetadata.getKind(clazz)).toLowerCase(Locale.ROOT); }
Source:
private boolean isCurrentDataExpired() { return lastUpdateTime + MAX_DATA_AGE < new Date().getTime(); }

Target:
private boolean isCurrentDataExpired() { return lastUpdateTime + MAX_DATA_AGE < System.currentTimeMillis(); }
Source:
public boolean canPrincipalConfigure( IAuthorizationPrincipal principal, String portletDefinitionId) throws AuthorizationException { String owner = IPermission.PORTAL_PUBLISH; String target = IPermission.PORTLET_PREFIX + portletDefinitionId; IPortletDefinition portlet = this.portletDefinitionRegistry.getPortletDefinition(portletDefinitionId); if (portlet == null) { throw new AuthorizationException("Unable to locate portlet " + portletDefinitionId); } final String activity = IPermission.PORTLET_MODE_CONFIG; boolean isAllowed = doesPrincipalHavePermission(principal, owner, activity, target); if (this.log.isTraceEnabled()) { log.trace( String.format( "In canPrincipalConfigure() - principal.key=[%s], is allowed?=[%s]", principal.getKey(), isAllowed)); } return isAllowed; }

Target:
public boolean canPrincipalConfigure( IAuthorizationPrincipal principal, String portletDefinitionId) throws AuthorizationException { String owner = IPermission.PORTAL_PUBLISH; String target = IPermission.PORTLET_PREFIX + portletDefinitionId; IPortletDefinition portlet = this.portletDefinitionRegistry.getPortletDefinition(portletDefinitionId); if (portlet == null) { throw new AuthorizationException("Unable to locate portlet " + portletDefinitionId); } final String activity = IPermission.PORTLET_MODE_CONFIG; boolean isAllowed = doesPrincipalHavePermission(principal, owner, activity, target); log.trace( "In canPrincipalConfigure() - principal.key=[{}], is allowed?=[{}]", principal.getKey(), isAllowed); return isAllowed; }
Source:
public default Stream<X> stream() { return asList().stream() ; }

Target:
public default Stream<X> stream() { return StreamSupport.stream(spliterator(), false) ; }
Source:
private List<PublicIPAddress> getIPAddresses(Deployment deployment) { List<PublicIPAddress> list = new ArrayList<PublicIPAddress>(); String resourceGroup = getResourceGroupFromId(deployment.id()); if (deployment.properties() != null && deployment.properties().dependencies() != null) { List<Deployment.Dependency> dependencies = deployment.properties().dependencies(); for (int d = 0; d < dependencies.size(); d++) { if (dependencies.get(d).resourceType().equals("Microsoft.Network/networkInterfaces")) { List<Deployment.Dependency> dependsOn = dependencies.get(d).dependsOn(); for (int e = 0; e < dependsOn.size(); e++) { if (dependsOn.get(e).resourceType().equals("Microsoft.Network/publicIPAddresses")) { String resourceName = dependsOn.get(e).resourceName(); PublicIPAddress ip = api.getPublicIPAddressApi(resourceGroup).get(resourceName); list.add(ip); } } } } } return list; }

Target:
private List<PublicIPAddress> getIPAddresses(Deployment deployment) { List<PublicIPAddress> list = new ArrayList<PublicIPAddress>(); String resourceGroup = getResourceGroupFromId(deployment.id()); if (deployment.properties() != null && deployment.properties().dependencies() != null) { List<Deployment.Dependency> dependencies = deployment.properties().dependencies(); for (int d = 0; d < dependencies.size(); d++) { if (dependencies.get(d).resourceType().equals("Microsoft.Network/networkInterfaces")) { List<Deployment.Dependency> dependsOn = dependencies.get(d).dependsOn(); for (int e = 0; e < dependsOn.size(); e++) { if (dependsOn.get(e).resourceType().equals("Microsoft.Network/publicIPAddresses")) { String resourceName = dependsOn.get(e).resourceName(); PublicIPAddress ip = api.getPublicIPAddressApi(resourceGroup).get(resourceName); list.add(ip); break; } } } } } return list; }
Source:
public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); emptyView = new EmptyViewHandler(getContext()); emptyView.setIcon(R.attr.ic_folder); emptyView.setTitle(R.string.no_subscriptions_head_label); emptyView.setMessage(R.string.no_subscriptions_label); emptyView.attachToListView(subscriptionGridLayout); subscriptionAdapter = new SubscriptionsAdapter((MainActivity) getActivity(), itemAccess); subscriptionGridLayout.setAdapter(subscriptionAdapter); subscriptionGridLayout.setOnItemClickListener(subscriptionAdapter); subscriptionAddButton.setOnClickListener(view -> { if (getActivity() instanceof MainActivity) { ((MainActivity) getActivity()).loadChildFragment(new AddFeedFragment()); } }); if (getActivity() instanceof MainActivity) { ((MainActivity) getActivity()).getSupportActionBar().setTitle(R.string.subscriptions_label); } }

Target:
public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); subscriptionAdapter = new SubscriptionsAdapter((MainActivity) getActivity(), itemAccess); subscriptionGridLayout.setAdapter(subscriptionAdapter); subscriptionGridLayout.setOnItemClickListener(subscriptionAdapter); subscriptionAddButton.setOnClickListener(view -> { if (getActivity() instanceof MainActivity) { ((MainActivity) getActivity()).loadChildFragment(new AddFeedFragment()); } }); if (getActivity() instanceof MainActivity) { ((MainActivity) getActivity()).getSupportActionBar().setTitle(R.string.subscriptions_label); } }
Source:
public String addCssClass(String cssClasses, String cssClass) { if (StringUtility.hasText(cssClasses) && StringUtility.hasText(cssClass) && !cssClasses.matches("(.* |^)" + Pattern.quote(cssClass) + "( .*|$)")) { return cssClasses + " " + cssClass; } else if (!StringUtility.hasText(cssClasses) && StringUtility.hasText(cssClass)) { return cssClass; } else { return cssClasses; } }

Target:
public String addCssClass(String cssClasses, String cssClass) { boolean hasCssClasses = StringUtility.hasText(cssClasses); boolean hasCssClass = StringUtility.hasText(cssClass); if (hasCssClasses && hasCssClass && !cssClasses.matches("(.* |^)" + Pattern.quote(cssClass) + "( .*|$)")) { return cssClasses + " " + cssClass; } if (!hasCssClasses && hasCssClass) { return cssClass; } return cssClasses; }
Source:
public void blobUrlWithLines() { String blobUrl = GitHubUrlUtils.getBlobUrl( HTTPS_URL, "mysql", "src/test/java/org/springframework" + "/samples/petclinic/service/ClinicServiceJdbcTests.java", 10, 20); System.out.println(blobUrl); }

Target:
public void blobUrlWithLines() { String blobUrl = GitHubUrlUtils.getBlobUrl( HTTPS_URL, "mysql", "src/test/java/org/springframework" + "/samples/petclinic/service/ClinicServiceJdbcTests.java", 10, 20); assertEquals(blobUrl, BLOB_URL + "#L10-L20"); }
Source:
protected void checkSignedAssertion(AssertionWrapper assertion, RequestData data) throws WSSecurityException { SAMLKeyInfo samlKeyInfo = assertion.getSignatureKeyInfo(); X509Certificate[] certs = samlKeyInfo.getCerts(); PublicKey publicKey = samlKeyInfo.getPublicKey(); try { super.verifySignedAssertion(assertion, data); } catch (WSSecurityException e) { if (certs == null && publicKey != null) { LOG.warn("Could not establish trust of the signature's public key because no matching public key " + "exists in the truststore. Please see GATEWAY-3146 for more details."); } else { if (isValidateChainOfTrust() && e.getCause() instanceof CertPathValidatorException){ CertificateChainValidator chainValidator = CertificateChainValidator.getInstance(); List<X509Certificate> certList = Arrays.asList(certs); LOG.debug("Detect number of certs in saml {}", certList.size()); for (X509Certificate cert: certList){ String serialNumber = cert.getSerialNumber().toString(16); if (chainValidator.validateCert(cert)){ LOG.info("A certs serial number in saml already in the truststore {}",serialNumber); }else{ LOG.error("Unable to find cert serial number in the truststore {}",serialNumber); throw e; } } }else{ throw e; } } } }

Target:
protected void checkSignedAssertion(AssertionWrapper assertion, RequestData data) throws WSSecurityException { SAMLKeyInfo samlKeyInfo = assertion.getSignatureKeyInfo(); X509Certificate[] certs = samlKeyInfo.getCerts(); PublicKey publicKey = samlKeyInfo.getPublicKey(); try { super.verifySignedAssertion(assertion, data); } catch (WSSecurityException e) { if (certs == null && publicKey != null) { LOG.warn("Could not establish trust of the signature's public key because no matching public key " + "exists in the truststore. Please see GATEWAY-3146 for more details."); } else { if (isValidateChainOfTrust() && e.getCause() instanceof CertPathValidatorException){ CertificateChainValidator chainValidator = CertificateChainValidator.getInstance(); List<X509Certificate> certList = Arrays.asList(certs); LOG.debug("Detect number of certs in saml " + certList.size()); for (X509Certificate cert: certList){ String serialNumber = chainValidator.getCertSerialNumber(cert); if (chainValidator.validateCert(cert)){ LOG.info("A certs serial number in saml already in the truststore " + serialNumber); }else{ LOG.error("Unable to find cert serial number in the truststore " + serialNumber); throw e; } } } else { throw e; } } } }
Source:
public Object visit(ASTCompilationUnit node, Object data) { literals.clear(); if (getProperty(EXCEPTION_LIST_DESCRIPTOR) != null) { ExceptionParser p = new ExceptionParser(getProperty(SEPARATOR_DESCRIPTOR)); exceptions = p.parse(getProperty(EXCEPTION_LIST_DESCRIPTOR)); } else if (getProperty(EXCEPTION_FILE_DESCRIPTOR) != null) { exceptions = new HashSet<>(); try (LineNumberReader reader = getLineReader()) { String line; while ((line = reader.readLine()) != null) { exceptions.add(line); } } catch (IOException ioe) { ioe.printStackTrace(); } } minLength = 2 + getProperty(MINIMUM_LENGTH_DESCRIPTOR); super.visit(node, data); processResults(data); return data; }

Target:
public Object visit(ASTCompilationUnit node, Object data) { literals.clear(); if (getProperty(EXCEPTION_LIST_DESCRIPTOR) != null) { ExceptionParser p = new ExceptionParser(getProperty(SEPARATOR_DESCRIPTOR)); exceptions = p.parse(getProperty(EXCEPTION_LIST_DESCRIPTOR)); } else if (getProperty(EXCEPTION_FILE_DESCRIPTOR) != null) { exceptions = new HashSet<>(); try (LineNumberReader reader = getLineReader()) { String line; while ((line = reader.readLine()) != null) { exceptions.add(line); } } catch (IOException ioe) { throw new RuntimeException(ioe); } } minLength = 2 + getProperty(MINIMUM_LENGTH_DESCRIPTOR); super.visit(node, data); processResults(data); return data; }
Source:
public void init(IWorkbench workbench, IStructuredSelection currentSelection) { this.selection = currentSelection; List<?> selectedResources = IDE.computeSelectedResources(currentSelection); if (!selectedResources.isEmpty()) { this.selection = new StructuredSelection(selectedResources); } if (selection.isEmpty() && workbench.getActiveWorkbenchWindow() != null) { IWorkbenchPage page = workbench.getActiveWorkbenchWindow() .getActivePage(); if (page != null) { IEditorPart currentEditor = page.getActiveEditor(); if (currentEditor != null) { Object selectedResource = Adapters.getAdapter(currentEditor, IResource.class, true); if (selectedResource != null) { selection = new StructuredSelection(selectedResource); } } } } setWindowTitle(DataTransferMessages.DataTransfer_export); setDefaultPageImageDescriptor(IDEWorkbenchPlugin.getIDEImageDescriptor("wizban/exportdir_wiz.png")); setNeedsProgressMonitor(true); }

Target:
public void init(IWorkbench workbench, IStructuredSelection currentSelection) { this.selection = currentSelection; List<?> selectedResources = IDE.computeSelectedResources(currentSelection); if (!selectedResources.isEmpty()) { this.selection = new StructuredSelection(selectedResources); } if (selection.isEmpty() && workbench.getActiveWorkbenchWindow() != null) { IWorkbenchPage page = workbench.getActiveWorkbenchWindow() .getActivePage(); if (page != null) { IEditorPart currentEditor = page.getActiveEditor(); if (currentEditor != null) { Object selectedResource = Adapters.getAdapter(currentEditor.getEditorInput(), IResource.class, true); if (selectedResource != null) { selection = new StructuredSelection(selectedResource); } } } } setWindowTitle(DataTransferMessages.DataTransfer_export); setDefaultPageImageDescriptor(IDEWorkbenchPlugin.getIDEImageDescriptor("wizban/exportdir_wiz.png")); setNeedsProgressMonitor(true); }
Source:
public void add(T pair) { if (!pairs.contains(pair)) { pairs.add(pair); } if (!cleared) { cleared = false; } }

Target:
public void add(T pair) { if (!pairs.contains(pair)) { pairs.add(pair); } if (cleared) { cleared = false; } }
Source:
public String toString() { return "TcpStat {sent=" + sent + " received=" + received + " lost=" + lost + " retransmit=" + retransmit + "}"; }

Target:
public String toString() { return "TcpStat {sent=" + nSent + ", received=" + nReceived + ", lost=" + nLost + ", retransmit=" + nRetransmit + "}"; }
Source:
public void clickFanomArticleCard() { fandomArticleCard.click(); }

Target:
public FandomPageObject clickFanomArticleCard() { wait.forElementClickable(fandomArticleCard); fandomArticleCard.click(); return new FandomPageObject(); }
Source:
public void mergeTrackable(final Trackable newTrackable) { guid = newTrackable.guid.equals("") ? guid : newTrackable.guid; geocode = newTrackable.geocode.equals("") ? geocode : newTrackable.geocode; iconUrl = newTrackable.iconUrl.equals("") ? iconUrl : newTrackable.iconUrl; name = newTrackable.name.equals("") ? name : newTrackable.name; type = newTrackable.type == null ? type : newTrackable.type; released = newTrackable.released == null ? released : newTrackable.released; distance = newTrackable.distance == -1 ? distance : newTrackable.distance; origin = newTrackable.origin == null ? origin : newTrackable.origin; owner = newTrackable.owner == null ? owner : newTrackable.owner; ownerGuid = newTrackable.ownerGuid == null ? ownerGuid : newTrackable.ownerGuid; spottedName = newTrackable.spottedName == null ? spottedName : newTrackable.spottedName; spottedType = newTrackable.spottedType == SPOTTED_UNSET ? spottedType : newTrackable.spottedType; spottedGuid = newTrackable.spottedGuid == null ? spottedGuid : newTrackable.spottedGuid; goal = newTrackable.goal == null ? goal : newTrackable.goal; details = newTrackable.details == null ? details : newTrackable.details; image = newTrackable.image == null ? image : newTrackable.image; logs = newTrackable.logs == null ? logs : newTrackable.logs; trackingcode = newTrackable.trackingcode == null ? trackingcode : newTrackable.trackingcode; brand = newTrackable.brand == null ? brand : newTrackable.brand; trackableConnector = newTrackable.trackableConnector == null ? trackableConnector : newTrackable.trackableConnector; }

Target:
public void mergeTrackable(final Trackable newTrackable) { guid = StringUtils.defaultIfEmpty(newTrackable.guid, guid); geocode = StringUtils.defaultIfEmpty(newTrackable.geocode, geocode); iconUrl = StringUtils.defaultIfEmpty(newTrackable.iconUrl, iconUrl); name = StringUtils.defaultIfEmpty(newTrackable.name, name); type = ObjectUtils.defaultIfNull(newTrackable.type, type); released = ObjectUtils.defaultIfNull(newTrackable.released, released); distance = newTrackable.distance == -1 ? distance : newTrackable.distance; origin = ObjectUtils.defaultIfNull(newTrackable.origin, origin); owner = ObjectUtils.defaultIfNull(newTrackable.owner, owner); ownerGuid = ObjectUtils.defaultIfNull(newTrackable.ownerGuid, ownerGuid); spottedName = ObjectUtils.defaultIfNull(newTrackable.spottedName, spottedName); spottedType = newTrackable.spottedType == SPOTTED_UNSET ? spottedType : newTrackable.spottedType; spottedGuid = ObjectUtils.defaultIfNull(newTrackable.spottedGuid, spottedGuid); goal = ObjectUtils.defaultIfNull(newTrackable.goal, goal); details = ObjectUtils.defaultIfNull(newTrackable.details, details); image = ObjectUtils.defaultIfNull(newTrackable.image, image); mergeLogEntry(newTrackable.logs); trackingcode = ObjectUtils.defaultIfNull(newTrackable.trackingcode, trackingcode); brand = ObjectUtils.defaultIfNull(newTrackable.brand, brand); trackableConnector = ObjectUtils.defaultIfNull(newTrackable.trackableConnector, trackableConnector); }
Source:
private void onLeadershipAcquire() { switch (localClusterDescriptor.getRole()) { case ACTIVE: log.info("Start as Source (sender/replicator)"); if (replicationManager == null) { replicationManager = new CorfuReplicationManager(replicationContext, localNodeDescriptor, logReplicationMetadataManager, serverContext.getPluginConfigFilePath(), getCorfuRuntime()); } replicationManager.setTopology(topologyDescriptor); replicationManager.start(); break; case STANDBY: log.info("Start as Sink (receiver)"); interClusterReplicationService.getLogReplicationServer().setLeadership(true); interClusterReplicationService.getLogReplicationServer().getSinkManager().reset(); break; default: log.error("Log Replication not started on this cluster. Leader node belongs to cluster with role.", localEndpoint, localClusterDescriptor.getRole()); break; } }

Target:
private void onLeadershipAcquire() { switch (localClusterDescriptor.getRole()) { case ACTIVE: log.info("Start as Source (sender/replicator)"); if (replicationManager == null) { replicationManager = new CorfuReplicationManager(replicationContext, localNodeDescriptor, logReplicationMetadataManager, serverContext.getPluginConfigFilePath(), getCorfuRuntime()); } replicationManager.setTopology(topologyDescriptor); replicationManager.start(); break; case STANDBY: log.info("Start as Sink (receiver)"); interClusterReplicationService.getLogReplicationServer().setLeadership(true); break; default: log.error("Log Replication not started on this cluster. Leader node belongs to cluster with role.", localEndpoint, localClusterDescriptor.getRole()); break; } }
Source:
public void testDecrementNonJavaProject() throws CoreException, InvocationTargetException, InterruptedException { IFile file = nonJavaProject.getProject().getFile("foo.txt"); file.create(null, true, null); ResourceStructureBridge bridge = new ResourceStructureBridge(); ResourceInteractionMonitor interactMonitor = new ResourceInteractionMonitor(); interactMonitor.selectionChanged(part, new StructuredSelection(file)); IInteractionElement fileElement = ContextCore.getContextManager().getElement(bridge.getHandleIdentifier(file)); IInteractionElement projectElement = ContextCore.getContextManager().getElement( new ResourceStructureBridge().getHandleIdentifier(nonJavaProject.getProject())); assertTrue(fileElement.getInterest().isInteresting()); assertTrue(projectElement.getInterest().isInteresting()); assertTrue(ContextCorePlugin.getContextManager().manipulateInterestForElement(projectElement, false, false, false, "test")); projectElement = ContextCore.getContextManager().getElement( new ResourceStructureBridge().getHandleIdentifier(nonJavaProject.getProject())); fileElement = ContextCore.getContextManager().getElement(bridge.getHandleIdentifier(file)); assertFalse(projectElement.getInterest().isInteresting()); assertFalse(fileElement.getInterest().isInteresting()); interactMonitor.dispose(); }

Target:
public void testDecrementNonJavaProject() throws CoreException, InvocationTargetException, InterruptedException { IFile file = nonJavaProject.getProject().getFile("foo.txt"); file.create(null, true, null); ResourceStructureBridge bridge = new ResourceStructureBridge(); resourceMonitor.selectionChanged(part, new StructuredSelection(file)); IInteractionElement fileElement = ContextCore.getContextManager().getElement(bridge.getHandleIdentifier(file)); IInteractionElement projectElement = ContextCore.getContextManager().getElement( new ResourceStructureBridge().getHandleIdentifier(nonJavaProject.getProject())); assertTrue(fileElement.getInterest().isInteresting()); assertTrue(projectElement.getInterest().isInteresting()); assertTrue(ContextCorePlugin.getContextManager().manipulateInterestForElement(projectElement, false, false, false, "test")); projectElement = ContextCore.getContextManager().getElement( new ResourceStructureBridge().getHandleIdentifier(nonJavaProject.getProject())); fileElement = ContextCore.getContextManager().getElement(bridge.getHandleIdentifier(file)); assertFalse(projectElement.getInterest().isInteresting()); assertFalse(fileElement.getInterest().isInteresting()); }
Source:
public void onVisitorDrop(final PlayerDropItemEvent e) { if (DEBUG) { plugin.getLogger().info(e.getEventName()); } if (!IslandGuard.inWorld(e.getPlayer())) { return; } if (plugin.getGrid().isAtSpawn(e.getItemDrop().getLocation())) { if (Settings.allowSpawnVisitorItemDrop || e.getPlayer().isOp() || VaultHelper.checkPerm(e.getPlayer(), Settings.PERMPREFIX + "mod.bypassprotect") || plugin.getGrid().locationIsOnIsland(e.getPlayer(), e.getItemDrop().getLocation())) { return; } } if (plugin.getGrid().getIslandAt(e.getItemDrop().getLocation()).getIgsFlag(Flags.allowVisitorItemDrop) || e.getPlayer().isOp() || VaultHelper.checkPerm(e.getPlayer(), Settings.PERMPREFIX + "mod.bypassprotect") || plugin.getGrid().locationIsOnIsland(e.getPlayer(), e.getItemDrop().getLocation())) { return; } e.getPlayer().sendMessage(ChatColor.RED + plugin.myLocale(e.getPlayer().getUniqueId()).islandProtected); e.setCancelled(true); }

Target:
public void onVisitorDrop(final PlayerDropItemEvent e) { if (DEBUG) { plugin.getLogger().info(e.getEventName()); } if (!IslandGuard.inWorld(e.getPlayer())) { return; } if (plugin.getGrid().isAtSpawn(e.getItemDrop().getLocation())) { if (Settings.allowSpawnVisitorItemDrop || e.getPlayer().isOp() || VaultHelper.checkPerm(e.getPlayer(), Settings.PERMPREFIX + "mod.bypassprotect") || plugin.getGrid().locationIsOnIsland(e.getPlayer(), e.getItemDrop().getLocation())) { return; } } if ((plugin.getGrid().getIslandAt(e.getItemDrop().getLocation()) != null && plugin.getGrid().getIslandAt(e.getItemDrop().getLocation()).getIgsFlag(Flags.allowVisitorItemDrop)) || e.getPlayer().isOp() || VaultHelper.checkPerm(e.getPlayer(), Settings.PERMPREFIX + "mod.bypassprotect") || plugin.getGrid().locationIsOnIsland(e.getPlayer(), e.getItemDrop().getLocation())) { return; } e.getPlayer().sendMessage(ChatColor.RED + plugin.myLocale(e.getPlayer().getUniqueId()).islandProtected); e.setCancelled(true); }
Source:
private String getAzureSubnetToUseWithPrivateEndpoint(DetailedEnvironmentResponse detailedEnvironmentResponse, DBStack dbStack) { String subscriptionId = subnetListerService.getAzureSubscriptionId(detailedEnvironmentResponse.getCrn()); return subnetChooserService.chooseSubnetForPrivateEndpoint( detailedEnvironmentResponse.getNetwork().getSubnetMetas().values(), dbStack, detailedEnvironmentResponse.getNetwork().isExistingNetwork()) .stream() .findFirst() .map(csn -> subnetListerService.expandAzureResourceId(csn, detailedEnvironmentResponse, subscriptionId)) .map(sn -> sn.getId()).orElse(null); }

Target:
private String getAzureSubnetToUseWithPrivateEndpoint(DetailedEnvironmentResponse detailedEnvironmentResponse, DBStack dbStack) { String subscriptionId = subnetListerService.getAzureSubscriptionId(detailedEnvironmentResponse.getCrn()); return subnetChooserService.chooseSubnetForPrivateEndpoint( detailedEnvironmentResponse.getNetwork().getSubnetMetas().values(), dbStack, detailedEnvironmentResponse.getNetwork().isExistingNetwork()) .stream() .findFirst() .map(csn -> subnetListerService.expandAzureResourceId(csn, detailedEnvironmentResponse, subscriptionId)) .map(sn -> sn.getId()).orElseThrow(() -> new RedbeamsException("It is not possible to create private endpoints for database: " + "there are no subnets with privateEndpointNetworkPolicies disabled")); }