This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 197341
Collapse All | Expand All

(-)a/dlight.core.stack/src/org/netbeans/modules/dlight/core/stack/storage/impl/SQLStackDataStorage.java (-1 / +4 lines)
Lines 1100-1106 Link Here
1100
        FunctionCallImpl(Function function, long offset, Map<FunctionMetric, Object> metrics) {
1100
        FunctionCallImpl(Function function, long offset, Map<FunctionMetric, Object> metrics) {
1101
            super(function, offset);
1101
            super(function, offset);
1102
            this.metrics = metrics;
1102
            this.metrics = metrics;
1103
            SourceFileInfo sourceFileInfo = FunctionNameUtils.getSourceFileInfo(function.getSignature());
1103
            SourceFileInfo sourceFileInfo = null;
1104
            try{
1105
                sourceFileInfo = FunctionNameUtils.getSourceFileInfo(function.getSignature());
1106
            }catch(Throwable e){}
1104
            lineNumber = sourceFileInfo == null ? -1 : sourceFileInfo.getLine();
1107
            lineNumber = sourceFileInfo == null ? -1 : sourceFileInfo.getLine();
1105
            setLineNumber(lineNumber);
1108
            setLineNumber(lineNumber);
1106
1109
(-)a/dlight.core.stack/src/org/netbeans/modules/dlight/core/stack/utils/FunctionNameUtils.java (-5 / +17 lines)
Lines 53-69 Link Here
53
    }
53
    }
54
54
55
    public static SourceFileInfo getSourceFileInfo(String functionSignature) {
55
    public static SourceFileInfo getSourceFileInfo(String functionSignature) {
56
        int indexOf = functionSignature.lastIndexOf("+"); //NOI18N
56
        int indexOf = functionSignature.indexOf("+"); //NOI18N
57
        int functionOffsetIndex = -1;
57
        //now we should get source file info (if presented)
58
        //now we should get source file info (if presented)
58
        while (indexOf > 0) {
59
        while (indexOf > 0) {
59
            if (functionSignature.length() > indexOf + 1
60
            if (functionSignature.length() > indexOf + 2
60
                    && functionSignature.charAt(indexOf + 1) == '0') { //NOI18N
61
                    && functionSignature.charAt(indexOf + 1) == '0' && //NOI18N
61
                break;
62
                    functionSignature.charAt(indexOf + 2) == 'x') { //NOI18N
63
                functionOffsetIndex = indexOf;
62
            }
64
            }
63
            indexOf = functionSignature.indexOf("+", indexOf + 1); //NOI18N
65
            indexOf = functionSignature.indexOf("+", indexOf + 1); //NOI18N
64
        }
66
        }
67
        //find function qualififed name
68
        String functionQualifiedName = getFunctionQName(functionSignature);
69
        int prev = indexOf;
70
        indexOf = functionSignature.indexOf(functionQualifiedName);
71
        if (indexOf >= 0 ){
72
            indexOf  = indexOf + functionQualifiedName.length();
73
        }
74
        if  (indexOf == 0){
75
            indexOf = prev;
76
        }
65
        //here we are: after the function offset there could be : which starts file:line
77
        //here we are: after the function offset there could be : which starts file:line
66
        int indexOfFile = functionSignature.indexOf(":", indexOf); //NOI18N
78
        int indexOfFile = functionSignature.indexOf(":", functionOffsetIndex); //NOI18N
67
        if (indexOfFile < 0) {
79
        if (indexOfFile < 0) {
68
            return null;
80
            return null;
69
        }
81
        }

Return to bug 197341