Gets the assertion.

@param message the message
@return the assertion
@throws SAXException the sAX exception
@throws IOException Signals that an I/O exception has occurred.
@throws ParserConfigurationException the parser configuration exception
548064
public static AssertionInfo getAssertion(Message message)
            throws SAXException, IOException, ParserConfigurationException {
        AssertionInfoMap aim = message.get(AssertionInfoMap.class);

        if (aim != null) {
            Collection<AssertionInfo> ais = aim
                    .get(TransformationPolicyBuilder.TRANSFORMATION);

            if (ais == null) {
                return null;
            }

            for (AssertionInfo ai : ais) {
                if (ai.getAssertion() instanceof TransformationAssertion) {
                    return ai;
                }
            }
        }

        return null;
    }
62826
public SAXParser newSAXParser() throws ParserConfigurationException, SAXException
    {
        if(isValidating()) {
            try {
                  return new ValidatingSAXParser(
                      _WrappedFactory.newSAXParser(),
                      _Schema.newVerifier());
             } catch(VerifierConfigurationException ex) {
                 throw new ParserConfigurationException(ex.getMessage());
             }
        } else
            return _WrappedFactory.newSAXParser();
    }
678436
function AssertionException(type, message, id) {
        var _this = _super.call(this, message) || this;
        _this.type = type;
        _this.id = id;
        if (Error.captureStackTrace) {
            Error.captureStackTrace(_this, _this.constructor);
        }
        return _this;
    }
1070915
public Result check(IMessage message) {
    if (message == null) {
      throw new IllegalArgumentException("Message is null");
    }
    if (!enable) {
      return SUCCESS;
    }
    // todo
    return null;
  }
579531
@SuppressWarnings("static-method")
	protected int getIssueAdornment(XtendMember element) {
		final ICompositeNode node = NodeModelUtils.getNode(element);
		if (node == null) {
			return 0;
		}
		// Error markers are more important than warning markers.
		// Order of checks:
		// - parser error (from the resource) or semantic error (from Diagnostician)
		// - parser warning or semantic warning
		final Resource resource = element.eResource();
		if (!resource.getURI().isArchive()) {
			if (hasParserIssue(node, resource.getErrors())) {
				return JavaElementImageDescriptor.ERROR;
			}
			final Diagnostic diagnostic = Diagnostician.INSTANCE.validate(element);
	        switch (diagnostic.getSeverity()) {
	        case Diagnostic.ERROR:
	        	return JavaElementImageDescriptor.ERROR;
	        case Diagnostic.WARNING:
	        	return JavaElementImageDescriptor.WARNING;
	        default:
	        }
			if (hasParserIssue(node, resource.getWarnings())) {
				return JavaElementImageDescriptor.WARNING;
			}
		}
		return 0;
	}
95747
public String getXML()
    {
        Object root = null;
        if (m_message != null)
            root = m_message.getRawData();
        if (root != null)
        {
            try {
                ByteArrayOutputStream out = new ByteArrayOutputStream();
                String packageName = (String)((TrxMessageHeader)this.getMessage().getMessageHeader()).get(SOAPMessageTransport.JIBX_PACKAGE_NAME);
                String bindingName = (String)((TrxMessageHeader)this.getMessage().getMessageHeader()).get(SOAPMessageTransport.JIBX_BINDING_NAME);
                if (packageName == null)
                {
                	packageName = root.getClass().getName();
                	packageName = packageName.substring(0, packageName.lastIndexOf('.'));
                	((TrxMessageHeader)this.getMessage().getMessageHeader()).put(SOAPMessageTransport.JIBX_PACKAGE_NAME, packageName);
                }
    
                IMarshallingContext m = JibxContexts.getJIBXContexts().getMarshaller(packageName, bindingName);
                if (m == null)
                    return null;
                synchronized(m)
                {   // Since the marshaller is shared (may want to tweek this for multi-cpu implementations)
                	m.marshalDocument(root, DBConstants.URL_ENCODING, null, out);
                }
                String strXML = out.toString(Constants.STRING_ENCODING);
                return strXML;
            } catch (IOException ex)  {
                ex.printStackTrace();   // Never
            } catch (JiBXException ex)   {
                ex.printStackTrace();
            } catch (java.lang.IllegalArgumentException ex)   {
                ex.printStackTrace();
            }
        }
        return null;
    }
156083
public void assertion(boolean b, java.lang.String msg)
  {

    if (!b)
    {
      java.lang.String fMsg = XSLMessages.createXPATHMessage(
        XPATHErrorResources.ER_INCORRECT_PROGRAMMER_ASSERTION,
        new Object[]{ msg });

      throw new RuntimeException(fMsg);
    }
  }
816941
@Override
    public void error(SAXParseException exception) throws SAXException {
        logger.warn("Error on line " + exception.getLineNumber() + ": "
                + exception.getMessage() + " ... "
                + "Policy will not be available");

        throw new SAXException("error parsing policy");
    }
1170912
public void verifyMessage(String message, String signatureBase64) throws SignatureException {
        ECKey key = ECKey.signedMessageToKey(message, signatureBase64);
        if (!key.pub.equals(pub))
            throw new SignatureException("Signature did not match for message");
    }
574730
public Document parse(InputSource inputsource) throws SAXException, IOException
    {
        return verify(_WrappedBuilder.parse(inputsource));
    }
174697
public static PushNotificationPayload alert(String message) {
		if (message == null) throw new IllegalArgumentException("Alert cannot be null");
		PushNotificationPayload payload = complex();
		try {
			payload.addAlert(message);
		} catch (JSONException e) {
		}
		return payload;
	}
1162824
public static OrtcMessage parseMessage(String message) throws IOException {
        OrtcOperation operation = null;
        String JSONMessage = null;
        String parsedMessage = null;
        String filteredByServer = null;
        String seqId = null;
        String messageChannel = null;
        String messageId = null;
        int messagePart = -1;
        int messageTotalParts = -1;

        Matcher matcher = operationPattern.matcher(message);

        if (matcher != null && !matcher.matches()) {
            //matcher = receivedPattern.matcher(message.replace("\\\"", "\""));
			matcher = JSONPattern.matcher(message);

            if ((matcher != null && matcher.matches())) {
                try{
                    operation = OrtcOperation.Received;
                    JSONMessage = matcher.group(1).replace("\\\\", "\\").replace("\\\"","\"");
                    org.json.JSONObject json = new org.json.JSONObject(JSONMessage);

                    parsedMessage = (String)json.get("m");
                    messageChannel = (String)json.get("ch");

                    if (json.has("f"))
                        filteredByServer = (String)json.get("f");

                    if (json.has("s"))
                        seqId = (String)json.get("s");


                    //parsedMessage = parsedMessage.replace("\\\\n", "\n").replace("\\\"", "\"").replace("\\\\\\\\", "\\");

                    Matcher multiPartMatcher = parseMultiPartMessage(parsedMessage);

                    if (multiPartMatcher.matches()) {
                        parsedMessage = multiPartMatcher.group(4);
                        messageId = multiPartMatcher.group(1);
                        messagePart = Strings.isNullOrEmpty(multiPartMatcher.group(2)) ? -1 : Integer.parseInt(multiPartMatcher.group(2));
                        messageTotalParts = Strings.isNullOrEmpty(multiPartMatcher.group(3)) ? -1 : Integer.parseInt(multiPartMatcher.group(3));
                    }
                }catch(NumberFormatException parseException){
                    //throw new NumberFormatException("Invalid message format: " + message + " - Error " + parseException.toString());
                    parsedMessage = matcher.group(1);
                    messageId = null;
                    messagePart = -1;
                    messageTotalParts = -1;
                } catch (JSONException e) {
                    parsedMessage = matcher.group(1);
                    messageId = null;
                    messagePart = -1;
                    messageTotalParts = -1;
                }
            } else {
                matcher = closePattern.matcher(message);
                if (matcher != null && matcher.matches()){
                    operation = OrtcOperation.Close;
                } else {
                    throw new IOException(String.format("Invalid message format: %s", message));
                }
            }
        // CAUSE: Possible null pointer dereference
        } else {
            operation = operationIndex.get(matcher.group(1));
            parsedMessage = matcher.group(2);
        }

        return new OrtcMessage(operation, parsedMessage, messageChannel, messageId, messagePart, messageTotalParts, Boolean.valueOf(filteredByServer), seqId);
    }
1058743
public static List<Audit> findByMessage(EntityManager em, String message) {
        requireArgument(em != null, "Entity manager cannot be null.");
        requireArgument(message != null && !message.isEmpty(), "Message cannot be null or empty.");

        TypedQuery<Audit> query = em.createNamedQuery("Audit.findByMessage", Audit.class);

        try {
            query.setParameter("message", "%" + message + "%");
            return query.getResultList();
        } catch (Exception ex) {
            return new ArrayList<Audit>(0);
        }
    }
107812
protected Element marshallMessage(XMLObject message) throws MessageEncodingException {
        log.debug("Marshalling message");

        try {
            return XMLObjectSupport.marshall(message);
        } catch (MarshallingException e) {
            throw new MessageEncodingException("Error marshalling message", e);
        }
    }
244989
public boolean matches( Message message ) throws JMSException
    {
        Boolean result = selectorTree != null ? selectorTree.evaluateBoolean(message) : null;
        return result != null && result.booleanValue();
    }
107619
public static XMLStreamException createXMLStreamException(
            final String message,
            final XMLStreamReader reader,
            final Throwable cause) {
        final XMLStreamException exception = new XMLStreamException(message, reader.getLocation(), null);
        exception.initCause(cause);
        return exception;
    }
553206
public byte[] sign(byte[] message) {
		try {
			// this way signatureInstance should be thread safe
			final Signature signatureInstance = ((provider == null) || (provider.length() == 0)) ? Signature
					.getInstance(algorithm) : Signature.getInstance(algorithm, provider);
			signatureInstance.initSign(privateKey);
			signatureInstance.update(message);
			return signatureInstance.sign();
		} catch (Exception e) {
			throw new SignatureException("error generating the signature: algorithm=" + algorithm, e);
		}
	}