auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
<code>private void readXmlAndBuildTree() { ConfigDispayRules.getInstance().refresh(); Modes.setBindState(BindState.edit); try { Integer id = Integer.valueOf(Helper.getRequestParameter("ProzesseID")); this.process = serviceManager.getProcessService().getById(id); } catch (NumberFormatException | DAOException e) { logger.error(e.getMessage(), e); <START> Helper.setFehlerMeldung("error while loading process data" + e.getMessage()); <END> } this.userId = Helper.getRequestParameter("BenutzerID"); this.allPagesSelectionFirstPage = ""; this.allPagesSelectionLastPage = ""; this.result = Helper.getRequestParameter("zurueck"); this.neuesElementWohin = "1"; this.treeNodeStruct = null; try { readXmlStart(); } catch (ReadException e) { logger.error(e.getMessage(), e); Helper.setFehlerMeldung(e.getMessage()); } catch (PreferencesException | IOException e) { logger.error(e.getMessage(), e); Helper.setFehlerMeldung("error while loading metadata" + e.getMessage()); } expandTree(); this.sperrung.setLocked(this.process.getId(), this.userId); }</code><technical_language>setErrorMessage</technical_language>

Target:
private void readXmlAndBuildTree() { ConfigDispayRules.getInstance().refresh(); Modes.setBindState(BindState.edit); try { Integer id = Integer.valueOf(Helper.getRequestParameter("ProzesseID")); this.process = serviceManager.getProcessService().getById(id); } catch (NumberFormatException | DAOException e) { Helper.setErrorMessage("error while loading process data" + e.getMessage(), logger, e); } this.userId = Helper.getRequestParameter("BenutzerID"); this.allPagesSelectionFirstPage = ""; this.allPagesSelectionLastPage = ""; this.result = Helper.getRequestParameter("zurueck"); this.neuesElementWohin = "1"; this.treeNodeStruct = null; try { readXmlStart(); } catch (ReadException e) { Helper.setErrorMessage(e.getMessage(), logger, e); } catch (PreferencesException | IOException e) { Helper.setErrorMessage("error while loading metadata" + e.getMessage(), logger, e); } expandTree(); this.sperrung.setLocked(this.process.getId(), this.userId); }
Source:
<code>private boolean tryToDispatchTokens(MessageHolderWithTokens msg) throws InterruptedException { for (int i = 0 ; i <= MAX_TIME_TO_BLOCK_WHEN_QUEUE_IS_FULL; i += TIME_BETWEEN_RETRIES_WHEN_QUEUE_IS_FULL) { if (dispatchTokensOrFailWhenQueueIsFull(msg)) { return true; } else { logger.fine(String.format("Queue is full, blocking loading of batch token #%s for %s variant (%s) for %s ms", msg.getSerialId(), msg.getVariant().getType().getTypeName(), msg.getVariant().getVariantID(), TIME_BETWEEN_RETRIES_WHEN_QUEUE_IS_FULL)); <START> Thread.sleep(TIME_BETWEEN_RETRIES_WHEN_QUEUE_IS_FULL); <END> } } return false; }</code><technical_language>is this a good idea</technical_language>

Target:
private boolean tryToDispatchTokens(MessageHolderWithTokens msg) throws InterruptedException { try { dispatchTokensEvent.fire(msg); return true; } catch (MessageDeliveryException e) { Throwable cause = e.getCause(); if (isQueueFullException(cause)) { return false; } throw e; } }
Source:
<code>public void addTokenForOwnerStats(TokenIdent id) { String realOwner = getTokenRealOwner(id); tokenOwnerStats.put(realOwner, <START> tokenOwnerStats.getOrDefault(realOwner, 0l)+1); <END> }</code><technical_language>nit: capital 0L IDE happy</technical_language>

Target:
private void addTokenForOwnerStats(TokenIdent id) { String realOwner = getTokenRealOwner(id); tokenOwnerStats.put(realOwner, tokenOwnerStats.getOrDefault(realOwner, 0L)+1); }
Source:
<code>public int compare(Nameable nameable1, Nameable nameable2) { final String name1 = nameable1.getName(); final String name2 = nameable2.getName(); final NumericSuffixNormalizer <START> numericSuffixNormalizer = <END> new NumericSuffixNormalizer(); final List<String> normalizedNames = numericSuffixNormalizer.normalize(name1, name2); return ObjectUtils.compare(normalizedNames.get(0), normalizedNames.get(1)); }</code><technical_language>extract field; do need N creations of this lets sorting collection</technical_language>

Target:
public int compare(Nameable nameable1, Nameable nameable2) { final String name1 = nameable1.getName(); final String name2 = nameable2.getName(); final List<String> normalizedNames = numericSuffixNormalizer.normalize(name1, name2); return ObjectUtils.compare(normalizedNames.get(0), normalizedNames.get(1)); }
Source:
<code>private void paintTableActions(final WTable table, final WebXmlRenderContext renderContext) { XmlStringBuilder xml = renderContext.getWriter(); List<WButton> tableActions = table.getActions(); if (!tableActions.isEmpty()) { boolean hasActions = false; for (WButton button : tableActions) { if (!button.isVisible()) { continue; } if (!hasActions) { hasActions = true; xml.appendTag("ui:actions"); } xml.appendTag("ui:action"); List<WTable.ActionConstraint> constraints = table.getActionConstraints(button); if (constraints != null) { for (WTable.ActionConstraint constraint : constraints) { int minRows = constraint.getMinSelectedRowCount(); int maxRows = constraint.getMaxSelectedRowCount(); String message = constraint.getMessage(); <START> int selectedOnOther = table.getSelectedRows().size(); <END> String type = constraint.isError() ? "error" : "warning"; xml.appendTagOpen("ui:condition"); xml.appendOptionalAttribute("minSelectedRows", minRows > 0, minRows); xml.appendOptionalAttribute("maxSelectedRows", maxRows > 0, maxRows); xml.appendOptionalAttribute("selectedOnOther", selectedOnOther); xml.appendAttribute("type", type); xml.appendAttribute("message", I18nUtilities.format(null, message)); xml.appendEnd(); } } button.paint(renderContext); xml.appendEndTag("ui:action"); } if (hasActions) { xml.appendEndTag("ui:actions"); } } }</code><technical_language>This TOTAL selected row count... get OTHER selected row count (i.e. count of rows selected pages current one)? Assuming this code needs changed this adequately unit tested. I suggest adopt a test-driven approach - write unit test (which fail) work</technical_language>

Target:
private void paintTableActions(final WTable table, final WebXmlRenderContext renderContext) { XmlStringBuilder xml = renderContext.getWriter(); List<WButton> tableActions = table.getActions(); if (!tableActions.isEmpty()) { boolean hasActions = false; for (WButton button : tableActions) { if (!button.isVisible()) { continue; } if (!hasActions) { hasActions = true; xml.appendTag("ui:actions"); } xml.appendTag("ui:action"); List<WTable.ActionConstraint> constraints = table.getActionConstraints(button); if (constraints != null) { for (WTable.ActionConstraint constraint : constraints) { int minRows = constraint.getMinSelectedRowCount(); int maxRows = constraint.getMaxSelectedRowCount(); String message = constraint.getMessage(); String type = constraint.isError() ? "error" : "warning"; xml.appendTagOpen("ui:condition"); xml.appendOptionalAttribute("minSelectedRows", minRows > 0, minRows); xml.appendOptionalAttribute("maxSelectedRows", maxRows > 0, maxRows); xml.appendAttribute("selectedOnOther", this.selectedOnOther); xml.appendAttribute("type", type); xml.appendAttribute("message", I18nUtilities.format(null, message)); xml.appendEnd(); } } button.paint(renderContext); xml.appendEndTag("ui:action"); } if (hasActions) { xml.appendEndTag("ui:actions"); } } }
Source:
<code>protected String getQuery(MultivaluedMap<String, String> queryParams) { String query = queryParams.getFirst(QUERY); if (query == null) { <START> query = "SELECT * from Document"; <END> } return query; }</code><technical_language>Detail: capitalized</technical_language>

Target:
protected String getQuery(MultivaluedMap<String, String> queryParams) { String query = queryParams.getFirst(QUERY); if (query == null) { query = "SELECT * FROM Document"; } return query; }
Source:
<code>private TreeMap<Integer, Initiator> createIv2Initiators(Collection<Integer> partitions, StartAction startAction, List<Integer> m_partitionsToSitesAtStartupForExportInit) { TreeMap<Integer, Initiator> initiators = new TreeMap<>(); TransactionTaskQueue.resetScoreboards(m_messenger.getNextSiteId(), m_nodeSettings.getLocalSitesCount()); <START> TransactionTaskQueue.initBarrier(m_nodeSettings.getLocalSitesCount()); <END> for (Integer partition : partitions) { Initiator initiator = new SpInitiator(m_messenger, partition, getStatsAgent(), m_snapshotCompletionMonitor, startAction); initiators.put(partition, initiator); m_partitionsToSitesAtStartupForExportInit.add(partition); } return initiators; }</code><technical_language>barrier is needed in joining. avoid initialization in other start actions</technical_language>

Target:
private TreeMap<Integer, Initiator> createIv2Initiators(Collection<Integer> partitions, StartAction startAction, List<Integer> m_partitionsToSitesAtStartupForExportInit) { TreeMap<Integer, Initiator> initiators = new TreeMap<>(); TransactionTaskQueue.resetScoreboards(m_messenger.getNextSiteId(), m_nodeSettings.getLocalSitesCount()); for (Integer partition : partitions) { Initiator initiator = new SpInitiator(m_messenger, partition, getStatsAgent(), m_snapshotCompletionMonitor, startAction); initiators.put(partition, initiator); m_partitionsToSitesAtStartupForExportInit.add(partition); } if (StartAction.JOIN.equals(startAction)) { TransactionTaskQueue.initBarrier(m_nodeSettings.getLocalSitesCount()); } return initiators; }
Source:
<code>public Array<T> getElementsContainingArea(Shape area, boolean entirelyContained) { <START> return null; <END> }</code><technical_language>return empty array instance</technical_language>

Target:
public Array<T> getElementsContainingArea(Shape area, boolean entirelyContained) { return new Array<>(); }
Source:
<code>protected Class<?>[] getTypes(ResourceMethod method) { Type superclass = method.getResource().getType().getGenericSuperclass(); <START> if(!superclass.equals(Object.class)) { <END> Type[] genericsTypes = getGenericsTypes(superclass); Class<?>[] classes = new Class<?>[genericsTypes.length]; for (int i = 0; i < genericsTypes.length; i++) { classes[i] = (Class<?>) genericsTypes[i]; } return classes; } return method.getMethod().getParameterTypes(); }</code><technical_language>I this is right test... do if (superclass instanceof ParameterizedType)</technical_language>

Target:
protected Class<?>[] getTypes(ResourceMethod method) { Class<?>[] parameterTypes = method.getMethod().getParameterTypes(); Type genericType = getGenericSuperClass(method); if (genericType != null) { return parseGenericParameters(parameterTypes, genericType); } return parameterTypes; }
Source:
<code>public static boolean canReplicate(JoinNode joinNode, Context context) { PlanNode buildSide = joinNode.getRight(); PlanNodeStatsEstimate buildSideStatsEstimate = context.getStatsProvider().getStats(buildSide); double buildSideSizeInBytes = buildSideStatsEstimate.getOutputSizeInBytes(buildSide.getOutputSymbols(), context.getSymbolAllocator().getTypes()); JoinDistributionType joinDistributionType = getJoinDistributionType(context.getSession()); Optional<DataSize> joinMaxBroadcastTableSize = getJoinMaxBroadcastTableSize(context.getSession()); <START> return joinDistributionType.canReplicate() <END> && (!joinMaxBroadcastTableSize.isPresent() || buildSideSizeInBytes <= joinMaxBroadcastTableSize.get().toBytes()); }</code><technical_language>shortcircuit this check</technical_language>

Target:
public static boolean canReplicate(JoinNode joinNode, Context context) { JoinDistributionType joinDistributionType = getJoinDistributionType(context.getSession()); if (!joinDistributionType.canReplicate()) { return false; } Optional<DataSize> joinMaxBroadcastTableSize = getJoinMaxBroadcastTableSize(context.getSession()); if (!joinMaxBroadcastTableSize.isPresent()) { return true; } PlanNode buildSide = joinNode.getRight(); PlanNodeStatsEstimate buildSideStatsEstimate = context.getStatsProvider().getStats(buildSide); double buildSideSizeInBytes = buildSideStatsEstimate.getOutputSizeInBytes(buildSide.getOutputSymbols(), context.getSymbolAllocator().getTypes()); return buildSideSizeInBytes <= joinMaxBroadcastTableSize.get().toBytes(); }
Source:
<code>private void updateShortcut() { final ShortcutDTO shortcut = getControl().getShortcut(); if (shortcut != null) { title.setValue(shortcut.getInfo().getName()); description.setValue(shortcut.getInfo().getDescription()); try { final Map<String, Object> shortcutProperties = getControl().getObjectMapper() .readValue(shortcut.getScript(), new TypeReference<Map<String, Object>>() { }); this.shortcutProperties.clear(); this.shortcutProperties.putAll(shortcutProperties); } catch (IOException e) { <START> LOGGER.error("An error occurred during a Shortcut update", e); <END> } } }</code><technical_language>shortcut case</technical_language>

Target:
private void updateShortcut() { final ShortcutDTO shortcut = getControl().getShortcut(); if (shortcut != null) { title.setValue(shortcut.getInfo().getName()); description.setValue(shortcut.getInfo().getDescription()); try { final Map<String, Object> shortcutProperties = getControl().getObjectMapper() .readValue(shortcut.getScript(), new TypeReference<Map<String, Object>>() { }); this.shortcutProperties.clear(); this.shortcutProperties.putAll(shortcutProperties); } catch (IOException e) { LOGGER.error("An error occurred during a shortcut update", e); } } }
Source:
<code>private PropertyChangeListener addSetMacroListener(final Macro displayMacro, final Collection<Macro> setMacros) { return new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent newValue) { Optional<Macro> existingMacro = setMacros.stream().filter(m -> m.getName().equals(displayMacro.getName())).findFirst(); if (existingMacro.isPresent()) { existingMacro.get().setValue(displayMacro.getValue()); } else { Macro newMacro = new Macro(displayMacro); setMacros.add(newMacro); } <START> setMacros.removeIf(m -> m.getValue() == null); <END> } }; }</code><technical_language>Do need loop list again? changed null is set right</technical_language>

Target:
private PropertyChangeListener addSetMacroListener(final Macro displayMacro, final Collection<Macro> setMacros) { return new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent newValue) { Optional<Macro> existingMacro = setMacros.stream().filter(m -> m.getName().equals(displayMacro.getName())).findFirst(); if (existingMacro.isPresent()) { if (displayMacro.getValue() != null) { existingMacro.get().setValue(displayMacro.getValue()); } else { setMacros.remove(existingMacro.get()); } } else { Macro newMacro = new Macro(displayMacro); setMacros.add(newMacro); } } }; }
Source:
<code>HttpResponse uploadObject(ApiAddress address, Object object, Function<URI, R> requestConstructor) throws IOException { R request = buildRequest(address, requestConstructor); if (object != null) { String json = jsonService.serialize(object); try { request.setEntity(new StringEntity(json)); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } } request.addHeader(HttpHeaders.CONTENT_TYPE, APPLICATION_JSON_CONTENT_TYPE); try (CloseableHttpResponse response = cachedRemoteReader.getResponse(request)) { response.close(); <START> return response; <END> } }</code><technical_language>this piece of code sense me. connection get closed try-with-resources statement? is return clause visible of try block? method complain for finding a return statement</technical_language>

Target:
HttpResponse uploadObject(ApiAddress address, Object object, Function<URI, R> requestConstructor) throws IOException { R request = buildRequest(address, requestConstructor); if (object != null) { String json = jsonService.serialize(object); try { request.setEntity(new StringEntity(json)); } catch (UnsupportedEncodingException e) { throw new RuntimeException(e); } } request.addHeader(HttpHeaders.CONTENT_TYPE, APPLICATION_JSON_CONTENT_TYPE); try (CloseableHttpResponse response = cachedRemoteReader.getResponse(request)) { return response; } }
Source:
<code>public int compareTo(ActivityEvent object) { <START> if (date == null && object.getDate() == null) { <END> return 0; } if (date == null || object.getDate() == null) { return -1; } return date.compareTo(object.getDate()); }</code><technical_language>This transitive. CoreUtil.compare() implements this correctly</technical_language>

Target:
public int compareTo(ActivityEvent object) { return CoreUtil.compare(date, object.getDate()); }
Source:
<code>public synchronized void write(int b) throws IOException { if (readonly) throw new IOException("Remote file is read only."); try { outStream.write(("WRITE " + remoteOffset + " 1\r\n").getBytes(Sage.BYTE_CHARSET)); outStream.flush(); <START> outStream.write(b); <END> } catch (IOException e) { reconnect(); outStream.write(("WRITE " + remoteOffset + " 1\r\n").getBytes(Sage.BYTE_CHARSET)); outStream.flush(); outStream.write(b); } remoteOffset += 1; }</code><technical_language>Flush write data....same for places write data</technical_language>

Target:
public synchronized void write(int b) throws IOException { if (readonly) throw new IOException("Remote file is read only."); try { outStream.write(("WRITE " + remoteOffset + " 1\r\n").getBytes(Sage.BYTE_CHARSET)); outStream.write(b); outStream.flush(); } catch (IOException e) { reconnect(); outStream.write(("WRITE " + remoteOffset + " 1\r\n").getBytes(Sage.BYTE_CHARSET)); outStream.write(b); outStream.flush(); } remoteOffset += 1; }
Source:
<code>private static List<String> getCombinedStyles(Document getCapabilitiesXml, String layerName) { List<String> combinedStyles = new ArrayList<String>(); DefaultXPath xpath = new DefaultXPath(" Map<String,String> namespaces = new TreeMap<String, String>(); namespaces.put("x", "<LINK_0>"); xpath.setNamespaceURIs(namespaces); <START> List<DefaultText> list = xpath.selectNodes(getCapabilitiesXml); <END> for (final DefaultText text : list) { combinedStyles.add(text.getText()); } return combinedStyles; }</code><technical_language>type signature match LHS RHS</technical_language>

Target:
private static List<String> getCombinedStyles(Document getCapabilitiesXml, String layerName) { List<String> combinedStyles = new ArrayList<String>(); DefaultXPath xpath = new DefaultXPath(" Map<String,String> namespaces = new TreeMap<String, String>(); namespaces.put("x", "<LINK_0>"); xpath.setNamespaceURIs(namespaces); @SuppressWarnings("unchecked") List<DefaultText> list = xpath.selectNodes(getCapabilitiesXml); for (final DefaultText text : list) { combinedStyles.add(text.getText()); } return combinedStyles; }
Source:
<code>private static HttpCookie parseLine(String line, Date creationDate) { if (line.isEmpty() || (line.startsWith("#") && !line.startsWith(HTTP_ONLY_PREAMBLE))) { return null; } String[] cookieLineParts = line.split(COLUMN_SEPARATOR, 7); if (cookieLineParts == null) { throw new IllegalArgumentException( "Did not find any tab in line " + line); } if (cookieLineParts.length < 7) { throw new IllegalArgumentException( "Each line must consist of 7 tab separated entries, found only " <START> + cookieLineParts.length); <END> } String name = cookieLineParts[5]; String value = cookieLineParts[6]; HttpCookie cookie = new HttpCookie(name, value); String domain = cookieLineParts[0]; if (domain.startsWith(HTTP_ONLY_PREAMBLE)) { cookie.setHttpOnly(true); domain = domain.substring(HTTP_ONLY_PREAMBLE.length()); } cookie.setDomain(domain); cookie.setPath(cookieLineParts[2]); cookie.setSecure(Boolean.parseBoolean(cookieLineParts[3])); long expires = Long.parseLong(cookieLineParts[4]); if (creationDate == null) { creationDate = new Date(); } long maxAge = (expires - creationDate.getTime()) / 1000; if (maxAge < 0) { maxAge = -1; } cookie.setMaxAge(maxAge); return cookie; }</code><technical_language>Externalize strings</technical_language>

Target:
private static HttpCookie parseLine(String line, Date creationDate) { if (line.isEmpty() || (line.startsWith("#") && !line.startsWith(HTTP_ONLY_PREAMBLE))) { return null; } String[] cookieLineParts = line.split(COLUMN_SEPARATOR, 7); if (cookieLineParts == null) { throw new IllegalArgumentException(MessageFormat .format(JGitText.get().couldNotFindTabInLine, line)); } if (cookieLineParts.length < 7) { throw new IllegalArgumentException(MessageFormat.format( JGitText.get().couldNotFindSixTabsInLine, cookieLineParts.length, line)); } String name = cookieLineParts[5]; String value = cookieLineParts[6]; HttpCookie cookie = new HttpCookie(name, value); String domain = cookieLineParts[0]; if (domain.startsWith(HTTP_ONLY_PREAMBLE)) { cookie.setHttpOnly(true); domain = domain.substring(HTTP_ONLY_PREAMBLE.length()); } cookie.setDomain(domain); cookie.setPath(cookieLineParts[2]); cookie.setSecure(Boolean.parseBoolean(cookieLineParts[3])); long expires = Long.parseLong(cookieLineParts[4]); if (creationDate == null) { creationDate = new Date(); } long maxAge = (expires - creationDate.getTime()) / 1000; if (maxAge < 0) { maxAge = -1; } cookie.setMaxAge(maxAge); return cookie; }
Source:
<code>public void setupMonitor() { if (monitoringInterval > 0) { <START> executorService.scheduleAtFixedRate(() -> monitorClouderaManagerDescriptors(null), 0, monitoringInterval, TimeUnit.MILLISECONDS); <END> LOG.monitoringClouderaManagerDescriptor(descriptorsDir); } }</code><technical_language>Passing in null explicitly wrong..</technical_language>

Target:
public void setupMonitor() { if (monitoringInterval > 0) { final ScheduledExecutorService executorService = Executors.newSingleThreadScheduledExecutor(new BasicThreadFactory.Builder().namingPattern("ClouderaManagerDescriptorMonitor-%d").build()); executorService.scheduleAtFixedRate(() -> monitorClouderaManagerDescriptors(null), 0, monitoringInterval, TimeUnit.MILLISECONDS); LOG.monitoringClouderaManagerDescriptor(descriptorsDir); } }
Source:
<code>public boolean isEmpty() { return (fInputBuffer.isEmpty() && fOutputBuffer.isEmpty() <START> && fInnerQueue.isEmpty()); <END> }</code><technical_language>This method give incorrect result if buffer is moved queue (which is empty) output buffer (which previously empty) in calls</technical_language>

Target:
public boolean isEmpty() { fOutputLock.lock(); try { return (fInputBuffer.isEmpty() && fOutputBuffer.isEmpty() && fInnerQueue.isEmpty()); } finally { fOutputLock.unlock(); } }
Source:
<code><START> public void when_formUploaderIsRunning_should_appropriateResultBeReturned() { <END> doReturn(true).when(storageMigrator).isFormUploaderRunning(); assertThat(storageMigrator.performStorageMigration(), is(StorageMigrationResult.FORM_UPLOADER_IS_RUNNING)); }</code><technical_language>I need break this object a bit fake/mock methods object test. do this of a bunch of static methods though. a similar strategy BackgroundLocationHelper @lognaturel created? This worked time allowed wrap a bunch of static methods/singletons new object build needed refactor/unwrap of them. This interface include isFormUploaderRunning() isFormDownloaderRunning()</technical_language>

Target:
public void when_formUploaderIsRunning_should_appropriateResultBeReturned() { doReturn(true).when(storageMigrator).isFormUploaderRunning(); assertThat(storageMigrator.migrate(), is(StorageMigrationResult.FORM_UPLOADER_IS_RUNNING)); }
Source:
<code>protected boolean canDoAction() { if (getParameters() == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_IS_NOT_VALID); return false; } else if (!QuotaHelper.getInstance().checkQuotaValidationForAddEdit(getParameters().getQuota(), getReturnValue().getCanDoActionMessages())) { return false; <START> } else if (getParameters().getQuota().getId() == null) { <END> addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_IS_NOT_VALID); return false; } return true; }</code><technical_language>this is enough, need check quota exist in db (what if i send update new quota object?)</technical_language>

Target:
protected boolean canDoAction() { if (!QuotaHelper.getInstance().checkQuotaValidationForAddEdit(getParameters().getQuota(), getReturnValue().getCanDoActionMessages())) { return false; } else if (getParameters().getQuota().getId() == null) { addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_QUOTA_IS_NOT_VALID); return false; } else if (getQuotaDAO().getById(getParameters().getQuota().getId()) == null) { } return true; }
Source:
<code>private void connectAndRefreshAllUpHosts(final boolean commandSucceeded) { try { for (VDS vds : getAllRunningVdssInPool()) { try { VDSReturnValue returnValue = null; if (!_isLastMaster && commandSucceeded && !getVds().equals(vds)) { <START> returnValue = executeRefreshStoragePoolCommand(vds); <END> if (!returnValue.getSucceeded()) { log.errorFormat("Post reconstruct actions (refreshPool) did not complete on host {0} in the pool. error {1}", vds.getId(), returnValue.getVdsError().getMessage()); } } if (returnValue == null || returnValue.getSucceeded()) { returnValue = executeConnectStoragePoolCommand(vds); if (!returnValue.getSucceeded()) { log.errorFormat("Post reconstruct actions (connectPool) did not complete on host {0} in the pool. error {1}", vds.getId(), returnValue.getVdsError().getMessage()); } } if (getParameters().isInactive()) { StorageHelperDirector.getInstance() .getItem(getStorageDomain().getstorage_type()) .DisconnectStorageFromDomainByVdsId(getStorageDomain(), vds.getId()); } } catch (Exception e) { log.errorFormat("Post reconstruct actions (connectPool,refreshPool,disconnect storage)" + " did not complete on host {0} in the pool. error {1}", vds.getId(), e.getMessage()); } } } catch (Exception ex) { log.errorFormat("Post reconstruct actions (connectPool,refreshPool,disconnect storage)" + " did not complete on all up hosts in the pool. error {0}", ex.getMessage()); } }</code><technical_language>condition true. if refresh storage pool failed exception thrown. In order understand u code verifying code</technical_language>

Target:
private void connectAndRefreshAllUpHosts(final boolean commandSucceeded) { try { for (VDS vds : getAllRunningVdssInPool()) { try { if (!_isLastMaster && commandSucceeded) { if (!getVds().equals(vds)) { executeRefreshStoragePoolCommand(vds); } VDSReturnValue returnValue = executeConnectStoragePoolCommand(vds); if (!returnValue.getSucceeded()) { log.errorFormat("Post reconstruct actions (connectPool) did not complete on host {0} in the pool. error {1}", vds.getId(), returnValue.getVdsError().getMessage()); } } if (getParameters().isInactive()) { StorageHelperDirector.getInstance() .getItem(getStorageDomain().getstorage_type()) .DisconnectStorageFromDomainByVdsId(getStorageDomain(), vds.getId()); } } catch (Exception e) { log.errorFormat("Post reconstruct actions (connectPool,refreshPool,disconnect storage)" + " did not complete on host {0} in the pool. error {1}", vds.getId(), e.getMessage()); } } } catch (Exception ex) { log.errorFormat("Post reconstruct actions (connectPool,refreshPool,disconnect storage)" + " did not complete on all up hosts in the pool. error {0}", ex.getMessage()); } }
Source:
<code>public static String getResponseFromServer(final URL constructedUrl, final HttpURLConnectionFactory factory, final String encoding) { HttpURLConnection conn = null; InputStreamReader in = null; try { conn = factory.buildHttpURLConnection(constructedUrl.openConnection()); if (CommonUtils.isEmpty(encoding)) { in = new InputStreamReader(conn.getInputStream()); } else { in = new InputStreamReader(conn.getInputStream(), encoding); } final StringBuilder builder = new StringBuilder(255); int byteRead; while ((byteRead = in.read()) != -1) { builder.append((char) byteRead); } return builder.toString(); } catch (final SSLException e) { LOGGER.error("SSL error getting response from host: : Error Message: {}", constructedUrl.getHost(), e.getMessage(), e); throw new RuntimeException(e); } catch (final Exception e) { LOGGER.error("Error getting response from host: with path: and protocol: {}: Error Message: {}", constructedUrl.getHost(), constructedUrl.getPath(), constructedUrl.getProtocol(), e.getMessage(), e); throw new RuntimeException(e); <START> } finally { <END> closeQuietly(in); if (conn != null) { conn.disconnect(); } } }</code><technical_language>This log exception "e" folded array for string formatting arguments</technical_language>

Target:
public static String getResponseFromServer(final URL constructedUrl, final HttpURLConnectionFactory factory, final String encoding) { HttpURLConnection conn = null; InputStreamReader in = null; try { conn = factory.buildHttpURLConnection(constructedUrl.openConnection()); if (CommonUtils.isEmpty(encoding)) { in = new InputStreamReader(conn.getInputStream()); } else { in = new InputStreamReader(conn.getInputStream(), encoding); } final StringBuilder builder = new StringBuilder(255); int byteRead; while ((byteRead = in.read()) != -1) { builder.append((char) byteRead); } return builder.toString(); } catch (final RuntimeException e) { throw e; } catch (final SSLException e) { LOGGER.error("SSL error getting response from host: : Error Message: {}", constructedUrl.getHost(), e.getMessage(), e); throw new RuntimeException(e); } catch (final IOException e) { LOGGER.error("Error getting response from host: with path: and protocol: Error Message: {}", constructedUrl.getHost(), constructedUrl.getPath(), constructedUrl.getProtocol(), e.getMessage(), e); throw new RuntimeException(e); } finally { closeQuietly(in); if (conn != null) { conn.disconnect(); } } }
Source:
<code>public void endWindow() { <START> boolean isTimeUnifiedStore = (store instanceof ManagedTimeUnifiedStateImpl); <END> for (K key: cache.getChangedKeys()) { long timeOrBucketId = getBucket(key); long bucketId = timeOrBucketId; if (isTimeUnifiedStore) { bucketId = ((ManagedTimeUnifiedStateImpl)store).getTimeBucketId(timeOrBucketId); } keyValueSerdeManager.updateBuffersForBucketChange(bucketId); store.put(timeOrBucketId, keyValueSerdeManager.serializeDataKey(key, true), keyValueSerdeManager.serializeValue(cache.get(key))); } for (K key: cache.getRemovedKeys()) { long timeOrBucketId = getBucket(key); long bucketId = timeOrBucketId; if (isTimeUnifiedStore) { bucketId = ((ManagedTimeUnifiedStateImpl)store).getTimeBucketId(timeOrBucketId); } keyValueSerdeManager.updateBuffersForBucketChange(bucketId); store.put(timeOrBucketId, keyValueSerdeManager.serializeDataKey(key, true), BufferSlice.EMPTY_SLICE); } cache.endWindow(); keyValueSerdeManager.resetReadBuffer(); }</code><technical_language>Move this out of endWindow(). I suggest this class variable</technical_language>

Target:
public void endWindow() { boolean isTimeUnifiedStore = (store instanceof ManagedTimeUnifiedStateImpl); for (K key: cache.getChangedKeys()) { long timeOrBucketId = bucket; long bucketId = timeOrBucketId; if (isTimeUnifiedStore) { timeOrBucketId = getBucketTimeOrId(key); bucketId = ((ManagedTimeUnifiedStateImpl)store).getTimeBucketAssigner().getTimeBucket(timeOrBucketId); } keyValueSerdeManager.updateBuffersForBucketChange(bucketId); store.put(timeOrBucketId, keyValueSerdeManager.serializeDataKey(key, true), keyValueSerdeManager.serializeValue(cache.get(key))); } for (K key: cache.getRemovedKeys()) { long timeOrBucketId = bucket; long bucketId = timeOrBucketId; if (isTimeUnifiedStore) { timeOrBucketId = getBucketTimeOrId(key); bucketId = ((ManagedTimeUnifiedStateImpl)store).getTimeBucketAssigner().getTimeBucket(timeOrBucketId); } keyValueSerdeManager.updateBuffersForBucketChange(bucketId); store.put(timeOrBucketId, keyValueSerdeManager.serializeDataKey(key, true), BufferSlice.EMPTY_SLICE); } cache.endWindow(); keyValueSerdeManager.resetReadBuffer(); }
Source:
<code>public void testWriteBool() { final boolean expected = false; final String tag = "tag1"; checkWriterAndReader( (oa) -> oa.writeBool(expected, tag), (ia) -> { boolean actual = ia.readBool(tag); <START> Assert.assertEquals(expected, actual); <END> } ); }</code><technical_language>Sorry, nit: reason for static imports</technical_language>

Target:
public void testWriteBool() { final boolean expected = false; final String tag = "tag1"; checkWriterAndReader( (oa) -> oa.writeBool(expected, tag), (ia) -> { boolean actual = ia.readBool(tag); assertEquals(expected, actual); } ); }
Source:
<code>public Page<TaskId> getTaskIds(String taskTag, long from, long to, boolean mytasks, boolean running, boolean pending, boolean finished, int offset, int limit) throws NotConnectedException, PermissionException { RestPage<TaskStateData> page = null; try { page = restApi().getTaskStates(sid, from, to, mytasks, running, pending, finished, offset, limit); } catch (NotConnectedRestException e) { throw new NotConnectedException(e); } catch (PermissionRestException e) { throw new PermissionException(e); } List<TaskId> lTaskIds = new ArrayList<TaskId>(page.getList().size()); for (TaskStateData taskStateData : page.getList()) { <START> JobId jobId = new JobIdImpl(taskStateData.getTaskInfo().getJobId().getId(), <END> taskStateData.getTaskInfo().getJobId().getReadableName()); TaskId taskId = TaskIdImpl.createTaskId(jobId, taskStateData.getTaskInfo().getTaskId().getReadableName(), taskStateData.getTaskInfo().getTaskId().getId()); lTaskIds.add(taskId); } return new Page<TaskId>(lTaskIds, page.getSize()); }</code><technical_language>introduce variable for taskStateData.getTaskInfo() in order improve readability</technical_language>

Target:
public Page<TaskId> getTaskIds(String taskTag, long from, long to, boolean mytasks, boolean running, boolean pending, boolean finished, int offset, int limit) throws NotConnectedException, PermissionException { RestPage<TaskStateData> page = null; try { page = restApi().getTaskStates(sid, from, to, mytasks, running, pending, finished, offset, limit); } catch (NotConnectedRestException e) { throw new NotConnectedException(e); } catch (PermissionRestException e) { throw new PermissionException(e); } List<TaskId> lTaskIds = new ArrayList<TaskId>(page.getList().size()); for (TaskStateData taskStateData : page.getList()) { TaskInfoData taskInfo = taskStateData.getTaskInfo(); TaskIdData taskIdData = taskInfo.getTaskId(); JobId jobId = new JobIdImpl(taskInfo.getJobId().getId(), taskInfo.getJobId().getReadableName()); TaskId taskId = TaskIdImpl.createTaskId(jobId, taskIdData.getReadableName(), taskIdData.getId()); lTaskIds.add(taskId); } return new Page<TaskId>(lTaskIds, page.getSize()); }
Source:
<code>public HttpRequest filterKey(HttpRequest request) throws HttpException { request = replaceDateHeader(request); String signature = calculateSignature(createStringToSign(request)); <START> request = replaceAuthorizationHeader(request, signature); <END> return request; }</code><technical_language>suggestion</technical_language>

Target:
public HttpRequest filterKey(HttpRequest request) throws HttpException { request = replaceDateHeader(request); String signature = calculateSignature(createStringToSign(request)); return replaceAuthorizationHeader(request, signature); }
Source:
<code>public void connect(IDocument doc) { if (doc == document) { return; } synchronized (partitions) { <START> disconnect(); <END> if (doc != null) { inputPartitions = new ArrayList<>(); document = doc; legalLineDelimiterMatcher = MultiStringMatcher.create(document.getLegalLineDelimiters()); } } }</code><technical_language>disconnect() need sync block? acquire another lock while holding partitions lock. Danger</technical_language>

Target:
public void connect(IDocument doc) { if (doc == document) { return; } disconnect(); if (doc != null) { synchronized (partitions) { inputPartitions = new ArrayList<>(); document = doc; legalLineDelimiterMatcher = MultiStringMatcher.create(document.getLegalLineDelimiters()); } } }
Source:
<code>public void testMultiPartitionCURRENT_TIMESTAMP() throws IOException, ProcCallException { <START> <END> if (!isHSQL()) { Client client = getClient(); client.callProcedure(CurrentTimestampProcedure.class.getSimpleName()); } }</code><technical_language>A positive test clearer here: if (isHSQL()) { return; }</technical_language>

Target:
public void testMultiPartitionCURRENT_TIMESTAMP() throws IOException, ProcCallException { if (isHSQL()) { return; } Client client = getClient(); client.callProcedure(CurrentTimestampProcedure.class.getSimpleName()); }
Source:
<code>public void do2DQuery(ITmfStateIntervalList stateInfo, long t) throws TimeRangeException, StateSystemDisposedException { if (!checkValidTime(t)) { throw new TimeRangeException(); } CoreNode currentNode = sht.getLatestBranch().get(0); currentNode.writeInfoFromNode(stateInfo); try { while (currentNode.getNbChildren() > 0) { currentNode = (CoreNode) sht.selectNextChild(currentNode, t); currentNode.writeInfoFromNode(stateInfo); } } catch (ClosedChannelException e) { throw new StateSystemDisposedException(e); } <START> return; <END> }</code><technical_language>This piece of code is useless. remove</technical_language>

Target:
public void do2DQuery(ITmfStateIntervalList stateInfo, long t) throws TimeRangeException, StateSystemDisposedException { if (!checkValidTime(t)) { throw new TimeRangeException(); } CoreNode currentNode = sht.getLatestBranch().get(0); currentNode.writeInfoFromNode(stateInfo); try { while (currentNode.getNbChildren() > 0) { currentNode = (CoreNode) sht.selectNextChild(currentNode, t); currentNode.writeInfoFromNode(stateInfo); } } catch (ClosedChannelException e) { throw new StateSystemDisposedException(e); } }
Source:
<code><START> public void setStacktrace(@NonNull List<Stackframe> stacktrace) { <END> if (stacktrace != null) { impl.setStacktrace(stacktrace); } else { error("stacktrace"); } }</code><technical_language>This sanitized for null elements</technical_language>

Target:
public void setStacktrace(@NonNull List<Stackframe> stacktrace) { if (!CollectionUtils.containsNullElements(stacktrace)) { impl.setStacktrace(stacktrace); } else { logNull("stacktrace"); } }
Source:
<code>synchronized private void flush() { lastFlush.set(System.nanoTime()); if (!leaseManager.stillInLeasePeriod()) { if (batch.getNumEvents() > 0) { writer.clearWriteBuffer(); <START> panicker.panic("Replica " + tsoHostAndPort + " lost mastership before flushing data. Committing suicide"); <END> } } else { try { writer.flush(); } catch (IOException e) { panicker.panic("Error persisting commit batch", e.getCause()); } batchSizeHistogram.update(batch.getNumEvents()); if (!leaseManager.stillInLeasePeriod()) { panicker.panic("Replica " + tsoHostAndPort + " lost mastership after flushing data. Committing suicide"); } } flushTimer.update((System.nanoTime() - lastFlush.get())); batch.sendRepliesAndReset(reply, retryProc); }</code><technical_language>super minor: do want move this a method replace identical code method call? panicker.panic("Replica " + tsoHostAndPort + " lost mastership flushing data. Committing suicide");</technical_language>

Target:
synchronized private void flush() { if (batch.getNumEvents() > 0) { lastFlush.set(System.nanoTime()); commitSuicideIfNotMaster(); try { writer.flush(); batchSizeHistogram.update(batch.getNumEvents()); } catch (IOException e) { panicker.panic("Error persisting commit batch", e); } commitSuicideIfNotMaster(); flushTimer.update((System.nanoTime() - lastFlush.get())); batch.sendRepliesAndReset(reply, retryProc); } }
Source:
<code>protected Timestamp doBackward(String s) { try { return Timestamps.parse(s); } catch (ParseException e) { final ConversionError conversionError = new ConversionError(e.getMessage(), e.getErrorOffset()); <START> throw new IllegalArgumentException(conversionError); <END> } }</code><technical_language>weird. fetch conversion error outside</technical_language>

Target:
protected Timestamp doBackward(String s) { try { return Timestamps.parse(s); } catch (ParseException e) { final ConversionError conversionError = new ConversionError(e.getMessage()); throw new IllegalConversionArgumentException(conversionError); } }
Source:
<code>public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final View courseUnitOnlyOnYoutubeView = inflater.inflate(R.layout.fragment_course_unit_only_on_youtube, container, false); if (environment.getConfig().getEmbeddedYoutubeConfig().isYoutubeEnabled()) { ((TextView) courseUnitOnlyOnYoutubeView.findViewById(R.id.only_youtube_available_message)).setText(R.string.assessment_needed_updating_youtube); courseUnitOnlyOnYoutubeView.findViewById(R.id.update_youtube_button).setVisibility(View.VISIBLE); courseUnitOnlyOnYoutubeView.findViewById(R.id.update_youtube_button).setOnClickListener(v -> { <START> final Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(AppConstants.BROWSER_PLAYSTORE_YOUTUBE_URI)); <END> startActivity(intent); }); } courseUnitOnlyOnYoutubeView.findViewById(R.id.view_on_youtube_button).setOnClickListener(v -> { final Intent intent = new Intent(Intent.ACTION_VIEW); intent.setData(Uri.parse(((VideoBlockModel) unit).getData().encodedVideos.youtube.url)); startActivity(intent); }); return courseUnitOnlyOnYoutubeView; }</code><technical_language>this solution for play store app page redirection? <LINK_0> this kind of functions(in intent is Intent.ACTION_VIEW) a utility function</technical_language>

Target:
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { final View view = inflater.inflate(R.layout.fragment_course_unit_only_on_youtube, container, false); TextView tvYouTubeMessage = view.findViewById(R.id.only_youtube_available_message); if (environment.getConfig().getYoutubePlayerConfig().isYoutubePlayerEnabled()) { tvYouTubeMessage.setText(R.string.assessment_needed_updating_youtube); view.findViewById(R.id.update_youtube_button).setVisibility(View.VISIBLE); view.findViewById(R.id.update_youtube_button).setOnClickListener(v -> { BrowserUtil.open(getActivity(), AppConstants.BROWSER_PLAYSTORE_YOUTUBE_URI); }); } else { tvYouTubeMessage.setText(R.string.assessment_only_on_youtube); } view.findViewById(R.id.view_on_youtube_button).setOnClickListener(v -> { BrowserUtil.open(getActivity(), ((VideoBlockModel) unit).getData().encodedVideos.youtube.url); }); return view; }
Source:
<code><START> public void start(){ <END> if (started.compareAndSet(false, true)){ for (final KafkaStream<byte[], byte[]> stream: streams){ executorService.execute(new Runnable() { @Override public void run() { while (!closed.get()) { try { String input = null; ConsumerIterator<byte[], byte[]> it = stream.iterator(); while(it.hasNext()){ input = new String(it.next().message()); if (outputEmitter == null) { throw new RuntimeException("OutputEmitter should be set in " + BaseSourceGenerator.class.getName()); } if (input.equals("")) { Thread.sleep(sleepTime); } else { outputEmitter.emit(input); } } } catch (final InterruptedException e){ e.printStackTrace(); } } } }); } } }</code><technical_language>) {</technical_language>

Target:
public void start() { if (started.compareAndSet(false, true)) { final KafkaStream<byte[], byte[]> stream = streams.get(0); executorService.execute(new Runnable() { @Override public void run() { while (!closed.get()) { try { String input; final ConsumerIterator<byte[], byte[]> it = stream.iterator(); while(it.hasNext()){ input = new String(it.next().message()); if (outputEmitter == null) { throw new RuntimeException("OutputEmitter should be set in " + BaseSourceGenerator.class.getName()); } if (input.equals("")) { Thread.sleep(sleepTime); } else { outputEmitter.emit(input); } } } catch (final InterruptedException e) { e.printStackTrace(); } } } }); } }
Source:
<code>public void validate(String ownerId, Collection<String> serviceLevels) { Set<String> invalidServiceLevels = new HashSet<>(); for (String serviceLevel : serviceLevels) { if (!StringUtils.isBlank(serviceLevel)) { boolean found = false; for (String level : poolManager.retrieveServiceLevelsForOwner(ownerId, false)) { if (serviceLevel.equalsIgnoreCase(level)) { found = true; break; } } if (!found) { invalidServiceLevels.add(serviceLevel); } } } if (!invalidServiceLevels.isEmpty()) { Owner owner = ownerCurator.findOwnerById(ownerId); String error = i18n.tr("Service level \"{0}\" is not available to units of organization {1}.", StringUtils.join(invalidServiceLevels, ", "), owner.getKey()); <START> throw new RuleValidationException(error); <END> } }</code><technical_language>This is a bit confusing place for this exception, rules (policy package) execution. BadRequestException seemd a fit</technical_language>

Target:
private void validate(String ownerId, Collection<String> serviceLevels) { Set<String> invalidServiceLevels = new HashSet<>(); for (String serviceLevel : serviceLevels) { if (!StringUtils.isBlank(serviceLevel)) { boolean found = false; for (String level : poolManager.retrieveServiceLevelsForOwner(ownerId, false)) { if (serviceLevel.equalsIgnoreCase(level)) { found = true; break; } } if (!found) { invalidServiceLevels.add(serviceLevel); } } } if (!invalidServiceLevels.isEmpty()) { Owner owner = ownerCurator.findOwnerById(ownerId); String error = i18n.tr("Service level \"{0}\" is not available to units of organization {1}.", StringUtils.join(invalidServiceLevels, ", "), owner.getKey()); throw new SlaValidationException(error); } }
Source:
<code>private void addEntryToZip(String path, String srcFile, ZipOutputStream zip, boolean isFolder, boolean isManifest) throws IOException { File entry = new File(srcFile); if (isFolder == true) { zip.putNextEntry(new ZipEntry(path + SEPARATOR + entry.getName() + SEPARATOR)); } else { if (entry.isDirectory()) { addFolderToZip(path, srcFile, zip); } else { byte[] buf = new byte[8192]; int len; <START> FileInputStream in = new FileInputStream(srcFile); <END> ZipEntry zipEntry = isManifest ? new ZipEntry(entry.getName()) : new ZipEntry(path + SEPARATOR + entry.getName()); zip.putNextEntry(zipEntry); while ((len = in.read(buf)) > 0) { zip.write(buf, 0, len); } } } }</code><technical_language>close in finally</technical_language>

Target:
private void addEntryToZip(String path, String srcFile, ZipOutputStream zip, boolean isFolder, boolean isManifest) throws IOException { File entry = new File(srcFile); if (isFolder == true) { zip.putNextEntry(new ZipEntry(path + SEPARATOR + entry.getName() + SEPARATOR)); } else { if (entry.isDirectory()) { addFolderToZip(path, srcFile, zip); } else { byte[] buf = new byte[8192]; int len; ZipEntry zipEntry = isManifest ? new ZipEntry(entry.getName()) : new ZipEntry(path + SEPARATOR + entry.getName()); zip.putNextEntry(zipEntry); try (FileInputStream in = new FileInputStream(srcFile)) { while ((len = in.read(buf)) > 0) { zip.write(buf, 0, len); } } } } }
Source:
<code>public void testResolveUserWithUnresolvedUser() throws Exception { ParseACL acl = new ParseACL(); ParseUser unresolvedUser = new ParseUser(); setLazy(unresolvedUser); acl.setReadAccess(unresolvedUser, true); acl.setWriteAccess(unresolvedUser, true); unresolvedUser.setObjectId("test"); acl.resolveUser(unresolvedUser); <START> unresolvedUser.setObjectId("test"); <END> assertNull(acl.getUnresolvedUser()); assertTrue(acl.getReadAccess(unresolvedUser)); assertTrue(acl.getWriteAccess(unresolvedUser)); assertEquals(1, acl.getPermissionsById().length()); assertFalse(acl.getPermissionsById().has(UNRESOLVED_KEY)); }</code><technical_language>reasoning need this</technical_language>

Target:
public void testResolveUserWithUnresolvedUser() throws Exception { ParseACL acl = new ParseACL(); ParseUser unresolvedUser = new ParseUser(); setLazy(unresolvedUser); acl.setReadAccess(unresolvedUser, true); acl.setWriteAccess(unresolvedUser, true); unresolvedUser.setObjectId("test"); acl.resolveUser(unresolvedUser); assertNull(acl.getUnresolvedUser()); assertTrue(acl.getReadAccess(unresolvedUser)); assertTrue(acl.getWriteAccess(unresolvedUser)); assertEquals(1, acl.getPermissionsById().length()); assertFalse(acl.getPermissionsById().has(UNRESOLVED_KEY)); }