auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code><START> private boolean verifyAggregationOrderBy(OrderingScheme orderingScheme, OrderBy expectedSortOrder) <END> { if (orderingScheme.getOrderBy().size() != expectedSortOrder.getSortItems().size()) { return false; } for (int i = 0; i < expectedSortOrder.getSortItems().size(); i++) { Symbol orderingSymbol = orderingScheme.getOrderBy().get(i); if (expectedSortOrder.getSortItems().get(i).getSortKey().equals(orderingSymbol.toSymbolReference()) && toSortOrder(expectedSortOrder.getSortItems().get(i)).equals(orderingScheme.getOrdering(orderingSymbol))) { continue; } return false; } return true; }</code><technical_language>static</technical_language>

Target:
private static boolean verifyAggregationOrderBy(OrderingScheme orderingScheme, OrderBy expectedSortOrder) { if (orderingScheme.getOrderBy().size() != expectedSortOrder.getSortItems().size()) { return false; } for (int i = 0; i < expectedSortOrder.getSortItems().size(); i++) { Symbol orderingSymbol = orderingScheme.getOrderBy().get(i); if (expectedSortOrder.getSortItems().get(i).getSortKey().equals(orderingSymbol.toSymbolReference()) && toSortOrder(expectedSortOrder.getSortItems().get(i)).equals(orderingScheme.getOrdering(orderingSymbol))) { continue; } return false; } return true; }
Source:
<code>protected Object decode( Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { Parser parser = new Parser(PATTERN, (String) msg); if (!parser.matches()) { return null; } Position position = new Position(); position.setProtocol(getProtocolName()); DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); if (deviceSession == null) { return null; } position.setDeviceId(deviceSession.getDeviceId()); position.set(Position.KEY_INDEX, parser.nextInt()); position.set(Position.KEY_POWER, parser.nextInt() * 0.01); position.set(Position.KEY_BATTERY, parser.nextInt() * 0.01); position.set(Position.KEY_IGNITION, parser.nextInt() == 1); position.set(Position.KEY_INPUT, parser.nextInt()); int satellites = parser.nextInt(); position.set(Position.KEY_SATELLITES, satellites); DateBuilder dateBuilder = new DateBuilder() .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()); <START> position.setValid(satellites >= 3); <END> position.setLatitude(parser.nextCoordinate()); position.setLongitude(parser.nextCoordinate()); position.setSpeed(parser.nextDouble()); position.setCourse(parser.nextDouble()); dateBuilder.setDateReverse(parser.nextInt(), parser.nextInt(), parser.nextInt()); position.setTime(dateBuilder.getDate()); return position; }</code><technical_language>do this</technical_language>

Target:
protected Object decode( Channel channel, SocketAddress remoteAddress, Object msg) throws Exception { Parser parser = new Parser(PATTERN, (String) msg); if (!parser.matches()) { return null; } Position position = new Position(); position.setProtocol(getProtocolName()); DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, parser.next()); if (deviceSession == null) { return null; } position.setDeviceId(deviceSession.getDeviceId()); position.set(Position.KEY_INDEX, parser.nextInt()); position.set(Position.KEY_POWER, parser.nextInt() * 0.01); position.set(Position.KEY_BATTERY, parser.nextInt() * 0.01); position.set(Position.KEY_IGNITION, parser.nextInt() == 1); position.set(Position.KEY_INPUT, parser.nextInt()); position.set(Position.KEY_SATELLITES, parser.nextInt()); DateBuilder dateBuilder = new DateBuilder() .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()); position.setValid(true); position.setLatitude(parser.nextCoordinate()); position.setLongitude(parser.nextCoordinate()); position.setSpeed(parser.nextDouble()); position.setCourse(parser.nextDouble()); dateBuilder.setDateReverse(parser.nextInt(), parser.nextInt(), parser.nextInt()); position.setTime(dateBuilder.getDate()); return position; }
Source:
<code>public void stop() { _log.info("Stopping coordinator"); _shutdown = true; while (_eventThread.isAlive()) { try { <START> _eventThread.join(EVENT_THREAD_JOIN_TIMEOUT.toMillis()); <END> _eventThread.interrupt(); } catch (InterruptedException e) { _log.warn("Exception caught while stopping coordinator", e); } } for (String connectorType : _connectors.keySet()) { try { _connectors.get(connectorType).getConnector().stop(); } catch (Exception ex) { _log.warn(String.format( "Connector stop threw an exception for connectorType %s, " + "Swallowing it and continuing shutdown.", connectorType), ex); } } for (DatastreamTask task : _assignedDatastreamTasks.values()) { ((EventProducer) task.getEventProducer()).shutdown(); } _adapter.disconnect(); _log.info("Coordinator stopped"); }</code><technical_language>I move this line 306; wait for thread finish (join) start interrupting if alive. attempt a join() thread is interrupted, a shorter timeout, i.e. java _shutdown = true; try { _eventThread.join(EVENT_THREAD_JOIN_TIMEOUT); } catch (InterruptedException ex) { /* omitted for brevity */ throw ex; } while (_eventThread.isAlive()) { // Thread alive if gracefully exited try { _eventThread.interrupt(); _eventThread.join(/* shorter timeout */); } catch (InterruptedException ex) { /* omitted for brevity */ throw ex; } }</technical_language>

Target:
public void stop() { _log.info("Stopping coordinator"); _shutdown = true; _eventQueue.put(CoordinatorEvent.NO_OP_EVENT); try { _eventThread.join(EVENT_THREAD_LONG_JOIN_TIMEOUT); } catch (InterruptedException e) { _log.warn("Exception caught while waiting event thread to stop", e); return; } while (_eventThread.isAlive()) { try { _eventThread.interrupt(); _eventThread.join(EVENT_THREAD_SHORT_JOIN_TIMEOUT); } catch (InterruptedException e) { _log.warn("Exception caught while stopping coordinator", e); return; } } for (String connectorType : _connectors.keySet()) { try { _connectors.get(connectorType).getConnector().stop(); } catch (Exception ex) { _log.warn(String.format( "Connector stop threw an exception for connectorType %s, " + "Swallowing it and continuing shutdown.", connectorType), ex); } } for (DatastreamTask task : _assignedDatastreamTasks.values()) { ((EventProducer) task.getEventProducer()).shutdown(); } _adapter.disconnect(); _log.info("Coordinator stopped"); }
Source:
<code>protected boolean checkForAndInstallJava(String requiredVersion) { List<String> requiredVersionParts = Splitter.on(".").splitToList(requiredVersion); <START> int requiredJavaMinor = Integer.valueOf(requiredVersionParts.get(1)); <END> Optional<String> installedJavaVersion = getInstalledJavaVersion(); if (installedJavaVersion.isPresent()) { List<String> installedVersionParts = Splitter.on(".").splitToList(installedJavaVersion.get()); int javaMajor = Integer.valueOf(installedVersionParts.get(0)); int javaMinor = Integer.valueOf(installedVersionParts.get(1)); if (javaMajor == 1 && javaMinor >= requiredJavaMinor) { log.debug("Java already installed at {}@{}", new Object[]{installedJavaVersion.get(), getEntity(), getLocation()}); return true; } } return tryJavaInstall(requiredVersion, BashCommands.installJava(requiredJavaMinor)) == 0; }</code><technical_language>Worth checking length in case invalid format supplied more information exception message</technical_language>

Target:
protected boolean checkForAndInstallJava(String requiredVersion) { int requiredJavaMinor; if (requiredVersion.contains(".")) { List<String> requiredVersionParts = Splitter.on(".").splitToList(requiredVersion); requiredJavaMinor = Integer.valueOf(requiredVersionParts.get(1)); } else if (requiredVersion.length() == 1) { requiredJavaMinor = Integer.valueOf(requiredVersion); } else { log.error("java version required is not supported", requiredVersion); throw new IllegalArgumentException("Required java version " + requiredVersion + " not supported"); } Optional<String> installedJavaVersion = getInstalledJavaVersion(); if (installedJavaVersion.isPresent()) { List<String> installedVersionParts = Splitter.on(".").splitToList(installedJavaVersion.get()); int javaMajor = Integer.valueOf(installedVersionParts.get(0)); int javaMinor = Integer.valueOf(installedVersionParts.get(1)); if (javaMajor == 1 && javaMinor >= requiredJavaMinor) { log.debug("Java already installed at {}@{}", new Object[]{installedJavaVersion.get(), getEntity(), getLocation()}); return true; } } return tryJavaInstall(requiredVersion, BashCommands.installJava(requiredJavaMinor)) == 0; }
Source:
<code>public void killJob( @NotBlank(message = "No id entered. Unable to kill job.") final String id, @NotBlank(message = "No reason provided.") final String reason ) throws GenieException { final JobStatus jobStatus = this.jobSearchService.getJobStatus(id); if (jobStatus == JobStatus.INIT) { this.eventPublisher.publishEvent( new JobFinishedEvent( id, JobFinishedReason.KILLED, "User requested job be killed during initialization", this ) ); } else if (jobStatus == JobStatus.RUNNING) { final JobExecution jobExecution = this.jobSearchService.getJobExecution(id); if (jobExecution.getExitCode().isPresent()) { return; } if (!this.hostName.equals(jobExecution.getHostName())) { throw new GeniePreconditionException( "Job with id " + id + " is not running on this host (" + this.hostName + "). It's actually on " + jobExecution.getHostName() ); } if (SystemUtils.IS_OS_UNIX) { this.killJobOnUnix(jobExecution .getProcessId() .orElseThrow(() -> new GeniePreconditionException("No process id found. Unable to kill if no process id") ) ); } else { throw new java.lang.UnsupportedOperationException("Genie isn't currently supported on this OS"); } try { this.objectMapper.writeValue( <START> new File(this.baseWorkingDir + "/" + id + "/genie/kill-reason"), <END> new JobKillReasonFile(reason)); } catch (IOException e) { throw new GenieServerException("Failed to write job kill reason file", e); } } }</code><technical_language>I name of this file a constant in JobConstants change change code reference track strings</technical_language>

Target:
public void killJob( @NotBlank(message = "No id entered. Unable to kill job.") final String id, @NotBlank(message = "No reason provided.") final String reason ) throws GenieException { final JobStatus jobStatus = this.jobSearchService.getJobStatus(id); if (jobStatus == JobStatus.INIT) { this.eventPublisher.publishEvent( new JobFinishedEvent( id, JobFinishedReason.KILLED, "User requested job be killed during initialization", this ) ); } else if (jobStatus == JobStatus.RUNNING) { final JobExecution jobExecution = this.jobSearchService.getJobExecution(id); if (jobExecution.getExitCode().isPresent()) { return; } if (!this.hostName.equals(jobExecution.getHostName())) { throw new GeniePreconditionException( "Job with id " + id + " is not running on this host (" + this.hostName + "). It's actually on " + jobExecution.getHostName() ); } if (SystemUtils.IS_OS_UNIX) { this.killJobOnUnix(jobExecution .getProcessId() .orElseThrow(() -> new GeniePreconditionException("No process id found. Unable to kill if no process id") ) ); } else { throw new java.lang.UnsupportedOperationException("Genie isn't currently supported on this OS"); } try { this.objectMapper.writeValue( new File(this.baseWorkingDir + "/" + id + "/" + JobConstants.GENIE_KILL_REASON_FILE_NAME), new JobKillReasonFile(reason)); } catch (IOException e) { throw new GenieServerException("Failed to write job kill reason file", e); } } }
Source:
<code>public void testGetTimeZones() { final TimeZone timeZone0 = mock(TimeZone.class); final TimeZone timeZone1 = mock(TimeZone.class); final String[] ids = new String[]{"0", "1"}; when(timeZone0.getRawOffset()).thenReturn(0); when(timeZone1.getRawOffset()).thenReturn(3600000); doReturn(ids).when(service).getAvailableIds(); doReturn(timeZone0).when(service).getTimeZone("0"); doReturn(timeZone1).when(service).getTimeZone("1"); final List<DMNSimpleTimeZone> simpleTimeZones = service.getTimeZones(); assertEquals(2, simpleTimeZones.size()); assertEquals(0, simpleTimeZones.get(0).getOffset(), 0.01d); <START> assertEquals(1, simpleTimeZones.get(1).getOffset(), 0.01d); <END> }</code><technical_language>please add this assertions: java assertEquals("+00:00", simpleTimeZones.get(0).getOffsetString()); assertEquals("+01:00", simpleTimeZones.get(1).getOffsetString());</technical_language>

Target:
public void testGetTimeZones() { final TimeZone timeZone0 = mock(TimeZone.class); final TimeZone timeZone1 = mock(TimeZone.class); final String[] ids = new String[]{"0", "1"}; when(timeZone0.getRawOffset()).thenReturn(0); when(timeZone1.getRawOffset()).thenReturn(3600000); doReturn(ids).when(service).getAvailableIds(); doReturn(timeZone0).when(service).getTimeZone("0"); doReturn(timeZone1).when(service).getTimeZone("1"); final List<DMNSimpleTimeZone> simpleTimeZones = service.getTimeZones(); assertEquals(2, simpleTimeZones.size()); assertEquals(0, simpleTimeZones.get(0).getOffset(), 0.01d); assertEquals(1, simpleTimeZones.get(1).getOffset(), 0.01d); assertEquals("+00:00", simpleTimeZones.get(0).getOffsetString()); assertEquals("+01:00", simpleTimeZones.get(1).getOffsetString()); }
Source:
<code>private static Supplier<ClientRegistration.Builder> oidcRfc8414(URI issuer) { URI uri = UriComponentsBuilder.fromUri(issuer) .replacePath(OIDC_METADATA_PATH + issuer.getPath()).build(Collections.emptyMap()); return () -> { RequestEntity<Void> request = RequestEntity.get(uri).build(); Map<String, Object> configuration = rest.exchange(request, typeReference).getBody(); AuthorizationServerMetadata metadata = parse(configuration, AuthorizationServerMetadata::parse); validateJwksUri(metadata); ClientRegistration.Builder builder = withProviderConfiguration(metadata, issuer.toASCIIString()) <START> .jwkSetUri(metadata.getJWKSetURI().toASCIIString()); <END> String userinfoEndpoint = (String) configuration.get("userinfo_endpoint"); if (userinfoEndpoint != null) { builder.userInfoUri(userinfoEndpoint); } return builder; }; }</code><technical_language>RFC 8414, for jwk set uri null, set builder if is in response. if other properties required OIDC discovery, optional in RFC 8414</technical_language>

Target:
private static Supplier<ClientRegistration.Builder> oidcRfc8414(URI issuer) { URI uri = UriComponentsBuilder.fromUri(issuer) .replacePath(OIDC_METADATA_PATH + issuer.getPath()).build(Collections.emptyMap()); return getRfc8414Builder(issuer, uri); }
Source:
<code>public void beginRecognizeInvoices() throws IOException { File invoice = new File("local/file_path/invoice.jpg"); Flux<ByteBuffer> buffer = toFluxByteBuffer(new ByteArrayInputStream(Files.readAllBytes(invoice.toPath()))); <START> formRecognizerAsyncClient.beginRecognizeBusinessCards(buffer, invoice.length()) <END> .flatMap(AsyncPollResponse::getFinalResult) .subscribe(recognizedInvoices -> { for (int i = 0; i < recognizedInvoices.size(); i++) { RecognizedForm recognizedForm = recognizedInvoices.get(i); Map<String, FormField> recognizedFields = recognizedForm.getFields(); FormField customAddrFormField = recognizedFields.get("CustomerAddress"); if (customAddrFormField != null) { if (FieldValueType.STRING == customAddrFormField.getValue().getValueType()) { System.out.printf("Customer Address: %s%n", customAddrFormField.getValue().asString()); } } FormField invoiceDateFormField = recognizedFields.get("InvoiceDate"); if (invoiceDateFormField != null) { if (FieldValueType.DATE == invoiceDateFormField.getValue().getValueType()) { LocalDate invoiceDate = invoiceDateFormField.getValue().asDate(); System.out.printf("Invoice Date: %s, confidence: %.2f%n", invoiceDate, invoiceDateFormField.getConfidence()); } } } }); END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeInvoices#Flux-long }</code><technical_language>this shows business card</technical_language>

Target:
public void beginRecognizeInvoices() throws IOException { File invoice = new File("local/file_path/invoice.jpg"); Flux<ByteBuffer> buffer = toFluxByteBuffer(new ByteArrayInputStream(Files.readAllBytes(invoice.toPath()))); formRecognizerAsyncClient.beginRecognizeInvoices(buffer, invoice.length()) .flatMap(AsyncPollResponse::getFinalResult) .subscribe(recognizedInvoices -> { for (int i = 0; i < recognizedInvoices.size(); i++) { RecognizedForm recognizedForm = recognizedInvoices.get(i); Map<String, FormField> recognizedFields = recognizedForm.getFields(); FormField customAddrFormField = recognizedFields.get("CustomerAddress"); if (customAddrFormField != null) { if (FieldValueType.STRING == customAddrFormField.getValue().getValueType()) { System.out.printf("Customer Address: %s%n", customAddrFormField.getValue().asString()); } } FormField invoiceDateFormField = recognizedFields.get("InvoiceDate"); if (invoiceDateFormField != null) { if (FieldValueType.DATE == invoiceDateFormField.getValue().getValueType()) { LocalDate invoiceDate = invoiceDateFormField.getValue().asDate(); System.out.printf("Invoice Date: %s, confidence: %.2f%n", invoiceDate, invoiceDateFormField.getConfidence()); } } } }); END: com.azure.ai.formrecognizer.FormRecognizerAsyncClient.beginRecognizeInvoices#Flux-long }
Source:
<code>public ReviewerResource parse(ChangeResource rsrc, IdString id) throws OrmException, ResourceNotFoundException, AuthException { Account account = null; Account.Id accountId; if (id.equals("self")) { CurrentUser user = rsrc.getControl().getCurrentUser(); if (user instanceof IdentifiedUser) { accountId = ((IdentifiedUser)user).getAccountId(); } else if (user instanceof AnonymousUser) { throw new AuthException("Authentication required"); } else { throw new ResourceNotFoundException(id); } <START> } else if (id.get().matches("^[0-9]+$")) { <END> accountId = Account.Id.parse(id.get()); } else { account = accountResolver.find(id.get()); if (account != null) { accountId = account.getId(); } else { throw new ResourceNotFoundException(id); } } if (fetchAccountIds(rsrc).contains(accountId)) { if (account == null) { account = accountCache.get(accountId).getAccount(); } return new ReviewerResource(rsrc, account, id.get()); } throw new ResourceNotFoundException(id); }</code><technical_language>This is handled of AccountResolver. For a example of code want AccountsCollection.parse()</technical_language>

Target:
public ReviewerResource parse(ChangeResource rsrc, IdString id) throws OrmException, ResourceNotFoundException, AuthException { Account.Id accountId; if (id.equals("self")) { CurrentUser user = rsrc.getControl().getCurrentUser(); if (user instanceof IdentifiedUser) { accountId = ((IdentifiedUser) user).getAccountId(); } else if (user instanceof AnonymousUser) { throw new AuthException("Authentication required"); } else { throw new ResourceNotFoundException(id); } } else { Set<Account.Id> matches = resolver.findAll(id.get()); if (matches.size() != 1) { throw new ResourceNotFoundException(id); } accountId = Iterables.getOnlyElement(matches); } if (fetchAccountIds(rsrc).contains(accountId)) { Account account = accountCache.get(accountId).getAccount(); return resourceFactory.create(rsrc, account); } throw new ResourceNotFoundException(id); }
Source:
<code>public Optional<String> getCountryCode(String locationWKT, int radius) { try { <START> Optional<String> alpha3CountryCode = geoEntryQueryable.getCountryCode(locationWKT, radius); <END> if (alpha3CountryCode.isPresent()) { return alpha3CountryCode; } } catch (GeoEntryQueryException e) { LOGGER.debug("Error querying GeoNames", e); } catch (ParseException e) { LOGGER.debug("Error parsing WKT: ", locationWKT, e); } return Optional.empty(); }</code><technical_language>simplify return geoEntryQueryable.getCountryCode(locationWKT, radius);</technical_language>

Target:
public Optional<String> getCountryCode(String locationWKT, int radius) { try { return geoEntryQueryable.getCountryCode(locationWKT, radius); } catch (GeoEntryQueryException e) { LOGGER.debug("Error querying GeoNames", e); } catch (ParseException e) { LOGGER.debug("Error parsing WKT: ", locationWKT, e); } return Optional.empty(); }
Source:
<code>public FileKryoRegistrar() { <START> super(); <END> this.registrationId = DEFAULT_REGISTRATION_ID; }</code><technical_language>Unnecessary</technical_language>

Target:
public FileKryoRegistrar() { this.registrationId = DEFAULT_REGISTRATION_ID; }
Source:
<code>public final void testPathsDirectoryWithNestedFile() throws IOException { TestRootModuleChecker.reset(); final CheckstyleAntTaskLogStub antTask = new CheckstyleAntTaskLogStub(); antTask.setConfig(getPath(CUSTOM_ROOT_CONFIG_FILE)); antTask.setProject(new Project()); final FileResource fileResource = new FileResource( <START> antTask.getProject(), getPath(FLAWLESS_INPUT)); <END> final Path sourcePath = new Path(antTask.getProject()); sourcePath.add(fileResource); antTask.addPath(sourcePath); antTask.execute(); assertTrue("Checker is not processed", TestRootModuleChecker.isProcessed()); final List<File> filesToCheck = TestRootModuleChecker.getFilesToCheck(); assertThat("There more files to check then expected", filesToCheck.size(), is(1)); assertThat("The path of file differs from expected", filesToCheck.get(0).getAbsolutePath(), is(getPath(FLAWLESS_INPUT))); assertEquals("Amount of logged messages in unxexpected", 9, antTask.getLoggedMessages().size()); }</code><technical_language>@subkrish This is issue. Original code directory, file. @romani This is another bad sign tests pass is code coverage tells is a problem</technical_language>

Target:
public final void testPathsDirectoryWithNestedFile() throws IOException { TestRootModuleChecker.reset(); final CheckstyleAntTaskLogStub antTask = new CheckstyleAntTaskLogStub(); antTask.setConfig(getPath(CUSTOM_ROOT_CONFIG_FILE)); antTask.setProject(new Project()); final FileResource fileResource = new FileResource( antTask.getProject(), getPath("ant/checkstyleanttask/")); final Path sourcePath = new Path(antTask.getProject()); sourcePath.add(fileResource); antTask.addPath(sourcePath); antTask.execute(); assertTrue("Checker is not processed", TestRootModuleChecker.isProcessed()); final List<File> filesToCheck = TestRootModuleChecker.getFilesToCheck(); assertThat("There more files to check then expected", filesToCheck.size(), is(9)); assertThat("The path of file differs from expected", filesToCheck.get(5).getAbsolutePath(), is(getPath(FLAWLESS_INPUT))); assertEquals("Amount of logged messages in unxexpected", 9, antTask.getLoggedMessages().size()); }
Source:
<code>public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: finish(); return true; case R.id.menu_clear_all_saved_pages: AlertDialog.Builder builder = new AlertDialog.Builder(this); <START> builder.setTitle(R.string.dialog_title_clear_saved_pages); <END> builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { app.getPersister(Bookmark.class).deleteAll(); } }); builder.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } }); builder.create().show(); return true; default: throw new RuntimeException("Unknown menu item clicked!"); } }</code><technical_language>I I started title, some Google apps, Play store app, I message. so, I recommend change HistoryActivity instead consistent this</technical_language>

Target:
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: finish(); return true; case R.id.menu_clear_all_saved_pages: AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setMessage(R.string.dialog_title_clear_saved_pages); builder.setPositiveButton(R.string.yes, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { app.getPersister(Bookmark.class).deleteAll(); } }); builder.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } }); builder.create().show(); return true; default: throw new RuntimeException("Unknown menu item clicked!"); } }
Source:
<code>public void close() throws Exception { <START> synchronized (this) { <END> for (final MQTTSubscribeClient subClient : mqttSubscribeClientMap.values()) { subClient.disconnect(); } } }</code><technical_language>Do need this synchronized</technical_language>

Target:
public void close() throws Exception { for (final MQTTSubscribeClient subClient : mqttSubscribeClientMap.values()) { subClient.disconnect(); } }
Source:
<code>public void testSplit1() { String s1 = "(thrift://hcat1:port,thrift://hcat2:port),(thrift://hcat3:port,thrift://hcat4:port)"; p.put(EXTRA_HCAT_CLUSTERS, s1); <START> List<String> s2 = Arrays.asList("", "thrift://hcat1:port,thrift://hcat2:port" , "thrift://hcat3:port,thrift://hcat4:port"); <END> Assert.assertTrue(p.getStringListFromCluster(EXTRA_HCAT_CLUSTERS).equals(s2)); String s3 = "(thrift://hcat1:port,thrift://hcat2:port) , (thrift://hcat3:port,thrift://hcat4:port)"; p.put(EXTRA_HCAT_CLUSTERS, s3); List<String> s4 = Arrays.asList("", "thrift://hcat1:port,thrift://hcat2:port" , "thrift://hcat3:port,thrift://hcat4:port"); Assert.assertTrue(p.getStringListFromCluster(EXTRA_HCAT_CLUSTERS).equals(s4)); String s5 = " (thrift://hcat1:port,thrift://hcat2:port) , (thrift://hcat3:port,thrift://hcat4:port) "; p.put(EXTRA_HCAT_CLUSTERS, s5); List<String> s6 = Arrays.asList("", "thrift://hcat1:port,thrift://hcat2:port" , "thrift://hcat3:port,thrift://hcat4:port"); Assert.assertTrue(p.getStringListFromCluster(EXTRA_HCAT_CLUSTERS).equals(s6)); }</code><technical_language>returning empty string. list 2 entries..</technical_language>

Target:
public void testSplit1() { String s1 = "thrift://hcat1:port,thrift://hcat2:port;thrift://hcat3:port,thrift://hcat4:port;"; p.put(EXTRA_HCAT_CLUSTERS, s1); List<String> s2 = Arrays.asList("thrift://hcat1:port,thrift://hcat2:port" , "thrift://hcat3:port,thrift://hcat4:port"); Assert.assertTrue(p.getStringListFromCluster(EXTRA_HCAT_CLUSTERS).equals(s2)); String s3 = "thrift://hcat1:port,thrift://hcat2:port ; thrift://hcat3:port,thrift://hcat4:port;"; p.put(EXTRA_HCAT_CLUSTERS, s3); List<String> s4 = Arrays.asList( "thrift://hcat1:port,thrift://hcat2:port" , "thrift://hcat3:port,thrift://hcat4:port"); Assert.assertTrue(p.getStringListFromCluster(EXTRA_HCAT_CLUSTERS).equals(s4)); String s5 = "thrift://hcat1:port,thrift://hcat2:port"; p.put(EXTRA_HCAT_CLUSTERS, s5); List<String> s6 = Arrays.asList("thrift://hcat1:port,thrift://hcat2:port"); Assert.assertTrue(p.getStringListFromCluster(EXTRA_HCAT_CLUSTERS).equals(s6)); }
Source:
<code>public MagicKey(String name, Cache<?, ?> primaryOwner) { this.name = name; address = addressOf(primaryOwner).toString(); Random r = new Random(); Object dummy; <START> int attemptsLeft = 100000; <END> do { final int hc = r.nextInt(); dummy = new Integer(hc); attemptsLeft--; } while (!isFirstOwner(primaryOwner, dummy) && attemptsLeft >= 0); if (attemptsLeft < 0) { throw new IllegalStateException("Could not find any key owned by " + primaryOwner); } hashcode = dummy.hashCode(); segment = primaryOwner.getAdvancedCache().getDistributionManager().getReadConsistentHash().getSegment(this); }</code><technical_language>need this? need change MagicKey algorithm..</technical_language>

Target:
public MagicKey(String name, Cache<?, ?> primaryOwner) { this.name = name; address = addressOf(primaryOwner).toString(); Random r = new Random(); Object dummy; int attemptsLeft = 1000; do { final int hc = r.nextInt(); dummy = new Integer(hc); attemptsLeft--; } while (!isFirstOwner(primaryOwner, dummy) && attemptsLeft >= 0); if (attemptsLeft < 0) { throw new IllegalStateException("Could not find any key owned by " + primaryOwner); } hashcode = dummy.hashCode(); segment = primaryOwner.getAdvancedCache().getDistributionManager().getReadConsistentHash().getSegment(this); }
Source:
<code>public RelDataType createRawType(String className, String serializerString) { return new DummyRawType(className, serializerString); <START> } <END></code><technical_language>type canonized. compare object references</technical_language>

Target:
public RelDataType createRawType(String className, String serializerString) { return canonize(new DummyRawType(className, serializerString)); }
Source:
<code>public Map<String, Map<String, String>> extractBrokerConfigurations(Map<String, Object> properties) { Map<String, Map<String, String>> configPerBroker = new HashMap<String, Map<String, String>>(); for (Entry<String, Object> entry : properties.entrySet()) { String key = entry.getKey(); if (key.equals("service.pid") || key.equals("objectClass") || key.equals("component.name") || key.equals("component.id")) { continue; } if (!(entry.getValue() instanceof String)) { <START> logger.error("Unexpected value {}:{}", entry.getKey(), entry.getValue()); <END> continue; } String value = (String) entry.getValue(); String[] subkeys = key.split("\\."); if (subkeys.length != 2 || StringUtils.isBlank(value)) { logger.debug("MQTT Broker property '{}={}' should have the format 'broker.propertykey=value'", key, value); continue; } String brokername = subkeys[0].toLowerCase(); Map<String, String> brokerConfig = configPerBroker.get(brokername); if (brokerConfig == null) { brokerConfig = new HashMap<>(); configPerBroker.put(brokername, brokerConfig); brokerConfig.put(NAME_PROPERTY, brokername); } brokerConfig.put(subkeys[1], value); } return configPerBroker; }</code><technical_language>MQTT service pov this is error prevent framework execution. Log warn debug instead</technical_language>

Target:
public Map<String, Map<String, String>> extractBrokerConfigurations(Map<String, Object> properties) { Map<String, Map<String, String>> configPerBroker = new HashMap<String, Map<String, String>>(); for (Entry<String, Object> entry : properties.entrySet()) { String key = entry.getKey(); if (key.equals("service.pid") || key.equals("objectClass") || key.equals("component.name") || key.equals("component.id")) { continue; } if (!(entry.getValue() instanceof String)) { logger.warn("Unexpected value in broker configuration {}:{}", entry.getKey(), entry.getValue()); continue; } String value = (String) entry.getValue(); String[] subkeys = key.split("\\."); if (subkeys.length != 2 || StringUtils.isBlank(value)) { logger.debug("MQTT Broker property '{}={}' should have the format 'broker.propertykey=value'", key, value); continue; } String brokername = subkeys[0].toLowerCase(); Map<String, String> brokerConfig = configPerBroker.get(brokername); if (brokerConfig == null) { brokerConfig = new HashMap<>(); configPerBroker.put(brokername, brokerConfig); brokerConfig.put(NAME_PROPERTY, brokername); } brokerConfig.put(subkeys[1], value); } return configPerBroker; }
Source:
<code>public boolean consume(QuotaConsumptionParametersWrapper parameters) { Pair<AuditLogType, AuditLogableBase> auditLogPair = new Pair<AuditLogType, AuditLogableBase>(); auditLogPair.setSecond(parameters.getAuditLogable()); lock.readLock().lock(); try { storage_pool storagePool = parameters.getAuditLogable().getStoragePool(); if (storagePool == null) { throw new InvalidQuotaParametersException("Null storage pool passed to QuotaManager"); <START> } <END> if (!storagePoolQuotaMap.containsKey(storagePool.getId())) { storagePoolQuotaMap.put(storagePool.getId(), new HashMap<Guid, Quota>()); } synchronized (storagePoolQuotaMap.get(storagePool.getId())) { if (!validateAndCompleteParameters(parameters, auditLogPair)) { throw new InvalidQuotaParametersException(); } return internalConsumeAndReleaseHandler(parameters, auditLogPair); } } finally { lock.readLock().unlock(); getQuotaManagerAuditLogger().auditLog(auditLogPair.getFirst(), auditLogPair.getSecond()); } }</code><technical_language>here, read lock</technical_language>

Target:
public boolean consume(QuotaConsumptionParametersWrapper parameters) throws InvalidQuotaParametersException { Pair<AuditLogType, AuditLogableBase> auditLogPair = new Pair<AuditLogType, AuditLogableBase>(); auditLogPair.setSecond(parameters.getAuditLogable()); storage_pool storagePool = parameters.getAuditLogable().getStoragePool(); if (storagePool == null) { throw new InvalidQuotaParametersException("Null storage pool passed to QuotaManager"); } lock.writeLock().lock(); try { if (!storagePoolQuotaMap.containsKey(storagePool.getId())) { storagePoolQuotaMap.put(storagePool.getId(), new HashMap<Guid, Quota>()); } } finally { lock.writeLock().unlock(); } lock.readLock().lock(); try { synchronized (storagePoolQuotaMap.get(storagePool.getId())) { if (!validateAndCompleteParameters(parameters, auditLogPair)) { throw new InvalidQuotaParametersException(); } return internalConsumeAndReleaseHandler(parameters, auditLogPair); } } finally { lock.readLock().unlock(); getQuotaManagerAuditLogger().auditLog(auditLogPair.getFirst(), auditLogPair.getSecond()); } }
Source:
<code>protected void testAccessControl() throws Exception { InstructorAttributes instructor1OfCourse1 = dataBundle.instructors.get("instructor1OfCourse1"); <START> FeedbackSessionAttributes accessableFeedbackSession = dataBundle.feedbackSessions.get("session1InCourse1"); <END> String[] submissionParams = new String[] { Const.ParamsNames.FEEDBACK_SESSION_NAME, accessableFeedbackSession.getFeedbackSessionName(), Const.ParamsNames.COURSE_ID, instructor1OfCourse1.courseId }; verifyOnlyInstructorsOfTheSameCourseCanAccess(submissionParams); }</code><technical_language>correct typo accessable changing code</technical_language>

Target:
protected void testAccessControl() throws Exception { InstructorAttributes instructor1OfCourse1 = dataBundle.instructors.get("instructor1OfCourse1"); FeedbackSessionAttributes accessibleFeedbackSession = dataBundle.feedbackSessions.get("session1InCourse1"); String[] submissionParams = new String[] { Const.ParamsNames.FEEDBACK_SESSION_NAME, accessibleFeedbackSession.getFeedbackSessionName(), Const.ParamsNames.COURSE_ID, instructor1OfCourse1.courseId }; verifyOnlyInstructorsOfTheSameCourseCanAccess(submissionParams); }
Source:
<code>private void internalFreeMac(String mac) { <START> if (allocatedMacs.get(mac) != null) { <END> removeMacFromMap(allocatedMacs, mac); availableMacs.add(mac); } else if (allocatedCustomMacs.get(mac) != null) { removeMacFromMap(allocatedCustomMacs, mac); } }</code><technical_language>check if contains key</technical_language>

Target:
private void internalFreeMac(String mac) { if (allocatedMacs.containsKey(mac)) { removeMacFromMap(allocatedMacs, mac); availableMacs.add(mac); } else if (allocatedCustomMacs.containsKey(mac)) { removeMacFromMap(allocatedCustomMacs, mac); } }
Source:
<code>public void testDisableSSO() throws Exception { <START> final Address keyStoreAddress = securityDomainOperations.createKeyStore(); <END> try { page.getResourceManager().selectByName(APP_SEC_DOMAIN_WITH_SSO_TBR_ADDRESS.getLastPairValue()); page.switchToSSOConfigTab(); page.disableSSO() .confirmAndDismissReloadRequiredMessage() .assertClosed(); new ResourceVerifier(APP_SEC_DOMAIN_WITH_SSO_TBR_ADDRESS.and(SETTING, SINGLE_SIGN_ON), client) .verifyDoesNotExist(); } finally { operations.removeIfExists(APP_SEC_DOMAIN_WITH_SSO_TBR_ADDRESS.and(SETTING, SINGLE_SIGN_ON)); operations.removeIfExists(keyStoreAddress); administration.reloadIfRequired(); } }</code><technical_language>Please remove keyStoreAddress - is used</technical_language>

Target:
public void testDisableSSO() throws Exception { try { page.getResourceManager().selectByName(APP_SEC_DOMAIN_WITH_SSO_TBR_ADDRESS.getLastPairValue()); page.switchToSSOConfigTab(); page.disableSSO() .confirmAndDismissReloadRequiredMessage() .assertClosed(); new ResourceVerifier(APP_SEC_DOMAIN_WITH_SSO_TBR_ADDRESS.and(SETTING, SINGLE_SIGN_ON), client) .verifyDoesNotExist(); } finally { operations.removeIfExists(APP_SEC_DOMAIN_WITH_SSO_TBR_ADDRESS.and(SETTING, SINGLE_SIGN_ON)); administration.reloadIfRequired(); } }
Source:
<code>private CompletableFuture<Void> runFailureDetectorTask(PollReport pollReport) { return CompletableFuture.runAsync(() -> { correctWrongEpochs(pollReport); try { if (!pollReport.getWrongEpochs().isEmpty()) { if (isCurrentLayoutSlotUnFilled(pollReport)) { handleFailure(Collections.emptySet(), pollReport); } return; } } catch (Exception ex) { log.error("Can't fill slot. Poll report: {}", pollReport); } <START> boolean failure = handleFailure(pollReport); <END> if (failure) { return; } handleSequencer(pollReport, serverContext.copyManagementLayout()); handleHealing(pollReport, serverContext.copyManagementLayout()); }, detectionTaskWorkers); }</code><technical_language>overload return</technical_language>

Target:
private CompletableFuture<Void> runFailureDetectorTask(PollReport pollReport) { return CompletableFuture.runAsync(() -> { correctWrongEpochs(pollReport); try { if (pollReport.isCurrentLayoutSlotUnFilled()) { handleFailure(Collections.emptySet(), pollReport); return; } if (!pollReport.getWrongEpochs().isEmpty()) { return; } } catch (Exception ex) { log.error("Can't fill slot. Poll report: {}", pollReport, ex); } handleFailure(pollReport); handleSequencer(pollReport, serverContext.copyManagementLayout()); handleHealing(pollReport, serverContext.copyManagementLayout()); }, failureDetectorWorker); }
Source:
<code>public AdminCommand create( Path homeDir, Path configDir, OutsideWorld outsideWorld ) { <START> boolean debug = !System.getenv().getOrDefault( "NEO4J_DEBUG", "" ).equals( "" ); <END> LogProvider logProvider = FormattedLogProvider.withDefaultLogLevel( debug ? Level.DEBUG : Level.NONE ).toOutputStream( outsideWorld.outStream() ); Monitors monitors = new Monitors(); OnlineBackupContextBuilder contextBuilder = new OnlineBackupContextBuilder( homeDir, configDir ); BackupModule backupModule = new BackupModule( outsideWorld, logProvider, monitors ); BackupSupportingClassesFactoryProvider classesFactoryProvider = getProvidersByPriority().findFirst().orElseThrow( noProviderException() ); BackupSupportingClassesFactory supportingClassesFactory = classesFactoryProvider.getFactory( backupModule ); BackupStrategyCoordinatorFactory coordinatorFactory = new BackupStrategyCoordinatorFactory( backupModule ); return new OnlineBackupCommand( outsideWorld, contextBuilder, supportingClassesFactory, coordinatorFactory ); }</code><technical_language>check if null</technical_language>

Target:
public AdminCommand create( Path homeDir, Path configDir, OutsideWorld outsideWorld ) { boolean debug = System.getenv().get( "NEO4J_DEBUG") != null; LogProvider logProvider = FormattedLogProvider.withDefaultLogLevel( debug ? Level.DEBUG : Level.NONE ).toOutputStream( outsideWorld.outStream() ); Monitors monitors = new Monitors(); OnlineBackupContextBuilder contextBuilder = new OnlineBackupContextBuilder( homeDir, configDir ); BackupModule backupModule = new BackupModule( outsideWorld, logProvider, monitors ); BackupSupportingClassesFactoryProvider classesFactoryProvider = getProvidersByPriority().findFirst().orElseThrow( noProviderException() ); BackupSupportingClassesFactory supportingClassesFactory = classesFactoryProvider.getFactory( backupModule ); BackupStrategyCoordinatorFactory coordinatorFactory = new BackupStrategyCoordinatorFactory( backupModule ); return new OnlineBackupCommand( outsideWorld, contextBuilder, supportingClassesFactory, coordinatorFactory ); }
Source:
<code>public IndexedUserContainer() { <START> List<User> users = Collections.emptyList(); UserService userService = UserServices.getUserService(); if (userService != null) { users = userService.getUsers(); } <END> addContainerProperty(User.PROPERTY_FIRSTNAME, String.class, null); addContainerProperty(User.PROPERTY_LASTNAME, String.class, null); addContainerProperty(User.PROPERTY_EMAIL, String.class, null); addContainerProperty(User.PROPERTY_DISPLAY_NAME, String.class, null); addContainerProperty(PROPERTY_USER, User.class, null); for (User user : users) { addItem(user); } }</code><technical_language>Initialization in constructor work user service started --- is I observed I ran this in debugger. I need this initialization all, event mechanism in UserContainer initialize cache. try remove this snippet verify assumption is true</technical_language>

Target:
public IndexedUserContainer() { addContainerProperty(User.PROPERTY_FIRSTNAME, String.class, null); addContainerProperty(User.PROPERTY_LASTNAME, String.class, null); addContainerProperty(User.PROPERTY_EMAIL, String.class, null); addContainerProperty(User.PROPERTY_DISPLAY_NAME, String.class, null); addContainerProperty(PROPERTY_USER, User.class, null); }
Source:
<code>private SyncRepoEntity getTagsSyncRepo(Repository repo) { Set<String> allRefs = repo.getAllRefs().keySet(); SyncRepoEntity local = new SyncRepoEntity( UIText.SynchronizeWithAction_tagsName); for (String ref : allRefs) { if (ref.startsWith(Constants.R_TAGS)) { <START> local.addRef(createSyncRrepoEntity(ref)); <END> } } return local; }</code><technical_language>typo ? s/createSyncRrepoEntity/createSyncReposEntity/</technical_language>

Target:
private SyncRepoEntity getTagsSyncRepo(Repository repo) { Set<String> allRefs = repo.getAllRefs().keySet(); SyncRepoEntity local = new SyncRepoEntity( UIText.SynchronizeWithAction_tagsName); for (String ref : allRefs) if (ref.startsWith(Constants.R_TAGS)) local.addRef(createSyncRepoEntity(ref)); return local; }
Source:
<code>public Command revertUnsavedChangesBeforeExitCommand( final Command onCompleted) { return new Command() { @Override public void execute() { handleUnsavedChangesBeforeExit( new ArrayList<UnsavedChangesTarget>(), onCompleted); } }; <START> } <END></code><technical_language>Reduce this method to: public Command revertUnsavedChangesBeforeExitCommand(final Command onCompleted) { return () -> handleUnsavedChangesBeforeExit(new ArrayList<>(), onCompleted); }</technical_language>

Target:
public Command revertUnsavedChangesBeforeExitCommand( final Command onCompleted) { return () -> handleUnsavedChangesBeforeExit(new ArrayList<UnsavedChangesTarget>(), onCompleted); }
Source:
<code>private void testAccumulate(final String accumulateFunction, final Number expectedResult) { final String drl = "import org.drools.compiler.oopath.*;\n" + "global java.lang.Object globalVar\n" + "\n" + "rule R when\n" + " accumulate ( Adult( $child: /children ) ; $accumulateResult: " + accumulateFunction + "($child.getAge()) )\n" + "then\n" + " kcontext.getKieRuntime().setGlobal(\"globalVar\", $accumulateResult);\n" + "end\n"; final KieSession ksession = new KieHelper().addContent( drl, ResourceType.DRL ) .build() .newKieSession(); final Man bob = new Man( "Bob", 40 ); bob.addChild( new Child( "Charles", 12 ) ); bob.addChild( new Child( "Debbie", 8 ) ); ksession.insert( bob ); ksession.fireAllRules(); final Number result = (Number) ksession.getGlobal("globalVar"); if (result instanceof Double) { <START> assertEquals(expectedResult.doubleValue(), result.doubleValue(), 0); <END> } else { assertEquals(expectedResult.longValue(), result.longValue()); } }</code><technical_language>Please AssertJ for assertions, if possible</technical_language>

Target:
private void testAccumulate(final String accumulateFunction, final Number expectedResult) { final String drl = "import org.drools.compiler.oopath.model.*;\n" + "global java.lang.Object globalVar\n" + "\n" + "rule R when\n" + " accumulate ( Adult( $child: /children ) ; $accumulateResult: " + accumulateFunction + "($child.getAge()) )\n" + "then\n" + " kcontext.getKieRuntime().setGlobal(\"globalVar\", $accumulateResult);\n" + "end\n"; final KieSession ksession = new KieHelper().addContent( drl, ResourceType.DRL ) .build() .newKieSession(); final Man bob = new Man( "Bob", 40 ); bob.addChild( new Child( "Charles", 12 ) ); bob.addChild( new Child( "Debbie", 8 ) ); ksession.insert( bob ); ksession.fireAllRules(); final Number result = (Number) ksession.getGlobal("globalVar"); if (result instanceof Double) { Assertions.assertThat(expectedResult.doubleValue()).isEqualTo(result.doubleValue()); } else { Assertions.assertThat(expectedResult.longValue()).isEqualTo(result.longValue()); } }
Source:
<code>PersistenceProcessorHandler(MetricsRegistry metrics, String tsoHostAndPort, LeaseManagement leaseManager, CommitTable commitTable, ReplyProcessor reply, RetryProcessor retryProc, Panicker panicker, TSOServerConfig config) throws InterruptedException, ExecutionException, IOException { this.tsoHostAndPort = tsoHostAndPort; this.leaseManager = leaseManager; <START> this.commitTableClient = commitTable.getClient(); <END> this.writer = commitTable.getWriter(); this.reply = reply; this.retryProc = retryProc; this.panicker = panicker; this.maxBatchSize = config.getMaxBatchSize() / config.getPersistHandlerNum(); LOG.info("Creating the persist processor with batch size {}, and timeout {}ms", maxBatchSize, config.getBatchPersistTimeoutMS()); flushTimer = metrics.timer(name("tso", "persist", "flush")); batchSizeHistogram = metrics.histogram(name("tso", "persist", "batchsize")); }</code><technical_language>Please remove commitTableClient</technical_language>

Target:
PersistenceProcessorHandler(MetricsRegistry metrics, String tsoHostAndPort, LeaseManagement leaseManager, CommitTable commitTable, ReplyProcessor reply, RetryProcessor retryProc, Panicker panicker, TSOServerConfig config) throws InterruptedException, ExecutionException, IOException { this.tsoHostAndPort = tsoHostAndPort; this.leaseManager = leaseManager; this.writer = commitTable.getWriter(); this.reply = reply; this.retryProc = retryProc; this.panicker = panicker; flushTimer = metrics.timer(name("tso", "persist", "flush")); batchSizeHistogram = metrics.histogram(name("tso", "persist", "batchsize")); }
Source:
<code>public boolean isTrue(State state, String[] params) { ObjectInstance containerInstance = state.getObject(params[1]); <START> if (ContainerFactory.getContentNames(containerInstance).size() != <END> (this.topLevelIngredient.getContents().size() + this.topLevelIngredient.getNecessaryTraits().size())) { return false; } return true; }</code><technical_language>this multiple lines</technical_language>

Target:
public boolean isTrue(State state, String[] params) { ObjectInstance containerInstance = state.getObject(params[1]); int contentAmount = ContainerFactory.getContentNames(containerInstance).size(); int neededAmount = this.topLevelIngredient.getContents().size() + this.topLevelIngredient.getNecessaryTraits().size(); if (contentAmount != neededAmount) { return false; } return true; }
Source:
<code>public boolean provides(final IOperation operation) { boolean provide = false; if (operation instanceof CreateDecoratorsOperation) { final IDecoratorTarget decoratorTarget = ((CreateDecoratorsOperation) operation).getDecoratorTarget(); final View view = decoratorTarget.getAdapter(View.class); <START> if (view != null && ActivityDiagramEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(view)) && view.getElement() instanceof CallBehaviorAction) { <END> provide = true; } else { provide = false; } } return provide; }</code><technical_language>'null' operande</technical_language>

Target:
public boolean provides(final IOperation operation) { boolean provide = false; if (operation instanceof CreateDecoratorsOperation) { final IDecoratorTarget decoratorTarget = ((CreateDecoratorsOperation) operation).getDecoratorTarget(); final View view = decoratorTarget.getAdapter(View.class); if (null != view && ActivityDiagramEditPart.MODEL_ID.equals(UMLVisualIDRegistry.getModelID(view)) && view.getElement() instanceof CallBehaviorAction) { provide = true; } else { provide = false; } } return provide; }
Source:
<code>public HashCode buildHashCode() { <START> return filter.buildHashCode(); <END> }</code><technical_language>need add differentiate underlying filter. E.g. hashcode list add class name hash something</technical_language>

Target:
public HashCode buildHashCode() { final List<HashCode> hashes = Lists.newArrayListWithCapacity(2); hashes.add(filter.buildHashCode()); final HashCode hc = Const.HASH_FUNCTION().newHasher() .putString(Strings.nullToEmpty(getType()), Const.UTF8_CHARSET) .hash(); hashes.add(hc); return Hashing.combineOrdered(hashes); }