auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testSimpleGetAllWithLoader() throws Exception { when(cacheLoader.loadAll((Iterable)any())).thenAnswer(new Answer() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { Iterable<Integer> iterable = (Iterable) invocation.getArguments()[0]; Map<Number, CharSequence> result = new HashMap<Number, CharSequence>(); for (Integer i : iterable) { switch (i) { case 1: result.put(1, "one"); break; case 2: result.put(2, "two"); break; case 3: result.put(3, null); break; default: throw new AssertionError("Should not try to load key " + i); } } return result; } }); Map<Number, CharSequence> all = testCache.getAll(Arrays.asList(1, 2, 3)); assertThat(all.size(), is(2)); assertThat(all.get(1), Matchers.<CharSequence>equalTo("one")); assertThat(all.get(2), Matchers.<CharSequence>equalTo("two")); <START> assertThat(all.get(3), is(Matchers.nullValue())); <END> }</code><technical_language>This assertion is useless returned map a size of keys 1 & 2 asserted</technical_language>

Target:
public void testSimpleGetAllWithLoader() throws Exception { when(cacheLoader.loadAll((Iterable)any())).thenAnswer(new Answer() { @Override public Object answer(InvocationOnMock invocation) throws Throwable { Iterable<Integer> iterable = (Iterable) invocation.getArguments()[0]; Map<Number, CharSequence> result = new HashMap<Number, CharSequence>(); for (Integer i : iterable) { switch (i) { case 1: result.put(1, "one"); break; case 2: result.put(2, "two"); break; case 3: result.put(3, null); break; default: throw new AssertionError("Should not try to load key " + i); } } return result; } }); Map<Number, CharSequence> all = testCache.getAll(Arrays.asList(1, 2, 3)); assertThat(all.keySet(), containsInAnyOrder((Number)1, 2)); assertThat(all.get(1), Matchers.<CharSequence>equalTo("one")); assertThat(all.get(2), Matchers.<CharSequence>equalTo("two")); }
Source:
<code>public void expunge_whenChargeMeetsTheConditions() { ChargeEntity chargeEntity = aWebChargeEntity() .withGatewayAccount(aGatewayAccountEntity().withId(1L).build()) .withAmount(120L) .build(); chargeEntity.setStatus(ChargeStatus.CREATED); chargeEntity.setStatus(ChargeStatus.ENTERING_CARD_DETAILS); <START> chargeEntity.setStatus(ChargeStatus.AUTHORISATION_READY); <END> chargeEntity.setStatus(ChargeStatus.AUTHORISATION_SUCCESS); chargeEntity.setStatus(ChargeStatus.CAPTURE_READY); chargeEntity.setStatus(ChargeStatus.CAPTURE_SUBMITTED); when(mockExpungeConfig.isExpungeChargesEnabled()).thenReturn(true); when(mockExpungeConfig.getMinimumAgeOfChargeInDays()).thenReturn(minimumAgeOfChargeInDays); when(mockChargeDao.findChargeToExpunge(minimumAgeOfChargeInDays, defaultExcludeChargesParityCheckedWithInDays)) .thenReturn(Optional.of(chargeEntity)); when(parityCheckService.parityCheckChargeForExpunger(chargeEntity)).thenReturn(true); chargeExpungeService.expunge(2); }</code><technical_language>missing some assertions (verify())</technical_language>

Target:
public void expunge_whenChargeMeetsTheConditions() { ChargeEntity chargeEntity = ChargeEntityFixture.aValidChargeEntity() .withGatewayAccountEntity(aGatewayAccountEntity().withId(1L).build()) .withAmount(120L) .withStatus(ChargeStatus.CAPTURED) .build(); when(mockExpungeConfig.isExpungeChargesEnabled()).thenReturn(true); when(mockExpungeConfig.getMinimumAgeOfChargeInDays()).thenReturn(minimumAgeOfChargeInDays); when(mockChargeDao.findChargeToExpunge(minimumAgeOfChargeInDays, defaultExcludeChargesParityCheckedWithInDays)) .thenReturn(Optional.of(chargeEntity)).thenReturn(Optional.empty()); when(parityCheckService.parityCheckChargeForExpunger(chargeEntity)).thenReturn(true); chargeExpungeService.expunge(2); verify(mockChargeDao).expungeCharge(chargeEntity.getId()); }
Source:
<code>public void mouseHover(MouseEvent e) { if (getChartViewer().getWindowDuration() != 0) { IAxis xAxis = getChart().getAxisSet().getXAxis(0); double xCoordinate = xAxis.getDataCoordinate(e.x); ISeries[] series = getChart().getSeriesSet().getSeries(); if ((xCoordinate < 0) || (series.length == 0)) { return; } double[] xS = series[0].getXSeries(); if (xS == null) { return; } int index = 0; for (int i = 0; i < xS.length; i++) { if (xS[i] > xCoordinate) { break; } index = i; } Format format = getChart().getAxisSet().getYAxis(0).getTick().getFormat(); if (format == null) { format = DEFAULT_FORMAT; } StringBuilder buffer = new StringBuilder(); try (Formatter formatter = <START> new Formatter(buffer, Locale.US);) { <END> formatter.format("%8s\t%12s%n", "Time", TmfTimestamp.fromNanos((long) xCoordinate + getChartViewer().getTimeOffset()).toString()); } for (ISeries serie : series) { double[] yS = serie.getYSeries(); if (yS == null || yS.length <= index || !serie.isVisible()) { continue; } try (Formatter formatter = new Formatter(buffer, Locale.US);) { formatter.format("%8s\t%12s%n", serie.getId(), format.format(yS[index])); } } getChart().getPlotArea().setToolTipText(buffer.toString()); getChart().redraw(); } }</code><technical_language>set local eclipse preferences, reuse formatter a field</technical_language>

Target:
public void mouseHover(MouseEvent e) { if (getChartViewer().getWindowDuration() != 0) { IAxis xAxis = getChart().getAxisSet().getXAxis(0); double xCoordinate = xAxis.getDataCoordinate(e.x); ISeries[] series = getChart().getSeriesSet().getSeries(); if ((xCoordinate < 0) || (series.length == 0)) { return; } double[] xS = series[0].getXSeries(); if (xS == null) { return; } int index = 0; for (int i = 0; i < xS.length; i++) { if (xS[i] > xCoordinate) { break; } index = i; } Format format = getChart().getAxisSet().getYAxis(0).getTick().getFormat(); if (format == null) { format = DEFAULT_FORMAT; } StringBuilder buffer = new StringBuilder(); try (Formatter formatter = new Formatter(buffer, Locale.US);) { formatter.format(TWO_COLUMN_TOOLTIP_LINE, Messages.TmfCommonXLineChartTooltipProvider_time, TmfTimestamp.fromNanos((long) xCoordinate + getChartViewer().getTimeOffset()).toString()); } for (ISeries serie : series) { double[] yS = serie.getYSeries(); if (yS == null || yS.length <= index || !serie.isVisible()) { continue; } try (Formatter formatter = new Formatter(buffer, Locale.US);) { formatter.format(TWO_COLUMN_TOOLTIP_LINE, serie.getId(), format.format(yS[index])); } } getChart().getPlotArea().setToolTipText(buffer.toString()); getChart().redraw(); } }
Source:
<code>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; <START> checkForCollision(awsDiscoveryEnabled, discoverySpiEnabled, hazelcastCloudEnabled); <END> 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(); }</code><technical_language>method naming? e.g. check for isDiscoveryConfigurationConsistent</technical_language>

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:
<code><START> public CallBatcherImpl(DatabaseClient client, CallManagerImpl.CallerImpl<E> caller, Class<W> inputType) { <END> 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; }</code><technical_language>If test public interfaces, implementation package-local</technical_language>

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:
<code>public void onStart(ISuite suite) { try { TestServerUtils.startServer(); } catch (Exception e) { <START> SeLionLogger.getLogger().info(e.getMessage()); <END> } }</code><technical_language>Please change log level WARNING</technical_language>

Target:
public void onStart(ISuite suite) { try { TestServerUtils.startServer(); } catch (Exception e) { System.err.println(" Unable to start test server"); } }
Source:
<code>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; <START> } catch (ClassCastException e) { <END> log(listener, String.format("ClassCastException '%s': %s", value, e.getMessage())); return value; } }</code><technical_language>This removed</technical_language>

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:
<code>protected boolean canDoAction() { if (!isVmExist()) { return false; } if (!acquireLockInternal()) { return false; <START> } <END> 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; }</code><technical_language>unite if statements</technical_language>

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:
<code>public void Initialize(SystemTreeItemModel systemTreeSelectedItem) { super.Initialize(systemTreeSelectedItem); new BuilderExecutor<VoidSource, UnitVmModel>( <START> new DataCenterToUnitBuilder() <END> ).build(new VoidSource(), getModel()); InitPriority(0); }</code><technical_language>DataCenter*Buildr is N/A</technical_language>

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:
<code>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)); } <START> else { <END> 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); } }</code><technical_language>@deepak140596 reformat this code Android Studio's formatter</technical_language>

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:
<code>public void rewrite(Exchange exchange) throws IOException { try { Message httpMessage = exchange.getIn(); if (httpMessage != null) { <START> Object body = httpMessage.getBody(); <END> 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); } }</code><technical_language>body of check in next line. combine body instead of body again</technical_language>

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:
<code>protected Map<String, String> createPortAllocationRuntimeProperties(Port port) { Map<String, String> runtimeProperties = super.createPortAllocationRuntimeProperties(port); runtimeProperties.put("plugin_type", <START> ((OpenstackNetworkProviderProperties) <END> provider.getAdditionalProperties()).getPluginType()); return runtimeProperties; }</code><technical_language>unneeded cast</technical_language>

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:
<code>public void adminsShouldBeUnableToChangeTokensByDefault() throws Exception { <START> j.jenkins.setCrumbIssuer(null); <END> 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>"); }</code><technical_language>Why</technical_language>

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:
<code><START> public String decrypt(EncryptedSecret encryptedSecret) throws SecretDecryptionException { <END> 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) } } }</code><technical_language>This is a personal preference thing, I checked exceptions. Do need it</technical_language>

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:
<code>private RecordWriter<Long, SinkRecord> getWriter(TopicPartition topicPart, SinkRecord record) throws CopycatException { try { <START> if (writers.containsKey(topicPart)) return writers.get(topicPart); <END> 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); } }</code><technical_language>Again, this is fine for a cut, file issue change this is keyed/checked. a topic data formats evolving time, I need compare schemas well</technical_language>

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:
<code>public void onComplete() { s = SubscriptionHelper.CANCELLED; if (index <= count && !done) { done = true; <START> if (defaultValue != null) { <END> actual.onSuccess(defaultValue); } else { actual.onError(new NoSuchElementException()); } } }</code><technical_language>java T v = defaultValue; if (v != null) { actual.onSuccess(v); } else {</technical_language>

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:
<code>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())); <START> environment.jersey().register(new NotCurrentLeaderExceptionMapper()); <END> }</code><technical_language>move this line refactored method</technical_language>

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:
<code>protected EPersonRest createAndReturn(Context context) throws AuthorizeException { HttpServletRequest req = getRequestService().getCurrentRequest().getHttpServletRequest(); ObjectMapper mapper = new ObjectMapper(); <START> EPersonRest mock = null; <END> 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); }</code><technical_language>variable name "mock" I a test class</technical_language>

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:
<code>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"); <START> assertQuery("select ST_Equals(ST_GeometryFromText('LineString(0 0, 2 2)'), ST_GeometryFromText('LineString(0 0, 2 2)'))", "select true"); <END> }</code><technical_language>this line a copy of line 282</technical_language>

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:
<code>public void testWebMessageListenerReplyProxyIsIsomorphic() throws Exception { <START> WebkitUtils.checkFeature(WebViewFeature.WEB_MESSAGE_LISTENER); <END> 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); }</code><technical_language>optionally add this setup</technical_language>

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:
<code>private List<IgniteEx> startGrids(int cnt, boolean client) { <START> return Stream.generate(() -> { <END> try { return client ? startClientGrid(gridNum.getAndIncrement()) : startGrid(gridNum.getAndIncrement()); } catch (Exception e) { throw new RuntimeException(e); } }).limit(cnt).collect(Collectors.toList()); }</code><technical_language>I suppose, simple loop List#add is simpler a more readable. Moreover, this approach AtomicInteger type of gridNum</technical_language>

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:
<code>public boolean contains(double lat, double lon) { <START> return polygon.contains(factory.createPoint(new Coordinate(lon, lat))); <END> }</code><technical_language>check envelope first</technical_language>

Target:
public boolean contains(double lat, double lon) { return prepPolygon.contains(factory.createPoint(new Coordinate(lon, lat))); }
Source:
<code>public void testStatsNoStreaming() throws InterruptedException, IOException { <START> TimeUnit.SECONDS.sleep(1); <END> 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); }</code><technical_language>is here</technical_language>

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:
<code>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; } <END> <START> 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); }</code><technical_language>payload validated subscription, basically soon is provided? RSocketRequester hold this logic check creating a requester Mono/Flux, re-using logic</technical_language>

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:
<code>private boolean isChildOfOrEqualToAnyFolder(IResource resource) { for (IPackageFragment <START> fPackageFragment : <END> fPackageFragments) { IFolder folder= (IFolder) fPackageFragment.getResource(); if (folder.equals(resource) || ParentChecker.isDescendantOf(resource, folder)) return true; } return false; }</code><technical_language>rename pack</technical_language>

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:
<code><START> public RemoteCacheKey(String cacheName, boolean forceReturnValue) { <END> this.cacheName = cacheName; this.forceReturnValue = forceReturnValue; }</code><technical_language>Is used</technical_language>

Target:
RemoteCacheKey(String cacheName, boolean forceReturnValue) { this.cacheName = cacheName; this.forceReturnValue = forceReturnValue; }
Source:
<code>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); } <START> assert commCarePreferenceFragment != null; <END> 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()); } }</code><technical_language>default case throw exception, this line unnecessary</technical_language>

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:
<code>public Iterable<Engine> getEngines() { <START> Optional<org.wildfly.extension.undertow.Server> found = Optional.empty(); <END> 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)); }</code><technical_language>Unnecessary Optional allocation</technical_language>

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:
<code>public OIDC getOIDCManager(){ if(oidcManager == null){ <START> oidcManager = new OIDC(); <END> } return oidcManager; }</code><technical_language>Susceptible race condition</technical_language>

Target:
public OIDC getOIDCManager(){ return oidcManager; }
Source:
<code>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())); <START> Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardForEachColorAmongControlledPermanentsEffect(), new GenericManaCost(5)); <END> ability.addCost(new TapSourceCost()); this.addAbility(ability); }</code><technical_language>This important leave out zone default constructor assumes</technical_language>

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:
<code>public static Map<String, Metric> getMetrics() { Map<String, Metric> metrics = new HashMap<>(); metrics.put(CLASSNAME + MetricsAware.KEY_REGEX + PROCESSED_EVENT_COUNT, new Counter()); <START> metrics.put(CLASSNAME + MetricsAware.KEY_REGEX + PROCESSED_TXNS_COUNT, new Counter()); <END> return metrics; }</code><technical_language>wrap Collections.unmodifiableMap()</technical_language>

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:
<code>public MarketHistory(Market m) { super(); this.m = m; <START> history = new HashMap<String, List<Double>>(); <END> }</code><technical_language>history is set a HashMap here, a Map in class</technical_language>

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

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:
<code>private GlusterVolumeAdvancedDetails fetchAdvancedDetails(String volumeName) { VDSReturnValue returnValue = runVdsCommand(VDSCommandType.GetGlusterVolumeAdvancedDetails, new GlusterVolumeAdvancedDetailsVDSParameters(getUpServerId(), clusterId, <START> volumeName, <END> brick.getQualifiedName(), detailRequired)); return (GlusterVolumeAdvancedDetails) returnValue.getReturnValue(); }</code><technical_language>NPE - brick null. I if brick is null, null passed method, advanceddetails of bricks fetched</technical_language>

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:
<code><START> protected PullWithOptionsAction() <END> { super(ActionCommands.PULL_WITH_OPTIONS, new PullWithOptionsActionHandler()); }</code><technical_language>I get !ENTRY org.eclipse.ui 4 4 2016-01-11 20:56:17.129 !MESSAGE create action delegate for id: org.eclipse.egit.ui.actionpullwithoptions !SUBENTRY 1 org.eclipse.equinox.registry 4 1 2016-01-11 20:56:17.129 !MESSAGE Plug-in "org.eclipse.egit.ui" unable instantiate class "org.eclipse.egit.ui.internal.actions.PullWithOptionsAction". !STACK 0 java.lang.IllegalAccessException: Class org.eclipse.core.internal.registry.osgi.RegistryStrategyOSGI access a member of class org.eclipse.egit.ui.internal.actions.PullWithOptionsAction modifiers "protected" public</technical_language>

Target:
public PullWithOptionsAction() { super(ActionCommands.PULL_WITH_OPTIONS, new PullWithOptionsActionHandler()); }
Source:
<code>public void testImportUnrelatedUACWhilePushing() throws Exception { System.out.println("Schema changes that don't affect importers should not result in importer restarts."); <START> CountDownLatch dataGenerationAwaiter = asyncPushDataToImporters(4000, 3); <END> 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); }</code><technical_language>avoid time sensitivity pass client data pushers bunch of SQL run weaving in socket writes</technical_language>

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(); }