auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>public Object caseCall(Call object) { <START> Boolean prematureExitValue = null; <END> if (AND.equals(object.getServiceName())) { prematureExitValue = Boolean.FALSE; } if (OR.equals(object.getServiceName())) { prematureExitValue = Boolean.TRUE; } List<Expression> exprArgs = object.getArguments(); Object result = null; int argc = exprArgs.size(); Object[] args = new Object[argc]; int i = 0; while (result == null && i < argc) { args[i] = doSwitch(exprArgs.get(i)); if (prematureExitValue != null && args[i] != null && args[i].equals(prematureExitValue)) { result = prematureExitValue; } i++; } if (result == null) { switch (object.getType()) { case CALLSERVICE: result = services.call(object.getServiceName(), args, diagnostic); break; case CALLORAPPLY: result = services.callOrApply(object.getServiceName(), args, diagnostic); break; case COLLECTIONCALL: result = services.collectionServiceCall(object.getServiceName(), args, diagnostic); break; default: throw new UnsupportedOperationException("should never happen"); } } return result; }</code><technical_language>"shortcutReturnValue" a name for this one, "allowShortcut" for third-value of boolan</technical_language>

Target:
public Object caseCall(Call object) { boolean shouldShortcut = false; Boolean shortcutReturnValue = null; if (AND.equals(object.getServiceName())) { shouldShortcut = true; shortcutReturnValue = Boolean.FALSE; } if (OR.equals(object.getServiceName())) { shouldShortcut = true; shortcutReturnValue = Boolean.TRUE; } List<Expression> exprArgs = object.getArguments(); Object result = null; int argc = exprArgs.size(); Object[] args = new Object[argc]; int i = 0; while (result == null && i < argc) { args[i] = doSwitch(exprArgs.get(i)); if (shouldShortcut && args[i] != null && args[i].equals(shortcutReturnValue)) { result = shortcutReturnValue; } i++; } if (result == null) { switch (object.getType()) { case CALLSERVICE: result = services.call(object.getServiceName(), args, diagnostic); break; case CALLORAPPLY: result = services.callOrApply(object.getServiceName(), args, diagnostic); break; case COLLECTIONCALL: result = services.collectionServiceCall(object.getServiceName(), args, diagnostic); break; default: throw new UnsupportedOperationException("should never happen"); } } return result; }
Source:
<code>private void validateDatafeed(DataFeed feed) { DataSource dataSource = null; try { dataSource = getDataSource(feed.getDataSourceId()); } catch (Exception ex) { <START> throw new StorageException("Got exception while validating endpoint.", ex); <END> } if (dataSource == null) { throw new StorageException("Cannot add Datafeed for non existent datasource"); } else if (dataSource.getType() == DataSource.Type.DATASET) { QueryParam qp = new QueryParam("type", feed.getType()); Collection<DataFeed> existing = null; try { existing = listDataFeeds(Collections.singletonList(qp)); } catch (Exception ex) { throw new StorageException("Got excepting while listing data feeds with query param " + qp, ex); } if (!existing.isEmpty()) { throw new StorageException("Datafeed endpoint must be unique for a Dataset"); } } }</code><technical_language>Exception message more meaningful. like. find dataSource {id} for data feed id {id}</technical_language>

Target:
private void validateDatafeed(DataFeed feed) { DataSource dataSource = null; LOG.debug("Validating data feed [{}]", feed); try { dataSource = getDataSource(feed.getDataSourceId()); } catch (Exception ex) { throw new StorageException("Got exception while validating datafeed [" + feed + "]", ex); } if (dataSource == null) { throw new StorageException("Cannot add Datafeed [" + feed + "] for non existent datasource"); } else if (dataSource.getType() == DataSource.Type.DATASET) { QueryParam qp = new QueryParam("type", feed.getType()); Collection<DataFeed> existing = null; try { existing = listDataFeeds(Collections.singletonList(qp)); } catch (Exception ex) { throw new StorageException("Got excepting while listing data feeds with query param " + qp, ex); } if (!existing.isEmpty()) { throw new StorageException("Datafeed type must be unique for a Dataset"); } } }
Source:
<code>public void tearDown() { try { Case.closeCurrentCase(); try { Thread.sleep(2000); } catch (Exception ex) { <START> } <END> FileUtils.deleteDirectory(CASE_DIR); } catch (CaseActionException | IOException ex) { Exceptions.printStackTrace(ex); } assertFalse(CASE_DIR.exists()); }</code><technical_language>I this necessary. observe led add this sleep</technical_language>

Target:
public void tearDown() { CaseUtils.closeCase(); CaseUtils.deleteCaseDir(CASE_DIRECTORY_PATH); }
Source:
<code>private void a(char[] pwd, String var) { String variable1 = "blabla"; String variable2 = "login=a&password=xxx"; String variable3 = "login=a&passwd=xxx"; String variable4 = "login=a&pwd=xxx"; String variable5 = "login=a&password="; String variableNameWithPasswordInIt = "xxx"; String variableNameWithPasswdInIt = "xxx"; String variableNameWithPwdInIt = "xxx"; String otherVariableNameWithPasswordInIt; fieldNameWithPasswordInIt = "xx"; fieldNameWithPasswordInIt = retrievePassword(); this.fieldNameWithPasswordInIt = "xx"; this.fieldNameWithPasswordInIt = retrievePassword(); variable1 = "xx"; String[] array = {}; array[0] = "xx"; A myA = new A(); myA.setProperty("password", "xxxxx"); myA.setProperty("passwd", "xxxxx"); myA.setProperty("pwd", "xxxxx"); myA.setProperty("password", new Object()); myA.setProperty("xxxxx", "password"); myA.setProperty(12, "xxxxx"); myA.setProperty(new Object(), new Object()); MyUnknownClass.myUnknownMethod("password", "xxxxx"); PasswordAuthentication pa; pa = new PasswordAuthentication("userName", "1234".toCharArray()); pa = new PasswordAuthentication("userName", pwd); pa = new PasswordAuthentication("userName", getPwd(var)); pa = new PasswordAuthentication("userName", var.toCharArray()); <START> } <END></code><technical_language>pa = new SomeOtherAuthentication("username", "1234".toCharArray()); tested show conditions needs satisfied</technical_language>

Target:
private void a(char[] pwd, String var) { String variable1 = "blabla"; String variable2 = "login=a&password=xxx"; String variable3 = "login=a&passwd=xxx"; String variable4 = "login=a&pwd=xxx"; String variable5 = "login=a&password="; String variableNameWithPasswordInIt = "xxx"; String variableNameWithPasswdInIt = "xxx"; String variableNameWithPwdInIt = "xxx"; String otherVariableNameWithPasswordInIt; fieldNameWithPasswordInIt = "xx"; fieldNameWithPasswordInIt = retrievePassword(); this.fieldNameWithPasswordInIt = "xx"; this.fieldNameWithPasswordInIt = retrievePassword(); variable1 = "xx"; String[] array = {}; array[0] = "xx"; A myA = new A(); myA.setProperty("password", "xxxxx"); myA.setProperty("passwd", "xxxxx"); myA.setProperty("pwd", "xxxxx"); myA.setProperty("password", new Object()); myA.setProperty("xxxxx", "password"); myA.setProperty(12, "xxxxx"); myA.setProperty(new Object(), new Object()); MyUnknownClass.myUnknownMethod("password", "xxxxx"); PasswordAuthentication pa; pa = new PasswordAuthentication("userName", "1234".toCharArray()); pa = new PasswordAuthentication("userName", pwd); pa = new PasswordAuthentication("userName", getPwd(var)); pa = new PasswordAuthentication("userName", var.toCharArray()); OtherPasswordAuthentication opa; opa = new OtherPasswordAuthentication("userName", "1234".toCharArray()); }
Source:
<code>private List<String> createResources(final String prefix, final int count) throws IOException { final var resources = new ArrayList<String>(); for (int i = 0; i < count; i++) { <START> final var response = createObject(prefix + "-" + String.format("%05d", i)); <END> resources.add(getLocation(response)); response.close(); } return resources; }</code><technical_language>response produced createObject is Closable, put this statement in a try clause... auto-close</technical_language>

Target:
private List<String> createResources(final String prefix, final int count) throws IOException { final var resources = new ArrayList<String>(); for (int i = 0; i < count; i++) { try (final CloseableHttpResponse response = createObject(prefix + "-" + String.format("%05d", i))) { resources.add(getLocation(response)); } } return resources; }
Source:
<code>public void unselect() { assertMultiSelect("unselect"); int count = selectionCount(); asyncExec(new VoidResult() { public void run() { String[] items = widget.getSelection(); for (String item : items) { <START> widget.deselect(indexOf(item)); <END> } } }); if (count == 0) { log.debug(MessageFormat.format("Nothing to unselect {0}]", this)); } else { notifySelect(count); } }</code><technical_language>send a selection event iteration</technical_language>

Target:
public void unselect() { assertMultiSelect("unselect"); asyncExec(new VoidResult() { public void run() { int[] selectionIndices = widget.getSelectionIndices(); for (int i = 0; i < selectionIndices.length; i++) { widget.deselect(selectionIndices[i]); if (i == 0) { notifySelect(true); } else { notifySelect(false); } } } }); }
Source:
<code>protected void executeCommand() { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { NetworkCluster networkCluster = getParameters().getNetworkCluster(); getNetworkClusterDAO().remove(getParameters().getVdsGroupId(), networkCluster.getNetworkId()); if (networkCluster.isDisplay()) { getManagementNetworkCluster().setDisplay(true); <START> } <END> if (networkCluster.isMigration()) { getManagementNetworkCluster().setMigration(true); } if (managementNetworkCluster != null) { getNetworkClusterDAO().update(managementNetworkCluster); } return null; } }); if (NetworkHelper.shouldRemoveNetworkFromHostUponNetworkRemoval(getPersistedNetwork(), getVdsGroup().getcompatibility_version())) { removeNetworkFromHosts(); } setSucceeded(true); }</code><technical_language>please add a space line a closing curly bracket (sorry...the dark force is strong)</technical_language>

Target:
protected void executeCommand() { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { NetworkClusterHelper helper = new NetworkClusterHelper(getParameters().getNetworkCluster()); helper.removeNetworkAndReassignRoles(); return null; } }); if (NetworkHelper.shouldRemoveNetworkFromHostUponNetworkRemoval(getPersistedNetwork(), getVdsGroup().getcompatibility_version())) { removeNetworkFromHosts(); } setSucceeded(true); }
Source:
<code>public String[] preferenceNames() { Set<String> namesSet = properties.stringPropertyNames(); String[] names = new String[namesSet.size()]; Iterator<String> it = namesSet.iterator(); for (int i = 0; it.hasNext(); i++) { names[i] = it.next(); } <START> return names; <END> }</code><technical_language>Is this a good of converting keys a List? similar <LINK_0></technical_language>

Target:
public String[] preferenceNames() { Set<String> names = properties.stringPropertyNames(); return names.toArray(new String[names.size()]); }
Source:
<code>public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { if (args.length == 0) { throw new NotEnoughArgumentsException(); } final String warpName = args[0]; final String safeWarpName = StringUtil.safeString(warpName); if (NumberUtil.isInt(warpName) || warpName.isEmpty()) { throw new Exception(tl("invalidWarpName")); } final IWarps warps = ess.getWarps(); Location warpLoc = null; try { warpLoc = warps.getWarp(warpName); } catch (WarpNotFoundException | InvalidWorldException ignored) { } final boolean warpExists = warpLoc != null; final boolean canOverwrite = user.isAuthorized("essentials.warp.overwrite." + safeWarpName); <START> final boolean canCreate = user.isAuthorized("essentials.warp.set." + safeWarpName); <END> if (warpExists && !canOverwrite) { throw new Exception(tl("warpOverwrite")); } if (!warpExists && !canCreate && !canOverwrite) { throw new Exception(tl("warpCreate")); } warps.setWarp(user, warpName, user.getLocation()); user.sendMessage(tl("warpSet", warpName)); }</code><technical_language>Is this new permission compatible users versions of Essentials prior this PR? Players permission essentials.setwarp able create warps default. Permission defaults defined in plugin.yml</technical_language>

Target:
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception { if (args.length == 0) { throw new NotEnoughArgumentsException(); } final String warpName = args[0]; if (NumberUtil.isInt(warpName) || warpName.isEmpty()) { throw new Exception(tl("invalidWarpName")); } final IWarps warps = ess.getWarps(); Location warpLoc = null; try { warpLoc = warps.getWarp(warpName); } catch (final WarpNotFoundException | InvalidWorldException ignored) { } final boolean warpExists = warpLoc != null; final String safeWarpName = StringUtil.safeString(warpName); final boolean canOverwrite = user.isAuthorized("essentials.warp.overwrite." + safeWarpName); final boolean canCreate = user.isAuthorized("essentials.warp.set." + safeWarpName); if (warpExists && !canOverwrite) { throw new Exception(tl("warpOverwrite")); } if (!warpExists && !canCreate && !canOverwrite) { throw new Exception(tl("warpCanCreate")); } warps.setWarp(user, warpName, user.getLocation()); user.sendMessage(tl("warpSet", warpName)); }
Source:
<code>protected boolean validate() { return isNoLeasesOnStorageDomain() && canDetachStorageDomainWithVmsAndDisks(getStorageDomain()) && canDetachDomain(getParameters().getDestroyingPool(), <START> getParameters().getRemoveLast()); <END> }</code><technical_language>please move check canDetachDomain() validates domain exists. need move canDetachStorageDomainWithVmsAndDisks() in a separate patch</technical_language>

Target:
protected boolean validate() { return canDetachStorageDomainWithVmsAndDisks(getStorageDomain()) && canDetachDomain(getParameters().getDestroyingPool(), getParameters().getRemoveLast()) && isNoLeasesOnStorageDomain(); }
Source:
<code>public void testMapCount() { HazelcastInstance hz = createHazelcastInstance(); Node node = getNode(hz); PhoneHome phoneHome = new PhoneHome(node); Map<String, String> parameters = phoneHome.phoneHome(true); assertEquals(parameters.get("mpct"), "0"); Map<String, String> map1 = hz.getMap("hazelcast"); Map<String, String> map2 = hz.getMap("phonehome"); parameters.clear(); parameters = phoneHome.phoneHome(true); assertEquals(parameters.get("mpct"), "2"); Map<String, String> map3 = hz.getMap("maps"); <START> parameters.clear(); <END> parameters = phoneHome.phoneHome(true); assertEquals(parameters.get("mpct"), "3"); }</code><technical_language>parameters.clear() calls necessary</technical_language>

Target:
public void testMapCount() { HazelcastInstance hz = createHazelcastInstance(); Node node = getNode(hz); PhoneHome phoneHome = new PhoneHome(node); Map<String, String> parameters = phoneHome.phoneHome(true); assertEquals(parameters.get("mpct"), "0"); Map<String, String> map1 = hz.getMap("hazelcast"); Map<String, String> map2 = hz.getMap("phonehome"); parameters = phoneHome.phoneHome(true); assertEquals(parameters.get("mpct"), "2"); Map<String, String> map3 = hz.getMap("maps"); parameters = phoneHome.phoneHome(true); assertEquals(parameters.get("mpct"), "3"); }
Source:
<code>protected <K> Object handleWriteManyCommand(InvocationContext ctx, FlagAffectedCommand command, Collection<K> keys, boolean forwarded) throws Throwable { try { Object stage; if (hasSkipLocking(command)) { stage = invokeNext(ctx, command); } else { if (!needRemoteLocks(ctx, keys, command)) { acquireLocalLocks(ctx, command, keys); stage = invokeNext(ctx, command); } else { final TxInvocationContext txContext = (TxInvocationContext) ctx; LockControlCommand lcc = cf.buildLockControlCommand(keys, command.getFlagsBitSet(), txContext.getGlobalTransaction()); stage = invokeNextThenApply(ctx, lcc, (rCtx, rCommand, rv) -> { acquireLocalLocks(rCtx, command, keys); return invokeNext(rCtx, command); }); } } <START> return makeStage(stage).andFinally(ctx, command, (rCtx, rCommand, rv, t) -> { <END> if (t != null) { rethrowAndReleaseLocksIfNeeded(rCtx, t); } }); } catch (Throwable t) { rethrowAndReleaseLocksIfNeeded(ctx, t); throw t; } }</code><technical_language>andExceptionally more appropriate</technical_language>

Target:
protected <K> Object handleWriteManyCommand(InvocationContext ctx, FlagAffectedCommand command, Collection<K> keys, boolean forwarded) throws Throwable { try { Object stage; if (hasSkipLocking(command)) { stage = invokeNext(ctx, command); } else { if (!needRemoteLocks(ctx, keys, command)) { acquireLocalLocks(ctx, command, keys); stage = invokeNext(ctx, command); } else { final TxInvocationContext txContext = (TxInvocationContext) ctx; LockControlCommand lcc = cf.buildLockControlCommand(keys, command.getFlagsBitSet(), txContext.getGlobalTransaction()); stage = invokeNextThenApply(ctx, lcc, (rCtx, rCommand, rv) -> { acquireLocalLocks(rCtx, command, keys); return invokeNext(rCtx, command); }); } } return makeStage(stage).andExceptionally(ctx, command, (rCtx, rCommand, t) -> { rethrowAndReleaseLocksIfNeeded(rCtx, t); throw t; }); } catch (Throwable t) { rethrowAndReleaseLocksIfNeeded(ctx, t); throw t; } }
Source:
<code>public Class<?>[] getAdapterList() { <START> return new Class[] { ResourceMapping.class, IFile.class }; <END> }</code><technical_language>Need declare adapter type here, too</technical_language>

Target:
public Class<?>[] getAdapterList() { return new Class[] { ResourceMapping.class, IFile.class, IResource.class }; }
Source:
<code>public void onPageUpdated(ApiDatasetLandingPage page, String uri) throws IOException { Dataset dataset = new Dataset(); dataset.setId(page.getapiDatasetId()); Link taxonomyLink = new Link(); taxonomyLink.setHref(uri); DatasetLinks datasetLinks = new DatasetLinks(); datasetLinks.setTaxonomy(taxonomyLink); dataset.setLinks(datasetLinks); try { datasetAPIClient.createDataset(page.getapiDatasetId(), dataset); <START> } catch (DatasetAPIException e) { <END> throw new RuntimeException(e); } }</code><technical_language>add a log message rethrow</technical_language>

Target:
public void onPageUpdated(ApiDatasetLandingPage page, String uri) throws IOException { Dataset dataset = new Dataset(); dataset.setId(page.getapiDatasetId()); Link taxonomyLink = new Link(); taxonomyLink.setHref(uri); DatasetLinks datasetLinks = new DatasetLinks(); datasetLinks.setTaxonomy(taxonomyLink); dataset.setLinks(datasetLinks); try { datasetAPIClient.createDataset(page.getapiDatasetId(), dataset); } catch (DatasetAPIException e) { logError(e, "failed to create dataset in the dataset api").log(); throw new RuntimeException(e); } }
Source:
<code>public boolean canDeleteTable(TCredentials c, TableId tableId, NamespaceId namespaceId) throws ThriftSecurityException { String tableName = getTableName(tableId); try { boolean result = super.canDeleteTable(c, tableId, namespaceId); <START> audit(c, result, CAN_DELETE_TABLE_AUDIT_TEMPLATE, tableName); <END> return result; } catch (ThriftSecurityException ex) { audit(c, ex, CAN_DELETE_TABLE_AUDIT_TEMPLATE, tableName); throw ex; } }</code><technical_language>drop tableId here</technical_language>

Target:
public boolean canDeleteTable(TCredentials c, TableId tableId, NamespaceId namespaceId) throws ThriftSecurityException { String tableName = getTableName(tableId); try { boolean result = super.canDeleteTable(c, tableId, namespaceId); audit(c, result, CAN_DELETE_TABLE_AUDIT_TEMPLATE, tableName, tableId); return result; } catch (ThriftSecurityException ex) { audit(c, ex, CAN_DELETE_TABLE_AUDIT_TEMPLATE, tableName, tableId); throw ex; } }
Source:
<code>public void handleException(@Nullable Throwable exception) { Activator.logError(fMessage, exception); <START> ITmfEvent event = fEventsQueue.take(); <END> while (event != END_EVENT) { if (event == EMPTY_QUEUE_EVENT) { event = fEventsQueue.take(); continue; } event = fEventsQueue.take(); } closeStateSystem(); }</code><technical_language>This is good, this thread bad failures dealock anymore. mark analysis failed. for large traces, I some failing mechanism put in place, cancel analysis. For instance, waitForCompletion wake time time analysis failed in meantime. While this works perfectly fine, resources a computer _are_ limited is avoid dragging this thread, request thread, threaded backend thread some more view threads waiting for this, imho</technical_language>

Target:
public void handleException(@Nullable Throwable exception) { final RuntimeException rException = (exception instanceof RuntimeException) ? (RuntimeException) exception : new RuntimeException("Error in threaded state history backend", exception); fail(rException); fPropagateExceptions = () -> { throw rException; }; ITmfEvent event = fEventsQueue.take(); while (event != END_EVENT) { if (event == EMPTY_QUEUE_EVENT) { event = fEventsQueue.take(); continue; } event = fEventsQueue.take(); } closeStateSystem(); }
Source:
<code>public Map<Long, ILogData> read(Iterable<Long> addresses, @NonNull ReadOptions options) { final Map<Long, ILogData> cachedData = readCache.getAllPresent(addresses); final Set<Long> addressesToFetch = Sets.difference( Sets.newHashSet(addresses), cachedData.keySet()); final Map<Long, ILogData> uncachedData = fetchAll(addressesToFetch, options); final List<Long> trimmedAddresses = filterTrimmedAddresses(uncachedData); final List<Long> holes = filterHoles(uncachedData); trimmedAddresses.forEach(uncachedData::remove); <START> holes.forEach(trimmedAddresses::remove); <END> final Map<Long, ILogData> result = uncachedData.entrySet().stream() .collect(Collectors.toMap(Entry::getKey, entry -> cacheLoadAndGet(readCache, entry.getKey(), entry.getValue(), options))); result.putAll(cachedData); if (!trimmedAddresses.isEmpty()) { if (!options.isIgnoreTrim()) { throw new TrimmedException(trimmedAddresses); } log.warn("read: ignoring trimmed addresses {}", trimmedAddresses); } return result; }</code><technical_language>this happen? entry a hole a trimmed address time, right? remove uncached data?, in case for reason</technical_language>

Target:
public Map<Long, ILogData> read(Iterable<Long> addresses, @NonNull ReadOptions options) { final Map<Long, ILogData> cachedData = readCache.getAllPresent(addresses); final Set<Long> addressesToFetch = Sets.difference( Sets.newHashSet(addresses), cachedData.keySet()); final Map<Long, ILogData> uncachedData = fetchAll(addressesToFetch, options); final List<Long> trimmedAddresses = filterTrimmedAddresses(uncachedData); trimmedAddresses.forEach(uncachedData::remove); final Map<Long, ILogData> result = uncachedData.entrySet().stream() .collect(Collectors.toMap(Entry::getKey, entry -> cacheLoadAndGet(readCache, entry.getKey(), entry.getValue(), options))); result.putAll(cachedData); if (!trimmedAddresses.isEmpty()) { if (!options.isIgnoreTrim()) { throw new TrimmedException(trimmedAddresses); } log.debug("read: ignoring trimmed addresses {}", trimmedAddresses); } return result; }
Source:
<code>public TimeSegmentPruner(TableConfig tableConfig, ZkHelixPropertyStore<ZNRecord> propertyStore) { _tableNameWithType = tableConfig.getTableName(); _propertyStore = propertyStore; _segmentZKMetadataPathPrefix = ZKMetadataProvider.constructPropertyStorePathForResource(_tableNameWithType) + "/"; _timeColumn = tableConfig.getValidationConfig().getTimeColumnName(); Preconditions .checkNotNull(_timeColumn, "Time column must be configured in table config for table: %s", _tableNameWithType); Schema schema = ZKMetadataProvider.getTableSchema(_propertyStore, _tableNameWithType); Preconditions.checkState(schema != null, "Failed to find schema for table: %s", _tableNameWithType); DateTimeFieldSpec dateTimeSpec = schema.getSpecForTimeColumn(_timeColumn); Preconditions.checkNotNull(dateTimeSpec, "Field spec must be specified in schema for time column: %s of table: %s", _timeColumn, _tableNameWithType); DateTimeFormatSpec formatSpec = new DateTimeFormatSpec(dateTimeSpec.getFormat()); <START> _timeUnit = formatSpec.getColumnUnit(); <END> Preconditions .checkNotNull(_timeUnit, "Time unit must be configured in the field spec for time column: %s of table: %s", _timeColumn, _tableNameWithType); _segmentToTimeRangeMSCache = new HashMap<String, Interval>(); }</code><technical_language>Keeping _timeUnit is enough, need formatSpec in order handle simple data format (e.g. "2020-11-19")</technical_language>

Target:
public TimeSegmentPruner(TableConfig tableConfig, ZkHelixPropertyStore<ZNRecord> propertyStore) { _tableNameWithType = tableConfig.getTableName(); _propertyStore = propertyStore; _segmentZKMetadataPathPrefix = ZKMetadataProvider.constructPropertyStorePathForResource(_tableNameWithType) + "/"; _timeColumn = tableConfig.getValidationConfig().getTimeColumnName(); Preconditions .checkNotNull(_timeColumn, "Time column must be configured in table config for table: %s", _tableNameWithType); Schema schema = ZKMetadataProvider.getTableSchema(_propertyStore, _tableNameWithType); Preconditions.checkNotNull(schema, "Failed to find schema for table: %s", _tableNameWithType); DateTimeFieldSpec dateTimeSpec = schema.getSpecForTimeColumn(_timeColumn); Preconditions.checkNotNull(dateTimeSpec, "Field spec must be specified in schema for time column: %s of table: %s", _timeColumn, _tableNameWithType); _timeFormatSpec = new DateTimeFormatSpec(dateTimeSpec.getFormat()); }
Source:
<code>private boolean isRequestFresh(CruiseConfig cruiseConfig) { SCM existingSCM = findSCM(cruiseConfig); return entityHashingService.md5ForEntity(existingSCM, existingSCM.getName()).equals(md5); <START> } <END></code><technical_language>add a message result if is stale request result.stale()</technical_language>

Target:
private boolean isRequestFresh(CruiseConfig cruiseConfig) { SCM existingSCM = findSCM(cruiseConfig); boolean freshRequest = entityHashingService.md5ForEntity(existingSCM, existingSCM.getName()).equals(md5); if (!freshRequest) { result.stale(LocalizedMessage.string("STALE_RESOURCE_CONFIG", "SCM", globalScmConfig.getName())); } return freshRequest; }
Source:
<code>private void writeFile(File path, String contents) throws Exception { PrintWriter out = null; String oldContents = null; try { oldContents = readFile(path); } catch (IOException ex) { oldContents = ""; } <START> if (oldContents.isEmpty() || !oldContents.equals(contents)) { <END> try { out = new PrintWriter(path); out.print(contents); } finally { if (out != null) { try { out.close(); } catch (Exception ex) { ; } } } } }</code><technical_language>Check for oldContents.isEmpty() is unnecessary</technical_language>

Target:
private void writeFile(File path, String contents) throws Exception { PrintWriter out = null; String oldContents = null; try { oldContents = readFile(path); } catch (IOException ex) { oldContents = ""; } if (!oldContents.equals(contents)) { try { out = new PrintWriter(path); out.print(contents); } finally { if (out != null) { try { out.close(); } catch (Exception ex) { ; } } } } }
Source:
<code>public List<Long> getDownloadingVideoDmIdsForSection(String enrollmentId, String chapter, <START> String section, final DataCallback<List<Long>> callback) { <END> DbOperationGetColumn<Long> op = new DbOperationGetColumn<Long>(true, DbStructure.Table.DOWNLOADS, new String[]{DbStructure.Column.DM_ID}, DbStructure.Column.DOWNLOADED + "=? AND " + DbStructure.Column.EID + "=? AND " + DbStructure.Column.CHAPTER + "=? AND " + DbStructure.Column.SECTION + "=? AND " + DbStructure.Column.USERNAME + "=?", new String[]{String.valueOf(DownloadedState.DOWNLOADING.ordinal()), enrollmentId, chapter, section, username()}, null, Long.class); op.setCallback(callback); return enqueue(op); }</code><technical_language>Similarly returning long[] instead of List<Long>. converted Apache Commons Lang library: <LINK_0></technical_language>

Target:
public long[] getDownloadingVideoDmIdsForSection(String enrollmentId, String chapter, String section, final DataCallback<List<Long>> callback) { DbOperationGetColumn<Long> op = new DbOperationGetColumn<Long>(true, DbStructure.Table .DOWNLOADS, new String[]{DbStructure.Column.DM_ID}, DbStructure.Column.DOWNLOADED + "=? AND " + DbStructure.Column.EID + "=? AND " + DbStructure.Column.CHAPTER + "=? AND " + DbStructure.Column.SECTION + "=? AND " + DbStructure.Column.USERNAME + "=?", new String[]{String.valueOf(DownloadedState.DOWNLOADING.ordinal()), enrollmentId, chapter, section, username()}, null, Long.class); op.setCallback(callback); List<Long> downloadingList = enqueue(op); if (callback != null) { return null; } else { return ArrayUtils.toPrimitive(downloadingList.toArray(new Long[downloadingList.size()])); } }
Source:
<code>private void resolveConflict(CacheEntry<?, ?> entry, DataWriteCommand command, IracMetadata localMetadata, IracMetadata remoteMetadata) { if (isTraceEnabled()) { getLog().tracef("[IRAC] Conflict found between local and remote metadata: %s and %s", localMetadata, remoteMetadata); } assert !localMetadata.getSite().equals(remoteMetadata.getSite()); if (localMetadata.getSite().compareTo(remoteMetadata.getSite()) < 0) { <START> IracUtils.discardUpdate(getLog(), entry, command, remoteMetadata); <END> return; } setIracMetadata(entry, remoteMetadata); }</code><technical_language>clear if conflicting writes site is higher lexigraphically for now? long is consistent sites, I fine. wanted clarify</technical_language>

Target:
private void resolveConflict(CacheEntry<?, ?> entry, DataWriteCommand command, IracMetadata localMetadata, IracMetadata remoteMetadata) { if (isTraceEnabled()) { getLog().tracef("[IRAC] Conflict found between local and remote metadata: %s and %s", localMetadata, remoteMetadata); } assert !localMetadata.getSite().equals(remoteMetadata.getSite()); if (localMetadata.getSite().compareTo(remoteMetadata.getSite()) < 0) { discardUpdate(entry, command, remoteMetadata); return; } setIracMetadata(entry, remoteMetadata); }
Source:
<code>public static int getFrontCamera() { int index = 0; int numCameras = Camera.getNumberOfCameras(); if (numCameras == 0) { Log.w("BarcodeModule", "No cameras!"); return -1; } while (index < numCameras) { Camera.CameraInfo cameraInfo = new Camera.CameraInfo(); Camera.getCameraInfo(index, cameraInfo); CameraFacing reportedFacing = CameraFacing.values()[cameraInfo.facing]; if (reportedFacing == CameraFacing.FRONT) { <START> break; <END> } index++; } return index; }</code><technical_language>return here? return -1 in other cases</technical_language>

Target:
public static int getFrontCamera() { int index = 0; int numCameras = Camera.getNumberOfCameras(); if (numCameras == 0) { Log.w("BarcodeModule", "No cameras!"); return -1; } while (index < numCameras) { Camera.CameraInfo cameraInfo = new Camera.CameraInfo(); Camera.getCameraInfo(index, cameraInfo); CameraFacing reportedFacing = CameraFacing.values()[cameraInfo.facing]; if (reportedFacing == CameraFacing.FRONT) { return index; } index++; } return -1; }
Source:
<code>public AnnotationVisitor visitAnnotation(String descriptor, boolean visible) { String cname = descriptor.replace("/", "."); if (cname.contains(annotationName)) { return new RepeatedAnnotationVisitor() { HashMap<String, Object> info = new HashMap<>(); @Override public AnnotationVisitor visitArray(String name) { List values = new ArrayList<>(); info.put(name, values); return new AnnotationVisitor(api, this) { @Override public void visit(String dummy, Object value) { <START> if (data.indexOf(info) < 0) { <END> data.add(info); } values.add(value); } }; } @Override public void visit(String name, Object value) { if (data.indexOf(info) < 0) { data.add(info); } info.put(name, value); } @Override public AnnotationVisitor visitAnnotation(String name, String descriptor) { info = new HashMap<>(); return this; } }; } return null; }</code><technical_language>replaced !data.contains(info)</technical_language>

Target:
public AnnotationVisitor visitAnnotation(String descriptor, boolean visible) { String cname = descriptor.replaceFirst("^L(.*);$", "$1").replace("/", "."); if (cname.equals(annotationName)) { return new DataAnnotationVisitor(data, false); } else if (cname.equals(annotationName + "$Container")) { return new DataAnnotationVisitor(data, true); } return null; }
Source:
<code>private static boolean isJavadocLineEmpty(final String line) { <START> return null != line && "*".equals(line.trim()); <END> }</code><technical_language>@dskalenko line null</technical_language>

Target:
private static boolean isJavadocLineEmpty(final String line) { return "*".equals(line.trim()); }
Source:
<code>public void parentCompleted() { synchronized (this) { if (childCompleted) { <START> delegate.onCompleted(); <END> } parentCompleted = true; } }</code><technical_language>call onXXX methods while holding a lock</technical_language>

Target:
public void parentCompleted() { boolean bothCompleted = false; synchronized (this) { if (childCompleted) { bothCompleted = true; } parentCompleted = true; } if (bothCompleted) { delegate.onCompleted(); } }
Source:
<code>public RenderGraph(Context context) { nodeMap = Maps.newHashMap(); graph = GraphBuilder.directed().build(); <START> this.context = context; <END> }</code><technical_language>please this variable is used</technical_language>

Target:
public RenderGraph(Context context) { nodeMap = Maps.newHashMap(); akaNodeMap = Maps.newHashMap(); graph = GraphBuilder.directed().build(); this.context = context; this.shaderManager = context.get(ShaderManager.class); }
Source:
<code>protected void onMessageReceived(WorkspaceStatusEvent statusEvent) { final String workspaceId = statusEvent.getWorkspaceId(); switch (statusEvent.getEventType()) { case STARTING: onWorkspaceStarting(workspaceId); break; case RUNNING: <START> if (statusEvent.getPrevStatus() == WorkspaceStatus.STARTING) { <END> onWorkspaceStarted(workspaceId); } break; case ERROR: notificationManager.notify(locale.workspaceStartFailed(), FAIL, FLOAT_MODE); loader.setError(LoaderPresenter.Phase.STARTING_WORKSPACE_RUNTIME); final String workspaceName = workspace.getConfig().getName(); final String error = statusEvent.getError(); workspaceServiceClient.getWorkspaces(SKIP_COUNT, MAX_COUNT).then(showErrorDialog(workspaceName, error)); eventBus.fireEvent(new WorkspaceStoppedEvent(workspace)); break; case STOPPING: loader.show(LoaderPresenter.Phase.STOPPING_WORKSPACE); break; case STOPPED: loader.setSuccess(LoaderPresenter.Phase.STOPPING_WORKSPACE); startWorkspaceNotification.show(statusEvent.getWorkspaceId()); eventBus.fireEvent(new WorkspaceStoppedEvent(workspace)); break; case SNAPSHOT_CREATING: loader.show(LoaderPresenter.Phase.CREATING_WORKSPACE_SNAPSHOT); break; case SNAPSHOT_CREATED: loader.setSuccess(LoaderPresenter.Phase.CREATING_WORKSPACE_SNAPSHOT); snapshotCreator.successfullyCreated(); break; case SNAPSHOT_CREATION_ERROR: loader.setError(LoaderPresenter.Phase.CREATING_WORKSPACE_SNAPSHOT); snapshotCreator.creationError("Snapshot creation error: " + statusEvent.getError()); break; } }</code><technical_language>explain this</technical_language>

Target:
protected void onMessageReceived(WorkspaceStatusEvent statusEvent) { final String workspaceId = statusEvent.getWorkspaceId(); switch (statusEvent.getEventType()) { case STARTING: onWorkspaceStarting(workspaceId); break; case RUNNING: onWorkspaceStarted(workspaceId); break; case ERROR: notificationManager.notify(locale.workspaceStartFailed(), FAIL, FLOAT_MODE); loader.setError(LoaderPresenter.Phase.STARTING_WORKSPACE_RUNTIME); final String workspaceName = workspace.getConfig().getName(); final String error = statusEvent.getError(); workspaceServiceClient.getWorkspaces(SKIP_COUNT, MAX_COUNT).then(showErrorDialog(workspaceName, error)); eventBus.fireEvent(new WorkspaceStoppedEvent(workspace)); eventBus.fireEvent(WsAgentStateEvent.createWsAgentStoppedEvent()); break; case STOPPING: loader.show(LoaderPresenter.Phase.STOPPING_WORKSPACE); break; case STOPPED: loader.setSuccess(LoaderPresenter.Phase.STOPPING_WORKSPACE); startWorkspaceNotification.show(statusEvent.getWorkspaceId()); eventBus.fireEvent(new WorkspaceStoppedEvent(workspace)); eventBus.fireEvent(WsAgentStateEvent.createWsAgentStoppedEvent()); break; case SNAPSHOT_CREATING: loader.show(LoaderPresenter.Phase.CREATING_WORKSPACE_SNAPSHOT); break; case SNAPSHOT_CREATED: loader.setSuccess(LoaderPresenter.Phase.CREATING_WORKSPACE_SNAPSHOT); snapshotCreator.successfullyCreated(); break; case SNAPSHOT_CREATION_ERROR: loader.setError(LoaderPresenter.Phase.CREATING_WORKSPACE_SNAPSHOT); snapshotCreator.creationError("Snapshot creation error: " + statusEvent.getError()); break; } }
Source:
<code>private CompletableFuture<Result> failedAuthentication() { logger.info("Failed authentication"); <START> return completedFuture(unauthorized()); <END> }</code><technical_language>a message nice</technical_language>

Target:
private CompletableFuture<Result> failedAuthentication() { logger.info("Failed authentication"); return completedFuture(unauthorized("Unauthorized")); }
Source:
<code>protected ClientMessage encodeResponse(Object response) { if (response == null) { return MapFetchEntriesCodec.encodeResponse(0, Collections.<Map.Entry<Data, Data>>emptyList()); } MapEntriesWithCursor mapEntriesWithCursor = (MapEntriesWithCursor) response; return MapFetchEntriesCodec.encodeResponse(mapEntriesWithCursor.getNextTableIndexToReadFrom(), <START> (List<Map.Entry<Data, Data>>)(Object)mapEntriesWithCursor.getBatch()); <END> }</code><technical_language>I this create a class cast exception client. release this changed - <LINK_0> cc @asimarslan @sancar</technical_language>

Target:
protected ClientMessage encodeResponse(Object response) { if (response == null) { return MapFetchEntriesCodec.encodeResponse(0, Collections.<Map.Entry<Data, Data>>emptyList()); } MapEntriesWithCursor mapEntriesWithCursor = (MapEntriesWithCursor) response; return MapFetchEntriesCodec.encodeResponse(mapEntriesWithCursor.getNextTableIndexToReadFrom(), serializeBatch(mapEntriesWithCursor)); }
Source:
<code>private CompletableFuture<Void> addOperation(Operation<K, V> operation) { if (batch.isEmpty()) { setBatchTimer(batch); } else if (batch.isClosed()) { processBatch(); } batch.addOperation(operation); <START> final CompletableFuture<Void> res = batch.getCompletableFuture(); <END> if (batch.isClosed()) { processBatch(); } return res; }</code><technical_language>do need check again</technical_language>

Target:
private CompletableFuture<Void> addOperation(Operation<K, V> operation) { if (batch == null) { startNewBatch(); } final CompletableFuture<Void> res = batch.addOperation(operation); if (batch.isClosed()) { processBatch(true); } return res; }
Source:
<code><START> public static void setAPIRelatedTags(TracingSpan tracingSpan, org.apache.synapse.MessageContext messageContext) { <END> org.apache.axis2.context.MessageContext axis2MessageContext = ((Axis2MessageContext) messageContext).getAxis2MessageContext(); Object restUrlPostfix = axis2MessageContext.getProperty(APIMgtGatewayConstants.REST_URL_POSTFIX); Object httpMethod = axis2MessageContext.getProperty(Constants.Configuration.HTTP_METHOD); if (restUrlPostfix != null){ Util.setTag(tracingSpan,APIMgtGatewayConstants.SPAN_REQUEST_PATH, (String) restUrlPostfix); } if (httpMethod != null) { Util.setTag(tracingSpan, APIMgtGatewayConstants.SPAN_REQUEST_METHOD, (String) httpMethod); } Object electedResource = messageContext.getProperty(APIMgtGatewayConstants.API_ELECTED_RESOURCE); if (electedResource != null){ Util.setTag(tracingSpan, APIMgtGatewayConstants.SPAN_RESOURCE, (String) electedResource); } setTracingId(tracingSpan, axis2MessageContext); }</code><technical_language>multiple formatting issues in this method</technical_language>

Target:
public static void setAPIRelatedTags(TracingSpan tracingSpan, org.apache.synapse.MessageContext messageContext) { org.apache.axis2.context.MessageContext axis2MessageContext = ((Axis2MessageContext) messageContext).getAxis2MessageContext(); Object restUrlPostfix = axis2MessageContext.getProperty(APIMgtGatewayConstants.REST_URL_POSTFIX); Object httpMethod = axis2MessageContext.getProperty(APIMgtGatewayConstants.HTTP_METHOD); if (restUrlPostfix != null) { Util.setTag(tracingSpan, APIMgtGatewayConstants.SPAN_REQUEST_PATH, (String) restUrlPostfix); } if (httpMethod != null) { Util.setTag(tracingSpan, APIMgtGatewayConstants.SPAN_REQUEST_METHOD, (String) httpMethod); } Object electedResource = messageContext.getProperty(APIMgtGatewayConstants.API_ELECTED_RESOURCE); if (electedResource != null) { Util.setTag(tracingSpan, APIMgtGatewayConstants.SPAN_RESOURCE, (String) electedResource); } setTracingId(tracingSpan, axis2MessageContext); }
Source:
<code>public void testCount() { SWTBotNatTable nattable = bot.nattable(); int rowCount = nattable.rowCount(); int totalRowCount = nattable.preferredRowCount(); <START> assertThat(rowCount, allOf(lessThan(totalRowCount), greaterThanOrEqualTo(14))); <END> assertEquals("Two columns are visible", 2, nattable.columnCount()); assertEquals("Total thirty two rows are created", 32, totalRowCount); assertEquals("Total two columns are created", 2, nattable.preferredColumnCount()); }</code><technical_language>If this fails, SWTBotNatTable (that testing) is wrong, means test setup is correct for a graphical setup. If font is small, happen visible row count is equal preferred row count. I check rowCount <= 32, columnCount <=2. If 14 rows, I other test (that reads row 14) fail</technical_language>

Target:
public void testCount() { SWTBotNatTable nattable = bot.nattable(); int rowCount = nattable.rowCount(); int totalRowCount = nattable.preferredRowCount(); assertThat(rowCount, lessThanOrEqualTo(totalRowCount)); int columnCount = nattable.columnCount(); int totalColumnCount = nattable.preferredColumnCount(); assertThat(columnCount, lessThanOrEqualTo(totalColumnCount)); assertEquals("Total thirty two rows are created", 32, totalRowCount); assertEquals("Total two columns are created", 2, nattable.preferredColumnCount()); }
Source:
<code>public List<Map<String, Object>> getIncompleteTasks() { <START> final InputStream queryResponse = runGetQuery("incompleteTasks"); <END> try { return jsonMapper.readValue( queryResponse, new TypeReference<List<Map<String, Object>>>() { } ); } catch (IOException e) { log.warn("Error parsing response for incompleteTasks query from Overlord [%s]", baseUrl()); return null; } }</code><technical_language>pull this a static string</technical_language>

Target:
public List<Map<String, Object>> getIncompleteTasks() { final InputStream queryResponse = runGetQuery(INCOMPLETE_TASKS); try { return jsonMapper.readValue( queryResponse, new TypeReference<List<Map<String, Object>>>() { } ); } catch (IOException e) { log.warn(e, "Error parsing response for incompleteTasks query from Overlord [%s]", baseUrl()); throw Throwables.propagate(e); } }
Source:
<code>public static String getUserAgent() { String appString = getAppContext().getResources().getString(R.string.user_agent); String packageName = getAppContext().getPackageName(); PackageInfo pInfo = null; try { pInfo = getAppContext().getPackageManager().getPackageInfo(packageName, 0); } catch (PackageManager.NameNotFoundException e) { <START> <END> } String version = ""; if (pInfo != null) { version = "/" + pInfo.versionName; } String userAgent = appString + version; return userAgent; }</code><technical_language>log a warning</technical_language>

Target:
public static String getUserAgent() { String appString = getAppContext().getResources().getString(R.string.user_agent); String packageName = getAppContext().getPackageName(); String version = ""; PackageInfo pInfo = null; try { pInfo = getAppContext().getPackageManager().getPackageInfo(packageName, 0); if (pInfo != null) { version = "/" + pInfo.versionName; } } catch (PackageManager.NameNotFoundException e) { Log_OC.e(TAG, "Trying to get packageName", e.getCause()); } String userAgent = appString + version; return userAgent; }
Source:
<code>public Map<String, DbParameterAccessor> getAllProcedureParameters( String procName) throws SQLException { String[] qualifiers = procName.split("\\."); <START> String schemaName, procedureName; <END> if (qualifiers.length == 2) { schemaName = qualifiers[0]; procedureName = qualifiers[1]; } else { schemaName = getConnection().getSchema(); procedureName = qualifiers[0]; } procedureName = procedureName.toUpperCase(); boolean isFunction; if (isProcedureOrFunction(schemaName, procedureName, false)) { isFunction = false; } else { if (isProcedureOrFunction(schemaName, procedureName, true)) { isFunction = true; } else { throw new SQLException("Cannot find Procedure or Function with name " + procName); } } return getParamMap(schemaName, procedureName, isFunction); }</code><technical_language>parsing a candidate for refactoring</technical_language>

Target:
public Map<String, DbParameterAccessor> getAllProcedureParameters(String procName) throws SQLException { DbObjectName qn = new DbObjectName(getConnection().getSchema(), procName.toUpperCase()); boolean isFunction; if (isProcedureOrFunction(qn, false)) { isFunction = false; } else if (isProcedureOrFunction(qn, true)) { isFunction = true; } else { throw new SQLException("Cannot find Procedure or Function with name " + procName); } return getParamMap(qn, isFunction); }
Source:
<code>private double summarize(List<WeightedEntry> snapshot) { long totalWeight = <START> snapshot.stream().map(WeightedEntry::weight).mapToLong(x -> x).sum(); <END> if (totalWeight == 0) { return 0.0; } double valueSum = snapshot.stream() .map(entry -> entry.value() * entry.weight()) .mapToDouble(x -> x) .sum(); return valueSum / totalWeight; }</code><technical_language>mapToLong</technical_language>

Target:
private double summarize(List<WeightedEntry> snapshot) { long totalWeight = snapshot.stream().mapToLong(WeightedEntry::weight).sum(); if (totalWeight == 0) { return 0.0; } double valueSum = snapshot.stream() .mapToDouble(entry -> entry.value() * entry.weight()) .sum(); return valueSum / totalWeight; }
Source:
<code>public static boolean isJava6() { <START> System.out.println(System.getProperty("java.version", "None??")); <END> return System.getProperty("java.version", "").contains("1.6."); }</code><technical_language>Debugging code</technical_language>

Target:
public static boolean isJava6() { return System.getProperty("java.version", "").contains("1.6."); }
Source:
<code>public void switchToTrash() { hideTutorials(); <START> if(currentView!=TRASHCAN){ <END> TrashProjectListBox.getTrashProjectListBox().getTrashProjectList().getSelectedProjects().clear(); TrashProjectListBox.getTrashProjectListBox().getTrashProjectList().refreshTable(false); } currentView=TRASHCAN; projectListPane2.setWidth("100%"); projectListPanel.remove(ProjectListBox.getProjectListBox()); projectListPane2.add(TrashProjectListBox.getTrashProjectListBox()); pVertPanel.remove(projectListPanel); pVertPanel.add(projectListPane2); projectToolbar.setProjectTabButtonsVisible(false); projectToolbar.setPublishOrUpdateButtonVisible(false); projectToolbar.setTrashTabButtonsVisible(true); if (TrashProjectListBox.getTrashProjectListBox().getTrashProjectList().getNumProjects() == 0) { Ode.getInstance().createEmptyTrashDialog(true); } }</code><technical_language>Space "if" instead of "if(" is "if (" spaces !=</technical_language>

Target:
public void switchToTrash() { hideTutorials(); if (currentView != TRASHCAN){ TrashProjectListBox.getTrashProjectListBox().getTrashProjectList().getSelectedProjects().clear(); TrashProjectListBox.getTrashProjectListBox().getTrashProjectList().refreshTable(false); } currentView = TRASHCAN; projectListPane2.setWidth("100%"); projectListPanel.remove(ProjectListBox.getProjectListBox()); projectListPane2.add(TrashProjectListBox.getTrashProjectListBox()); pVertPanel.remove(projectListPanel); pVertPanel.add(projectListPane2); deckPanel.showWidget(projectsTabIndex); projectToolbar.setProjectTabButtonsVisible(false); projectToolbar.setPublishOrUpdateButtonVisible(false); projectToolbar.setTrashTabButtonsVisible(true); if (TrashProjectListBox.getTrashProjectListBox().getTrashProjectList().getNumProjects() == 0) { Ode.getInstance().createEmptyTrashDialog(true); } }