auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static String formatRequest(String url, Position position, String alarm) { Uri serverUrl = Uri.parse(url).buildUpon() .appendQueryParameter("id", position.getDeviceId()) .appendQueryParameter("timestamp", String.valueOf(position.getTime().getTime() / 1000)) .appendQueryParameter("lat", String.valueOf(position.getLatitude())) .appendQueryParameter("lon", String.valueOf(position.getLongitude())) .appendQueryParameter("speed", String.valueOf(position.getSpeed())) .appendQueryParameter("bearing", String.valueOf(position.getCourse())) .appendQueryParameter("altitude", String.valueOf(position.getAltitude())) .appendQueryParameter("batt", String.valueOf(position.getBattery())) .build(); if (alarm != null && alarm.trim().length() != 0) { serverUrl = serverUrl.buildUpon().appendQueryParameter("alarm", alarm).build(); } int port = serverUrl.getPort(); if (port < 0 || port > 65535) { port = 5055; String host = serverUrl.getHost(); serverUrl = serverUrl.buildUpon().encodedAuthority(host + ":" + port).build(); } return serverUrl.toString(); }

Target:
public static String formatRequest(String url, Position position, String alarm) { Uri serverUrl = Uri.parse(url); Uri.Builder builder = serverUrl.buildUpon() .appendQueryParameter("id", position.getDeviceId()) .appendQueryParameter("timestamp", String.valueOf(position.getTime().getTime() / 1000)) .appendQueryParameter("lat", String.valueOf(position.getLatitude())) .appendQueryParameter("lon", String.valueOf(position.getLongitude())) .appendQueryParameter("speed", String.valueOf(position.getSpeed())) .appendQueryParameter("bearing", String.valueOf(position.getCourse())) .appendQueryParameter("altitude", String.valueOf(position.getAltitude())) .appendQueryParameter("batt", String.valueOf(position.getBattery())); if (alarm != null) { builder.appendQueryParameter("alarm", alarm); } return builder.build().toString(); }
Source:
private static Slice realToLongDecimal(long value, long precision, long scale) { float floatValue = intBitsToFloat(intScale(value)); if (Float.isInfinite(floatValue) || Float.isNaN(floatValue)) { throw new PrestoException(INVALID_CAST_ARGUMENT, format("Cannot cast REAL '%s' to DECIMAL(%s, %s)", floatValue, precision, scale)); } try { BigDecimal bigDecimal = new BigDecimal(String.valueOf(floatValue)).setScale((int) scale, BigDecimal.ROUND_HALF_UP); Slice decimal = Decimals.encodeScaledValue(bigDecimal); if (overflows(decimal, intScale(precision))) { throw new PrestoException(INVALID_CAST_ARGUMENT, format("Cannot cast REAL '%s' to DECIMAL(%s, %s)", floatValue, precision, scale)); } return decimal; } catch (ArithmeticException e) { throw new PrestoException(INVALID_CAST_ARGUMENT, format("Cannot cast REAL '%s' to DECIMAL(%s, %s)", floatValue, precision, scale)); } }

Target:
private static Slice realToLongDecimal(long value, long precision, long scale) { float floatValue = intBitsToFloat(intScale(value)); if (Float.isInfinite(floatValue) || Float.isNaN(floatValue)) { throw new PrestoException(INVALID_CAST_ARGUMENT, format("Cannot cast REAL '%s' to DECIMAL(%s, %s)", floatValue, precision, scale)); } try { BigDecimal bigDecimal = new BigDecimal(String.valueOf(floatValue)).setScale(intScale(scale), HALF_UP); Slice decimal = Decimals.encodeScaledValue(bigDecimal); if (overflows(decimal, intScale(precision))) { throw new PrestoException(INVALID_CAST_ARGUMENT, format("Cannot cast REAL '%s' to DECIMAL(%s, %s)", floatValue, precision, scale)); } return decimal; } catch (ArithmeticException e) { throw new PrestoException(INVALID_CAST_ARGUMENT, format("Cannot cast REAL '%s' to DECIMAL(%s, %s)", floatValue, precision, scale)); } }
Source:
private void startFurnace() throws InterruptedException, ExecutionException { Future<Furnace> future = furnace.startAsync(); future.get(); long startTime = System.currentTimeMillis(); long maxWait = 1000L * 30L; while (true) { long currentTime = System.currentTimeMillis(); long timeWaited = currentTime - startTime; boolean allStarted = true; for (Addon addon : furnace.getAddonRegistry().getAddons()) { if (!addon.getStatus().isStarted()) { allStarted = false; } } if (allStarted) break; if (timeWaited > maxWait) { System.err.println("WARN: Not all addons started!"); for (Addon addon : furnace.getAddonRegistry().getAddons()) { if (!addon.getStatus().isStarted()) System.err.println("WARN: " + addon.getId() + " status: " + addon.getStatus()); } } } }

Target:
private void startFurnace() throws InterruptedException, ExecutionException { Future<Furnace> future = furnace.startAsync(); future.get(); long startTime = System.currentTimeMillis(); long maxWait = 1000L * 30L; while (true) { long currentTime = System.currentTimeMillis(); long timeWaited = currentTime - startTime; boolean allStarted = true; for (Addon addon : furnace.getAddonRegistry().getAddons()) { if (!addon.getStatus().isStarted()) { allStarted = false; } } if (allStarted) break; if (timeWaited > maxWait) { System.err.println("WARN: Not all addons started!"); for (Addon addon : furnace.getAddonRegistry().getAddons()) { if (!addon.getStatus().isStarted()) System.err.println("WARN: " + addon.getId() + " status: " + addon.getStatus()); } break; } } }
Source:
public void onBackPressed() { if (narrowedList != null) { narrowedList = null; getSupportFragmentManager().popBackStack(NARROW, FragmentManager.POP_BACK_STACK_INCLUSIVE); } else { if(atHome){ if(backPressedOnce){ finish(); } backPressedOnce=true; Toast.makeText(this, R.string.press_again_to_exit, Toast.LENGTH_SHORT).show(); new Handler().postDelayed(new Runnable() { @Override public void run() { backPressedOnce= false; } }, 2000); } else if(!atHome) atHome = true; } }

Target:
public void onBackPressed() { if (narrowedList == null) { if (backPressedOnce) { finish(); } backPressedOnce = true; Toast.makeText(this, R.string.press_again_to_exit, Toast.LENGTH_SHORT).show(); statusUpdateRunnable = new Runnable() { @Override public void run() { backPressedOnce = false; } }; statusUpdateHandler.postDelayed(statusUpdateRunnable, 2000); } else { narrowedList = null; getSupportFragmentManager().popBackStack(NARROW, FragmentManager.POP_BACK_STACK_INCLUSIVE); } }
Source:
public void testFaultyStyleDoesntBreak() throws Exception { MockHttpServletResponse response = getAsServletResponse( "wms?BBOX=-180,-90,180,90" + "&styles=raster&layers=cdf:Fifteen&Format=image/png" + "&request=GetMap" + "&width=256" + "&height=256" + "&srs=EPSG%3A4326"); BufferedImage image = ImageIO.read(getBinaryInputStream(response)); assertNotNull(image); }

Target:
public void testFaultyStyleDoesntBreak() throws Exception { MockHttpServletResponse response = getAsServletResponse( "wms?BBOX=-180,-90,180,90" + "&styles=raster&layers=cdf:Fifteen&Format=image/png" + "&request=GetMap" + "&width=256" + "&height=256" + "&srs=EPSG%3A4326"); BufferedImage image = ImageIO.read(getBinaryInputStream(response)); assertNotNull(image); assertBlank("testFaultyStyleDoesntBreak", image); }
Source:
public void updateEntry(Sort oldSort, Sort newSort) { SQLiteDatabase sqLiteDatabase = getWritableDatabase(); ContentValues contentValues = new ContentValues(); contentValues.put(COLUMN_SORT_ID, newSort.getId()); contentValues.put(COLUMN_SORT_PATH, newSort.getPath()); contentValues.put(COLUMN_SORT_TYPE, newSort.getSortType()); sqLiteDatabase.update(TABLE_SORT, contentValues, COLUMN_SORT_ID + " = ?", new String[]{oldSort.getId() + ""}); }

Target:
public void updateEntry(Sort oldSort, Sort newSort) { if (TextUtils.isEmpty(oldSort.path) || TextUtils.isEmpty(newSort.path)) { return; } SQLiteDatabase sqLiteDatabase = getWritableDatabase(); ContentValues contentValues = new ContentValues(); contentValues.put(COLUMN_SORT_PATH, newSort.path); contentValues.put(COLUMN_SORT_TYPE, newSort.type); sqLiteDatabase.update(TABLE_SORT, contentValues, COLUMN_SORT_PATH + " = ?", new String[]{oldSort.path}); }
Source:
public void testCloseIsForcedOnPendingAddOffsetRequest() throws InterruptedException { Map<String, Object> configs = new HashMap<>(); configs.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9000"); configs.put(ProducerConfig.TRANSACTIONAL_ID_CONFIG, "this-is-a-transactional-id"); Time time = new MockTime(); MetadataResponse initialUpdateResponse = TestUtils.metadataUpdateWith(1, singletonMap("testTopic", 1)); ProducerMetadata metadata = newMetadata(0, Long.MAX_VALUE, Long.MAX_VALUE); metadata.update(initialUpdateResponse, time.milliseconds()); MockClient client = new MockClient(time, metadata); Producer<String, String> producer = new KafkaProducer<>(configs, new StringSerializer(), new StringSerializer(), metadata, client, null, time); ExecutorService executorService = Executors.newSingleThreadExecutor(); CountDownLatch assertionDoneLatch = new CountDownLatch(1); client.prepareResponse(FindCoordinatorResponse.prepareResponse(Errors.NONE, host1)); executorService.submit(() -> { assertThrows(KafkaException.class, producer::initTransactions); assertionDoneLatch.countDown(); }); client.waitForRequests(1, 2000); producer.close(Duration.ofMillis(1000)); assertionDoneLatch.await(5000, TimeUnit.MILLISECONDS); }

Target:
public void testCloseIsForcedOnPendingAddOffsetRequest() throws InterruptedException { Map<String, Object> configs = new HashMap<>(); configs.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9000"); configs.put(ProducerConfig.TRANSACTIONAL_ID_CONFIG, "this-is-a-transactional-id"); Time time = new MockTime(); MetadataResponse initialUpdateResponse = TestUtils.metadataUpdateWith(1, singletonMap("testTopic", 1)); ProducerMetadata metadata = newMetadata(0, Long.MAX_VALUE); metadata.updateWithCurrentRequestVersion(initialUpdateResponse, false, time.milliseconds()); MockClient client = new MockClient(time, metadata); Producer<String, String> producer = new KafkaProducer<>(configs, new StringSerializer(), new StringSerializer(), metadata, client, null, time); ExecutorService executorService = Executors.newSingleThreadExecutor(); CountDownLatch assertionDoneLatch = new CountDownLatch(1); client.prepareResponse(FindCoordinatorResponse.prepareResponse(Errors.NONE, host1)); executorService.submit(() -> { assertThrows(KafkaException.class, producer::initTransactions); assertionDoneLatch.countDown(); }); client.waitForRequests(1, 2000); producer.close(Duration.ofMillis(1000)); assertionDoneLatch.await(5000, TimeUnit.MILLISECONDS); }
Source:
public AvroConverter<String, ?> getConverterFromString(org.apache.avro.Schema.Field f) { Schema fieldSchema = AvroUtils.unwrapIfNullable(f.schema()); if (AvroUtils.isSameType(fieldSchema, AvroUtils._boolean())) { return new StringToBooleanConverter(f); } else if (AvroUtils.isSameType(fieldSchema, AvroUtils._decimal())) { return new StringToDecimalConverter(f); } else if (AvroUtils.isSameType(fieldSchema, AvroUtils._double())) { return new StringToDoubleConverter(f); } else if (AvroUtils.isSameType(fieldSchema, AvroUtils._int())) { return new StringToIntegerConverter(f); } else if (AvroUtils.isSameType(fieldSchema, AvroUtils._date()) || LogicalTypes.timestampMillis() == fieldSchema.getLogicalType()) { return new StringToDateConverter(f); } else if (AvroUtils.isSameType(fieldSchema, AvroUtils._bytes())) { return new StringToBytesConverter(f); } else if (AvroUtils.isSameType(fieldSchema, AvroUtils._string())) { return super.getConverter(String.class); } throw new UnsupportedOperationException("The type " + fieldSchema.getType() + " is not supported."); }

Target:
public AvroConverter<String, ?> getConverterFromString(org.apache.avro.Schema.Field f) { Schema fieldSchema = AvroUtils.unwrapIfNullable(f.schema()); if (AvroUtils.isSameType(fieldSchema, AvroUtils._boolean())) { return new StringToBooleanConverter(f); } else if (AvroUtils.isSameType(fieldSchema, AvroUtils._decimal())) { return new StringToDecimalConverter(f); } else if (AvroUtils.isSameType(fieldSchema, AvroUtils._double())) { return new StringToDoubleConverter(f); } else if (AvroUtils.isSameType(fieldSchema, AvroUtils._int())) { return new StringToIntegerConverter(f); } else if (AvroUtils.isSameType(fieldSchema, AvroUtils._date()) || LogicalTypeUtils.isLogicalTimestampMillis(fieldSchema)) { return new StringToDateConverter(f); } else if (AvroUtils.isSameType(fieldSchema, AvroUtils._bytes())) { return new StringToBytesConverter(f); } else if (AvroUtils.isSameType(fieldSchema, AvroUtils._string())) { return super.getConverter(String.class); } throw new UnsupportedOperationException("The type " + fieldSchema.getType() + " is not supported."); }
Source:
public void shouldThrow_whenIncorrectOperationForCorporateDebitSurchargeAmount() { JsonNode jsonNode = new ObjectMapper() .valueToTree(ImmutableMap.of(FIELD_OPERATION, "update", FIELD_OPERATION_PATH, "corporate_debit_card_surcharge_amount", FIELD_VALUE, 250)); try { validator.validatePatchRequest(jsonNode); fail( "Expected ValidationException" ); } catch (ValidationException validationException) { assertThat(validationException.getErrors().size(), is(1)); assertThat(validationException.getErrors(), hasItems( "Operation [update] is not valid for path [corporate_debit_card_surcharge_amount]")); } }

Target:
public void shouldThrow_whenIncorrectOperationForCorporateDebitSurchargeAmount() { JsonNode jsonNode = new ObjectMapper() .valueToTree(ImmutableMap.of(FIELD_OPERATION, "remove", FIELD_OPERATION_PATH, "corporate_debit_card_surcharge_amount", FIELD_VALUE, 250)); try { validator.validatePatchRequest(jsonNode); fail( "Expected ValidationException" ); } catch (ValidationException validationException) { assertThat(validationException.getErrors().size(), is(1)); assertThat(validationException.getErrors(), hasItems( "Operation [remove] is not valid for path [corporate_debit_card_surcharge_amount]")); } }
Source:
public CassandraSegmentStore(CassandraDataStaxClient cassandra, String keyspace, String tableName, AliasIndex<Segment> aliasIndex, IdGenerator idGenerator, Equivalence<? super Segment> equivalence, MessageSender<ResourceUpdatedMessage> sender) { super(idGenerator, equivalence, sender, new SystemClock()); this.cassandra = checkNotNull(cassandra); this.aliasIndex = checkNotNull(aliasIndex); this.keyspace = checkNotNull(keyspace); this.tableName = checkNotNull(tableName); }

Target:
private CassandraSegmentStore(CassandraDataStaxClient cassandra, String keyspace, String tableName, AliasIndex<Segment> aliasIndex, IdGenerator idGenerator, Equivalence<? super Segment> equivalence, MessageSender<ResourceUpdatedMessage> sender) { super(idGenerator, equivalence, sender, new SystemClock()); this.cassandra = checkNotNull(cassandra); this.aliasIndex = checkNotNull(aliasIndex); this.keyspace = checkNotNull(keyspace); this.tableName = checkNotNull(tableName); }
Source:
public Object getAdapter(Class type) { if (!initEditor.get() && stackedPane.getActiveControlKey() == EDIT_VIEW) { if (type == CommandStack.class) { return chartEditor.getViewer().getEditDomain().getCommandStack(); } } if (type == IPropertySheetPage.class) { return propertySheetPage; } return super.getAdapter(type); }

Target:
public Object getAdapter(Class type) { if (type == CommandStack.class) { if (!initEditor.get() && stackedPane.getActiveControlKey() == EDIT_VIEW) { return chartEditor.getViewer().getEditDomain().getCommandStack(); } } if (type == IPropertySheetPage.class) { return propertySheetPage; } return super.getAdapter(type); }
Source:
public static void validateJdk() throws RuntimeException { if (!isSupportedJdkVersion()) { if (isJdkAboveRange(getJdkVersion(), createJdkVersionRanges(getSupportedJdks()))) { logger.warn("We are looking into adding support for this JDK version. Use it at your own risk."); } else { throw new RuntimeException("Unsupported Jdk"); } } if (!isSupportedJdkVendor()) { logger.info("You're executing with a JDK made by a vendor that is not on the recommended list of vendors. Vendor: " + JAVA_VENDOR + " Please consider changing to a recommended JDK vendor."); } else if (getBoolean(getProperty("mule.jdkDebug"))) { logger.info("You're executing with a JDK made by a recommended vendor."); } }

Target:
public static void validateJdk() throws RuntimeException { if (!isSupportedJdkVersion()) { if (isJdkAboveRange(getJdkVersion(), createJdkVersionRanges(getSupportedJdks()))) { logger.warn("We are looking into adding support for this JDK version. Use it at your own risk."); } else { throw new RuntimeException("Unsupported Jdk"); } } if (!isSupportedJdkVendor()) { logger.info("You're executing with a JDK made by a vendor that is not on the recommended list of vendors. Vendor: " + JAVA_VENDOR + " Please consider changing to a recommended JDK vendor."); } else if (getBoolean(MULE_JDK_DEBUG)) { logger.info("You're executing with a JDK made by a recommended vendor."); } }
Source:
public void testSDView() { SWTBotView viewBot = fBot.viewById(UML2DVIEW_ID); assertNotNull(viewBot); viewBot.setFocus(); SWTBotUtils.waitForJobs(); List<SWTBotToolbarButton> viewButtons = viewBot.getToolbarButtons(); List<String> titles = new ArrayList<>(); for (SWTBotToolbarButton buttonBot : viewButtons) { titles.add(buttonBot.getToolTipText()); } String[] expected = { "Reset zoom factor", "Select", "Zoom in the diagram", "Zoom out the diagram", "Go to next page", "Go to previous page", "Go to first page", "Go to last page", "Find... (Ctrl+F)" }; assertArrayEquals("Buttons", expected, titles.toArray(new String[0])); }

Target:
public void testSDView() { SWTBotView viewBot = fBot.viewById(UML2DVIEW_ID); assertNotNull(viewBot); viewBot.setFocus(); SWTBotUtils.waitForJobs(); List<SWTBotToolbarButton> viewButtons = viewBot.getToolbarButtons(); List<String> titles = new ArrayList<>(); for (SWTBotToolbarButton buttonBot : viewButtons) { titles.add(buttonBot.getToolTipText()); } String[] expected = { "Reset zoom factor", "Select", "Zoom in the diagram", "Zoom out the diagram", "Go to next page", "Go to previous page", "Go to first page", "Go to last page", "Find... (Ctrl+F)" }; assertArrayEquals("Buttons", expected, titles.toArray(new String[0])); SDView view = (SDView) viewBot.getViewReference().getPart(false); Frame frame = view.getFrame(); assertEquals(2, frame.lifeLinesCount()); }
Source:
public long getSpaceRequired(Set<Entity> entities) { long total = 0L; for (val entity : entities) { ObjectSpecification spec = storageService.getDownloadSpecification(entity.getId(), 0, -1L); total += spec.getObjectSize(); } return total; }

Target:
public long getSpaceRequired(Set<Entity> entities) { long total = 0L; for (val entity : entities) { ObjectSpecification spec = storageService.getDownloadSpecification(entity.getId()); total += spec.getObjectSize(); } return total; }
Source:
public static boolean backupFileDiffers(Path originalPath) { Path backupPath = getBackupPath(originalPath); if (!Files.exists(backupPath) || Files.isDirectory(backupPath)) { return false; } try { return !com.google.common.io.Files.equal(originalPath.toFile(), backupPath.toFile()); } catch (IOException e) { LOGGER.debug("Could not compare original file and backup file.", e); return true; } }

Target:
public static boolean backupFileDiffers(Path originalPath) { Path backupPath = getBackupPath(originalPath); if (!Files.exists(backupPath) || Files.isDirectory(backupPath)) { return false; } try { return Files.mismatch(originalPath, backupPath) != -1L; } catch (IOException e) { LOGGER.debug("Could not compare original file and backup file.", e); return true; } }
Source:
public void forceDarkTheme(boolean forced) { forceDarkTheme = forced; }

Target:
public synchronized void forceDarkTheme(boolean forced) { forceDarkTheme = forced; }
Source:
public void shouldNotSaveTaskWithInvalidRetryIntervalValue() { Task t = new Task("name", trigger, asList(action)); t.setRetryIntervalInMilliseconds(-10); taskService.save(t); }

Target:
public void shouldNotSaveTaskWithInvalidRetryIntervalValue() { Task t = new Task("name", trigger, asList(action)); t.setRetryIntervalInMilliseconds(-10); try { taskService.save(t); } finally { verifyZeroInteractions(tasksDataService); } }
Source:
protected PrivateKey engineGeneratePrivate(KeySpec keySpec) throws InvalidKeySpecException { if (keySpec instanceof PKCS8EncodedKeySpec ) { return new IosRSAKey.IosRSAPrivateKey(((PKCS8EncodedKeySpec) keySpec).getEncoded()); } if (keySpec instanceof X509EncodedKeySpec || keySpec instanceof PKCS8EncodedKeySpec ) { X509EncodedKeySpec x509Spec = (X509EncodedKeySpec) keySpec; return new IosRSAKey.IosRSAPrivateKey(x509Spec.getEncoded()); } else if (keySpec instanceof RSAPrivateKeySpec) { return new IosRSAKey.IosRSAPrivateKey((RSAPrivateKeySpec) keySpec); } throw new InvalidKeySpecException( "Must use PKCS8EncodedKeySpec; was " + keySpec.getClass().getName()); }

Target:
protected PrivateKey engineGeneratePrivate(KeySpec keySpec) throws InvalidKeySpecException { if (keySpec instanceof PKCS8EncodedKeySpec ) { return new IosRSAKey.IosRSAPrivateKey(((PKCS8EncodedKeySpec) keySpec).getEncoded()); } if (keySpec instanceof X509EncodedKeySpec) { X509EncodedKeySpec x509Spec = (X509EncodedKeySpec) keySpec; return new IosRSAKey.IosRSAPrivateKey(x509Spec.getEncoded()); } else if (keySpec instanceof RSAPrivateKeySpec) { return new IosRSAKey.IosRSAPrivateKey((RSAPrivateKeySpec) keySpec); } throw new InvalidKeySpecException( "Must use PKCS8EncodedKeySpec, X509EncodedKeySpec or RSAPrivateKeySpec; was " + keySpec.getClass().getName()); }
Source:
public BaseRobot() { super(); setupInjectionModule(); pdp = injector.getInstance(PowerDistributionPanelWPIAdapter.class); brownoutLatch.addObserver((Observable o, Object arg) -> { if(arg instanceof EdgeType) { EdgeType edge = (EdgeType)arg; if(edge == EdgeType.RisingEdge) { log.warn("Entering brownout"); } else if(edge == EdgeType.FallingEdge) { log.info("Leaving brownout"); } } }); }

Target:
public BaseRobot() { super(); setupInjectionModule(); brownoutLatch.addObserver((Observable o, Object arg) -> { if(arg instanceof EdgeType) { EdgeType edge = (EdgeType)arg; if(edge == EdgeType.RisingEdge) { log.warn("Entering brownout"); } else if(edge == EdgeType.FallingEdge) { log.info("Leaving brownout"); } } }); }
Source:
private List<PersistedEntry> enhancedGetFeedPage(final String feedName, final Date markerTimestamp, final long markerId, final PageDirection direction, final String searchString, final int pageSize) { List<PersistedEntry> feedPage = new LinkedList<PersistedEntry>(); TimerContext context = null; boolean noCats = searchString.trim().isEmpty(); try { switch (direction) { case FORWARD: if ( noCats ) { context = startTimer(String.format("db-get-feed-page-forward-with-cats-%s", getMetricBucketForPageSize(pageSize))); } else { context = startTimer( String.format("db-get-feed-page-forward-%s", getMetricBucketForPageSize(pageSize))); } feedPage = getFeedForward( feedName, markerTimestamp, markerId, searchString, pageSize, feedHeadDelayInSeconds ); Collections.reverse(feedPage); break; case BACKWARD: if ( noCats ) { context = startTimer(String.format("db-get-feed-page-backward-with-cats-%s", getMetricBucketForPageSize(pageSize))); } else { context = startTimer( String.format("db-get-feed-page-backward-%s", getMetricBucketForPageSize(pageSize))); } feedPage = getFeedBackward( feedName, markerTimestamp, markerId, searchString, pageSize ); break; } } finally { stopTimer(context); } return feedPage; }

Target:
private List<PersistedEntry> enhancedGetFeedPage(final String feedName, final Date markerTimestamp, final long markerId, final PageDirection direction, final String searchString, final int pageSize) { List<PersistedEntry> feedPage = new LinkedList<PersistedEntry>(); TimerContext context = null; boolean hasCats = !searchString.trim().isEmpty(); try { switch (direction) { case FORWARD: if ( hasCats ) { context = startTimer(String.format("db-get-feed-page-forward-with-cats-%s", getMetricBucketForPageSize(pageSize))); } else { context = startTimer( String.format("db-get-feed-page-forward-%s", getMetricBucketForPageSize(pageSize))); } feedPage = getFeedForward( feedName, markerTimestamp, markerId, searchString, pageSize, feedHeadDelayInSeconds ); Collections.reverse(feedPage); break; case BACKWARD: if ( hasCats ) { context = startTimer(String.format("db-get-feed-page-backward-with-cats-%s", getMetricBucketForPageSize(pageSize))); } else { context = startTimer( String.format("db-get-feed-page-backward-%s", getMetricBucketForPageSize(pageSize))); } feedPage = getFeedBackward( feedName, markerTimestamp, markerId, searchString, pageSize ); break; } } finally { stopTimer(context); } return feedPage; }
Source:
public String getGroupName() { if (!isInGroup()) return ""; return actualName.substring(0, actualName.indexOf(getDelimiter(actualName).get())); }

Target:
public String getGroupName() { return groupName; }
Source:
public boolean adjustCountryCentroid(Location location, Map<Integer, HealthMapCountry> countryMap) { if (location.getPrecision() == LocationPrecision.COUNTRY) { HealthMapCountry country = countryMap.get(location.getHealthMapCountryId()); if (country != null) { Point centroid = country.getCentroidOverride(); if (centroid != null) { Point originalPoint = location.getGeom(); message = String.format(REPLACED_MESSAGE, originalPoint.getX(), originalPoint.getY(), centroid.getX(), centroid.getY()); location.setGeom(country.getCentroidOverride()); return true; } } } return false; }

Target:
public boolean adjustCountryCentroid(Location location, Map<Integer, HealthMapCountry> countryMap) { if (location.getPrecision() == LocationPrecision.COUNTRY) { HealthMapCountry country = countryMap.get(location.getHealthMapCountryId()); if (country != null) { Point centroid = country.getCentroidOverride(); if (centroid != null) { Point originalPoint = location.getGeom(); Point clonedCentroid = (Point) centroid.clone(); message = String.format(REPLACED_MESSAGE, originalPoint.getX(), originalPoint.getY(), centroid.getX(), centroid.getY()); location.setGeom(clonedCentroid); return true; } } } return false; }
Source:
public AccountStatus getStatus(IAccount account) { if (account.getAccessToken() == null) { return AccountStatus.NEEDS_LOGIN; } long lastRefreshed = account.getLastRefreshedTime(); long current = System.currentTimeMillis(); if (current > account.getAccessTokenExpiryTime()) { if (current > account.getRefreshTokenExpiryTime()) { return AccountStatus.NEEDS_LOGIN; } else { return AccountStatus.NEEDS_REFRESH; } } if (((current - lastRefreshed) > OSIOCoreConstants.DURATION_24_HOURS) || ((current - lastRefreshed) > ((account.getAccessTokenExpiryTime() - current) / 2))) { return AccountStatus.NEEDS_REFRESH; } return AccountStatus.VALID; }

Target:
public AccountStatus getStatus(IAccount account) { if (account.getAccessToken() == null) { return AccountStatus.NEEDS_LOGIN; } long lastRefreshed = account.getLastRefreshedTime(); long current = System.currentTimeMillis(); if (current > account.getAccessTokenExpiryTime()) { if (current > account.getRefreshTokenExpiryTime()) { return AccountStatus.NEEDS_LOGIN; } else { return AccountStatus.NEEDS_REFRESH; } } if (wasRefreshed24HAgo(lastRefreshed, current) || wasRefreshedMoreThanHalfTheTotalValidPeriod(account.getAccessTokenExpiryTime(), lastRefreshed, current)) { return AccountStatus.NEEDS_REFRESH; } return AccountStatus.VALID; }
Source:
private void checkIfUserIsOwner(String noteId, String errorMsg) { Set<String> userAndRoles = Sets.newHashSet(); userAndRoles.add(SecurityUtils.getPrincipal()); userAndRoles.addAll(SecurityUtils.getRoles()); if (!notebookAuthorization.hasReadAuthorization(userAndRoles, noteId)) { throw new UnauthorizedException(errorMsg); } }

Target:
private void checkIfUserIsOwner(String noteId, String errorMsg) { Set<String> userAndRoles = Sets.newHashSet(); userAndRoles.add(SecurityUtils.getPrincipal()); userAndRoles.addAll(SecurityUtils.getRoles()); if (!notebookAuthorization.isOwner(userAndRoles, noteId)) { throw new UnauthorizedException(errorMsg); } }
Source:
public void updateModel(final @Nullable Object dataInput) { final TableViewer tableViewer = getTableViewer(); Display.getDefault().asyncExec(() -> { if (!tableViewer.getTable().isDisposed()) { tableViewer.getTable().setTopIndex(0); ISelection selection = tableViewer.getSelection(); ISegment selected = null; if (!selection.isEmpty() && selection instanceof StructuredSelection) { Object firstElement = ((StructuredSelection) selection).getFirstElement(); if (firstElement instanceof ISegment) { selected = (ISegment) firstElement; } } if (dataInput == null) { tableViewer.setSelection(StructuredSelection.EMPTY); tableViewer.setInput(null); tableViewer.setItemCount(0); return; } addPackListener(); tableViewer.setInput(dataInput); SegmentStoreContentProvider contentProvider = (SegmentStoreContentProvider) getTableViewer().getContentProvider(); tableViewer.setItemCount((int) Math.min(Integer.MAX_VALUE, contentProvider.getSegmentCount())); boolean found = false; if (selected != null && dataInput instanceof ISegmentStore<?>) { ISegmentStore<?> store = (ISegmentStore<?>) dataInput; for (ISegment segment : store.getIntersectingElements(selected.getStart())) { if (isSameish(segment, selected)) { selection = new StructuredSelection(segment); tableViewer.setSelection(selection, true); found = true; break; } } } if (!found) { tableViewer.setSelection(StructuredSelection.EMPTY); } } }); }

Target:
public void updateModel(final @Nullable Object dataInput) { final TableViewer tableViewer = getTableViewer(); Display.getDefault().asyncExec(() -> { if (!tableViewer.getTable().isDisposed()) { tableViewer.getTable().setTopIndex(0); ISelection selection = tableViewer.getSelection(); ISegment selected = null; if (!selection.isEmpty() && selection instanceof StructuredSelection) { Object firstElement = ((StructuredSelection) selection).getFirstElement(); if (firstElement instanceof ISegment) { selected = (ISegment) firstElement; } } if (dataInput == null) { tableViewer.setSelection(StructuredSelection.EMPTY); tableViewer.setInput(null); tableViewer.setItemCount(0); return; } addPackListener(); tableViewer.setInput(dataInput); SegmentStoreContentProvider contentProvider = (SegmentStoreContentProvider) getTableViewer().getContentProvider(); tableViewer.setItemCount((int) Math.min(Integer.MAX_VALUE, contentProvider.getSegmentCount())); boolean found = false; if (selected != null && dataInput instanceof ISegmentStore<?>) { ISegmentStore<?> store = (ISegmentStore<?>) dataInput; for (ISegment segment : store.getIntersectingElements(selected.getEnd())) { if (isSameish(segment, selected)) { selection = new StructuredSelection(segment); tableViewer.setSelection(selection, true); found = true; break; } } } if (!found) { tableViewer.setSelection(StructuredSelection.EMPTY); } } }); }
Source:
private void performLogin(ConnectorConfig config, PartnerConnection connection) throws ConnectionException { config.setServiceEndpoint(config.getAuthEndpoint()); LoginResult loginResult = connection.login(config.getUsername(), config.getPassword()); if (loginResult.isPasswordExpired()) { throw new ConnectionException(SalesforceRuntime.getI18nMessage("error.expiredPassword")); } config.setSessionId(loginResult.getSessionId()); config.setServiceEndpoint(loginResult.getServerUrl()); connection.setSessionHeader(loginResult.getSessionId()); }

Target:
private void performLogin(ConnectorConfig config, PartnerConnection connection) throws ConnectionException { config.setServiceEndpoint(config.getAuthEndpoint()); LoginResult loginResult = connection.login(config.getUsername(), config.getPassword()); if (loginResult.isPasswordExpired()) { throw new ConnectionException(MESSAGES.getMessage("error.expiredPassword")); } config.setSessionId(loginResult.getSessionId()); config.setServiceEndpoint(loginResult.getServerUrl()); connection.setSessionHeader(loginResult.getSessionId()); }
Source:
private boolean canStop(int x) { if ((x & 127) == 0) { long t = System.nanoTime() - startNs; return cost >= 0 && 10 * t > cost * TimeUnit.MILLISECONDS.toNanos(1); } return false; }

Target:
private boolean canStop(int x) { return (x & 127) == 0 && cost >= 0 && 10 * (System.nanoTime() - startNs) > cost * TimeUnit.MILLISECONDS.toNanos(1); }
Source:
public void rollback(Xid xid) throws XAException { log.infof("rollback xid: [%s]", xid); checker.addRollback(); }

Target:
public void rollback(Xid xid) throws XAException { log.tracef("rollback xid: [%s]", xid); checker.addRollback(); }
Source:
Preset(String presetName) throws ParseError { if (presetName == null) throw new ParseError("Preset name cannot be null"); Collection<TaggingPreset> ts = TaggingPresets.getTaggingPresets(); ps = new ArrayList<>(); for (TaggingPreset t : ts) { String name = t.getSimpleName(); if (name != null && name.equalsIgnoreCase(presetName)) ps.add(t); } if (ps.isEmpty()) throw new ParseError(tr("Unknown preset name: ") + presetName); }

Target:
Preset(String presetName) throws ParseError { if (presetName == null) { throw new ParseError("The name of the preset is required"); } this.presets = TaggingPresets.getTaggingPresets() .stream() .filter(preset -> presetName.equalsIgnoreCase(preset.getSimpleName())) .collect(Collectors.toList()); if (this.presets.isEmpty()) { throw new ParseError(tr("Unknown preset name: ") + presetName); } }
Source:
protected AbstractBigtableConnection(Configuration conf, boolean managed, ExecutorService pool, User user) throws IOException { if (managed) { throw new IllegalArgumentException("Bigtable does not support managed connections."); } this.conf = conf; try { this.options = BigtableOptionsFactory.fromConfiguration(conf); } catch (IOException ioe) { LOG.error("Error loading BigtableOptions from Configuration.", ioe); throw ioe; } this.batchPool = pool; this.closed = false; this.session = new BigtableSession(options); synchronized (resourceLimitedLock) { if (resourceLimiter == null) { int defaultRpcCount = AsyncExecutor.MAX_INFLIGHT_RPCS_DEFAULT * options.getChannelCount(); int maxInflightRpcs = conf.getInt(MAX_INFLIGHT_RPCS_KEY, defaultRpcCount); long maxMemory = conf.getLong( BIGTABLE_BUFFERED_MUTATOR_MAX_MEMORY_KEY, AsyncExecutor.ASYNC_MUTATOR_MAX_MEMORY_DEFAULT); this.resourceLimiter = new ResourceLimiter(maxMemory, maxInflightRpcs); } } }

Target:
protected AbstractBigtableConnection(Configuration conf, boolean managed, ExecutorService pool, User user) throws IOException { if (managed) { throw new IllegalArgumentException("Bigtable does not support managed connections."); } this.conf = conf; try { this.options = BigtableOptionsFactory.fromConfiguration(conf); } catch (IOException ioe) { LOG.error("Error loading BigtableOptions from Configuration.", ioe); throw ioe; } this.batchPool = pool; this.closed = false; this.session = new BigtableSession(options); initializeResourceLimiter(conf, options); }
Source:
public Symbol cast(DataType<?> targetType, boolean tryCast) { if (targetType.equals(valueType())) { return this; } else if (ArrayType.unnest(targetType).equals(DataTypes.UNTYPED_OBJECT) && valueType().id() == DataTypes.UNTYPED_OBJECT.id()) { return this; } return CastFunctionResolver.generateCastFunction(this, targetType, tryCast); }

Target:
public Symbol cast(DataType<?> targetType, boolean tryCast) { if (targetType.equals(valueType())) { return this; } else if (ArrayType.unnest(targetType).equals(DataTypes.UNTYPED_OBJECT) && valueType().id() == targetType.id()) { return this; } return CastFunctionResolver.generateCastFunction(this, targetType, tryCast); }
Source:
public void loggingAppenderStop() { listAppender.stop(); System.setProperty("oak.repository.property.logWarnStringSizeThreshold", ""); }

Target:
public void loggingAppenderStop() { listAppender.stop(); }
Source:
private void doTestSmartMarkAsPlayed_Skip_ForEpisode(int itemIdxNegAllowed) throws Exception { setSmartMarkAsPlayedPreference(60); setSkipKeepsEpisodePreference(false); uiTestUtils.addLocalFeedData(true); int fiIdx; if (itemIdxNegAllowed >= 0) { fiIdx = itemIdxNegAllowed; } else { fiIdx = DBReader.getQueue().size() + itemIdxNegAllowed; } final FeedItem feedItem = DBReader.getQueue().get(fiIdx); gotoQueueScreen(); playFromQueue(fiIdx); skipEpisode(); Thread.sleep(1000); assertThat("Ensure smart mark as play will lead to the item removed from the queue", DBReader.getQueue(), not(hasItems(feedItem))); assertThat(DBReader.getFeedItem(feedItem.getId()).isPlayed(), is(true)); }

Target:
private void doTestSmartMarkAsPlayed_Skip_ForEpisode(int itemIdxNegAllowed) throws Exception { setSmartMarkAsPlayedPreference(60); setSkipKeepsEpisodePreference(false); uiTestUtils.addLocalFeedData(true); int fiIdx; if (itemIdxNegAllowed >= 0) { fiIdx = itemIdxNegAllowed; } else { fiIdx = DBReader.getQueue().size() + itemIdxNegAllowed; } final FeedItem feedItem = DBReader.getQueue().get(fiIdx); gotoQueueScreen(); playFromQueue(fiIdx); skipEpisode(); Awaitility.await() .atMost(1000, MILLISECONDS) .untilAsserted(() -> { assertThat("Ensure smart mark as play will lead to the item removed from the queue", DBReader.getQueue(), not(hasItems(feedItem))); }); assertThat(DBReader.getFeedItem(feedItem.getId()).isPlayed(), is(true)); }
Source:
public CompletableFuture<org.apache.bookkeeper.client.api.LedgerEntries> read(long firstEntry, long lastEntry) { if (firstEntry < 0 || firstEntry > lastEntry) { LOG.error("IncorrectParameterException on ledgerId:{} firstEntry:{} lastEntry:{}", new Object[] { ledgerId, firstEntry, lastEntry }); return FutureUtils.exception(new BKIncorrectParameterException()); } if (lastEntry > lastAddConfirmed) { LOG.error("ReadException on ledgerId:{} firstEntry:{} lastEntry:{}", new Object[] { ledgerId, firstEntry, lastEntry }); return FutureUtils.exception(new BKReadException()); } return readEntriesInternalAsync(firstEntry, lastEntry); }

Target:
public CompletableFuture<LedgerEntries> read(long firstEntry, long lastEntry) { if (firstEntry < 0 || firstEntry > lastEntry) { LOG.error("IncorrectParameterException on ledgerId:{} firstEntry:{} lastEntry:{}", new Object[] { ledgerId, firstEntry, lastEntry }); return FutureUtils.exception(new BKIncorrectParameterException()); } if (lastEntry > lastAddConfirmed) { LOG.error("ReadException on ledgerId:{} firstEntry:{} lastEntry:{}", new Object[] { ledgerId, firstEntry, lastEntry }); return FutureUtils.exception(new BKReadException()); } return readEntriesInternalAsync(firstEntry, lastEntry); }
Source:
public static Map<String, Grid> fromShapefile (File shapefile, int zoom, BiConsumer<Integer, Integer> statusListener) throws IOException, FactoryException, TransformException { Map<String, Grid> grids = new HashMap<>(); ShapefileReader reader = new ShapefileReader(shapefile); Envelope envelope = reader.wgs84Bounds(); int total = reader.getFeatureCount(); if (statusListener != null) statusListener.accept(0, total); AtomicInteger count = new AtomicInteger(0); reader.wgs84Stream().forEach(feat -> { Geometry geom = (Geometry) feat.getDefaultGeometry(); for (Property p : feat.getProperties()) { Object val = p.getValue(); if (val == null || !Number.class.isInstance(val)) continue; double numericVal = ((Number) val).doubleValue(); if (numericVal == 0) continue; String attributeName = p.getName().getLocalPart(); if (!grids.containsKey(attributeName)) { grids.put(attributeName, new Grid( zoom, envelope.getMaxY(), envelope.getMaxX(), envelope.getMinY(), envelope.getMinX() )); } Grid grid = grids.get(attributeName); if (geom instanceof Point) { Point point = (Point) geom; grid.incrementPoint(point.getY(), point.getX(), numericVal); } else if (geom instanceof Polygon || geom instanceof MultiPolygon) { grid.rasterize(geom, numericVal); } else { throw new IllegalArgumentException("Unsupported geometry type"); } } int currentCount = count.incrementAndGet(); if (statusListener != null) statusListener.accept(currentCount, total); if (currentCount % 100 == 0) { LOG.info("{} / features read", human(currentCount), human(total)); } }); reader.close(); return grids; }

Target:
public static Map<String, Grid> fromShapefile (File shapefile, int zoom, BiConsumer<Integer, Integer> statusListener) throws IOException, FactoryException, TransformException { Map<String, Grid> grids = new HashMap<>(); ShapefileReader reader = new ShapefileReader(shapefile); Envelope envelope = reader.wgs84Bounds(); int total = reader.getFeatureCount(); if (statusListener != null) statusListener.accept(0, total); AtomicInteger count = new AtomicInteger(0); reader.wgs84Stream().forEach(feat -> { Geometry geom = (Geometry) feat.getDefaultGeometry(); for (Property p : feat.getProperties()) { Object val = p.getValue(); if (val == null || !Number.class.isInstance(val)) continue; double numericVal = ((Number) val).doubleValue(); if (numericVal == 0) continue; String attributeName = p.getName().getLocalPart(); if (!grids.containsKey(attributeName)) { grids.put(attributeName, new Grid( zoom, envelope.getMaxY(), envelope.getMaxX(), envelope.getMinY(), envelope.getMinX() )); } Grid grid = grids.get(attributeName); if (geom instanceof Point) { Point point = (Point) geom; grid.incrementPoint(point.getY(), point.getX(), numericVal); } else if (geom instanceof Polygon || geom instanceof MultiPolygon) { grid.rasterize(geom, numericVal); } else { throw new IllegalArgumentException("Unsupported geometry type"); } } int currentCount = count.incrementAndGet(); if (statusListener != null) statusListener.accept(currentCount, total); if (currentCount % 10000 == 0) { LOG.info("{} / features read", human(currentCount), human(total)); } }); reader.close(); return grids; }
Source:
private String getMedia(JSONObject data) { String imageURL = ""; if (data.has("videos")) { JSONObject videosObject = data.getJSONObject("videos"); if (!videosObject.isNull("standard_resolution")) { imageURL = videosObject.getJSONObject("standard_resolution").getString("url"); } } else if (data.has("images")) { JSONObject imagesObject = data.getJSONObject("images"); if (!imagesObject.isNull("standard_resolution")) { imageURL = imagesObject.getJSONObject("standard_resolution").getString("url"); } } return imageURL; }

Target:
private String getMedia(JSONObject data) { String imageURL = ""; JSONObject mediaObject; if (data.has("videos")) { mediaObject = data.getJSONObject("videos"); if (!videosObject.isNull("standard_resolution")) { imageURL = videosObject.getJSONObject("standard_resolution").getString("url"); } } else if (data.has("images")) { mediaObject = data.getJSONObject("images"); if (!imagesObject.isNull("standard_resolution")) { imageURL = imagesObject.getJSONObject("standard_resolution").getString("url"); } } return imageURL; }
Source:
public long getStorageDomainOverCommitPercent() { return storageDomainOverCommitPercent; }

Target:
public int getStorageDomainOverCommitPercent() { return storageDomainOverCommitPercent; }
Source:
protected Control createDialogArea(Composite parent) { Composite main = new Composite(parent, SWT.NONE); GridDataFactory.fillDefaults().grab(true, true).applyTo(main); main.setLayout(new GridLayout(1, false)); TreeViewer groupsViewer = new TreeViewer(main, SWT.BORDER | SWT.V_SCROLL); GridDataFactory.fillDefaults().grab(true, true) .applyTo(groupsViewer.getControl()); groupsViewer.setLabelProvider( WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider()); groupsViewer.setContentProvider( new DeleteRepositoryGroupTreeContentProvider()); groupsViewer.setInput(groupsToDelete); setTitle(UIText.RepositoriesView_RepoGroup_Delete_Title); setMessage(UIText.RepositoriesView_RepoGroup_Delete_Confirm); return main; }

Target:
protected Control createDialogArea(Composite parent) { Composite main = new Composite(parent, SWT.NONE); GridDataFactory.fillDefaults().grab(true, true).applyTo(main); main.setLayout(new GridLayout(1, false)); TreeViewer groupsViewer = new TreeViewer(main, SWT.BORDER | SWT.V_SCROLL); GridDataFactory.fillDefaults().grab(true, true) .applyTo(groupsViewer.getControl()); groupsViewer.setLabelProvider(new RepositoryTreeNodeLabelProvider()); groupsViewer.setContentProvider( new DeleteRepositoryGroupTreeContentProvider()); groupsViewer.setInput(groupsToDelete); setTitle(UIText.RepositoriesView_RepoGroup_Delete_Title); setMessage(UIText.RepositoriesView_RepoGroup_Delete_Confirm); return main; }
Source:
public Object result(@PathParam("executionId") String executionId) throws IOException, MessagingException { if (isCompleted(executionId)) { Object output = getResult(executionId); String error = getError(executionId); cleanup(executionId); if (error != null) { throw new NuxeoException(error, HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } if (output instanceof Map) { Object url = ((Map) output).get("url"); if (url instanceof String) { String baseUrl = VirtualHostHelper.getBaseURL(ctx.getRequest()); return redirect(baseUrl + url); } } return ResponseHelper.getResponse(output, request, HttpServletResponse.SC_OK); } throw new WebResourceNotFoundException("Execution with id=" + executionId + " not found"); }

Target:
public Object result(@PathParam("executionId") String executionId) throws IOException, MessagingException { if (isCompleted(executionId)) { Object output = getResult(executionId); String error = getError(executionId); cleanup(executionId); if (error != null) { throw new NuxeoException(error, HttpServletResponse.SC_INTERNAL_SERVER_ERROR); } if (output instanceof Map) { Object url = ((Map<?, ?>) output).get(RESULT_URL_KEY); if (url instanceof String) { String baseUrl = VirtualHostHelper.getBaseURL(ctx.getRequest()); return redirect(baseUrl + url); } } return ResponseHelper.getResponse(output, request, HttpServletResponse.SC_OK); } throw new WebResourceNotFoundException("Execution with id=" + executionId + " not found"); }
Source:
protected boolean containsKeyInternal(Object key) { Data keyData = toDataWithStrategy(key); int partitionId = partitionService.getPartitionId(keyData); MapOperation containsKeyOperation = operationProvider.createContainsKeyOperation(name, keyData); containsKeyOperation.setThreadId(getThreadId()); containsKeyOperation.setServiceName(SERVICE_NAME); try { Future future = operationService.invokeOnPartition(SERVICE_NAME, containsKeyOperation, partitionId); return (Boolean) toObject(future.get()); } catch (Throwable t) { throw rethrow(t); } finally { if (statisticsEnabled) { LocalMapStatsProvider localMapStatsProvider = mapServiceContext.getLocalMapStatsProvider(); localMapStatsProvider.getLocalMapStatsImpl(name).incrementOtherOperations(); } } }

Target:
protected boolean containsKeyInternal(Object key) { Data keyData = toDataWithStrategy(key); int partitionId = partitionService.getPartitionId(keyData); MapOperation containsKeyOperation = operationProvider.createContainsKeyOperation(name, keyData); containsKeyOperation.setThreadId(getThreadId()); containsKeyOperation.setServiceName(SERVICE_NAME); try { Future future = operationService.invokeOnPartition(SERVICE_NAME, containsKeyOperation, partitionId); Object object = future.get(); if (statisticsEnabled) { LocalMapStatsProvider localMapStatsProvider = mapServiceContext.getLocalMapStatsProvider(); localMapStatsProvider.getLocalMapStatsImpl(name).incrementOtherOperations(); } return (Boolean) toObject(object); } catch (Throwable t) { throw rethrow(t); } }
Source:
public NatRule(Condition condition, Action action, boolean dnat) { super(condition, action); this.dnat = dnat; if (!action.equals(Action.ACCEPT) && !action.equals(Action.CONTINUE) && !action.equals(Action.RETURN)) { throw new IllegalArgumentException("A nat rule's action " + "must be one of: ACCEPT, CONTINUE, or RETURN."); } }

Target:
public NatRule(Condition condition, Action action, boolean dnat) { super(condition, action); this.dnat = dnat; if (!action.equals(Action.ACCEPT) && !action.equals(Action.CONTINUE) && !action.equals(Action.RETURN)) throw new IllegalArgumentException("A nat rule's action " + "must be one of: ACCEPT, CONTINUE, or RETURN."); }