Attempts to parse the item type string.
@param s The string to parse.
@param checkBlocks if string can't be parsed as an item, attempt to parse as a block, if checkBlocks is true
@return The item type, or null if the string is not recognised.
19929
public static Item ParseItemType( String s, boolean checkBlocks )
    {
        if (s == null)
            return null;
        Item item = (Item)Item.REGISTRY.getObject(new ResourceLocation(s)); // Minecraft returns null when it doesn't recognise the string
        if (item == null && checkBlocks)
        {
            // Maybe this is a request for a block item?
            IBlockState block = MinecraftTypeHelper.ParseBlockType(s);
            item = (block != null && block.getBlock() != null) ? Item.getItemFromBlock(block.getBlock()) : null;
        }
        return item;
    }
489338
def _parse_block(self, block, node):
        '''
        
        '''
        assert block[self.get_key()] == 'Block'

        if self.is_compact_ast:
            statements = block['statements']
        else:
            statements = block[self.get_children('children')]

        for statement in statements:
            node = self._parse_statement(statement, node)
        return node
1146989
private static String readString(DataInput reader) throws IOException {
		int blocks = reader.readInt();
		String result;
		if (blocks == 0) {
			result = null;
		} else if (blocks < 0) {
			throw new DeserializerException("Wrong 'null' indicator for a string", "0", Integer.toString(blocks));
		} else {
			StringBuilder sb = new StringBuilder();
			for (int i=0; i<blocks; i++) {
				sb.append(reader.readUTF());
			}
			result = sb.toString();
		}
		return result;
	}
609190
private static ContentType parse(final String contentTypeString) {

		try {

			return new ContentType(contentTypeString);

		} catch (ParseException pe) {

			logger.warn("Could not parse " + contentTypeString, pe);

		}

		return null;
	}
728673
public static String[][] parse(String s) throws IOException {
        if (s == null) {
            throw new IllegalArgumentException("Null argument not allowed.");
        }
        String[][] result = (new CSVParser(new StringReader(s), CSVStrategy.DEFAULT_STRATEGY)).getAllValues();
        if (result == null) {
            // since CSVStrategy ignores empty lines an empty array is returned
            // (i.e. not "result = new String[][] {{""}};")
            result = EMPTY_DOUBLE_STRING_ARRAY;
        }
        return result;
    }
995446
public final boolean isDatatype( DdlTokenStream tokens ) throws ParsingException {
        // Loop through the registered statement start string arrays and look for exact matches.

        for (String[] stmts : basicCharStringTypes) {
            if (tokens.matches(stmts)) return true;
        }

        for (String[] stmts : basicNationalCharStringTypes) {
            if (tokens.matches(stmts)) return true;
        }

        for (String[] stmts : basicBitStringTypes) {
            if (tokens.matches(stmts)) return true;
        }

        for (String[] stmts : basicExactNumericTypes) {
            if (tokens.matches(stmts)) return true;
        }

        for (String[] stmts : basicApproxNumericStringTypes) {
            if (tokens.matches(stmts)) return true;
        }

        for (String[] stmts : basicDateTimeTypes) {
            if (tokens.matches(stmts)) return true;
        }

        for (String[] stmts : basicMiscTypes) {
            if (tokens.matches(stmts)) return true;
        }

        // If no type is found, assume it's a custom type
        return isCustomDataType(tokens);
    }
1087569
public static byte[] decode(String s) {
        if (s == null) {
            throw new NullPointerException("Input string was null.");
        }

        byte[] bytes = s.getBytes(UTF_8);
        return decode(bytes, 0, bytes.length);
    }
1288005
public <T> T read(final String s, final DataTypeDescriptor<T> descriptor)
			throws Exception {
		if (descriptor == null) throw new NullPointerException("descriptor");
		if (s == null) return null;

		JsonParser parser = factory.createParser(s);
		return read(parser, descriptor);
	}
755536
public static boolean isValidJson(String s) {
		try {
			new JSONParser(DEFAULT_PERMISSIVE_MODE).parse(s, FakeMapper.DEFAULT);
			return true;
		} catch (ParseException e) {
			return false;
		}
	}
391951
public boolean isValidBlock(int namespaceId, Block b, boolean checkSize)
      throws IOException {
    File f = null;
    ;
    try {
      f = getValidateBlockFile(namespaceId, b, checkSize);
    } catch (IOException e) {
      DataNode.LOG.warn("Block " + b + " is not valid:", e);
    }

    return ((f != null) ? isBlockFinalizedWithLock(namespaceId, b) : false);
  }
394473
private boolean validParameter(final String s) {
        final String[] tokens = PARAMS_REGEX.split(s);
        if (tokens.length != 2) {
            return false;
        }

        final char first = s.charAt(0);
        String second = tokens[1];
        if (second.endsWith(VARARGS_SUFFIX)) {
            // value encoding / return type var args, mangle argument
            second = varargsRoot(second);
        }

        if (first == 'E') {
            if (isWildcard(second)) {
                return true;
            }

            // Verify value encoding exists as an enum
            if (getValueEncoding(second) != null) {
                return true;
            }

            // Fallback to verification based on all character discriminators
            for (final Character c : second.toCharArray()) {
                if (getValueEncoding(c) == null) {
                    return false;
                }
            }
            return true;
        } else if (first == 'F') {
            // Verify return type exists as an enum
            if (ReturnType.getReturnType(second) != null) {
                return true;
            }
        }
        return false;
    }
769387
public RootNode parseInternal(StringBuilderVar block) {
        char[] chars = block.getChars();
        int[] ixMap = new int[chars.length + 1]; // map of cleaned indices to original indices
        
        // strip out CROSSED_OUT characters and build index map
        StringBuilder clean = new StringBuilder();
        for (int i = 0; i < chars.length; i++) {
            char c = chars[i];
            if (c != CROSSED_OUT) {
                ixMap[clean.length()] = i;
                clean.append(c);
            }
        }
        ixMap[clean.length()] = chars.length;
        
        // run inner parse
        char[] cleaned = new char[clean.length()];
        clean.getChars(0, cleaned.length, cleaned, 0);
        RootNode rootNode = parseInternal(cleaned);
        
        // correct AST indices with index map
        fixIndices(rootNode, ixMap);
        
        return rootNode;
    }
692843
public static boolean isJavaLangType(String s) {
		return getJavaDefaultTypes().contains(s) && Character.isUpperCase(s.charAt(0));
	}
1011324
private AbsFilter parseItemType() {

        AbsFilter filter;
        if (isKindTest()) {
            filter = parseKindTest();
        } else if (is("item", true)) {
            consume(TokenType.OPEN_BR, true);
            consume(TokenType.CLOSE_BR, true);

            filter = new ItemFilter(getTransaction());
        } else {
            final String atomic = parseAtomicType();
            filter = new TypeFilter(getTransaction(), atomic);
        }
        return filter;
    }
300196
private void readObject(java.io.ObjectInputStream s)
        throws java.io.IOException, ClassNotFoundException {
        s.defaultReadObject();

        // Read in elements until trailing null sentinel found
        Node<E> h = null, t = null;
        for (Object item; (item = s.readObject()) != null; ) {
            @SuppressWarnings("unchecked")
            Node<E> newNode = newNode((E) item);
            if (h == null)
                h = t = newNode;
            else {
                NEXT.set(t, newNode);
                PREV.set(newNode, t);
                t = newNode;
            }
        }
        initHeadTail(h, t);
    }
1314487
@Override
    public <I> MatchResult<I> matchResult(I item) {
        StringDescription mismatch = new StringDescription();
        if (matches(item, mismatch)) {
            return new MatchResultSuccess<>(item, this);
        } else {
            return new MatchResultMismatch<>(item, this, mismatch.toString());
        }
    }
875662
private int parseListItem (int start) {
        start = skipSpacesToNewline(start, wikiLength); // skip spaces
        int end=parseItem(start, null, ContextType.LIST_ITEM);
        if ((listLevels[listLevel]=='>' || listLevels[listLevel]==':') &&
            wikiText.substring(start, end).trim().length()==0) { // empty line within blockquote/div
            if (!blockquoteBR) {
                sb.append("<br/><br/>");
                blockquoteBR=true;
            }
        }
        else {
            blockquoteBR=false;
        }
        return end;
    }