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 196767
Collapse All | Expand All

(-)a/dlight.core.stack/src/org/netbeans/modules/dlight/core/stack/resources/schema.sql (+1 lines)
Lines 1-6 Link Here
1
CREATE TABLE Func (
1
CREATE TABLE Func (
2
    func_id INT NOT NULL,
2
    func_id INT NOT NULL,
3
    func_name VARCHAR(16384) NOT NULL,
3
    func_name VARCHAR(16384) NOT NULL,
4
    context_id BIGINT NOT NULL DEFAULT -1,
4
    func_source_file_id INT NOT NULL DEFAULT -1,
5
    func_source_file_id INT NOT NULL DEFAULT -1,
5
    line_number INT NOT NULL DEFAULT -1,    
6
    line_number INT NOT NULL DEFAULT -1,    
6
--  FOREIGN KEY (func_source_file_id) REFERENCES (SourceFiles.id)    
7
--  FOREIGN KEY (func_source_file_id) REFERENCES (SourceFiles.id)    
(-)a/dlight.core.stack/src/org/netbeans/modules/dlight/core/stack/storage/impl/SQLStackDataStorage.java (-2 / +2 lines)
Lines 556-565 Link Here
556
        }
556
        }
557
557
558
        synchronized (funcCache) {
558
        synchronized (funcCache) {
559
            Long funcId = funcCache.get(funcName);
559
            Long funcId = funcCache.get("_"+ context_id + ""  + funcName);
560
            if (funcId == null) {
560
            if (funcId == null) {
561
                funcId = ++funcIdSequence;
561
                funcId = ++funcIdSequence;
562
                AddFunctionRequest cmd = requestsProvider.addFunction(funcId, funcName, source_file_index, line_number);
562
                AddFunctionRequest cmd = requestsProvider.addFunction(funcId, funcName, source_file_index, line_number, context_id);
563
                requestsProcessor.queueRequest(cmd);
563
                requestsProcessor.queueRequest(cmd);
564
                funcCache.put(funcName, funcId);
564
                funcCache.put(funcName, funcId);
565
            }
565
            }
(-)a/dlight.core.stack/src/org/netbeans/modules/dlight/core/stack/storage/impl/SQLStackRequestsProvider.java (-5 / +8 lines)
Lines 74-81 Link Here
74
        return new AddNodeRequest(nodeId, callerId, funcId, offset, lineNumber);
74
        return new AddNodeRequest(nodeId, callerId, funcId, offset, lineNumber);
75
    }
75
    }
76
76
77
    public AddFunctionRequest addFunction(Long funcId, String funcName, int source_file_index, int line_number) {
77
    public AddFunctionRequest addFunction(Long funcId, String funcName, int source_file_index, int line_number, long context_id) {
78
        return new AddFunctionRequest(funcId, funcName, source_file_index, line_number);
78
        return new AddFunctionRequest(funcId, funcName, source_file_index, line_number, context_id);
79
    }
79
    }
80
80
81
    public SQLRequest updateNodeMetrics(long id, long bucket) {
81
    public SQLRequest updateNodeMetrics(long id, long bucket) {
Lines 127-150 Link Here
127
        public final CharSequence name;
127
        public final CharSequence name;
128
        public final int sourceFileIndex;
128
        public final int sourceFileIndex;
129
        public final int line_number;
129
        public final int line_number;
130
        public final long context_id;
130
131
131
        public AddFunctionRequest(long id, CharSequence name, int sourceFileIndex, int line_number) {
132
        public AddFunctionRequest(long id, CharSequence name, int sourceFileIndex, int line_number, long context_id) {
132
            this.id = id;
133
            this.id = id;
133
            this.name = name;
134
            this.name = name;
134
            this.sourceFileIndex = sourceFileIndex;
135
            this.sourceFileIndex = sourceFileIndex;
135
            this.line_number = line_number;
136
            this.line_number = line_number;
137
            this.context_id = context_id;
136
        }
138
        }
137
139
138
        @Override
140
        @Override
139
        public void execute() throws SQLException {
141
        public void execute() throws SQLException {
140
            PreparedStatement stmt = cache.getPreparedStatement(
142
            PreparedStatement stmt = cache.getPreparedStatement(
141
                    "INSERT INTO Func " + // NOI18N
143
                    "INSERT INTO Func " + // NOI18N
142
                    "(func_id, func_name, func_source_file_id, line_number) " + // NOI18N
144
                    "(func_id, func_name, func_source_file_id, line_number, context_id) " + // NOI18N
143
                    "VALUES (?, ?, ?, ?)"); // NOI18N
145
                    "VALUES (?, ?, ?, ?, ?)"); // NOI18N
144
            stmt.setLong(1, id);
146
            stmt.setLong(1, id);
145
            stmt.setString(2, truncateString(name.toString()));
147
            stmt.setString(2, truncateString(name.toString()));
146
            stmt.setInt(3, sourceFileIndex);
148
            stmt.setInt(3, sourceFileIndex);
147
            stmt.setLong(4, line_number);
149
            stmt.setLong(4, line_number);
150
            stmt.setLong(5, context_id);
148
            stmt.executeUpdate();
151
            stmt.executeUpdate();
149
        }
152
        }
150
    }
153
    }

Return to bug 196767