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.

Bug 196767 - StackDataStorage doesn't use passed contextID.
Summary: StackDataStorage doesn't use passed contextID.
Status: VERIFIED FIXED
Alias: None
Product: cnd
Classification: Unclassified
Component: D-Light (show other bugs)
Version: 7.0
Hardware: PC Solaris
: P1 normal (vote)
Assignee: Maria Tishkova
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-16 12:19 UTC by Andrew Krasny
Modified: 2011-03-18 17:27 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Proposed patch (4.11 KB, text/plain)
2011-03-16 12:51 UTC, Maria Tishkova
Details
corrected patch: added context id in FuctionImpl (4.11 KB, patch)
2011-03-16 14:03 UTC, Maria Tishkova
Details | Diff
file corrected (13.16 KB, patch)
2011-03-16 14:05 UTC, Maria Tishkova
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Krasny 2011-03-16 12:19:03 UTC
StackDataStorage doesn't use passed contextID for calculating functionid => functions (and metrics) from different contexts (processes, for example) get mixed. 

It is important to fix this for solstudio..
Comment 1 Maria Tishkova 2011-03-16 12:51:07 UTC
Created attachment 107044 [details]
Proposed patch

The patch is save for the NetBeans functionality. We will only put additional column to the database and will change the id generation. For all parts in CND which uses  StackStorage there will be no changes as context_id = -1 is used when put sample to the database
Comment 2 Maria Tishkova 2011-03-16 14:03:41 UTC
Created attachment 107051 [details]
corrected patch: added context id in FuctionImpl

in the previous patch only INSERT was changed, in the latest also SELECT
Comment 3 Maria Tishkova 2011-03-16 14:05:58 UTC
Created attachment 107052 [details]
file corrected

file corrected
Comment 4 Maria Tishkova 2011-03-16 16:20:14 UTC
this fix is required for DLight Tool and Analytics (part of Studio release)
Comment 5 Andrew Krasny 2011-03-17 13:39:27 UTC
Thanks. The last proposed fix seems to be OK with some notes:
in generateFuncId() last block should be:

        synchronized (funcCache) {
            String id = context_id + funcName;
            Long funcId = funcCache.get(id);
            if (funcId == null) {
                funcId = ++funcIdSequence;
                AddFunctionRequest cmd = requestsProvider.addFunction(funcId, funcName, source_file_index, line_number, context_id);
                requestsProcessor.queueRequest(cmd);
                funcCache.put(id, funcId);
            }
            return funcId;
        }
Comment 6 Maria Tishkova 2011-03-17 13:47:59 UTC
Fixed in cnd-main http://hg.netbeans.org/cnd-main/rev/daef063de372

(this fix includes additional fix suggested by Andrew)


Please verify. To verify you just need to check if Gizmo works
Comment 7 Alexander Pepin 2011-03-17 16:13:18 UTC
verified in dev build #4987
Comment 8 Andrew Krasny 2011-03-18 07:09:21 UTC
transplanted from cnd-main:
daef063de372 transplanted to f8b8eec06d2d
Comment 9 Quality Engineering 2011-03-18 09:46:47 UTC
Integrated into 'main-golden', will be available in build *201103180400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/daef063de372
User: Maria Tishkova <mromashova@netbeans.org>
Log: BZ#196767 - StackDataStorage doesn't use passed contextID
Comment 10 Alexander Pepin 2011-03-18 17:27:11 UTC
verified in rc1 build 20110318