auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public void ensureEncrypted() { <START> this.username = StringUtils.stripToNull(username); <END> setPasswordIfNotBlank(password); if (encryptedPassword != null) { goCipher.maybeReEncrypt(encryptedPassword, this::setEncryptedPassword); } }</code><technical_language>Rename method dealing encryption post-construct time</technical_language>

Target:
public void ensureEncrypted() { this.username = StringUtils.stripToNull(username); setPasswordIfNotBlank(password); if (encryptedPassword != null) { setEncryptedPassword(goCipher.maybeReEncryptForPostConstructWithoutExceptions(encryptedPassword)); } }
Source:
<code>public boolean isNull(int field) { <START> return Objects.isNull(value); <END> }</code><technical_language>return == null; I of Objects.isNull == null. 1 place in Presto code this is used</technical_language>

Target:
public boolean isNull(int field) { return value == null; }
Source:
<code>public void setZoomPercentageBy0_5_isHalfCropWidth() throws InterruptedException { mZoomControl.setZoomPercentage(1f); HandlerUtil.waitForLooperToIdle(mHandler); Rect cropRegionMaxZoom = getSessionCropRegion(mControlUpdateListener); Rect cropRegionMinZoom = getSensorRect(); mZoomControl.setZoomPercentage(0.5f); HandlerUtil.waitForLooperToIdle(mHandler); Rect cropRegionHalfZoom = getSessionCropRegion(mControlUpdateListener); Assert.assertEquals(cropRegionHalfZoom.width(), (cropRegionMinZoom.width() + cropRegionMaxZoom.width()) / 2.0f, <START> 10); <END> }</code><technical_language>explain is 10 here? If getSessionCropRegion is precise enough, deviation 1 pixel most</technical_language>

Target:
public void setZoomPercentageBy0_5_isHalfCropWidth() throws InterruptedException { mZoomControl.setZoomPercentage(1f); HandlerUtil.waitForLooperToIdle(mHandler); Rect cropRegionMaxZoom = getSessionCropRegion(mControlUpdateListener); Rect cropRegionMinZoom = getSensorRect(); mZoomControl.setZoomPercentage(0.5f); HandlerUtil.waitForLooperToIdle(mHandler); Rect cropRegionHalfZoom = getSessionCropRegion(mControlUpdateListener); Assert.assertEquals(cropRegionHalfZoom.width(), (cropRegionMinZoom.width() + cropRegionMaxZoom.width()) / 2.0f, TOLERANCE); }
Source:
<code>private static DurationValue durationInSecondsAndNanos( Temporal from, Temporal to ) { long seconds; long nanos; boolean negate = false; if ( from.isSupported( OFFSET_SECONDS ) && !to.isSupported( OFFSET_SECONDS ) ) { negate = true; Temporal tmp = from; from = to; to = tmp; } seconds = from.until( to, SECONDS ); int fromNanos = from.isSupported( NANO_OF_SECOND ) ? from.get( NANO_OF_SECOND ) : 0; int toNanos = to.isSupported( NANO_OF_SECOND ) ? to.get( NANO_OF_SECOND ) : 0; nanos = toNanos - fromNanos; if ( seconds > 0 && nanos < 0 ) { nanos = NANOS_PER_SECOND + nanos; } else if ( seconds < 0 && nanos > 0 ) <START> { <END> nanos = nanos - NANOS_PER_SECOND; } if ( negate ) { seconds = -seconds; nanos = -nanos; } return duration( 0, 0, seconds, nanos ); }</code><technical_language>do I get itching feeling seconds--; here</technical_language>

Target:
private static DurationValue durationInSecondsAndNanos( Temporal from, Temporal to ) { long seconds; long nanos; boolean negate = false; if ( from.isSupported( OFFSET_SECONDS ) && !to.isSupported( OFFSET_SECONDS ) ) { negate = true; Temporal tmp = from; from = to; to = tmp; } seconds = from.until( to, SECONDS ); int fromNanos = from.isSupported( NANO_OF_SECOND ) ? from.get( NANO_OF_SECOND ) : 0; int toNanos = to.isSupported( NANO_OF_SECOND ) ? to.get( NANO_OF_SECOND ) : 0; nanos = toNanos - fromNanos; boolean specialZeroSecondCase = seconds == 0 && from.get( SECOND_OF_MINUTE ) != to.get( SECOND_OF_MINUTE ); if ( nanos < 0 && ( seconds > 0 || specialZeroSecondCase ) ) { nanos = NANOS_PER_SECOND + nanos; } else if ( nanos > 0 && ( seconds < 0 || specialZeroSecondCase ) ) { nanos = nanos - NANOS_PER_SECOND; } if ( negate ) { seconds = -seconds; nanos = -nanos; } return duration( 0, 0, seconds, nanos ); }
Source:
<code>private KeychainBackend[] getAvailableBackends() { if (!keychain.isPresent()) { return new KeychainBackend[]{}; } if (SystemUtils.IS_OS_LINUX) { EnumSet<KeychainBackend> backends = LinuxSystemKeychainAccess.getAvailableKeychainBackends(); keychainBackendChoiceBox.setValue(LinuxSystemKeychainAccess.getBackendActivated()); <START> return backends.size() > 0 ? backends.toArray(KeychainBackend[]::new) : new KeychainBackend[]{}; <END> } if (SystemUtils.IS_OS_MAC || SystemUtils.IS_OS_WINDOWS) { keychainBackendChoiceBox.setValue(Arrays.stream(KeychainBackend.supportedBackends()).findFirst().orElseThrow(IllegalStateException::new)); return KeychainBackend.supportedBackends(); } return new KeychainBackend[]{}; }</code><technical_language>Is this ternary necessary</technical_language>

Target:
private KeychainBackend[] getAvailableBackends() { if (!keychain.isPresent()) { return new KeychainBackend[]{}; } if (SystemUtils.IS_OS_LINUX) { EnumSet<KeychainBackend> backends = LinuxSystemKeychainAccess.getAvailableKeychainBackends(); return backends.size() > 0 ? backends.toArray(KeychainBackend[]::new) : new KeychainBackend[]{}; } if (SystemUtils.IS_OS_MAC || SystemUtils.IS_OS_WINDOWS) { return KeychainBackend.supportedBackends(); } return new KeychainBackend[]{}; }
Source:
<code>private static FrameworkLogEntry getLog(IStatus status) { Throwable t = status.getException(); ArrayList<FrameworkLogEntry> childlist = new ArrayList<>(); int stackCode = t instanceof CoreException ? 1 : 0; if (stackCode == 1) { IStatus coreStatus = ((CoreException) t).getStatus(); if (coreStatus != null) { childlist.add(getLog(coreStatus)); } } if (status.isMultiStatus()) { IStatus[] children = status.getChildren(); for (IStatus <START> children1 : <END> children) { childlist.add(getLog(children1)); } } FrameworkLogEntry[] children = (childlist.size() == 0 ? null : childlist.toArray(new FrameworkLogEntry[childlist.size()])); return new FrameworkLogEntry(status.getPlugin(), status.getSeverity(), status.getCode(), status.getMessage(), stackCode, t, children); }</code><technical_language>name "child"</technical_language>

Target:
private static FrameworkLogEntry getLog(IStatus status) { Throwable t = status.getException(); ArrayList<FrameworkLogEntry> childlist = new ArrayList<>(); int stackCode = t instanceof CoreException ? 1 : 0; if (stackCode == 1) { IStatus coreStatus = ((CoreException) t).getStatus(); if (coreStatus != null) { childlist.add(getLog(coreStatus)); } } if (status.isMultiStatus()) { IStatus[] children = status.getChildren(); for (IStatus child : children) { childlist.add(getLog(child)); } } FrameworkLogEntry[] children = (childlist.size() == 0 ? null : childlist.toArray(new FrameworkLogEntry[childlist.size()])); return new FrameworkLogEntry(status.getPlugin(), status.getSeverity(), status.getCode(), status.getMessage(), stackCode, t, children); }
Source:
<code>public List<HandlerMethodArgumentResolver> getResolvers() { <START> return new ArrayList<>(this.resolvers); <END> }</code><technical_language>Collections.unmodifableList()</technical_language>

Target:
public List<HandlerMethodArgumentResolver> getResolvers() { return Collections.unmodifiableList(this.resolvers); }
Source:
<code>public Response updateWifiInfo(@Scope(OAuthScope.DEVICE_INFORMATION_WRITE) final AccessToken accessToken, @Valid final WifiInfo wifiInfo){ final Boolean hasUpserted = deviceProcessor.upsertWifiInfo(accessToken.accountId, wifiInfo); if (!hasUpserted) { <START> throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR) <END> .entity(new JsonError(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), String.format("Failed to upsert wifi info for sense %s", wifiInfo.senseId))).build()); } return Response.noContent().build(); }</code><technical_language>Hmm... throw a 500 error if this fails, client errors sense</technical_language>

Target:
public Response updateWifiInfo(@Scope(OAuthScope.DEVICE_INFORMATION_WRITE) final AccessToken accessToken, @Valid final WifiInfo wifiInfo){ try { final Boolean hasUpserted = deviceProcessor.upsertWifiInfo(accessToken.accountId, wifiInfo); if (!hasUpserted) { throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR) .entity(new JsonError(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), String.format("Failed to upsert wifi info for sense %s", wifiInfo.senseId))).build()); } } catch (DeviceProcessor.InvalidWifiInfoException iwe) { throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST) .entity(new JsonError(Response.Status.BAD_REQUEST.getStatusCode(), iwe.getMessage())).build()); } return Response.noContent().build(); }
Source:
<code>public long timestampNanoToCycles(long nanos){ long retVal; <START> if(getInverseTimeScale() != 1.0 ) { <END> retVal = (long) (nanos * getInverseTimeScale()); } else { retVal = nanos; } return retVal - getOffset(); }</code><technical_language>saver check for a clock frequency of 1GHz (comparison of long values) instead of checking scale 1.0 (comparison of double values)</technical_language>

Target:
public long timestampNanoToCycles(long nanos){ long retVal; if( clockNeedsScale() ) { retVal = (long) (nanos * getInverseTimeScale()); } else { retVal = nanos; } return retVal - getOffset(); }
Source:
<code>public String showCityCenter( @RequestParam Map<String, String> allRequestParams, Model model) { LOGGER.info("Requested params:" + allRequestParams); Player player = playerService.getPlayerByLogin(playerLogin); CityCenterDto cityCenterDto = cityCenterService.cityCenterInfo(); cityCenterDto.setResourceDto(new ResourceDto(player.getPlayerResources().getGold(), player.getPlayerResources().getTimber(), player.getPlayerResources().getClay(), player.getPlayerResources().getCorn())); <START> cityCenterDto.setNickName(player.getLogin()); <END> model.addAttribute("dto", cityCenterDto); LOGGER.info("Out:" + model); return "city_center"; }</code><technical_language>done in cityCenterService. fake data</technical_language>

Target:
public String showCityCenter( @RequestParam Map<String, String> allRequestParams, Model model) { LOGGER.info("Requested params:" + allRequestParams); CityCenterDto cityCenterDto = cityCenterService.cityCenterInfo(); model.addAttribute("dto", cityCenterDto); LOGGER.info("Out:" + model); return "city_center"; }
Source:
<code>public boolean pingDB() { logger.debug("JDBC::pingDB"); boolean ret = false; long timerStart = System.currentTimeMillis(); if (openConnection()) { if (conf.getDbName() == null) { logger.debug( <START> "JDBC::pingDB asking db for name as absolutelly first db action, after connection is established."); <END> String dbName = conf.getDBDAO().doGetDB(); conf.setDbName(dbName); ret = dbName.length() > 0; } else { ret = conf.getDBDAO().doPingDB() > 0; } } logTime("pingDB", timerStart, System.currentTimeMillis()); return ret; }</code><technical_language>spelling: absolutely</technical_language>

Target:
public boolean pingDB() { logger.debug("JDBC::pingDB"); boolean ret = false; long timerStart = System.currentTimeMillis(); if (openConnection()) { if (conf.getDbName() == null) { logger.debug( "JDBC::pingDB asking db for name as absolutely first db action, after connection is established."); String dbName = conf.getDBDAO().doGetDB(); conf.setDbName(dbName); ret = dbName.length() > 0; } else { ret = conf.getDBDAO().doPingDB() > 0; } } logTime("pingDB", timerStart, System.currentTimeMillis()); return ret; }
Source:
<code>public void appendDelta(Delta d) { deltas.add(d); <START> if (uncommittedChanges instanceof AtomicHashMap) { <END> uncommittedChanges = (AtomicHashMap<K, ?>) d.merge(uncommittedChanges); } setChanged(true); }</code><technical_language>this condition is true</technical_language>

Target:
public void appendDelta(Delta d) { deltas.add(d); if (uncommittedChanges != null) { uncommittedChanges = (AtomicHashMap<K, ?>) d.merge(uncommittedChanges); } setChanged(true); }
Source:
<code>public void asyncReadEntries(final long firstEntry, final long lastEntry, final ReadCallback cb, final Object ctx) { if (bk.isStopped()) { cb.readComplete(-1, MockLedgerHandle.this, null, ctx); return; } bk.executor.execute(new Runnable() { public void run() { if (bk.getProgrammedFailStatus()) { cb.readComplete(bk.failReturnCode, MockLedgerHandle.this, null, ctx); return; } else if (bk.isStopped()) { log.debug("Bookkeeper is closed!"); cb.readComplete(-1, MockLedgerHandle.this, null, ctx); return; } log.debug("readEntries: first={} last={} total={}", firstEntry, lastEntry, entries.size()); final Queue<LedgerEntry> seq = new ArrayDeque<LedgerEntry>(); long entryId = firstEntry; while (entryId <= lastEntry && entryId < entries.size()) { <START> seq.add(new LedgerEntry(entries.get((int) entryId++).duplicate())); <END> } log.debug("Entries read: {}", seq); try { Thread.sleep(1); } catch (InterruptedException e) { } cb.readComplete(0, MockLedgerHandle.this, new Enumeration<LedgerEntry>() { public boolean hasMoreElements() { return !seq.isEmpty(); } public LedgerEntry nextElement() { return seq.remove(); } }, ctx); } }); }</code><technical_language>is a memory leak here, need duplicate. LedgerEntry constructor retain buffer</technical_language>

Target:
public void asyncReadEntries(final long firstEntry, final long lastEntry, final ReadCallback cb, final Object ctx) { if (bk.isStopped()) { cb.readComplete(-1, MockLedgerHandle.this, null, ctx); return; } bk.executor.execute(new Runnable() { public void run() { if (bk.getProgrammedFailStatus()) { cb.readComplete(bk.failReturnCode, MockLedgerHandle.this, null, ctx); return; } else if (bk.isStopped()) { log.debug("Bookkeeper is closed!"); cb.readComplete(-1, MockLedgerHandle.this, null, ctx); return; } log.debug("readEntries: first={} last={} total={}", firstEntry, lastEntry, entries.size()); final Queue<LedgerEntry> seq = new ArrayDeque<LedgerEntry>(); long entryId = firstEntry; while (entryId <= lastEntry && entryId < entries.size()) { seq.add(new LedgerEntry(entries.get((int) entryId++))); } log.debug("Entries read: {}", seq); try { Thread.sleep(1); } catch (InterruptedException e) { } cb.readComplete(0, MockLedgerHandle.this, new Enumeration<LedgerEntry>() { public boolean hasMoreElements() { return !seq.isEmpty(); } public LedgerEntry nextElement() { return seq.remove(); } }, ctx); } }); }
Source:
<code>public static List<Field> getDeclaredFieldsIncludingParent(Class<?> current) { if (fieldCache.containsKey(current)) { return fieldCache.get(current); } <START> Class<?> start = current; <END> List<Field> fields = new ArrayList<>(); while (current != null) { List<Field> declared = Arrays.asList(current.getDeclaredFields()); fields.addAll(declared); current = current.getSuperclass(); } fieldCache.put(start, fields); return fields; }</code><technical_language>is this necessary? fieldCache.put here</technical_language>

Target:
public static List<Field> getDeclaredFieldsIncludingParent(Class<?> current) { if (fieldCache.containsKey(current)) { return fieldCache.get(current); } List<Field> fields = new ArrayList<>(); fieldCache.put(current, fields); while (current != null) { List<Field> declared = Arrays.asList(current.getDeclaredFields()); fields.addAll(declared); current = current.getSuperclass(); } return fields; }
Source:
<code>private String determineHandlerLocation(String lsRegisterDump, String scheme) throws Exception { String[] lsRegisterEntries = lsRegisterDump.split("-{80}\n"); String keyOfFirstLine; String <START> prefixOfSchemeList; <END> if (Stream.of(lsRegisterEntries).parallel().anyMatch(s -> s.startsWith("BundleClass:"))) { keyOfFirstLine = "BundleClass"; prefixOfSchemeList = "bindings:"; } else { keyOfFirstLine = "bundle id"; prefixOfSchemeList = "claimed schemes:"; } String lines = "(?:.*\\n)*"; Pattern pattern = Pattern.compile( "^" + lines + "\\s*" + PATH_WITH_CAPUTERING_GROUP + "\\n" + lines + "\\s*" + prefixOfSchemeList + ".*" + Pattern.quote(scheme) + ":", Pattern.MULTILINE); String path = Stream.of(lsRegisterEntries). parallel(). filter(s -> s.startsWith(keyOfFirstLine)). filter(s -> s.contains(scheme + ":")). map(s -> pattern.matcher(s)). filter(m -> m.find()). map(m -> m.group(1)).findFirst().map(s -> s.replaceFirst(TRAILING_HEX_VALUE_WITH_BRACKETS, "")) .orElse(""); return path; }</code><technical_language>keyOfSchemeList (to compliant other variable)</technical_language>

Target:
private String determineHandlerLocation(String lsRegisterDump, String scheme) throws Exception { String[] lsRegisterEntries = lsRegisterDump.split("-{80}\n"); String keyOfFirstLine; String keyOfSchemeList; if (Stream.of(lsRegisterEntries).parallel().anyMatch(s -> s.startsWith("BundleClass:"))) { keyOfFirstLine = "BundleClass"; keyOfSchemeList = "bindings:"; } else { keyOfFirstLine = "bundle id"; keyOfSchemeList = "claimed schemes:"; } Pattern pattern = Pattern.compile( "^" + ANY_LINES + "\\s*" + PATH_WITH_CAPTURING_GROUP + "\\n" + ANY_LINES + "\\s*" + keyOfSchemeList + ".*" + Pattern.quote(scheme) + ":", Pattern.MULTILINE); String path = Stream.of(lsRegisterEntries). parallel(). filter(s -> s.startsWith(keyOfFirstLine)). filter(s -> s.contains(scheme + ":")). map(s -> pattern.matcher(s)). filter(m -> m.find()). map(m -> m.group(1)).findFirst().map(s -> s.replaceFirst(TRAILING_HEX_VALUE_WITH_BRACKETS, "")) .orElse(""); return path; }
Source:
<code><START> public Set<Type<?>> findAnnotatedClasses(Class annotationClass) <END> throws ClassNotFoundException { Set<Type<?>> annotatedClasses = new HashSet<>(); compiledObjects.values().forEach(classz -> { if (classz.getAnnotation(annotationClass) != null) { annotatedClasses.add(getType(classz)); } }); return annotatedClasses; }</code><technical_language>want this work Type instead Class here</technical_language>

Target:
public Set<Class<?>> findAnnotatedClasses(Class annotationClass) throws ClassNotFoundException { Set<Class<?>> annotatedClasses = new HashSet<Class<?>>(); compiledObjects.values().forEach(classz -> { if (classz.getAnnotation(annotationClass) != null) { annotatedClasses.add(classz); } }); return annotatedClasses; }
Source:
<code>private String getContainersDescriptionForLogging() { List<ContainerTemplate> containers = getContainers(); StringBuilder sb = new StringBuilder(); for (ContainerTemplate ct : containers) { sb.append("* ).append(ct.getName()).append( ").append(ct.getImage()); StringBuilder optional = new StringBuilder(); optionalField(optional, "resourceRequestCpu", ct.getResourceRequestCpu()); optionalField(optional, "resourceRequestMemory", ct.getResourceRequestMemory()); optionalField(optional, "resourceLimitCpu", ct.getResourceLimitCpu()); optionalField(optional, "resourceLimitMemory", ct.getResourceLimitMemory()); if (optional.length() > 0) { sb.append("(").append(optional).append(")"); } sb.append("\n"); } <START> if (getYamls().size() > 0 && isShowRawYaml()) { <END> for (String yaml : getYamls()) { sb.append("yaml:\n") .append(yaml) .append("\n"); } } return sb.toString(); }</code><technical_language>need check for getYamls().size()</technical_language>

Target:
private String getContainersDescriptionForLogging() { List<ContainerTemplate> containers = getContainers(); StringBuilder sb = new StringBuilder(); for (ContainerTemplate ct : containers) { sb.append("* ).append(ct.getName()).append( ").append(ct.getImage()); StringBuilder optional = new StringBuilder(); optionalField(optional, "resourceRequestCpu", ct.getResourceRequestCpu()); optionalField(optional, "resourceRequestMemory", ct.getResourceRequestMemory()); optionalField(optional, "resourceLimitCpu", ct.getResourceLimitCpu()); optionalField(optional, "resourceLimitMemory", ct.getResourceLimitMemory()); if (optional.length() > 0) { sb.append("(").append(optional).append(")"); } sb.append("\n"); } if (isShowRawYaml()) { for (String yaml : getYamls()) { sb.append("yaml:\n") .append(yaml) .append("\n"); } } return sb.toString(); }
Source:
<code>private boolean processMedia(Uri mediaUri) { if (mediaUri == null) { return false; } Activity activity = EditPostActivity.this; if (!MediaUtils.isInMediaStore(mediaUri) && !mediaUri.toString().startsWith("/") && !mediaUri.toString().startsWith("file://")) { <START> mediaUri = MediaUtils.downloadExternalMedia(activity, mediaUri); <END> } String path = MediaUtils.getRealPathFromURI(activity, mediaUri); if (path == null) { return false; } final boolean isVideo = MediaUtils.isVideo(mediaUri.toString()); Uri optimizedMedia = WPMediaUtils.getOptimizedMedia(activity, path, isVideo); if (optimizedMedia != null) { mediaUri = optimizedMedia; } else if (mShowNewEditor || mShowAztecEditor) { if (!mSite.isWPCom()) { Uri rotatedMedia = WPMediaUtils.fixOrientationIssue(activity, path, isVideo); if (rotatedMedia != null) { mediaUri = rotatedMedia; } } else { if (mShowNewEditor) { Uri rotatedMedia = WPMediaUtils.fixOrientationIssue(activity, path, isVideo); if (rotatedMedia != null) { path = MediaUtils.getRealPathFromURI(activity, rotatedMedia); } } } } trackAddMediaFromDeviceEvents(isNew, isVideo, mediaUri); postProcessMedia(mediaUri, path, isVideo); return true; }</code><technical_language>download external file in another thread. Ex: I share a picture WordPress Google Drive file needs downloaded immediately. Ref: <LINK_0> <LINK_1></technical_language>

Target:
private boolean processMedia(Uri mediaUri) { if (mediaUri == null) { return false; } Activity activity = EditPostActivity.this; String path = MediaUtils.getRealPathFromURI(activity, mediaUri); if (path == null) { return false; } final boolean isVideo = MediaUtils.isVideo(mediaUri.toString()); Uri optimizedMedia = WPMediaUtils.getOptimizedMedia(activity, path, isVideo); if (optimizedMedia != null) { mediaUri = optimizedMedia; } else if (mShowNewEditor || mShowAztecEditor) { if (!mSite.isWPCom()) { Uri rotatedMedia = WPMediaUtils.fixOrientationIssue(activity, path, isVideo); if (rotatedMedia != null) { mediaUri = rotatedMedia; } } else { if (mShowNewEditor) { Uri rotatedMedia = WPMediaUtils.fixOrientationIssue(activity, path, isVideo); if (rotatedMedia != null) { path = MediaUtils.getRealPathFromURI(activity, rotatedMedia); } } } } if (isInterrupted()) { return false; } trackAddMediaFromDeviceEvents(isNew, isVideo, mediaUri); postProcessMedia(mediaUri, path, isVideo); return true; }
Source:
<code>private void dataCenterWithClusterSelectedItemChanged(Object sender, EventArgs args) { <START> String selectedTimeZone = null; <END> Integer selectedOsId = null; if (getTimeZone().getSelectedItem() != null) { selectedTimeZone = getTimeZone().getSelectedItem().getTimeZoneKey().toString(); } if (getOSType().getSelectedItem() != null) { selectedOsId = getOSType().getSelectedItem(); } behavior.dataCenterWithClusterSelectedItemChanged(); refreshMigrationPolicies(); updateMigrationRelatedFields(); DataCenterWithCluster dataCenterWithCluster = getDataCenterWithClustersList().getSelectedItem(); if (dataCenterWithCluster != null && dataCenterWithCluster.getDataCenter() != null) { getDisksAllocationModel().setQuotaEnforcementType(dataCenterWithCluster.getDataCenter() .getQuotaEnforcementType()); } updateMigrationOptions(); handleQxlClusterLevel(); updateWatchdogModels(); updateBootMenu(); getInstanceImages().updateActionsAvailability(); initGraphicsConsoles(); updateSoundCard(); updateResumeBehavior(); updateBiosType(); if (selectedOsId != null) { getOSType().setSelectedItem(selectedOsId); } if (selectedTimeZone != null && !selectedTimeZone.isEmpty()) { getBehavior().updateTimeZone(selectedTimeZone); } }</code><technical_language>initialize "" if isEmpty below? save a null check;)</technical_language>

Target:
private void dataCenterWithClusterSelectedItemChanged(Object sender, EventArgs args) { String selectedTimeZone = ""; Integer selectedOsId = null; if (getTimeZone().getSelectedItem() != null) { selectedTimeZone = getTimeZone().getSelectedItem().getTimeZoneKey().toString(); } if (getOSType().getSelectedItem() != null) { selectedOsId = getOSType().getSelectedItem(); } behavior.dataCenterWithClusterSelectedItemChanged(); refreshMigrationPolicies(); updateMigrationRelatedFields(); DataCenterWithCluster dataCenterWithCluster = getDataCenterWithClustersList().getSelectedItem(); if (dataCenterWithCluster != null && dataCenterWithCluster.getDataCenter() != null) { getDisksAllocationModel().setQuotaEnforcementType(dataCenterWithCluster.getDataCenter() .getQuotaEnforcementType()); } updateMigrationOptions(); handleQxlClusterLevel(); updateWatchdogModels(); updateBootMenu(); getInstanceImages().updateActionsAvailability(); initGraphicsConsoles(); updateSoundCard(); updateResumeBehavior(); updateBiosType(); if (selectedOsId != null) { getOSType().setSelectedItem(selectedOsId); } if (!selectedTimeZone.isEmpty()) { getBehavior().updateTimeZone(selectedTimeZone); } }
Source:
<code>private void showMultiLingualOnboarding() { if (Prefs.getShowSearchTutorial()) { <START> FeedbackUtil.showTapTargetView(getActivity(), <END> langButton, R.string.empty, R.string.tool_tip_lang_button, null); } Prefs.setShowSearchOnboarding(false); }</code><technical_language>requireActivity()</technical_language>

Target:
private void showMultiLingualOnboarding() { if (Prefs.getShowSearchTutorial()) { FeedbackUtil.showTapTargetView(requireActivity(), langButton, R.string.empty, R.string.tool_tip_lang_button, null); Prefs.setShowSearchOnboarding(false); } }
Source:
<code><START> public static void deleteFileOrDirectory(File file) throws IOException { <END> Files.walkFileTree(file.toPath(), new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { Files.delete(file); return FileVisitResult.CONTINUE; } @Override public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { Files.delete(dir); return FileVisitResult.CONTINUE; } }); }</code><technical_language>is a function in DiskReformatter move maybe. /** * Deletes {@code location} * @param location location delete * @throws IOException if problems deleting {@code location}. */ private void delete(File location) throws IOException { if (location.exists() && !FileUtils.deleteQuietly(location)) { throw new IOException("Could delete " + location); } } this implementation do thing</technical_language>

Target:
public static void deleteFileOrDirectory(File file) throws IOException { if (file.exists()) { Files.walkFileTree(file.toPath(), new SimpleFileVisitor<Path>() { @Override public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException { Files.delete(file); return FileVisitResult.CONTINUE; } @Override public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException { Files.delete(dir); return FileVisitResult.CONTINUE; } }); } }
Source:
<code>public void testEncryptDecryptKeyVersion(AESKeyVersion keyVersion) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException { String testinput = "weak"; byte[] encTxt = keyVersion.encryptString(testinput); String result = keyVersion.decryptString(encTxt); assertEquals(testinput, result); testinput = ""; encTxt = keyVersion.encryptString(testinput); result = keyVersion.decryptString(encTxt); assertEquals(testinput, result); <START> <END> }</code><technical_language>please remove blank lines</technical_language>

Target:
public void testEncryptDecryptKeyVersion(AESKeyVersion keyVersion) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, InvalidAlgorithmParameterException, IllegalBlockSizeException, BadPaddingException { String testinput = "weak"; byte[] encTxt = encryptString(keyVersion, testinput); String result = decryptString(keyVersion, encTxt); assertEquals(testinput, result); testinput = ""; encTxt = encryptString(keyVersion, testinput); result = decryptString(keyVersion, encTxt); assertEquals(testinput, result); }
Source:
<code>private boolean checkIfListenersHaveDataToSendOnly() { <START> synchronized (DataList.this) { <END> for (DataListener dl : all_listeners) { try { if (dl.addedData(true)) { return true; } } catch (RuntimeException e) { logger.error("{}: removing DataListener due to exception", DataList.this, dl, e); removeDataListener(dl); return checkIfListenersHaveDataToSendOnly(); } } return false; } }</code><technical_language>is this synchronized DataList. I other adds removes listener list synchronized</technical_language>

Target:
private boolean checkIfListenersHaveDataToSendOnly() { for (DataListener dl : all_listeners) { try { if (dl.addedData(true)) { return true; } } catch (RuntimeException e) { logger.error("{}: removing DataListener due to exception", DataList.this, dl, e); removeDataListener(dl); return checkIfListenersHaveDataToSendOnly(); } } return false; }
Source:
<code>private Issue createJiraIssue(AbstractBuild<?, ?> build, String filename) throws IOException, InterruptedException { EnvVars vars = build.getEnvironment(TaskListener.NULL); String summary = String.format("Build %s failed", getBuildName(vars)); <START> String checkDescription = (this.testDescription.equals("")) ? "No description is provided" : this.testDescription; <END> String description = String.format("%s\n\nThe build %s has failed.\nFirst failed run: %s", checkDescription, getBuildName(vars), getBuildDetailsString(vars)); List<BasicComponent> components = getJiraComponents(build, this.component); JiraSession session = getJiraSession(build); Issue issue = session.createIssue(projectKey, description, assignee, components, summary); writeInFile(filename, issue); return issue; }</code><technical_language>get a NPE calling testDescription.equals() checking if null</technical_language>

Target:
private Issue createJiraIssue(AbstractBuild<?, ?> build, String filename) throws IOException, InterruptedException { EnvVars vars = build.getEnvironment(TaskListener.NULL); String buildName = getBuildName(vars); String summary = String.format("Build %s failed", buildName); String description = String.format( "%s\n\nThe build %s has failed.\nFirst failed run: %s", (this.testDescription.equals("")) ? "No description is provided" : this.testDescription, buildName, getBuildDetailsString(vars) ); List<BasicComponent> components = getJiraComponents(build, this.component); JiraSession session = getJiraSession(build); Issue issue = session.createIssue(projectKey, description, assignee, components, summary); writeInFile(filename, issue); return issue; }
Source:
<code>public void onShowTimeDateTimePicker() { view.showTimeDate(false); String value = view.getTimeDate(); try { Date date = view.parseFromISO(value); view.setTimeDateTimePickerValue(date); <START> } catch (Exception e) { <END> view.setTimeDateTimePickerValue(value); } view.showTimeDateTimePicker(true); }</code><technical_language>is catch some Exception sub-type? I some ParserException.</technical_language>

Target:
public void onShowTimeDateTimePicker() { view.showTimeDate(false); String value = view.getTimeDate(); try { Date date = view.parseFromISO(value); view.setTimeDateTimePickerValue(date); } catch (IllegalArgumentException e) { view.setTimeDateTimePickerValue(value); } view.showTimeDateTimePicker(true); }
Source:
<code>public void testPublishWithSameName() throws IOException { MetricsSystem metrics = DefaultMetricsSystem.instance(); metrics.init("test"); PrometheusMetricsSink sink = new PrometheusMetricsSink(); metrics.register("Prometheus", "Prometheus", sink); metrics.register("FooBar", "fooBar", (MetricsSource) (collector, all) -> { collector.addRecord("RpcMetrics").add(new MetricsTag(PORT_INFO, "1234")) .addGauge(COUNTER_INFO, 123).endRecord(); collector.addRecord("RpcMetrics").add(new MetricsTag( PORT_INFO, "2345")).addGauge(COUNTER_INFO, 234).endRecord(); }); metrics.start(); metrics.publishMetricsNow(); ByteArrayOutputStream stream = new ByteArrayOutputStream(); OutputStreamWriter writer = new OutputStreamWriter(stream, UTF_8); sink.writeMetrics(writer); writer.flush(); String writtenMetrics = stream.toString(UTF_8.name()); <START> System.out.println(writtenMetrics); <END> Assert.assertTrue( "The expected metric line is missing from prometheus metrics output", writtenMetrics.contains( "rpc_metrics_counter{port=\"2345\"")); Assert.assertTrue( "The expected metric line is missing from prometheus metrics " + "output", writtenMetrics.contains( "rpc_metrics_counter{port=\"1234\"")); metrics.stop(); metrics.shutdown(); }</code><technical_language>NIT: debug message removed</technical_language>

Target:
public void testPublishWithSameName() throws IOException { MetricsSystem metrics = DefaultMetricsSystem.instance(); metrics.init("test"); PrometheusMetricsSink sink = new PrometheusMetricsSink(); metrics.register("Prometheus", "Prometheus", sink); metrics.register("FooBar", "fooBar", (MetricsSource) (collector, all) -> { collector.addRecord("RpcMetrics").add(new MetricsTag(PORT_INFO, "1234")) .addGauge(COUNTER_INFO, 123).endRecord(); collector.addRecord("RpcMetrics").add(new MetricsTag( PORT_INFO, "2345")).addGauge(COUNTER_INFO, 234).endRecord(); }); metrics.start(); metrics.publishMetricsNow(); ByteArrayOutputStream stream = new ByteArrayOutputStream(); OutputStreamWriter writer = new OutputStreamWriter(stream, UTF_8); sink.writeMetrics(writer); writer.flush(); String writtenMetrics = stream.toString(UTF_8.name()); Assert.assertTrue( "The expected metric line is missing from prometheus metrics output", writtenMetrics.contains( "rpc_metrics_counter{port=\"2345\"")); Assert.assertTrue( "The expected metric line is missing from prometheus metrics " + "output", writtenMetrics.contains( "rpc_metrics_counter{port=\"1234\"")); metrics.stop(); metrics.shutdown(); }
Source:
<code>public Assertion validate(final String ticketId, final String service) { <START> final org.apereo.cas.validation.Assertion ass = cas.validateServiceTicket(ticketId, () -> service); <END> return new AssertionImpl(new AttributePrincipalImpl( ass.getPrimaryAuthentication().getPrincipal().getId(), ass.getPrimaryAuthentication().getPrincipal().getAttributes())); }</code><technical_language>variable name - different</technical_language>

Target:
public Assertion validate(final String ticketId, final String service) { val assertion = cas.validateServiceTicket(ticketId, () -> service); val principal = assertion.getPrimaryAuthentication().getPrincipal(); return new AssertionImpl(new AttributePrincipalImpl(principal.getId(), principal.getAttributes())); }
Source:
<code><START> private Observable.Transformer<BoundStatement, Integer> applyMicroBatching() { <END> return tObservable -> tObservable .groupBy(b -> { ByteBuffer routingKey = b.getRoutingKey(ProtocolVersion.NEWEST_SUPPORTED, codecRegistry); Token token = metadata.newToken(routingKey); for (TokenRange tokenRange : session.getCluster().getMetadata().getTokenRanges()) { if (tokenRange.contains(token)) { return tokenRange; } } throw new RuntimeException("Unable to find any Cassandra node to insert token " + token.toString()); }) .flatMap(g -> g.compose(new BoundBatchStatementTransformer())) .flatMap(batch -> rxSession .execute(batch) .compose(applyInsertRetryPolicy()) .map(resultSet -> batch.size()) ); }</code><technical_language>Right insert patterns do data point metric. In event start multiple data points metric request, this method group inserts batch statement</technical_language>

Target:
private Observable.Transformer<BoundStatement, Integer> applyMicroBatching() { return tObservable -> tObservable .groupBy(b -> { ByteBuffer routingKey = b.getRoutingKey(ProtocolVersion.NEWEST_SUPPORTED, codecRegistry); Token token = metadata.newToken(routingKey); for (TokenRange tokenRange : session.getCluster().getMetadata().getTokenRanges()) { if (tokenRange.contains(token)) { return tokenRange; } } log.warn("Unable to find any Cassandra node to insert token " + token.toString()); return session.getCluster().getMetadata().getTokenRanges().iterator().next(); }) .flatMap(g -> g.compose(new BoundBatchStatementTransformer())) .flatMap(batch -> rxSession .execute(batch) .compose(applyInsertRetryPolicy()) .map(resultSet -> batch.size()) ); }
Source:
<code>public Variant(int index, String name, String url, int bitrate, String codecs, int width, int height) { this.url = url; <START> if (name != null) { <END> format = new Format(name, MimeTypes.APPLICATION_M3U8, width, height, -1, -1, -1, bitrate, null, codecs); } else { format = new Format(Integer.toString(index), MimeTypes.APPLICATION_M3U8, width, height, -1, -1, -1, bitrate, null, codecs); } }</code><technical_language>Hm. I guess a weird case (some variants names, others in master playlist), strange if ended exposing some tracks indices for names other tracks actual names. feel about: name: Integer.toString(index) name: Integer.toString(index) + ':' + name apply for TODO in WebmExtractor, I guess some tracks names others more likely</technical_language>

Target:
public Variant(int index, String name, String url, int bitrate, String codecs, int width, int height) { this.url = url; this.name = name; String formatName = name != null ? name : Integer.toString(index); format = new Format(formatName, MimeTypes.APPLICATION_M3U8, width, height, -1, -1, -1, bitrate, null, codecs); }
Source:
<code>private JsonElement evaluate(LDUser user, FeatureStore featureStore, List<FeatureRequestEvent> events, Set<String> visited) { boolean prereqOk = true; for (Prerequisite prereq : prerequisites) { <START> visited.add(key); <END> if (visited.contains(prereq.getKey())) { logger.error("Prerequisite cycle detected when evaluating feature flag: " + key); return null; } FeatureFlag prereqFeatureFlag = featureStore.get(prereq.getKey()); JsonElement prereqEvalResult = null; if (prereqFeatureFlag == null) { logger.error("Could not retrieve prerequisite flag: " + prereq.getKey() + " when evaluating: " + key); return null; } else if (prereqFeatureFlag.isOn()) { prereqEvalResult = prereqFeatureFlag.evaluate(user, featureStore, events, visited); if (prereqEvalResult == null || !prereqEvalResult.equals(prereqFeatureFlag.getVariation(prereq.getVariation()))) { prereqOk = false; } } else { prereqOk = false; } events.add(new FeatureRequestEvent(prereqFeatureFlag.getKey(), user, prereqEvalResult, null)); } if (prereqOk) { return getVariation(evaluateIndex(user)); } return null; }</code><technical_language>This line is in wrong place. adding feature flag's key iteration prerequisites-- benign a bit inefficient</technical_language>

Target:
private JsonElement evaluate(LDUser user, FeatureStore featureStore, List<FeatureRequestEvent> events, Set<String> visited) { boolean prereqOk = true; visited.add(key); for (Prerequisite prereq : prerequisites) { if (visited.contains(prereq.getKey())) { logger.error("Prerequisite cycle detected when evaluating feature flag: " + key); return null; } FeatureFlag prereqFeatureFlag = featureStore.get(prereq.getKey()); JsonElement prereqEvalResult = null; if (prereqFeatureFlag == null) { logger.error("Could not retrieve prerequisite flag: " + prereq.getKey() + " when evaluating: " + key); return null; } else if (prereqFeatureFlag.isOn()) { prereqEvalResult = prereqFeatureFlag.evaluate(user, featureStore, events, visited); if (prereqEvalResult == null || !prereqEvalResult.equals(prereqFeatureFlag.getVariation(prereq.getVariation()))) { prereqOk = false; } } else { prereqOk = false; } events.add(new FeatureRequestEvent(prereqFeatureFlag.getKey(), user, prereqEvalResult, null)); } if (prereqOk) { return getVariation(evaluateIndex(user)); } return null; }
Source:
<code>public boolean isArticleTextDisplayed() { scrollToSelector(".article-content p"); <START> return articleContent.isDisplayed(); <END> }</code><technical_language>wait for articleContent</technical_language>

Target:
public boolean isArticleTextDisplayed() { wait.forElementPresent(By.cssSelector(".article-content p")); scrollToSelector(".article-content p"); return articleContent.isDisplayed(); }
Source:
<code>void giveBack(V object) { Preconditions.checkNotNull(object, "object"); synchronized (this) { if (closed) { log.info(String.format("giveBack called after being closed. key[%s]", key)); factory.close(object); return; } if (resourceHolderList.size() >= maxSize) { <START> if (resourceHolderList.stream().filter(a -> a.getResource().equals(object)).findAny().isPresent()) { <END> log.warn( String.format( "Returning object[%s] at key[%s] that has already been returned!? Skipping", object, key ), new Exception("Exception for stacktrace") ); } else { log.warn( String.format( "Returning object[%s] at key[%s] even though we already have all that we can hold[%s]!? Skipping", object, key, resourceHolderList ), new Exception("Exception for stacktrace") ); } return; } resourceHolderList.addLast(new ResourceHolder<>(System.currentTimeMillis(), object)); this.notifyAll(); } }</code><technical_language>define a private "contains(..)" method intent is clear</technical_language>

Target:
void giveBack(V object) { Preconditions.checkNotNull(object, "object"); synchronized (this) { if (closed) { log.info(String.format("giveBack called after being closed. key[%s]", key)); factory.close(object); return; } if (resourceHolderList.size() >= maxSize) { if (holderListContains(object)) { log.warn( String.format( "Returning object[%s] at key[%s] that has already been returned!? Skipping", object, key ), new Exception("Exception for stacktrace") ); } else { log.warn( String.format( "Returning object[%s] at key[%s] even though we already have all that we can hold[%s]!? Skipping", object, key, resourceHolderList ), new Exception("Exception for stacktrace") ); } return; } resourceHolderList.addLast(new ResourceHolder<>(System.currentTimeMillis(), object)); this.notifyAll(); } }
Source:
<code>public int hashCode() { int hash = 7; hash = 89 * hash + (this.name != null ? this.name.hashCode() : 0); <START> return hash; <END> }</code><technical_language>org.modeshape.common.util.HashCode.compute(...) instead of this? yet, return name.hashCode()? (When name null?)</technical_language>

Target:
public int hashCode() { return name.hashCode(); }
Source:
<code>public PushdownSubfieldsIntoConnector(Metadata metadata) { <START> this.metadata = metadata; <END> }</code><technical_language>requireNonNull</technical_language>

Target:
public PushdownSubfieldsIntoConnector(Metadata metadata) { this.metadata = requireNonNull(metadata, "metadata is null"); }
Source:
<code>public @NonNull String @NonNull getFullAttribute() { LinkedList<String> list = new LinkedList<>(); Attribute curNode = this; while (curNode.parent != null) { list.addFirst(curNode.getName()); curNode = curNode.parent; } <START> return list.toArray(new @NonNull String[0]); <END> }</code><technical_language>While changing this code, instead of String[0], String[list.size()]</technical_language>

Target:
public @NonNull String @NonNull getFullAttribute() { LinkedList<String> list = new LinkedList<>(); Attribute curNode = this; while (curNode.parent != null) { list.addFirst(curNode.getName()); curNode = curNode.parent; } return list.toArray(new @NonNull String[list.size()]); }
Source:
<code>public boolean refreshBpTaskList() { boolean changed = false; LOG.debug("Running Back Pressure status change check"); for (Iterator<Entry<Integer, JCQueue>> itr = bpTasks.entrySet().iterator(); itr.hasNext(); ) { Entry<Integer, JCQueue> entry = itr.next(); if (entry.getValue().isEmptyOverflow()) { nonBpTasks.add(entry.getKey()); <START> itr.remove(); <END> changed = true; } } return changed; }</code><technical_language>is a race condition recordBackpressure. If nonBpTasks.add(entry.getKey()) finishes get a context switch recordBackpressure completes fully for taskId itr.remove inconsistent state</technical_language>

Target:
public boolean refreshBpTaskList() { boolean changed = false; LOG.debug("Running Back Pressure status change check"); for ( Entry<Integer, JCQueue> entry : tasks.entrySet()) { if (entry.getValue() != NONE && entry.getValue().isEmptyOverflow()) { recordNoBackPressure(entry.getKey()); changed = true; } } return changed; }
Source:
<code>public Blob getBlob(String key) { TransientStore store = Framework.getService(TransientStoreService.class).getStore(CSVExportAction.ACTION_NAME); List<Blob> blobs = store.getBlobs(key); Blob blob = blobs == null || blobs.isEmpty() ? null : blobs.get(0); if (blob == null) { <START> log.error("[%s] Could not retrieve blob for key {}", metadata.name(), key); <END> } return blob; }</code><technical_language>%s</technical_language>

Target:
public Blob getBlob(String key) { TransientStore store = Framework.getService(TransientStoreService.class).getStore(CSVExportAction.ACTION_NAME); List<Blob> blobs = store.getBlobs(key); Blob blob = blobs == null || blobs.isEmpty() ? null : blobs.get(0); if (blob == null) { log.error("[{}] Could not retrieve blob for key {}", metadata.name(), key); } return blob; }
Source:
<code>public ASTNode visit(org.kframework.kil.Variable node, Void _) { String name = node.getName(); if (node.isFreshVariable()) { <START> name = "?" + name; <END> } else if (node.isFreshConstant()) { name = "!" + name; } if (node.getSort().equals(org.kframework.kil.Sort.BAG)) { return new Variable(name, Kind.CELL_COLLECTION.asSort()); } if (node.getSort().equals(org.kframework.kil.Sort.K)) { return new Variable(name, Sort.KSEQUENCE); } if (node.getSort().equals(org.kframework.kil.Sort.KLIST)) { return new Variable(name, Sort.KLIST); } DataStructureSort dataStructureSort = context.dataStructureSortOf(node.getSort()); if (dataStructureSort != null) { Sort sort = null; if (dataStructureSort.type().equals(org.kframework.kil.Sort.LIST)) { sort = Sort.LIST; } else if (dataStructureSort.type().equals(org.kframework.kil.Sort.MAP)) { sort = Sort.MAP; } else if (dataStructureSort.type().equals(org.kframework.kil.Sort.SET)) { sort = Sort.SET; } else { assert false: "unexpected data structure " + dataStructureSort.type(); } if (concreteCollectionSize.containsKey(node)) { return new ConcreteCollectionVariable( name, sort, concreteCollectionSize.get(node)); } else { return new Variable(name, sort); } } return new Variable(name, node.getSort().toBackendJava()); }</code><technical_language>a method in Variable return this for you</technical_language>

Target:
public ASTNode visit(org.kframework.kil.Variable node, Void _) { String name = node.fullName(); if (node.getSort().equals(org.kframework.kil.Sort.BAG)) { return new Variable(name, Kind.CELL_COLLECTION.asSort()); } if (node.getSort().equals(org.kframework.kil.Sort.K)) { return new Variable(name, Sort.KSEQUENCE); } if (node.getSort().equals(org.kframework.kil.Sort.KLIST)) { return new Variable(name, Sort.KLIST); } DataStructureSort dataStructureSort = context.dataStructureSortOf(node.getSort()); if (dataStructureSort != null) { Sort sort = null; if (dataStructureSort.type().equals(org.kframework.kil.Sort.LIST)) { sort = Sort.LIST; } else if (dataStructureSort.type().equals(org.kframework.kil.Sort.MAP)) { sort = Sort.MAP; } else if (dataStructureSort.type().equals(org.kframework.kil.Sort.SET)) { sort = Sort.SET; } else { assert false: "unexpected data structure " + dataStructureSort.type(); } if (concreteCollectionSize.containsKey(node)) { return new ConcreteCollectionVariable( name, sort, concreteCollectionSize.get(node)); } else { return new Variable(name, sort); } } return new Variable(name, node.getSort().toBackendJava()); }
Source:
<code>private void removeSplitItemViews(){ final int childCount = mDetailTableLayout.getChildCount(); for (int i = 0; i < childCount; i++) { if (mDetailTableLayout.getChildAt(0).getId() == R.id.row_split_amount_info) { mDetailTableLayout.removeViewAt(0); } else { break; } <START> } <END> mDebitBalance.setText(""); mCreditBalance.setText(""); }</code><technical_language>works, a simpler solution. 4 rows in fragment_transaction_details (mDetailTableLayout) splits: row_balance, row_time_and_date, row_trn_notes row_trn_recurrence. Then, substitute for loop this? mDetailTableLayout.removeViews(0, childCount - 4);</technical_language>

Target:
private void removeSplitItemViews(){ mDetailTableLayout.removeViews(0, mDetailTableLayout.getChildCount() - mDetailTableRows); mDebitBalance.setText(""); mCreditBalance.setText(""); }