auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private AddressTranslator createAddressTranslator() { ClientNetworkConfig networkConfig = getClientConfig().getNetworkConfig(); ClientAwsConfig awsConfig = networkConfig.getAwsConfig(); boolean awsDiscoveryEnabled = awsConfig != null && awsConfig.isEnabled(); boolean discoverySpiEnabled = discoveryService != null; String cloudToken = properties.getString(HAZELCAST_CLOUD_TOKEN); boolean hazelcastCloudEnabled = cloudToken != null; checkForCollision(awsDiscoveryEnabled, discoverySpiEnabled, hazelcastCloudEnabled); if (awsDiscoveryEnabled) { try { return new AwsAddressTranslator(awsConfig, loggingService); } catch (NoClassDefFoundError e) { ILogger logger = loggingService.getLogger(HazelcastClient.class); logger.warning("hazelcast-aws.jar might be missing!"); throw e; } } else if (discoverySpiEnabled) { return new DiscoveryAddressTranslator(discoveryService, getProperties().getBoolean(ClientProperty.DISCOVERY_SPI_PUBLIC_IP_ENABLED)); } else if (hazelcastCloudEnabled) { return new HazelcastCloudAddressTranslator(cloudToken, loggingService); } return new DefaultAddressTranslator(); }

Target:
private AddressTranslator createAddressTranslator() { ClientNetworkConfig networkConfig = getClientConfig().getNetworkConfig(); ClientAwsConfig awsConfig = networkConfig.getAwsConfig(); List<String> addresses = networkConfig.getAddresses(); boolean addressListProvided = addresses.size() != 0; boolean awsDiscoveryEnabled = awsConfig != null && awsConfig.isEnabled(); boolean discoverySpiEnabled = discoveryService != null; String cloudToken = properties.getString(HAZELCAST_CLOUD_DISCOVERY_TOKEN); boolean hazelcastCloudEnabled = cloudToken != null; isDiscoveryConfigurationConsistent(addressListProvided, awsDiscoveryEnabled, discoverySpiEnabled, hazelcastCloudEnabled); if (awsDiscoveryEnabled) { try { return new AwsAddressTranslator(awsConfig, loggingService); } catch (NoClassDefFoundError e) { ILogger logger = loggingService.getLogger(HazelcastClient.class); logger.warning("hazelcast-aws.jar might be missing!"); throw e; } } else if (discoverySpiEnabled) { return new DiscoveryAddressTranslator(discoveryService, getProperties().getBoolean(ClientProperty.DISCOVERY_SPI_PUBLIC_IP_ENABLED)); } else if (hazelcastCloudEnabled) { return new HazelcastCloudAddressTranslator(cloudToken, getConnectionTimeoutMillis(), loggingService); } return new DefaultAddressTranslator(); }
Source:
public CallBatcherImpl(DatabaseClient client, CallManagerImpl.CallerImpl<E> caller, Class<W> inputType) { super(client.newDataMovementManager()); if (caller == null) { throw new IllegalArgumentException("null caller"); } if (inputType == null) { throw new IllegalArgumentException("null inputType"); } this.caller = caller; this.inputType = inputType; }

Target:
CallBatcherImpl(DatabaseClient client, CallManagerImpl.CallerImpl<E> caller, Class<W> inputType) { super(client.newDataMovementManager()); if (caller == null) { throw new IllegalArgumentException("null caller"); } if (inputType == null) { throw new IllegalArgumentException("null inputType"); } this.caller = caller; this.inputType = inputType; }
Source:
public void onStart(ISuite suite) { try { TestServerUtils.startServer(); } catch (Exception e) { SeLionLogger.getLogger().info(e.getMessage()); } }

Target:
public void onStart(ISuite suite) { try { TestServerUtils.startServer(); } catch (Exception e) { System.err.println(" Unable to start test server"); } }
Source:
private String evaluateMacro(Run<?, ?> build, FilePath workspace, TaskListener listener, String value) throws InterruptedException, IOException { try { return TokenMacro.expandAll(build, workspace, listener, value); } catch (MacroEvaluationException e) { log(listener, String.format("Could not evaluate macro '%s': %s", value, e.getMessage())); return value; } catch (ClassCastException e) { log(listener, String.format("ClassCastException '%s': %s", value, e.getMessage())); return value; } }

Target:
private String evaluateMacro(Run<?, ?> build, FilePath workspace, TaskListener listener, String value) throws InterruptedException, IOException { try { return TokenMacro.expandAll(build, workspace, listener, value); } catch (MacroEvaluationException e) { log(listener, String.format("Could not evaluate macro '%s': %s", value, e.getMessage())); return value; } }
Source:
protected boolean canDoAction() { if (!isVmExist()) { return false; } if (!acquireLockInternal()) { return false; } VM vm = getVm(); if (vm != null) { if (!isDiskCanBeAddedToVm(getParameters().getDiskInfo()) || !isDiskPassPciAndIdeLimit(getParameters().getDiskInfo())) { return false; } } if (DiskStorageType.IMAGE == getParameters().getDiskInfo().getDiskStorageType()) { return checkIfImageDiskCanBeAdded(vm); } if (DiskStorageType.LUN == getParameters().getDiskInfo().getDiskStorageType()) { return checkIfLunDiskCanBeAdded(); } return true; }

Target:
protected boolean canDoAction() { if (!isVmExist() || !acquireLockInternal()) { return false; } VM vm = getVm(); if (vm != null) { if (!isDiskCanBeAddedToVm(getParameters().getDiskInfo()) || !isDiskPassPciAndIdeLimit(getParameters().getDiskInfo())) { return false; } } if (DiskStorageType.IMAGE == getParameters().getDiskInfo().getDiskStorageType()) { return checkIfImageDiskCanBeAdded(vm); } if (DiskStorageType.LUN == getParameters().getDiskInfo().getDiskStorageType()) { return checkIfLunDiskCanBeAdded(); } return true; }
Source:
public void Initialize(SystemTreeItemModel systemTreeSelectedItem) { super.Initialize(systemTreeSelectedItem); new BuilderExecutor<VoidSource, UnitVmModel>( new DataCenterToUnitBuilder() ).build(new VoidSource(), getModel()); InitPriority(0); }

Target:
public void Initialize(SystemTreeItemModel systemTreeSelectedItem) { super.Initialize(systemTreeSelectedItem); AsyncDataProvider.GetDataCenterByClusterServiceList(new AsyncQuery(getModel(), new INewAsyncCallback() { @Override public void OnSuccess(Object target, Object returnValue) { UnitVmModel model = (UnitVmModel) target; ArrayList<storage_pool> list = new ArrayList<storage_pool>(); for (storage_pool a : (ArrayList<storage_pool>) returnValue) { if (a.getstatus() == StoragePoolStatus.Up) { list.add(a); } } model.SetDataCenter(model, list); } }, getModel().getHash()), true, false); InitPriority(0); }
Source:
public void setErrorsVisibility(boolean givenNameError, boolean familyNameError, boolean dayOfBirthError, boolean addressError, boolean countryError, boolean genderError, boolean countryNull, boolean stateError, boolean cityError, boolean postalError) { String emptyError = getString(R.string.emptyerror); if (givenNameError) { firstNameTIL.setErrorEnabled(true); firstNameTIL.setError(emptyError); } else { firstNameTIL.setErrorEnabled(false); } if (familyNameError) { lastNameTIL.setErrorEnabled(true); lastNameTIL.setError(emptyError); } else { lastNameTIL.setErrorEnabled(false); } if (dayOfBirthError) { doberror.setVisibility(View.VISIBLE); dateTimeFormatter = DateTimeFormat.forPattern(DateUtils.DEFAULT_DATE_FORMAT); String minimumDate = DateTime.now().minusYears( ApplicationConstants.RegisterPatientRequirements.MAX_PATIENT_AGE) .toString(dateTimeFormatter); String maximumDate = DateTime.now().toString(dateTimeFormatter); doberror.setText(getString(R.string.dob_error, minimumDate, maximumDate)); } else { doberror.setVisibility(View.GONE); } if (addressError) { address1TIL.setErrorEnabled(true); address1TIL.setError(emptyError); } else { address1TIL.setErrorEnabled(false); } if (countryError) { countryTIL.setErrorEnabled(true); countryTIL.setError(getString(R.string.incorrect_country)); } else { countryTIL.setErrorEnabled(false); } if (genderError) { gendererror.setVisibility(View.VISIBLE); } else { gendererror.setVisibility(View.GONE); } }

Target:
public void setErrorsVisibility(boolean givenNameError, boolean familyNameError, boolean dayOfBirthError, boolean addressError, boolean countryError, boolean genderError, boolean countryNull, boolean stateError, boolean cityError, boolean postalError) { if (dayOfBirthError) { doberror.setVisibility(View.VISIBLE); dateTimeFormatter = DateTimeFormat.forPattern(DateUtils.DEFAULT_DATE_FORMAT); String minimumDate = DateTime.now().minusYears( ApplicationConstants.RegisterPatientRequirements.MAX_PATIENT_AGE) .toString(dateTimeFormatter); String maximumDate = DateTime.now().toString(dateTimeFormatter); doberror.setText(getString(R.string.dob_error, minimumDate, maximumDate)); } else { doberror.setVisibility(View.GONE); } if (genderError) { gendererror.setVisibility(View.VISIBLE); } else { gendererror.setVisibility(View.GONE); } }
Source:
public void rewrite(Exchange exchange) throws IOException { try { Message httpMessage = exchange.getIn(); if (httpMessage != null) { Object body = httpMessage.getBody(); if (body != null) { String bodyStr; if (httpMessage.getBody() instanceof InputStream) { bodyStr = IOUtils.toString((InputStream) httpMessage.getBody()); } else if (httpMessage.getBody() instanceof String) { bodyStr = (String) httpMessage.getBody(); } else { bodyStr = httpMessage.getBody().toString(); } String queryString = (String) httpMessage.getHeader(Exchange.HTTP_QUERY); String httpUri = (String) httpMessage.getHeader(Exchange.HTTP_URI); if ("wsdl".equalsIgnoreCase(queryString) || "_wadl" .equalsIgnoreCase(queryString) || httpUri.equals(cxfContext)) { bodyStr = bodyStr.replaceAll("<wsp:PolicyReference.+?/>", ""); bodyStr = bodyStr .replaceAll("<wsp:Policy [\\S\\s]*.+?</wsp:Policy>", ""); bodyStr = bodyStr.replaceAll("https://" + host + ":" + httpsPort, "http://" + host + ":" + httpPort); } exchange.getIn().setBody(bodyStr); } } } catch (Exception e) { LOGGER.error("Exception occurred while processing policy removal bean.", e); } }

Target:
public void rewrite(Exchange exchange) throws IOException { try { Message httpMessage = exchange.getIn(); if (httpMessage != null) { Object body = httpMessage.getBody(); if (body != null) { String bodyStr; if (body instanceof InputStream) { bodyStr = IOUtils.toString((InputStream) body); } else if (body instanceof String) { bodyStr = (String) body; } else { bodyStr = body.toString(); } String queryString = (String) httpMessage.getHeader(Exchange.HTTP_QUERY); String httpUri = (String) httpMessage.getHeader(Exchange.HTTP_URI); if ("wsdl".equalsIgnoreCase(queryString) || "_wadl" .equalsIgnoreCase(queryString) || httpUri.equals(cxfContext)) { bodyStr = bodyStr.replaceAll("<wsp:PolicyReference.+?/>", ""); bodyStr = bodyStr .replaceAll("<wsp:Policy [\\S\\s]*.+?</wsp:Policy>", ""); bodyStr = bodyStr.replaceAll("https://" + host + ":" + httpsPort, "http://" + host + ":" + httpPort); } exchange.getIn().setBody(bodyStr); } } } catch (Exception e) { LOGGER.error("Exception occurred while processing policy removal bean.", e); } }
Source:
protected Map<String, String> createPortAllocationRuntimeProperties(Port port) { Map<String, String> runtimeProperties = super.createPortAllocationRuntimeProperties(port); runtimeProperties.put("plugin_type", ((OpenstackNetworkProviderProperties) provider.getAdditionalProperties()).getPluginType()); return runtimeProperties; }

Target:
protected Map<String, String> createPortAllocationRuntimeProperties(Port port) { Map<String, String> runtimeProperties = super.createPortAllocationRuntimeProperties(port); runtimeProperties.put("plugin_type", provider.getAdditionalProperties().getPluginType()); return runtimeProperties; }
Source:
public void adminsShouldBeUnableToChangeTokensByDefault() throws Exception { j.jenkins.setCrumbIssuer(null); j.jenkins.setSecurityRealm(j.createDummySecurityRealm()); User foo = User.get("foo"); User bar = User.get("bar"); final ApiTokenProperty t = foo.getProperty(ApiTokenProperty.class); final ApiTokenProperty.DescriptorImpl descriptor = (ApiTokenProperty.DescriptorImpl) t.getDescriptor(); WebClient wc = createClientForUser("bar"); wc.getOptions().setThrowExceptionOnFailingStatusCode(false); HtmlPage requirePOST = wc.goTo(foo.getUrl() + "/" + descriptor.getDescriptorUrl()+ "/changeToken"); assertEquals("method should not be allowed", 405, requirePOST.getWebResponse().getStatusCode()); wc.getOptions().setThrowExceptionOnFailingStatusCode(true); WebRequest request = new WebRequest(new URL(j.getURL().toString() + foo.getUrl() + "/" + descriptor.getDescriptorUrl()+ "/changeToken"), HttpMethod.POST); HtmlPage res = wc.getPage(request); assertEquals("Update token response is incorrect", Messages.ApiTokenProperty_ChangeToken_SuccessHidden(), "<div>" + res.getBody().asText() + "</div>"); }

Target:
public void adminsShouldBeUnableToChangeTokensByDefault() throws Exception { j.jenkins.setSecurityRealm(j.createDummySecurityRealm()); User foo = User.get("foo"); User bar = User.get("bar"); final ApiTokenProperty t = foo.getProperty(ApiTokenProperty.class); final ApiTokenProperty.DescriptorImpl descriptor = (ApiTokenProperty.DescriptorImpl) t.getDescriptor(); WebClient wc = createClientForUser("bar"); wc.getOptions().setThrowExceptionOnFailingStatusCode(false); HtmlPage requirePOST = wc.goTo(foo.getUrl() + "/" + descriptor.getDescriptorUrl()+ "/changeToken"); assertEquals("method should not be allowed", 405, requirePOST.getWebResponse().getStatusCode()); wc.getOptions().setThrowExceptionOnFailingStatusCode(true); WebRequest request = new WebRequest(new URL(j.getURL().toString() + foo.getUrl() + "/" + descriptor.getDescriptorUrl()+ "/changeToken"), HttpMethod.POST); HtmlPage res = wc.getPage(request); assertEquals("Update token response is incorrect", Messages.ApiTokenProperty_ChangeToken_SuccessHidden(), "<div>" + res.getBody().asText() + "</div>"); }
Source:
public String decrypt(EncryptedSecret encryptedSecret) throws SecretDecryptionException { String fileUri = encryptedSecret.getParams().get(STORAGE_FILE_URI); String key = encryptedSecret.getParams().get(STORAGE_PROP_KEY); InputStream is = null; try { if (key == null || !cache.containsKey(fileUri)) { is = downloadRemoteFile(encryptedSecret); } if (key == null) { return new String(readAll(is)); } if (!cache.containsKey(fileUri)) { parseAsYaml(fileUri, is); } return getParsedValue(fileUri, key); } catch (IOException e) { throw new SecretDecryptionException(e); } finally { if (is != null) { try { is.close(); } catch (IOException e) } } }

Target:
public String decrypt(EncryptedSecret encryptedSecret) { String fileUri = encryptedSecret.getParams().get(STORAGE_FILE_URI); String key = encryptedSecret.getParams().get(STORAGE_PROP_KEY); InputStream is = null; try { if (key == null || !cache.containsKey(fileUri)) { is = downloadRemoteFile(encryptedSecret); } if (key == null) { return new String(readAll(is)); } if (!cache.containsKey(fileUri)) { parseAsYaml(fileUri, is); } return getParsedValue(fileUri, key); } catch (IOException e) { throw new SecretDecryptionException(e); } finally { if (is != null) { try { is.close(); } catch (IOException e) } } }
Source:
private RecordWriter<Long, SinkRecord> getWriter(TopicPartition topicPart, SinkRecord record) throws CopycatException { try { if (writers.containsKey(topicPart)) return writers.get(topicPart); String fileName = FileUtils.tempFileName(url, topicsDir, topicPart); Path path = new Path(fileName); if (fs.exists(path)) { log.info("Deleting temp files {}", path); fs.delete(path, false); } RecordWriter<Long, SinkRecord> writer = writerProviderClass.newInstance(). getRecordWriter(conf, fileName, record); writers.put(topicPart, writer); recordCounters.put(topicPart, 0); return writer; } catch (IllegalAccessException e) { throw new CopycatRuntimeException(e); } catch (InstantiationException e) { throw new CopycatRuntimeException(e); } catch (IOException e) { throw new CopycatRuntimeException(e); } }

Target:
private RecordWriter<Long, SinkRecord> getWriter(TopicPartition topicPart, SinkRecord record) throws CopycatException { try { if (writers.containsKey(topicPart)) return writers.get(topicPart); String fileName = FileUtils.tempFileName(url, topicsDir, topicPart); Path path = new Path(fileName); if (fs.exists(path)) { log.info("Deleting uncommited file {}", fileName); fs.delete(path, false); } RecordWriter<Long, SinkRecord> writer = writerProviderClass.newInstance(). getRecordWriter(conf, fileName, record); writers.put(topicPart, writer); recordCounters.put(topicPart, 0); return writer; } catch (IllegalAccessException e) { throw new CopycatRuntimeException(e); } catch (InstantiationException e) { throw new CopycatRuntimeException(e); } catch (IOException e) { throw new CopycatRuntimeException(e); } }
Source:
public void onComplete() { s = SubscriptionHelper.CANCELLED; if (index <= count && !done) { done = true; if (defaultValue != null) { actual.onSuccess(defaultValue); } else { actual.onError(new NoSuchElementException()); } } }

Target:
public void onComplete() { s = SubscriptionHelper.CANCELLED; if (index <= count && !done) { done = true; T v = defaultValue; if (v != null) { actual.onSuccess(v); } else { actual.onError(new NoSuchElementException()); } } }
Source:
private void registerLeaderElectionService(TimeLockServerConfiguration configuration) { remoteServers = getRemoteServerPaths(configuration); LeaderConfig leaderConfig = getLeaderConfig(configuration); Set<String> paxosSubresourceUris = PaxosTimeLockUriUtils.getLeaderPaxosUris(remoteServers); Leaders.LocalPaxosServices localPaxosServices = Leaders.createLocalServices( leaderConfig, ImmutableRemotePaxosServerSpec.builder() .remoteLeaderUris(remoteServers) .remoteAcceptorUris(paxosSubresourceUris) .remoteLearnerUris(paxosSubresourceUris) .build()); leaderElectionService = localPaxosServices.leaderElectionService(); environment.jersey().register(leaderElectionService); environment.jersey().register(new LeadershipResource( localPaxosServices.ourAcceptor(), localPaxosServices.ourLearner())); environment.jersey().register(new NotCurrentLeaderExceptionMapper()); }

Target:
private void registerLeaderElectionService(TimeLockServerConfiguration configuration) { remoteServers = getRemoteServerPaths(configuration); LeaderConfig leaderConfig = getLeaderConfig(configuration); Set<String> paxosSubresourceUris = PaxosTimeLockUriUtils.getLeaderPaxosUris(remoteServers); Leaders.LocalPaxosServices localPaxosServices = Leaders.createLocalServices( leaderConfig, ImmutableRemotePaxosServerSpec.builder() .remoteLeaderUris(remoteServers) .remoteAcceptorUris(paxosSubresourceUris) .remoteLearnerUris(paxosSubresourceUris) .build()); leaderElectionService = localPaxosServices.leaderElectionService(); environment.jersey().register(leaderElectionService); environment.jersey().register(new LeadershipResource( localPaxosServices.ourAcceptor(), localPaxosServices.ourLearner())); }
Source:
protected EPersonRest createAndReturn(Context context) throws AuthorizeException { HttpServletRequest req = getRequestService().getCurrentRequest().getHttpServletRequest(); ObjectMapper mapper = new ObjectMapper(); EPersonRest mock = null; try { mock = mapper.readValue(req.getInputStream(), EPersonRest.class); } catch (IOException e1) { throw new UnprocessableEntityException("error parsing the body... maybe this is not the right error code"); } EPerson eperson = null; try { eperson = es.create(context); eperson.setCanLogIn(mock.isCanLogIn()); eperson.setRequireCertificate(mock.isRequireCertificate()); eperson.setEmail(mock.getEmail()); eperson.setNetid(mock.getNetid()); if (mock.getPassword() != null) { es.setPassword(eperson, mock.getPassword()); } es.update(context, eperson); if (mock.getMetadata() != null) { for (MetadataEntryRest mer : mock.getMetadata()) { String[] metadatakey = mer.getKey().split("\\."); es.addMetadata(context, eperson, metadatakey[0], metadatakey[1], metadatakey.length == 3 ? metadatakey[2] : null, mer.getLanguage(), mer.getValue()); } } } catch (SQLException e) { throw new RuntimeException(e.getMessage(), e); } return converter.convert(eperson); }

Target:
protected EPersonRest createAndReturn(Context context) throws AuthorizeException { HttpServletRequest req = getRequestService().getCurrentRequest().getHttpServletRequest(); ObjectMapper mapper = new ObjectMapper(); EPersonRest epersonRest = null; try { epersonRest = mapper.readValue(req.getInputStream(), EPersonRest.class); } catch (IOException e1) { throw new UnprocessableEntityException("error parsing the body... maybe this is not the right error code"); } EPerson eperson = null; try { eperson = es.create(context); eperson.setCanLogIn(epersonRest.isCanLogIn()); eperson.setRequireCertificate(epersonRest.isRequireCertificate()); eperson.setEmail(epersonRest.getEmail()); eperson.setNetid(epersonRest.getNetid()); if (epersonRest.getPassword() != null) { es.setPassword(eperson, epersonRest.getPassword()); } es.update(context, eperson); if (epersonRest.getMetadata() != null) { for (MetadataEntryRest mer : epersonRest.getMetadata()) { String[] metadatakey = mer.getKey().split("\\."); es.addMetadata(context, eperson, metadatakey[0], metadatakey[1], metadatakey.length == 3 ? metadatakey[2] : null, mer.getLanguage(), mer.getValue()); } } } catch (SQLException e) { throw new RuntimeException(e.getMessage(), e); } return converter.convert(eperson); }
Source:
public void testSTEquals() throws Exception { assertQuery("select ST_Equals(ST_GeometryFromText('LineString(0 0, 2 2)'), ST_GeometryFromText('LineString(0 0, 2 2)'))", "select true"); assertQuery("select ST_Equals(ST_GeometryFromText('LineString(0 0, 2 2)'), ST_GeometryFromText('LineString(0 0, 2 2)'))", "select true"); }

Target:
public void testSTEquals() throws Exception { assertFunction("ST_Equals(ST_GeometryFromText('POINT (50 100)'), ST_GeometryFromText('POINT (150 150)'))", BOOLEAN, false); assertFunction("ST_Equals(ST_GeometryFromText('MULTIPOINT (50 100, 50 200)'), ST_GeometryFromText('POINT (50 100)'))", BOOLEAN, false); assertFunction("ST_Equals(ST_GeometryFromText('LINESTRING (0 0, 0 1)'), ST_GeometryFromText('LINESTRING (1 1, 1 0)'))", BOOLEAN, false); assertFunction("ST_Equals(ST_GeometryFromText('LINESTRING (0 0, 2 2)'), ST_GeometryFromText('LINESTRING (0 0, 2 2)'))", BOOLEAN, true); assertFunction("ST_Equals(ST_GeometryFromText('MULTILINESTRING ((1 1, 5 1), (2 4, 4 4))'), ST_GeometryFromText('MULTILINESTRING ((3 4, 6 4), (5 0, 5 4))'))", BOOLEAN, false); assertFunction("ST_Equals(ST_GeometryFromText('POLYGON ((1 1, 1 3, 3 3, 3 1))'), ST_GeometryFromText('POLYGON ((3 3, 3 1, 1 1, 1 3))'))", BOOLEAN, true); assertFunction("ST_Equals(ST_GeometryFromText('MULTIPOLYGON (((1 1, 1 3, 3 3, 3 1)), ((0 0, 0 2, 2 2, 2 0)))'), ST_GeometryFromText('POLYGON ((0 1, 3 1, 3 3, 0 3))'))", BOOLEAN, false); }
Source:
public void testWebMessageListenerReplyProxyIsIsomorphic() throws Exception { WebkitUtils.checkFeature(WebViewFeature.WEB_MESSAGE_LISTENER); mWebViewOnUiThread.addWebMessageListener(JS_OBJECT_NAME, new ArrayList<String>() { { add("*"); } }, mListener); loadPage(BASIC_USAGE); TestWebMessageListener.Data data = mListener.waitForOnPostMessage(); Assert.assertEquals("hello", data.mMessage.getData()); mWebViewOnUiThread.evaluateJavascript(JS_OBJECT_NAME + ".postMessage('hello again')", null); TestWebMessageListener.Data data2 = mListener.waitForOnPostMessage(); Assert.assertEquals(data.mReplyProxy, data2.mReplyProxy); }

Target:
public void testWebMessageListenerReplyProxyIsIsomorphic() throws Exception { mWebViewOnUiThread.addWebMessageListener(JS_OBJECT_NAME, new ArrayList<String>() { { add("*"); } }, mListener); loadPage(BASIC_USAGE); TestWebMessageListener.Data data = mListener.waitForOnPostMessage(); Assert.assertEquals("hello", data.mMessage.getData()); mWebViewOnUiThread.evaluateJavascript(JS_OBJECT_NAME + ".postMessage('hello again')", null); TestWebMessageListener.Data data2 = mListener.waitForOnPostMessage(); Assert.assertSame(data.mReplyProxy, data2.mReplyProxy); }
Source:
private List<IgniteEx> startGrids(int cnt, boolean client) { return Stream.generate(() -> { try { return client ? startClientGrid(gridNum.getAndIncrement()) : startGrid(gridNum.getAndIncrement()); } catch (Exception e) { throw new RuntimeException(e); } }).limit(cnt).collect(Collectors.toList()); }

Target:
private List<IgniteEx> startGrids(int cnt, boolean client) throws Exception { List<IgniteEx> grids = new ArrayList<>(cnt); for (int i = 0; i < cnt; ++i) grids.add(client ? startClientGrid(gridNum++) : startGrid(gridNum++)); return grids; }
Source:
public boolean contains(double lat, double lon) { return polygon.contains(factory.createPoint(new Coordinate(lon, lat))); }

Target:
public boolean contains(double lat, double lon) { return prepPolygon.contains(factory.createPoint(new Coordinate(lon, lat))); }
Source:
public void testStatsNoStreaming() throws InterruptedException, IOException { TimeUnit.SECONDS.sleep(1); CountDownLatch countDownLatch = new CountDownLatch(NUM_STATS); String containerName = "generated_" + new SecureRandom().nextInt(); CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox").withCmd("top") .withName(containerName).exec(); LOG.info("Created container {}", container.toString()); assertThat(container.getId(), not(isEmptyString())); dockerRule.getClient().startContainerCmd(container.getId()).exec(); StatsCallbackTest statsCallback = dockerRule.getClient().statsCmd(container.getId()).withNoStream(true).exec( new StatsCallbackTest(countDownLatch)); countDownLatch.await(5, TimeUnit.SECONDS); Boolean gotStats = statsCallback.gotStats(); LOG.info("Stop stats collection"); statsCallback.close(); LOG.info("Stopping container"); dockerRule.getClient().stopContainerCmd(container.getId()).exec(); dockerRule.getClient().removeContainerCmd(container.getId()).exec(); LOG.info("Completed test"); assertTrue("Expected true", gotStats); assertEquals("Expected stats called only once", countDownLatch.getCount(), NUM_STATS - 1); }

Target:
public void testStatsNoStreaming() throws InterruptedException, IOException { CountDownLatch countDownLatch = new CountDownLatch(NUM_STATS); CreateContainerResponse container = dockerRule.getClient().createContainerCmd("busybox").withCmd("top").exec(); dockerRule.getClient().startContainerCmd(container.getId()).exec(); try (StatsCallbackTest statsCallback = dockerRule.getClient().statsCmd(container.getId()).withNoStream(true).exec( new StatsCallbackTest(countDownLatch))) { countDownLatch.await(5, TimeUnit.SECONDS); LOG.info("Stop stats collection"); } LOG.info("Stopping container"); dockerRule.getClient().stopContainerCmd(container.getId()).exec(); dockerRule.getClient().removeContainerCmd(container.getId()).exec(); LOG.info("Completed test"); assertEquals("Expected stats called only once", countDownLatch.getCount(), NUM_STATS - 1); }
Source:
public void subscribe(CoreSubscriber<? super Payload> actual) { long previousState = markSubscribed(STATE, this); if (isSubscribed(previousState) || isTerminated(previousState)) { Operators.error( actual, new IllegalStateException("RequestResponseMono allows only a single Subscriber")); return; } final Payload p = this.payload; try { if (!isValid(this.mtu, this.maxFrameLength, p, false)) { lazyTerminate(STATE, this); Operators.error( actual, new IllegalArgumentException( String.format(INVALID_PAYLOAD_ERROR_MESSAGE, this.maxFrameLength))); p.release(); return; } } catch (IllegalReferenceCountException e) { lazyTerminate(STATE, this); Operators.error(actual, e); return; } this.actual = actual; actual.onSubscribe(this); }

Target:
public void subscribe(CoreSubscriber<? super Payload> actual) { long previousState = markSubscribed(STATE, this); if (isSubscribedOrTerminated(previousState)) { Operators.error( actual, new IllegalStateException("RequestResponseMono allows only a single Subscriber")); return; } final Payload p = this.payload; try { if (!isValid(this.mtu, this.maxFrameLength, p, false)) { lazyTerminate(STATE, this); Operators.error( actual, new IllegalArgumentException( String.format(INVALID_PAYLOAD_ERROR_MESSAGE, this.maxFrameLength))); p.release(); return; } } catch (IllegalReferenceCountException e) { lazyTerminate(STATE, this); Operators.error(actual, e); return; } this.actual = actual; actual.onSubscribe(this); }
Source:
private boolean isChildOfOrEqualToAnyFolder(IResource resource) { for (IPackageFragment fPackageFragment : fPackageFragments) { IFolder folder= (IFolder) fPackageFragment.getResource(); if (folder.equals(resource) || ParentChecker.isDescendantOf(resource, folder)) return true; } return false; }

Target:
private boolean isChildOfOrEqualToAnyFolder(IResource resource) { for (IPackageFragment pack : fPackageFragments) { IFolder folder= (IFolder) pack.getResource(); if (folder.equals(resource) || ParentChecker.isDescendantOf(resource, folder)) return true; } return false; }
Source:
public RemoteCacheKey(String cacheName, boolean forceReturnValue) { this.cacheName = cacheName; this.forceReturnValue = forceReturnValue; }

Target:
RemoteCacheKey(String cacheName, boolean forceReturnValue) { this.cacheName = cacheName; this.forceReturnValue = forceReturnValue; }
Source:
protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); addBackButtonToActionBar(this); Intent intent = getIntent(); if (intent != null && intent.hasExtra(EXTRA_PREF_TYPE)) { String prefType = intent.getStringExtra(EXTRA_PREF_TYPE); CommCarePreferenceFragment commCarePreferenceFragment; switch (prefType) { case PREF_TYPE_COMMCARE: commCarePreferenceFragment = new CommCarePreferences(); break; case PREF_TYPE_SERVER: commCarePreferenceFragment = new CommCareServerPreferences(); break; case PREF_TYPE_DEVELOPER: commCarePreferenceFragment = new DeveloperPreferences(); break; case PREF_TYPE_ADVANCED_ACTIONS: commCarePreferenceFragment = new AdvancedActionsPreferences(); break; case PREF_TYPE_FORM_ENTRY: commCarePreferenceFragment = new FormEntryPreferences(); break; case PREF_TYPE_APP_MANAGER_ADVANCED: commCarePreferenceFragment = new AppManagerAdvancedPreferences(); break; default: throw new IllegalStateException("Invalid prefType : " + prefType); } assert commCarePreferenceFragment != null; getSupportFragmentManager().beginTransaction() .replace(android.R.id.content, commCarePreferenceFragment) .commit(); } else { throw new IllegalStateException("Must pass an intent with key extra_pref_type to " + CommCarePreferenceActivity.class.getSimpleName()); } }

Target:
protected void onCreate(@Nullable Bundle savedInstanceState) { super.onCreate(savedInstanceState); addBackButtonToActionBar(this); Intent intent = getIntent(); if (intent != null && intent.hasExtra(EXTRA_PREF_TYPE)) { String prefType = intent.getStringExtra(EXTRA_PREF_TYPE); CommCarePreferenceFragment commCarePreferenceFragment; switch (prefType) { case PREF_TYPE_COMMCARE: commCarePreferenceFragment = new CommCarePreferences(); break; case PREF_TYPE_SERVER: commCarePreferenceFragment = new CommCareServerPreferences(); break; case PREF_TYPE_DEVELOPER: commCarePreferenceFragment = new DeveloperPreferences(); break; case PREF_TYPE_ADVANCED_ACTIONS: commCarePreferenceFragment = new AdvancedActionsPreferences(); break; case PREF_TYPE_FORM_ENTRY: commCarePreferenceFragment = new FormEntryPreferences(); break; case PREF_TYPE_APP_MANAGER_ADVANCED: commCarePreferenceFragment = new AppManagerAdvancedPreferences(); break; default: throw new IllegalStateException("Invalid prefType : " + prefType); } getSupportFragmentManager().beginTransaction() .replace(android.R.id.content, commCarePreferenceFragment) .commit(); } else { throw new IllegalStateException("Must pass an intent with key extra_pref_type to " + CommCarePreferenceActivity.class.getSimpleName()); } }
Source:
public Iterable<Engine> getEngines() { Optional<org.wildfly.extension.undertow.Server> found = Optional.empty(); for (org.wildfly.extension.undertow.Server server : this.service.getServers()) { if (server.getName().equals(this.service.getDefaultServer())) { found = Optional.of(server); break; } } org.wildfly.extension.undertow.Server defaultServer = found.get(); return Collections.singleton(new UndertowEngine(defaultServer, this.service, this.connector)); }

Target:
public Iterable<Engine> getEngines() { for (org.wildfly.extension.undertow.Server server : service.getServers()) { if (server.getName().equals(service.getDefaultServer())) { return Collections.singleton(new UndertowEngine(server, service, connector)); } } throw new IllegalStateException(); }
Source:
public OIDC getOIDCManager(){ if(oidcManager == null){ oidcManager = new OIDC(); } return oidcManager; }

Target:
public OIDC getOIDCManager(){ return oidcManager; }
Source:
public ChromaticOrrery(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{7}"); this.addSuperType(SuperType.LEGENDARY); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ChromaticOrreryEffect())); this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.ColorlessMana(5), new TapSourceCost())); Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardForEachColorAmongControlledPermanentsEffect(), new GenericManaCost(5)); ability.addCost(new TapSourceCost()); this.addAbility(ability); }

Target:
public ChromaticOrrery(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{7}"); this.addSuperType(SuperType.LEGENDARY); this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ChromaticOrreryEffect())); this.addAbility(new SimpleManaAbility(Zone.BATTLEFIELD, Mana.ColorlessMana(5), new TapSourceCost())); Ability ability = new SimpleActivatedAbility(new DrawCardForEachColorAmongControlledPermanentsEffect(), new GenericManaCost(5)); ability.addCost(new TapSourceCost()); this.addAbility(ability); }
Source:
public static Map<String, Metric> getMetrics() { Map<String, Metric> metrics = new HashMap<>(); metrics.put(CLASSNAME + MetricsAware.KEY_REGEX + PROCESSED_EVENT_COUNT, new Counter()); metrics.put(CLASSNAME + MetricsAware.KEY_REGEX + PROCESSED_TXNS_COUNT, new Counter()); return metrics; }

Target:
public static Map<String, Metric> getMetrics() { Map<String, Metric> metrics = new HashMap<>(); metrics.put(CLASSNAME + MetricsAware.KEY_REGEX + PROCESSED_EVENT_COUNT, new Counter()); metrics.put(CLASSNAME + MetricsAware.KEY_REGEX + PROCESSED_TXNS_COUNT, new Counter()); return Collections.unmodifiableMap(metrics); }
Source:
public MarketHistory(Market m) { super(); this.m = m; history = new HashMap<String, List<Double>>(); }

Target:
public MarketHistory(Market m) { super(); this.market = m; marketHistory = new HashMap<String, List<Double>>(); }
Source:
public List<Location> getLocationsByType(final Integer type, final String programUUID) throws MiddlewareQueryException { return this.getAllByMethod(this.getLocationDao(), GET_BY_TYPE, new Object[] { type, programUUID }, new Class[] { Integer.class, String.class }); }

Target:
public List<Location> getLocationsByType(final Integer type, final String programUUID) throws MiddlewareQueryException { return this.getAllByMethod(this.getLocationDao(), LocationDataManagerImpl.GET_BY_TYPE, new Object[] { type, programUUID }, new Class[] { Integer.class, String.class }); }
Source:
private GlusterVolumeAdvancedDetails fetchAdvancedDetails(String volumeName) { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterVolumeAdvancedDetails, new GlusterVolumeAdvancedDetailsVDSParameters(getUpServerId(), clusterId, volumeName, brick.getQualifiedName(), detailRequired)); return (GlusterVolumeAdvancedDetails) returnValue.getReturnValue(); }

Target:
private GlusterVolumeAdvancedDetails fetchAdvancedDetails(String volumeName) { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterVolumeAdvancedDetails, new GlusterVolumeAdvancedDetailsVDSParameters(getUpServerId(), clusterId, volumeName, brick == null ? null : brick.getQualifiedName(), detailRequired)); return (GlusterVolumeAdvancedDetails) returnValue.getReturnValue(); }
Source:
protected PullWithOptionsAction() { super(ActionCommands.PULL_WITH_OPTIONS, new PullWithOptionsActionHandler()); }

Target:
public PullWithOptionsAction() { super(ActionCommands.PULL_WITH_OPTIONS, new PullWithOptionsActionHandler()); }
Source:
public void testImportUnrelatedUACWhilePushing() throws Exception { System.out.println("Schema changes that don't affect importers should not result in importer restarts."); CountDownLatch dataGenerationAwaiter = asyncPushDataToImporters(4000, 3); applySchemaChange("CREATE TABLE nudge(id integer);"); Thread.sleep(200); applySchemaChange("CREATE PROCEDURE NudgeThatDB AS INSERT INTO nudge VALUES (?);"); Thread.sleep(1000); applySchemaChange("DROP PROCEDURE NudgeThatDB;"); Thread.sleep(200); applySchemaChange("DROP TABLE nudge;"); dataGenerationAwaiter.await(); verifyData(m_client, 12000); }

Target:
public void testImportUnrelatedUACWhilePushing() throws Exception { System.out.println("Schema changes that don't affect importers should not result in importer restarts."); asyncPushDataToImporters(0, 3); applySchemaChange("CREATE TABLE nudge(id integer);"); applySchemaChange("CREATE PROCEDURE NudgeThatDB AS INSERT INTO nudge VALUES (?);"); applySchemaChange("DROP PROCEDURE NudgeThatDB;"); applySchemaChange("DROP TABLE nudge;"); waitForData(); }
Source:
@Override public void openTestPlayerPicker() { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); final String[] file_types = PlayerTestConstants.FILE_TYPES; builder.setTitle("Player Tests") .setNegativeButton("Cancel", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int index) { dialogInterface.dismiss(); } }) .setSingleChoiceItems(file_types, -1, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int index) { dialogInterface.dismiss(); presenter.debugVideoSelected(index); } }); builder.show(); }

Target:
@Override public void openTestPlayerPicker() { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); final String[] file_types = PlayerTestConstants.FILE_TYPES; builder.setTitle(R.string.overview_player_test) .setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int index) { dialogInterface.dismiss(); } }) .setSingleChoiceItems(file_types, -1, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int index) { dialogInterface.dismiss(); presenter.debugVideoSelected(index); } }); builder.show(); }
Source:
public static List<Granularity> granularitiesFinerThan(final Granularity gran0) { final DateTime epoch = new DateTime(0); final List<Granularity> retVal = Lists.newArrayList(); final DateTime origin = (gran0 instanceof PeriodGranularity) ? ((PeriodGranularity) gran0).getOrigin() : null; final DateTimeZone tz = (gran0 instanceof PeriodGranularity) ? ((PeriodGranularity) gran0).getTimeZone() : null; for (GranularityType gran : GranularityType.values()) { if (gran == GranularityType.ALL || gran == GranularityType.NONE) { continue; } final Granularity segmentGranularity = GranularityType.createGranularity(gran.name(), origin, tz); if (segmentGranularity.bucket(epoch).toDurationMillis() <= gran0.bucket(epoch).toDurationMillis()) { retVal.add(segmentGranularity); } } Collections.sort( retVal, new Comparator<Granularity>() { @Override public int compare(Granularity g1, Granularity g2) { return Longs.compare(g2.bucket(epoch).toDurationMillis(), g1.bucket(epoch).toDurationMillis()); } } ); return retVal; }

Target:
public static List<Granularity> granularitiesFinerThan(final Granularity gran0) { final DateTime epoch = new DateTime(0); final List<Granularity> retVal = Lists.newArrayList(); final DateTime origin = (gran0 instanceof PeriodGranularity) ? ((PeriodGranularity) gran0).getOrigin() : null; final DateTimeZone tz = (gran0 instanceof PeriodGranularity) ? ((PeriodGranularity) gran0).getTimeZone() : null; for (GranularityType gran : GranularityType.values()) { if (gran == GranularityType.ALL || gran == GranularityType.NONE) { continue; } final Granularity segmentGranularity = gran.create(origin, tz); if (segmentGranularity.bucket(epoch).toDurationMillis() <= gran0.bucket(epoch).toDurationMillis()) { retVal.add(segmentGranularity); } } Collections.sort( retVal, new Comparator<Granularity>() { @Override public int compare(Granularity g1, Granularity g2) { return Longs.compare(g2.bucket(epoch).toDurationMillis(), g1.bucket(epoch).toDurationMillis()); } } ); return retVal; }
Source:
public void send(final Pooled<ByteBuffer> pooled, final boolean close) { connection.getIoThread().execute(() -> { synchronized (queue) { XnioExecutor.Key heartKey1 = RemoteWriteListener.this.heartKey; if (heartKey1 != null) heartKey1.remove(); if (closed) { pooled.free(); return; } if (close) { closed = true; } boolean free = true; try { final SaslWrapper wrapper = saslWrapper; if (wrapper != null) { final ByteBuffer buffer = pooled.getResource(); final ByteBuffer source = buffer.duplicate(); buffer.clear(); wrapper.wrap(buffer, source); buffer.flip(); } final boolean empty = queue.isEmpty(); queue.add(pooled); free = false; if (empty) { connection.getIoThread().execute(flushTask); } } catch (IOException e) { handleException(e, false); Pooled<ByteBuffer> unqueued; while ((unqueued = queue.poll()) != null) { unqueued.free(); } } finally { if (free) { pooled.free(); } } } }); }

Target:
public void send(final Pooled<ByteBuffer> pooled, final boolean close) { connection.getIoThread().execute(() -> { synchronized (queue) { this.expireTime = System.currentTimeMillis() + heartbeatInterval; if (closed) { pooled.free(); return; } if (close) { closed = true; } boolean free = true; try { final SaslWrapper wrapper = saslWrapper; if (wrapper != null) { final ByteBuffer buffer = pooled.getResource(); final ByteBuffer source = buffer.duplicate(); buffer.clear(); wrapper.wrap(buffer, source); buffer.flip(); } final boolean empty = queue.isEmpty(); queue.add(pooled); free = false; if (empty) { connection.getIoThread().execute(flushTask); } } catch (IOException e) { handleException(e, false); Pooled<ByteBuffer> unqueued; while ((unqueued = queue.poll()) != null) { unqueued.free(); } } finally { if (free) { pooled.free(); } } } }); }
Source:
public void addEvents(List<IEventDeclaration> events) throws CTFReaderException { if (fEvents != Collections.EMPTY_LIST) { throw new CTFReaderException("Cannot add to an already populated list"); } fEvents = ImmutableList.<IEventDeclaration> copyOf(events); }

Target:
public void addEvents(List<IEventDeclaration> events) throws CTFReaderException { if (fEvents != Collections.EMPTY_LIST) { ImmutableList.Builder<IEventDeclaration> builder = new ImmutableList.Builder<>(); int i = 0; for (; i < fEvents.size(); i++) { if ((events.size() > i)) { if (fEvents.get(i) == UNASSIGNED) { builder.add(events.get(i)); } else if (events.get(i) != UNASSIGNED) { throw new CTFReaderException("Both lists have an event defined at position " + i); } } else { builder.add(fEvents.get(i)); } } if (i < events.size()) { builder.addAll(events.subList(i, events.size())); } fEvents = builder.build(); } else { fEvents = ImmutableList.<IEventDeclaration> copyOf(events); } }
Source:
public void exportCSV() { Toast.makeText(this, R.string.txt_exporting_history, Toast.LENGTH_LONG).show(); String baseDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath(); Log.d("dir", baseDir); String fileName = "exportHistoryOFF" + new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(new Date()) + ".csv"; String filePath = baseDir + File.separator + fileName; File f = new File(filePath); CSVWriter writer; FileWriter fileWriter; try { if (f.exists() && !f.isDirectory()) { fileWriter = new FileWriter(filePath, true); writer = new CSVWriter(fileWriter); } else { writer = new CSVWriter(new FileWriter(filePath)); } String[] headers = res.getStringArray(R.array.headers); writer.writeNext(headers); List<HistoryProduct> listHistoryProducts = mHistoryProductDao.loadAll(); for (HistoryProduct hp : listHistoryProducts) { String[] line = {hp.getBarcode(), hp.getTitle(), hp.getBrands()}; writer.writeNext(line); } writer.close(); Toast.makeText(this, R.string.txt_history_exported, Toast.LENGTH_LONG).show(); } catch (IOException e) { e.printStackTrace(); } }

Target:
public void exportCSV() { Toast.makeText(this, R.string.txt_exporting_history, Toast.LENGTH_LONG).show(); String baseDir = Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS).getAbsolutePath(); Log.d("dir", baseDir); String fileName = "exportHistoryOFF" + new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss").format(new Date()) + ".csv"; String filePath = baseDir + File.separator + fileName; File f = new File(filePath); CSVWriter writer; FileWriter fileWriter; try { if (f.exists() && !f.isDirectory()) { fileWriter = new FileWriter(filePath, true); writer = new CSVWriter(fileWriter); } else { writer = new CSVWriter(new FileWriter(filePath)); } String[] headers = getResources().getStringArray(R.array.headers); writer.writeNext(headers); List<HistoryProduct> listHistoryProducts = mHistoryProductDao.loadAll(); for (HistoryProduct hp : listHistoryProducts) { String[] line = {hp.getBarcode(), hp.getTitle(), hp.getBrands()}; writer.writeNext(line); } writer.close(); Toast.makeText(this, R.string.txt_history_exported, Toast.LENGTH_LONG).show(); } catch (IOException e) { e.printStackTrace(); } }
Source:
public void validateServerBinConfiguration(Field[] fields) { if (isSingleBinEnabled) { if (fields.length != 1) { LOG.error( "Aerospike server is single bin enabled and cannot allow multiple bin operations"); throw new RuntimeException("Aerospike server is single bin enabled and cannot allow " + "multiple bin operations"); } } }

Target:
public void validateServerBinConfiguration(Field[] fields) { if (isSingleBinEnabled && fields.length != 1) { LOG.error("Aerospike server is single bin enabled and cannot allow multiple bin operations"); throw new RuntimeException("Aerospike server is single bin enabled and cannot allow " + "multiple bin operations"); } }
Source:
@Override public void finishRecover() throws StorageException { lock.writeLock().lock(); try { updateAllocatedPages(); recover = false; } finally { lock.writeLock().unlock(); } }

Target:
@Override public void finishRecover() throws StorageException { lock.writeLock().lock(); try { if (inited) { long newSize = Math.max(pageSize, fileIO.size() - headerSize()); if (newSize % pageSize != 0) newSize += pageSize - newSize % pageSize; long delta = newSize - allocated.getAndSet(newSize); assert delta % pageSize == 0 : delta; allocatedTracker.add(delta / pageSize); } recover = false; } catch (IOException e) { throw new StorageException("Failed to finish recover partition file [file=" + getFileAbsolutePath() + "]", e); } finally { lock.writeLock().unlock(); } }
Source:
Delete(String keyspace, String table, List<Selector> columns) { super(keyspace); this.table = table; this.columns = columns; this.where = new Where(this); this.usings = new Options(this); this.conditions = new Conditions(this); for (Selector sel : columns) { if (sel instanceof CollectionElementSelector) { if (((CollectionElementSelector) sel).key instanceof Integer) { setNonIdempotentOps(); } } } }

Target:
Delete(String keyspace, String table, List<Selector> columns) { this(keyspace, table, null, null, columns); }