auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void deleteForDeploymentUnit() throws Exception { <START> CountDownAsyncJobListener countDownListener = new CountDownAsyncJobListener(1); <END> ((ExecutorServiceImpl) getExecutorService()).addAsyncJobListener(countDownListener); String caseIdIncomplete = caseService.startCase(DEPLOYMENT_UNIT, LOG_INCOMPLETE_CLEANUP_ID); logger.info("CASE CREATED: {}", caseIdIncomplete); caseService.cancelCase(caseIdIncomplete); Thread.sleep(1010); Assertions.assertThat(getCaseFileDataLogSize()).isEqualTo(1); Assertions.assertThat(getCaseAssignmentRoleLogSize()).isPositive(); scheduleLogCleanup(null, "1s", Collections.singletonMap("ForDeployment", DEPLOYMENT_UNIT)); countDownListener.waitTillCompleted(); Assertions.assertThat(getCaseFileDataLogSize()).isZero(); Assertions.assertThat(getCaseAssignmentRoleLogSize()).isZero(); }</code><technical_language>check other logs</technical_language>

Target:
public void deleteForDeploymentUnit() throws Exception { CountDownAsyncJobListener countDownListener = new CountDownAsyncJobListener(1); ((ExecutorServiceImpl) getExecutorService()).addAsyncJobListener(countDownListener); String caseIdIncomplete = caseService.startCase(DEPLOYMENT_UNIT, LOG_INCOMPLETE_CLEANUP_ID); logger.info("CASE CREATED: {}", caseIdIncomplete); caseService.cancelCase(caseIdIncomplete); Thread.sleep(1010); Assertions.assertThat(getCaseFileDataLogSize()).isEqualTo(1); Assertions.assertThat(getCaseAssignmentRoleLogSize()).isPositive(); Map<String, Object> params = new HashMap<>(); params.put("Status", "2,3"); params.put("ForDeployment", DEPLOYMENT_UNIT); scheduleLogCleanup(null, "1s", params); countDownListener.waitTillCompleted(); Assertions.assertThat(getCaseFileDataLogSize()).isZero(); Assertions.assertThat(getCaseAssignmentRoleLogSize()).isZero(); Assertions.assertThat(getProcessLogSize(LOG_INCOMPLETE_CLEANUP_ID)).isZero(); Assertions.assertThat(getTaskLogSize(LOG_INCOMPLETE_CLEANUP_ID)).isZero(); Assertions.assertThat(getNodeInstanceLogSize(LOG_INCOMPLETE_CLEANUP_ID)).isZero(); Assertions.assertThat(getVariableLogSize(LOG_INCOMPLETE_CLEANUP_ID)).isZero(); }
Source:
<code>public void addGroup(String username, String group) { <START> throw new RuntimeException("Adding a group is not supporting in LDAP"); <END> }</code><technical_language>UnsupportedOperationException instead of a generic RuntimeException</technical_language>

Target:
public void addGroup(String username, String group) { throw new UnsupportedOperationException("Adding a group is not supporting in LDAP"); }
Source:
<code><START> public final void run() { <END> affinityInterceptor.beforeRun(); try { run0(); } finally { affinityInterceptor.afterRun(); } }</code><technical_language>superfluous abstraction this simplified this public final void run() { String pool = cpuPoolName(); if(threadAffinity.enabled() && pool!=null){ String cpu = threadAffinity.takeFromCpuPool(pool); threadAffinty.setAffinity(cpu); try{ run0(); }finally{ threadAffinty.returnToCpuPool(cpu, pool); } }else{ run0(); }</technical_language>

Target:
public final void run() { if (affinityController == null) { run0(); return; } affinityController.assign(); try { run0(); } finally { affinityController.release(); } }
Source:
<code>public synchronized boolean resubmit(Verification verification, QueryException queryException) { if (!shouldRequeue(queryException)) { return false; } VerificationRef ref = new VerificationRef(verification); Integer requeudCount = requeuedCounts.getOrDefault(ref, 0); <START> if (requeudCount < failureRequeueLimit) { <END> queriesSubmitted.addAndGet(1); requeuedCounts.compute(ref, (key, count) -> count == null ? 1 : count + 1); completionService.submit(verification::run); log.info("Verification failed with %s, re-queued for verification (%s/%s)", queryException.getErrorCode(), requeudCount, failureRequeueLimit); return true; } log.info("Verification failed with %s, re-queue limit exceeded", queryException.getErrorCode()); return false; }</code><technical_language>nit: personal preference - if (requeuedCount >= failureRequeueLimit) { return false; } .... rest of success case logic This easier add other dropping conditions</technical_language>

Target:
public synchronized boolean resubmit(Verification verification, QueryException queryException) { if (!shouldResubmit(queryException)) { return false; } String name = verification.getSourceQuery().getName(); VerificationRef ref = new VerificationRef(verification); Integer resubmittedCount = resubmittedCounts.getOrDefault(ref, 0); if (resubmittedCount >= verificationResubmissionLimit) { log.info("Verification %s failed with %s, resubmission limit exceeded", name, queryException.getErrorCode()); return false; } queriesSubmitted.addAndGet(1); resubmittedCounts.compute(ref, (key, count) -> count == null ? 1 : count + 1); completionService.submit(verification::run); log.info("Verification %s failed with %s, resubmitted for verification (%s/%s)", name, queryException.getErrorCode(), resubmittedCount, verificationResubmissionLimit); return true; }
Source:
<code>public void throwIfConditionInvalid(long timestamp) { if (startTs.filter(ts -> ts != timestamp).isPresent()) { <START> commitUpdate.set(lockWatchManager.getCommitUpdate(startTs.get())); <END> } }</code><technical_language>I this a bit simpler if ifPresent(...)</technical_language>

Target:
public void throwIfConditionInvalid(long timestamp) { startTs.filter(ts -> ts != timestamp) .ifPresent(ts -> commitUpdate.set(lockWatchManager.getCommitUpdate(ts))); }
Source:
<code>protected boolean canAddDomain() { if (getStorageDomainStaticDAO().get(getStorageDomain().getId()) != null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_ALREADY_EXIST); } List<LUNs> physicalVolumeIdsOnStorage = getLUNsFromVgInfo(getStorageDomain().getStorage()); if (CollectionUtils.containsAny(physicalVolumeIdsOnStorage, <START> getPhysicalVolumesFromLunsList(getDbFacade().getLunDao().getAll()))) { <END> log.info("There are existing luns in the system which are part of VG id '{}'", getStorageDomain().getStorage()); return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_IMPORT_STORAGE_DOMAIN_EXTERNAL_LUN_DISK_EXIST); } return true; }</code><technical_language>Allon stated: physicalVolumeIdsOnStorage is a List<LUNs> while etPhysicalVolumesFromLunsList is a List<String> this condition true operation blocked</technical_language>

Target:
protected boolean canAddDomain() { if (getStorageDomainStaticDAO().get(getStorageDomain().getId()) != null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_ALREADY_EXIST); } List<LUNs> physicalVolumeIdsOnStorage = getLUNsFromVgInfo(getStorageDomain().getStorage()); if (CollectionUtils.containsAny(physicalVolumeIdsOnStorage, Entities.getPhysicalVolumesFromLunsList(getDbFacade().getLunDao().getAll()))) { log.info("There are existing luns in the system which are part of VG id '{}'", getStorageDomain().getStorage()); return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_IMPORT_STORAGE_DOMAIN_EXTERNAL_LUN_DISK_EXIST); } return true; }
Source:
<code>private String getJsonDiskDescription() { try { return ImagesHandler.getJsonDiskDescription(getParameters().getDiskInfo().getDiskAlias(), getParameters().getDiskInfo().getDiskDescription()); } catch (IOException e) { <START> throw new RuntimeException("Exception while generating json for disk", e); <END> } }</code><technical_language>remove try-catch, happen. if does, catched outside</technical_language>

Target:
private String getJsonDiskDescription() throws IOException { return ImagesHandler.getJsonDiskDescription(getParameters().getDiskInfo().getDiskAlias(), getParameters().getDiskInfo().getDiskDescription()); }
Source:
<code><START> public boolean matchConfigValue(String in) { <END> if (name().toLowerCase().replace('_', '-') .equals(in.substring("--".length()))) return true; return false; }</code><technical_language>this is better: if (!in.startsWith("--")) return false; in = in.substring(2).replace('-', '_'); return name().equalsIgnoreCase(in);</technical_language>

Target:
public boolean matchConfigValue(String in) { if (StringUtils.isEmptyOrNull(in)) return false; if (!in.startsWith("--")) return false; return name().equalsIgnoreCase(in.substring(2).replace('-', '_')); }
Source:
<code>public static IEditorDescriptor getEditorDescriptor(IFile file) throws PartInitException { <START> try { return getEditorDescriptor(file, true, false); } catch (OperationCanceledException ex) { throw new PartInitException(ex.getMessage(), ex); } <END> }</code><technical_language>This call method in 4.5: ==> return getEditorDescriptor(file, true);</technical_language>

Target:
public static IEditorDescriptor getEditorDescriptor(IFile file) throws PartInitException { return getEditorDescriptor(file, true); }
Source:
<code>public FIXValue valueOf(int tag, int fromIndex) { <START> for (int i = fromIndex; i < count; i++) { <END> if (tags[i] == tag) return values[i]; } return null; }</code><technical_language>In #valueOf(int,int) method, simplify resulting bytecode slightly eliminating i fromIndex index variable loop. in: java for (; fromIndex < count; fromIndex++) { ..</technical_language>

Target:
public FIXValue valueOf(int tag, int fromIndex) { for (; fromIndex < count; fromIndex++) { if (tags[fromIndex] == tag) return values[fromIndex]; } return null; }
Source:
<code>public int bytesRead() { if (buffer == null) return size.position(); <START> return payload().position() + size.position(); <END> }</code><technical_language>odd buffer a couple of lines payload() refer thing</technical_language>

Target:
public int bytesRead() { if (buffer == null) return size.position(); return buffer.position() + size.position(); }
Source:
<code><START> public EObject updateCreatedObject(EObject newObject, String loadedVersion) { <END> EObject returnedValue = null; for (IMigrationParticipant contribution : delegatesParticipants) { returnedValue = contribution.updateCreatedObject(newObject, loadedVersion); if (returnedValue != null) { break; } } return returnedValue; }</code><technical_language>This method prohibits 2 participants update EObject. I updateCreatedObject return EObject if is modification. this this EObject returnedValue = newObject; for (IMigrationParticipant contribution : delegatesParticipants) { returnedValue = contribution.updateCreatedObject(returnedValue, loadedVersion); }</technical_language>

Target:
public EObject updateCreatedObject(EObject newObject, String loadedVersion) { EObject returnedValue = newObject; for (IMigrationParticipant contribution : delegatesParticipants) { returnedValue = contribution.updateCreatedObject(newObject, loadedVersion); } return returnedValue; }
Source:
<code>protected void doStart() throws Exception { super.doStart(); if (client == null) { DefaultAsyncHttpClientConfig.Builder builder = clientConfig != null ? new DefaultAsyncHttpClientConfig.Builder(clientConfig) : new DefaultAsyncHttpClientConfig.Builder(); if (configuration != null && ObjectHelper.isNotEmpty(configuration.getProxyHost()) && ObjectHelper.isNotEmpty(configuration.getProxyPort())) { LOG.debug("Setup http proxy host:{} port:{} for TelegramService", configuration.getProxyHost(), configuration.getProxyPort()); builder.setProxyServer( new ProxyServer.Builder(configuration.getProxyHost(), configuration.getProxyPort()).build()); } final AsyncHttpClientConfig config = builder.build(); client = new DefaultAsyncHttpClient(config); } if (telegramService == null) { telegramService = new TelegramServiceRestBotAPIAdapter( client, <START> 4 * 1024, <END> configuration.getBaseUri(), configuration.getAuthorizationToken()); } }</code><technical_language>This bufferSize</technical_language>

Target:
protected void doStart() throws Exception { super.doStart(); if (client == null) { DefaultAsyncHttpClientConfig.Builder builder = clientConfig != null ? new DefaultAsyncHttpClientConfig.Builder(clientConfig) : new DefaultAsyncHttpClientConfig.Builder(); if (configuration != null && ObjectHelper.isNotEmpty(configuration.getProxyHost()) && ObjectHelper.isNotEmpty(configuration.getProxyPort())) { LOG.debug("Setup http proxy host:{} port:{} for TelegramService", configuration.getProxyHost(), configuration.getProxyPort()); builder.setProxyServer( new ProxyServer.Builder(configuration.getProxyHost(), configuration.getProxyPort()).build()); } final AsyncHttpClientConfig config = builder.build(); client = new DefaultAsyncHttpClient(config); } if (telegramService == null) { telegramService = new TelegramServiceRestBotAPIAdapter( client, bufferSize, configuration.getBaseUri(), configuration.getAuthorizationToken()); } }
Source:
<code>public static boolean openRepositoryTask(String connectorKind, String repositoryUrl, String id, TaskOpenListener listener, long timestamp) { IRepositoryManager repositoryManager = TasksUi.getRepositoryManager(); AbstractRepositoryConnector connector = repositoryManager.getRepositoryConnector(connectorKind); String taskUrl = connector.getTaskUrl(repositoryUrl, id); if (taskUrl == null) { return false; } IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); if (window == null) { IWorkbenchWindow[] windows = PlatformUI.getWorkbench().getWorkbenchWindows(); if (windows != null && windows.length > 0) { window = windows[0]; } } if (window == null) { return false; } IWorkbenchPage page = window.getActivePage(); <START> OpenRepositoryTaskJob job = new OpenRepositoryTaskJob(connectorKind, repositoryUrl, id, id, taskUrl, timestamp, <END> page); job.setListener(listener); job.schedule(); return true; }</code><technical_language>Right, put in UI ID a key. this method takes ID a parameter assume ID is a valid key. logic for in UI component</technical_language>

Target:
public static boolean openRepositoryTask(String connectorKind, String repositoryUrl, String id, TaskOpenListener listener, long timestamp) { String taskUrl = getTaskUrl(connectorKind, repositoryUrl, id); if (taskUrl == null) { return false; } IWorkbenchWindow window = getWindow(); if (window == null) { return false; } IWorkbenchPage page = window.getActivePage(); OpenRepositoryTaskJob job = new OpenRepositoryTaskJob(connectorKind, repositoryUrl, id, taskUrl, timestamp, page); job.setListener(listener); job.schedule(); return true; }
Source:
<code>public void locatorLauncherUsesConfigFileInClasspathWithGeodePlugins() throws Exception { copy(configWithGeodePluginsFile, temporaryFolder.getRoot().toPath().resolve("log4j2.xml")); String classpath = temporaryFolder.getRoot().getAbsolutePath() + File.pathSeparator + geodeDependencies.toFile().getAbsolutePath(); ProcessBuilder processBuilder = new ProcessBuilder() .redirectErrorStream(true) .redirectOutput(stdoutFile.toFile()) .directory(temporaryFolder.getRoot()) .command("java", "-Dgemfire.http-service-port=" + httpServicePort, "-Dgemfire.jmx-manager-start=true", "-Djava.awt.headless=true", "-cp", classpath, "org.apache.geode.distributed.LocatorLauncher", "start", LOCATOR_NAME, "--port", String.valueOf(locatorPort)); System.out.println("Launching command: " + processBuilder.command()); locator = processBuilder .start(); assertThat(locator.isAlive()).isTrue(); await().untilAsserted(() -> { assertThat(locatorLogFile) .doesNotExist(); <START> assertThat(pulseLogFile) <END> .doesNotExist(); LogFileAssert.assertThat(stdoutFile.toFile()) .exists() .contains("Located war: geode-pulse") .contains("Adding webapp /pulse") .contains("Starting server location for Distribution Locator") .doesNotContain("geode-pulse war file was not found") .doesNotContain("java.lang.IllegalStateException: No factory method found for class"); }); }</code><technical_language>understanding is GEODE-8197 related bug is fixed, this @Ignore annotation removed</technical_language>

Target:
public void locatorLauncherUsesConfigFileInClasspathWithGeodePlugins() throws Exception { copy(configWithGeodePluginsFile, temporaryFolder.getRoot().toPath().resolve("log4j2.xml")); String classpath = temporaryFolder.getRoot().getAbsolutePath() + File.pathSeparator + geodeDependencies.toFile().getAbsolutePath(); ProcessBuilder processBuilder = new ProcessBuilder() .redirectErrorStream(true) .redirectOutput(stdoutFile.toFile()) .directory(temporaryFolder.getRoot()) .command(javaBin.toFile().getAbsolutePath(), "-Dgemfire.http-service-port=" + httpServicePort, "-Dgemfire.jmx-manager-start=true", "-Djava.awt.headless=true", "-cp", classpath, "org.apache.geode.distributed.LocatorLauncher", "start", LOCATOR_NAME, "--port", String.valueOf(locatorPort)); System.out.println("Environment: " + System.getenv()); System.out.println("Launching command: " + processBuilder.command()); locator = processBuilder .start(); assertThat(locator.isAlive()).isTrue(); await().untilAsserted(() -> { assertThat(locatorLogFile) .as(locatorLogFile.toFile().getAbsolutePath()) .doesNotExist(); assertThat(pulseLogFile) .as(pulseLogFile.toFile().getAbsolutePath()) .doesNotExist(); LogFileAssert.assertThat(stdoutFile.toFile()) .as(stdoutFile.toFile().getAbsolutePath()) .exists() .contains("Located war: geode-pulse") .contains("Adding webapp /pulse") .contains("Starting server location for Distribution Locator") .doesNotContain("geode-pulse war file was not found") .doesNotContain("java.lang.IllegalStateException: No factory method found for class"); }); }
Source:
<code>public ResponseEntity<String> refreshConfiguration(HttpServletRequest request) { String accessToken = utilService.getAccessTokenFromRequest(request); if (StringUtils.isEmpty(accessToken)) return new ResponseEntity<>("Access token not specified.", HttpStatus.BAD_REQUEST); String role = tokenService.getRole(accessToken); if (!StringUtils.equals(role, UserType.TECH_ADMIN.getName())) <START> return new ResponseEntity<>("Tech Admin role is needed to call this service.", HttpStatus.BAD_REQUEST); <END> randomizationService.refreshConfigurations(accessToken); return new ResponseEntity("Success", HttpStatus.NO_CONTENT); }</code><technical_language>return a 403 (ACCESS_DENIED) instead of 400</technical_language>

Target:
public ResponseEntity<String> refreshConfiguration(HttpServletRequest request) { String accessToken = utilService.getAccessTokenFromRequest(request); if (StringUtils.isEmpty(accessToken)) return new ResponseEntity<>("Access token not specified.", HttpStatus.BAD_REQUEST); String userType = tokenService.getUserType(accessToken); if (!StringUtils.equals(userType, UserType.TECH_ADMIN.getName())) return new ResponseEntity<>("Tech Admin user type is needed to call this service.", HttpStatus.FORBIDDEN); Map<String, String> configMap = new HashMap<>(); boolean isSuccess = randomizationService.refreshConfigurations(accessToken, configMap); if (isSuccess) return new ResponseEntity(configMap, HttpStatus.NO_CONTENT); else return new ResponseEntity(configMap, HttpStatus.UNPROCESSABLE_ENTITY); }
Source:
<code>public void getNettyServerTest() throws Exception { Properties properties = new Properties(); VerifiableProperties verifiableProperties = new VerifiableProperties(properties); NettyConfig nettyConfig = new NettyConfig(verifiableProperties); RestRequestHandler restRequestHandler = new MockRestRequestResponseHandler(); PublicAccessLogger publicAccessLogger = new PublicAccessLogger(new String[]{}, new String[]{}); RestServerState restServerState = new RestServerState("/healthCheck"); SSLFactory sslFactory = new MockSSLFactory(verifiableProperties); for (int i = 0; i < 2; i++) { NettyServerFactory nettyServerFactory = new NettyServerFactory(verifiableProperties, new MetricRegistry(), restRequestHandler, publicAccessLogger, restServerState, i == 0 ? sslFactory : null); NioServer nioServer = nettyServerFactory.getNioServer(); assertNotNull("No NioServer returned", nioServer); assertEquals("Did not receive a NettyServer instance", NettyServer.class.getCanonicalName(), nioServer.getClass().getCanonicalName()); Map<Integer, ChannelInitializer<SocketChannel>> channelInitializers = nettyServerFactory.getChannelInitializers(); if (i == 0) { <START> assertEquals("Expected two ChannelInitializers when SSLFactoryImpl is not null", 2, channelInitializers.size()); <END> assertNotNull("No ChannelInitializer for SSL port", channelInitializers.get(nettyConfig.nettyServerSSLPort)); } else { assertEquals("Expected one ChannelInitializer when SSLFactoryImpl is null", 1, channelInitializers.size()); } assertNotNull("No ChannelInitializer for plaintext port", channelInitializers.get(nettyConfig.nettyServerPort)); } }</code><technical_language>minor: "when SSLFactory is null.."</technical_language>

Target:
public void getNettyServerTest() throws Exception { Properties properties = new Properties(); doGetNettyServerTest(properties, SSL_FACTORY); doGetNettyServerTest(properties, null); properties.setProperty("netty.server.enable.ssl", "true"); doGetNettyServerTest(properties, SSL_FACTORY); }
Source:
<code>public List<FeatureDto> findApplicationFeatures(String applicationName) { List<FeatureDto> features = new ArrayList<FeatureDto>(); try { for (Feature feature : getRepositoryFeatures(applicationName)) { if (!isAppInFeatureList(feature, applicationName)) { features.add(getFeatureView(feature)); } } } catch (Exception ex) { <START> logger.warn("getRepositoryFeatures Exception: " + ex.getMessage(), ex); <END> } return features; }</code><technical_language>Improve warning text. above</technical_language>

Target:
public List<FeatureDetails> findApplicationFeatures(String applicationName) { List<FeatureDetails> features = new ArrayList<FeatureDetails>(); try { for (Feature feature : getRepositoryFeatures(applicationName)) { if (!isAppInFeatureList(feature, applicationName)) { features.add(getFeatureView(feature)); } } } catch (Exception ex) { logger.warn("Could not obtain Application Features.", ex); } return features; }
Source:
<code>protected void perform() { if (!getVm().isManaged()) { kubevirt.restart(getVm()); setSucceeded(true); return; } if (isColdReboot()) { ActionReturnValue returnValue = runInternalAction(ActionType.ShutdownVm, new ShutdownVmParameters(getVmId(), false)); setReturnValue(returnValue); setSucceeded(returnValue.getSucceeded()); if (getSucceeded()) { resourceManager.getVmManager(getVmId()).setColdReboot(true); } } else { final VDSReturnValue returnValue = runVdsCommand(VDSCommandType.RebootVm, new VdsAndVmIDVDSParametersBase(getVdsId(), getVmId())); setActionReturnValue(returnValue.getReturnValue()); setSucceeded(returnValue.getSucceeded()); if (getSucceeded()) { vmDynamicDao.updateStatus(getVm().getId(), VMStatus.RebootInProgress); <START> } <END> } }</code><technical_language>alright, set expected state right in engine, fine. do for cold reboot</technical_language>

Target:
protected void perform() { if (!getVm().isManaged()) { kubevirt.restart(getVm()); setSucceeded(true); return; } if (isColdReboot()) { ActionReturnValue returnValue = runInternalAction(ActionType.ShutdownVm, new ShutdownVmParameters(getVmId(), false)); setReturnValue(returnValue); setSucceeded(returnValue.getSucceeded()); if (getSucceeded()) { resourceManager.getVmManager(getVmId()).setColdReboot(true); } } else { final VDSReturnValue returnValue = runVdsCommand(VDSCommandType.RebootVm, new VdsAndVmIDVDSParametersBase(getVdsId(), getVmId())); setActionReturnValue(returnValue.getReturnValue()); setSucceeded(returnValue.getSucceeded()); } if (getSucceeded()) { vmDynamicDao.updateStatus(getVm().getId(), VMStatus.RebootInProgress); } }
Source:
<code>public Method aggregateArguments( final ArgumentsAccessor arguments, final ParameterContext context) throws ArgumentsAggregationException { final int offset = context.getIndex(); <START> final Class<?> clazz = arguments.get(offset, Class.class); <END> final String methodName = arguments.getString(offset + 1); final Class<?>[] args = IntStream.range(offset + 2, arguments.size()) .mapToObj(i -> arguments.get(i, Class.class)) .toArray(Class<?>[]::new); try { return clazz.getMethod(methodName, args); } catch (final NoSuchMethodException e) { throw new ArgumentsAggregationException("Invalid method specified", e); } }</code><technical_language>kind of class is this expected be? Is annotated remote method number? more clear RemoteMethodAnnotatedClass</technical_language>

Target:
public Method aggregateArguments( final ArgumentsAccessor arguments, final ParameterContext context) throws ArgumentsAggregationException { final int offset = context.getIndex(); final Class<?> remoteInterface = arguments.get(offset, Class.class); final String methodName = arguments.getString(offset + 1); final Class<?>[] argumentTypes = IntStream.range(offset + 2, arguments.size()) .mapToObj(i -> arguments.get(i, Class.class)) .toArray(Class<?>[]::new); try { return remoteInterface.getMethod(methodName, argumentTypes); } catch (final NoSuchMethodException e) { throw new ArgumentsAggregationException("Invalid method specified", e); } }
Source:
<code>private void checkRoot() throws IOException, InterruptedException { ZooKeeper zk = new ZooKeeper(hostPort, 10000, this); try { zk.create(dirOnZK, null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); } catch (KeeperException.NodeExistsException ke) { } catch (KeeperException ke) { Assert.fail("Unexpected exception code for create " + dirOnZK + ": " + ke.getMessage()); } try { zk.create(testDirOnZK, null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); } catch (KeeperException.NodeExistsException ke) { } catch (KeeperException ke) { <START> Assert.fail("Unexpected exception code for create " + testDirOnZK + ": " + ke.getMessage()); <END> } zk.close(); }</code><technical_language>I noticed this fact: a rule forbid usage of "Assert.xxxx" force usage of import static "org.junit.Assert.fail"</technical_language>

Target:
private void checkRoot() throws IOException, InterruptedException { ZooKeeper zk = new ZooKeeper(hostPort, 10000, this); try { zk.create(dirOnZK, null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); } catch (KeeperException.NodeExistsException ke) { } catch (KeeperException ke) { fail("Unexpected exception code for create " + dirOnZK + ": " + ke.getMessage()); } try { zk.create(testDirOnZK, null, Ids.OPEN_ACL_UNSAFE, CreateMode.PERSISTENT); } catch (KeeperException.NodeExistsException ke) { } catch (KeeperException ke) { fail("Unexpected exception code for create " + testDirOnZK + ": " + ke.getMessage()); } zk.close(); }
Source:
<code><START> public void verifyBasicRequest() { <END> String expected = "{book {edges {node {id title}}}}"; String actual = document( selection( field( "book", selections( field("id"), field("title") ) ) ) ).toQuery(); Assert.assertEquals(actual, expected); }</code><technical_language>coverage of new DSL is high. This touch entry function created in DSL</technical_language>

Target:
public void verifyBasicRequest() { String expected = "{book {edges {node {id title}}}}"; String actual = document( selection( field( "book", selections( field("id"), field("title") ) ) ) ).toQuery(); assertEquals(expected, actual); }
Source:
<code>public static Expr binaryOp(BinaryOpExprBase binary, Expr left, Expr right) { try { return binary.getClass() .getDeclaredConstructor(String.class, Expr.class, Expr.class) .newInstance(binary.op, left, right); } catch (Exception e) { <START> log.info(e, "failed to rewrite expression " + binary); <END> return binary; } }</code><technical_language>Do expect this happen "normally" is this a problem indicating a bug? If happen "normally" log.info noisy in logs. If a bug, please bump log.warn</technical_language>

Target:
public static Expr binaryOp(BinaryOpExprBase binary, Expr left, Expr right) { try { return binary.getClass() .getDeclaredConstructor(String.class, Expr.class, Expr.class) .newInstance(binary.op, left, right); } catch (Exception e) { log.warn(e, "failed to rewrite expression " + binary); return binary; } }
Source:
<code>private PartitionIterator sendNextRequests() { List<PartitionIterator> concurrentQueries = new ArrayList<>(concurrencyFactor); List<ReadRepair> readRepairs = new ArrayList<>(concurrencyFactor); try { for (int i = 0; i < concurrencyFactor && ranges.hasNext();) { ReplicaPlan.ForRangeRead range = ranges.next(); @SuppressWarnings("resource") SingleRangeResponse response = query(range, i == 0); concurrentQueries.add(response); readRepairs.add(response.readRepair); rangesQueried += range.vnodeCount(); <START> i += range.vnodeCount(); <END> } } catch (Throwable t) { for (PartitionIterator response: concurrentQueries) response.close(); throw t; } Tracing.trace("Submitted concurrent range requests", concurrentQueries.size()); counter = DataLimits.NONE.newCounter(command.nowInSec(), true, command.selectsFullPartition(), enforceStrictLiveness); return counter.applyTo(concatAndBlockOnRepair(concurrentQueries, readRepairs)); }</code><technical_language>@jasonstack @adelapena a concurrency factor of 2, next range is a merged range representing 3 vnodes. exceed concurrency factor 1, is idea able progress? feel matters way, point of this mechanism is limit queries replicas, does, I wanted page intent..</technical_language>

Target:
private PartitionIterator sendNextRequests() { List<PartitionIterator> concurrentQueries = new ArrayList<>(concurrencyFactor); List<ReadRepair> readRepairs = new ArrayList<>(concurrencyFactor); try { for (int i = 0; i < concurrencyFactor && ranges.hasNext();) { ReplicaPlan.ForRangeRead range = ranges.next(); @SuppressWarnings("resource") SingleRangeResponse response = query(range, i == 0); concurrentQueries.add(response); readRepairs.add(response.readRepair); rangesQueried += range.vnodeCount(); i += range.vnodeCount(); } batchesRequested++; } catch (Throwable t) { for (PartitionIterator response: concurrentQueries) response.close(); throw t; } Tracing.trace("Submitted concurrent range requests", concurrentQueries.size()); counter = DataLimits.NONE.newCounter(command.nowInSec(), true, command.selectsFullPartition(), enforceStrictLiveness); return counter.applyTo(concatAndBlockOnRepair(concurrentQueries, readRepairs)); }
Source:
<code>public static Modify fromString(String s) { String[] arr = s.split("\\s+"); if (arr.length != 2) { return null; } <START> if (arr[0].equals("insert")) { <END> return insert(Integer.parseInt(arr[1])); } else if (arr[0].equals("replace")) { String[] arr2 = arr[1].split("-"); if (arr2.length != 2) { return null; } return replace(Integer.parseInt(arr2[0]), Integer.parseInt(arr2[1])); } return null; }</code><technical_language>invert comparisons strings</technical_language>

Target:
public static Modify fromString(String s) { String[] arr = s.split("\\s+"); if (arr.length != 2) { return null; } if ("insert".equals(arr[0])) { return insert(Integer.parseInt(arr[1])); } else if ("replace".equals(arr[0])) { String[] arr2 = arr[1].split("-"); if (arr2.length != 2) { return null; } return replace(Integer.parseInt(arr2[0]), Integer.parseInt(arr2[1])); } return null; }
Source:
<code>public InvalidCursorOperation(final Reason reason) { <START> super(); <END> this.reason = reason; }</code><technical_language>I skip this</technical_language>

Target:
public InvalidCursorOperation(final Reason reason) { this.reason = reason; }
Source:
<code>private void addTrustManagerService(OperationContext context, ModelNode ssl, ServiceName serviceName, ServiceTarget serviceTarget) throws OperationFailedException { final ServiceBuilder<TrustManager[]> serviceBuilder; char[] keystorePassword = KeystoreAttributes.KEYSTORE_PASSWORD.resolveModelAttribute(context, ssl).asString() .toCharArray(); final String provider = KeystoreAttributes.KEYSTORE_PROVIDER.resolveModelAttribute(context, ssl).asString(); if (!JKS.equalsIgnoreCase(provider)) { final ProviderTrustManagerService trustManagerService = new ProviderTrustManagerService(provider, keystorePassword); serviceBuilder = serviceTarget.addService(serviceName, trustManagerService); } else { final String path = KeystoreAttributes.KEYSTORE_PATH.resolveModelAttribute(context, ssl).asString(); ModelNode relativeToNode = KeystoreAttributes.KEYSTORE_RELATIVE_TO.resolveModelAttribute(context, ssl); String relativeTo = relativeToNode.isDefined() ? relativeToNode.asString() : null; <START> final FileTrustManagerService trustManagerService = new FileTrustManagerService(JKS.toLowerCase(Locale.ENGLISH), path, relativeTo, keystorePassword); <END> serviceBuilder = serviceTarget.addService(serviceName, trustManagerService); if (relativeTo != null) { serviceBuilder.addDependency(PathManagerService.SERVICE_NAME, PathManager.class, trustManagerService.getPathManagerInjector()); serviceBuilder.addDependency(pathName(relativeTo)); } } serviceBuilder.setInitialMode(ON_DEMAND).install(); }</code><technical_language>this change other "JKS" truststore forbidden? provider.toLowerCase better</technical_language>

Target:
private void addTrustManagerService(OperationContext context, ModelNode ssl, ServiceName serviceName, ServiceTarget serviceTarget) throws OperationFailedException { final ServiceBuilder<TrustManager[]> serviceBuilder; char[] keystorePassword = KeystoreAttributes.KEYSTORE_PASSWORD.resolveModelAttribute(context, ssl).asString() .toCharArray(); final String provider = KeystoreAttributes.KEYSTORE_PROVIDER.resolveModelAttribute(context, ssl).asString(); if (!JKS.equalsIgnoreCase(provider)) { final ProviderTrustManagerService trustManagerService = new ProviderTrustManagerService(provider, keystorePassword); serviceBuilder = serviceTarget.addService(serviceName, trustManagerService); } else { String path = KeystoreAttributes.KEYSTORE_PATH.resolveModelAttribute(context, ssl).asString(); ModelNode relativeToNode = KeystoreAttributes.KEYSTORE_RELATIVE_TO.resolveModelAttribute(context, ssl); String relativeTo = relativeToNode.isDefined() ? relativeToNode.asString() : null; FileTrustManagerService trustManagerService = new FileTrustManagerService(provider, path, relativeTo, keystorePassword); serviceBuilder = serviceTarget.addService(serviceName, trustManagerService); if (relativeTo != null) { serviceBuilder.addDependency(PathManagerService.SERVICE_NAME, PathManager.class, trustManagerService.getPathManagerInjector()); serviceBuilder.addDependency(pathName(relativeTo)); } } serviceBuilder.setInitialMode(ON_DEMAND).install(); }
Source:
<code>public boolean isFifoQueue() { <START> if (queueName.endsWith(".fifo")) { <END> return true; } return false; }</code><technical_language>Please create a constant put left side of comparison. Thanks</technical_language>

Target:
boolean isFifoQueue() { if (queueName.endsWith(".fifo")) { return true; } return false; }
Source:
<code>private boolean isSameTenant(DocumentModel registrationDoc, UserRegistrationConfiguration configuration) { NuxeoPrincipal originatingPrincipal = getOriginatingPrincipal(registrationDoc); if (originatingPrincipal.isAdministrator()) { return true; } <START> return StringUtils.equals((String) registrationDoc.getPropertyValue(configuration.getUserInfoTenantIdField()), <END> originatingPrincipal.getTenantId()); }</code><technical_language>Objects.equals cast needed</technical_language>

Target:
private boolean isSameTenant(DocumentModel registrationDoc, UserRegistrationConfiguration configuration) { NuxeoPrincipal originatingPrincipal = getOriginatingPrincipal(registrationDoc); if (originatingPrincipal == null) { return registrationDoc.getPropertyValue(configuration.getUserInfoTenantIdField()) == null; } if (originatingPrincipal.isAdministrator()) { return true; } return Objects.equals(registrationDoc.getPropertyValue(configuration.getUserInfoTenantIdField()), originatingPrincipal.getTenantId()); }
Source:
<code>public void messagesLogGetsClosed() throws Exception { File storeDir = this.storeDir.graphDbDir(); BatchInserter inserter = BatchInserters.inserter( storeDir, fileSystemRule.get(), stringMap() ); inserter.shutdown(); <START> assertTrue( new File( storeDir, "debug.log" ).delete() ); <END> }</code><technical_language>GraphDatabaseInternalLogIT.INTERNAL_LOG_FILE instead</technical_language>

Target:
public void messagesLogGetsClosed() throws Exception { File storeDir = this.storeDir.graphDbDir(); BatchInserter inserter = BatchInserters.inserter( storeDir, fileSystemRule.get(), stringMap() ); inserter.shutdown(); assertTrue( new File( storeDir, INTERNAL_LOG_FILE ).delete() ); }
Source:
<code>public StateSystemEventRequest(ITmfStateProvider sp, TmfTimeRange timeRange, int index, int nbRequested) { super(ITmfEvent.class, timeRange, index, nbRequested, ITmfEventRequest.ExecutionType.BACKGROUND, TmfStateSystemAnalysisModule.this.getDependencyLevel()); <START> this.sci = sp; <END> trace = sci.getTrace(); }</code><technical_language>remove this</technical_language>

Target:
public StateSystemEventRequest(ITmfStateProvider sp, TmfTimeRange timeRange, int index, int nbRequested) { super(ITmfEvent.class, timeRange, index, nbRequested, ITmfEventRequest.ExecutionType.BACKGROUND, TmfStateSystemAnalysisModule.this.getDependencyLevel()); sci = sp; trace = sci.getTrace(); }
Source:
<code>public void setDayViewAdapter(DayViewAdapter adapter) { for (int i = 0; i < getChildCount(); i++) { <START> if (getChildAt(i) instanceof CalendarCellView) { <END> ((CalendarCellView) getChildAt(i)).removeAllViews(); adapter.makeCellView((CalendarCellView) getChildAt(i)); } } }</code><technical_language>if (getChildAt(i) instanceof CalendarCellView) { CalendarCellView cell = ((CalendarCellView) getChildAt(i)); cell.removeAllViews(); adapter.makeCellView(cell); }</technical_language>

Target:
public void setDayViewAdapter(DayViewAdapter adapter) { for (int i = 0; i < getChildCount(); i++) { if (getChildAt(i) instanceof CalendarCellView) { CalendarCellView cell = ((CalendarCellView) getChildAt(i)); cell.removeAllViews(); adapter.makeCellView(cell); } } }
Source:
<code>public void doFilter(ServletRequest req, ServletResponse res, <START> FilterChain chain) throws IOException, ServletException { <END> HttpServletResponse response = (HttpServletResponse) res; response.setHeader("Access-Control-Allow-Origin", "http://localhost:9000"); response.setHeader("Access-Control-Allow-Credentials", "true"); response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); response.setHeader("Access-Control-Max-Age", "3600"); response.setHeader("Access-Control-Allow-Headers", "x-requested-with,accept,content-type,authorization"); chain.doFilter(req, res); }</code><technical_language>add this file, too</technical_language>

Target:
public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException, ServletException { HttpServletResponse response = (HttpServletResponse) res; response.setHeader("Access-Control-Allow-Origin", "http://localhost:9000"); response.setHeader("Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE"); response.setHeader("Access-Control-Max-Age", "3600"); response.setHeader("Access-Control-Allow-Headers", "x-requested-with,accept,content-type,authorization"); chain.doFilter(req, res); }
Source:
<code>protected Configuration getConfiguration(String testName) throws IOException { conf.unset(TxConstants.Manager.CFG_TX_HDFS_USER); conf.set(TxConstants.Manager.CFG_TX_SNAPSHOT_DIR, tmpFolder.newFolder().getAbsolutePath()); <START> conf.set(TxConstants.Persist.CFG_TX_SNAPHOT_CODEC_CLASSES, SnapshotCodecV4.class.getName()); <END> return conf; }</code><technical_language>Need remove codec too, right</technical_language>

Target:
protected Configuration getConfiguration(String testName) throws IOException { conf.unset(TxConstants.Manager.CFG_TX_HDFS_USER); conf.set(TxConstants.Manager.CFG_TX_SNAPSHOT_DIR, tmpFolder.newFolder().getAbsolutePath()); return conf; }
Source:
<code>public void checkSelectedCellsWithHiddenColumnMultipleColumnsFirstHidden() { final GridColumn<String> column2 = new StringPopupColumn(new BaseHeaderMetaData("title"), columnRenderer, <START> 200.0); <END> this.model.appendColumn(column2); this.column.setVisible(false); setupSelectionContext(); checkRenderedSelectedCells(0, 0, 2, 1, 0, 0, column2.getWidth()); }</code><technical_language>makeGridColumn instead of calling StringPopupColumn</technical_language>

Target:
public void checkSelectedCellsWithHiddenColumnMultipleColumnsFirstHidden() { final GridColumn<String> column2 = makeGridColumn(200.0); this.model.appendColumn(column2); this.column.setVisible(false); setupSelectionContext(); checkRenderedSelectedCells(0, 0, 2, 1, 0, 0, column2.getWidth()); }
Source:
<code>public void init(final GlusterVolumeGeoRepActionConfirmationModel model) { super.init(model); model.getPropertyChangedEvent().addListener(new IEventListener<PropertyChangedEventArgs>() { @Override public void eventRaised(Event<? extends PropertyChangedEventArgs> ev, Object sender, PropertyChangedEventArgs args) { if(args.propertyName.equalsIgnoreCase("forceLabel")) { getView().setForceLabelMessage(model.getForceLabel()); } else if(args.propertyName.equalsIgnoreCase("forceHelp")) { getView().setForceHelp(model.getForceHelp()); } else if (args.propertyName.equalsIgnoreCase("Message")) { getView().setErrorMessage(model.getMessage()); } else <START> if(args.propertyName.equalsIgnoreCase("messageSet")) <END> { getView().setMessage(model.getMessage()); } } }); }</code><technical_language>ActionConfirmationText/ActionConfirmationMessage</technical_language>

Target:
public void init(final GlusterVolumeGeoRepActionConfirmationModel model) { super.init(model); model.getPropertyChangedEvent().addListener(new IEventListener<PropertyChangedEventArgs>() { @Override public void eventRaised(Event<? extends PropertyChangedEventArgs> ev, Object sender, PropertyChangedEventArgs args) { if(args.propertyName.equalsIgnoreCase("forceLabel")) { getView().setForceLabelMessage(model.getForceLabel()); } else if(args.propertyName.equalsIgnoreCase("forceHelp")) { getView().setForceHelp(model.getForceHelp()); } else if (args.propertyName.equalsIgnoreCase("Message")) { getView().setErrorMessage(model.getMessage()); } else if(args.propertyName.equalsIgnoreCase("ActionConfirmationMessage")) { getView().setActionConfirmationMessage(model.getMessage()); } } }); }
Source:
<code>protected void orchestrateMerge(MavenProject project) throws MavenExecutionException { mergeTiles(project); mergeModel(project, project.getArtifact().toString(), project.getFile(), "project"); <START> System.out.println("finished"); <END> }</code><technical_language>Ik. Maven logging facilities. them</technical_language>

Target:
protected void orchestrateMerge(MavenProject project) throws MavenExecutionException { Model ourPureModel = loadModel(getArtifactFromCoordinates(project.getGroupId(), project.getArtifactId(), project.getVersion())); Model propertyCollectionModel = project.getModel().clone(); collectTiles(propertyCollectionModel); resolveTiles(); Collections.reverse(tileDiscoveryOrder); mergePropertyModels(ourPureModel, propertyCollectionModel, project.getModel()); mergeModel(project.getModel(), ourPureModel); }
Source:
<code><START> public PageResult<Installation> findInstallationsByVariantForDeveloper(String variantID, String developer, Integer page, Integer pageSize) { <END> CriteriaBuilder builder = entityManager.getCriteriaBuilder(); CriteriaQuery<Installation> query = builder.createQuery(Installation.class); Root<Installation> v = query.from(Installation.class); final Join join = v.join("variant"); final Predicate[] predicates = getPredicates(variantID, developer, builder, join); query.where(predicates); List<Installation> result = entityManager.createQuery(query) .setFirstResult(page * pageSize).setMaxResults(pageSize).getResultList(); CriteriaQuery<Long> countQuery = builder.createQuery(Long.class); final Join<Object, Object> join1 = countQuery.from(Installation.class).join("variant"); countQuery.where(getPredicates(variantID, developer, builder, join1)); final Long count = entityManager.createQuery(countQuery.select(builder.count(join1))).getSingleResult(); return new PageResult<Installation>(result, count); }</code><technical_language>body of findInstallationsByVariant() findInstallationsByVariantForDeveloper() is similar (besides predicates), of call other one</technical_language>

Target:
public PageResult<Installation> findInstallationsByVariantForDeveloper(String variantID, String developer, Integer page, Integer pageSize) { final CriteriaBuilder builder = entityManager.getCriteriaBuilder(); final CriteriaQuery<Installation> query = builder.createQuery(Installation.class); Root<Installation> v = query.from(Installation.class); final Join join = v.join("variant"); final Predicate[] predicates = getPredicates(variantID, developer, builder, join); query.where(predicates); List<Installation> result = entityManager.createQuery(query) .setFirstResult(page * pageSize).setMaxResults(pageSize).getResultList(); CriteriaQuery<Long> countQuery = builder.createQuery(Long.class); final Join<Object, Object> join1 = countQuery.from(Installation.class).join("variant"); countQuery.where(getPredicates(variantID, developer, builder, join1)); final Long count = entityManager.createQuery(countQuery.select(builder.count(join1))).getSingleResult(); return new PageResult<Installation>(result, count); }
Source:
<code>public static void exposeResourcesToView(Map<String, String> resources, String host) { put(resources, host, "CATALOG_UTILS_JS", CATALOG_UTILS_JS); put(resources, host, "COLLECTION_INFO_JS", COLLECTION_INFO_JS); put(resources, host, "DATE_UTILS_JS", DATE_UTILS_JS); put(resources, host, "FAVICON_ICO", FAVICON_ICO); put(resources, host, "MAIN_CSS", MAIN_CSS); put(resources, host, "PARTICIPANT_ADD_JS", PARTICIPANT_ADD_JS); put(resources, host, "SERIES_ADD_JS", SERIES_ADD_JS); put(resources, host, "SERIES_INFO_JS", SERIES_INFO_JS); put(resources, host, "SALE_IMPORT_FORM_JS", SALE_IMPORT_FORM_JS); put(resources, host, "SIMILAR_SERIES_FORM_JS", SIMILAR_SERIES_FORM_JS); put(resources, host, "ADD_COMMENT_FORM_JS", ADD_COMMENT_FORM_JS); put(resources, host, "CATALOG_PRICE_FORM_JS", CATALOG_PRICE_FORM_JS); put(resources, host, "CATALOG_NUMBERS_FORM_JS", CATALOG_NUMBERS_FORM_JS); put(resources, host, "RELEASE_YEAR_FORM_JS", RELEASE_YEAR_FORM_JS); <START> put(resources, host, "SERIES_SALES_BLOCK_JS", SERIES_SALES_BLOCK_JS); <END> }</code><technical_language>suggestion put(resources, host, "SERIES_SALES_LIST_JS", SERIES_SALES_LIST_JS);</technical_language>

Target:
public static void exposeResourcesToView(Map<String, String> resources, String host) { put(resources, host, "CATALOG_UTILS_JS", CATALOG_UTILS_JS); put(resources, host, "COLLECTION_INFO_JS", COLLECTION_INFO_JS); put(resources, host, "DATE_UTILS_JS", DATE_UTILS_JS); put(resources, host, "FAVICON_ICO", FAVICON_ICO); put(resources, host, "MAIN_CSS", MAIN_CSS); put(resources, host, "PARTICIPANT_ADD_JS", PARTICIPANT_ADD_JS); put(resources, host, "SERIES_ADD_JS", SERIES_ADD_JS); put(resources, host, "SERIES_INFO_JS", SERIES_INFO_JS); put(resources, host, "SALE_IMPORT_FORM_JS", SALE_IMPORT_FORM_JS); put(resources, host, "SIMILAR_SERIES_FORM_JS", SIMILAR_SERIES_FORM_JS); put(resources, host, "ADD_COMMENT_FORM_JS", ADD_COMMENT_FORM_JS); put(resources, host, "CATALOG_PRICE_FORM_JS", CATALOG_PRICE_FORM_JS); put(resources, host, "CATALOG_NUMBERS_FORM_JS", CATALOG_NUMBERS_FORM_JS); put(resources, host, "RELEASE_YEAR_FORM_JS", RELEASE_YEAR_FORM_JS); put(resources, host, "SERIES_SALES_LIST_JS", SERIES_SALES_LIST_JS); }
Source:
<code>public boolean tryDelete() { try { <START> if (deleteHandler == null) { <END> return false; } return deleteHandler.apply(this); } catch (Exception e) { throw handleErrorInCallback(e, "deleteHandler"); } }</code><technical_language>I inverting this if check improve readability/flow woudl consistent other methods in this class</technical_language>

Target:
public boolean tryDelete() { try { if (!canDelete()) { return false; } return deleteHandler.apply(this); } catch (Exception e) { throw handleErrorInCallback(e, "deleteHandler"); } }
Source:
<code>List<ItemDefinition> itemDefinitions() { <START> return dmnGraphUtils.getDefinitions().getItemDefinition(); <END> }</code><technical_language>please prevent NPE here? src/main/java/org/kie/workbench/common/dmn/client/editors/types/persistence/handlers/ItemDefinitionDestroyHandler.java:78: error: NULL_DEREFERENCE object returned ItemDefinitionDestroyHandler.dmnGraphUtils.getDefinitions() null is dereferenced line 78. 76. 77. List<ItemDefinition> itemDefinitions() { 78. > return dmnGraphUtils.getDefinitions().getItemDefinition(); 79. } 80</technical_language>

Target:
List<ItemDefinition> itemDefinitions() { final Optional<Definitions> definitions = Optional.ofNullable(dmnGraphUtils.getDefinitions()); if (definitions.isPresent()) { return definitions.get().getItemDefinition(); } return new ArrayList<>(); }