Search in sources :

Example 1 with ExtendedType

use of com.tagtraum.perf.gcviewer.model.AbstractGCEvent.ExtendedType in project GCViewer by chewiebug.

the class AbstractDataReaderSun method extractTypeFromParsedString.

protected ExtendedType extractTypeFromParsedString(String typeName) throws UnknownGcTypeException {
    ExtendedType extendedType = null;
    String lookupTypeName = typeName.endsWith("--") ? typeName.substring(0, typeName.length() - 2) : typeName;
    AbstractGCEvent.Type gcType = AbstractGCEvent.Type.lookup(lookupTypeName);
    // the gcType may be null because there was a PrintGCCause flag enabled - if so, reparse it with the first paren set stripped
    if (gcType == null) {
        // try to parse it again with the parens removed
        Matcher parenMatcher = parenthesesPattern.matcher(lookupTypeName);
        if (parenMatcher.find()) {
            gcType = AbstractGCEvent.Type.lookup(parenMatcher.replaceFirst(""));
        }
    }
    if (gcType != null) {
        extendedType = ExtendedType.lookup(gcType, typeName);
    }
    return extendedType;
}
Also used : Matcher(java.util.regex.Matcher) AbstractGCEvent(com.tagtraum.perf.gcviewer.model.AbstractGCEvent) ExtendedType(com.tagtraum.perf.gcviewer.model.AbstractGCEvent.ExtendedType)

Example 2 with ExtendedType

use of com.tagtraum.perf.gcviewer.model.AbstractGCEvent.ExtendedType in project GCViewer by chewiebug.

the class AbstractDataReaderSun method parseType.

protected ExtendedType parseType(String line, ParseInformation pos) throws ParseException {
    String typeString = parseTypeString(line, pos);
    ExtendedType gcType = extractTypeFromParsedString(typeString);
    if (gcType == null) {
        throw new UnknownGcTypeException(typeString, line, pos);
    }
    return gcType;
}
Also used : ExtendedType(com.tagtraum.perf.gcviewer.model.AbstractGCEvent.ExtendedType)

Aggregations

ExtendedType (com.tagtraum.perf.gcviewer.model.AbstractGCEvent.ExtendedType)2 AbstractGCEvent (com.tagtraum.perf.gcviewer.model.AbstractGCEvent)1 Matcher (java.util.regex.Matcher)1