/* Returns true if the message could be rendered.
480690
private boolean
toWire(DNSOutput out, int maxLength) {
	if (maxLength < Header.LENGTH)
		return false;

	Header newheader = null;

	int tempMaxLength = maxLength;
	if (tsigkey != null)
		tempMaxLength -= tsigkey.recordLength();

	OPTRecord opt = getOPT();
	byte [] optBytes = null;
        if (opt != null) {
		optBytes = opt.toWire(Section.ADDITIONAL);
		tempMaxLength -= optBytes.length;
	}

	int startpos = out.current();
	header.toWire(out);
	Compression c = new Compression();
	int flags = header.getFlagsByte();
	int additionalCount = 0;
	for (int i = 0; i < 4; i++) {
		int skipped;
		if (sections[i] == null)
			continue;
		skipped = sectionToWire(out, i, c, tempMaxLength);
		if (skipped != 0 && i != Section.ADDITIONAL) {
			flags = Header.setFlag(flags, Flags.TC, true);
			out.writeU16At(header.getCount(i) - skipped,
				       startpos + 4 + 2 * i);
			for (int j = i + 1; j < Section.ADDITIONAL; j++)
				out.writeU16At(0, startpos + 4 + 2 * j);
			break;
		}
		if (i == Section.ADDITIONAL)
			additionalCount = header.getCount(i) - skipped;
	}

	if (optBytes != null) {
		out.writeByteArray(optBytes);
		additionalCount++;
	}

	if (flags != header.getFlagsByte())
		out.writeU16At(flags, startpos + 2);

	if (additionalCount != header.getCount(Section.ADDITIONAL))
		out.writeU16At(additionalCount, startpos + 10);

	if (tsigkey != null) {
		TSIGRecord tsigrec = tsigkey.generate(this, out.toByteArray(),
						      tsigerror, querytsig);

		tsigrec.toWire(out, Section.ADDITIONAL, c);
		out.writeU16At(additionalCount + 1, startpos + 10);
	}

	return true;
}
775143
@Override
	public boolean isServerExpandable(HttpServletRequest request, String mid) {
		int idx = mid.indexOf("!"); //$NON-NLS-1$
		String plugin = idx != -1 ? mid.substring(0, idx) : null;
		String name = idx != -1 ? mid.substring(idx+1) : mid;
		if (name.startsWith("/") || urlId.matcher(name).find() || name.contains("?")) { //$NON-NLS-1$ //$NON-NLS-2$
			return false;
		}
		if (plugin != null) {
			IAggregator aggr = (IAggregator)request.getAttribute(IAggregator.AGGREGATOR_REQATTRNAME);
			if (!aggr.getConfig().getTextPluginDelegators().contains(plugin) &&
					!aggr.getConfig().getJsPluginDelegators().contains(plugin)) {
				return false;
			}
		}
		return true;
	}
230417
function(value, options) {
      options = v.extend({}, this.options, options);
      if (options.allowEmpty !== false ? !v.isDefined(value) : v.isEmpty(value)) {
        return options.message || this.message || "can't be blank";
      }
    }
446991
function checkMsg(msg, protos){
    if(!protos){
      return false;
    }

    for(var name in protos){
      var proto = protos[name];

      //All required element must exist
      switch(proto.option){
        case 'required' :
          if(typeof(msg[name]) === 'undefined'){
            return false;
          }
        case 'optional' :
          if(typeof(msg[name]) !== 'undefined'){
            if(!!protos.__messages[proto.type]){
              checkMsg(msg[name], protos.__messages[proto.type]);
            }
          }
        break;
        case 'repeated' :
          //Check nest message in repeated elements
          if(!!msg[name] && !!protos.__messages[proto.type]){
            for(var i = 0; i < msg[name].length; i++){
              if(!checkMsg(msg[name][i], protos.__messages[proto.type])){
                return false;
              }
            }
          }
        break;
      }
    }

    return true;
  }
913726
private boolean isImmediatelySendable(final AbstractBody msg) {
        assertLocked();

        if (cmParams == null) {
            // block if we're waiting for a response to our first request
            return exchanges.isEmpty();
        }

        AttrRequests requests = cmParams.getRequests();
        if (requests == null) {
            return true;
        }
        int maxRequests = requests.intValue();
        if (exchanges.size() < maxRequests) {
            return true;
        }
        if (exchanges.size() == maxRequests
                && (isTermination(msg) || isPause(msg))) {
            // One additional terminate or pause message is allowed
            return true;
        }
        return false;
    }
124587
function (msg) {
		var i = this.msgs.length;

		this.msgs.push('ERROR: ' + msg);
		if ((i + 1) !== this.msgs.length) {
			return false;
		}
		return true;
	}
598151
function isErrorMessage(message) {
	const level = message.fatal ? 2 : message.severity;

	if (Array.isArray(level)) {
		return level[0] > 1;
	}

	return level > 1;
}
1021670
public boolean canReach(final String cluterName, final KeyedMessageWithType message) {
        final ApplicationState cur = outbounds.get();
        if(cur == null)
            return false;
        return cur.canReach(cluterName, message);
    }
992779
public boolean displayMessage (ChatMessage msg, boolean alreadyDisplayed)
    {
        // see if we're full, and if so, clear out a bunch of old stuff
        int adjusted;
        if (size() == MAX_HISTORY) {
            removeRange(0, PRUNE_HISTORY);
            adjusted = PRUNE_HISTORY;

        } else {
            adjusted = 0;
        }

        // add the message to the history
        add(msg);

        // notify observers that something changed
        notify(adjusted);

        return true;
    }
137518
public RequestContext renderMsg(final String msg) {
        if (renderer instanceof JsonRenderer) {
            final JsonRenderer r = (JsonRenderer) renderer;

            final JSONObject ret = r.getJSONObject();
            ret.put(Keys.MSG, msg);
        }

        return this;
    }
379359
private function isForeachProcessPossible(Message $message, MessageHandler $messageHandler)
    {
        if ($message->processingType()->typeDescription()->nativeType() !== NativeType::COLLECTION) {
            return false;
        }

        $itemMessage = Message::emulateProcessingWorkflowMessage(
            $message->messageType(),
            $message->processingType()->typeProperties()['item']->typePrototype(),
            $message->processingMetadata()
        );

        return $messageHandler->canHandleMessage($itemMessage);
    }
990371
public boolean isStandardFont() {
		return (family == UNDEFINED && size == UNDEFINED && style == UNDEFINED
				&& color == null && baseFont == null);
	}
1236009
public boolean isApiMessage() {
        MessageType mType = getJsMessageType();
        return (mType == MessageType.JMS || mType == MessageType.SDO);
    }
396836
@Override
    public boolean canRead(@Nonnull MediaType mimeType, Class<?> resultType) {
        MediaType type = mimeType.withoutParameters();
        return (type.is(MediaType.ANY_TEXT_TYPE) || MediaType.APPLICATION_XML_UTF_8.withoutParameters().is(type)
                || MediaType.JSON_UTF_8.withoutParameters().is(type)) && String.class.equals(resultType);
    }
435165
public static boolean isTransferEncodingChunked(HttpMessage message) {
        return message.headers().contains(HttpHeaderNames.TRANSFER_ENCODING, HttpHeaderValues.CHUNKED, true);
    }
554359
private static boolean isDataMessage(final ByteBuf msg) {
    return DcpMutationMessage.is(msg) || DcpDeletionMessage.is(msg) || DcpExpirationMessage.is(msg);
  }
713874
boolean containsMessages(final Level level) {
        if (level == null) {
            throw new NullPointerException("Level can't be null");
        }

        return !this.messages.get(level).isEmpty();
    }