Code example for Logger

Methods: fine, warning

0
            if (!matcher.find() || matcher.groupCount() != 1)
                return null; 
        } 
 
        String missingNS = matcher.group(1);
        log.warning("Fixing missing namespace declaration for: " + missingNS);
 
        // Extract <root> attributes 
        pattern = Pattern.compile("<root([^>]*)");
        matcher = pattern.matcher(descriptorXml);
        if (!matcher.find() || matcher.groupCount() != 1) {
            log.fine("Could not find <root> element attributes");
            return null; 
        } 
 
        String rootAttributes = matcher.group(1);
        log.fine("Preserving existing <root> element attributes/namespace declarations: " + matcher.group(0));
 
        // Extract <root> body 
        pattern = Pattern.compile("<root[^>]*>(.*)</root>", Pattern.DOTALL);
        matcher = pattern.matcher(descriptorXml);
        if (!matcher.find() || matcher.groupCount() != 1) {
            log.fine("Could not extract body of <root> element");
            return null; 
        } 
 
        String rootBody = matcher.group(1);