auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public static Set<Gene> searchGene(String keyword, Boolean exactSearch) { Set<Gene> genes = new HashSet<>(); if (exactSearch == null) exactSearch = false; if (keyword != null && keyword != "") { Set<Gene> allGenes = GeneUtils.getAllGenes(); if (org.apache.commons.lang3.math.NumberUtils.isNumber(keyword)) { for (Gene gene : allGenes) { String entrezId = Integer.toString(gene.getEntrezGeneId()); if (exactSearch) { if (entrezId.equals(keyword)) { genes.add(gene); } } else { if (entrezId.contains(keyword)) { genes.add(gene); } } } } else { keyword = keyword.toLowerCase(); for (Gene gene : allGenes) { String hugoSymbol = gene.getHugoSymbol().toLowerCase(); if (exactSearch) { <START> if (hugoSymbol.equals(keyword)) { <END> genes.add(gene); } else { for (String alias : gene.getGeneAliases()) { if (alias.toLowerCase().equals(keyword)) { genes.add(gene); break; } } } } else { if (StringUtils.containsIgnoreCase(hugoSymbol, keyword)) { genes.add(gene); } else { for (String alias : gene.getGeneAliases()) { if (StringUtils.containsIgnoreCase(alias, keyword)) { genes.add(gene); break; } } } } } } } return genes; }</code><technical_language>equalsIgnoreCase instead</technical_language>

Target:
public static Set<Gene> searchGene(String keyword, Boolean exactSearch) { Set<Gene> genes = new HashSet<>(); if (exactSearch == null) exactSearch = false; if (keyword != null && keyword != "") { Set<Gene> allGenes = GeneUtils.getAllGenes(); if (org.apache.commons.lang3.math.NumberUtils.isNumber(keyword)) { for (Gene gene : allGenes) { String entrezId = Integer.toString(gene.getEntrezGeneId()); if (exactSearch) { if (entrezId.equals(keyword)) { genes.add(gene); } } else { if (entrezId.contains(keyword)) { genes.add(gene); } } } } else { keyword = keyword.toLowerCase(); for (Gene gene : allGenes) { String hugoSymbol = gene.getHugoSymbol(); if (exactSearch) { if (hugoSymbol.equalsIgnoreCase(keyword)) { genes.add(gene); } else { for (String alias : gene.getGeneAliases()) { if (alias.toLowerCase().equals(keyword)) { genes.add(gene); break; } } } } else { if (StringUtils.containsIgnoreCase(hugoSymbol, keyword)) { genes.add(gene); } else { for (String alias : gene.getGeneAliases()) { if (StringUtils.containsIgnoreCase(alias, keyword)) { genes.add(gene); break; } } } } } } } return genes; }
Source:
<code>public List<ProgramState> setConstraint(ProgramState programState, ObjectConstraint nullConstraint) { Constraint cstraint = programState.getConstraint(this, nullConstraint.getClass()); <START> if (cstraint == null) { <END> if(nullConstraint.isNull()) { PMap<Class<? extends Constraint>, Constraint> onlyNullConstraint = PCollections.<Class<? extends Constraint>, Constraint>emptyMap() .put(ObjectConstraint.class, ObjectConstraint.NULL); return ImmutableList.of(programState.addConstraints(this, onlyNullConstraint)); } else { return ImmutableList.of(programState.addConstraint(this, nullConstraint)); } } else if (cstraint != nullConstraint) { return ImmutableList.of(); } return ImmutableList.of(programState); }</code><technical_language>2 letters win</technical_language>

Target:
public List<ProgramState> setConstraint(ProgramState programState, ObjectConstraint nullConstraint) { Constraint constraint = programState.getConstraint(this, nullConstraint.getClass()); if (constraint == null) { if(nullConstraint.isNull()) { PMap<Class<? extends Constraint>, Constraint> onlyNullConstraint = PCollections.<Class<? extends Constraint>, Constraint>emptyMap() .put(ObjectConstraint.class, ObjectConstraint.NULL); return ImmutableList.of(programState.addConstraints(this, onlyNullConstraint)); } else { return ImmutableList.of(programState.addConstraint(this, nullConstraint)); } } else if (constraint != nullConstraint) { return ImmutableList.of(); } return ImmutableList.of(programState); }
Source:
<code>public static void moveToList(final Collection<Geocache> caches, final int listId) { if (caches.isEmpty()) { Log.e("No cache was passed to moveToList"); return; } final AbstractList list = AbstractList.getListById(listId); if (list == null) { Log.e("Target list with id " + list + " does not exist in moveToList"); return; } if (!list.isConcrete()) { return; } init(); final SQLiteStatement add = PreparedStatement.ADD_TO_LIST.getStatement(); final SQLiteStatement remove = PreparedStatement.REMOVE_FROM_ALL_LISTS.getStatement(); database.beginTransaction(); try { for (final Geocache cache : caches) { remove.bindString(1, cache.getGeocode()); remove.execute(); add.bindLong(1, listId); add.bindString(2, cache.getGeocode()); add.execute(); <START> cache.getLists().add(listId); <END> } database.setTransactionSuccessful(); } finally { database.endTransaction(); } }</code><technical_language>preceeded cache.getLists().clear()</technical_language>

Target:
public static void moveToList(final Collection<Geocache> caches, final int listId) { if (caches.isEmpty()) { Log.e("No cache was passed to moveToList"); return; } final AbstractList list = AbstractList.getListById(listId); if (list == null) { Log.e("Target list with id " + list + " does not exist in moveToList"); return; } if (!list.isConcrete()) { return; } init(); final SQLiteStatement add = PreparedStatement.ADD_TO_LIST.getStatement(); final SQLiteStatement remove = PreparedStatement.REMOVE_FROM_ALL_LISTS.getStatement(); database.beginTransaction(); try { for (final Geocache cache : caches) { remove.bindString(1, cache.getGeocode()); remove.execute(); add.bindLong(1, listId); add.bindString(2, cache.getGeocode()); add.execute(); cache.getLists().clear(); cache.getLists().add(listId); } database.setTransactionSuccessful(); } finally { database.endTransaction(); } }
Source:
<code>public void testGetCompletionTimesTwoFragmentInteractionP2PSync() throws Exception { Trace trace1 = new Trace(); trace1.setId("1_2ip2psync"); <START> trace1.setStartTime(TimeUnit.MILLISECONDS.toMicros(System.currentTimeMillis()) - 4000); END> Consumer c1 = new Consumer(); c1.setUri("testuri"); c1.setDuration(5000); trace1.getNodes().add(c1); Producer p1 = new Producer(); p1.setUri("testuri2"); p1.setBaseTime(500); p1.setDuration(4000); p1.addInteractionCorrelationId("cid1_2ip2psync"); c1.getNodes().add(p1); Trace trace2 = new Trace(); trace2.setId("2_2ip2psync"); trace2.setStartTime(trace1.getStartTime() + 2000); Consumer c2 = new Consumer(); c2.setUri("testuri2"); c2.setDuration(1000); c2.addInteractionCorrelationId("cid1_2ip2psync"); trace2.getNodes().add(c2); tracePublisher.publish(null, Arrays.asList(trace1, trace2)); Wait.until(() -> traceService.searchFragments(null, new Criteria()).size() == 2); Wait.until(() -> analyticsService.getTraceCompletionTimes(null, new Criteria()).size() == 1); List<CompletionTime> times = analyticsService.getTraceCompletionTimes(null, new Criteria()); assertNotNull(times); assertEquals(1, times.size()); assertEquals(5000, times.get(0).getDuration()); }</code><technical_language>60000 - 60000000 - is 4000</technical_language>

Target:
public void testGetCompletionTimesTwoFragmentInteractionP2PSync() throws Exception { Trace trace1 = new Trace(); trace1.setId("1_2ip2psync"); trace1.setStartTime(TimeUnit.MILLISECONDS.toMicros(System.currentTimeMillis()) - FOUR_MS_IN_MICRO_SEC); Consumer c1 = new Consumer(); c1.setUri("testuri"); c1.setDuration(5000); trace1.getNodes().add(c1); Producer p1 = new Producer(); p1.setUri("testuri2"); p1.setBaseTime(500); p1.setDuration(4000); p1.addInteractionCorrelationId("cid1_2ip2psync"); c1.getNodes().add(p1); Trace trace2 = new Trace(); trace2.setId("2_2ip2psync"); trace2.setStartTime(trace1.getStartTime() + 2000); Consumer c2 = new Consumer(); c2.setUri("testuri2"); c2.setDuration(1000); c2.addInteractionCorrelationId("cid1_2ip2psync"); trace2.getNodes().add(c2); tracePublisher.publish(null, Arrays.asList(trace1, trace2)); Wait.until(() -> traceService.searchFragments(null, new Criteria()).size() == 2); Wait.until(() -> analyticsService.getTraceCompletionTimes(null, new Criteria()).size() == 1); List<CompletionTime> times = analyticsService.getTraceCompletionTimes(null, new Criteria()); assertNotNull(times); assertEquals(1, times.size()); assertEquals(5000, times.get(0).getDuration()); }
Source:
<code>public Map<String, Object> saveNewReport(@RequestBody ReportPayload payLoad) { final ReportDto reportDto = payLoad.getReport(); final Map<String, Object> response = new HashMap<String, Object>(); ReportDto dto = null; RestStatusDto statusDto = new RestStatusDto(); statusDto.setStatus("failed"); if (reportDto != null) { User user = userDao.findUserByEmail(reportDto.getUser()); if (user != null) { Report r = new Report(); BeanUtils.copyProperties(reportDto, r, doNotCopy); r.setUser(user.getKey().getId()); r.setState(Report.QUEUED); r = reportDao.save(r); Queue queue = QueueFactory.getDefaultQueue(); TaskOptions options = TaskOptions.Builder.withUrl("/app_worker/reportservlet") .param(TaskRequest.ACTION_PARAM, ReportTaskRequest.START_ACTION) .param(ReportTaskRequest.ID_PARAM, Long.toString(r.getKey().getId())); queue.add(options); dto = new ReportDto(); <START> DtoMarshaller.copyToDto(r, dto); <END> statusDto.setStatus("ok"); } } response.put("meta", statusDto); response.put("report", dto); return response; }</code><technical_language>Lets DtoMarshaller class in newer endpoints. replace springframework BeanUtils class a performance sinkhole</technical_language>

Target:
public Map<String, Object> saveNewReport(@RequestBody ReportPayload payLoad) { final ReportDto reportDto = payLoad.getReport(); final Map<String, Object> response = new HashMap<String, Object>(); ReportDto dto = null; RestStatusDto statusDto = new RestStatusDto(); statusDto.setStatus("failed"); if (reportDto != null) { Report r = new Report(); BeanUtils.copyProperties(reportDto, r, doNotCopy); r.setUser((Long)SecurityContextHolder.getContext().getAuthentication().getCredentials()); r.setState(Report.QUEUED); r = reportDao.save(r); ReportServlet.queueStart(r); dto = new ReportDto(); BeanUtils.copyProperties(r, dto); dto.setKeyId(r.getKey().getId()); statusDto.setStatus("ok"); } response.put("meta", statusDto); response.put("report", dto); return response; }
Source:
<code>private String getMessage(String identifier, String value) { <START> return INT_IDENTIFIER_VALUE.replace("xxx", identifier).replace("nnn", value); <END> }</code><technical_language>please avoid string replace</technical_language>

Target:
private String getMessage(String identifier, String value) { return MessageFormat.format("Either make \"{0}\" a \"long\" or correct this shift to {1}", identifier, value); }
Source:
<code>public void setBackgroundRGB(@Nullable RGB background) { <START> fBackgroundRGB = background; <END> if (fBackgroundColor != null) { fBackgroundColor.dispose(); } if (fDimmedBackgroundColor != null) { fDimmedBackgroundColor.dispose(); } Display display = Display.getDefault(); fBackgroundColor = (fBackgroundRGB != null) ? new Color(display, fBackgroundRGB) : null; fDimmedBackgroundColor = (fBackgroundRGB == null) ? null : new Color(display, ColorUtil.blend( fBackgroundRGB, display.getSystemColor(SWT.COLOR_LIST_BACKGROUND).getRGB())); }</code><technical_language>changing fBackgroundRGB change fDimmedForegroundColor a blend of fBackgroundRGB fForegroundRGB</technical_language>

Target:
public void setBackgroundRGB(@Nullable RGB background) { fBackgroundRGB = background; if (fBackgroundColor != null) { fBackgroundColor.dispose(); } if (fDimmedBackgroundColor != null) { fDimmedBackgroundColor.dispose(); } if (fDimmedForegroundColor != null) { fDimmedForegroundColor.dispose(); } Display display = Display.getDefault(); fBackgroundColor = (fBackgroundRGB != null) ? new Color(display, fBackgroundRGB) : null; fDimmedBackgroundColor = (fBackgroundRGB == null) ? null : new Color(display, ColorUtil.blend( fBackgroundRGB, display.getSystemColor(SWT.COLOR_LIST_BACKGROUND).getRGB())); fDimmedForegroundColor = new Color(display, ColorUtil.blend( (fForegroundRGB != null) ? fForegroundRGB : display.getSystemColor(SWT.COLOR_LIST_FOREGROUND).getRGB(), (fBackgroundRGB != null) ? fBackgroundRGB : display.getSystemColor(SWT.COLOR_LIST_BACKGROUND).getRGB())); }
Source:
<code><START> public void testIsUsingScsiReservationValidWhenAddingFloatingDisk() { <END> setupForLun(); LunDisk lunDisk1 = createLunDisk(); lunDisk1.setSgio(ScsiGenericIO.FILTERED); lunDisk1.setUsingScsiReservation(true); assertThat(lunValidator.isUsingScsiReservationValid(null, lunDisk1), failsWith(VdcBllMessages.ACTION_TYPE_FAILED_SCSI_RESERVATION_NOT_VALID_FOR_FLOATING_DISK)); }</code><technical_language>Please share code methods public void isUsingScsiReservationFails(ScsiGenericIO scsiGenericIo, VdcBllMessages failureMessage) { setupForLun(); LunDisk lunDisk = createLunDisk(); lunDisk.setSgio(scsiGenericIo); lunDisk.setUsingScsiReservation(true); assertThat(lunValidator.isUsingScsiReservationValid(createVM(), lunDisk), failsWith(failureMessage)) }</technical_language>

Target:
public void testIsUsingScsiReservationValidWhenAddingFloatingDisk() { setupForLun(); LunDisk lunDisk1 = createLunDisk(ScsiGenericIO.UNFILTERED, true); assertThat(lunValidator.isUsingScsiReservationValid(null, lunDisk1), failsWith(VdcBllMessages.ACTION_TYPE_FAILED_SCSI_RESERVATION_NOT_VALID_FOR_FLOATING_DISK)); }
Source:
<code>private static String formatRepeat(final TimingWindow tw) { if (tw.getDuration() == TimingWindow.WINDOW_REMAINS_OPEN_FOREVER) return null; switch (tw.getRepeat()) { <START> case -1: return "forever"; <END> case 0: return "never"; case 1: return "1 time"; default: return tw.getRepeat() + " times"; } }</code><technical_language>some Constants hardcoded numbers</technical_language>

Target:
private static String formatRepeat(final TimingWindow tw) { if (tw.getDuration() == TimingWindow.WINDOW_REMAINS_OPEN_FOREVER) return null; final int repeats = tw.getRepeat(); switch (repeats) { case TimingWindow.REPEAT_FOREVER: return "forever"; case TimingWindow.REPEAT_NEVER: return "never"; default: return String.format("%d time%s", repeats, repeats > 1 ? "s" : ""); } }
Source:
<code>protected <T extends APIEntity> void clone(T from) { <START> <END> }</code><technical_language>Empty method</technical_language>

Target:
protected <T extends APIEntity> void clone(T from) { cloneBase(from); APIJiraPriority jiraPriority = (APIJiraPriority) from; this.name = jiraPriority.name; }
Source:
<code>public ITmfTrace getTrace() { for (ITmfTrace openedTrace : TmfTraceManager.getInstance().getOpenedTraces()) { for (ITmfTrace singleTrace : TmfTraceManager.getTraceSet(openedTrace)) { if (getParent() instanceof TmfExperimentElement) { if (getElementUnderTraceFolder().getResource().equals(singleTrace.getResource())) { return singleTrace; } } else { if (getResource().equals(singleTrace.getResource())) { <START> return singleTrace; <END> } } } } return null; }</code><technical_language>return ITmfTrace belongs opened experiment (because resource Traces folder trace element is 'this' element. This is want. I want do is: - If 'this' is a trace element experiment, return ITmfTrace instance is a child of experiment (if experiment is opened). - If 'this' is a trace element Traces folder, return ITmfTrace is opened trace 'this' resource. (I this super implementation cover experiment element case). said, for purpose of trim trace handler, if try trim a trace selecting a trace element experiment, need ITmfTrace instance in bullet above, for purpose of enabling handler determining selection range, experiment element (as is 'opened trace'</technical_language>

Target:
public ITmfTrace getTrace() { ITmfProjectModelElement parent = getParent(); IResource resource = getElementUnderTraceFolder().getResource(); if (parent instanceof TmfExperimentElement) { return lookupExperimentTrace((TmfExperimentElement) parent, resource); } return lookupSingleTrace(resource); }
Source:
<code>private CriticalPathInfo findCriticalPathHelper(PTOperator operator, Map<PTOperator, CriticalPathInfo> cache) { <START> if (cache.containsKey(operator)) { <END> return cache.get(operator); } CriticalPathInfo cpi; PTOperator slowestUpstreamOperator = slowestUpstreamOp.get(operator); if (slowestUpstreamOperator != null) { cpi = findCriticalPathHelper(slowestUpstreamOperator, cache); try { cpi = (CriticalPathInfo)cpi.clone(); } catch (CloneNotSupportedException ex) { throw new RuntimeException(); } } else { cpi = new CriticalPathInfo(); } cpi.latency += operator.stats.getLatencyMA(); cpi.path.addLast(operator.getId()); cache.put(operator, cpi); return cpi; }</code><technical_language>Avoid double hash map lookup? Combine containsKey() get()</technical_language>

Target:
private CriticalPathInfo findCriticalPathHelper(PTOperator operator, Map<PTOperator, CriticalPathInfo> cache) { CriticalPathInfo cpi = cache.get(operator); if (cpi != null) { return cpi; } PTOperator slowestUpstreamOperator = slowestUpstreamOp.get(operator); if (slowestUpstreamOperator != null) { cpi = findCriticalPathHelper(slowestUpstreamOperator, cache); try { cpi = (CriticalPathInfo)cpi.clone(); } catch (CloneNotSupportedException ex) { throw new RuntimeException(); } } else { cpi = new CriticalPathInfo(); } cpi.latency += operator.stats.getLatencyMA(); cpi.path.addLast(operator.getId()); cache.put(operator, cpi); return cpi; }
Source:
<code>protected void calculateBounds() { if (this.dropdownShell != null && !this.dropdownShell.isDisposed()) { Point size = getSize(); int listHeight = (getVisibleItemCount() > 0 ? getVisibleItemCount() : 3) * this.dropdownTable.getItemHeight() + this.dropdownTable.getGridLineWidth() * 2; this.dropdownTable.getColumn(0).pack(); int listWidth = Math.max( this.dropdownTable.computeSize(SWT.DEFAULT, listHeight, true).x, size.x); int correction = 0; if (this.maxVisibleItems > 0 && getVisibleItemCount() < this.dropdownTable.getItemCount()) { correction = 2; } this.dropdownTable.setSize(listWidth - correction, listHeight - correction); calculateColumnWidth(); Point textPosition = this.text.toDisplay(this.text.getLocation()); int dropdownShellStartingY = textPosition.y + this.text.getBounds().height; int shellBottomY = textPosition.y + this.text.getBounds().height + listHeight; if (shellBottomY > Display.getCurrent().getBounds().height) { dropdownShellStartingY = textPosition.y - listHeight; } int filterTextBoxHeight = 0; if (this.dropdownFilter) { Point point = this.filterBox.computeSize(SWT.DEFAULT, SWT.DEFAULT); <START> filterTextBoxHeight = this.filterBox.getBorderWidth() + point.y; <END> } Rectangle shellBounds = new Rectangle( textPosition.x, dropdownShellStartingY, listWidth, listHeight + filterTextBoxHeight); this.dropdownShell.setBounds(shellBounds); } }</code><technical_language>border width necessary introduces a spacing ... IIRC border is account computing size</technical_language>

Target:
protected void calculateBounds() { if (this.dropdownShell != null && !this.dropdownShell.isDisposed()) { Point size = getSize(); int listHeight = (getVisibleItemCount() > 0 ? getVisibleItemCount() : 3) * this.dropdownTable.getItemHeight() + this.dropdownTable.getGridLineWidth() * 2; this.dropdownTable.getColumn(0).pack(); int listWidth = Math.max( this.dropdownTable.computeSize(SWT.DEFAULT, listHeight, true).x, size.x); int correction = 0; if (this.maxVisibleItems > 0 && getVisibleItemCount() < this.dropdownTable.getItemCount()) { correction = 2; } this.dropdownTable.setSize(listWidth - correction, listHeight - correction); calculateColumnWidth(); Point textPosition = this.text.toDisplay(this.text.getLocation()); int dropdownShellStartingY = textPosition.y + this.text.getBounds().height; int shellBottomY = textPosition.y + this.text.getBounds().height + listHeight; if (shellBottomY > Display.getCurrent().getBounds().height) { dropdownShellStartingY = textPosition.y - listHeight; } int filterTextBoxHeight = this.showDropdownFilter ? this.filterBox.computeSize(SWT.DEFAULT, SWT.DEFAULT).y : 0; Rectangle shellBounds = new Rectangle( textPosition.x, dropdownShellStartingY, listWidth, listHeight + filterTextBoxHeight); this.dropdownShell.setBounds(shellBounds); } }
Source:
<code>public void contributorCanNotEditContributors() { final List<Contributor> contributors = new ArrayList<>(); <START> contributors.add(new Contributor("admin", ContributorType.CONTRIBUTOR)); <END> assertFalse(service.canEditContributors(contributors, ContributorType.OWNER)); assertFalse(service.canEditContributors(contributors, ContributorType.ADMIN)); assertFalse(service.canEditContributors(contributors, ContributorType.CONTRIBUTOR)); }</code><technical_language>rename contributors type? If this test fails a bit confusing a contributor named admin a role contributor</technical_language>

Target:
public void contributorCanNotEditContributors() { final List<Contributor> contributors = new ArrayList<>(); contributors.add(new Contributor("owner", ContributorType.CONTRIBUTOR)); assertFalse(service.canEditContributors(contributors, ContributorType.OWNER)); assertFalse(service.canEditContributors(contributors, ContributorType.ADMIN)); assertFalse(service.canEditContributors(contributors, ContributorType.CONTRIBUTOR)); }
Source:
<code>public boolean equals(Object o) { if (this == o) return true; <START> if (o == null || getClass() != o.getClass()) return false; <END> Implementation other = (Implementation) o; if (emulateSdk != other.emulateSdk) return false; if (!qualifiers.equals(other.qualifiers)) return false; if (!Arrays.equals(shadows, other.shadows)) return false; return true; }</code><technical_language>Do this is non-useful? I figured cases people want test code behaves differently if SDK claims fully emulate</technical_language>

Target:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Implementation other = (Implementation) o; if (emulateSdk != other.emulateSdk) return false; if (reportSdk != other.reportSdk) return false; if (!qualifiers.equals(other.qualifiers)) return false; if (!Arrays.equals(shadows, other.shadows)) return false; if (application != other.application) return false; return true; }
Source:
<code>public static String getSDKLocation() throws CoreException { String sdkLocation = Platform.getPreferencesService().getString( THYM_UI_ID, WPConstants.WINDOWS_PHONE_SDK_LOCATION_PREF, null, null); if (sdkLocation == null) { File location = detectSDK(); <START> if (location.exists()) { <END> sdkLocation = location.getAbsolutePath(); IEclipsePreferences prefs = InstanceScope.INSTANCE .getNode(THYM_UI_ID); prefs.put(WPConstants.WINDOWS_PHONE_SDK_LOCATION_PREF, sdkLocation); } } return sdkLocation; }</code><technical_language>if is SDK installed detectSDK returns null a NPE here. I this needs a null check location</technical_language>

Target:
public static String getSDKLocation() throws CoreException { String sdkLocation = Platform.getPreferencesService().getString( THYM_UI_ID, WPConstants.WINDOWS_PHONE_SDK_LOCATION_PREF, null, null); if (sdkLocation == null) { File location = detectSDK(); if (location != null && location.exists()) { sdkLocation = location.getAbsolutePath(); IEclipsePreferences prefs = InstanceScope.INSTANCE .getNode(THYM_UI_ID); prefs.put(WPConstants.WINDOWS_PHONE_SDK_LOCATION_PREF, sdkLocation); } } return sdkLocation; }
Source:
<code><START> public <END> boolean isAllowed(@NonNull String[] allowedGroups) { for (String allowedGroup: allowedGroups) { for (String group: groups) { if (allowedGroup.equals(group)) { return true; } } } return false; }</code><technical_language>Consider ordering this method group public methods</technical_language>

Target:
public boolean isAllowed(@NonNull String[] allowedGroups) { for (String allowedGroup: allowedGroups) { for (String group: groups) { if (allowedGroup != null && allowedGroup.equals(group)) { return true; } } } return false; }
Source:
<code>public CloudResource build(GcpContext context, AuthenticatedContext auth, Group group, Network network, Security security, CloudResource buildableResource) throws Exception { String projectId = context.getProjectId(); <START> ComputeRequest<Operation> firewallRequest = StringUtils.isNotBlank(group.getSecurity().getCloudSecurityId()) && isExistingNetwork(network) <END> ? updateExistingFirewallForNewTargets(context, auth, group) : createNewFirewallRule(context, auth, group, network, security, buildableResource, projectId); try { Operation operation = firewallRequest.execute(); if (operation.getHttpErrorStatusCode() != null) { throw new GcpResourceException(operation.getHttpErrorMessage(), resourceType(), buildableResource.getName()); } return createOperationAwareCloudResource(buildableResource, operation); } catch (GoogleJsonResponseException e) { throw new GcpResourceException(checkException(e), resourceType(), buildableResource.getName()); } }</code><technical_language>I worth check group.getSecurity() is null here</technical_language>

Target:
public CloudResource build(GcpContext context, AuthenticatedContext auth, Group group, Network network, Security security, CloudResource buildableResource) throws Exception { String projectId = context.getProjectId(); ComputeRequest<Operation> firewallRequest = (group.getSecurity() != null && StringUtils.isNotBlank(group.getSecurity().getCloudSecurityId()) && isExistingNetwork(network)) ? updateExistingFirewallForNewTargets(context, auth, group) : createNewFirewallRule(context, auth, group, network, security, buildableResource, projectId); try { Operation operation = firewallRequest.execute(); if (operation.getHttpErrorStatusCode() != null) { throw new GcpResourceException(operation.getHttpErrorMessage(), resourceType(), buildableResource.getName()); } return createOperationAwareCloudResource(buildableResource, operation); } catch (GoogleJsonResponseException e) { throw new GcpResourceException(checkException(e), resourceType(), buildableResource.getName()); } }
Source:
<code>public void add(Integer art_id, Integer branchId, Integer transactionId) { <START> this.branchId = branchId; <END> entries.add(new Entry(art_id, branchId, transactionId)); }</code><technical_language>Is impossible for add called branch ids? is, called id = 1 id = 2. If so, this is branch ID. Is intent</technical_language>

Target:
public void add(Integer art_id, Integer branchId, Integer transactionId) { entries.add(new Entry(art_id, branchId, transactionId)); }
Source:
<code>public void start(ComponentContext context) { if (Framework.isBooleanPropertyTrue(CLUSTERING_ENABLED_PROP)) { String nodeId = Framework.getProperty(NODE_ID_PROP); if (StringUtils.isBlank(nodeId)) { nodeId = String.valueOf(RANDOM.nextLong()); log.warn("Missing cluster node id configuration, please define it explicitly " + "(usually through repository.clustering.id). Using random cluster node id instead: " + nodeId); } else { nodeId = nodeId.trim(); } invalidator = new CachePubSubInvalidator(); invalidator.initialize(CACHE_INVAL_PUBSUB_TOPIC, nodeId); log.info("Registered cache invalidator for node: " + nodeId); } else { <START> log.info("No cache invalidator registered"); <END> } registry.getCacheDescriptors().forEach(this::startCacheDescriptor); }</code><technical_language>message "Clustering is enabled"</technical_language>

Target:
public void start(ComponentContext context) { if (Framework.isBooleanPropertyTrue(CLUSTERING_ENABLED_PROP)) { String nodeId = Framework.getProperty(NODE_ID_PROP); if (StringUtils.isBlank(nodeId)) { nodeId = String.valueOf(RANDOM.nextLong()); log.warn("Missing cluster node id configuration, please define it explicitly " + "(usually through repository.clustering.id). Using random cluster node id instead: " + nodeId); } else { nodeId = nodeId.trim(); } invalidator = new CachePubSubInvalidator(); invalidator.initialize(CACHE_INVAL_PUBSUB_TOPIC, nodeId); log.info("Registered cache invalidator for node: " + nodeId); } else { log.info("Not registering a cache invalidator because clustering is not enabled"); } registry.getCacheDescriptors().forEach(this::startCacheDescriptor); }
Source:
<code>public void doDownload(DynamicForm form){ Task task = this.parentController.getSelectedTask(); if(task != null){ String taskId = task.getName(); <START> form.getField("taskId").setValue(taskId); <END> String jobId = Long.toString(task.getJobId()); form.getField("jobId").setValue(jobId); DownloadOption dlOption = this.model.getDownloadOption(); form.getField("media").setValue(dlOption.formDownload); form.submitForm(); } }</code><technical_language>I field names extracted in a constants this constant reference fieldname in classes. This way, if name change, complex code modification is required. Besides, is easier tracker is it</technical_language>

Target:
public void doDownload(DynamicForm form){ Task task = this.parentController.getSelectedTask(); if(task != null){ String taskId = task.getName(); form.getField(ResultView.taskIdFieldName).setValue(taskId); String jobId = Long.toString(task.getJobId()); form.getField(ResultView.jobIdFieldName).setValue(jobId); DownloadOption dlOption = this.model.getDownloadOption(); form.getField(ResultView.mediaFieldName).setValue(dlOption.formDownload); form.submitForm(); } }
Source:
<code>public void set_cmd_status_to_error_if_got_exception_on_dispatching() { <START> final Command cmd = Given.Command.createProject(); END> final CommandId commandId = getId(cmd); final Exception exception = new Exception(newUuid()); givenThrowingAggregate(exception, cmd); repositorySpy.dispatch(cmd); verify(commandStore).updateStatus(commandId, exception); }</code><technical_language>Please process this TODO item PR is closed</technical_language>

Target:
public void set_cmd_status_to_error_if_got_exception_on_dispatching() { final Exception exception = new Exception(newUuid()); final CommandId id = dispatchCmdToAggregateThrowing(exception); verify(commandStore).updateStatus(id, exception); }
Source:
<code>protected Map<Guid, Guid> addAllTemplateDisks() { CreateAllTemplateDisksParameters parameters = new CreateAllTemplateDisksParameters(getVm() != null ? getVmId() : Guid.Empty); parameters.setVmTemplateId(getVmTemplateId()); parameters.setVmTemplateName(getVmTemplateName()); parameters.setDiskInfoDestinationMap(diskInfoDestinationMap); parameters.setTargetDiskIds(targetDiskIds); parameters.setCopyVolumeType( <START> !getParameters().isSealTemplate() ? CopyVolumeType.SharedVol : CopyVolumeType.LeafVol); <END> parameters.setParentCommand(getActionType()); parameters.setParentParameters(getParameters()); parameters.setEndProcedure(EndProcedure.COMMAND_MANAGED); VdcReturnValueBase returnValue = runInternalAction( getAddAllTemplateDisksActionType(), parameters, ExecutionHandler.createDefaultContextForTasks(getContext())); if (!returnValue.getSucceeded()) { throw new EngineException(returnValue.getFault().getError(), returnValue.getFault().getMessage()); } return returnValue.getActionReturnValue(); }</code><technical_language>set this CopyVolumeType shared default. Consider simply add in if statement set leaf if is sealed</technical_language>

Target:
protected Map<Guid, Guid> addAllTemplateDisks() { CreateAllTemplateDisksParameters parameters = new CreateAllTemplateDisksParameters(getVm() != null ? getVmId() : Guid.Empty); parameters.setVmTemplateId(getVmTemplateId()); parameters.setVmTemplateName(getVmTemplateName()); parameters.setDiskInfoDestinationMap(diskInfoDestinationMap); parameters.setTargetDiskIds(targetDiskIds); if (getParameters().isSealTemplate()) { parameters.setCopyVolumeType(CopyVolumeType.LeafVol); } parameters.setParentCommand(getActionType()); parameters.setParentParameters(getParameters()); parameters.setEndProcedure(EndProcedure.COMMAND_MANAGED); VdcReturnValueBase returnValue = runInternalAction( getAddAllTemplateDisksActionType(), parameters, ExecutionHandler.createDefaultContextForTasks(getContext())); if (!returnValue.getSucceeded()) { throw new EngineException(returnValue.getFault().getError(), returnValue.getFault().getMessage()); } return returnValue.getActionReturnValue(); }
Source:
<code>private static int getIndexOfFileSeparator(String string) { int index = string.indexOf('/'); <START> if (index == -1) { <END> return string.indexOf('\\'); } return index; }</code><technical_language>inlined a single return line</technical_language>

Target:
private static int getIndexOfFileSeparator(String string) { int index = string.indexOf('/'); return index == -1 ? string.indexOf('\\') : index; }
Source:
<code>static String joinTags(Set<String> tags) { if (tags == null || tags.isEmpty()) { return ""; } <START> StringBuilder sb = new StringBuilder(); <END> boolean first = true; for (String tag : tags) { if (TextUtils.isEmpty(tag)) { continue; } if (first) { first = false; } else { sb.append(TAG_SEPARATOR); } sb.append(tag.trim().replaceAll(TAG_SEPARATOR, "_")); } return sb.toString(); }</code><technical_language>this extra code StringBuilder here? wrong TextUtils.join()? If for performance premature optimization resulting in unnecessary code</technical_language>

Target:
static String joinTags(Set<String> tags) { for (String t : tags) { t.replaceAll(" ", "_"); } return TextUtils.join(" ", tags); }
Source:
<code>private void registerMbean() { ObjectName objectName = null; MBeanServer mBeanServer = null; try { objectName = new ObjectName(Geocoding.class.getName() + ":service=geocoding"); mBeanServer = ManagementFactory.getPlatformMBeanServer(); } catch (MalformedObjectNameException e) { LOGGER.info("Unable to create Geocoding Configuration MBean.", e); } if (mBeanServer != null) { try { try { mBeanServer.registerMBean(this, objectName); LOGGER.debug( "Registered Geocoding Configuration MBean under object name: {}", objectName); } catch (InstanceAlreadyExistsException e) { mBeanServer.unregisterMBean(objectName); mBeanServer.registerMBean(this, objectName); LOGGER.debug("Re-registered Geocoding Configuration MBean"); } } catch (Exception e) { <START> LOGGER.info("Could not register MBean [{}].", objectName, e); <END> } } }</code><technical_language>This form print out exception stack trace passing objectName. string concatenation for objectName instead. trace exception debug instead of info</technical_language>

Target:
private void registerMbean() { ObjectName objectName = null; MBeanServer mBeanServer = null; try { objectName = new ObjectName(Geocoding.class.getName() + ":service=geocoding"); mBeanServer = ManagementFactory.getPlatformMBeanServer(); } catch (MalformedObjectNameException e) { LOGGER.info("Unable to create Geocoding Configuration MBean.", e); } if (mBeanServer != null) { try { try { mBeanServer.registerMBean(this, objectName); LOGGER.debug( "Registered Geocoding Configuration MBean under object name: {}", objectName); } catch (InstanceAlreadyExistsException e) { mBeanServer.unregisterMBean(objectName); mBeanServer.registerMBean(this, objectName); LOGGER.debug("Re-registered Geocoding Configuration MBean"); } } catch (Exception e) { LOGGER.info("Could not register MBean [{}].", objectName); } } }
Source:
<code>public void visitMethodInvocation(MethodInvocationTree tree) { if (this.owner == tree.symbol().owner()) { return; } Arguments args = tree.arguments(); <START> if (args.isEmpty()) { <END> return; } args.stream().filter(arg -> is(arg, "this")).forEach(expr -> reportIssue(expr, REPORT)); }</code><technical_language>need check for emptyness calling args.stream(), if empty, done</technical_language>

Target:
public void visitMethodInvocation(MethodInvocationTree tree) { if (this.owner == tree.symbol().owner()) { return; } tree.arguments().stream().filter(this::isThis).forEach(this::report); super.visitMethodInvocation(tree); }
Source:
<code>private boolean hasAnyFilter(int columnIndex) { <START> return columnToScore.entrySet().contains(columnIndex) || filterFunctionInputs.contains(columnIndex); <END> }</code><technical_language>containsKey method</technical_language>

Target:
private boolean hasAnyFilter(int columnIndex) { return columnsWithFilterScores.containsKey(columnIndex) || filterFunctionInputs.contains(columnIndex); }
Source:
<code>private static <T> List<T> getMapFields(List<Map<String, String>> results, Class classToUse) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchFieldException, ParseException { List<T> ret; Map<String, String> properties; ret = new ArrayList<>(); for (final Map<String, String> map : results) { Constructor<?> ctor = classToUse.getConstructor(); final T object = (T) ctor.newInstance(); properties = map.entrySet().stream().collect(Collectors <START> .toMap(entry -> CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, entry.getKey()), entry ->map.get(entry.getKey()))); <END> for (final String property: properties.keySet()){ if (properties.get(property) != null){ if (isFieldPresent(classToUse, String.class, property)){ PropertyUtils.setProperty(object, property, properties.get(property)); }else if (isFieldPresent(classToUse, Integer.TYPE, property)){ PropertyUtils.setProperty(object, property, Integer.parseInt(properties.get(property))); }else if (isFieldPresent(classToUse, Boolean.TYPE, property)){ PropertyUtils.setProperty(object, property, Boolean.parseBoolean(properties.get(property))); }else if (isFieldPresent(classToUse, Date.class, property)){ PropertyUtils.setProperty(object, property, df.parse(properties.get(property))); }else{ Logger.warn(classToUse, "Property " + property + "not set for " + classToUse.getName()); } } } ret.add(object); } return ret; }</code><technical_language>![MINOR](<LINK_2> 'Severity: MINOR') a type for: 'entry' [![rule](<LINK_1>](<LINK_0> ![MINOR](<LINK_2> 'Severity: MINOR') a type for: 'entry' [![rule](<LINK_1>](<LINK_0></technical_language>

Target:
private static <T> List<T> getMapFields(List<Map<String, String>> results, Class classToUse) throws NoSuchMethodException, InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchFieldException, ParseException { List<T> ret; Map<String, String> properties; ret = new ArrayList<>(); for (final Map<String, String> map : results) { Constructor<?> ctor = classToUse.getConstructor(); final T object = (T) ctor.newInstance(); properties = map.entrySet().stream().collect(Collectors .toMap(entry -> CaseFormat.LOWER_UNDERSCORE.to(CaseFormat.LOWER_CAMEL, entry.getKey()), entry ->map.get(entry.getKey()))); for (final Entry entry: properties.entrySet()){ String property = (String) entry.getKey(); if (properties.get(property) != null){ if (isFieldPresent(classToUse, String.class, property)){ PropertyUtils.setProperty(object, property, properties.get(property)); }else if (isFieldPresent(classToUse, Integer.TYPE, property)){ PropertyUtils.setProperty(object, property, Integer.parseInt(properties.get(property))); }else if (isFieldPresent(classToUse, Boolean.TYPE, property)){ PropertyUtils.setProperty(object, property, Boolean.parseBoolean(properties.get(property))); }else if (isFieldPresent(classToUse, Date.class, property)){ PropertyUtils.setProperty(object, property, df.parse(properties.get(property))); }else{ Logger.warn(classToUse, "Property " + property + "not set for " + classToUse.getName()); } } } ret.add(object); } return ret; }
Source:
<code><START> private void processFailure(Exception e) <END> { if (client != null) { hostLocationProvider.reportFailedHost(client.getHostLocationHandle(), e); this.close(); } }</code><technical_language>move this new private method end of class</technical_language>

Target:
private void processFailure(Exception e) { if (client != null) { client.getHostLocationHandle().reportFailure(e); this.close(); } }
Source:
<code>public IndexedFloats getFloatRow() { <START> throw new UnsupportedOperationException("AAAAA"); <END> }</code><technical_language>error msg :P</technical_language>

Target:
public IndexedFloats getFloatRow() { return new IndexedFloats() { @Override public int size() { return 1; } @Override public float get(int index) { return 0.0f; } @Override public void fill(int index, float[] toFill) { throw new UnsupportedOperationException("NullDimensionSelector does not support fill"); } @Override public void close() throws IOException { } }; }
Source:
<code>protected void applyDefaultRequestHeaders(Request request) { request.getHeaders().setAccept(java.util.Collections.singletonList(MediaType.APPLICATION_JSON)); <START> List<String> stormpathAgents = request.getHeaders().get(STORMPATH_AGENT); <END> if (stormpathAgents != null && stormpathAgents.size() > 0) { String stormpathAgent = Strings.arrayToDelimitedString(stormpathAgents.toArray(), " "); request.getHeaders().set("User-Agent", stormpathAgent + " " + USER_AGENT_STRING); } else { request.getHeaders().set("User-Agent", USER_AGENT_STRING); } if (request.getHeaders().getContentType() == null) { if (request.getBody() != null) { request.getHeaders().setContentType(MediaType.APPLICATION_JSON); } } }</code><technical_language>a new web filter is needed for this. a mechanism in Client update user agent, familiar core, @mrioan give some pointers, for header do need a new web filter for servlet spring extract header</technical_language>

Target:
protected void applyDefaultRequestHeaders(Request request) { request.getHeaders().setAccept(java.util.Collections.singletonList(MediaType.APPLICATION_JSON)); Map<String, List<String>> headerMap = HttpHeadersHolder.get(); String stormpathAgentHeaderName = STORMPATH_AGENT.toLowerCase(); if (headerMap != null && headerMap.get(stormpathAgentHeaderName) != null) { List<String> stormpathAgents = headerMap.get(stormpathAgentHeaderName); if (stormpathAgents != null && stormpathAgents.size() > 0) { String stormpathAgent = Strings.arrayToDelimitedString(stormpathAgents.toArray(), " "); request.getHeaders().set("User-Agent", stormpathAgent + " " + USER_AGENT_STRING); } } else { request.getHeaders().set("User-Agent", USER_AGENT_STRING); } if (request.getHeaders().getContentType() == null) { if (request.getBody() != null) { request.getHeaders().setContentType(MediaType.APPLICATION_JSON); } } }
Source:
<code>public ClientReferrerFilter(final ReferringInformation referringInformation, @Nullable final String serviceName) { final ImmutableMap.Builder<String, List<Object>> builder = ImmutableMap.builder(); <START> if (referringInformation.getReferrringHost() != null) { <END> builder.put(OTHeaders.REFERRING_HOST, ImmutableList.of(referringInformation.getReferrringHost())); } if (referringInformation.getReferringEnvironment() != null) { builder.put(OTHeaders.REFERRING_ENV, ImmutableList.of(referringInformation.getReferringEnvironment())); } if (serviceName != null) { builder.put(OTHeaders.REFERRING_SERVICE, ImmutableList.of(serviceName)); } referrerHeaders = builder.build(); if (isActive()) { LOG.info("on outgoing jax-rs requests, will set headers: {}", referrerHeaders); } else { LOG.warn("no headers found for outgoing jax-rs requests"); } }</code><technical_language>'r's in getReferrringHost</technical_language>

Target:
public ClientReferrerFilter(final ReferringInformation referringInformation, @Nullable final String serviceName) { final ImmutableMap.Builder<String, List<Object>> builder = ImmutableMap.builder(); if (referringInformation.getReferringHost() != null) { builder.put(OTHeaders.REFERRING_HOST, ImmutableList.of(referringInformation.getReferringHost())); } if (referringInformation.getReferringEnvironment() != null) { builder.put(OTHeaders.REFERRING_ENV, ImmutableList.of(referringInformation.getReferringEnvironment())); } if (serviceName != null) { builder.put(OTHeaders.REFERRING_SERVICE, ImmutableList.of(serviceName)); } referrerHeaders = builder.build(); if (isActive()) { LOG.info("on outgoing jax-rs requests, will set headers: {}", referrerHeaders); } else { LOG.warn("no headers found for outgoing jax-rs requests"); } }
Source:
<code>public void testRecovery_ClosedStateTransition() { assertEquals("Delayed service is down", monitoringService.delayedServiceResponse()); assertEquals("OPEN", delayedServiceCircuitBreaker.getState()); try { Thread.sleep(4000); } catch (InterruptedException e) { <START> e.printStackTrace(); <END> } assertEquals("HALF_OPEN", delayedServiceCircuitBreaker.getState()); assertEquals("Delayed service is working", monitoringService.delayedServiceResponse()); assertEquals("CLOSED", delayedServiceCircuitBreaker.getState()); }</code><technical_language>logger</technical_language>

Target:
public void testRecovery_ClosedStateTransition() { assertEquals("Delayed service is down", monitoringService.delayedServiceResponse()); assertEquals("OPEN", delayedServiceCircuitBreaker.getState()); try { LOGGER.info("Waiting 4s for delayed service to become responsive"); Thread.sleep(4000); } catch (InterruptedException e) { e.printStackTrace(); } assertEquals("HALF_OPEN", delayedServiceCircuitBreaker.getState()); assertEquals("Delayed service is working", monitoringService.delayedServiceResponse()); assertEquals("CLOSED", delayedServiceCircuitBreaker.getState()); }
Source:
<code>public void testOver9000() { testAssertOkLines(true, "package Vegeta", " native testSuccess()", " class Scouter", " static int size = 0", " construct()", " size++", "", " init", " for i = 0 to 20000", " new Scouter()", " if Scouter.size == 20001", <START> " testSuccess()", <END> "endpackage" ); }</code><technical_language>more sense create 20k powelevel objects instead of 20 scouters</technical_language>

Target:
public void testOver9000() { testAssertOkLines(true, "package Vegeta", " native testSuccess()", " class PowerLevel", " static int amount = 0", " construct()", " amount++", "", " init", " for i = 0 to 20000", " new PowerLevel()", " if PowerLevel.amount > 9000 and PowerLevel.amount == 20001", " testSuccess()", "endpackage" ); }
Source:
<code>public BitmapIndexSeeker getBitmapIndexSeeker(String dimension) { final Column column = input.getColumn(dimension); if (column == null) { return new EmptyBitmapIndexSeeker(); } final BitmapIndex bitmaps = column.getBitmapIndex(); if (bitmaps == null) { return new EmptyBitmapIndexSeeker(); } final Indexed<String> dimSet = getDimValueLookup(dimension); return new BitmapIndexSeeker() { private int currIndex = 0; private String currVal = null; private String lastVal = null; @Override public IndexedInts seek(String value) { if (dimSet == null || dimSet.size() == 0) { return new EmptyIndexedInts(); } if (lastVal != null) { if (GenericIndexed.STRING_STRATEGY.compare(value, lastVal) <= 0) { throw new ISE("Value[%s] is less than the last value[%s] I have, cannot be.", value, lastVal); } return new EmptyIndexedInts(); } if (currVal == null) { if(currIndex == dimSet.size()) { return new EmptyIndexedInts(); <START> } <END> currVal = dimSet.get(currIndex); } int compareResult = GenericIndexed.STRING_STRATEGY.compare(currVal, value); if (compareResult == 0) { IndexedInts ret = new BitmapCompressedIndexedInts(bitmaps.getBitmap(currIndex)); ++currIndex; if (currIndex == dimSet.size()) { lastVal = value; } else { currVal = dimSet.get(currIndex); } return ret; } else if (compareResult < 0) { throw new ISE("Skipped currValue[%s], currIndex[%,d]; incoming value[%s]", currVal, currIndex, value); } else { return new EmptyIndexedInts(); } } }; }</code><technical_language>is this change needed</technical_language>

Target:
public BitmapIndexSeeker getBitmapIndexSeeker(String dimension) { final Column column = input.getColumn(dimension); if (column == null) { return new EmptyBitmapIndexSeeker(); } final BitmapIndex bitmaps = column.getBitmapIndex(); if (bitmaps == null) { return new EmptyBitmapIndexSeeker(); } final Indexed<String> dimSet = getDimValueLookup(dimension); return new BitmapIndexSeeker() { private int currIndex = 0; private String currVal = null; private String lastVal = null; @Override public IndexedInts seek(String value) { if (dimSet == null || dimSet.size() == 0) { return new EmptyIndexedInts(); } if (lastVal != null) { if (GenericIndexed.STRING_STRATEGY.compare(value, lastVal) <= 0) { throw new ISE( "Value[%s] is less than the last value[%s] I have, cannot be.", value, lastVal ); } return new EmptyIndexedInts(); } if (currVal == null) { currVal = dimSet.get(currIndex); } int compareResult = GenericIndexed.STRING_STRATEGY.compare(currVal, value); if (compareResult == 0) { IndexedInts ret = new BitmapCompressedIndexedInts(bitmaps.getBitmap(currIndex)); ++currIndex; if (currIndex == dimSet.size()) { lastVal = value; } else { currVal = dimSet.get(currIndex); } return ret; } else if (compareResult < 0) { throw new ISE( "Skipped currValue[%s], currIndex[%,d]; incoming value[%s]", currVal, currIndex, value ); } else { return new EmptyIndexedInts(); } } }; }