/* Returns true if the message could be rendered.
971589
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();

	int startpos = out.current();
	header.toWire(out);
	Compression c = new Compression();
	for (int i = 0; i < 4; i++) {
		int skipped;
		if (sections[i] == null)
			continue;
		skipped = sectionToWire(out, i, c, tempMaxLength);
		if (skipped != 0) {
			if (newheader == null)
				newheader = (Header) header.clone();
			if (i != Section.ADDITIONAL)
				newheader.setFlag(Flags.TC);
			int count = newheader.getCount(i);
			newheader.setCount(i, count - skipped);
			for (int j = i + 1; j < 4; j++)
				newheader.setCount(j, 0);

			out.save();
			out.jump(startpos);
			newheader.toWire(out);
			out.restore();
			break;
		}
	}

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

		if (newheader == null)
			newheader = (Header) header.clone();
		tsigrec.toWire(out, Section.ADDITIONAL, c);
		newheader.incCount(Section.ADDITIONAL);

		out.save();
		out.jump(startpos);
		newheader.toWire(out);
		out.restore();
	}

	return true;
}
1236009
public boolean isApiMessage() {
        MessageType mType = getJsMessageType();
        return (mType == MessageType.JMS || mType == MessageType.SDO);
    }
716741
protected function canAccess()
    {
        if ($this->formRequest->user()->isAdmin() || $this->formRequest->user()->isUser()) {
            return true;
        }

        return $this->formRequest->user()->canDo('message.message.view');
    }
263559
public boolean isSendRemoteMessage(BaseMessage message)
    {
        Iterator<BaseMessageFilter> iterator = this.getMessageFilterList().getFilterList(null);    // ALL The filters (not just matches).
        while (iterator.hasNext())
        {
            BaseMessageFilter filter = iterator.next();
            if (!filter.isRemoteFilter())   // Always send down when filter is a remote copy
                if (filter.isSendRemoteMessage(message) == false)
                    return false;      // Don't send this message down
        }
        return true;
    }
704455
public boolean isValidAndEnabled() {

        return (getMode() != null)
            && (getMode() != Mode.disabled)
            && (getPort() > -1)
            && !CmsStringUtil.isEmptyOrWhitespaceOnly(getCertConfigPath())
            && !CmsStringUtil.isEmptyOrWhitespaceOnly(getHost());
    }
1049558
function isSubpixelRenderingSupported() {
        // Test if subpixel rendering is supported
        // @NOTE: jQuery.support.leadingWhitespace is apparently false if browser is IE6-8
        if (!$.support.leadingWhitespace) {
            return false;
        } else {
            //span #1 - desired font-size: 12.5px
            var span = $(util.template(TEST_SPAN_TEMPLATE, { size: 12.5 }))
                .appendTo(document.documentElement).get(0);
            var fontsize1 = $(span).css('font-size');
            var width1 = $(span).width();
            $(span).remove();

            //span #2 - desired font-size: 12.6px
            span = $(util.template(TEST_SPAN_TEMPLATE, { size: 12.6 }))
                .appendTo(document.documentElement).get(0);
            var fontsize2 = $(span).css('font-size');
            var width2 = $(span).width();
            $(span).remove();

            // is not mobile device?
            // @NOTE(plai): Mobile WebKit supports subpixel rendering even though the browser fails the following tests.
            // @NOTE(plai): When modifying these tests, make sure that these tests will work even when the browser zoom is changed.
            // @TODO(plai): Find a better way of testing for mobile Safari.
            if (!('ontouchstart' in window)) {

                //font sizes are the same? (Chrome and Safari will fail this)
                if (fontsize1 === fontsize2) {
                    return false;
                }

                //widths are the same? (Firefox on Windows without GPU will fail this)
                if (width1 === width2) {
                    return false;
                }
            }
        }

        return true;
    }
851706
protected boolean report(IsMessageSet messageSet){
		if(messageSet==null){
			return false;
		}

		E_MessageType type = null;
		if(messageSet.isErrorSet()){
			type = E_MessageType.ERROR;
		}
		else if(messageSet.isWarningSet()){
			type = E_MessageType.WARNING;
		}
		else if(messageSet.isInfoSet()){
			type = E_MessageType.INFO;
		}
		else{
			return false;
		}
		if(!this.messageHandlers.containsKey(type)){
			return false;
		}
		MessageTypeHandler handler = this.messageHandlers.get(type);

		String template = messageSet.render();
		handler.handleMessage(template, type, this.max100stg.getInstanceOf("max"), this.appID);
		this.messages.put(template, type);
		return true;
	}
658175
public static void renderUnhandledFacesMessages(FacesContext facesContext)
            throws IOException
    {
        // create and configure HtmlMessages component
        HtmlMessages messages = (HtmlMessages) facesContext.getApplication()
                .createComponent(HtmlMessages.COMPONENT_TYPE);
        messages.setId("javax_faces_developmentstage_messages");
        messages.setTitle("Project Stage[Development]: Unhandled Messages");
        messages.setStyle("color:orange");
        messages.setRedisplay(false);
        // render the component
        messages.encodeAll(facesContext);
    }
1239358
public function isRenderable()
    {
        $intro = $this->getIntro();
        $result = true;
        if($this->countCancel >= $intro->getMaxCancelLimit()){
            $result = false;
        }
        if($this->countShow >= $intro->getMaxShowLimit()){
            $result = false;
        }
        return $result;
    }
1337694
@Override
    public boolean canRender(final String userName, final String fname) {
        if (userName == null || fname == null) {
            return false;
        }

        final IAuthorizationPrincipal userPrincipal = this.getUserPrincipal(userName);
        if (userPrincipal == null) {
            return false;
        }

        final String portletId;
        try {
            final IPortletDefinition portletDefinition =
                    this.portletDefinitionRegistry.getPortletDefinitionByFname(fname);
            if (portletDefinition == null) {
                if (this.logger.isInfoEnabled()) {
                    this.logger.info(
                            "No PortletDefinition for fname='" + fname + "', returning false.");
                }

                return false;
            }

            portletId = portletDefinition.getPortletDefinitionId().getStringId();
        } catch (Exception e) {
            this.logger.warn(
                    "Could not find PortletDefinition for fname='"
                            + fname
                            + "' while checking if user '"
                            + userName
                            + "' can render it. Returning FALSE.",
                    e);
            return false;
        }

        return userPrincipal.canRender(portletId);
    }
1306840
@Override
    public boolean canRead(@Nonnull MediaType mimeType, Type 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(TypeToken.of(resultType).getRawType());
    }
230310
public boolean error(String msg) {
    output(getColorBuffer().red(msg), true, errorStream);
    return false;
  }
1002421
function verify(postedMessage) {
		if (
			// Check incoming message is valid
			typeof postedMessage === 'object' &&
			typeof postedMessage.uuid === 'string' &&
			postedMessage._respondable === true
		) {
			var messageSource = _getSource();
			return (
				// Check the version matches
				postedMessage._source === messageSource ||
				// Allow free communication with axe test
				postedMessage._source === 'axeAPI.x.y.z' ||
				messageSource === 'axeAPI.x.y.z'
			);
		}
		return false;
	}
181607
def _TryPrintAsAnyMessage(self, message):
    """"""
    packed_message = _BuildMessageFromTypeName(message.TypeName(),
                                               self.descriptor_pool)
    if packed_message:
      packed_message.MergeFromString(message.value)
      self.out.write('%s[%s]' % (self.indent * ' ', message.type_url))
      self._PrintMessageFieldValue(packed_message)
      self.out.write(' ' if self.as_one_line else '\n')
      return True
    else:
      return False
910580
public boolean hasMessageOf(String property, String messageKey) {
        assertArgumentNotNull("property", property);
        assertArgumentNotNull("messageKey", messageKey);
        final UserMessageItem item = getPropertyItem(property);
        return item != null && item.getMessageList().stream().anyMatch(message -> {
            final String myKey = resolveMessageKey(messageKey);
            if (message.isResource()) {
                if (myKey.equals(resolveMessageKey(message.getMessageKey()))) {
                    return true;
                }
            } else { // direct message
                if (message.getValidatorMessageKey().filter(vlkey -> resolveMessageKey(vlkey).equals(myKey)).isPresent()) {
                    return true;
                }
            }
            return false;
        });
    }
840616
@Override
	public boolean hasNext() {

		validateState();

		if (!delegate.hasNext() && !isFinished()) {
			load(getCursorMark());
		}

		if (delegate.hasNext()) {
			return true;
		}

		return false;
	}
293555
private boolean checkForH2MagicString(HttpInboundServiceContextImpl isc) {

        boolean hasMagicString = false;
        WsByteBuffer buffer;

        if (myTSC == null || myTSC.getReadInterface() == null ||
            (buffer = myTSC.getReadInterface().getBuffer()) == null) {
            return hasMagicString;
        }

        // read the buffer, flip it, and if there is a backing array pull that out
        buffer = buffer.duplicate();
        buffer.flip();
        byte[] bufferArray = null;
        if (buffer.hasArray()) {
            bufferArray = buffer.array();
        }

        // return true if the read buffer starts with the magic string
        if (bufferArray != null && bufferArray.length >= 24) {
            String bufferString = new String(bufferArray, 0, 24);
            if (bufferString.startsWith(HttpConstants.HTTP2PrefaceString)) {
                hasMagicString = true;
            }
        }
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
            Tr.exit(tc, "checkForH2MagicString: returning " + hasMagicString);
        }
        buffer.release();
        return hasMagicString;
    }