AutoRefactor: push negation down
| | |
| | | */ |
| | | @Override |
| | | public boolean equals(Object o) { |
| | | return this == o || |
| | | !(o == null || getClass() != o.getClass()) && |
| | | compareTo((BuildInformation)o) == 0; |
| | | if (this == o) { |
| | | return true; |
| | | } |
| | | return o != null |
| | | && getClass() == o.getClass() |
| | | && compareTo((BuildInformation)o) == 0; |
| | | } |
| | | |
| | | /** |
| | |
| | | try |
| | | { |
| | | File f = getFileForPath(newTrustStoreFile); |
| | | if (!(f.exists() && f.isFile())) |
| | | if (!f.exists() || !f.isFile()) |
| | | { |
| | | unacceptableReasons.add(ERR_TRUSTSTORE_NO_SUCH_FILE.get(newTrustStoreFile, cfgEntryDN)); |
| | | configAcceptable = false; |
| | |
| | | // Get the path to the trust store file. |
| | | String newTrustStoreFile = cfg.getTrustStoreFile(); |
| | | File f = getFileForPath(newTrustStoreFile); |
| | | if (! (f.exists() && f.isFile())) |
| | | if (!f.exists() || !f.isFile()) |
| | | { |
| | | ccr.setResultCode(DirectoryServer.getServerErrorResultCode()); |
| | | ccr.addMessage(ERR_TRUSTSTORE_NO_SUCH_FILE.get(newTrustStoreFile, configEntryDN)); |
| | |
| | | */ |
| | | public boolean hasMoreData() throws IOException |
| | | { |
| | | boolean ret = ((begin + offset) >= end); |
| | | return !(cache.remaining() == 0 && ret); |
| | | boolean hasMore = begin + offset < end; |
| | | return cache.remaining() != 0 || hasMore; |
| | | } |
| | | |
| | | |
| | |
| | | */ |
| | | public boolean hasMoreData() throws IOException |
| | | { |
| | | boolean ret = ((begin + offset) >= end); |
| | | return !(cache.remaining() == 0 && ret); |
| | | boolean hasMore = begin + offset < end; |
| | | return cache.remaining() != 0 || hasMore; |
| | | } |
| | | |
| | | |
| | |
| | | |
| | | ByteString v = iterator.next(); |
| | | String valueString = toLowerCase(v.toString()); |
| | | if (!(valueString.startsWith("cancel") || |
| | | valueString.startsWith("stop"))) { |
| | | if (!valueString.startsWith("cancel") |
| | | && !valueString.startsWith("stop")) { |
| | | acceptable = false; |
| | | break; |
| | | } |
| | |
| | | try |
| | | { |
| | | String dnString = configEntryDN.toString(); |
| | | if ( ! ((dnString == null) || (dnString.length() == 0))) |
| | | if (dnString != null && dnString.length() != 0) |
| | | { |
| | | StringBuilder buffer = new StringBuilder(dnString.length()); |
| | | String rdns[] = dnString.replace(',', ';').split(";"); |
| | |
| | | final SecretKey secretKey |
| | | = decodeSymmetricKeyAttribute(symmetricKeyAttribute); |
| | | final Map<String, byte[]> certMap = getTrustedCertificates(); |
| | | if (! (certMap.containsKey(requestedInstanceKeyID) |
| | | && null != certMap.get(requestedInstanceKeyID))) { |
| | | if (certMap.get(requestedInstanceKeyID) == null) { |
| | | throw new CryptoManagerException( |
| | | ERR_CRYPTOMGR_REWRAP_SYMMETRIC_KEY_ATTRIBUTE_NO_WRAPPER.get( |
| | | requestedInstanceKeyID)); |
| | |
| | | keyStoreFile = configuration.getKeyStoreFile(); |
| | | try { |
| | | File f = getFileForPath(keyStoreFile); |
| | | if (!(f.exists() && f.isFile())) { |
| | | if (!f.exists() || !f.isFile()) { |
| | | throw new InitializationException(ERR_FILE_KEYMANAGER_NO_SUCH_FILE.get(keyStoreFile, configEntryDN)); |
| | | } |
| | | } catch (SecurityException e) { |
| | |
| | | try |
| | | { |
| | | File f = getFileForPath(newKeyStoreFile); |
| | | if (!(f.exists() && f.isFile())) |
| | | if (!f.exists() || !f.isFile()) |
| | | { |
| | | unacceptableReasons.add(ERR_FILE_KEYMANAGER_NO_SUCH_FILE.get(newKeyStoreFile, cfgEntryDN)); |
| | | configAcceptable = false; |
| | |
| | | try |
| | | { |
| | | File f = getFileForPath(newKeyStoreFile); |
| | | if (!(f.exists() && f.isFile())) |
| | | if (!f.exists() || !f.isFile()) |
| | | { |
| | | ccr.setResultCode(DirectoryServer.getServerErrorResultCode()); |
| | | ccr.addMessage(ERR_FILE_KEYMANAGER_NO_SUCH_FILE.get(newKeyStoreFile, configEntryDN)); |
| | |
| | | // Get the path to the trust store file. |
| | | trustStoreFile = configuration.getTrustStoreFile(); |
| | | File f = getFileForPath(trustStoreFile); |
| | | if (! (f.exists() && f.isFile())) |
| | | if (!f.exists() || !f.isFile()) |
| | | { |
| | | LocalizableMessage message = ERR_FILE_TRUSTMANAGER_NO_SUCH_FILE.get(trustStoreFile, configEntryDN); |
| | | throw new InitializationException(message); |
| | |
| | | try |
| | | { |
| | | File f = getFileForPath(newTrustStoreFile); |
| | | if (!(f.exists() && f.isFile())) |
| | | if (!f.exists() || !f.isFile()) |
| | | { |
| | | unacceptableReasons.add(ERR_FILE_TRUSTMANAGER_NO_SUCH_FILE.get(newTrustStoreFile, cfgEntryDN)); |
| | | configAcceptable = false; |
| | |
| | | // Get the path to the trust store file. |
| | | String newTrustStoreFile = configuration.getTrustStoreFile(); |
| | | File f = getFileForPath(newTrustStoreFile); |
| | | if (! (f.exists() && f.isFile())) |
| | | if (!f.exists() || !f.isFile()) |
| | | { |
| | | ccr.setResultCode(DirectoryServer.getServerErrorResultCode()); |
| | | ccr.addMessage(ERR_FILE_TRUSTMANAGER_NO_SUCH_FILE.get(newTrustStoreFile, configEntryDN)); |
| | |
| | | |
| | | // Make sure that the profile directory exists. |
| | | File profileDirectory = getFileForPath(configuration.getProfileDirectory()); |
| | | if (! (profileDirectory.exists() && profileDirectory.isDirectory())) |
| | | if (!profileDirectory.exists() || !profileDirectory.isDirectory()) |
| | | { |
| | | LocalizableMessage message = WARN_PLUGIN_PROFILER_INVALID_PROFILE_DIR.get( |
| | | profileDirectory.getAbsolutePath(), configEntryDN); |
| | |
| | | |
| | | // Make sure that the profile directory exists. |
| | | File profileDirectory = getFileForPath(configuration.getProfileDirectory()); |
| | | if (! (profileDirectory.exists() && profileDirectory.isDirectory())) |
| | | if (!profileDirectory.exists() || !profileDirectory.isDirectory()) |
| | | { |
| | | unacceptableReasons.add(WARN_PLUGIN_PROFILER_INVALID_PROFILE_DIR.get( |
| | | profileDirectory.getAbsolutePath(), cfgEntryDN)); |
| | |
| | | } |
| | | } |
| | | |
| | | if (!(operationsInProgress.isEmpty() && getPersistentSearches() |
| | | .isEmpty())) |
| | | if (!operationsInProgress.isEmpty() |
| | | || !getPersistentSearches().isEmpty()) |
| | | { |
| | | lastCompletionTime.set(TimeThread.getTime()); |
| | | } |
| | |
| | | ERR_ATTR_SYNTAX_ATTR_ILLEGAL_INITIAL_DIGIT.get( |
| | | value, ch, ATTR_ALLOW_ATTRIBUTE_NAME_EXCEPTIONS)); |
| | | } |
| | | else if(!((ch>='0' && ch<='9') || (ch>='A' && ch<='Z') || |
| | | (ch>='a' && ch<='z'))) |
| | | else if (!(('0'<=ch && ch<='9') |
| | | || ('A'<=ch && ch<='Z') |
| | | || ('a'<=ch && ch<='z'))) |
| | | { |
| | | throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, |
| | | ERR_ATTR_SYNTAX_ATTR_ILLEGAL_CHAR.get(value, ch, index)); |
| | |
| | | } |
| | | |
| | | String scopeStr = valueStr.substring(lastSharpPos+1).trim(); |
| | | if (! (scopeStr.equals("baseobject") || scopeStr.equals("onelevel") || |
| | | scopeStr.equals("wholesubtree") || |
| | | scopeStr.equals("subordinatesubtree"))) |
| | | if (!scopeStr.equals("baseobject") |
| | | && !scopeStr.equals("onelevel") |
| | | && !scopeStr.equals("wholesubtree") |
| | | && !scopeStr.equals("subordinatesubtree")) |
| | | { |
| | | if (scopeStr.length() == 0) |
| | | { |
| | |
| | | for (int i=sharpPos+2; i < endPos; i++) |
| | | { |
| | | char c = valueString.charAt(i); |
| | | if (! ((c == '0') || (c == '1'))) |
| | | if (c != '0' && c != '1') |
| | | { |
| | | invalidReason.append( |
| | | ERR_ATTR_SYNTAX_NAMEANDUID_ILLEGAL_BINARY_DIGIT.get(valueString, c, i)); |
| | |
| | | for (int i=0; i < length; i++) |
| | | { |
| | | char c = valueString.charAt(i); |
| | | if (! (isDigit(c) || (c == ' '))) |
| | | if (!isDigit(c) && c != ' ') |
| | | { |
| | | invalidReason.append(WARN_ATTR_SYNTAX_NUMERIC_STRING_ILLEGAL_CHAR.get(valueString, c, i)); |
| | | return false; |
| | |
| | | throw new DirectoryException( |
| | | ResultCode.INVALID_ATTRIBUTE_SYNTAX, message); |
| | | } |
| | | else if(!((ch>='0' && ch<='9') || (ch>='A' && ch<='Z') || |
| | | (ch>='a' && ch<='z'))) |
| | | else if (!(('0'<=ch && ch<='9') |
| | | || ('A'<=ch && ch<='Z') |
| | | || ('a'<=ch && ch<='z'))) |
| | | { |
| | | throw new DirectoryException(ResultCode.INVALID_ATTRIBUTE_SYNTAX, |
| | | ERR_OC_SYNTAX_ATTR_ILLEGAL_CHAR.get(value, ch, index)); |
| | |
| | | lastWasPeriod = true; |
| | | } |
| | | } |
| | | else if (! (isDigit(c) || |
| | | allowExceptions && (isAlpha(c) || (c=='-') || (c=='_')))) |
| | | else if ((!isDigit(c) && (!allowExceptions || (!isAlpha(c) && (c != '-') && (c != '_'))))) |
| | | { |
| | | // Technically, this must be an illegal character. However, it is |
| | | // possible that someone just got sloppy and did not include a space |
| | |
| | | |
| | | |
| | | // Make sure that the user actually tried to configure something. |
| | | if (! (baseDNString.isPresent() || ldapPort.isPresent() || |
| | | jmxPort.isPresent() || rootDNString.isPresent())) |
| | | if (!baseDNString.isPresent() |
| | | && !ldapPort.isPresent() |
| | | && !jmxPort.isPresent() |
| | | && !rootDNString.isPresent()) |
| | | { |
| | | LocalizableMessage message = ERR_CONFIGDS_NO_CONFIG_CHANGES.get(); |
| | | err.println(wrapText(message, MAX_LINE_WIDTH)); |
| | |
| | | if (javaHome.isPresent()) |
| | | { |
| | | File f = new File(javaHome.getValue()); |
| | | if (! (f.exists() && f.isDirectory())) |
| | | if (!f.exists() || !f.isDirectory()) |
| | | { |
| | | err.println(ERR_CREATERC_JAVA_HOME_DOESNT_EXIST.get(javaHome.getValue())); |
| | | return 1; |
| | |
| | | // were provided. |
| | | if (bindDN.isPresent()) |
| | | { |
| | | if (! (bindPW.isPresent() || bindPWFile.isPresent())) |
| | | if (!bindPW.isPresent() && !bindPWFile.isPresent()) |
| | | { |
| | | LocalizableMessage message = ERR_LDAPPWMOD_BIND_DN_AND_PW_MUST_BE_TOGETHER.get(); |
| | | |
| | |
| | | return CLIENT_SIDE_PARAM_ERROR; |
| | | } |
| | | |
| | | if (! (authzID.isPresent() && |
| | | (currentPW.isPresent() || currentPWFile.isPresent()))) |
| | | if ((!authzID.isPresent() || (!currentPW.isPresent() && !currentPWFile.isPresent()))) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_LDAPPWMOD_ANON_REQUIRES_AUTHZID_AND_CURRENTPW.get(); |
| | |
| | | for (TemplateLine l : rdnLines) |
| | | { |
| | | TagResult r = l.generateLine(entry); |
| | | if (! (r.keepProcessingEntry() && r.keepProcessingParent() && |
| | | r.keepProcessingTemplateFile())) |
| | | if (!r.keepProcessingEntry() |
| | | || !r.keepProcessingParent() |
| | | || !r.keepProcessingTemplateFile()) |
| | | { |
| | | return r; |
| | | } |
| | |
| | | for (TemplateLine l : extraLines) |
| | | { |
| | | TagResult r = l.generateLine(entry); |
| | | if (! (r.keepProcessingEntry() && r.keepProcessingParent() && |
| | | r.keepProcessingTemplateFile())) |
| | | if ((!r.keepProcessingEntry() |
| | | || !r.keepProcessingParent() |
| | | || !r.keepProcessingTemplateFile())) |
| | | { |
| | | return r; |
| | | } |
| | |
| | | TagResult r = |
| | | subordinateTemplates[i].writeEntries(entryWriter, branchDN, |
| | | numEntriesPerTemplate[i]); |
| | | if (! (r.keepProcessingParent() && r.keepProcessingTemplateFile())) |
| | | if (!r.keepProcessingParent() |
| | | || !r.keepProcessingTemplateFile()) |
| | | { |
| | | if (r.keepProcessingTemplateFile()) |
| | | { |
| | |
| | | for (TemplateLine l : templateLines) |
| | | { |
| | | TagResult r = l.generateLine(templateEntry); |
| | | if (! (r.keepProcessingEntry() && r.keepProcessingParent() && |
| | | r.keepProcessingTemplateFile())) |
| | | if (!r.keepProcessingEntry() |
| | | || !r.keepProcessingParent() |
| | | || !r.keepProcessingTemplateFile()) |
| | | { |
| | | return r; |
| | | } |
| | |
| | | TagResult r = |
| | | subordinateTemplates[j].writeEntries(entryWriter, |
| | | templateEntry.getDN(), numEntriesPerTemplate[j]); |
| | | if (! (r.keepProcessingParent() && r.keepProcessingTemplateFile())) |
| | | if (!r.keepProcessingParent() |
| | | || !r.keepProcessingTemplateFile()) |
| | | { |
| | | if (r.keepProcessingTemplateFile()) |
| | | { |
| | |
| | | for (Tag t : tags) |
| | | { |
| | | TagResult result = t.generateValue(templateEntry, value); |
| | | if (! (result.keepProcessingLine() && result.keepProcessingEntry() && |
| | | result.keepProcessingParent() && |
| | | result.keepProcessingTemplateFile())) |
| | | if (!result.keepProcessingLine() |
| | | || !result.keepProcessingEntry() |
| | | || !result.keepProcessingParent() |
| | | || !result.keepProcessingTemplateFile()) |
| | | { |
| | | return result; |
| | | } |
| | |
| | | else |
| | | { |
| | | File parentFile = lockDirectory.getParentFile(); |
| | | if (! (parentFile.exists() && parentFile.isDirectory())) |
| | | if (!parentFile.exists() || !parentFile.isDirectory()) |
| | | { |
| | | throw new InitializationException( |
| | | ERR_DIRCFG_INVALID_LOCK_DIRECTORY.get( |
| | |
| | | |
| | | for (AttributeType t : o.getRequiredAttributes()) |
| | | { |
| | | if (! (userAttributes.containsKey(t) || |
| | | operationalAttributes.containsKey(t) || |
| | | t.isObjectClass())) |
| | | if (!userAttributes.containsKey(t) |
| | | && !operationalAttributes.containsKey(t) |
| | | && !t.isObjectClass()) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_ENTRY_SCHEMA_MISSING_REQUIRED_ATTR_FOR_OC.get( |
| | |
| | | // Make sure that all of the required attributes are present. |
| | | for (AttributeType t : ditContentRule.getRequiredAttributes()) |
| | | { |
| | | if (! (userAttributes.containsKey(t) || |
| | | operationalAttributes.containsKey(t) || |
| | | t.isObjectClass())) |
| | | if (!userAttributes.containsKey(t) |
| | | && !operationalAttributes.containsKey(t) |
| | | && !t.isObjectClass()) |
| | | { |
| | | LocalizableMessage message = |
| | | ERR_ENTRY_SCHEMA_MISSING_REQUIRED_ATTR_FOR_DCR.get( |
| | |
| | | for (int i=startPos+1; i < endPos; i++) |
| | | { |
| | | c = element.charAt(i); |
| | | if (! (isAlpha(c) || isDigit(c) || (c == '-') || |
| | | ((c == '_') && DirectoryServer.allowAttributeNameExceptions()))) |
| | | if (!isAlpha(c) |
| | | && !isDigit(c) |
| | | && c != '-' |
| | | && (c != '_' || !DirectoryServer.allowAttributeNameExceptions())) |
| | | { |
| | | // This is an illegal character for an attribute name. |
| | | invalidReason.append(ERR_SCHEMANAME_ILLEGAL_CHAR.get(element, c, i)); |
| | |
| | | |
| | | // Check if some trust manager info are set |
| | | boolean weDontKnowTheTrustMethod = |
| | | !(secureArgsList.trustAllArg.isPresent() |
| | | || secureArgsList.trustStorePathArg.isPresent() |
| | | || secureArgsList.trustStorePasswordArg.isPresent() || secureArgsList.trustStorePasswordFileArg |
| | | .isPresent()); |
| | | !secureArgsList.trustAllArg.isPresent() |
| | | && !secureArgsList.trustStorePathArg.isPresent() |
| | | && !secureArgsList.trustStorePasswordArg.isPresent() |
| | | && !secureArgsList.trustStorePasswordFileArg.isPresent(); |
| | | boolean askForTrustStore = false; |
| | | |
| | | trustAll = secureArgsList.trustAllArg.isPresent(); |
| | |
| | | // that we |
| | | // need client side authentication. |
| | | boolean weDontKnowIfWeNeedKeystore = |
| | | !(secureArgsList.keyStorePathArg.isPresent() |
| | | || secureArgsList.keyStorePasswordArg.isPresent() |
| | | || secureArgsList.keyStorePasswordFileArg.isPresent() || secureArgsList.certNicknameArg |
| | | .isPresent()); |
| | | !secureArgsList.keyStorePathArg.isPresent() |
| | | && !secureArgsList.keyStorePasswordArg.isPresent() |
| | | && !secureArgsList.keyStorePasswordFileArg.isPresent() |
| | | && !secureArgsList.certNicknameArg.isPresent(); |
| | | |
| | | // We don't have specific key manager parameter. |
| | | // We assume that no client side authentication is required |
| | |
| | | // through the set of modifications to see if a password is included in the |
| | | // changes. If so, then add the appropriate state changes to the set of |
| | | // modifications. |
| | | if (! (isInternalOperation() || isSynchronizationOperation())) |
| | | if (!isInternalOperation() && !isSynchronizationOperation()) |
| | | { |
| | | for (Modification m : modifications) |
| | | { |
| | |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, errorMsg.get(entryDN)); |
| | | |
| | | case INTERNAL_ONLY: |
| | | if (!(op.isInternalOperation() || op.isSynchronizationOperation())) |
| | | if (!op.isInternalOperation() && !op.isSynchronizationOperation()) |
| | | { |
| | | throw new DirectoryException(ResultCode.UNWILLING_TO_PERFORM, errorMsg.get(entryDN)); |
| | | } |