auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public boolean getScenes(VeluxBridge bridge) { logger.trace("getScenes() called."); GetScenes bcp = bridge.bridgeAPI().getScenes(); <START> if ((bridge.bridgeCommunicate(bcp)) && (bcp.isCommunicationSuccessful())) { <END> for (VeluxScene scene : bcp.getScenes()) { logger.trace("getScenes() found scene {}.", scene.toString()); VeluxScene veluxScene = new VeluxScene(scene); logger.trace("getScenes() storing scene {}.", veluxScene); if (!channel.existingScenes.isRegistered(veluxScene)) { channel.existingScenes.register(veluxScene); } logger.trace("getScenes() stored scene {}.", veluxScene); } logger.debug("getScenes() finally has found scenes {}.", channel.existingScenes); return true; } else { logger.trace("getScenes() finished with failure."); return false; } }</code><technical_language>redundant parentheses</technical_language>

Target:
public boolean getScenes(VeluxBridge bridge) { logger.trace("getScenes() called."); GetScenes bcp = bridge.bridgeAPI().getScenes(); if (bridge.bridgeCommunicate(bcp) && bcp.isCommunicationSuccessful()) { for (VeluxScene scene : bcp.getScenes()) { logger.trace("getScenes() found scene {}.", scene.toString()); VeluxScene veluxScene = new VeluxScene(scene); logger.trace("getScenes() storing scene {}.", veluxScene); if (!channel.existingScenes.isRegistered(veluxScene)) { channel.existingScenes.register(veluxScene); } logger.trace("getScenes() stored scene {}.", veluxScene); } logger.debug("getScenes() finally has found scenes {}.", channel.existingScenes); return true; } else { logger.trace("getScenes() finished with failure."); return false; } }
Source:
<code><START> public void setup(HttpClient httpClient, ConfigurationServiceVersion serviceVersion) <END> throws InvalidKeyException, NoSuchAlgorithmException { if (interceptorManager.isPlaybackMode()) { connectionString = "Endpoint=http://localhost:8080;Id=0000000000000;Secret=MDAwMDAw"; String endpoint = new ConfigurationClientCredentials(connectionString).getBaseUri(); client = new ConfigurationClientBuilder() .connectionString(connectionString) .endpoint(endpoint) .httpClient(interceptorManager.getPlaybackClient()) .buildClient(); } else { connectionString = Configuration.getGlobalConfiguration().get(AZURE_APPCONFIG_CONNECTION_STRING); tokenCredential = new DefaultAzureCredentialBuilder().build(); String endpoint = new ConfigurationClientCredentials(connectionString).getBaseUri(); client = new ConfigurationClientBuilder() .httpClient(httpClient) .credential(tokenCredential) .endpoint(endpoint) .addPolicy(interceptorManager.getRecordPolicy()) .serviceVersion(serviceVersion) .buildClient(); } }</code><technical_language>This method private</technical_language>

Target:
private void setup(HttpClient httpClient, ConfigurationServiceVersion serviceVersion) throws InvalidKeyException, NoSuchAlgorithmException { if (interceptorManager.isPlaybackMode()) { connectionString = "Endpoint=http://localhost:8080;Id=0000000000000;Secret=MDAwMDAw"; String endpoint = new ConfigurationClientCredentials(connectionString).getBaseUri(); client = new ConfigurationClientBuilder() .connectionString(connectionString) .endpoint(endpoint) .httpClient(interceptorManager.getPlaybackClient()) .buildClient(); } else { connectionString = Configuration.getGlobalConfiguration().get(AZURE_APPCONFIG_CONNECTION_STRING); tokenCredential = new DefaultAzureCredentialBuilder().build(); String endpoint = new ConfigurationClientCredentials(connectionString).getBaseUri(); client = new ConfigurationClientBuilder() .httpClient(httpClient) .credential(tokenCredential) .endpoint(endpoint) .addPolicy(interceptorManager.getRecordPolicy()) .serviceVersion(serviceVersion) .buildClient(); } }
Source:
<code>public static String getDistanceUnit(long userId) { String unit = Context.getPermissionsManager().getUser(userId).getDistanceUnit(); <START> if (unit == null || Context.getPermissionsManager().getServer().getForceSettings()) { <END> unit = Context.getPermissionsManager().getServer().getDistanceUnit(); } return unit != null ? unit : "km"; }</code><technical_language>is problem this code. If server is set, want user value. Web app handles this situation</technical_language>

Target:
public static String getDistanceUnit(long userId) { return (String) Context.getPermissionsManager().lookupPreference(userId, "distanceUnit", "km"); }
Source:
<code>public static Router loadGraph(GraphConfig config) { File graphFile = new File(config.getPath(), GRAPH_FILENAME); LOG.info("Loading graph from file '{}'", graphFile.getPath()); try (InputStream is = new FileInputStream(graphFile)) { <START> final Graph newGraph = Graph.load(is); <END> JsonNode jsonConfig = config.routerConfig(newGraph.routerConfig); Router newRouter = new Router(newGraph); newRouter.startup(jsonConfig); return newRouter; } catch (Exception e) { LOG.error("Exception while loading graph: {}", e); return null; } }</code><technical_language>I final here, scope of variable is short. final obstruct reading more provide guidance</technical_language>

Target:
public static Router loadGraph(GraphConfig config) { File graphFile = new File(config.getPath(), GRAPH_FILENAME); LOG.info("Loading graph from file '{}'", graphFile.getPath()); try (InputStream is = new FileInputStream(graphFile)) { Graph newGraph = Graph.load(is); JsonNode jsonConfig = config.routerConfig(newGraph.routerConfig); Router newRouter = new Router(newGraph); newRouter.startup(jsonConfig); return newRouter; } catch (Exception e) { LOG.error("Exception while loading graph: {}", e); return null; } }
Source:
<code>private void assertReplicationFactorMismatchError(Exception ex) { assertThat(ex.getMessage(), is("Your current Cassandra keyspace (atlasdb) has a replication " <START> + "factor not matching your Atlas Cassandra configuration. Change them to match, but be mindful" <END> + " of what steps you'll need to take to correctly repair or cleanup existing data in your " + "cluster.")); }</code><technical_language>nit: Inconsistent "should space end start of line" treatment</technical_language>

Target:
private void assertReplicationFactorMismatchError(Exception ex) { assertThat(ex.getMessage(), is("Your current Cassandra keyspace (atlasdb) has a replication" + " factor not matching your Atlas Cassandra configuration. Change them to match, but be mindful" + " of what steps you'll need to take to correctly repair or cleanup existing data in your cluster.")); }
Source:
<code>public void build() throws ConversionException { final List<BaseColumn> expandedColumns = dtable.getExpandedColumns(); for (int sourceIndex = 0; sourceIndex < expandedColumns.size(); sourceIndex++) { final BaseColumn baseColumn = expandedColumns.get(sourceIndex); if (baseColumn instanceof AttributeCol52) { makeAttribute((AttributeCol52) baseColumn); } else if (baseColumn instanceof MetadataCol52) { } else if (baseColumn instanceof ConditionCol52) { <START> <END> makeCondition((ConditionCol52) baseColumn); } else if (baseColumn instanceof ActionCol52) { makeAction(baseColumn); } else if (baseColumn instanceof RowNumberCol52) { continue; } else if (baseColumn instanceof DescriptionCol52) { } else { throw new IllegalArgumentException("TODO REMOTE THIS"); } columnIndex++; } }</code><technical_language>I this empty line is needed</technical_language>

Target:
public void build() { final List<BaseColumn> expandedColumns = dtable.getExpandedColumns(); for (int sourceIndex = 0; sourceIndex < expandedColumns.size(); sourceIndex++) { final BaseColumn baseColumn = expandedColumns.get(sourceIndex); if (baseColumn instanceof AttributeCol52) { makeAttribute((AttributeCol52) baseColumn); } else if (baseColumn instanceof MetadataCol52) { } else if (baseColumn instanceof ConditionCol52) { makeCondition((ConditionCol52) baseColumn); } else if (baseColumn instanceof ActionCol52) { makeAction(baseColumn); } else if (baseColumn instanceof RowNumberCol52) { continue; } else if (baseColumn instanceof DescriptionCol52) { } else { throw new IllegalArgumentException("TODO REMOTE THIS"); } columnIndex++; } }
Source:
<code>public void canCreateAndListIndexerNames() { String indexName = createIndex(); String dataSourceName = createDataSource(); SearchIndexer indexer1 = createBaseTestIndexerObject(indexName, dataSourceName); indexer1.setName("a" + indexer1.getName()); SearchIndexer indexer2 = createBaseTestIndexerObject(indexName, dataSourceName); indexer2.setName("b" + indexer2.getName()); searchIndexerClient.createIndexer(indexer1); indexersToDelete.add(indexer1.getName()); searchIndexerClient.createIndexer(indexer2); indexersToDelete.add(indexer2.getName()); <START> Iterator<String> indexersRes = searchIndexerClient.listIndexerNames(Context.NONE) <END> .iterator(); String actualIndexer = indexersRes.next(); assertNotNull(actualIndexer); assertEquals(indexer1.getName(), actualIndexer); actualIndexer = indexersRes.next(); assertNotNull(actualIndexer); assertEquals(indexer2.getName(), actualIndexer); assertFalse(indexersRes.hasNext()); }</code><technical_language>a test setting request id</technical_language>

Target:
public void canCreateAndListIndexerNames() { String indexName = createIndex(); String dataSourceName = createDataSource(); SearchIndexer indexer1 = createBaseTestIndexerObject(indexName, dataSourceName); mutateName(indexer1, "a" + indexer1.getName()); SearchIndexer indexer2 = createBaseTestIndexerObject(indexName, dataSourceName); mutateName(indexer2, "b" + indexer2.getName()); searchIndexerClient.createIndexer(indexer1); indexersToDelete.add(indexer1.getName()); searchIndexerClient.createIndexer(indexer2); indexersToDelete.add(indexer2.getName()); Iterator<String> indexersRes = searchIndexerClient.listIndexerNames(Context.NONE) .iterator(); String actualIndexer = indexersRes.next(); assertNotNull(actualIndexer); assertEquals(indexer1.getName(), actualIndexer); actualIndexer = indexersRes.next(); assertNotNull(actualIndexer); assertEquals(indexer2.getName(), actualIndexer); assertFalse(indexersRes.hasNext()); }
Source:
<code>public Map<Integer, String> getInstanceIdLocationIdMap(final List<Integer> instanceIds) { Map<Integer, String> instanceIdLocationIdMap = new HashMap<>(); final StringBuilder sql = new StringBuilder().append("SELECT ").append(" geo.nd_geolocation_id as instanceId, geo.value as value ").append("FROM ") .append(" nd_geolocationprop geo ").append("WHERE ").append(" geo.nd_geolocation_id in (:geolocationIds) ") <START> .append(" AND geo.type_id = 8190"); <END> try { final Query query = this.getSession().createSQLQuery(sql.toString()).addScalar("instanceId").addScalar("value").setParameterList("geolocationIds", instanceIds); final List<Object> results = query.list(); for (final Object obj : results) { final Object[] row = (Object[]) obj; instanceIdLocationIdMap.put((Integer) row[0], (String) row[1]); } return instanceIdLocationIdMap; } catch (final MiddlewareQueryException e) { final String message = "Error with getInstanceIdLocationIdMap() query from instanceIds: " + instanceIds; GeolocationPropertyDao.LOG.error(message, e); throw new MiddlewareQueryException(message, e); } }</code><technical_language>query.setParameter TermId.LOCATION_ID.getId() instead of appending query string</technical_language>

Target:
public Map<Integer, String> getInstanceIdLocationIdMap(final List<Integer> instanceIds) { Map<Integer, String> instanceIdLocationIdMap = new HashMap<>(); final StringBuilder sql = new StringBuilder().append("SELECT ").append(" geo.nd_geolocation_id as instanceId, geo.value as value ").append("FROM ") .append(" nd_geolocationprop geo ").append("WHERE ").append(" geo.nd_geolocation_id in (:geolocationIds) ") .append(" AND geo.type_id = :locationVariableId"); try { final Query query = this.getSession().createSQLQuery(sql.toString()).addScalar("instanceId").addScalar("value") .setParameterList("geolocationIds", instanceIds).setParameter("locationVariableId", TermId.LOCATION_ID.getId()); final List<Object> results = query.list(); for (final Object obj : results) { final Object[] row = (Object[]) obj; instanceIdLocationIdMap.put((Integer) row[0], (String) row[1]); } return instanceIdLocationIdMap; } catch (final MiddlewareQueryException e) { final String message = "Error with getInstanceIdLocationIdMap() query from instanceIds: " + instanceIds; GeolocationPropertyDao.LOG.error(message, e); throw new MiddlewareQueryException(message, e); } }
Source:
<code>public void onNext(final PullResponseItem item) { super.onNext(item); String status = item.getStatus(); String id = item.getId(); if (item.getProgressDetail() != null) { allLayers.add(id); } if (status != null && status.equalsIgnoreCase("Download complete")) { downloadedLayers.add(id); } if (status != null && status.equalsIgnoreCase("Pull complete")) { pulledLayers.add(id); } if (item.getProgressDetail() != null) { Long total = item.getProgressDetail().getTotal(); Long current = item.getProgressDetail().getCurrent(); if (total != null && total > totalSizes.getOrDefault(id, 0L)) { totalSizes.put(id, total); } if (current != null && current > currentSizes.getOrDefault(id, 0L)) { currentSizes.put(id, current); } } if (status != null && (status.startsWith("Pulling from") || status.contains("complete"))) { long totalSize = totalLayerSize(); long currentSize = downloadedLayerSize(); int pendingCount = allLayers.size() - downloadedLayers.size(); String friendlyTotalSize; if (pendingCount > 0) { friendlyTotalSize = "? MB"; } else { friendlyTotalSize = byteCountToDisplaySize(totalSize); } logger.info("Pulling image layers: pending, downloaded, extracted, ({}/{})", format("%2d", pendingCount), format("%2d", downloadedLayers.size()), format("%2d", pulledLayers.size()), byteCountToDisplaySize(currentSize), friendlyTotalSize); } <START> if (status != null && status.contains("complete")) { <END> completed = true; } }</code><technical_language>I if is else assume completion. thinking compatibility, change "Complete" completely different. onComplete is a good place set flag</technical_language>

Target:
public void onNext(final PullResponseItem item) { super.onNext(item); final String statusLowercase = item.getStatus() != null ? item.getStatus().toLowerCase() : ""; final String id = item.getId(); if (item.getProgressDetail() != null) { allLayers.add(id); } if (statusLowercase.equalsIgnoreCase("download complete")) { downloadedLayers.add(id); } if (statusLowercase.equalsIgnoreCase("pull complete")) { pulledLayers.add(id); } if (item.getProgressDetail() != null) { Long total = item.getProgressDetail().getTotal(); Long current = item.getProgressDetail().getCurrent(); if (total != null && total > totalSizes.getOrDefault(id, 0L)) { totalSizes.put(id, total); } if (current != null && current > currentSizes.getOrDefault(id, 0L)) { currentSizes.put(id, current); } } if (statusLowercase.startsWith("pulling from" ) || statusLowercase.contains("complete" )) { long totalSize = totalLayerSize(); long currentSize = downloadedLayerSize(); int pendingCount = allLayers.size() - downloadedLayers.size(); String friendlyTotalSize; if (pendingCount > 0) { friendlyTotalSize = "? MB"; } else { friendlyTotalSize = byteCountToDisplaySize(totalSize); } logger.info("Pulling image layers: pending, downloaded, extracted, ({}/{})", format("%2d", pendingCount), format("%2d", downloadedLayers.size()), format("%2d", pulledLayers.size()), byteCountToDisplaySize(currentSize), friendlyTotalSize); } if (statusLowercase.contains("complete")) { completed = true; } }
Source:
<code>public SuccessOrFailure isReady(DockerComposeRule rule) { <START> return SuccessOrFailure.onResultOf(() -> CassandraKeyValueServiceImpl.createForTesting(getConfig()) <END> .isInitialized()); }</code><technical_language>lift creation of CassandraKeyValueServiceImpl of lambda, lambda call isInitialized. I lambda is invoked times starting up, want run resources problem other day. wrong too</technical_language>

Target:
public SuccessOrFailure isReady(DockerComposeRule rule) { try (CassandraKeyValueService cassandraKeyValueService = CassandraKeyValueServiceImpl.createForTesting( getConfigWithProxy(Containers.getSocksProxy(name).address()))) { return SuccessOrFailure.onResultOf(cassandraKeyValueService::isInitialized); } catch (Exception e) { return SuccessOrFailure.failure(e.getMessage()); } }
Source:
<code>public void open(final InputStream stream) throws IOException, DbException { buffer = new TupleBatchBuffer(getSchema()); InputStream inputStream; <START> inputStream = new BufferedInputStream(stream); <END> if (isLittleEndian) { dataInput = new LittleEndianDataInputStream(inputStream); } else { dataInput = new DataInputStream(inputStream); } }</code><technical_language>collapse line</technical_language>

Target:
public void open(final InputStream stream) throws IOException, DbException { buffer = new TupleBatchBuffer(schema); InputStream inputStream = new BufferedInputStream(stream); if (isLittleEndian) { dataInput = new LittleEndianDataInputStream(inputStream); } else { dataInput = new DataInputStream(inputStream); } }
Source:
<code>final MetaTypeService getMetaTypeService() { BundleContext context = getContext(); <START> if (serviceTracker == null && context != null) { <END> serviceTracker = new ServiceTracker<>(context, META_TYPE_NAME, null); serviceTracker.open(); } return (serviceTracker != null) ? (MetaTypeService) serviceTracker.getService() : null; }</code><technical_language>need context null check anymore</technical_language>

Target:
final MetaTypeService getMetaTypeService() { BundleContext context = getContext(); if (serviceTracker == null) { serviceTracker = new ServiceTracker<>(context, META_TYPE_NAME, null); serviceTracker.open(); } return (MetaTypeService) serviceTracker.getService(); }
Source:
<code>public Boolean doesLastNRecentBlogActivitiesContain(int n, String blogPostContent, String blogPostName, String userName) { Boolean ifPassed = false; for (int i = 0; i < n; i++) { ifPassed = ifNewBlogDetailsPresent(activitiesList.get(i), blogPostContent, blogPostName, userName); <START> if (ifPassed == true) { <END> break; } } return ifPassed; }</code><technical_language>![MINOR](<LINK_1> 'Severity: MINOR') Remove literal "true" boolean value. [![rule](<LINK_0>](http://sonar-s4/coding_rules#rule_key=squid%3AS1125)</technical_language>

Target:
public Boolean doesLastNRecentBlogActivitiesContain(int n, String blogPostContent, String blogPostName, String userName) { if(n < editActivitiesList.size()){ n = editActivitiesList.size(); } Boolean ifPassed = false; for (int i = 0; i < n; i++) { ifPassed = ifNewBlogDetailsPresent(activitiesList.get(i), blogPostContent, blogPostName, userName); if (ifPassed == true) { break; } } return ifPassed; }
Source:
<code>public <T> T getSoleAttributeValue(IAttributeType attributeType, DeletionFlag flag, T defaultValue) { T value = defaultValue; Attribute<T> attribute = null; try { attribute = getSoleAttribute(attributeType, flag); } catch (AttributeDoesNotExist ex) { } <START> if (attribute != null) { <END> value = attribute.getValue(); } return value; }</code><technical_language>move this 244, get rid of extra if check</technical_language>

Target:
public <T> T getSoleAttributeValue(IAttributeType attributeType, DeletionFlag flag, T defaultValue) { T value = defaultValue; Attribute<T> attribute = null; try { attribute = getSoleAttribute(attributeType, flag); value = attribute.getValue(); } catch (AttributeDoesNotExist ex) { } return value; }
Source:
<code>public void onEvent(Event event) { if (!(event instanceof CommitEvent)) { return; } else { EKBCommit commit = ((CommitEvent) event).getCommit(); if (commit == lastCommit) { return; } LOGGER.warn("caught event: ({})", event.toString(), watchfile.getAbsolutePath()); ModelDescription localModelDesc = new ModelDescription(modelType, "3.0.0.SNAPSHOT"); List<Object> sourceModels = new ArrayList<Object>(); for (OpenEngSBModel model : commit.getInserts()) { ModelDescription tempModelDesc = new ModelDescription(model.getClass(), "3.0.0.SNAPSHOT"); if (transformationEngine.isTransformationPossible(tempModelDesc, localModelDesc)) { LOGGER.warn("transform!"); sourceModels.add(transformationEngine.performTransformation(tempModelDesc, localModelDesc, model)); } } if (sourceModels.size() > 0) { try { ignoreLastModification = true; fileSerializer.writeFile(watchfile, (List) sourceModels); } catch (IOException e) { throw new RuntimeException(e); } } } <START> <END> }</code><technical_language>code. removed</technical_language>

Target:
public void onEvent(Event event) { if (!(event instanceof CommitEvent)) { logger.debug("caught non-commit-event - only updating local models", event.toString()); try { update(); } catch (IOException e) { throw new RuntimeException(e); } return; } EKBCommit commit = ((CommitEvent) event).getCommit(); if (commit.equals(lastCommit)) { logger.debug("caught event with our own commit ({}) - ignoring", commit.toString()); return; } logger.debug("caught commit event: {}", event.toString()); OpenEngSBModel tempModel; try { tempModel = (OpenEngSBModel) modelType.newInstance(); } catch (InstantiationException e) { throw new RuntimeException(e); } catch (IllegalAccessException e) { throw new RuntimeException(e); } ModelDescription localModelDesc = new ModelDescription(modelType, ModelUtils.retrieveModelVersionAsString(tempModel)); List<Object> sourceModels = new ArrayList<Object>(); for (OpenEngSBModel model : commit.getInserts()) { ModelDescription tempModelDesc = new ModelDescription(model.getClass(), ModelUtils.retrieveModelVersionAsString(model)); if (transformationEngine.isTransformationPossible(tempModelDesc, localModelDesc)) { logger.debug("transforming from model to {}", tempModelDesc.toString(), localModelDesc.toString()); sourceModels.add(transformationEngine.performTransformation(tempModelDesc, localModelDesc, model)); } } if (sourceModels.size() > 0) { try { ignoreLastModification = true; fileSerializer.writeFile(watchfile, (List) sourceModels); } catch (IOException e) { throw new RuntimeException(e); } } }
Source:
<code>public InstancesResult getStatus(String type, String entity, String startStr, String endStr, String colo, List<LifeCycle> lifeCycles, String filterBy, String orderBy, String sortOrder, Integer offset, Integer numResults, Boolean allAttempts) { checkColo(colo); checkType(type); try { lifeCycles = checkAndUpdateLifeCycle(lifeCycles, type); validateParams(type, entity); validateInstanceFilterByClause(filterBy); Entity entityObject = EntityUtil.getEntity(type, entity); Pair<Date, Date> startAndEndDate = getStartAndEndDate(entityObject, startStr, endStr, numResults); AbstractWorkflowEngine wfEngine = getWorkflowEngine(entityObject); <START> InstancesResult instancesResult = getInstanceResultSubset(wfEngine.getStatus(entityObject, <END> startAndEndDate.first, startAndEndDate.second, lifeCycles, allAttempts), filterBy, orderBy, sortOrder, offset, numResults); if (StringUtils.isNotEmpty(startStr) && StringUtils.isEmpty(sortOrder)){ ArrayUtils.reverse(instancesResult.getInstances()); } instancesResult.setCollection(ArrayUtils.subarray(instancesResult.getInstances(), offset, (offset + numResults))); return instancesResult; } catch (FalconException e) { LOG.error("Failed to get instances status", e); throw FalconWebException.newAPIException(e.getMessage()); } }</code><technical_language>getInstanceResultSubset apply numResults returning? If i1-i20 instances if startTime is i11 numResults is 5, this code return: i16 - i20 i11 - i15 ? code changes, I i16-i20. But, Pragya is asking for is i11-i15. please confirm</technical_language>

Target:
public InstancesResult getStatus(String type, String entity, String startStr, String endStr, String colo, List<LifeCycle> lifeCycles, String filterBy, String orderBy, String sortOrder, Integer offset, Integer numResults, Boolean allAttempts) { checkColo(colo); checkType(type); try { lifeCycles = checkAndUpdateLifeCycle(lifeCycles, type); validateParams(type, entity); validateInstanceFilterByClause(filterBy); Entity entityObject = EntityUtil.getEntity(type, entity); Pair<Date, Date> startAndEndDate = getStartAndEndDate(entityObject, startStr, endStr, numResults); AbstractWorkflowEngine wfEngine = getWorkflowEngine(entityObject); return getInstanceResultSubset(wfEngine.getStatus(entityObject, startAndEndDate.first, startAndEndDate.second, lifeCycles, allAttempts), filterBy, orderBy, sortOrder, offset, numResults, startStr); } catch (FalconException e) { LOG.error("Failed to get instances status", e); throw FalconWebException.newAPIException(e.getMessage()); } }
Source:
<code>public void delete(FieldVariable fieldVar) throws DotDataException { fac.delete(fieldVar); Field field = this.find(fieldVar.fieldId()); <START> ContentTypeAPI tapi = APILocator.getContentTypeAPI(this.userAPI.getSystemUser()); <END> ContentType type; try { type = tapi.find(field.contentTypeId()); tapi.updateModDate(type); } catch (DotSecurityException e) { throw new DotDataException("Error updating Content Type mode_date for FieldVariable("+fieldVar.id()+")"+e.getMessage()); } }</code><technical_language>rename this contentTypeAPI</technical_language>

Target:
public void delete(FieldVariable fieldVar) throws DotDataException { fac.delete(fieldVar); Field field = this.find(fieldVar.fieldId()); ContentTypeAPI contentTypeAPI = APILocator.getContentTypeAPI(this.userAPI.getSystemUser()); ContentType type; try { type = contentTypeAPI.find(field.contentTypeId()); contentTypeAPI.updateModDate(type); } catch (DotSecurityException e) { throw new DotDataException("Error updating Content Type mode_date for FieldVariable("+fieldVar.id()+"). "+e.getMessage()); } }
Source:
<code>public void test401ShouldRetry() { HttpCommand command = createMock(HttpCommand.class); HttpRequest request = createMock(HttpRequest.class); HttpResponse response = createMock(HttpResponse.class); @SuppressWarnings("unchecked") LoadingCache<Credentials, Auth> cache = createMock(LoadingCache.class); BackoffLimitedRetryHandler backoffHandler = createMock(BackoffLimitedRetryHandler.class); expect(command.getCurrentRequest()).andReturn(request); cache.invalidateAll(); expectLastCall(); expect(response.getPayload()).andReturn(Payloads.newStringPayload("token expired, please renew")).anyTimes(); <START> expect(command.incrementFailureCount()).andReturn(0).anyTimes(); <END> expect(response.getStatusCode()).andReturn(401).atLeastOnce(); replay(command); replay(response); replay(cache); RetryOnRenew retry = new RetryOnRenew(cache, backoffHandler); assertTrue(retry.shouldRetryRequest(command, response)); verify(command); verify(response); verify(cache); }</code><technical_language>This realistic? incrementFailureCount() returns new failure count, return 0, anyTimes()..</technical_language>

Target:
public void test401ShouldRetry() { HttpCommand command = createMock(HttpCommand.class); HttpRequest request = createMock(HttpRequest.class); HttpResponse response = createMock(HttpResponse.class); @SuppressWarnings("unchecked") LoadingCache<Credentials, Auth> cache = createMock(LoadingCache.class); BackoffLimitedRetryHandler backoffHandler = createMock(BackoffLimitedRetryHandler.class); expect(command.getCurrentRequest()).andReturn(request); cache.invalidateAll(); expectLastCall(); expect(response.getPayload()).andReturn(Payloads.newStringPayload("token expired, please renew")).anyTimes(); expect(response.getStatusCode()).andReturn(401).atLeastOnce(); replay(command); replay(response); replay(cache); replay(backoffHandler); RetryOnRenew retry = new RetryOnRenew(cache, backoffHandler); assertTrue(retry.shouldRetryRequest(command, response)); verify(command); verify(response); verify(cache); verify(backoffHandler); }
Source:
<code>public void doesNotFireIfConstraintHasNotChanged() { Map<String, Domain> filterConstraint = ImmutableMap.<String, Domain>builder() <START> .put("nationkey", singleValue(BIGINT, 44L)) <END> .build(); ColumnHandle columnHandle = new TpchColumnHandle("nationkey", BIGINT); tester().assertThat(pickTableLayout) .on(p -> p.filter(expression("nationkey = BIGINT '44'"), p.tableScan( nationTableHandle, ImmutableList.of(p.symbol("nationkey", BIGINT)), ImmutableMap.of(p.symbol("nationkey", BIGINT), new TpchColumnHandle("nationkey", BIGINT)), TupleDomain.withColumnDomains(ImmutableMap.of(columnHandle, filterConstraint.get("nationkey"))), expression("nationkey = BIGINT '44'"), Optional.of(DUMMY_TABLE_LAYOUT_HANDLE)))) .doesNotFire(); }</code><technical_language>Do i read correctly purpose of map is extract of this single entry 10 lines below</technical_language>

Target:
public void doesNotFireIfConstraintHasNotChanged() { Map<String, Domain> filterConstraint = ImmutableMap.<String, Domain>builder() .put("nationkey", singleValue(BIGINT, 44L)) .build(); ColumnHandle columnHandle = new TpchColumnHandle("nationkey", BIGINT); tester.assertThat(pickTableLayout) .on(p -> p.filter(expression("nationkey = BIGINT '44'"), p.tableScan( nationTableHandle, ImmutableList.of(p.symbol("nationkey", BIGINT)), ImmutableMap.of(p.symbol("nationkey", BIGINT), new TpchColumnHandle("nationkey", BIGINT)), TupleDomain.withColumnDomains(ImmutableMap.of(columnHandle, filterConstraint.get("nationkey"))), expression("nationkey = BIGINT '44'"), Optional.of(DUMMY_TABLE_LAYOUT_HANDLE)))) .doesNotFire(); }
Source:
<code>public CircularBuffer(int capacity) { <START> buffer = (E[]) new Object[capacity]; <END> }</code><technical_language>explode a precondition check capacity is larger 0 instead of exploding out of bounds [here](<LINK_0></technical_language>

Target:
public CircularBuffer(int capacity) { Preconditions.checkArgument(capacity > 0, "Capacity must be greater than 0."); buffer = (E[]) new Object[capacity]; }
Source:
<code>public void commit() throws SQLException { checkClosed(); if (strict && getAutoCommit()) { throw new SQLException("The Crate JDBC driver does not support manual commit. " + <START> "The commit operation is not allowed."); <END> } }</code><technical_language>pls consistent in error messages, line 94</technical_language>

Target:
public void commit() throws SQLException { checkClosed(); if (getAutoCommit() && strict) { throw new SQLFeatureNotSupportedException("The commit operation is not allowed. " + "The Crate JDBC driver does not support manual commit."); } }
Source:
<code>public static String getNormalizedString(String input) { int end = Math.min(input.length(), MAX_CHARS - 1); String stringLessThan63chars = input.substring(0, end); <START> String normilizedString = removeSpecialCharactersInTheEnd(stringLessThan63chars); <END> return normilizedString; }</code><technical_language>minor typo : normalized instead of normilized</technical_language>

Target:
public static String getNormalizedString(String input) { int end = Math.min(input.length(), MAX_CHARS - 1); String stringLessThan63chars = input.substring(0, end); String normalizedString = removeSpecialCharactersInTheEnd(stringLessThan63chars); return normalizedString; }
Source:
<code>private void connect() { int delay = 0; logger.debug("Reconnecting web socket to Plex"); while (!isConnected()) { try { Thread.sleep(delay); open(); } catch (IOException e) { logger.error("Error reconnecting to Plex", e); } catch (InterruptedException e) { logger.error("Interrupted while reconnecting to Plex", e); } catch (ExecutionException e) { logger.error("Error reconnecting to Plex", e); } <START> delay = RECONNECT_DELAY; <END> } }</code><technical_language>method is called "connect()" logs speak "reconnect()" - expect log "connecting"</technical_language>

Target:
private void connect() { int delay = 0; logger.debug("Connecting web socket to Plex"); while (!isConnected()) { try { Thread.sleep(delay); open(); } catch (IOException e) { logger.error("Error connecting to Plex", e); } catch (InterruptedException e) { logger.error("Interrupted while reconnecting to Plex", e); } catch (ExecutionException e) { logger.error("Error connecting to Plex", e); } delay = RECONNECT_DELAY; } }
Source:
<code><START> SQLiteLimits(int id) { <END> this.id = id; }</code><technical_language>If is specific reason, constructor private</technical_language>

Target:
private SQLiteLimits(int id) { this.id = id; }
Source:
<code><START> public static Expr.NumericBinding withMap(final Map<String, ?> bindings) <END> { return new Expr.NumericBinding() { @Override public Number get(String name) { return (Number)bindings.get(name); } }; }</code><technical_language>Suggest naming this objectBindings</technical_language>

Target:
public static Expr.ObjectBinding withMap(final Map<String, ?> bindings) { return new Expr.ObjectBinding() { @Override public Number get(String name) { return (Number)bindings.get(name); } }; }
Source:
<code>private SelectionKey keyForId(String id) { SelectionKey key = this.keyMap.get(id); if (key == null) { throw new IllegalStateException( <START> "Attempt to write to socket for which there is no open connection. Connection id " + id); <END> } return key; }</code><technical_language>do this call is for write? This message "Key for Id". Right</technical_language>

Target:
private SelectionKey keyForId(String id) { return this.keyMap.get(id); }
Source:
<code>private void createNewGeoRepSession() { if(getWindow() != null || getEntity() == null) { return; } final UIConstants constants = ConstantsManager.getInstance().getConstants(); <START> if(getEntity().getStatus() == GlusterStatus.DOWN) { <END> ConfirmationModel cModel = new ConfirmationModel(); cModel.setTitle(constants.newGeoRepSessionTitle()); cModel.setMessage(constants.geoRepCreateFailedMasterDownMessage()); UICommand okCommand = new UICommand("closeConfirmWindow", this); okCommand.setTitle(ConstantsManager.getInstance().getConstants().ok()); okCommand.setIsDefault(true); cModel.getCommands().add(okCommand); setConfirmWindow(cModel); } else { GlusterVolumeEntity selectedMasterVolume = getEntity(); final GlusterVolumeGeoRepCreateModel geoRepCreateModel = new GlusterVolumeGeoRepCreateModel(selectedMasterVolume); geoRepCreateModel.startProgress(constants.fetchingDataMessage()); setWindow(geoRepCreateModel); geoRepCreateModel.getShowEligibleVolumes().setEntity(true); UICommand ok = new UICommand("onCreateSession", this); ok.setTitle(constants.ok()); ok.setIsDefault(true); geoRepCreateModel.getCommands().add(ok); UICommand close = new UICommand("close", this); close.setTitle(constants.cancel()); close.setIsCancel(true); geoRepCreateModel.getCommands().add(close); } }</code><technical_language>disable action if volume is</technical_language>

Target:
private void createNewGeoRepSession() { if (getWindow() != null || getEntity() == null) { return; } final UIConstants constants = ConstantsManager.getInstance().getConstants(); GlusterVolumeEntity selectedMasterVolume = getEntity(); final GlusterVolumeGeoRepCreateModel geoRepCreateModel = new GlusterVolumeGeoRepCreateModel(selectedMasterVolume); setWindow(geoRepCreateModel); geoRepCreateModel.getShowEligibleVolumes().setEntity(true); UICommand ok = new UICommand("onCreateSession", this); ok.setTitle(constants.ok()); ok.setIsDefault(true); geoRepCreateModel.getCommands().add(ok); UICommand close = new UICommand("close", this); close.setTitle(constants.cancel()); close.setIsCancel(true); geoRepCreateModel.getCommands().add(close); }
Source:
<code>public <T extends E> Indexed<T> append(T entry) { final long index = getNextIndex(); final byte[] bytes = serializer.encode(entry); final int length = bytes.length; if (length > maxEntrySize) { <START> throw new StorageException.TooLarge("Entry size cannot exceed " + maxEntrySize + " bytes"); <END> } final Checksum crc32 = new CRC32(); crc32.update(bytes, 0, length); final long checksum = crc32.getValue(); int position = buffer.position(); buffer.writeInt(length) .writeUnsignedInt(checksum) .write(bytes); Indexed<E> indexedEntry = new Indexed<>(index, entry, length); this.lastEntry = indexedEntry; this.cache.put(indexedEntry); this.index.index(index, position); return (Indexed<T>) indexedEntry; }</code><technical_language>useful include actual length too</technical_language>

Target:
public <T extends E> Indexed<T> append(T entry) { final long index = getNextIndex(); final byte[] bytes = serializer.encode(entry); final int length = bytes.length; if (length > maxEntrySize) { throw new StorageException.TooLarge("Entry size " + length + " exceeds maximum allowed bytes (" + maxEntrySize + ")"); } final Checksum crc32 = new CRC32(); crc32.update(bytes, 0, length); final long checksum = crc32.getValue(); int position = buffer.position(); buffer.writeInt(length) .writeUnsignedInt(checksum) .write(bytes); Indexed<E> indexedEntry = new Indexed<>(index, entry, length); this.lastEntry = indexedEntry; this.cache.put(indexedEntry); this.index.index(index, position); return (Indexed<T>) indexedEntry; }
Source:
<code>protected void onLoad() { super.onLoad(); <START> $(listBox.getElement()).off("change"); <END> $(listBox.getElement()).change((e, param) -> { try { ValueChangeEvent.fire(this, getValue()); } catch (IndexOutOfBoundsException ex) { GWT.log("ListBox value change handler threw an exception.", ex); } return true; }); initializeMaterial(); }</code><technical_language>This happen in onUnload</technical_language>

Target:
protected void onLoad() { super.onLoad(); $(listBox.getElement()).change((e, param) -> { try { ValueChangeEvent.fire(this, getValue()); } catch (IndexOutOfBoundsException ex) { GWT.log("ListBox value change handler threw an exception.", ex); } return true; }); initializeMaterial(); }
Source:
<code>public void doGet(HttpServletRequest req, HttpServletResponse resp) { servletName = Const.PublicActionNames.PUBLIC_IMAGE_SERVE_ACTION; action = Const.PublicActionNames.PUBLIC_IMAGE_SERVE_ACTION; requestParameters = req.getParameterMap(); String blobKey = getBlobKeyFromRequest(); try { if (blobKey.isEmpty()) { String message = "Failed to serve image with URL : blobKey is missing"; logMessage(req, message); resp.sendError(1, "No image found"); } else { resp.setContentType("image/png"); BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService(); blobstoreService.serve(new BlobKey(blobKey), resp); String url = req.getRequestURL().toString() + "?blob-key=" + blobKey; String message = "Public image request with URL: <br>" + "<a href=\"" + url + "\" target=\"_blank\" rel=\"noopener noreferrer\" >" + url + "</a>"; logMessage(req, message); } } catch (IOException e) { UserType userType = new GateKeeper().getCurrentUser(); String url = HttpRequestHelper.getRequestedUrl(req); Map<String, String[]> params = HttpRequestHelper.getParameterMap(req); log.warning(new ActivityLogGenerator() <START> .generateServletActionFailureLogMessage(url, params, e, userType)); <END> } }</code><technical_language>add more tab spacings line 60</technical_language>

Target:
public void doGet(HttpServletRequest req, HttpServletResponse resp) { servletName = Const.PublicActionNames.PUBLIC_IMAGE_SERVE_ACTION; action = Const.PublicActionNames.PUBLIC_IMAGE_SERVE_ACTION; requestParameters = req.getParameterMap(); String blobKey = getBlobKeyFromRequest(); try { if (blobKey.isEmpty()) { String message = "Failed to serve image with URL : blobKey is missing"; logMessage(req, message); resp.sendError(1, "No image found"); } else { resp.setContentType("image/png"); BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService(); blobstoreService.serve(new BlobKey(blobKey), resp); String url = req.getRequestURL().toString() + "?blob-key=" + blobKey; String message = "Public image request with URL: <br>" + "<a href=\"" + url + "\" target=\"_blank\" rel=\"noopener noreferrer\" >" + url + "</a>"; logMessage(req, message); } } catch (IOException e) { UserType userType = new GateKeeper().getCurrentUser(); String url = HttpRequestHelper.getRequestedUrl(req); Map<String, String[]> params = HttpRequestHelper.getParameterMap(req); log.warning(new LogMessageGenerator() .generateActionFailureLogMessage(url, params, e, userType)); } }
Source:
<code><START> public void testLoadingInvalidUberJar() throws Exception { <END> pluginPath.newFile("test.jar"); DelegatingClassLoader classLoader = new DelegatingClassLoader( Collections.singletonList(pluginPath.getRoot().getAbsolutePath())); classLoader.initLoaders(); }</code><technical_language>Nice test cases. cases want cover? fail empty directory, a directory contained unparsable file (not a jar, a text file). If so, nice tests for edge cases too. In general, inspiration /usr/share/java typical linux installations</technical_language>

Target:
public void testLoadingInvalidUberJar() throws Exception { pluginDir.newFile("invalid.jar"); DelegatingClassLoader classLoader = new DelegatingClassLoader( Collections.singletonList(pluginDir.getRoot().getAbsolutePath())); classLoader.initLoaders(); }
Source:
<code>public void apply(OnlineCommandContext ctx) throws Exception { Address secretServerIdentitiesAddress = securityRealmAddress.and("server-identity", "secret"); Operations ops = new Operations(ctx.client); if (replaceExisting) { Batch batch = new Batch(); boolean secretServerIdentityExists = ops.exists(secretServerIdentitiesAddress); if (secretServerIdentityExists) { batch.remove(secretServerIdentitiesAddress); } <START> ops.batch(batch); <END> new Administration(ctx.client).reloadIfRequired(); } Batch batch = new Batch(); batch.add(secretServerIdentitiesAddress, Values.empty() .and("value", password)); ops.batch(batch); }</code><technical_language>batch here? contains operation</technical_language>

Target:
public void apply(OnlineCommandContext ctx) throws Exception { Address secretServerIdentitiesAddress = securityRealmAddress.and("server-identity", "secret"); Operations ops = new Operations(ctx.client); if (replaceExisting) { boolean secretServerIdentityExists = ops.exists(secretServerIdentitiesAddress); if (secretServerIdentityExists) { ops.remove(secretServerIdentitiesAddress); } new Administration(ctx.client).reloadIfRequired(); } ops.add(secretServerIdentitiesAddress, Values.empty() .and("value", password)); }
Source:
<code>public void removeCache(String name) { log.debugf("Remove cache %s", name); <START> if (persistentCaches.contains(name)) { <END> persistentCaches.remove(name); storeAll(); } GlobalComponentRegistry globalComponentRegistry = cacheManager.getGlobalComponentRegistry(); ComponentRegistry cacheComponentRegistry = globalComponentRegistry.getNamedComponentRegistry(name); if (cacheComponentRegistry != null) { cacheComponentRegistry.getComponent(PersistenceManager.class).setClearOnStop(true); cacheComponentRegistry.getComponent(CacheJmxRegistration.class).setUnregisterCacheMBean(true); cacheComponentRegistry.getComponent(PassivationManager.class).skipPassivationOnStop(true); Cache<?, ?> cache = cacheManager.getCache(name, false); if (cache != null) { cache.stop(); } } globalComponentRegistry.removeCache(name); globalComponentRegistry.getComponent(ConfigurationManager.class).removeConfiguration(name); globalComponentRegistry.getComponent(DependencyGraph.class, CACHE_DEPENDENCY_GRAPH).remove(name); }</code><technical_language>invoked if remove is successful</technical_language>

Target:
public void removeCache(String name) { log.debugf("Remove cache %s", name); if (persistentCaches.remove(name)) { storeAll(); } GlobalComponentRegistry globalComponentRegistry = cacheManager.getGlobalComponentRegistry(); ComponentRegistry cacheComponentRegistry = globalComponentRegistry.getNamedComponentRegistry(name); if (cacheComponentRegistry != null) { cacheComponentRegistry.getComponent(PersistenceManager.class).setClearOnStop(true); cacheComponentRegistry.getComponent(CacheJmxRegistration.class).setUnregisterCacheMBean(true); cacheComponentRegistry.getComponent(PassivationManager.class).skipPassivationOnStop(true); Cache<?, ?> cache = cacheManager.getCache(name, false); if (cache != null) { cache.stop(); } } globalComponentRegistry.removeCache(name); globalComponentRegistry.getComponent(ConfigurationManager.class).removeConfiguration(name); globalComponentRegistry.getComponent(DependencyGraph.class, CACHE_DEPENDENCY_GRAPH).remove(name); }
Source:
<code>FetchRequest(@NonNull Set<ObjectId> wantIds, int depth, @NonNull Set<ObjectId> clientShallowCommits, long filterBlobLimit, @NonNull Set<String> clientCapabilities) { this.wantIds = <START> Objects.requireNonNull(wantIds); <END> this.depth = depth; this.clientShallowCommits = Objects .requireNonNull(clientShallowCommits); this.filterBlobLimit = filterBlobLimit; this.clientCapabilities = Objects.requireNonNull(clientCapabilities); }</code><technical_language>optional: this more readable "import static"</technical_language>

Target:
FetchRequest(@NonNull Set<ObjectId> wantIds, int depth, @NonNull Set<ObjectId> clientShallowCommits, long filterBlobLimit, @NonNull Set<String> clientCapabilities) { this.wantIds = requireNonNull(wantIds); this.depth = depth; this.clientShallowCommits = requireNonNull(clientShallowCommits); this.filterBlobLimit = filterBlobLimit; this.clientCapabilities = requireNonNull(clientCapabilities); }
Source:
<code><START> private static int getHash(long key) { <END> int hash = (int) ((key >>> 32) ^ key); hash = ((hash >>> 16) ^ hash) * 0x45d9f3b; hash = ((hash >>> 16) ^ hash) * 0x45d9f3b; hash = (hash >>> 16) ^ hash; return hash; }</code><technical_language>This method default visibility avoid synthetic access</technical_language>

Target:
static int getHash(long key) { int hash = (int) ((key >>> 32) ^ key); hash = ((hash >>> 16) ^ hash) * 0x45d9f3b; hash = ((hash >>> 16) ^ hash) * 0x45d9f3b; hash = (hash >>> 16) ^ hash; return hash; }
Source:
<code>public IDataChartDescriptor<?, ?> getX(int index) { <START> return checkNotNull(fSeries.get(index)).getX(); <END> }</code><technical_language>do need checkNotNull() here? ChartSeries.getX() @NonNull due package annotation</technical_language>

Target:
public IDataChartDescriptor<?, ?> getX(int index) { return fSeries.get(index).getX(); }
Source:
<code><START> private int getFeatureFlagID() { <END> int featureFlagID; if (prefs.contains(PrefKeys.getFeatureFlagID())) { featureFlagID = prefs.getInt(PrefKeys.getFeatureFlagID(), 0); } else { featureFlagID = new Random().nextInt(); prefs.edit().putInt(PrefKeys.getFeatureFlagID(), featureFlagID).apply(); } return featureFlagID & Integer.MAX_VALUE; }</code><technical_language>a range annotation, @IntRange(from=0)</technical_language>

Target:
private int getFeatureFlagID() { int featureFlagID; if (prefs.contains(PrefKeys.getFeatureFlagID())) { featureFlagID = prefs.getInt(PrefKeys.getFeatureFlagID(), 0); } else { featureFlagID = new Random().nextInt(Integer.MAX_VALUE); prefs.edit().putInt(PrefKeys.getFeatureFlagID(), featureFlagID).apply(); } return featureFlagID & Integer.MAX_VALUE; }
Source:
<code>public static boolean isAlarmExpired(final Alarm alarm, final DateTime currentTime, final DateTimeZone timeZone){ if(alarm.isRepeated){ return false; } final DateTime ringTime = new DateTime(alarm.year, alarm.month, alarm.day, alarm.hourOfDay, alarm.minuteOfHour, 0, timeZone); <START> if(ringTime.isBefore(currentTime)){ <END> return true; } return false; }</code><technical_language>return ringTime.isBefore(currentTime) avoid if</technical_language>

Target:
public static boolean isAlarmExpired(final Alarm alarm, final DateTime currentTime, final DateTimeZone timeZone){ if(alarm.isRepeated){ return false; } final DateTime ringTime = new DateTime(alarm.year, alarm.month, alarm.day, alarm.hourOfDay, alarm.minuteOfHour, 0, timeZone); return ringTime.isBefore(currentTime); }
Source:
<code>protected SAMRecord getNextRecord() { final SAMRecord result = nextRec; nextRec = null; while (nextRec == null && unfilteredIterator.hasNext()) { SAMRecord nextRecord = unfilteredIterator.next(); switch (compareToFilter(nextRecord)) { case MATCHES_FILTER: nextRec = nextRecord; break; case CONTINUE_ITERATION: continue; case STOP_ITERATION: <START> nextRec = null; <END> return result; default: throw new SAMException("Unexpected return from compareToFilter"); } } return result; }</code><technical_language>circumstances reach this line nextRec null? modified of this method. Making a private field this a clearer</technical_language>

Target:
protected SAMRecord getNextRecord() { final SAMRecord result = nextRec; nextRec = null; while (nextRec == null && unfilteredIterator.hasNext()) { SAMRecord nextRecord = unfilteredIterator.next(); switch (compareToFilter(nextRecord)) { case MATCHES_FILTER: nextRec = nextRecord; break; case CONTINUE_ITERATION: continue; case STOP_ITERATION: return result; default: throw new SAMException("Unexpected return from compareToFilter"); } } return result; }