Java 8 InputMismatchException - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 InputMismatchException class.

This code example shows how to use the following methods:
	 */ 
	public String getHeaderText() throws InputMismatchException {
		if (headerType == getViewType()) {
			return headers.get(position);
		} else { 
			throw new InputMismatchException("This item is not a header...");
		} 
	} 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
    /** 
     * @tests serialization/deserialization. 
     */ 
    public void testSerializationSelf() throws Exception { 
 
        SerializationTest.verifySelf(new InputMismatchException(ERROR_MESSAGE));
    } 
 
    /** 
     * @tests serialization/deserialization compatibility with RI. 
     */ 
    public void testSerializationCompatibility() throws Exception { 
 
        SerializationTest.verifyGolden(this, new InputMismatchException(
                ERROR_MESSAGE));
    } 
} 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
    } else { 
      String next = scanner.next();
      if ("null".equals(next)) {
        return null; 
      } else { 
        throw new InputMismatchException();
      } 
    } 
  } 
   
  @Override 
  public String serialize() {
    return "4 " + SerializationUtils.serializeString(classFile) + " " + offset + " " + length + " " + SerializationUtils.serializeString(path);
  } 
} 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
	        this.stream = stream;
	    } 
	  
	    public int read() { 
	        if (numChars == -1)
	            throw new InputMismatchException();
	        if (curChar >= numChars) {
	            curChar = 0;
	            try { 
	                numChars = stream.read(buf);
	            } catch (IOException e) {
	                throw new InputMismatchException();
	            } 
	            if (numChars <= 0)
	                return -1; 
	        } 
	        return buf[curChar++];
	    } 
	  
	    public int readInt() { 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
        if (actual.equals(expected))
            return; 
 
        String msg;
        msg = String.format("'%s' expected, '%s' got", expected, actual);
        throw new InputMismatchException(msg);
    } 
} 
3
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:
            return; 
        } 
        try { 
            System.out.println("Zadejte cislo portu:");
            port = sc.nextInt();
            if(port < 0 || port > 65535) throw new InputMismatchException();
            soket = new Socket(addr, port);
            sc.nextLine();
        } catch (InputMismatchException e) {
            System.out.println("Napis cislo portu a ne naky nesmysly!");
            return; 
        } 
        catch (ConnectException e) {
            System.out.println("Napis spravny cislo portu a ne naky nesmysly!");
            return; 
        } 
        catch (IOException e) {
            System.out.println("Nejaky problem s IO.");
            return; 
        } 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Java 8 InputMismatchException Methods: