auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void testWriteOrdering() throws Exception { WriteBehindTestLoaderWriter<String, String> loaderWriter = new WriteBehindTestLoaderWriter<String, String>(); CacheLoaderWriterProvider cacheLoaderWriterProvider = mock(CacheLoaderWriterProvider.class); when(cacheLoaderWriterProvider.createCacheLoaderWriter(anyString(), (CacheConfiguration<String, String>)anyObject())).thenReturn((CacheLoaderWriter)loaderWriter); CacheManager cacheManager = newCacheManagerBuilder().using(cacheLoaderWriterProvider).build(true); try { Cache<String, String> testCache = cacheManager.createCache("testWriteOrdering", configurationBuilder() .add(newWriteBehindConfiguration().queueSize(10).batchSize(10).delay(1, 2).build()) .buildConfig(String.class, String.class)); CountDownLatch countDownLatch = new CountDownLatch(8); loaderWriter.setLatch(countDownLatch); testCache.remove("key"); testCache.put("key", "value1"); testCache.remove("key"); testCache.put("key", "value2"); testCache.remove("key"); testCache.put("key", "value3"); testCache.remove("key"); <START> testCache.put("key", "value4"); <END> countDownLatch.await(4, TimeUnit.SECONDS); assertThat(loaderWriter.getData().get("key"), contains(null, "value1", null, "value2", null, "value3", null, "value4")); } finally { cacheManager.close(); } }</code><technical_language>do do 8 operations batch is configured 10? This forces system wait for max delay</technical_language>

Target:
public void testWriteOrdering() throws Exception { WriteBehindTestLoaderWriter<String, String> loaderWriter = new WriteBehindTestLoaderWriter<String, String>(); CacheLoaderWriterProvider cacheLoaderWriterProvider = mock(CacheLoaderWriterProvider.class); when(cacheLoaderWriterProvider.createCacheLoaderWriter(anyString(), (CacheConfiguration<String, String>)anyObject())).thenReturn((CacheLoaderWriter)loaderWriter); CacheManager cacheManager = newCacheManagerBuilder().using(cacheLoaderWriterProvider).build(true); try { Cache<String, String> testCache = cacheManager.createCache("testWriteOrdering", configurationBuilder() .add(newWriteBehindConfiguration().batchSize(8).build()) .buildConfig(String.class, String.class)); CountDownLatch countDownLatch = new CountDownLatch(8); loaderWriter.setLatch(countDownLatch); testCache.remove("key"); testCache.put("key", "value1"); testCache.remove("key"); testCache.put("key", "value2"); testCache.remove("key"); testCache.put("key", "value3"); testCache.remove("key"); testCache.put("key", "value4"); countDownLatch.await(4, TimeUnit.SECONDS); assertThat(loaderWriter.getData().get("key"), contains(null, "value1", null, "value2", null, "value3", null, "value4")); } finally { cacheManager.close(); } }
Source:
<code>public void initialize() { Configuration configuration = getConfig(); if (configuration.get("udn") != null) { logger.debug("Initializing WemoHandler for UDN '{}'", configuration.get("udn")); <START> if (service.isRegistered(this)) { <END> logger.debug("Setting up UPnP status Listener for '{}'", this); service.addStatusListener(this, "basicevent1", "GetBinaryState", 60); } super.initialize(); } else { logger.debug("Cannot initalize WemoHandler. UDN not set."); } }</code><technical_language>if is registered time handler is initialized, add a status listener then</technical_language>

Target:
public void initialize() { Configuration configuration = getConfig(); if (configuration.get("udn") != null) { logger.debug("Initializing WemoHandler for UDN '{}'", configuration.get("udn")); onSubscription(); onUpdate(); super.initialize(); } else { logger.debug("Cannot initalize WemoHandler. UDN not set."); } }
Source:
<code>private void checkLoopbackHost(HttpUrl url) { try { for (InetAddress addr : InetAddress.getAllByName(url.host())) { if (!addr.isLoopbackAddress()) { <START> throw new IllegalArgumentException(url.host() + " is not loopback only host"); <END> } } } catch (UnknownHostException e) { throw new IllegalStateException("Host in " + url + " is not loopback address"); } }</code><technical_language>if IllegalArgumentException is right choice for exceptions in this class</technical_language>

Target:
private void checkLoopbackHost(HttpUrl url) { try { for (InetAddress addr : InetAddress.getAllByName(url.host())) { if (!addr.isLoopbackAddress()) { throw new ProviderException(url.host() + " is not loopback only host"); } } } catch (UnknownHostException e) { throw new ProviderException("Host in " + url + " is not loopback address"); } }
Source:
<code>public void testMissingParameterWithVarArgs() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); StringBuffer buf= new StringBuffer(); buf.append("package test1;\n"); buf.append("public class ArrayTest {\n"); buf.append(" public void test(String a, String...b){\n"); buf.append(" a.concat(c);\n"); buf.append(" }\n"); buf.append("}\n"); ICompilationUnit cu= pack1.createCompilationUnit("ArrayTest.java", buf.toString(), false, null); CompilationUnit astRoot= getASTRoot(cu); ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cu, astRoot); assertCorrectLabels(proposals); <START> assertNumberOfProposals(proposals, 5); <END> String[] expected= new String[1]; buf= new StringBuffer(); buf.append("package test1;\n"); buf.append("public class ArrayTest {\n"); buf.append(" public void test(String a, String c, String...b){\n"); buf.append(" a.concat(c);\n"); buf.append(" }\n"); buf.append("}\n"); expected[0]= buf.toString(); assertExpectedExistInProposals(proposals, expected); }</code><technical_language>I remove 2 'assertNumberOfProposals(...);' lines (here, in testMissingParameterWithoutVarArgs) this change need depend number of expected proposals. fail needlessly if contributed another proposal apply</technical_language>

Target:
public void testMissingParameterWithVarArgs() throws Exception { IPackageFragment pack1= fSourceFolder.createPackageFragment("test1", false, null); StringBuffer buf= new StringBuffer(); buf.append("package test1;\n"); buf.append("public class ArrayTest {\n"); buf.append(" public void test(String a, String...b){\n"); buf.append(" a.concat(c);\n"); buf.append(" }\n"); buf.append("}\n"); ICompilationUnit cu= pack1.createCompilationUnit("ArrayTest.java", buf.toString(), false, null); CompilationUnit astRoot= getASTRoot(cu); ArrayList<IJavaCompletionProposal> proposals= collectCorrections(cu, astRoot); assertCorrectLabels(proposals); String[] expected= new String[1]; buf= new StringBuffer(); buf.append("package test1;\n"); buf.append("public class ArrayTest {\n"); buf.append(" public void test(String a, String c, String...b){\n"); buf.append(" a.concat(c);\n"); buf.append(" }\n"); buf.append("}\n"); expected[0]= buf.toString(); assertExpectedExistInProposals(proposals, expected); }
Source:
<code>public HAProxyMessage touch(Object hint) { <START> tryRecord(); <END> return this; }</code><technical_language>for this need duplicate code pass hint</technical_language>

Target:
public HAProxyMessage touch(Object hint) { if (leak != null) { leak.record(hint); } return this; }
Source:
<code><START> public boolean teleportToSpawn() { <END> Location target = server.getWorlds().get(0).getSpawnLocation(); EntityPortalEvent event = EventFactory.callEvent(new EntityPortalEvent(this, location.clone(), target, null)); if (event.isCancelled()) { return false; } target = event.getTo(); teleport(target); return true; }</code><technical_language>Do this other method need public? protected suffice</technical_language>

Target:
protected boolean teleportToSpawn() { Location target = server.getWorlds().get(0).getSpawnLocation(); EntityPortalEvent event = EventFactory.callEvent(new EntityPortalEvent(this, location.clone(), target, null)); if (event.isCancelled()) { return false; } target = event.getTo(); teleport(target); return true; }
Source:
<code>public ActionResponseDto execute(final ClientConnection conn, final DlmsDevice device, final FindEventsQueryDto findEventsQuery) { List<EventDto> eventDtoList; try { <START> eventDtoList = this.retrieveEventsCommandExecutor.execute(conn, device, findEventsQuery); <END> } catch (final ProtocolAdapterException e) { LOGGER.error("Error while retrieving " + findEventsQuery.getEventLogCategory() + "events from device: " + device.getDeviceIdentification(), e); return new ActionResponseDto(e, "Error while retrieving " + findEventsQuery.getEventLogCategory() + "events from device: " + device.getDeviceIdentification()); } return new EventMessageDataContainerDto(eventDtoList); }</code><technical_language>better: return new EventMessageDataContainerDto(this.retrieveEventsCommandExecutor.execute(conn, device, findEventsQuery));</technical_language>

Target:
public ActionResponseDto execute(final ClientConnection conn, final DlmsDevice device, final FindEventsQueryDto findEventsQuery) { try { return new EventMessageDataContainerDto(this.retrieveEventsCommandExecutor.execute(conn, device, findEventsQuery)); } catch (final ProtocolAdapterException e) { LOGGER.error("Error while retrieving " + findEventsQuery.getEventLogCategory() + "events from device: " + device.getDeviceIdentification(), e); return new ActionResponseDto(e, "Error while retrieving " + findEventsQuery.getEventLogCategory() + "events from device: " + device.getDeviceIdentification()); } }
Source:
<code>private HostVO getHost(SnapshotInfo snapshotInfo) { HostVO hostVO = getHost(snapshotInfo.getDataCenterId(), true); if (hostVO == null) { hostVO = getHost(snapshotInfo.getDataCenterId(), false); if (hostVO == null) { <START> throw new CloudRuntimeException("Unable to locate an applicable host"); <END> } } return hostVO; }</code><technical_language>Please include datacenter id in message assist operational debugging</technical_language>

Target:
private HostVO getHost(SnapshotInfo snapshotInfo) { HostVO hostVO = getHost(snapshotInfo.getDataCenterId(), true); if (hostVO == null) { hostVO = getHost(snapshotInfo.getDataCenterId(), false); if (hostVO == null) { throw new CloudRuntimeException("Unable to locate an applicable host in data center with ID = " + snapshotInfo.getDataCenterId()); } } return hostVO; }
Source:
<code>public Map<ShortBranchIssue, DefaultIssue> loadDefaultIssuesWithChanges(Collection<ShortBranchIssue> lightIssues) { if (lightIssues.isEmpty()) { return Collections.emptyMap(); } Map<String, ShortBranchIssue> issuesByKey = lightIssues.stream().collect(Collectors.toMap(ShortBranchIssue::getKey, i -> i)); try (DbSession session = dbClient.openSession(false)) { Map<String, List<IssueChangeDto>> changeDtoByIssueKey = dbClient.issueChangeDao() .selectByIssueKeys(session, issuesByKey.keySet()).stream().collect(groupingBy(IssueChangeDto::getIssueKey)); return dbClient.issueDao().selectByKeys(session, issuesByKey.keySet()) .stream() .map(IssueDto::toDefaultIssue) <START> .map(i -> setChanges(changeDtoByIssueKey, i)) <END> .collect(Collectors.toMap(i -> issuesByKey.get(i.key()), i -> i)); } }</code><technical_language>curiosity, setChanges() need return object peek()</technical_language>

Target:
public Map<ShortBranchIssue, DefaultIssue> loadDefaultIssuesWithChanges(Collection<ShortBranchIssue> lightIssues) { if (lightIssues.isEmpty()) { return Collections.emptyMap(); } Map<String, ShortBranchIssue> issuesByKey = lightIssues.stream().collect(Collectors.toMap(ShortBranchIssue::getKey, i -> i)); try (DbSession session = dbClient.openSession(false)) { Map<String, List<IssueChangeDto>> changeDtoByIssueKey = dbClient.issueChangeDao() .selectByIssueKeys(session, issuesByKey.keySet()).stream().collect(groupingBy(IssueChangeDto::getIssueKey)); return dbClient.issueDao().selectByKeys(session, issuesByKey.keySet()) .stream() .map(IssueDto::toDefaultIssue) .peek(i -> ComponentIssuesLoader.setChanges(changeDtoByIssueKey, i)) .collect(toMap(i -> issuesByKey.get(i.key()), i -> i)); } }
Source:
<code>private void onRemove() { AsyncDataProvider.getInstance().getDataCentersByStorageDomain(new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { TemplateBackupModel templateBackupModel = (TemplateBackupModel) model; ArrayList<StoragePool> pools = (ArrayList<StoragePool>) returnValue; if (pools != null && pools.size() > 0) { StoragePool pool = pools.get(0); getVmsFromExportDomain(pool.getId(), <START> getEntity().getId()); <END> } } }), getEntity().getId()); cancel(); }</code><technical_language>this method renamed checkVmsDependentOnTemplate() similar</technical_language>

Target:
private void onRemove() { cancel(); AsyncDataProvider.getInstance().getDataCentersByStorageDomain(new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { TemplateBackupModel templateBackupModel = (TemplateBackupModel) model; ArrayList<StoragePool> pools = (ArrayList<StoragePool>) returnValue; if (pools != null && pools.size() > 0) { pool = pools.get(0); getVmsFromExportDomain(pool.getId(), getEntity().getId()); } } }), getEntity().getId()); }
Source:
<code>public void testLeaderDiesAndNewLeaderIsElected() { ICluster seed = Cluster.joinAwait(); LeaderElection seedLeader = createLeaderElection(seed); List<LeaderElection> leaders = createCluster(seed); <START> awaitSeconds(30); <END> killTheLeader(leaders,seedLeader.leader()); awaitSeconds(30); Address newLeader = seedLeader.leader(); for (LeaderElection m : leaders) { Address memberLeaderAddress = m.leader(); assertTrue("Expected leader address " + newLeader + ", but actual: " + memberLeaderAddress, memberLeaderAddress.equals(newLeader)); } for (LeaderElection m : leaders) { m.cluster().shutdown(); } seed.shutdown(); }</code><technical_language>Is required wait 30 seconds select leader?! is expect time for implemented algorithm choose leader? Please put small timeout is required choose leader. put 30 seconds sleep in other places well</technical_language>

Target:
public void testLeaderDiesAndNewLeaderIsElected() { ICluster seed = Cluster.joinAwait(); LeaderElection seedLeader = createLeaderElection(seed); Queue<LeaderElection> leaders = createCluster(seed, NUM_OF_NODES); awaitSeconds(3); killTheLeader(leaders, seedLeader.leader()); awaitSeconds(3); Member newLeader = leaders.peek().leader(); for (LeaderElection m : leaders) { Address memberLeaderAddress = m.leader().address(); assertTrue("Expected leader address " + newLeader.address() + ", but actual: " + memberLeaderAddress, memberLeaderAddress.equals(newLeader.address())); } teardownCluster(seed, leaders); }
Source:
<code><START> public static void validateNonNegative(int[] data, String paramName){ <END> boolean nonnegative = true; for(int value : data){ if(value < 0) { nonnegative = false; } } Preconditions.checkArgument(nonnegative, "Values for %s must be >= 0, got: %s", paramName, data); }</code><technical_language>Handling of nulls? some in methods, here... If null is acceptable, return null here. If not, add a lombok @NonNull a Preconditions.checkNotNull(. present, nulls give a non-useful NPE</technical_language>

Target:
public static void validateNonNegative(int[] data, String paramName){ if(data == null) { return; } boolean nonnegative = true; for(int value : data){ if(value < 0) { nonnegative = false; } } Preconditions.checkArgument(nonnegative, "Values for %s must be >= 0, got: %s", paramName, data); }
Source:
<code>public Path generateArtifact(PypiArtifactCoordinates coordinates, long byteSize) throws IOException { String packagePath = coordinates.toPath(); Path fullPath = basedir.resolve(packagePath); <START> new File(fullPath.getParent().toString()).mkdirs(); <END> Path path = Paths.get(fullPath.toString()); OutputStream outputStream = Files.newOutputStream(path, CREATE); try(ZipOutputStream zos = new ZipOutputStream(outputStream)) { if (coordinates.isSourcePackage()) { createSourcePackageFiles(zos, coordinates.getId(), coordinates.getVersion(), byteSize); } else { createWheelPackageFiles(zos, coordinates.getId(), coordinates.getVersion(), byteSize); } } return path; }</code><technical_language>Please, Java NIO.2 possible: suggestion Path fullPathParent = fullPath.getParent(); Files.createDirectories(fullPathParent);</technical_language>

Target:
public Path generateArtifact(PypiArtifactCoordinates coordinates, long byteSize) throws IOException { String packagePath = coordinates.toPath(); Path fullPath = basedir.resolve(packagePath); Path fullPathParent = fullPath.getParent(); Files.createDirectories(fullPathParent); OutputStream outputStream = Files.newOutputStream(fullPath, CREATE); try(ZipOutputStream zos = new ZipOutputStream(outputStream)) { if (coordinates.isSourcePackage()) { createSourcePackageFiles(zos, coordinates.getId(), coordinates.getVersion(), byteSize); } else { createWheelPackageFiles(zos, coordinates.getId(), coordinates.getVersion(), byteSize); } } return fullPath; }
Source:
<code><START> public ITmfTimestamp getCurrentTime() { <END> return getCurrentTraceContext().getTimestamp(); }</code><technical_language>Add synchronized this method</technical_language>

Target:
public synchronized ITmfTimestamp getCurrentTime() { return getCurrentTraceContext().getTimestamp(); }
Source:
<code>private String getUrl(Object eventData) { <START> if (eventData == null) { return null; } <END> if (eventData == null || !(eventData instanceof String)) { return null; } String[] dataLines = ((String) eventData) .split(System.getProperty("line.separator")); String url = dataLines[0]; return url; }</code><technical_language>removed</technical_language>

Target:
private String getUrl(Object eventData) { if (!(eventData instanceof String)) { return null; } String[] dataLines = ((String) eventData) .split(System.getProperty("line.separator")); String url = dataLines[0]; return url; }
Source:
<code>public void cursorError1(SQLiteDatabase db, long route_id) { Cursor cursor = db.query("TABLE_TRIPS", new String[]{ "KEY_TRIP_ID" }, "ROUTE_ID=?", new String[]{Long.toString(route_id)}, null, null, null); <START> cursor.close(); <END> }</code><technical_language>Apparently bad practice: * <LINK_0> * <LINK_1> Phew! I worried for a second. I AutoRefactor do right here, i.e. a try / finally block</technical_language>

Target:
public void cursorError1(SQLiteDatabase db, long route_id) { Cursor cursor = db.query("TABLE_TRIPS", new String[]{ "KEY_TRIP_ID" }, "ROUTE_ID=?", new String[]{Long.toString(route_id)}, null, null, null); if (cursor != null) { cursor.close(); } }
Source:
<code>private void getRevisions() { gitService.log(workspaceId, project, Collections.singletonList(selectedFile), false, new AsyncRequestCallback<LogResponse>(dtoUnmarshallerFactory.newUnmarshaller(LogResponse.class)) { @Override protected void onSuccess(LogResponse result) { view.setRevisions(result.getCommits()); view.showDialog(); } @Override protected void onFailure(Throwable exception) { <START> notificationManager.notify(exception.getMessage(), FAIL, false); <END> } }); }</code><technical_language>org.eclipse.che.ide.ext.git.client.GitLocalizationConstant#logFailed message instead of exception.getMessage()</technical_language>

Target:
private void getRevisions() { gitService.log(workspaceId, project, Collections.singletonList(selectedFile), false, new AsyncRequestCallback<LogResponse>(dtoUnmarshallerFactory.newUnmarshaller(LogResponse.class)) { @Override protected void onSuccess(LogResponse result) { view.setRevisions(result.getCommits()); view.showDialog(); } @Override protected void onFailure(Throwable exception) { notificationManager.notify(locale.logFailed(), FAIL, false); } }); }
Source:
<code>public void setUp() throws Exception { serverToClientReadyLatch = new CountDownLatch(1); messagesReceivedByFafServer = new ArrayBlockingQueue<>(10); startFakeFafLobbyServer(); final Server server = mock(Server.class); when(server.getHost()).thenReturn(LOOPBACK_ADDRESS.getHostAddress()); when(server.getPort()).thenReturn(fafLobbyServerSocket.getLocalPort()); <START> when(clientProperties.getServer()).thenReturn(server); <END> instance = new FafServerAccessorImpl(preferencesService, uidService, notificationService, i18n, reportingService, clientProperties); instance.afterPropertiesSet(); LoginPrefs loginPrefs = new LoginPrefs(); loginPrefs.setUsername("junit"); loginPrefs.setPassword("password"); when(preferencesService.getFafDataDirectory()).thenReturn(faDirectory.getRoot().toPath()); when(uidService.generate(any(), any())).thenReturn("encrypteduidstring"); }</code><technical_language>dont wanna change</technical_language>

Target:
public void setUp() throws Exception { serverToClientReadyLatch = new CountDownLatch(1); messagesReceivedByFafServer = new ArrayBlockingQueue<>(10); startFakeFafLobbyServer(); ClientProperties clientProperties = new ClientProperties(); clientProperties.getServer() .setHost(LOOPBACK_ADDRESS.getHostAddress()) .setPort(fafLobbyServerSocket.getLocalPort()); instance = new FafServerAccessorImpl(preferencesService, uidService, notificationService, i18n, reportingService, clientProperties); instance.afterPropertiesSet(); LoginPrefs loginPrefs = new LoginPrefs(); loginPrefs.setUsername("junit"); loginPrefs.setPassword("password"); when(preferencesService.getFafDataDirectory()).thenReturn(faDirectory.getRoot().toPath()); when(uidService.generate(any(), any())).thenReturn("encrypteduidstring"); }
Source:
<code>protected File createAllowedTargetDirectory() throws IOException { <START> File directory = File.createTempFile("target", "", new File("/tmp")); <END> directory.delete(); directory.mkdirs(); return directory; }</code><technical_language>this directory allowed compared created Framework.createTempDirectory? avoid hardcoding /tmp</technical_language>

Target:
protected File createAllowedTargetDirectory() throws IOException { File directory = File.createTempFile("target", "", FileUtils.getTempDirectory().getParentFile().getParentFile()); directory.delete(); directory.mkdirs(); return directory; }
Source:
<code>public void execute(SensorContext context) { BiConsumer<Exception, InputFile> parsingExceptionHandler = parsingExceptionHandler(context); for (InputFile inputFile : fileSystem.inputFiles(mainFilesPredicate)) { XmlFile xmlFile = new XmlFile(inputFile, fileSystem); try { NewXmlFile newXmlFile = NewXmlFile.create(inputFile); LineCounter.analyse(context, fileLinesContextFactory, newXmlFile); runChecks(context, xmlFile, newXmlFile); } catch (Exception e) { <START> processParseException(e, context, inputFile, parsingExceptionHandler); <END> } } }</code><technical_language>catch exception checks separately</technical_language>

Target:
public void execute(SensorContext context) { for (InputFile inputFile : fileSystem.inputFiles(mainFilesPredicate)) { XmlFile xmlFile = new XmlFile(inputFile, fileSystem); try { NewXmlFile newXmlFile = NewXmlFile.create(inputFile); LineCounter.analyse(context, fileLinesContextFactory, newXmlFile); runChecks(context, xmlFile, newXmlFile); saveSyntaxHighlighting(context, XMLHighlighting.highlight(newXmlFile), inputFile); } catch (Exception e) { processParseException(e, context, inputFile); } } }
Source:
<code>public void initFromPage(int valueCount, ByteBuffer in, int offset) throws IOException { if (DEBUG) LOG.debug("init from page at offset "+ offset + " for length " + (in.limit() - offset)); <START> this.in = new LittleEndianDataInputStream(new ByteBufferInputStream(in.duplicate(), offset, in.limit() - offset)); <END> }</code><technical_language>add in.toInputStream()</technical_language>

Target:
public void initFromPage(int valueCount, ByteBuffer in, int offset) throws IOException { if (DEBUG) LOG.debug("init from page at offset "+ offset + " for length " + (in.limit() - offset)); this.in = new LittleEndianDataInputStream(toInputStream(in, offset)); }
Source:
<code><START> public void tessellateAllExcept(Tessellator tessellator, String... excludedGroupNames) <END> { for (GroupObject groupObject : groupObjects) { for (String excludedGroupName : excludedGroupNames) { if (!excludedGroupName.equalsIgnoreCase(groupObject.name)) { groupObject.render(tessellator); } } } }</code><technical_language>This method work supposed to. Fixed this for normal function in this PR: <LINK_0></technical_language>

Target:
public void tessellateAllExcept(Tessellator tessellator, String... excludedGroupNames) { boolean exclude; for (GroupObject groupObject : groupObjects) { exclude=false; for (String excludedGroupName : excludedGroupNames) { if (excludedGroupName.equalsIgnoreCase(groupObject.name)) { exclude=true; } } if(!exclude) { groupObject.render(tessellator); } } }
Source:
<code>public void testPoolOfGivenGuidExist() { final MacPoolPerDc pool = new MacPoolPerDc(); mockStoragePools(storagePool); mockGettingAllMacPools(macPool); pool.initialize(); <START> assertThat(pool.getMacPoolId(storagePool.getId()), is(notNullValue())); <END> assertThat(pool.poolForDataCenter(storagePool.getId()), is(notNullValue())); }</code><technical_language>testing this method public</technical_language>

Target:
public void testPoolOfGivenGuidExist() { final MacPoolPerDc pool = new MacPoolPerDc(); mockStoragePool(storagePool); mockGettingAllMacPools(macPool); pool.initialize(); assertThat(pool.poolForDataCenter(storagePool.getId()), is(notNullValue())); }
Source:
<code>protected Observable<Integer> getSenderObservable(TagList tags, Metric[] batch) { JsonPayload payload = new UpdateRequest(tags, batch, batch.length); if (shouldDumpPayload()) { try { String name = getPayloadFilename(); <START> File out = new File(getPayloadDirectory(), name); <END> JsonGenerator generator = factory.createGenerator(out, JsonEncoding.UTF8); payload.toJson(generator); } catch (Exception ex) { LOGGER.debug("Ignoring error writing payload sent to atlas: {}", ex.getMessage()); } } return httpHelper.postSmile(config.getAtlasUri(), payload) .map(withBookkeeping(batch.length)); }</code><technical_language>Consider Files.createTempFile</technical_language>

Target:
protected Observable<Integer> getSenderObservable(TagList tags, Metric[] batch) { JsonPayload payload = new UpdateRequest(tags, batch, batch.length); if (shouldDumpPayload()) { String name = getPayloadFilename(); File out = new File(getPayloadDirectory(), name); dumpPayload(out, payload); } return httpHelper.postSmile(config.getAtlasUri(), payload) .map(withBookkeeping(batch.length)); }
Source:
<code>public Class<?> lookupDefinedClass(String name) { <START> return defined.get(name.replace('/', '.')); <END> }</code><technical_language>recurrent patterns: - name.replace('/', '.') slashes periods (used times) - ASMHelper:periodToSlashes periods slashes extract org.apache.cxf.common.util.StringUtils (and drop method ASMHelper interface)</technical_language>

Target:
public Class<?> lookupDefinedClass(String name) { return defined.get(StringUtils.slashesToPeriod(name)); }
Source:
<code>public double getFlySpeed() { <START> return flySpeed; <END> }</code><technical_language>this</technical_language>

Target:
public double getFlySpeed() { return this.flySpeed; }
Source:
<code>public void split(TableName tableName, byte[] bytes) throws IOException { <START> LOG.info("split is a no-op"); <END> }</code><technical_language>warning</technical_language>

Target:
public void split(TableName tableName, byte[] bytes) throws IOException { throw new UnsupportedOperationException("split"); }
Source:
<code>public void whenRemoveThenDeleteFromDatabase() throws Exception { EventType eventType = buildEventType(); <START> String insertSQL = "INSERT INTO zn_data.event_type (et_name, et_event_type_object) VALUES (?, to_json(?::json))"; <END> template.update(insertSQL, eventType.getName(), mapper.writer().writeValueAsString(eventType)); repository.removeEventType(eventType.getName()); final int rows = template.queryForObject("SELECT count(*) FROM zn_data.event_type", Integer.class); assertThat("Number of rows should encrease", rows, equalTo(0)); }</code><technical_language>saveEventType(eventType) here? avoid touching of this code if table structure change in a future</technical_language>

Target:
public void whenRemoveThenDeleteFromDatabase() throws Exception { EventType eventType = buildEventType(); insertEventType(eventType); repository.removeEventType(eventType.getName()); final int rows = template.queryForObject("SELECT count(*) FROM zn_data.event_type", Integer.class); assertThat("Number of rows should encrease", rows, equalTo(0)); }
Source:
<code>public void close() { if (!isShutDown) { executor.shutdownNow(); wakeIndefiniteBlockers(); callOnClose.run(); } isShutDown = true; <START> } <END></code><technical_language>Hmm. This generally fixes issue, is thread-safe; if threads call close() concurrently enter if-block, callOnClose is arbitrary Runnable necessarily idempotent. Minimal fix synchronize this (people depend close super performant). A fix AtomicBoolean idea mention</technical_language>

Target:
public void close() { if (isShutDown.compareAndSet(false, true)) { executor.shutdownNow(); wakeIndefiniteBlockers(); callOnClose.run(); } }
Source:
<code>private static String replaceChipset(String emulatedMachine, ChipsetType chipsetType) { if (chipsetType != ChipsetType.Q35) { return emulatedMachine; } if <START> (emulatedMachine.contains("i440fx")) { <END> return emulatedMachine.replace("i440fx", "q35"); } return emulatedMachine.replace("pc-", "pc-q35-"); }</code><technical_language>more sense replace string ChipsetType.I440FX.getChipsetName() ? replace "q35" ChipsetType.Q35.getChipsetName()</technical_language>

Target:
private static String replaceChipset(String emulatedMachine, ChipsetType chipsetType) { if (chipsetType != ChipsetType.Q35) { return emulatedMachine; } final String I440FX_CHIPSET_NAME = ChipsetType.I440FX.getChipsetName(); final String Q35_CHIPSET_NAME = ChipsetType.Q35.getChipsetName(); if (emulatedMachine.contains(I440FX_CHIPSET_NAME)) { return emulatedMachine.replace(I440FX_CHIPSET_NAME, Q35_CHIPSET_NAME); } return emulatedMachine.replace("pc-", "pc-" + Q35_CHIPSET_NAME + '-'); }
Source:
<code>protected DestroyImageParameters buildDestroyImageParameters(Guid imageGroupId, List<Guid> imageList) { <START> StorageDomain storageDomain = storageDomainDao.get(getParameters().getStorageDomainId()); <END> DestroyImageParameters parameters = new DestroyImageParameters( getVdsId(), getVmId(), getParameters().getStoragePoolId(), storageDomain.getId(), imageGroupId, imageList, storageDomain.getWipeAfterDelete(), false); parameters.setEndProcedure(ActionParametersBase.EndProcedure.COMMAND_MANAGED); parameters.setParentParameters(getParameters()); return parameters; }</code><technical_language>improve this getStorageDomain() instead</technical_language>

Target:
protected DestroyImageParameters buildDestroyImageParameters(Guid imageGroupId, List<Guid> imageList) { StorageDomain storageDomain = getStorageDomain(); DestroyImageParameters parameters = new DestroyImageParameters( getVdsId(), getVmId(), getParameters().getStoragePoolId(), storageDomain.getId(), imageGroupId, imageList, storageDomain.getWipeAfterDelete(), false); parameters.setEndProcedure(ActionParametersBase.EndProcedure.COMMAND_MANAGED); parameters.setParentParameters(getParameters()); return parameters; }
Source:
<code>public void testGetJsonString() throws Exception { StudentProfileAttributes spa = StudentProfileAttributes.valueOf(profile.toEntity()); spa.modifiedDate = TimeHelper.convertToDate("2015-05-21 8:34 AM UTC"); assertEquals("{\n \"googleId\": \"valid.googleId\",\n \"shortName\": \"shor\"," + "\n \"email\": \"valid@email.com\",\n \"institute\": \"institute\"," <START> + "\n \"nationality\": \"Lebanese\",\n \"gender\": \"OTHER\"," <END> + "\n \"moreInfo\": \"moreInfo can have a lot more than this...\"," + "\n \"pictureKey\": \"profile Pic Key\"," + "\n \"modifiedDate\": \"2015-05-21 8:34 AM +0000\"\n}", spa.getJsonString()); }</code><technical_language>Minor: enum</technical_language>

Target:
public void testGetJsonString() throws Exception { StudentProfileAttributes spa = StudentProfileAttributes.valueOf(profile.toEntity()); spa.modifiedDate = TimeHelper.convertToDate("2015-05-21 8:34 AM UTC"); assertEquals("{\n \"googleId\": \"valid.googleId\",\n \"shortName\": \"shor\"," + "\n \"email\": \"valid@email.com\",\n \"institute\": \"institute\"," + "\n \"nationality\": \"Lebanese\",\n \"gender\": \"female\"," + "\n \"moreInfo\": \"moreInfo can have a lot more than this...\"," + "\n \"pictureKey\": \"profile Pic Key\"," + "\n \"modifiedDate\": \"2015-05-21 8:34 AM +0000\"\n}", spa.getJsonString()); }
Source:
<code>private String getProjectName() throws Exception { String url = serverUrl + API_PROJECT_NAME + "?format=json" + "&key=" + projectKey; String http = client.getHttp(url, username, password); JSONArray jsonArray = (JSONArray) JSONSerializer.toJSON(http); if (jsonArray.size() != 1) { <START> throw new Exception("Can't find project " + projectKey + ". Number of projects found: " + jsonArray.size()); <END> } JSONObject obj = jsonArray.getJSONObject(0); return obj.getString("nm"); }</code><technical_language>![MAJOR](<LINK_0> Define throw a dedicated exception instead of a generic one. [![rule](<LINK_2>](<LINK_1></technical_language>

Target:
private String getProjectName() throws Exception { String url = serverUrl + API_PROJECT_NAME + encode(projectKey); String http = client.getHttp(url, username, password); JSONArray jsonArray = (JSONArray) JSONSerializer.toJSON(http); if (jsonArray.size() != 1) { throw new Exception("Can't find project " + projectKey + ". Number of projects found: " + jsonArray.size()); } JSONObject obj = jsonArray.getJSONObject(0); return obj.getString("nm"); }
Source:
<code>public void shouldReturnNotEnrolledWhenProgramEnrollmentNotFoundForLookupByUuidAndProgramName() { String className = ProgramEnrollment.class.getSimpleName(); Map<String, String> lookupFields = new HashMap<>(); lookupFields.put(PATIENT_UUID, DEFAULT_UUID); lookupFields.put(PROGRAM_NAME, PROGRAM_ANOTHER_NAME); when(programEnrollmentService.getProgramEnrollmentByPatientUuid(eq(CONFIG_NAME), eq(DEFAULT_UUID))) .thenReturn(prepareProgramEnrollments()); Object object = taskDataProvider.lookup(className + '-' + CONFIG_NAME, BY_UUID_AMD_PROGRAM_NAME, lookupFields); verify(programEnrollmentService).getProgramEnrollmentByPatientUuid(eq(CONFIG_NAME), eq(DEFAULT_UUID)); <START> assertEquals(false, ((ProgramEnrollment) object).isEnrolled()); <END> assertEquals(ProgramEnrollment.NOT_ENROLLED, ((ProgramEnrollment) object).getEnrolledString()); }</code><technical_language>assertFalse</technical_language>

Target:
public void shouldReturnNotEnrolledWhenProgramEnrollmentNotFoundForLookupByUuidAndProgramName() { String className = ProgramEnrollment.class.getSimpleName(); Map<String, String> lookupFields = new HashMap<>(); lookupFields.put(PATIENT_UUID, DEFAULT_UUID); lookupFields.put(PROGRAM_NAME, PROGRAM_ANOTHER_NAME); when(programEnrollmentService.getProgramEnrollmentByPatientUuid(eq(CONFIG_NAME), eq(DEFAULT_UUID))) .thenReturn(prepareProgramEnrollments()); Object object = taskDataProvider.lookup(className + '-' + CONFIG_NAME, BY_UUID_AMD_PROGRAM_NAME, lookupFields); verify(programEnrollmentService).getProgramEnrollmentByPatientUuid(eq(CONFIG_NAME), eq(DEFAULT_UUID)); assertTrue(object instanceof ProgramEnrollment); ProgramEnrollment actual = (ProgramEnrollment) object; assertFalse(actual.isEnrolled()); assertEquals(ProgramEnrollment.NOT_ENROLLED, actual.getEnrolledString()); assertNull(actual.getCurrentState()); }
Source:
<code>public Component getListCellRendererComponent( JList<? extends CheckBoxJList.CheckboxListItem> list, CheckBoxJList.CheckboxListItem value, int index, boolean isSelected, boolean cellHasFocus) { setBackground(list.getBackground()); checkbox.setSelected(value.isChecked()); checkbox.setBackground(list.getBackground()); label.setText(value.getDisplayName()); if (value.hasIcon()) { label.setIcon(value.getIcon()); } <START> setEnabled(list.isEnabled()); <END> return this; }</code><technical_language>state of checkbox label enabled list</technical_language>

Target:
public Component getListCellRendererComponent( JList<? extends CheckBoxJList.CheckboxListItem> list, CheckBoxJList.CheckboxListItem value, int index, boolean isSelected, boolean cellHasFocus) { setBackground(list.getBackground()); checkbox.setSelected(value.isChecked()); checkbox.setBackground(list.getBackground()); checkbox.setEnabled(list.isEnabled()); label.setText(value.getDisplayName()); label.setEnabled(list.isEnabled()); if (value.hasIcon()) { label.setIcon(value.getIcon()); } setEnabled(list.isEnabled()); return this; }
Source:
<code>public void messageTrackedAndRemovedWhenClientLeaves() throws Exception { Assert.assertThat(activeMessageHandler.getTrackedClients().count(), is(0L)); storeProxy.getAndAppend(42L, createPayload(42L)); <START> Map<Long, EhcacheEntityResponse> responses = activeMessageHandler.getTrackedResponsesForSegment(11, activeMessageHandler.getTrackedClients().findFirst().get()); <END> assertThat(responses).hasSize(1); assertThat(activeEntity.getConnectedClients()).hasSize(1); service.stop(); activeEntity.notifyDestroyed(activeMessageHandler.getTrackedClients().iterator().next()); waitForPredicate(e -> activeEntity.getConnectedClients().size() > 0, 2000); Assert.assertThat(activeMessageHandler.getTrackedClients().count(), is(0L)); }</code><technical_language>11 is message magically ends up? stable? do a constant for it? more obvious is giving a name</technical_language>

Target:
public void messageTrackedAndRemovedWhenClientLeaves() throws Exception { assertThat(activeMessageHandler.getTrackedClients().count()).isZero(); storeProxy.getAndAppend(42L, createPayload(42L)); Map<Long, EhcacheEntityResponse> responses = activeMessageHandler.getTrackedResponsesForSegment(KEY_ENDS_UP_IN_SEGMENT_11, activeMessageHandler.getTrackedClients().findFirst().get()); assertThat(responses).hasSize(1); assertThat(activeEntity.getConnectedClients()).hasSize(1); service.stop(); activeEntity.notifyDestroyed(activeMessageHandler.getTrackedClients().iterator().next()); waitForPredicate(e -> activeEntity.getConnectedClients().size() > 0, 2000); assertThat(activeMessageHandler.getTrackedClients().count()).isZero(); }
Source:
<code>private static Allele determineReferenceAlleleGivenReferenceBase(final List<VariantContext> VCs, final Locatable loc, final Byte refBase) { final Allele refAllele = GATKVariantContextUtils.determineReferenceAllele(VCs, loc); <START> if ( refAllele == null ) { <END> return (refBase == null ? null : Allele.create(refBase, true)); } return refAllele; }</code><technical_language>simplify this logic - add line if (refAllele == null || refBase == null) { return null; }</technical_language>

Target:
private static Allele determineReferenceAlleleGivenReferenceBase(final List<VariantContext> VCs, final Locatable loc, final Byte refBase) { final Allele refAllele = GATKVariantContextUtils.determineReferenceAllele(VCs, loc); if ( refAllele == null ) { if (refBase == null) { return null; } else { return Allele.create(refBase, true); } } else { return refAllele; } }
Source:
<code>public static void cleanup() { Integer level = LEVEL.get(); fireMethodCalled( level, "cleanup", null, null ); if ( level.intValue() == 1 ) { MAPPING.set( null ); LEVEL.set( null ); } else { <START> LEVEL.set( level.intValue() - 1 ); <END> } }</code><technical_language>needed unboxing</technical_language>

Target:
public static void cleanup() { Integer level = LEVEL.get(); fireMethodCalled( level, "cleanup", null, null ); if ( level == 1 ) { MAPPING.set( null ); LEVEL.set( null ); } else { LEVEL.set( level - 1 ); } }
Source:
<code>private void injectAccountAndContainerUsingAccountAndContainerUri(RestRequest restRequest, RestRequestMetricsGroup metricsGroup) throws RestServiceException { <START> String[] slashFields = parseInput(restRequest.getPath()); <END> String accountName = slashFields[2]; Account targetAccount = accountService.getAccountByName(accountName); if (targetAccount == null) { frontendMetrics.unrecognizedAccountNameCount.inc(); throw new RestServiceException("Account cannot be found for accountName=" + accountName + " in put request with account and container headers.", RestServiceErrorCode.InvalidAccount); } ensureAccountNameMatch(targetAccount, restRequest); String containerName = slashFields[3]; Container targetContainer = targetAccount.getContainerByName(containerName); if (targetContainer == null) { frontendMetrics.unrecognizedContainerNameCount.inc(); throw new RestServiceException( "Container cannot be found for accountName=" + accountName + " and containerName=" + containerName + " in put request with account and container headers.", RestServiceErrorCode.InvalidContainer); } setTargetAccountAndContainerInRestRequest(restRequest, targetAccount, targetContainer, metricsGroup); }</code><technical_language>is RestUtils.getRequestPath(restRequest).getOperationOrBlobId in situations this ensure cluster name url prefixes removed</technical_language>

Target:
private void injectAccountAndContainerUsingAccountAndContainerUri(RestRequest restRequest, RestRequestMetricsGroup metricsGroup) throws RestServiceException { NamedBlobPath namedBlobPath = RestUtils.parseInput(RestUtils.getRequestPath(restRequest).getOperationOrBlobId(false)); String accountName = namedBlobPath.getAccountName(); Account targetAccount = accountService.getAccountByName(accountName); if (targetAccount == null) { frontendMetrics.unrecognizedAccountNameCount.inc(); throw new RestServiceException("Account cannot be found for accountName=" + accountName + " in put request with account and container headers.", RestServiceErrorCode.InvalidAccount); } ensureAccountNameMatch(targetAccount, restRequest); String containerName = namedBlobPath.getContainerName(); Container targetContainer = targetAccount.getContainerByName(containerName); if (targetContainer == null) { frontendMetrics.unrecognizedContainerNameCount.inc(); throw new RestServiceException( "Container cannot be found for accountName=" + accountName + " and containerName=" + containerName + " in put request with account and container headers.", RestServiceErrorCode.InvalidContainer); } setTargetAccountAndContainerInRestRequest(restRequest, targetAccount, targetContainer, metricsGroup); }
Source:
<code>public void eventsShouldBeStreamedOnTimeout() throws InterruptedException { final long timeout = TimeUnit.SECONDS.toMillis(1); final PartitionData pd = new PartitionData(null, 100L); for (int i = 0; i < 100; ++i) { <START> pd.addEventFromKafka(i + 100L + 1, "test".getBytes()); <END> } SortedMap<Long, byte[]> data = pd.takeEventsToStream(currentTimeMillis(), 1000, timeout); assertNull(data); assertEquals(0, pd.getKeepAliveInARow()); Thread.sleep(timeout); data = pd.takeEventsToStream(currentTimeMillis(), 1000, timeout); assertNotNull(data); assertEquals(100, data.size()); for (int i = 100; i < 200; ++i) { pd.addEventFromKafka(i + 100L + 1, "test".getBytes()); } data = pd.takeEventsToStream(currentTimeMillis(), 1000, timeout); assertNull(data); assertEquals(0, pd.getKeepAliveInARow()); Thread.sleep(timeout); data = pd.takeEventsToStream(currentTimeMillis(), 1000, timeout); assertNotNull(data); assertEquals(100, data.size()); }</code><technical_language>UTF-8</technical_language>

Target:
public void eventsShouldBeStreamedOnTimeout() throws InterruptedException { final long timeout = TimeUnit.SECONDS.toMillis(1); final PartitionData pd = new PartitionData(null, 100L); for (int i = 0; i < 100; ++i) { pd.addEventFromKafka(i + 100L + 1, "test".getBytes(UTF_8)); } SortedMap<Long, byte[]> data = pd.takeEventsToStream(currentTimeMillis(), 1000, timeout); assertNull(data); assertEquals(0, pd.getKeepAliveInARow()); Thread.sleep(timeout); data = pd.takeEventsToStream(currentTimeMillis(), 1000, timeout); assertNotNull(data); assertEquals(100, data.size()); for (int i = 100; i < 200; ++i) { pd.addEventFromKafka(i + 100L + 1, "test".getBytes(UTF_8)); } data = pd.takeEventsToStream(currentTimeMillis(), 1000, timeout); assertNull(data); assertEquals(0, pd.getKeepAliveInARow()); Thread.sleep(timeout); data = pd.takeEventsToStream(currentTimeMillis(), 1000, timeout); assertNotNull(data); assertEquals(100, data.size()); }
Source:
<code>public void appendSeries(String namePrefix, String name, String nameSuffix, String[] columns, Object[][] points) { if (hasSeriesData) <START> pointsJson.append(','); <END> hasSeriesData = true; final DateTime timestamp = new DateTime(); pointsJson.append("{\"name\":\"").append(namePrefix).append(name).append(nameSuffix).append("\",\"fields\":{"); Object[] row = points[0]; for (int j = 1; j < row.length; j++) { if (j > 1) pointsJson.append(','); Object value = row[j]; pointsJson.append("\"" + columns[j] + "\":"); if (value instanceof String) { pointsJson.append('"').append(value).append('"'); } else if ((value instanceof Collection) && ((Collection<?>) value).size() < 1) { pointsJson.append("null"); } else if (value instanceof Double && Double.isInfinite((double) value)) { pointsJson.append("null"); } else if (value instanceof Float && Float.isInfinite((float) value)) { pointsJson.append("null"); } else { pointsJson.append(value); } } pointsJson.append("},"); pointsJson.append("\"timestamp\": \"" + timestamp + "\" }"); }</code><technical_language>Curly braces</technical_language>

Target:
public void appendSeries(String namePrefix, String name, String nameSuffix, String[] columns, Object[][] points) { if (hasSeriesData) pointsJson.append(','); hasSeriesData = true; final DateTime timestamp = new DateTime(); pointsJson.append("{\"measurement\":\"").append(namePrefix).append(name).append(nameSuffix).append("\",\"fields\":{"); Object[] row = points[0]; for (int j = 1; j < row.length; j++) { if (j > 1) { pointsJson.append(','); } Object value = row[j]; pointsJson.append("\"" + columns[j] + "\":"); if (value instanceof String) { pointsJson.append('"').append(value).append('"'); } else if ((value instanceof Collection) && ((Collection<?>) value).size() < 1) { pointsJson.append("null"); } else if (value instanceof Double && Double.isInfinite((double) value)) { pointsJson.append("null"); } else if (value instanceof Float && Float.isInfinite((float) value)) { pointsJson.append("null"); } else { pointsJson.append(value); } } pointsJson.append("},"); pointsJson.append("\"timestamp\": \"" + timestamp + "\" }"); }
Source:
<code>void classNameSource() { <START> String testClassName = "com.unknown.package.ClassByName"; <END> JavaClassSource source = new JavaClassSource(testClassName); assertThat(source.getClassName()).isEqualTo(testClassName); assertThat(source.getPosition()).isEmpty(); }</code><technical_language>avoid packages called 'package'? :)</technical_language>

Target:
void classNameSource() { String testClassName = "com.unknown.mypackage.ClassByName"; JavaClassSource source = new JavaClassSource(testClassName); assertThat(source.getClassName()).isEqualTo(testClassName); assertThat(source.getPosition()).isEmpty(); }
Source:
<code>private DateTime extractFrom(HttpServletRequest request) { DateTime now = clock.now(); <START> DateTime from = dateTimeParser.parse(getParameter(request, "from"), now); <END> return from; }</code><technical_language>extract param names constants</technical_language>

Target:
private DateTime extractFrom(HttpServletRequest request) { DateTime now = clock.now(); DateTime from = dateTimeParser.parse(getParameter(request, FROM_PARAM), now); return from; }
Source:
<code><START> private void checkExpression(Tree tree, SymbolicValue leftOp, SymbolicValue rightOp) { <END> switch (tree.kind()) { case MULTIPLY: case MULTIPLY_ASSIGNMENT: handleMultiply(leftOp, rightOp); break; case PLUS: case PLUS_ASSIGNMENT: case MINUS: case MINUS_ASSIGNMENT: handlePlusMinus(leftOp, rightOp); break; case DIVIDE: case DIVIDE_ASSIGNMENT: case REMAINDER: case REMAINDER_ASSIGNMENT: if (isZero(rightOp)) { reportIssue(tree); } else { handleDivide(tree.kind(), leftOp, rightOp); } break; default: } }</code><technical_language>![MAJOR](<LINK_0> Cyclomatic Complexity of this method "checkExpression" is 11 is greater 10 authorized. [![rule](<LINK_2>](<LINK_1></technical_language>

Target:
private void checkExpression(Tree tree, SymbolicValue leftOp, SymbolicValue rightOp) { switch (tree.kind()) { case MULTIPLY: case MULTIPLY_ASSIGNMENT: handleMultiply(leftOp, rightOp); break; case PLUS: case PLUS_ASSIGNMENT: case MINUS: case MINUS_ASSIGNMENT: handlePlusMinus(leftOp, rightOp); break; case DIVIDE: case DIVIDE_ASSIGNMENT: case REMAINDER: case REMAINDER_ASSIGNMENT: handleDivide(tree, leftOp, rightOp); break; default: } }