Package com.google.caja

Examples of com.google.caja.SomethingWidgyHappenedError


  protected static String formatShort(FilePosition p) {
    StringBuilder sb = new StringBuilder();
    try {
      p.formatShort(sb);
    } catch (IOException ex) {
      throw new SomethingWidgyHappenedError(
          "IOException from StringBuilder", ex);
    }
    return sb.toString();
  }
View Full Code Here


          tok = "" + Math.abs(rnd.nextFloat());
          break;
        case LINE_CONTINUATION:
          continue;
        default:
          throw new SomethingWidgyHappenedError();
      }
      tokens.add(tok);
      last = tok;
    }
    while (";".equals(last)) {
View Full Code Here

  public int getPort() {
    int port = server.getConnectors()[0].getLocalPort();
    // Occasionally port is -1 after the server is started, not sure why yet.
    if (port < 0) {
      System.err.println("port=" + port);
      throw new SomethingWidgyHappenedError("port=" + port);
    }
    return port;
  }
View Full Code Here

  private static String decode(String mimeEncoded) {
    try {
      return URLDecoder.decode(mimeEncoded, "UTF-8");
    } catch (UnsupportedEncodingException ex) {
      throw new SomethingWidgyHappenedError(ex);
    }
  }
View Full Code Here

      return exec.run(actuals, Object.class);
    } catch (AbnormalExitException ex) {
      Throwable th = ex.getCause();
      if (th instanceof Error) { throw (Error) th; }
      if (th instanceof RuntimeException) { throw (RuntimeException) th; }
      throw new SomethingWidgyHappenedError(ex);
    }
  }
View Full Code Here

        if (resourcePath.startsWith("/")) {
          try {
            resource = new InputSource(
                RhinoTestBed.class.getResource(resourcePath).toURI());
          } catch (URISyntaxException ex) {
            throw new SomethingWidgyHappenedError(
                "java.net.URL is not a valid java.net.URI", ex);
          }
        } else {
          InputSource baseUri = Nodes.getFilePositionFor(html).source();
          resource = new InputSource(baseUri.getUri().resolve(resourcePath));
View Full Code Here

      for (ParseTreeNode c : children) {
        checkFilePositionInvariants(AncestorChain.instance(nChain, c));
      }
    } catch (RuntimeException ex) {
      throw new SomethingWidgyHappenedError(msg, ex);
    }
  }
View Full Code Here

      try {
        renderAsJSON(
            (String)null, (String)null, contentParams.b, mq, writer, false);
      } catch (IOException e) {
        // Unlikely IOException to byte array; rethrow
        throw new SomethingWidgyHappenedError(e);
      }
      result = FetchedData.fromBytes(
          intermediateResponse.toByteArray(),
          contentParams.a.mimeType,
          "UTF-8",
View Full Code Here

      writer.flush();
      return Pair.pair(contentParams.a.mimeType, Charsets.UTF_8.name());
    } catch (UnsupportedEncodingException ex) {
      return null;
    } catch (IOException ex) {
      throw new SomethingWidgyHappenedError(ex);
    }
  }
View Full Code Here

  public String toString() {
    StringBuilder sb = new StringBuilder();
    try {
      formatSelf(new MessageContext(), 0, sb);
    } catch (IOException ex) {
      throw new SomethingWidgyHappenedError(
          "StringBuilders shouldn't throw IOExceptions");
    }
    return sb.toString();
  }
View Full Code Here

TOP

Related Classes of com.google.caja.SomethingWidgyHappenedError

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.