Package java.util

Examples of java.util.InputMismatchException


    try{
      final Long altFlag = Long.parseLong(input);
      return altFlag;
    } catch (NumberFormatException e){}
    // TODO: This very exception type?
    throw new InputMismatchException();
  }
View Full Code Here


  @Override
  public void setInputUserFeatures(String path) {
    LOG.debug("path = " + path);
    String alreadySetPath = conf.get(OnlineCF.Settings.CONF_INPUT_PATH, null);
    if (alreadySetPath != null && !alreadySetPath.equals(path)) {
      throw new InputMismatchException("different input path given"
                                    + ", old: " + alreadySetPath
                                    + ", current:" + path);
    }
    conf.set(OnlineCF.Settings.CONF_INPUT_PATH, path);
  }
View Full Code Here

  @Override
  public void setInputItemFeatures(String path) {
    LOG.debug("path = " + path);
    String alreadySetPath = conf.get(OnlineCF.Settings.CONF_INPUT_PATH, null);
    if (alreadySetPath != null && !alreadySetPath.equals(path)) {
      throw new InputMismatchException("different input path given"
                                    + ", old: " + alreadySetPath
                                    + ", current:" + path);
    }
    conf.set(OnlineCF.Settings.CONF_INPUT_PATH, path);   
  }
View Full Code Here

   * @param args Simple key value json map
   */
  public static void main(String[] args) {
    try {
      if (args.length < 2) {
        throw new InputMismatchException("Need to provide action, " +
          "stack name and stack version.");
      }

      String action = args[0];
      String valueMap = args[1];
View Full Code Here

        final Scanner sc = new Scanner(System.in);
        final int initValue = sc.nextInt();

        /* test for range, if not in range throw exception!! */
        if (initValue < 2 || initValue > 1000000000)
                    { throw new InputMismatchException(); }

        /* Do we need to use MemoizedPlatinumBlock or PlatinumBlock?
         *  The 10,00,000 value was calculated by trying
         *  different values for max input.
         *  If there is at least 1000 values to fill the array, use MemoizedPlatinumBlock.
View Full Code Here

            DocumentBuilder builder = factory.newDocumentBuilder();
            builder.setErrorHandler(errHandler);
            doc = builder.parse(input);
        } catch (SAXParseException sxe) {
            System.err.println(sxe.getMessage() + ": " + String.valueOf(sxe.getLineNumber()));
            throw new InputMismatchException("XML Parsing failure during planning");
        } catch (SAXException sxe) {
            System.err.println(sxe.getMessage());
            throw new InputMismatchException("XML Parsing failure during planning");
        } catch (ParserConfigurationException e) {
            System.err.println(e.getMessage());
            throw new InputMismatchException("XML Parsing failure during planning");
        } catch (IOException e) {
            System.err.println(e.getMessage());
            throw new InputMismatchException("XML Parsing failure during planning");
        }

        if (doc == null) {
            System.err.println("Unexpected error parsing hsql parsed stmt xml");
            System.exit(-1);
View Full Code Here

    /**
     * @tests java.util.InputMismatchException#InputMismatchException()
     */
    @SuppressWarnings("cast")
    public void test_Constructor() {
        InputMismatchException exception = new InputMismatchException();
        assertNotNull(exception);
        assertTrue(exception instanceof NoSuchElementException);
        assertTrue(exception instanceof Serializable);
    }
View Full Code Here

    /**
     * @tests java.util.InputMismatchException#InputMismatchException(String)
     */
    public void test_ConstructorLjava_lang_String() {
        InputMismatchException exception = new InputMismatchException(
                ERROR_MESSAGE);
        assertNotNull(exception);
        assertEquals(ERROR_MESSAGE, exception.getMessage());
    }
View Full Code Here

    /**
     * @tests serialization/deserialization.
     */
    public void testSerializationSelf() throws Exception {

        SerializationTest.verifySelf(new InputMismatchException(ERROR_MESSAGE));
    }
View Full Code Here

    /**
     * @tests serialization/deserialization compatibility with RI.
     */
    public void testSerializationCompatibility() throws Exception {

        SerializationTest.verifyGolden(this, new InputMismatchException(
                ERROR_MESSAGE));
    }
View Full Code Here

TOP

Related Classes of java.util.InputMismatchException

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.