You can subscribe to this list here.
2005 |
Jan
|
Feb
(1) |
Mar
(45) |
Apr
(150) |
May
(145) |
Jun
(150) |
Jul
(79) |
Aug
(313) |
Sep
(160) |
Oct
(309) |
Nov
(115) |
Dec
(60) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(160) |
Feb
(144) |
Mar
(127) |
Apr
(48) |
May
(102) |
Jun
(54) |
Jul
(245) |
Aug
(94) |
Sep
(152) |
Oct
(162) |
Nov
(166) |
Dec
(740) |
2007 |
Jan
(752) |
Feb
(437) |
Mar
(328) |
Apr
(373) |
May
(569) |
Jun
(399) |
Jul
(369) |
Aug
(627) |
Sep
(100) |
Oct
(306) |
Nov
(166) |
Dec
(282) |
2008 |
Jan
(68) |
Feb
(145) |
Mar
(180) |
Apr
(160) |
May
(277) |
Jun
(229) |
Jul
(1188) |
Aug
(51) |
Sep
(97) |
Oct
(99) |
Nov
(95) |
Dec
(170) |
2009 |
Jan
(39) |
Feb
(73) |
Mar
(120) |
Apr
(121) |
May
(104) |
Jun
(262) |
Jul
(57) |
Aug
(171) |
Sep
(131) |
Oct
(88) |
Nov
(64) |
Dec
(83) |
2010 |
Jan
(55) |
Feb
(67) |
Mar
(124) |
Apr
(64) |
May
(130) |
Jun
(75) |
Jul
(164) |
Aug
(64) |
Sep
(44) |
Oct
(17) |
Nov
(43) |
Dec
(31) |
2011 |
Jan
(21) |
Feb
(10) |
Mar
(43) |
Apr
(46) |
May
(52) |
Jun
(71) |
Jul
(7) |
Aug
(16) |
Sep
(51) |
Oct
(14) |
Nov
(33) |
Dec
(15) |
2012 |
Jan
(12) |
Feb
(61) |
Mar
(129) |
Apr
(76) |
May
(70) |
Jun
(52) |
Jul
(29) |
Aug
(41) |
Sep
(32) |
Oct
(23) |
Nov
(38) |
Dec
(26) |
2013 |
Jan
(35) |
Feb
(37) |
Mar
(51) |
Apr
(15) |
May
(52) |
Jun
(15) |
Jul
(23) |
Aug
(21) |
Sep
(46) |
Oct
(69) |
Nov
(57) |
Dec
(26) |
2014 |
Jan
(5) |
Feb
(13) |
Mar
(17) |
Apr
(1) |
May
(5) |
Jun
|
Jul
(2) |
Aug
(2) |
Sep
(1) |
Oct
(16) |
Nov
(8) |
Dec
(4) |
2015 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(1) |
Jun
(4) |
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
From: Adrian S. <a3s...@us...> - 2005-07-26 11:15:36
|
Update of /cvsroot/sblim/sfcb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29575 Modified Files: args.c array.c context.c datetime.c enumeration.c providerDrv.c string.c support.c support.h Log Message: Additional cleanup for [ 1245096 ] mem_state set incorrectly by instance:clone() Removed TOOL_MEM_ADD etc defines in support.h Changed MEM_NOT_TRACKED value to -2 - getting better control for memory management Index: support.c =================================================================== RCS file: /cvsroot/sblim/sfcb/support.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- support.c 13 Jul 2005 14:26:02 -0000 1.7 +++ support.c 26 Jul 2005 11:15:26 -0000 1.8 @@ -391,8 +391,8 @@ * Description: * * Calls calloc to get the requested block size, then adds it to - * the control system depending on add, defined as TOOL_MM_ADD and - * TOOL_MM_NO_ADD. + * the control system depending on add, defined as MEM_TRACKED and + * MEM_NOT_TRACKED. */ void *tool_mm_alloc(int add, size_t size) { @@ -405,7 +405,7 @@ } __ALLOC_ERROR(!result); - if (add != TOOL_MM_NO_ADD) { + if (add != MEM_NOT_TRACKED) { tool_mm_add(result); } _SFCB_TRACE(1, ("--- Area: %p size: %d", result, size)); @@ -514,7 +514,7 @@ object = malloc(size); memcpy(object, ptr, size); - if (mode == TOOL_MM_NO_ADD) + if (mode == MEM_NOT_TRACKED) _SFCB_RETURN(object); mt->hc.encObjs[mt->hc.encUsed++] = (Object *) object; @@ -595,7 +595,7 @@ { managed_thread *mt=__memInit(); - if (memId!=MEM_RELEASED) + if (memId!=MEM_RELEASED && memId!=MEM_NOT_TRACKED) mt->hc.memEncObjs[memId-1] = NULL; } Index: array.c =================================================================== RCS file: /cvsroot/sblim/sfcb/array.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- array.c 13 Jun 2005 23:37:31 -0000 1.2 +++ array.c 26 Jul 2005 11:15:26 -0000 1.3 @@ -55,7 +55,7 @@ { struct native_array *a = (struct native_array *) array; - if (a->mem_state == TOOL_MM_NO_ADD) { + if (a->mem_state == MEM_NOT_TRACKED) { int i = a->size; @@ -79,7 +79,7 @@ { CMPIStatus tmp; struct native_array *a = (struct native_array *) array; - struct native_array *new = __new_empty_array(TOOL_MM_NO_ADD, + struct native_array *new = __new_empty_array(MEM_NOT_TRACKED, a->size, a->type, &tmp); @@ -167,7 +167,7 @@ a->data[index].state = 0; a->data[index].value = - (a->mem_state == TOOL_MM_ADD) ? + (a->mem_state == MEM_TRACKED) ? *val : native_clone_CMPIValue(type, val, &rc); return rc; @@ -177,7 +177,7 @@ if (!(a->data[index].state & CMPI_nullValue)) { - __make_NULL(a, index, index, a->mem_state == TOOL_MM_NO_ADD); + __make_NULL(a, index, index, a->mem_state == MEM_NOT_TRACKED); } CMReturn(CMPI_RC_OK); @@ -209,14 +209,14 @@ CMPIStatus rc = {CMPI_RC_OK, NULL}; a->data[index].state = 0; if (opt) a->data[index].value = *val; - else a->data[index].value = ( a->mem_state == TOOL_MM_ADD )? *val: + else a->data[index].value = ( a->mem_state == MEM_TRACKED )? *val: native_clone_CMPIValue ( type, val, &rc ); return rc; } if ( type == CMPI_null ) { if ( ! ( a->data[index].state & CMPI_nullValue ) ) { - __make_NULL ( a, index, index, a->mem_state == TOOL_MM_NO_ADD ); + __make_NULL ( a, index, index, a->mem_state == MEM_NOT_TRACKED ); } CMReturn ( CMPI_RC_OK ); } @@ -254,7 +254,7 @@ if (type == CMPI_null) { if (!(a->data[index].state & CMPI_nullValue)) { - __make_NULL(a, index, index, a->mem_state == TOOL_MM_NO_ADD); + __make_NULL(a, index, index, a->mem_state == MEM_NOT_TRACKED); } CMReturn(CMPI_RC_OK); } @@ -337,7 +337,7 @@ CMPIArray *TrackedCMPIArray(CMPICount size, CMPIType type, CMPIStatus * rc) { - void *array = internal_new_CMPIArray(TOOL_MM_ADD, size, type, rc); + void *array = internal_new_CMPIArray(MEM_TRACKED, size, type, rc); return (CMPIArray *) array; } @@ -350,7 +350,7 @@ CMPIArray *NewCMPIArray(CMPICount size, CMPIType type, CMPIStatus * rc) { - void *array = internal_new_CMPIArray(TOOL_MM_NO_ADD, size, type, rc); + void *array = internal_new_CMPIArray(MEM_NOT_TRACKED, size, type, rc); return (CMPIArray *) array; } @@ -358,7 +358,7 @@ ClObjectHdr * hdr) { void *array = - __new_empty_array(TOOL_MM_NO_ADD, av->value.sint32, av->type, rc); + __new_empty_array(MEM_NOT_TRACKED, av->value.sint32, av->type, rc); int i, m; for (i = 0, m = (int) av->value.sint32; i < m; i++) Index: providerDrv.c =================================================================== RCS file: /cvsroot/sblim/sfcb/providerDrv.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- providerDrv.c 13 Jun 2005 12:50:33 -0000 1.16 +++ providerDrv.c 26 Jul 2005 11:15:26 -0000 1.17 @@ -183,7 +183,7 @@ ProviderInfo *pInfo; CMPIContext *ctx = NULL; - ctx = native_new_CMPIContext(TOOL_MM_ADD,NULL); + ctx = native_new_CMPIContext(MEM_TRACKED,NULL); for (pInfo=curProvProc->firstProv; pInfo; pInfo=pInfo->next) { if (pInfo->classMI) pInfo->classMI->ft->cleanup(pInfo->classMI, ctx); if (pInfo->instanceMI) pInfo->instanceMI->ft->cleanup(pInfo->instanceMI, ctx); @@ -264,7 +264,7 @@ semAcquireUnDo(sfcbSem,(proc->id*3)+provProcGuardId+provProcBaseId); if ((val=semGetValue(sfcbSem,(proc->id*3)+provProcInuseId+provProcBaseId))==0) { if ((now-proc->lastActivity)>provTimeoutInterval) { - ctx = native_new_CMPIContext(TOOL_MM_ADD,NULL); + ctx = native_new_CMPIContext(MEM_TRACKED,NULL); noBreak=0; for (crc.rc=0,pInfo = activProvs; pInfo; pInfo = pInfo->next) { if (pInfo->library==NULL) continue; @@ -712,7 +712,7 @@ CMPIObjectPath *path = relocateSerializedObjectPath(req->objectPath.data); CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIResult *result = native_new_CMPIResult(0,1,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); BinResponseHdr *resp; CMPIFlags flgs=0; @@ -741,7 +741,7 @@ CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIArray *r; CMPIResult *result = native_new_CMPIResult(0,1,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); CMPICount count; BinResponseHdr *resp; CMPIFlags flgs=0; @@ -792,7 +792,7 @@ CMPIConstClass *cls = relocateSerializedConstClass(req->cls.data); CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIResult *result = native_new_CMPIResult(0,1,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); BinResponseHdr *resp; CMPIFlags flgs=0; @@ -823,7 +823,7 @@ CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIArray *r; CMPIResult *result = native_new_CMPIResult(0,1,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); CMPICount count; BinResponseHdr *resp; CMPIFlags flgs=req->flags; @@ -869,7 +869,7 @@ CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIArray *r; CMPIResult *result = native_new_CMPIResult(requestor<0 ? 0 : requestor,0,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); BinResponseHdr *resp; CMPIFlags flgs=req->flags; @@ -904,7 +904,7 @@ CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIArray *r; CMPIResult *result = native_new_CMPIResult(0,1,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); CMPICount count; BinResponseHdr *resp; CMPIFlags flgs=0; @@ -963,7 +963,7 @@ CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIArray *r; CMPIResult *result = native_new_CMPIResult(0,1,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); CMPICount count; BinResponseHdr *resp; CMPIFlags flgs=0; @@ -1008,7 +1008,7 @@ CMPIObjectPath *path = relocateSerializedObjectPath(req->objectPath.data); CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIResult *result = native_new_CMPIResult(0,1,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); BinResponseHdr *resp; CMPIFlags flgs=0; @@ -1040,7 +1040,7 @@ CMPIInstance *inst = relocateSerializedInstance(req->instance.data); CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIResult *result = native_new_CMPIResult(0,1,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); CMPIArray *r; CMPICount count; BinResponseHdr *resp; @@ -1081,7 +1081,7 @@ CMPIInstance *inst = relocateSerializedInstance(req->instance.data); CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIResult *result = native_new_CMPIResult(0,1,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); CMPICount count; BinResponseHdr *resp; CMPIFlags flgs=0; @@ -1119,7 +1119,7 @@ CMPIObjectPath *path = relocateSerializedObjectPath(req->objectPath.data); CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIResult *result = native_new_CMPIResult(requestor<0 ? 0 : requestor,0,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); BinResponseHdr *resp; CMPIFlags flgs=0; char **props=NULL; @@ -1155,7 +1155,7 @@ CMPIObjectPath *path = relocateSerializedObjectPath(req->objectPath.data); CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIResult *result = native_new_CMPIResult(requestor<0 ? 0 : requestor,0,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); BinResponseHdr *resp; CMPIFlags flgs=0; @@ -1239,7 +1239,7 @@ CMPIObjectPath *path = relocateSerializedObjectPath(req->objectPath.data); CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIResult *result = native_new_CMPIResult(requestor<0 ? 0 : requestor,0,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); BinResponseHdr *resp; CMPIFlags flgs=0; int irc; @@ -1310,7 +1310,7 @@ CMPIObjectPath *path = relocateSerializedObjectPath(req->objectPath.data); CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIResult *result = native_new_CMPIResult(requestor<0 ? 0 : requestor,0,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); BinResponseHdr *resp; CMPIFlags flgs=0; char **props=NULL; @@ -1349,7 +1349,7 @@ CMPIObjectPath *path = relocateSerializedObjectPath(req->objectPath.data); CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIResult *result = native_new_CMPIResult(requestor<0 ? 0 : requestor,0,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); BinResponseHdr *resp; CMPIFlags flgs=0; char **props=NULL; @@ -1386,7 +1386,7 @@ CMPIObjectPath *path = relocateSerializedObjectPath(req->objectPath.data); CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIResult *result = native_new_CMPIResult(requestor<0 ? 0 : requestor,0,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); BinResponseHdr *resp; CMPIFlags flgs=0; @@ -1419,7 +1419,7 @@ CMPIObjectPath *path = relocateSerializedObjectPath(req->objectPath.data); CMPIStatus rci = { CMPI_RC_OK, NULL }; CMPIResult *result = native_new_CMPIResult(requestor<0 ? 0 : requestor,0,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); BinResponseHdr *resp; CMPIFlags flgs=0; @@ -1458,7 +1458,7 @@ NativeSelectExp *se=NULL,*prev=NULL; CMPIObjectPath *path = relocateSerializedObjectPath(req->objectPath.data); CMPIResult *result = native_new_CMPIResult(requestor<0 ? 0 : requestor,0,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); CMPIFlags flgs=0; int makeActive=0; char *type; @@ -1546,7 +1546,7 @@ NativeSelectExp *se=NULL,**sef=&activFilters; CMPIObjectPath *path = relocateSerializedObjectPath(req->objectPath.data); CMPIResult *result = native_new_CMPIResult(requestor<0 ? 0 : requestor,0,NULL); - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); CMPIFlags flgs=0; ctx->ft->addEntry(ctx,CMPIInvocationFlags,(CMPIValue*)&flgs,CMPI_uint32); @@ -1627,7 +1627,7 @@ CMPIInstanceMI *mi = NULL; int rc=0; unsigned int flgs=0; - CMPIContext *ctx = native_new_CMPIContext(TOOL_MM_ADD,info); + CMPIContext *ctx = native_new_CMPIContext(MEM_TRACKED,info); _SFCB_ENTER(TRACE_PROVIDERDRV, "initProvider"); Index: datetime.c =================================================================== RCS file: /cvsroot/sblim/sfcb/datetime.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- datetime.c 18 Jul 2005 20:29:35 -0000 1.4 +++ datetime.c 26 Jul 2005 11:15:26 -0000 1.5 @@ -64,9 +64,9 @@ { struct native_datetime *ndt = (struct native_datetime *) dt; - if (ndt->mem_state == TOOL_MM_NO_ADD) { + if (ndt->mem_state == MEM_NOT_TRACKED) { - ndt->mem_state = TOOL_MM_ADD; + ndt->mem_state = MEM_TRACKED; tool_mm_add(ndt); CMReturn(CMPI_RC_OK); @@ -90,7 +90,7 @@ static CMPIDateTime *__dtft_clone(CMPIDateTime * dt, CMPIStatus * rc) { struct native_datetime *ndt = (struct native_datetime *) dt; - struct native_datetime *new = __new_datetime(TOOL_MM_NO_ADD, + struct native_datetime *new = __new_datetime(MEM_NOT_TRACKED, ndt->msecs, ndt->interval, rc); @@ -212,7 +212,7 @@ The newly allocated object's function table is initialized to point to the native functions in this file. - \param mm_add TOOL_MM_ADD for a regular object, TOOL_MM_NO_ADD for + \param mm_add MEM_TRACKED for a regular object, MEM_NOT_TRACKED for cloned ones \param msecs the binary time to be stored \param interval the interval flag to be stored @@ -273,7 +273,7 @@ msecs = (CMPIUint64) 1000000 *(CMPIUint64) tv.tv_sec + (CMPIUint64) tv.tv_usec; - return (CMPIDateTime *) __new_datetime(TOOL_MM_ADD, msecs, 0, rc); + return (CMPIDateTime *) __new_datetime(MEM_TRACKED, msecs, 0, rc); } @@ -293,7 +293,7 @@ CMPIBoolean interval, CMPIStatus * rc) { - return (CMPIDateTime *) __new_datetime(TOOL_MM_ADD, time, interval, rc); + return (CMPIDateTime *) __new_datetime(MEM_TRACKED, time, interval, rc); } @@ -379,7 +379,7 @@ free(str); return (CMPIDateTime *) - __new_datetime(TOOL_MM_ADD, msecs, interval, rc); + __new_datetime(MEM_TRACKED, msecs, interval, rc); } Index: support.h =================================================================== RCS file: /cvsroot/sblim/sfcb/support.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- support.h 21 Mar 2005 14:22:38 -0000 1.2 +++ support.h 26 Jul 2005 11:15:26 -0000 1.3 @@ -68,15 +68,12 @@ //! States cloned objects, i.e. memory that is not being tracked. -#define TOOL_MM_NO_ADD 0 -#define MEM_NOT_TRACKED 0 +#define MEM_NOT_TRACKED -2 //! States tracked memory objects. -#define TOOL_MM_ADD 1 #define MEM_TRACKED 1 //! States tracked memory objects but already released. -#define TOOL_MM_RELEASED 2 #define MEM_RELEASED -1 //! The initial size of trackable memory pointers per thread. Index: args.c =================================================================== RCS file: /cvsroot/sblim/sfcb/args.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- args.c 17 May 2005 13:04:21 -0000 1.3 +++ args.c 26 Jul 2005 11:15:26 -0000 1.4 @@ -62,7 +62,7 @@ { struct native_args *a = (struct native_args *) args; - if (a->mem_state == TOOL_MM_NO_ADD) { + if (a->mem_state == MEM_NOT_TRACKED) { ClArgsFree((ClArgs *) a->args.hdl); free(args); CMReturn(CMPI_RC_OK); @@ -75,7 +75,7 @@ static CMPIArgs *__aft_clone(CMPIArgs * args, CMPIStatus * rc) { struct native_args *a = (struct native_args *) args; - struct native_args *na = __new_empty_args(TOOL_MM_NO_ADD, rc); + struct native_args *na = __new_empty_args(MEM_NOT_TRACKED, rc); // if (rc->rc == CMPI_RC_OK) { na->args.hdl = ClArgsRebuild((ClArgs *) a->args.hdl, NULL); @@ -202,12 +202,12 @@ CMPIArgs *NewCMPIArgs(CMPIStatus * rc) { - return (CMPIArgs *) __new_empty_args(TOOL_MM_NO_ADD, rc); + return (CMPIArgs *) __new_empty_args(MEM_NOT_TRACKED, rc); } CMPIArgs *TrackedCMPIArgs(CMPIStatus * rc) { - return (CMPIArgs *) __new_empty_args(TOOL_MM_ADD, rc); + return (CMPIArgs *) __new_empty_args(MEM_TRACKED, rc); } unsigned long getArgsSerializedSize(CMPIArgs * args) Index: enumeration.c =================================================================== RCS file: /cvsroot/sblim/sfcb/enumeration.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- enumeration.c 9 Mar 2005 12:25:11 -0000 1.1.1.1 +++ enumeration.c 26 Jul 2005 11:15:26 -0000 1.2 @@ -42,7 +42,7 @@ { struct native_enum *e = (struct native_enum *) enumeration; - if (e->mem_state == TOOL_MM_NO_ADD) { + if (e->mem_state == MEM_NOT_TRACKED) { tool_mm_add(enumeration); return e->data->ft->release(e->data); @@ -66,7 +66,7 @@ return NULL; } - return (CMPIEnumeration *) __new_enumeration(TOOL_MM_NO_ADD, data, rc); + return (CMPIEnumeration *) __new_enumeration(MEM_NOT_TRACKED, data, rc); } @@ -113,7 +113,7 @@ enumeration->enumeration = e; enumeration->mem_state = mm_add; - enumeration->data = (mm_add == TOOL_MM_NO_ADD) ? CMClone(array, rc) : array; + enumeration->data = (mm_add == MEM_NOT_TRACKED) ? CMClone(array, rc) : array; if (rc) CMSetStatus(rc, CMPI_RC_OK); @@ -123,7 +123,7 @@ CMPIEnumeration *native_new_CMPIEnumeration(CMPIArray * array, CMPIStatus * rc) { - return (CMPIEnumeration *) __new_enumeration(TOOL_MM_ADD, array, rc); + return (CMPIEnumeration *) __new_enumeration(MEM_TRACKED, array, rc); } Index: string.c =================================================================== RCS file: /cvsroot/sblim/sfcb/string.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- string.c 9 Mar 2005 12:25:14 -0000 1.1.1.1 +++ string.c 26 Jul 2005 11:15:26 -0000 1.2 @@ -40,7 +40,7 @@ { struct native_string *s = (struct native_string *) string; - if (s->mem_state == TOOL_MM_NO_ADD) { + if (s->mem_state == MEM_NOT_TRACKED) { tool_mm_add(s); tool_mm_add(s->string.hdl); @@ -55,7 +55,7 @@ static CMPIString *__sft_clone(CMPIString * string, CMPIStatus * rc) { return (CMPIString *) - __new_string(TOOL_MM_NO_ADD, string->ft->getCharPtr(string, rc), rc); + __new_string(MEM_NOT_TRACKED, string->ft->getCharPtr(string, rc), rc); } @@ -82,7 +82,7 @@ string->string.ft = &sft; string->mem_state = mm_add; - if (mm_add == TOOL_MM_ADD) { + if (mm_add == MEM_TRACKED) { tool_mm_add(string->string.hdl); } @@ -94,7 +94,7 @@ CMPIString *native_new_CMPIString(const char *ptr, CMPIStatus * rc) { - return (CMPIString *) __new_string(TOOL_MM_ADD, ptr, rc); + return (CMPIString *) __new_string(MEM_TRACKED, ptr, rc); } Index: context.c =================================================================== RCS file: /cvsroot/sblim/sfcb/context.c,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- context.c 9 Mar 2005 12:25:11 -0000 1.1.1.1 +++ context.c 26 Jul 2005 11:15:26 -0000 1.2 @@ -147,9 +147,9 @@ { struct native_context *c = (struct native_context *) ctx; - if (c->mem_state == TOOL_MM_NO_ADD) { + if (c->mem_state == MEM_NOT_TRACKED) { - c->mem_state = TOOL_MM_ADD; + c->mem_state = MEM_TRACKED; tool_mm_add(c); propertyFT.release(c->entries); @@ -161,7 +161,7 @@ CMPIString *name; struct native_context *c = (struct native_context *) ctx; int i,s; - CMPIContext *nCtx=native_new_CMPIContext(TOOL_MM_NO_ADD,c->data); + CMPIContext *nCtx=native_new_CMPIContext(MEM_NOT_TRACKED,c->data); for (i=0,s=ctx->ft->getEntryCount(ctx,NULL); i<s; i++) { CMPIData data=ctx->ft->getEntryAt(ctx,i,&name,NULL); @@ -230,7 +230,7 @@ tmp->name = strdup ( name ); - if ( mm_add == TOOL_MM_ADD ) tool_mm_add ( tmp->name ); + if ( mm_add == MEM_TRACKED ) tool_mm_add ( tmp->name ); if ( type == CMPI_chars ) { @@ -245,7 +245,7 @@ if ( type != CMPI_null ) { tmp->state = state; - if ( mm_add == TOOL_MM_ADD ) { + if ( mm_add == MEM_TRACKED ) { tmp->value = *value; } else { @@ -303,7 +303,7 @@ if ( type != CMPI_null ) { prop->value = - ( mm_add == TOOL_MM_ADD )? + ( mm_add == MEM_TRACKED )? *value: native_clone_CMPIValue ( type, value, &rc ); @@ -411,7 +411,7 @@ result = (struct native_property * ) - tool_mm_alloc ( TOOL_MM_NO_ADD, + tool_mm_alloc ( MEM_NOT_TRACKED, sizeof ( struct native_property ) ); result->name = strdup ( prop->name ); |
From: Adrian S. <a3s...@us...> - 2005-07-26 10:05:38
|
Update of /cvsroot/sblim/sfcb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14763 Modified Files: instance.c Log Message: Fixed [ 1245096 ] mem_state set incorrectly by instance:clone() mem_state now set to MEM_NOT_TRACKED. Index: instance.c =================================================================== RCS file: /cvsroot/sblim/sfcb/instance.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- instance.c 18 Jul 2005 20:30:02 -0000 1.12 +++ instance.c 26 Jul 2005 10:05:17 -0000 1.13 @@ -142,6 +142,7 @@ struct native_instance *new = (struct native_instance*) malloc(sizeof(struct native_instance)); + new->mem_state=MEM_NOT_TRACKED; new->property_list = __duplicate_list(i->property_list); new->key_list = __duplicate_list(i->key_list); |
From: Benjamin B. <bg...@us...> - 2005-07-25 07:57:30
|
Update of /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/utils In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15043/Plugin/com/ibm/ecute/utils Modified Files: Constants.java Log Message: fixes in flavor presentation and modification Index: Constants.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/utils/Constants.java,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- Constants.java 19 Jul 2005 16:10:48 -0000 1.17 +++ Constants.java 25 Jul 2005 07:57:19 -0000 1.18 @@ -22,7 +22,7 @@ public class Constants { - public static final String pluginVersion="2.1 beta 1g"; + public static final String pluginVersion="2.1 beta 1h"; public static final String toolName="ECUTE"; public static final String qualifiersFileName="QualifiersList.txt"; |
From: Benjamin B. <bg...@us...> - 2005-07-25 07:57:29
|
Update of /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/UMLBuffer/UMLTree In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15043/Plugin/com/ibm/ecute/UMLBuffer/UMLTree Modified Files: UMLClass.java Log Message: fixes in flavor presentation and modification Index: UMLClass.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/UMLBuffer/UMLTree/UMLClass.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- UMLClass.java 19 Jul 2005 16:10:49 -0000 1.7 +++ UMLClass.java 25 Jul 2005 07:57:19 -0000 1.8 @@ -62,6 +62,10 @@ return (ArrayList) createdClasses.get(className); } + public void clearCreatedClasses(){ + createdClasses.clear(); + } + private boolean referencesProcessed=false; public UMLClass(String name, String superClass, UMLFile parentPackage) { super(UMLInterface.TCLASS); |
From: Benjamin B. <bg...@us...> - 2005-07-25 07:57:28
|
Update of /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/rsa/core/internal/dialogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15043/Plugin/com/ibm/ecute/rsa/core/internal/dialogs Modified Files: EditQualifiersDialog.java Log Message: fixes in flavor presentation and modification Index: EditQualifiersDialog.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/rsa/core/internal/dialogs/EditQualifiersDialog.java,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- EditQualifiersDialog.java 21 Jul 2005 15:19:33 -0000 1.9 +++ EditQualifiersDialog.java 25 Jul 2005 07:57:19 -0000 1.10 @@ -75,6 +75,7 @@ import com.ibm.ecute.EcuteEclipsePlugin; import com.ibm.ecute.Qualifiers.Qualifier; import com.ibm.ecute.Qualifiers.QualifiersList; +import com.ibm.ecute.rsa.core.internal.properties.EffectiveInheritedValue; import com.ibm.ecute.rsa.core.internal.properties.FlavorsHelper; import com.ibm.ecute.rsa.core.internal.properties.QualifierDefinitionObject; import com.ibm.ecute.rsa.core.internal.properties.QualifierValueObject; @@ -1476,6 +1477,7 @@ if((prop.getUpper() != MultiplicityElement.UNLIMITED_UPPER_BOUND) || (prop.getUpper() == MultiplicityElement.UNLIMITED_UPPER_BOUND + && FlavorsHelper.effectiveInheritedValue(element, "Max") != null &&prop.getUpper() != (FlavorsHelper.effectiveInheritedValue(element, "Max")).getIntValue())){ qualifierName = "Max"; String value = new Integer(prop.getUpper()).toString(); @@ -1487,6 +1489,7 @@ allAvailableQualifers.remove(qualifierObject); } if((prop.getLower() != 0) || (prop.getLower() == 0 + && FlavorsHelper.effectiveInheritedValue(element, "Min") != null && prop.getLower() != (FlavorsHelper.effectiveInheritedValue(element, "Min")).getIntValue())){ qualifierName = "Min"; String value = new Integer(prop.getLower()).toString(); @@ -1585,6 +1588,11 @@ for(int k = 0; k < inheritedQualifiers.size(); k++){ qualifierName = ((QualifierValueObject)inheritedQualifiers.get(k)).name; String qualifierValue = ((QualifierValueObject)inheritedQualifiers.get(k)).value; + if(qualifierName.equalsIgnoreCase("Max") && qualifierValue.equalsIgnoreCase("-1")){ + qualifierValue = "null"; + } else if(qualifierName.equalsIgnoreCase("Min") && qualifierValue.equalsIgnoreCase("-1")){ + qualifierValue = "0"; + } definedIn = ((QualifierValueObject)inheritedQualifiers.get(k)).definedIn; Qualifier qualifierObject = qualifiersList.GetElement(qualifierName); addQualiferToValueTable(qualifierName, qualifierValue, definedIn, qualifierObject, -1, false); @@ -3862,9 +3870,12 @@ QualifierValueObject object = editedValues[i]; // flavors patch ******* boolean setDefault = false; - String effectiveInheritedValue = FlavorsHelper.effectiveInheritedValue(element, object.name).getValue(); - if(object.value.equalsIgnoreCase(effectiveInheritedValue) && !object.name.equalsIgnoreCase("Min")){ - setDefault = true; + EffectiveInheritedValue inheritedValue = FlavorsHelper.effectiveInheritedValue(element, object.name); + if(inheritedValue != null){ + String effectiveInheritedValue = inheritedValue.getValue(); + if(object.value.equalsIgnoreCase(effectiveInheritedValue) && !object.name.equalsIgnoreCase("Min")){ + setDefault = true; + } } //********************** if(object.name.equalsIgnoreCase("Max")){ |
From: Benjamin B. <bg...@us...> - 2005-07-25 07:57:27
|
Update of /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/rsa/ui/internal/wizards/command In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15043/Plugin/com/ibm/ecute/rsa/ui/internal/wizards/command Modified Files: RSAOutputOperation.java Log Message: fixes in flavor presentation and modification Index: RSAOutputOperation.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/rsa/ui/internal/wizards/command/RSAOutputOperation.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- RSAOutputOperation.java 15 Jul 2005 13:43:39 -0000 1.7 +++ RSAOutputOperation.java 25 Jul 2005 07:57:19 -0000 1.8 @@ -18,7 +18,6 @@ import com.ibm.ecute.plugins.ProgressFrame; import com.ibm.ecute.plugins.output.funcionality.RSAModelCreator; import com.ibm.ecute.rsa.core.internal.dialogs.ProgressLogDialog; -import com.ibm.ecute.rsa.core.internal.properties.FlavorsHelper; import com.ibm.ecute.utils.License; import com.ibm.ecute.utils.Utils; import com.ibm.xtools.emf.msl.ResourceSetModifyOperation; @@ -130,15 +129,15 @@ throw new InterruptedException(); } - // FLAVORS - log.setSubTask("Applying flavors..."); - - FlavorsHelper flavorsHelper = new FlavorsHelper(uml2Model); - flavorsHelper.setModelFlavors(); - - if(monitor.isCanceled()){ - throw new InterruptedException(); - } +// // FLAVORS +// log.setSubTask("Applying flavors..."); +// +// FlavorsHelper flavorsHelper = new FlavorsHelper(uml2Model); +// flavorsHelper.setModelFlavors(); +// +// if(monitor.isCanceled()){ +// throw new InterruptedException(); +// } boolean fileSaved = false; |
From: Benjamin B. <bg...@us...> - 2005-07-25 07:57:27
|
Update of /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/rsa/core/internal/properties In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15043/Plugin/com/ibm/ecute/rsa/core/internal/properties Modified Files: QualifiersPropertySection.java FlavorsHelper.java Log Message: fixes in flavor presentation and modification Index: FlavorsHelper.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/rsa/core/internal/properties/FlavorsHelper.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- FlavorsHelper.java 20 Jul 2005 15:21:46 -0000 1.4 +++ FlavorsHelper.java 25 Jul 2005 07:57:18 -0000 1.5 @@ -614,6 +614,10 @@ if(attribute != null){ +// if(getQualifiersStereotypeQualifer(attribute, "Override") == null){ +// return null; +// } + EList list = attribute.getOwnedComments(); Iterator it = list.iterator(); while (it.hasNext()){ @@ -626,6 +630,10 @@ if(description != null){ return(new EffectiveInheritedValue(description, (Class)parents.get(j))); } + + if(!override(attribute) && j != parents.size()-1){ + return null; + } } } return null; @@ -661,6 +669,10 @@ if(description != null){ return(new EffectiveInheritedValue(description, (Class)parents.get(j))); } + + if(!override(method) && j != parents.size()-1){ + return null; + } } } return null; @@ -706,6 +718,10 @@ if(description != null){ return(new EffectiveInheritedValue(description, (Class)parents.get(j))); } + + if(!override(method) && j != parents.size()-1){ + return null; + } } } return null; @@ -803,6 +819,10 @@ if(stereo != null){ return(new EffectiveInheritedValue("true", (Class)parents.get(j))); } + + if(!override(attribute) && j != parents.size()-1){ + return null; + } } } } else { @@ -872,6 +892,10 @@ if(datatype.getName().equalsIgnoreCase("Octetstring")){ return(new EffectiveInheritedValue("true", (Class)parents.get(j))); } + + if(!override(attribute) && j != parents.size()-1){ + return null; + } } } } @@ -899,6 +923,10 @@ if(datatype.getName().equalsIgnoreCase("Octetstring")){ return(new EffectiveInheritedValue("true", (Class)parents.get(j))); } + + if(!override(method) && j != parents.size()-1){ + return null; + } } } } @@ -939,6 +967,9 @@ if(datatype.getName().equalsIgnoreCase("Octetstring")){ return(new EffectiveInheritedValue("true", (Class)parents.get(j))); } + if(!override(method) && j != parents.size()-1){ + return null; + } } } } @@ -973,8 +1004,13 @@ } } - if(attribute != null && attribute.isStatic()){ - return(new EffectiveInheritedValue("true", (Class)parents.get(j))); + if(attribute != null){ + if(attribute.isStatic()){ + return(new EffectiveInheritedValue("true", (Class)parents.get(j))); + } + if(!override(attribute) && j != parents.size()-1){ + return null; + } } } @@ -991,8 +1027,13 @@ } } - if(method != null && equalMethods(operation, method) && method.isStatic()){ - return(new EffectiveInheritedValue("true", (Class)parents.get(j))); + if(method != null && equalMethods(operation, method)){ + if(method.isStatic()){ + return(new EffectiveInheritedValue("true", (Class)parents.get(j))); + } + if(!override(method) && j != parents.size()-1){ + return null; + } } } } @@ -1019,8 +1060,13 @@ } } - if(attribute != null && !attribute.isReadOnly()){ - return(new EffectiveInheritedValue("true", (Class)parents.get(j))); + if(attribute != null){ + if(!attribute.isReadOnly()){ + return(new EffectiveInheritedValue("true", (Class)parents.get(j))); + } + if(!override(attribute) && j != parents.size()-1){ + return null; + } } } } else { @@ -1071,6 +1117,10 @@ if(qualValue != null){ return(new EffectiveInheritedValue(qualValue, (Class)parents.get(j))); } + + if(!override(attribute) && j != parents.size()-1){ + return null; + } } } return null; @@ -1094,6 +1144,10 @@ if(qualValue != null){ return(new EffectiveInheritedValue(qualValue, (Class)parents.get(j))); } + + if(!override(method) && j != parents.size()-1){ + return null; + } } } return null; @@ -1107,11 +1161,13 @@ for(int j = 0; j < parents.size(); j++){ String description = null; Parameter param = null; + Operation method = null; List operationsList = ((Class)parents.get(j)).getOwnedOperations(); for(int i = 0; i < operationsList.size(); i++){ - if(((Operation)operationsList.get(i)).getName().equalsIgnoreCase(operation.getName())){ - List parameterList = ((Operation)operationsList.get(i)).getOwnedParameters(); + method = (Operation)operationsList.get(i); + if(method.getName().equalsIgnoreCase(operation.getName())){ + List parameterList = method.getOwnedParameters(); for(int k = 0; k < parameterList.size(); k++){ if(((Parameter)parameterList.get(k)).getName().equalsIgnoreCase(parameter.getName())){ param = (Parameter)parameterList.get(k); @@ -1126,6 +1182,10 @@ if(qualValue != null){ return(new EffectiveInheritedValue(qualValue, (Class)parents.get(j))); } + + if(!override(method) && j != parents.size()-1){ + return null; + } } } return null; Index: QualifiersPropertySection.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/rsa/core/internal/properties/QualifiersPropertySection.java,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- QualifiersPropertySection.java 21 Jul 2005 15:19:32 -0000 1.22 +++ QualifiersPropertySection.java 25 Jul 2005 07:57:18 -0000 1.23 @@ -493,7 +493,8 @@ if(((AssociationClass)prop.getOwner()).getOwnedEnds().contains(prop)){ if((prop.getUpper() != MultiplicityElement.UNLIMITED_UPPER_BOUND) || (prop.getUpper() == MultiplicityElement.UNLIMITED_UPPER_BOUND - &&prop.getUpper() != (FlavorsHelper.effectiveInheritedValue(element, "Max")).getIntValue())){ + && FlavorsHelper.effectiveInheritedValue(element, "Max") != null + && prop.getUpper() != (FlavorsHelper.effectiveInheritedValue(element, "Max")).getIntValue())){ qualifierName = "Max"; String value = new Integer(prop.getUpper()).toString(); if(value.equalsIgnoreCase("-1")){ @@ -504,6 +505,7 @@ allAvailableQualifers.remove(qualifierObject); } if((prop.getLower() != 0) || (prop.getLower() == 0 + && FlavorsHelper.effectiveInheritedValue(element, "Min") != null && prop.getLower() != (FlavorsHelper.effectiveInheritedValue(element, "Min")).getIntValue())){ qualifierName = "Min"; String value = new Integer(prop.getLower()).toString(); @@ -580,6 +582,11 @@ for(int k = 0; k < inheritedQualifiers.size(); k++){ qualifierName = ((QualifierValueObject)inheritedQualifiers.get(k)).name; String qualifierValue = ((QualifierValueObject)inheritedQualifiers.get(k)).value; + if(qualifierName.equalsIgnoreCase("Max") && qualifierValue.equalsIgnoreCase("-1")){ + qualifierValue = "null"; + } else if(qualifierName.equalsIgnoreCase("Min") && qualifierValue.equalsIgnoreCase("-1")){ + qualifierValue = "0"; + } definedIn = ((QualifierValueObject)inheritedQualifiers.get(k)).definedIn; Qualifier qualifierObject = qualifiersList.GetElement(qualifierName); addQualiferToTable(qualifierName, qualifierValue, definedIn, qualifierObject, -1, false); |
From: Benjamin B. <bg...@us...> - 2005-07-25 07:57:27
|
Update of /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/UMLBuffer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15043/Plugin/com/ibm/ecute/UMLBuffer Modified Files: UMLBuffer.java Log Message: fixes in flavor presentation and modification Index: UMLBuffer.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/UMLBuffer/UMLBuffer.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- UMLBuffer.java 20 Jul 2005 15:21:46 -0000 1.12 +++ UMLBuffer.java 25 Jul 2005 07:57:18 -0000 1.13 @@ -229,6 +229,11 @@ throw new InterruptedException(); } + // BB - this can be used when the new import process is implemented + if(UMLProgram instanceof RSAModelCreator && lastClass != null){ + //lastClass.clearCreatedClasses(); + } + //Resumen final; log.addLine2Log(""); log.addLine2Log("Created packages: " + pCreated); @@ -792,10 +797,16 @@ lastCheckedClass = lastCheckedClass.getBaseUMLClass(); } else { break; + + +// if(overwrittenAttribute.getQualifier("Override", true) == null){ +// break; +// } } } if(overwrittenAttribute != null){ + if(attribute.getQualifier("Octetstring", true) == null && overwrittenAttribute.getQualifier("Octetstring", true) != null){ attribute.getQualifiers(true).add(overwrittenAttribute.getQualifier("Octetstring", true)); |
From: Benjamin B. <bg...@us...> - 2005-07-25 07:57:26
|
Update of /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/plugins/output In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15043/Plugin/com/ibm/ecute/plugins/output Modified Files: RSAOutputEcutePlugin.java Log Message: fixes in flavor presentation and modification Index: RSAOutputEcutePlugin.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/plugins/output/RSAOutputEcutePlugin.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- RSAOutputEcutePlugin.java 21 Dec 2004 17:08:32 -0000 1.4 +++ RSAOutputEcutePlugin.java 25 Jul 2005 07:57:18 -0000 1.5 @@ -114,7 +114,7 @@ progLog.addLine2Log("Generating in RSA"); progLog.addLine2Log("***********************************************"); - RSAOutputOperation modifyCIMModel = new RSAOutputOperation(umlbuffer, modelDestination, modelName, + RSAOutputOperation modifyCIMModel = new RSAOutputOperation(umlbuffer, modelDestination, modelName, replace, layout, qualifiers, progLog); IProgressMonitor monitor = new NullProgressMonitor(); |
From: yeechan <ibm...@us...> - 2005-07-22 22:05:01
|
Update of /cvsroot/sblim/cmpi-tests/cmpi-instancetest/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26083 Modified Files: TST_InstanceTest.c Log Message: #di failed - lisa Index: TST_InstanceTest.c =================================================================== RCS file: /cvsroot/sblim/cmpi-tests/cmpi-instancetest/src/TST_InstanceTest.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- TST_InstanceTest.c 31 May 2005 19:30:36 -0000 1.8 +++ TST_InstanceTest.c 22 Jul 2005 22:04:46 -0000 1.9 @@ -19,7 +19,7 @@ #include "cmpidt.h" #include "cmpift.h" #include "cmpimacs.h" - +#include <stdio.h> /* NULL terminated list of classnames supported by this provider */ static char * _CLASSNAMES[] = {"TST_InstanceProperties", "TST_InstanceKeys", "TST_InstanceDefaults", NULL}; @@ -27,7 +27,7 @@ static char _NAMESPACE[] = "root/cimv2"; /* NULL terminated list of property names for the class(es) */ -static char * _PROPERTYNAMES[] = {"CreationClassName", "Id", "Property_string", "Property_uint8", "Property_uint16", "Property_uint32", "Property_uint64", "Property_sint8", "Property_sint16", "Property_sint32", "Property_sint64", "Property_boolean", "Property_real32", "Property_real64", "Property_dateTime", "Property_char16", NULL}; +static char * _PROPERTYNAMES[] = {"CreationClassName", "Id", "Property_string1", "Property_string2", "Property_uint8", "Property_uint16", "Property_uint32", "Property_uint64", "Property_sint8", "Property_sint16", "Property_sint32", "Property_sint64", "Property_boolean", "Property_real32", "Property_real64", "Property_dateTime", "Property_char16", NULL}; /* NULL terminated list of key names for the class(es) */ static char * _KEYNAMES[] = {"CreationClassName", "Id", NULL}; @@ -53,7 +53,8 @@ char CreationClassName[_MAXSTRINGLENGTH]; char Id[_MAXSTRINGLENGTH]; /* ADD MORE INSTANCE DATA HERE */ - char Property_string[_MAXSTRINGLENGTH]; + char Property_string1[_MAXSTRINGLENGTH]; + CMPIString * Property_string2; CMPIUint8 Property_uint8; CMPIUint16 Property_uint16; CMPIUint32 Property_uint32; @@ -278,8 +279,9 @@ else if (strncmp(namestring, "Property_", strlen("Property_")) == 0) { _OSBASE_TRACE(2,("%s:_testpropertytype() property type=%s, data type=%s(%d)", _PROVIDERNAME, namestring+9, typestring+5, type)); - if (strcmp(namestring+9, typestring+5) != 0) { - _OSBASE_TRACE(1,("%s:_testpropertytype() wrong property type", _PROVIDERNAME)); + if (strcmp(namestring+9, typestring+5) != 0 && + (strncmp(namestring+9, "string", 6) || strcmp(typestring+5, "string"))) { + _OSBASE_TRACE(1,("%s:_testpropertytype() wrong property type (\"%s\" != \"%s\")", _PROVIDERNAME, namestring+9, typestring+5)); CMSetStatusWithChars(_BROKER, &status, CMPI_RC_ERR_TYPE_MISMATCH, "wrong property type"); goto exit; } @@ -310,6 +312,7 @@ /* Check for NULL property value state */ if (CMIsNullValue(data)) { _OSBASE_TRACE(1,("%s:_testpropertystate() property value is NULL", _PROVIDERNAME)); + CMSetStatusWithChars(_BROKER, &status, CMPI_RC_ERR_FAILED, "NULL property value"); goto exit; } @@ -385,10 +388,16 @@ if (strcmp(CMGetCharPtr(value.string), instancedata->Id) != 0) goto error; } - else if (strcmp(namestring, "Property_string") == 0) { + else if (strcmp(namestring, "Property_string1") == 0) { _OSBASE_TRACE(2,("%s:_testpropertyvalue() property value=\"%s\", data value=\"%s\"", _PROVIDERNAME, - CMGetCharPtr(value.string), instancedata->Property_string)); - if (strcmp(CMGetCharPtr(value.string),instancedata->Property_string) != 0) goto error; + CMGetCharPtr(value.string), instancedata->Property_string1)); + if (strcmp(CMGetCharPtr(value.string),instancedata->Property_string1) != 0) goto error; + } + + else if (strcmp(namestring, "Property_string2") == 0) { + _OSBASE_TRACE(2,("%s:_testpropertyvalue() property value=\"%s\", data value=\"%s\"", _PROVIDERNAME, + CMGetCharPtr(value.string), instancedata->Property_string2->hdl)); + if (strcmp(CMGetCharPtr(value.string),instancedata->Property_string2->hdl) != 0) goto error; } else if (strcmp(namestring, "Property_uint8") == 0) { @@ -460,12 +469,13 @@ else if (strcmp(namestring, "Property_dateTime") == 0) { /* Get the property dateTime string value */ CMPIString * datetimestr1 = CMGetStringFormat(value.dateTime, &status); - if (status.rc != CMPI_RC_OK) { + if (status.rc != CMPI_RC_OK) { _OSBASE_TRACE(1,("%s:_testpropertyvalue() CMGetStringFormat(property value) failed", _PROVIDERNAME)); CMSetStatusWithChars(_BROKER, &status, CMPI_RC_ERROR_SYSTEM, "CMGetStringFormat() failed"); - goto exit; + goto exit; } + /* Get the instance data dateTime string value */ CMPIString * datetimestr2 = CMGetStringFormat(instancedata->Property_dateTime, &status); if (status.rc != CMPI_RC_OK) { @@ -477,14 +487,22 @@ /* Compare dateTime's using their string format */ _OSBASE_TRACE(2,("%s:_testpropertyvalue() property value=%s, data value=%s", _PROVIDERNAME, CMGetCharPtr(datetimestr1), CMGetCharPtr(datetimestr2))); - if (strcmp(CMGetCharPtr(datetimestr1), CMGetCharPtr(datetimestr2)) != 0) goto error; + if (strcmp(CMGetCharPtr(datetimestr1), CMGetCharPtr(datetimestr2)) != 0) + { + printf ("_testpropropertyvalue compare dateTime string format \n"); + fflush (stdout); + goto error; + } + + printf ("_testpropropertyvalue FINISHED compare dateTime string format \n"); + fflush (stdout); /* Get the property dateTime binary value */ CMPIUint64 datetime1 = CMGetBinaryFormat(value.dateTime, &status); if (status.rc != CMPI_RC_OK) { _OSBASE_TRACE(1,("%s:_testpropertyvalue() CMGetBinaryFormat(property value) failed", _PROVIDERNAME)); CMSetStatusWithChars(_BROKER, &status, CMPI_RC_ERROR_SYSTEM, "CMGetBinaryFormat() failed"); - goto exit; + goto exit; } /* Get the instance data dateTime binary value */ @@ -520,13 +538,19 @@ exit: _OSBASE_TRACE(1,("%s:_testpropertyvalue() %s", _PROVIDERNAME, (status.rc == CMPI_RC_OK)? "succeeded":"failed")); + + + return status; + + } // ---------------------------------------------------------------------------- + /* _testproperties() - test all properties of the CIM instance against the raw instance data */ CMPIStatus _testproperties( CMPIInstance * instance, _INSTANCEDATA * instancedata ) { @@ -609,12 +633,11 @@ exit: _OSBASE_TRACE(1,("%s:_testproperties() %s", _PROVIDERNAME, (status.rc == CMPI_RC_OK)? "succeeded":"failed")); return status; + } // ---------------------------------------------------------------------------- - - /* _testinstance() - run tests on the specified instance against the (optional) instance data. If instancedata is NULL then skip associated tests */ CMPIStatus _testinstance( CMPIInstance * instance, _INSTANCEDATA * instancedata ) @@ -632,7 +655,7 @@ /* Test instance properties */ status = _testproperties(instance, instancedata); - if (status.rc != CMPI_RC_OK) goto exit; + /* if (status.rc != CMPI_RC_OK) */ goto exit; /* Finished */ exit: @@ -911,8 +934,12 @@ CMSetProperty(*instance, "CreationClassName", instancedata->CreationClassName, CMPI_chars); CMSetProperty(*instance, "Id", instancedata->Id, CMPI_chars); /* ADD MORE CMSetProperty() COMMANDS FOR OTHER INSTANCE DATA HERE */ - CMSetProperty(*instance, "Property_string", (CMPIValue *)&(instancedata->Property_string), CMPI_chars); - CMSetProperty(*instance, "Property_uint8", (CMPIValue *)&(instancedata->Property_uint8) , CMPI_uint8); + CMSetProperty(*instance, "Property_string1", (CMPIValue *)&(instancedata->Property_string1), CMPI_chars); + + CMSetProperty(*instance, "Property_string2", (CMPIValue *)&(instancedata->Property_string2), CMPI_string); + + CMSetProperty(*instance, "Property_uint8", (CMPIValue *)&(instancedata->Property_uint8) , CMPI_uint8); + CMSetProperty(*instance, "Property_uint16", (CMPIValue *)&(instancedata->Property_uint16), CMPI_uint16); CMSetProperty(*instance, "Property_uint32", (CMPIValue *)&(instancedata->Property_uint32), CMPI_uint32); CMSetProperty(*instance, "Property_uint64", (CMPIValue *)&(instancedata->Property_uint64), CMPI_uint64); @@ -923,11 +950,16 @@ CMSetProperty(*instance, "Property_boolean", (CMPIValue *)&(instancedata->Property_boolean), CMPI_boolean); CMSetProperty(*instance, "Property_real32", (CMPIValue *)&(instancedata->Property_real32), CMPI_real32); CMSetProperty(*instance, "Property_real64", (CMPIValue *)&(instancedata->Property_real64), CMPI_real64); + CMSetProperty(*instance, "Property_dateTime", (CMPIValue *)&instancedata->Property_dateTime, CMPI_dateTime); + +CMPIData data = CMGetProperty(*instance, "Property_dateTime", NULL); + CMSetProperty(*instance, "Property_char16", (CMPIValue *)&(instancedata->Property_char16), CMPI_char16); + /* Finished */ -exit: +exit: _OSBASE_TRACE(1,("%s:_makeinstance() %s", _PROVIDERNAME, (status.rc == CMPI_RC_OK)? "succeeded":"failed")); return status; } @@ -974,6 +1006,19 @@ instances[sizeinstances-1] = newinstance; instances[sizeinstances] = NULL; sizeinstances++; + +{ +struct native_instance { +CMPIInstance instance; + int mem_state; + char **property_list; + char **key_list; +}; + +printf("++++++++ADDING new instance %d \n", ((struct native_instance *) newinstance)->mem_state); +fflush(stdout); +} + /* Instances list is always NULL terminated */ /* Finished */ @@ -1002,24 +1047,45 @@ _OSBASE_TRACE(1,("%s:_getinstanceindex() No object path specified", _PROVIDERNAME)); return sizeinstances; } +printf("getinstanceindex OP done \n"); +fflush (stdout); /* Look thru the list of instances for one with a matching object path */ for (i=0; i<sizeinstances; i++) { if (instances[i] == NULL) continue; +printf("instance list \n"); +fflush (stdout); + /* Check if this instance's object path matches the reference */ objectpath = CMGetObjectPath(instances[i], NULL); + +printf("CMGetObjectPath \n"); +fflush (stdout); + CMSetNameSpace(objectpath, CMGetCharPtr(CMGetNameSpace(reference,NULL))); - if (_CMSameObject(objectpath, reference)) { + +printf("CMSetNameSpace \n"); +fflush (stdout); + + if (_CMSameObject(objectpath, reference)) { found++; - break; - } +printf("CMSameObject done %s__,reference__%x, \n", objectpath, reference); +fflush (stdout); + break; + } + +printf("check Matching objectPath\n"); +fflush (stdout); } +printf("finished getinstanceindex\n"); +fflush (stdout); + /* Finished */ _OSBASE_TRACE(1,("%s:_getinstanceindex() %s", _PROVIDERNAME, (found)? "succeeded":"failed")); if (found) return i; - else return sizeinstances; /* Note - instances list is always NULL terminated */ + else return sizeinstances-1; /* Note - instances list is always NULL terminated */ } @@ -1282,7 +1348,8 @@ /* Run tests on the new instance */ status = _testinstance(newinstance, NULL); - if (status.rc != CMPI_RC_OK) goto exit; + if (status.rc != CMPI_RC_OK) + goto exit; /* Get the object path of the new instance */ newobjectpath = CMGetObjectPath(newinstance, &status); @@ -1331,10 +1398,14 @@ CMReturnObjectPath(results, newobjectpath); /* Finished */ + CMReturnDone(results); exit: + _OSBASE_TRACE(1,("%s:CreateInstance() %s", self->ft->miName, (status.rc == CMPI_RC_OK)? "succeeded":"failed")); - return status; + + return status; + } @@ -1360,6 +1431,9 @@ /* Locate the instance in the internal list of instances */ index = _getinstanceindex(reference); +printf("deleteInstance() _getinstanceindex done, %d \n", index); +fflush(stdout); + /* Check if found the desired instance */ if (instances[index] == NULL) { _OSBASE_TRACE(1,("%s:DeleteInstance() Requested instance not found", self->ft->miName)); @@ -1367,10 +1441,21 @@ goto exit; } +printf("instance is not null, %d \n", index); +printf("the CMRelease FT %x \n",(instances[index])->ft->release); +fflush(stdout); + /* Remove the instance from the internal list of instances */ CMRelease(instances[index]); + +printf("remove instances, %d \n", index); +fflush(stdout); + instances[index] = NULL; +printf("instance index is Null, %d \n", index); +fflush(stdout); + /* Finished */ CMReturnDone(results); exit: @@ -1498,7 +1583,8 @@ CMPIInstance * newinstance = NULL; /* New instance to add to the internal list */ CMPIObjectPath * newobjectpath = NULL; /* New object path for each new instance */ int instancenum = 1; /* Number of instances to populate the internal list */ - + //lisa - declaring instance + _OSBASE_TRACE(1,("%s:Initialize() called", self->ft->miName)); /* Copy the provider name for later use */ @@ -1521,7 +1607,10 @@ /* Create a new TST_InstanceDefaults instance from the raw data */ strncpy(newinstancedata.CreationClassName, "TST_InstanceDefaults", _MAXSTRINGLENGTH); - status = _makeinstance(&newinstance, &newinstancedata, newinstancedata.CreationClassName); + newinstancedata.Property_string2=NULL; + // newinstancedata.Property_dateTime = CMNewDateTimeFromChars(_BROKER,"20050503104354.000000:000",NULL); + newinstancedata.Property_dateTime=NULL; + status = _makeinstance(&newinstance, &newinstancedata, newinstancedata.CreationClassName); if (status.rc != CMPI_RC_OK) { _OSBASE_TRACE(1,("%s:Initialize() _makeinstance() failed", self->ft->miName)); goto exit; @@ -1529,11 +1618,16 @@ /* Run tests on the newly created instance */ status = _testinstance(newinstance, NULL); - if (status.rc != CMPI_RC_OK) goto exit; + /* if (status.rc != CMPI_RC_OK) goto exit; */ /* Get the object path of the newly created instance */ - newobjectpath = CMGetObjectPath(newinstance, &status); - if (status.rc != CMPI_RC_OK) { +//printf("instance=%s", CDToString(_BROKER, newinstance, NULL)); +//fflush(stdout); + + newobjectpath = CMGetObjectPath(newinstance, &status); +printf("%s\n" ); +fflush (stdout); + if (status.rc != CMPI_RC_OK) { _OSBASE_TRACE(1,("%s:Initialize() CMGetObjectPath() failed", self->ft->miName)); goto exit; } @@ -1557,7 +1651,21 @@ } /* Initialize the rest of the raw instance data */ - snprintf(newinstancedata.Property_string, _MAXSTRINGLENGTH, "This is instance #%d", instancenum); + snprintf(newinstancedata.Property_string1, _MAXSTRINGLENGTH, "This is instance #%d", instancenum); + +printf ("print string2 (mb)->eft->newString %X \n ", _BROKER ->eft->newString); +fflush (stdout); + +newinstancedata.Property_string2=CMNewString(_BROKER, "This is the New String Value using CMPIString", NULL); + +printf("TOO COMPLICATED --> %s\n", newinstancedata.Property_string2->hdl); +printf("try CMGetCharPtr -> %s\n", CMGetCharPtr(newinstancedata.Property_string2)); + +//printf("%s\n", CMGetCharPtr(CMNewString(_BROKER, "foobar", NULL))); +//fflush (stdout); + + /*snprintf(newinstancedata.Property_string2, mynewstring);*/ + /*newinstancedata.Property_string2=mynewstring;*/ newinstancedata.Property_uint8 = (CMPIUint8)255; newinstancedata.Property_uint16 = (CMPIUint16)65535; newinstancedata.Property_uint32 = (CMPIUint32)65535*65535; @@ -1570,6 +1678,13 @@ newinstancedata.Property_real32 = (CMPIReal32)0.123456e38; newinstancedata.Property_real64 = (CMPIReal64)0.123456789012345e38; newinstancedata.Property_dateTime = CMNewDateTimeFromChars(_BROKER,"20050503104354.000000:000",NULL); + +/*lisa - test Property_dateTime raw data initialize, then CMSetProperty, CMGetProperty*/ + +//newinstance = CMNewInstance(_BROKER, objectpath, &status); +//CMSetProperty(newinstance, "Property_dateTime", (CMPIValue *)&newinstancedata.Property_dateTime, CMPI_dateTime); + + newinstancedata.Property_char16 = (CMPIChar16)'a'; _OSBASE_TRACE(1,("%s:Initialize() creating new instance", self->ft->miName)); @@ -1581,10 +1696,10 @@ _OSBASE_TRACE(1,("%s:Initialize() _makeinstance() failed", self->ft->miName)); goto exit; } - /* Run tests on the newly created instance */ status = _testinstance(newinstance, &newinstancedata); - if (status.rc != CMPI_RC_OK) goto exit; + //if (status.rc != CMPI_RC_OK) + //goto exit; /* Get the object path of the newly created instance */ newobjectpath = CMGetObjectPath(newinstance, &status); |
From: Benjamin B. <bg...@us...> - 2005-07-21 16:26:39
|
Update of /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/rsa/core/internal/properties In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11035/Plugin/com/ibm/ecute/rsa/core/internal/properties Modified Files: QualifiersPropertySection.java Log Message: flavors presentation and modification rule implemented edit qualifiers dialog Index: QualifiersPropertySection.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/rsa/core/internal/properties/QualifiersPropertySection.java,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- QualifiersPropertySection.java 20 Jul 2005 15:21:46 -0000 1.21 +++ QualifiersPropertySection.java 21 Jul 2005 15:19:32 -0000 1.22 @@ -445,11 +445,11 @@ AssociationClass parentClass = (AssociationClass)prop.getOwner(); List ends = parentClass.getOwnedEnds(); if ((Property)ends.get(0) == prop){ - isOwnedEnd = true; + //isOwnedEnd = true; oppositeProp = (Property)ends.get(1); } if ((Property)ends.get(1) == prop){ - isOwnedEnd = true; + //isOwnedEnd = true; oppositeProp = (Property)ends.get(0); } @@ -572,7 +572,7 @@ } - //TODO Inherited qualifiers + // Inherited qualifiers // Get all inherited qualifiers which aren't already defined in this element ValuesTableHelper tableHelper = new ValuesTableHelper(qualifiersTable); |
From: Benjamin B. <bg...@us...> - 2005-07-21 15:21:45
|
Update of /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/rsa/core/internal/dialogs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11035/Plugin/com/ibm/ecute/rsa/core/internal/dialogs Modified Files: EditQualifiersDialog.java Log Message: flavors presentation and modification rule implemented edit qualifiers dialog Index: EditQualifiersDialog.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/rsa/core/internal/dialogs/EditQualifiersDialog.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- EditQualifiersDialog.java 15 Jun 2005 09:41:48 -0000 1.8 +++ EditQualifiersDialog.java 21 Jul 2005 15:19:33 -0000 1.9 @@ -25,6 +25,7 @@ import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.SelectionListener; import org.eclipse.swt.graphics.Color; +import org.eclipse.swt.graphics.Point; import org.eclipse.swt.graphics.RGB; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; @@ -74,9 +75,11 @@ import com.ibm.ecute.EcuteEclipsePlugin; import com.ibm.ecute.Qualifiers.Qualifier; import com.ibm.ecute.Qualifiers.QualifiersList; +import com.ibm.ecute.rsa.core.internal.properties.FlavorsHelper; import com.ibm.ecute.rsa.core.internal.properties.QualifierDefinitionObject; import com.ibm.ecute.rsa.core.internal.properties.QualifierValueObject; import com.ibm.ecute.rsa.core.internal.properties.QualifiersPropertySection; +import com.ibm.ecute.rsa.core.internal.properties.ValuesTableHelper; import com.ibm.ecute.utils.Constants; import com.ibm.ecute.utils.License; @@ -105,8 +108,8 @@ // Copyright private static final String COPYRIGHT = License.COPYRIGHT; - private static final int BUTTON_WIDTH = 90; - private static final int BUTTON_HEIGHT = 22; + private /*static final*/ int BUTTON_WIDTH;// = 90; + private /*static final*/ int BUTTON_HEIGHT;// = 22; private static final int NAME_COL_WIDTH = 135; private static final int TYPE_COL_WIDTH = 60; @@ -118,6 +121,7 @@ private Color YELLOW = null; private Color WHITE = null; + Shell shell; Model uml2Model; IUMLDiagramHelper diagramHelper = UMLModeler.getUMLDiagramHelper(); @@ -126,7 +130,7 @@ Button showAllButton; Label inheritLabel; Combo inheritComboBox; - Label elementLabel; + //Label elementLabel; Table valueTable; Combo propertiesComboBox; Combo methodsComboBox; @@ -200,6 +204,7 @@ public EditQualifiersDialog(Shell shell, NamedElement element, int index, QualifiersPropertySection qualSec) { super(shell); setShellStyle(getShellStyle()|SWT.RESIZE| SWT.MAX); + //this.shell = shell; this.element = element; startElement = element; startIndex = index; @@ -210,9 +215,10 @@ public Control createDialogArea(Composite parent) { - parent.getShell().setText("Edit Qualifiers" + - " (" + Constants.toolName + " " + Constants.pluginVersion + ")"); - + this.shell = parent.getShell(); +// parent.getShell().setText("Edit Qualifiers" + +// " (" + Constants.toolName + " " + Constants.pluginVersion + ")"); + GridLayout grid = new GridLayout(); grid.numColumns = 1; parent.setLayout(grid); @@ -246,7 +252,7 @@ resetDefinitionTableChanged(); } } - fillValueTable(element); + fillValueTable(element, valueTable); } else if(folder.getSelectionIndex() == 1){ performMarksQuestion("leaveTab"); @@ -271,7 +277,7 @@ showAllButton.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent selectionevent) { - fillValueTable(element); + fillValueTable(element, valueTable); qualPropSec.setShowAll(showAllButton.getSelection()); } }); @@ -293,15 +299,16 @@ Package thisPackage = (Package)element.getOwner(); element = getSelectedClass(selected, thisPackage, true); // update dialog content - fillValueTable(element); + fillValueTable(element, valueTable); fillComboBoxes(element); - setElementLabel(); + //setElementLabel(); + setDialogTitle(); setButtonVisibility(); } }); // elementLabel - elementLabel = new Label(valComposite, SWT.NONE); + //elementLabel = new Label(valComposite, SWT.NONE); // valueTable valueTable = new Table(valComposite, @@ -376,9 +383,10 @@ element = getSelectedProperty(selected,(Class)element); } // update dialog content - fillValueTable(element); + fillValueTable(element, valueTable); fillComboBoxes(element); - setElementLabel(); + //setElementLabel(); + setDialogTitle(); setButtonVisibility(); } }); @@ -396,9 +404,10 @@ element = getSelectedMethod(selected,(Class)element); } // update dialog content - fillValueTable(element); + fillValueTable(element, valueTable); fillComboBoxes(element); - setElementLabel(); + //setElementLabel(); + setDialogTitle(); setButtonVisibility(); } }); @@ -425,9 +434,10 @@ element = getOtherParameter(selected,(Parameter)element); } // update dialog content - fillValueTable(element); + fillValueTable(element, valueTable); fillComboBoxes(element); - setElementLabel(); + //setElementLabel(); + setDialogTitle(); setButtonVisibility(); } }); @@ -459,9 +469,10 @@ element = (Operation)parameter.getOwner(); } // update dialog content - fillValueTable(element); + fillValueTable(element, valueTable); fillComboBoxes(element); - setElementLabel(); + //setElementLabel(); + setDialogTitle(); setButtonVisibility(); } }); @@ -553,7 +564,7 @@ performValuesChanges(); valueTable.removeAll(); - fillValueTable(element); + fillValueTable(element, valueTable); valLegendComposite.setVisible(false); applyButton.setEnabled(false); @@ -574,7 +585,7 @@ resetRemovedValues(); valueTable.removeAll(); - fillValueTable(element); + fillValueTable(element, valueTable); valLegendComposite.setVisible(false); applyButton.setEnabled(false); @@ -589,10 +600,12 @@ valuesTab.setControl(valComposite); // fill and layout tab - setElementLabel(); - fillValueTable(element); + //setElementLabel(); + setDialogTitle(); + fillValueTable(element, valueTable); fillComboBoxes(); setButtonVisibility(); + setButtonSize(); setValueTabLayout(); if(startIndex > -1){ valueTable.setSelection(startIndex); @@ -1065,19 +1078,19 @@ } else { definedIn = fullDefinedIn; } - if(!definedIn.equalsIgnoreCase("") && !definedIn.equalsIgnoreCase(element.getName()) && - valueObject.inheritance.trim().equalsIgnoreCase("ToSubclass DisableOverride")){ - MessageBox messageBox = - new MessageBox(Display.getCurrent().getActiveShell(), - SWT.OK| - SWT.ICON_INFORMATION); - messageBox.setText("Can't override qualifier"); - messageBox.setMessage("The qualifier you've selected has the flavor \"DisableOverride\" and its value is already\n" + - "set in "+ fullDefinedIn + ".\n" + - "Therefore you're not allowed to change the qualifier value in this element. To change this\n" + - "value, navigate to the element where it is defined and change the value there."); - messageBox.open(); - } else { +// if(!definedIn.equalsIgnoreCase("") && !definedIn.equalsIgnoreCase(element.getName()) && +// valueObject.inheritance.trim().equalsIgnoreCase("ToSubclass DisableOverride")){ +// MessageBox messageBox = +// new MessageBox(Display.getCurrent().getActiveShell(), +// SWT.OK| +// SWT.ICON_INFORMATION); +// messageBox.setText("Can't override qualifier"); +// messageBox.setMessage("The qualifier you've selected has the flavor \"DisableOverride\" and its value is already\n" + +// "set in "+ fullDefinedIn + ".\n" + +// "Therefore you're not allowed to change the qualifier value in this element. To change this\n" + +// "value, navigate to the element where it is defined and change the value there."); +// messageBox.open(); +// } else { if(valueObject.name.equalsIgnoreCase("In")||valueObject.name.equalsIgnoreCase("Out")){ setInOutValueObjects(valueObject); } @@ -1115,7 +1128,7 @@ valueTable.getItem(ai).setBackground(YELLOW); } } - } + //} valueTable.setSelection(ai); valueTable.setFocus(); @@ -1215,7 +1228,7 @@ } - private void fillValueTable(NamedElement element){ + private void fillValueTable(NamedElement element, Table valueTable){ valueTable.removeAll(); QualifiersList qualifiersList=null; try { @@ -1230,14 +1243,25 @@ allAvailableQualifers.add(vector.get(i)); } +// String definedIn = ""; +// if(element instanceof Class){ +// definedIn = element.getName(); +// }else{ +// Element owner = element.getOwner(); +// if(owner instanceof NamedElement) +// definedIn = ((NamedElement)element.getOwner()).getName(); +// } + String definedIn = ""; - if(element instanceof Class){ - definedIn = element.getName()+" ("+element.getNearestPackage().getName()+")"; - }else{ - Element owner = element.getOwner(); - if(owner instanceof NamedElement) - definedIn = ((NamedElement)element.getOwner()).getName()+" ("+owner.getNearestPackage().getName()+")"; - } + if(element instanceof Class){ + definedIn = element.getName(); + }else if(element instanceof Parameter){ + definedIn = ((NamedElement)element.getOwner().getOwner()).getName() + "::" + ((NamedElement)element.getOwner()).getName() + "::" + element.getName(); + }else{ + Element owner = element.getOwner(); + if(owner instanceof NamedElement) + definedIn = ((NamedElement)element.getOwner()).getName() + "::" +element.getName(); + } //display all qualifiers witch are set in the Qualifiers-Stereotype Stereotype cimStereotype = element.getAppliedStereotype("CIM::Qualifiers"); @@ -1449,20 +1473,46 @@ //Qualifier: Max, Min if(isOwnedEnd){ if(((AssociationClass)prop.getOwner()).getOwnedEnds().contains(prop)){ - if(prop.getUpper() != MultiplicityElement.UNLIMITED_UPPER_BOUND){ - qualifierName = "Max"; - String value = new Integer(prop.getUpper()).toString(); - Qualifier qualifierObject = qualifiersList.GetElement(qualifierName); - addQualiferToValueTable(qualifierName, value, definedIn, qualifierObject, -1, false); - allAvailableQualifers.remove(qualifierObject); - } - if(prop.getLower() != 0){ - qualifierName = "Min"; - String value = new Integer(prop.getLower()).toString(); - Qualifier qualifierObject = qualifiersList.GetElement(qualifierName); - addQualiferToValueTable(qualifierName, value, definedIn, qualifierObject, -1, false); - allAvailableQualifers.remove(qualifierObject); - } + + if((prop.getUpper() != MultiplicityElement.UNLIMITED_UPPER_BOUND) || + (prop.getUpper() == MultiplicityElement.UNLIMITED_UPPER_BOUND + &&prop.getUpper() != (FlavorsHelper.effectiveInheritedValue(element, "Max")).getIntValue())){ + qualifierName = "Max"; + String value = new Integer(prop.getUpper()).toString(); + if(value.equalsIgnoreCase("-1")){ + value = "null"; + } + Qualifier qualifierObject = qualifiersList.GetElement(qualifierName); + addQualiferToValueTable(qualifierName, value, definedIn, qualifierObject, -1, false); + allAvailableQualifers.remove(qualifierObject); + } + if((prop.getLower() != 0) || (prop.getLower() == 0 + && prop.getLower() != (FlavorsHelper.effectiveInheritedValue(element, "Min")).getIntValue())){ + qualifierName = "Min"; + String value = new Integer(prop.getLower()).toString(); + if(value.equalsIgnoreCase("-1")){ + value = "0"; + } + Qualifier qualifierObject = qualifiersList.GetElement(qualifierName); + addQualiferToValueTable(qualifierName, value, definedIn, qualifierObject, -1, false); + allAvailableQualifers.remove(qualifierObject); + } + + +// if(prop.getUpper() != MultiplicityElement.UNLIMITED_UPPER_BOUND){ +// qualifierName = "Max"; +// String value = new Integer(prop.getUpper()).toString(); +// Qualifier qualifierObject = qualifiersList.GetElement(qualifierName); +// addQualiferToValueTable(qualifierName, value, definedIn, qualifierObject, -1, false); +// allAvailableQualifers.remove(qualifierObject); +// } +// if(prop.getLower() != 0){ +// qualifierName = "Min"; +// String value = new Integer(prop.getLower()).toString(); +// Qualifier qualifierObject = qualifiersList.GetElement(qualifierName); +// addQualiferToValueTable(qualifierName, value, definedIn, qualifierObject, -1, false); +// allAvailableQualifers.remove(qualifierObject); +// } } } //Qualifier: Octetstring @@ -1522,10 +1572,28 @@ } // TODO get inherited qualifiers + // Inherited qualifiers + // Get all inherited qualifiers which aren't already defined in this element + boolean isOwnedEnd = false; + if(element instanceof Property){ + Property prop = (Property)element; + isOwnedEnd = propertyIsOwnedEnd(prop); + } + + ValuesTableHelper tableHelper = new ValuesTableHelper(valueTable); + ArrayList inheritedQualifiers = tableHelper.getInheritedQualifers(element, allAvailableQualifers, isOwnedEnd); + for(int k = 0; k < inheritedQualifiers.size(); k++){ + qualifierName = ((QualifierValueObject)inheritedQualifiers.get(k)).name; + String qualifierValue = ((QualifierValueObject)inheritedQualifiers.get(k)).value; + definedIn = ((QualifierValueObject)inheritedQualifiers.get(k)).definedIn; + Qualifier qualifierObject = qualifiersList.GetElement(qualifierName); + addQualiferToValueTable(qualifierName, qualifierValue, definedIn, qualifierObject, -1, false); + allAvailableQualifers.remove(qualifierObject); + } //dispaly all qualifiers with default values if(showAllButton.getSelection()){ - definedIn = ""; + definedIn = "Default value"; for(Iterator iterator1 = allAvailableQualifers.iterator(); iterator1.hasNext();) { Qualifier qualifier = (Qualifier)iterator1.next(); @@ -2304,6 +2372,14 @@ } } + private void setButtonSize(){ + + Point buttonSize = removeButton.computeSize(SWT.DEFAULT, SWT.DEFAULT); + + BUTTON_WIDTH = buttonSize.x; + BUTTON_HEIGHT = buttonSize.y; + } + private void setValueTabLayout(){ FormData formdata = new FormData(); @@ -2312,7 +2388,7 @@ showAllButton.setLayoutData(formdata); formdata = new FormData(); - formdata.right = new FormAttachment(100,-95); + formdata.right = new FormAttachment(100,-BUTTON_WIDTH-10); formdata.top = new FormAttachment(0,5); inheritComboBox.setLayoutData(formdata); @@ -2321,35 +2397,44 @@ formdata.top = new FormAttachment(0,8); inheritLabel.setLayoutData(formdata); - formdata = new FormData(); - formdata.left = new FormAttachment(0,5); - formdata.top = new FormAttachment(showAllButton,8); - elementLabel.setLayoutData(formdata); +// formdata = new FormData(); +// formdata.left = new FormAttachment(0,5); +// formdata.top = new FormAttachment(showAllButton,8); +// elementLabel.setLayoutData(formdata); formdata = new FormData(); formdata.left = new FormAttachment(0,50); - formdata.bottom = new FormAttachment(100,-5); + formdata.bottom = new FormAttachment(100,-6); propertiesComboBox.setLayoutData(formdata); formdata = new FormData(); formdata.left = new FormAttachment(propertiesComboBox,100); - formdata.bottom = new FormAttachment(100,-5); + formdata.bottom = new FormAttachment(100,-6); methodsComboBox.setLayoutData(formdata); formdata = new FormData(); formdata.left = new FormAttachment(methodsComboBox,100); - formdata.bottom = new FormAttachment(100, -5); + formdata.bottom = new FormAttachment(100, -6); rolesComboBox.setLayoutData(formdata); formdata = new FormData(); formdata.left = new FormAttachment(rolesComboBox,100); formdata.bottom = new FormAttachment(100, -5); formdata.height = BUTTON_HEIGHT; + formdata.width = BUTTON_WIDTH; parentButton.setLayoutData(formdata); + +// formdata = new FormData(); +// formdata.right = new FormAttachment(100,-5); +// formdata.top = new FormAttachment(editButton,5); +// //formdata.height = BUTTON_HEIGHT; +// //formdata.width = BUTTON_WIDTH; +// removeButton.setLayoutData(formdata); +// //setButtonSize(); formdata = new FormData(); formdata.right = new FormAttachment(100,-5); - formdata.top = new FormAttachment(0,53); + formdata.top = new FormAttachment(inheritComboBox,5); formdata.height = BUTTON_HEIGHT; formdata.width = BUTTON_WIDTH; editButton.setLayoutData(formdata); @@ -2360,7 +2445,7 @@ formdata.height = BUTTON_HEIGHT; formdata.width = BUTTON_WIDTH; removeButton.setLayoutData(formdata); - + // formdata = new FormData(); // formdata.right = new FormAttachment(100,-5); // formdata.top = new FormAttachment(deleteButton,5); @@ -2391,8 +2476,8 @@ formdata = new FormData(); formdata.left = new FormAttachment(0,5); formdata.right = new FormAttachment(editButton,-5); - formdata.top = new FormAttachment(elementLabel,10); - formdata.bottom = new FormAttachment(propertiesComboBox,-5); + formdata.top = new FormAttachment(inheritComboBox,5); + formdata.bottom = new FormAttachment(parentButton,-5); formdata.height = 200; valueTable.setLayoutData(formdata); @@ -2693,7 +2778,7 @@ performValuesChanges(); valueTable.removeAll(); - fillValueTable(element); + fillValueTable(element, valueTable); valLegendComposite.setVisible(false); applyButton.setEnabled(false); @@ -2706,7 +2791,7 @@ resetRemovedValues(); valueTable.removeAll(); - fillValueTable(element); + fillValueTable(element, valueTable); valLegendComposite.setVisible(false); applyButton.setEnabled(false); @@ -2715,17 +2800,108 @@ } } + private void setDialogTitle(){ + + //String title = shell.getText(); + //String title = + " (" + Constants.toolName + " " + Constants.pluginVersion + ")"; + //String elementLabelText = elementLabel.getText(); + String elementLabelText = getElementLabel(); + + String newTitle = "Edit Qualifiers" + " - " + elementLabelText + " (" + Constants.toolName + " " + Constants.pluginVersion + ")"; + shell.setText(newTitle); +// shell.setText("Edit Qualifiers" + +// " (" + Constants.toolName + " " + Constants.pluginVersion + ")"); + } - private void setElementLabel(){ + +// private void setElementLabel(){ +// if(element instanceof Class){ +// Class class_ = (Class) element; +// String className = class_.getName(); +// Package package_ = (Package) class_.getOwner(); +// String packageName = package_.getName(); +// //elementLabel.setText("<Class> " + className + " in <Package> " + packageName); +// elementLabel.setText("<Class> " + packageName + "::" + className ); +// } +// +// if(element instanceof Property){ +// Property property = (Property) element; +// String propertyName = property.getName(); +// Element owner = property.getOwner(); +// if (owner instanceof Class){ +// Class class_ = (Class) owner; +// String className = class_.getName(); +// Package package_ = (Package) class_.getOwner(); +// String packageName = package_.getName(); +//// elementLabel.setText("<Property> " + propertyName + " of <Class> " + className + +//// " in <Package> " + packageName); +// elementLabel.setText("<Property> " + packageName + "::" + className + "::" + propertyName); +// } +// if (owner instanceof AssociationClass){ +// AssociationClass class_ = (AssociationClass) owner; +// String className = class_.getName(); +// Package package_ = (Package) class_.getOwner(); +// String packageName = package_.getName(); +// if(property.getAssociation() != null){ +//// elementLabel.setText("<Role> " + propertyName + " of <Association> " + className + +//// " in <Package> " + packageName); +// elementLabel.setText("<Role> " + packageName + "::" + className + "::" + propertyName); +// } else { +// elementLabel.setText("<Property> " + packageName + "::" + className + "::" + propertyName); +//// elementLabel.setText("<Property> " + propertyName + " of <Association> " + className + +//// " in <Package> " + packageName); +// } +// } +// } +// +// if(element instanceof Operation){ +// Operation method = (Operation) element; +// String methodName = method.getName(); +// Class class_ = (Class)method.getOwner(); +// String className = class_.getName(); +// Package package_ = (Package) class_.getOwner(); +// String packageName = package_.getName(); +// elementLabel.setText("<Method> " + packageName + "::" + className + "::" + methodName); +// } +// +// if(element instanceof Parameter){ +// Parameter parameter = (Parameter) element; +// String parameterName= parameter.getName(); +// Operation owner = (Operation)parameter.getOwner(); +// String methodName = owner.getName(); +// Class class_ = (Class)owner.getOwner(); +// String className = class_.getName(); +// Package package_ = (Package) class_.getOwner(); +// String packageName = package_.getName(); +//// elementLabel.setText("<Parameter> " + parameterName + " of <Method> "+ methodName + +//// " of <Class> " + className + " in <Package> " + packageName); +// elementLabel.setText("<Parameter> " + packageName + "::" + className + "::" + methodName + "::" + parameterName); +// } +// +// if(element instanceof AssociationClass){ +// AssociationClass associationClass = (AssociationClass) element; +// String className = associationClass.getName(); +// Package package_ = (Package) associationClass.getOwner(); +// String packageName = package_.getName(); +// //elementLabel.setText("<Association> " + className + " in <Package> " + packageName); +// elementLabel.setText("<Association Class> " + packageName + "::" + className ); +// } +// elementLabel.pack(); +// setDialogTitle(); +// +// } + + private String getElementLabel(){ + String elementLabel = ""; + if(element instanceof Class){ Class class_ = (Class) element; String className = class_.getName(); Package package_ = (Package) class_.getOwner(); String packageName = package_.getName(); - elementLabel.setText("<Class> " + className + " in <Package> " + packageName); - } + elementLabel = "<Class> " + packageName + "::" + className; - if(element instanceof Property){ + } else if(element instanceof Property){ Property property = (Property) element; String propertyName = property.getName(); Element owner = property.getOwner(); @@ -2734,36 +2910,31 @@ String className = class_.getName(); Package package_ = (Package) class_.getOwner(); String packageName = package_.getName(); - elementLabel.setText("<Property> " + propertyName + " of <Class> " + className + - " in <Package> " + packageName); - } + elementLabel = "<Property> " + packageName + "::" + className + "::" + propertyName; + + } if (owner instanceof AssociationClass){ AssociationClass class_ = (AssociationClass) owner; String className = class_.getName(); Package package_ = (Package) class_.getOwner(); String packageName = package_.getName(); if(property.getAssociation() != null){ - elementLabel.setText("<Role> " + propertyName + " of <Association> " + className + - " in <Package> " + packageName); + elementLabel = "<Role> " + packageName + "::" + className + "::" + propertyName; } else { - elementLabel.setText("<Property> " + propertyName + " of <Association> " + className + - " in <Package> " + packageName); + elementLabel = "<Property> " + packageName + "::" + className + "::" + propertyName; } } - } - if(element instanceof Operation){ + } else if(element instanceof Operation){ Operation method = (Operation) element; String methodName = method.getName(); Class class_ = (Class)method.getOwner(); String className = class_.getName(); Package package_ = (Package) class_.getOwner(); String packageName = package_.getName(); - elementLabel.setText("<Method> " + methodName + " of <Class> " + className + - " in <Package> " + packageName); - } + elementLabel = "<Method> " + packageName + "::" + className + "::" + methodName; - if(element instanceof Parameter){ + } else if(element instanceof Parameter){ Parameter parameter = (Parameter) element; String parameterName= parameter.getName(); Operation owner = (Operation)parameter.getOwner(); @@ -2772,19 +2943,17 @@ String className = class_.getName(); Package package_ = (Package) class_.getOwner(); String packageName = package_.getName(); - elementLabel.setText("<Parameter> " + parameterName + " of <Method> "+ methodName + - " of <Class> " + className + " in <Package> " + packageName); - } + elementLabel = "<Parameter> " + packageName + "::" + className + "::" + methodName + "::" + parameterName; - if(element instanceof AssociationClass){ + } else if(element instanceof AssociationClass){ AssociationClass associationClass = (AssociationClass) element; String className = associationClass.getName(); Package package_ = (Package) associationClass.getOwner(); String packageName = package_.getName(); - elementLabel.setText("<Association> " + className + " in <Package> " + packageName); + elementLabel = "<Association Class> " + packageName + "::" + className; } - elementLabel.pack(); + return elementLabel; } private void setButtonVisibility(){ @@ -2839,7 +3008,7 @@ parentButton.setVisible(true); parentButton.setText("parent class"); parentButton.setToolTipText("Go to the parent class of this property"); - parentButton.pack(); + //parentButton.pack(); } if (element instanceof Operation){ inheritLabel.setVisible(false); @@ -2850,7 +3019,7 @@ parentButton.setVisible(true); parentButton.setText("parent class"); parentButton.setToolTipText("Go to the parent class of this property"); - parentButton.pack(); + //parentButton.pack(); rolesComboBox.pack(); } if (element instanceof Parameter){ @@ -2862,7 +3031,7 @@ parentButton.setVisible(true); parentButton.setText("parent method"); parentButton.setToolTipText("Go to the parent method of this parameter"); - parentButton.pack(); + //parentButton.pack(); } } @@ -3687,15 +3856,23 @@ private void updateEditedValues(){ QualifierValueObject maxObject = null; + //boolean setMaxDefault = false; for(int i = 0; i < editedValuesIndex; i++){ QualifierValueObject object = editedValues[i]; + // flavors patch ******* + boolean setDefault = false; + String effectiveInheritedValue = FlavorsHelper.effectiveInheritedValue(element, object.name).getValue(); + if(object.value.equalsIgnoreCase(effectiveInheritedValue) && !object.name.equalsIgnoreCase("Min")){ + setDefault = true; + } + //********************** if(object.name.equalsIgnoreCase("Max")){ // ensure that changes of the max qualifier are always // performed after the min qualifier is changed maxObject = object; } else { - editValue(object, false); + editValue(object, setDefault); } } |
From: Benjamin B. <bg...@us...> - 2005-07-20 15:22:11
|
Update of /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/rsa/core/internal/properties In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21123/Plugin/com/ibm/ecute/rsa/core/internal/properties Modified Files: ValuesTableHelper.java QualifiersPropertySection.java EffectiveInheritedValue.java FlavorsHelper.java Log Message: flavors presentation rule implemented for values table in properties section and effectiveInheritedQualifier method implemented Index: FlavorsHelper.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/rsa/core/internal/properties/FlavorsHelper.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- FlavorsHelper.java 19 Jul 2005 16:10:47 -0000 1.3 +++ FlavorsHelper.java 20 Jul 2005 15:21:46 -0000 1.4 @@ -28,6 +28,7 @@ import org.eclipse.uml2.ParameterDirectionKind; import org.eclipse.uml2.Property; import org.eclipse.uml2.Stereotype; +import org.eclipse.uml2.Type; import org.eclipse.uml2.UML2Package; import com.ibm.ecute.EcuteEclipsePlugin; @@ -39,7 +40,7 @@ import com.ibm.xtools.modeler.UMLModeler; /** - * Copyright (c) 2003, International Business Machines + * Copyright (c) 2005, International Business Machines * * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE CONSTITUTES @@ -49,7 +50,9 @@ * http://oss.software.ibm.com/developerworks/opensource/license-cpl.html * * @author Benjamin Bender <be...@de...> + * */ + public class FlavorsHelper { // Copyright private static final String COPYRIGHT = License.COPYRIGHT; @@ -484,7 +487,7 @@ // ABSTRACT if(qualifierName.equalsIgnoreCase("Abstract")){ return null; - //AGGREGATE + //AGGREGATE } else if(qualifierName.equalsIgnoreCase("Aggregate")){ if(element instanceof Property && propertyIsOwnedEnd((Property)element) && override(element)){ Property property = (Property)element; @@ -512,21 +515,21 @@ } else { return null; } - // AGGREGATION + // AGGREGATION } else if(qualifierName.equalsIgnoreCase("Aggregation")){ if(element instanceof AssociationClass){ Class parent = getParentClass((AssociationClass)element); if(parent != null && parent instanceof AssociationClass){ - AssociationClass aClass = (AssociationClass)parent; - EList ends = aClass.getOwnedEnds(); - Iterator iter = ends.iterator(); - while(iter.hasNext()){ - Property prop = (Property)iter.next(); - if(prop.getAggregation().getValue()== AggregationKind.SHARED || - prop.getAggregation().getValue()== AggregationKind.COMPOSITE){ - return (new EffectiveInheritedValue("true", parent)); - } - } + AssociationClass aClass = (AssociationClass)parent; + EList ends = aClass.getOwnedEnds(); + Iterator iter = ends.iterator(); + while(iter.hasNext()){ + Property prop = (Property)iter.next(); + if(prop.getAggregation().getValue()== AggregationKind.SHARED || + prop.getAggregation().getValue()== AggregationKind.COMPOSITE){ + return (new EffectiveInheritedValue("true", parent)); + } + } } else { return null; } @@ -534,20 +537,20 @@ } else { return null; } - // COMPOSITION + // COMPOSITION } else if(qualifierName.equalsIgnoreCase("Composition")){ if(element instanceof AssociationClass){ Class parent = getParentClass((AssociationClass)element); if(parent != null && parent instanceof AssociationClass){ - AssociationClass aClass = (AssociationClass)parent; - EList ends = aClass.getOwnedEnds(); - Iterator iter = ends.iterator(); - while(iter.hasNext()){ - Property prop = (Property)iter.next(); - if(prop.getAggregation().getValue()== AggregationKind.COMPOSITE){ - return (new EffectiveInheritedValue("true", parent)); - } - } + AssociationClass aClass = (AssociationClass)parent; + EList ends = aClass.getOwnedEnds(); + Iterator iter = ends.iterator(); + while(iter.hasNext()){ + Property prop = (Property)iter.next(); + if(prop.getAggregation().getValue()== AggregationKind.COMPOSITE){ + return (new EffectiveInheritedValue("true", parent)); + } + } } else { return null; } @@ -555,10 +558,10 @@ } else { return null; } - // DEPRECATED + // DEPRECATED } else if(qualifierName.equalsIgnoreCase("Deprecated")){ - return null; - // DESCRIPTION + return null; + // DESCRIPTION } else if(qualifierName.equalsIgnoreCase("Description")){ // getParentClasses ArrayList parents = getParentClasses(element); @@ -568,15 +571,15 @@ for(int j = 0; j < parents.size(); j++){ String description = null; - EList list = ((Class)parents.get(j)).getOwnedComments(); - Iterator it = list.iterator(); - while (it.hasNext()){ - Comment comment = (Comment)it.next(); - Stereotype stereo = comment.getApplicableStereotype("Default::Documentation"); - if(stereo != null){ - description = comment.getBody(); - } - } + EList list = ((Class)parents.get(j)).getOwnedComments(); + Iterator it = list.iterator(); + while (it.hasNext()){ + Comment comment = (Comment)it.next(); + Stereotype stereo = comment.getApplicableStereotype("Default::Documentation"); + if(stereo != null){ + description = comment.getBody(); + } + } if(description != null){ return(new EffectiveInheritedValue(description, (Class)parents.get(j))); } @@ -643,8 +646,8 @@ method = (Operation)operationsList.get(i); } } - - if(method != null){ + + if(method != null && equalMethods(operation, method)){ EList list = method.getOwnedComments(); Iterator it = list.iterator(); @@ -674,6 +677,7 @@ for(int j = 0; j < parents.size(); j++){ String description = null; Parameter param = null; + Operation method = null; List operationsList = ((Class)parents.get(j)).getOwnedOperations(); for(int i = 0; i < operationsList.size(); i++){ @@ -681,13 +685,14 @@ List parameterList = ((Operation)operationsList.get(i)).getOwnedParameters(); for(int k = 0; k < parameterList.size(); k++){ if(((Parameter)parameterList.get(k)).getName().equalsIgnoreCase(parameter.getName())){ - param = (Parameter)parameterList.get(k); + param = (Parameter)parameterList.get(k); + method = (Operation)operationsList.get(i); } } } } - - if(param != null){ + + if(param != null && equalMethods(operation, method)){ EList list = param.getOwnedComments(); Iterator it = list.iterator(); @@ -710,7 +715,7 @@ } else { return null; } - // IN + // IN, OUT } else if(qualifierName.equalsIgnoreCase("In") || qualifierName.equalsIgnoreCase("Out")){ if(element instanceof Parameter){ ArrayList parents = getParentClasses(element); @@ -721,8 +726,9 @@ return null; } for(int j = 0; j < parents.size(); j++){ - String description = null; + //String description = null; Parameter param = null; + Operation method = null; List operationsList = ((Class)parents.get(j)).getOwnedOperations(); for(int i = 0; i < operationsList.size(); i++){ @@ -730,13 +736,14 @@ List parameterList = ((Operation)operationsList.get(i)).getOwnedParameters(); for(int k = 0; k < parameterList.size(); k++){ if(((Parameter)parameterList.get(k)).getName().equalsIgnoreCase(parameter.getName())){ - param = (Parameter)parameterList.get(k); + param = (Parameter)parameterList.get(k); + method = (Operation)operationsList.get(i); } } } } - - if(param != null){ + + if(param != null && equalMethods(operation, method)){ ParameterDirectionKind direction = param.getDirection(); String direct = null; @@ -765,6 +772,369 @@ return null; } + } else if (qualifierName.equalsIgnoreCase("Key")){ + + if(element instanceof Property && override(element)){ + ArrayList parents = getParentClasses(element); + if(parents.size() > 0){ + Property property = (Property)element; + + for(int j = 0; j < parents.size(); j++){ + Property attribute = null; + + List attributeList = ((Class)parents.get(j)).getAttributes(); + for(int i = 0; i < attributeList.size(); i++){ + if(((Property)attributeList.get(i)).getName().equalsIgnoreCase(property.getName())){ + attribute = (Property)attributeList.get(i); + } + } + + if(propertyIsOwnedEnd(property)){ + List endList = ((AssociationClass)parents.get(j)).getOwnedEnds(); + for(int i = 0; i < endList.size(); i++){ + if(((Property)endList.get(i)).getName().equalsIgnoreCase(property.getName())){ + attribute = (Property)endList.get(i); + } + } + } + + if(attribute != null){ + Stereotype stereo = attribute.getAppliedStereotype("CIM::Key"); + if(stereo != null){ + return(new EffectiveInheritedValue("true", (Class)parents.get(j))); + } + } + } + } else { + return null; + } + } else { + return null; + } + } else if (qualifierName.equalsIgnoreCase("Min") || qualifierName.equalsIgnoreCase("Max")){ + + if(element instanceof Property && propertyIsOwnedEnd((Property)element) && override(element)){ + ArrayList parents = getParentClasses(element); + if(parents.size() > 0){ + Property property = (Property)element; + + for(int j = 0; j < parents.size(); j++){ + Property attribute = null; + + List endList = ((AssociationClass)parents.get(j)).getOwnedEnds(); + for(int i = 0; i < endList.size(); i++){ + if(((Property)endList.get(i)).getName().equalsIgnoreCase(property.getName())){ + attribute = (Property)endList.get(i); + } + } + + if(attribute != null){ + String value = null; + if (qualifierName.equalsIgnoreCase("Min")){ + value = (new Integer(attribute.getLower())).toString(); + } else { + value = (new Integer(attribute.getUpper())).toString(); + } + return(new EffectiveInheritedValue(value, (Class)parents.get(j))); + } + } + } else { + return null; + } + } else { + return null; + } + // OCTETSTRING + } else if (qualifierName.equalsIgnoreCase("Octetstring")){ + if((element instanceof Property && override(element)) + || (element instanceof Operation && override(element)) + || element instanceof Parameter){ + + ArrayList parents = getParentClasses(element); + if(parents.size() > 0){ + // Property + if(element instanceof Property){ + Property property = (Property)element; + if(property.getType() != null && property.getType().getName().equalsIgnoreCase("String")){ + + for(int j = 0; j < parents.size(); j++){ + Property attribute = null; + List attributeList = ((Class)parents.get(j)).getAttributes(); + for(int i = 0; i < attributeList.size(); i++){ + if(((Property)attributeList.get(i)).getName().equalsIgnoreCase(property.getName())){ + attribute = (Property)attributeList.get(i); + } + } + + if(attribute != null){ + Type datatype = property.getType(); + if(datatype != null){ + if(datatype.getName().equalsIgnoreCase("Octetstring")){ + return(new EffectiveInheritedValue("true", (Class)parents.get(j))); + } + } + } + } + } else { + return null; + } + // Operation + } else if(element instanceof Operation){ + Operation operation = (Operation)element; + if(operation.getType() != null && operation.getType().getName().equalsIgnoreCase("String")){ + for(int j = 0; j < parents.size(); j++){ + Operation method = null; + + List operationsList = ((Class)parents.get(j)).getOwnedOperations(); + for(int i = 0; i < operationsList.size(); i++){ + if(((Operation)operationsList.get(i)).getName().equalsIgnoreCase(operation.getName())){ + method = (Operation)operationsList.get(i); + } + } + + if(method != null && equalMethods(operation, method)){ + + Type datatype = method.getType(); + if(datatype != null){ + if(datatype.getName().equalsIgnoreCase("Octetstring")){ + return(new EffectiveInheritedValue("true", (Class)parents.get(j))); + } + } + } + } + } else { + return null; + } + // Parameter + } else if(element instanceof Parameter){ + + Parameter parameter = (Parameter)element; + if(parameter.getType() != null && parameter.getType().getName().equalsIgnoreCase("String")){ + Operation operation = (Operation)parameter.getOwner(); + if(!override(operation)){ + return null; + } + for(int j = 0; j < parents.size(); j++){ + //String description = null; + Parameter param = null; + Operation method = null; + + List operationsList = ((Class)parents.get(j)).getOwnedOperations(); + for(int i = 0; i < operationsList.size(); i++){ + if(((Operation)operationsList.get(i)).getName().equalsIgnoreCase(operation.getName())){ + List parameterList = ((Operation)operationsList.get(i)).getOwnedParameters(); + for(int k = 0; k < parameterList.size(); k++){ + if(((Parameter)parameterList.get(k)).getName().equalsIgnoreCase(parameter.getName())){ + param = (Parameter)parameterList.get(k); + method = (Operation)operationsList.get(i); + } + } + } + } + + if(param != null && equalMethods(operation, method)){ + + Type datatype = param.getType(); + if(datatype != null){ + if(datatype.getName().equalsIgnoreCase("Octetstring")){ + return(new EffectiveInheritedValue("true", (Class)parents.get(j))); + } + } + } + } + return null; + } else { + return null; + } + } else { + return null; + } + } else { + return null; + } + } else { + return null; + } + // STATIC + } else if (qualifierName.equalsIgnoreCase("Static")){ + if((element instanceof Property || element instanceof Operation) && override(element)){ + ArrayList parents = getParentClasses(element); + if(parents.size() > 0){ + if(element instanceof Property){ + Property property = (Property)element; + + for(int j = 0; j < parents.size(); j++){ + Property attribute = null; + + List attributeList = ((Class)parents.get(j)).getAttributes(); + for(int i = 0; i < attributeList.size(); i++){ + if(((Property)attributeList.get(i)).getName().equalsIgnoreCase(property.getName())){ + attribute = (Property)attributeList.get(i); + } + } + + if(attribute != null && attribute.isStatic()){ + return(new EffectiveInheritedValue("true", (Class)parents.get(j))); + } + } + + } else if(element instanceof Operation){ + Operation operation = (Operation)element; + + for(int j = 0; j < parents.size(); j++){ + Operation method = null; + + List operationsList = ((Class)parents.get(j)).getOwnedOperations(); + for(int i = 0; i < operationsList.size(); i++){ + if(((Operation)operationsList.get(i)).getName().equalsIgnoreCase(operation.getName())){ + method = (Operation)operationsList.get(i); + } + } + + if(method != null && equalMethods(operation, method) && method.isStatic()){ + return(new EffectiveInheritedValue("true", (Class)parents.get(j))); + } + } + } + } else { + return null; + } + } else { + return null; + } + // WRITE + } else if (qualifierName.equalsIgnoreCase("Write")){ + if(element instanceof Property && override(element)){ + ArrayList parents = getParentClasses(element); + if(parents.size() > 0){ + Property property = (Property)element; + + for(int j = 0; j < parents.size(); j++){ + Property attribute = null; + + List attributeList = ((Class)parents.get(j)).getAttributes(); + for(int i = 0; i < attributeList.size(); i++){ + if(((Property)attributeList.get(i)).getName().equalsIgnoreCase(property.getName())){ + attribute = (Property)attributeList.get(i); + } + } + + if(attribute != null && !attribute.isReadOnly()){ + return(new EffectiveInheritedValue("true", (Class)parents.get(j))); + } + } + } else { + return null; + } + } else { + return null; + } + // Qualifiers in the qualifiers stereotype + } else { + // getParentClasses + ArrayList parents = getParentClasses(element); + if(parents.size() > 0 && !qualifierName.equalsIgnoreCase("ArrayType") + && !qualifierName.equalsIgnoreCase("Association")){ + + if(element instanceof Class){ + for(int j = 0; j < parents.size(); j++){ + String qualValue = getQualifiersStereotypeQualifer((Class)parents.get(j), qualifierName); + if(qualValue != null){ + return(new EffectiveInheritedValue(qualValue, (Class)parents.get(j))); + } + } + return null; + } else if (element instanceof Property && override(element)){ + Property property = (Property)element; + for(int j = 0; j < parents.size(); j++){ + String description = null; + Property attribute = null; + + List attributeList = ((Class)parents.get(j)).getAttributes(); + for(int i = 0; i < attributeList.size(); i++){ + if(((Property)attributeList.get(i)).getName().equalsIgnoreCase(property.getName())){ + attribute = (Property)attributeList.get(i); + } + } + if(propertyIsOwnedEnd(property)){ + List endList = ((AssociationClass)parents.get(j)).getOwnedEnds(); + for(int i = 0; i < endList.size(); i++){ + if(((Property)endList.get(i)).getName().equalsIgnoreCase(property.getName())){ + attribute = (Property)endList.get(i); + } + } + } + + if(attribute != null){ + + String qualValue = getQualifiersStereotypeQualifer(attribute, qualifierName); + if(qualValue != null){ + return(new EffectiveInheritedValue(qualValue, (Class)parents.get(j))); + } + } + } + return null; + + } else if (element instanceof Operation && override(element)){ + Operation operation = (Operation)element; + for(int j = 0; j < parents.size(); j++){ + String description = null; + Operation method = null; + + List operationsList = ((Class)parents.get(j)).getOwnedOperations(); + for(int i = 0; i < operationsList.size(); i++){ + if(((Operation)operationsList.get(i)).getName().equalsIgnoreCase(operation.getName())){ + method = (Operation)operationsList.get(i); + } + } + + if(method != null){ + + String qualValue = getQualifiersStereotypeQualifer(method, qualifierName); + if(qualValue != null){ + return(new EffectiveInheritedValue(qualValue, (Class)parents.get(j))); + } + } + } + return null; + + } else if (element instanceof Parameter){ + Parameter parameter = (Parameter)element; + Operation operation = (Operation)parameter.getOwner(); + if(!override(operation)){ + return null; + } + for(int j = 0; j < parents.size(); j++){ + String description = null; + Parameter param = null; + + List operationsList = ((Class)parents.get(j)).getOwnedOperations(); + for(int i = 0; i < operationsList.size(); i++){ + if(((Operation)operationsList.get(i)).getName().equalsIgnoreCase(operation.getName())){ + List parameterList = ((Operation)operationsList.get(i)).getOwnedParameters(); + for(int k = 0; k < parameterList.size(); k++){ + if(((Parameter)parameterList.get(k)).getName().equalsIgnoreCase(parameter.getName())){ + param = (Parameter)parameterList.get(k); + } + } + } + } + + if(param != null){ + + String qualValue = getQualifiersStereotypeQualifer(param, qualifierName); + if(qualValue != null){ + return(new EffectiveInheritedValue(qualValue, (Class)parents.get(j))); + } + } + } + return null; + } else { + return null; + } + } else { + return null; + } } return null; } @@ -815,6 +1185,24 @@ return parents; } + private static String getQualifiersStereotypeQualifer(NamedElement element, String qualifierName){ + String qualifierValue = null; + + Stereotype cimStereotype = element.getAppliedStereotype("CIM::Qualifiers"); + List qualifierNames = (List)element.getValue(cimStereotype, "QualifierName"); + List qualifierValues = (List)element.getValue(cimStereotype, "QualifierValue"); + + for(int i = 0; i < qualifierNames.size(); i++){ + String qualName = (String)qualifierNames.get(i); + String qualValue = (String)qualifierValues.get(i); + + if(qualName.equalsIgnoreCase(qualifierName)){ + qualifierValue = qualValue; + } + } + return qualifierValue; + } + private static boolean override(NamedElement namedElement){ Stereotype cimStereotype = namedElement.getAppliedStereotype("CIM::Qualifiers"); @@ -831,6 +1219,38 @@ return false; } + private static boolean equalMethods(Operation method1, Operation method2){ + + if(method1 == null || method2 == null){ + return false; + } + + List methodParameters1 = method1.getOwnedParameters(); + List methodParameters2 = method2.getOwnedParameters(); + + if(methodParameters1.size() != methodParameters2.size()){ + return false; + } + + for (int i = 0; i < methodParameters1.size(); i++){ + Parameter parameter1 = (Parameter)methodParameters1.get(i); + Parameter parameter2 = (Parameter)methodParameters2.get(i); + + if(!parameter1.getName().equalsIgnoreCase(parameter2.getName())){ + return false; + } + if(!(parameter1.getType()).getName().equalsIgnoreCase((parameter2.getType()).getName())){ + if(((parameter1.getType()).getName().equalsIgnoreCase("String") || (parameter1.getType()).getName().equalsIgnoreCase("Octetstring")) && + ((parameter2.getType()).getName().equalsIgnoreCase("String") || (parameter2.getType()).getName().equalsIgnoreCase("Octetstring"))){ + continue; + } else { + return false; + } + } + } + return true; + } + } Index: EffectiveInheritedValue.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/rsa/core/internal/properties/EffectiveInheritedValue.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- EffectiveInheritedValue.java 19 Jul 2005 16:10:47 -0000 1.1 +++ EffectiveInheritedValue.java 20 Jul 2005 15:21:46 -0000 1.2 @@ -8,14 +8,26 @@ import org.eclipse.uml2.Class; +import com.ibm.ecute.utils.License; + /** - * @author Benjamin Bender - * - * TODO To change the template for this generated type comment go to - * Window - Preferences - Java - Code Style - Code Templates + * Copyright (c) 2005, International Business Machines + * + * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE + * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE CONSTITUTES + * RECIPIENTS ACCEPTANCE OF THE AGREEMENT. + * + * You can obtain a current copy of the Common Public License from + * http://oss.software.ibm.com/developerworks/opensource/license-cpl.html + * + * @author Benjamin Bender <be...@de...> */ + public class EffectiveInheritedValue { + // Copyright + private static final String COPYRIGHT = License.COPYRIGHT; + protected String value; protected Class definedIn; @@ -31,4 +43,14 @@ public Class getDefinedIn(){ return this.definedIn; } + + public int getIntValue(){ + int value; + try { + value = (new Integer(this.value)).intValue(); + } catch (NumberFormatException e) { + return -1; + } + return value; + } } Index: ValuesTableHelper.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/rsa/core/internal/properties/ValuesTableHelper.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ValuesTableHelper.java 19 Jul 2005 16:10:47 -0000 1.2 +++ ValuesTableHelper.java 20 Jul 2005 15:21:46 -0000 1.3 @@ -7,15 +7,11 @@ package com.ibm.ecute.rsa.core.internal.properties; import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; import org.eclipse.emf.common.util.EList; import org.eclipse.swt.widgets.Table; -import org.eclipse.uml2.AggregationKind; import org.eclipse.uml2.AssociationClass; import org.eclipse.uml2.Class; -import org.eclipse.uml2.Comment; import org.eclipse.uml2.Constraint; import org.eclipse.uml2.NamedElement; import org.eclipse.uml2.OpaqueExpression; @@ -23,18 +19,27 @@ import org.eclipse.uml2.Package; import org.eclipse.uml2.Parameter; import org.eclipse.uml2.Property; -import org.eclipse.uml2.Stereotype; import com.ibm.ecute.Qualifiers.Qualifier; - +import com.ibm.ecute.utils.License; /** - * @author Benjamin Bender - * - * TODO To change the template for this generated type comment go to - * Window - Preferences - Java - Code Style - Code Templates + * Copyright (c) 2005, International Business Machines + * + * THIS FILE IS PROVIDED UNDER THE TERMS OF THE COMMON PUBLIC LICENSE + * ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION OF THIS FILE CONSTITUTES + * RECIPIENTS ACCEPTANCE OF THE AGREEMENT. + * + * You can obtain a current copy of the Common Public License from + * http://oss.software.ibm.com/developerworks/opensource/license-cpl.html + * + * @author Benjamin Bender <be...@de...> */ + public class ValuesTableHelper { + + // Copyright + private static final String COPYRIGHT = License.COPYRIGHT; Table table; @@ -42,302 +47,6 @@ this.table = table; } -// public void sortValuesTableBy(int columnNumber){ -// -// Collator collator = Collator.getInstance(Locale.getDefault()); -// -// boolean decreasing = false; -// TableItem[] column = table.getItems(); -// for (int h = 0; h < column.length-1; h++) { -// String value1 = column[h].getText(columnNumber); -// String value2 = column[h+1].getText(columnNumber); -// if (collator.compare(value1, value2) > 0) { -// decreasing = true; -// } -// } -// -// TableItem[] items = table.getItems(); -// for (int i = 1; i < items.length; i++) { -// String value1 = items[i].getText(columnNumber); -// QualifierValueObject data1 = (QualifierValueObject)items[i].getData(); -// for (int j = 0; j < i; j++){ -// String value2 = items[j].getText(columnNumber); -// if(decreasing){ -// if (collator.compare(value1, value2) < 0) { -// String[] values = {items[i].getText(0), items[i].getText(1), items[i].getText(2), -// items[i].getText(3), items[i].getText(4), items[i].getText(5)}; -// items[i].dispose(); -// TableItem item = new TableItem(table, SWT.NONE, j); -// item.setText(values); -// item.setData(data1); -// items = table.getItems(); -// break; -// } -// } else { -// if (collator.compare(value1, value2) > 0) { -// String[] values = {items[i].getText(0), items[i].getText(1), items[i].getText(2), -// items[i].getText(3), items[i].getText(4), items[i].getText(5)}; -// items[i].dispose(); -// TableItem item = new TableItem(table, SWT.NONE, j); -// item.setText(values); -// item.setData(data1); -// items = table.getItems(); -// break; -// } -// } -// } -// } -// } - - public ArrayList getInheritedQualifers(NamedElement element, ArrayList allAvailableQualifiers, boolean isReference){ - //TODO BB - ArrayList inheritedList = new ArrayList(); - - // get applicable qualifiers for the element - ArrayList applicableQualifiers = new ArrayList(); - for(int i = 0; i < allAvailableQualifiers.size(); i++){ - - Qualifier qualifier = (Qualifier)allAvailableQualifiers.get(i); - if(element instanceof Class && qualifier.classScope && !qualifier.RestrictedFlavor){ - applicableQualifiers.add(qualifier); - } else if(element instanceof AssociationClass && qualifier.associationScope && !qualifier.RestrictedFlavor){ - applicableQualifiers.add(qualifier); - } else if(element instanceof Property && !isReference && qualifier.propertyScope && !qualifier.RestrictedFlavor){ - applicableQualifiers.add(qualifier); - } else if(element instanceof Property && isReference && qualifier.referenceScope && !qualifier.RestrictedFlavor){ - applicableQualifiers.add(qualifier); - } else if(element instanceof Operation && qualifier.methodScope && !qualifier.RestrictedFlavor){ - applicableQualifiers.add(qualifier); - } else if(element instanceof Parameter && qualifier.parameterScope && !qualifier.RestrictedFlavor){ - applicableQualifiers.add(qualifier); - } - } - applicableQualifiers.trimToSize(); - -// if((element instanceof Class || element instanceof AssociationClass) && applicableQualifiers.size() > 0){ -// inheritedList = getInheritedClassQualifiers(element, applicableQualifiers, allAvailableQualifiers); -// } else if(element instanceof Property && isReference && applicableQualifiers.size() > 0){ -// inheritedList = getInheritedReferenceQualifiers(element, applicableQualifiers, allAvailableQualifiers, isReference); -// } -// return inheritedList; - - return getEffectiveInheritedValues(element, applicableQualifiers, allAvailableQualifiers); - } - - public QualifierValueObject checkIfInherited(Qualifier qualifier, Class class_, boolean lastParent){ - QualifierValueObject returnQualifierObject = null; - String classQualifierValue = null; - - if(qualifier.name.equalsIgnoreCase("Abstract")){ - if(class_.isAbstract()){ - classQualifierValue = "true"; - } else { - classQualifierValue = "false"; - } - } else if (qualifier.name.equalsIgnoreCase("Description")){ - EList list = class_.getOwnedComments(); - Iterator it = list.iterator(); - while (it.hasNext()){ - Comment comment = (Comment)it.next(); - Stereotype stereo = comment.getApplicableStereotype("Default::Documentation"); - if(stereo != null){ - classQualifierValue = comment.getBody(); - } - } - } else if (qualifier.name.equalsIgnoreCase("Deprecated")){ - Stereotype stereo = class_.getAppliedStereotype("CIM::Deprecated"); - if(stereo != null){ - classQualifierValue = (String)class_.getValue(stereo, "Value"); - } - } else if (!(class_ instanceof AssociationClass) && qualifier.name.equalsIgnoreCase("OCL")){ - String oclValue = existsOCL(class_); - if(oclValue != null) - classQualifierValue = oclValue; - } else if (class_ instanceof AssociationClass && qualifier.name.equalsIgnoreCase("Aggregation")){ - AssociationClass aClass = (AssociationClass)class_; - EList ends = aClass.getOwnedEnds(); - Iterator iter = ends.iterator(); - while(iter.hasNext()){ - Property prop = (Property)iter.next(); - if(prop.getAggregation().getValue()== AggregationKind.SHARED || - prop.getAggregation().getValue()== AggregationKind.COMPOSITE){ - classQualifierValue = "true"; - break; - } - } - - } else if (class_ instanceof AssociationClass && qualifier.name.equalsIgnoreCase("Composition")){ - AssociationClass aClass = (AssociationClass)class_; - EList ends = aClass.getOwnedEnds(); - Iterator iter = ends.iterator(); - while(iter.hasNext()){ - Property prop = (Property)iter.next(); - if(prop.getAggregation().getValue()== AggregationKind.COMPOSITE){ - classQualifierValue = "true"; - break; - } - } - } else { - - //get all qualifiers witch are set in the Qualifiers-Stereotype - Stereotype cimStereotype = class_.getAppliedStereotype("CIM::Qualifiers"); - List qualifierNames = (List) class_.getValue(cimStereotype, "QualifierName"); - List qualifierValues = (List) class_.getValue(cimStereotype, "QualifierValue"); - - for(int i=0; i<qualifierNames.size(); i++){ - String qualifierName = (String)qualifierNames.get(i); - String qualifierValue = (String)qualifierValues.get(i); - - if(qualifierName.equalsIgnoreCase(qualifier.name)){ - classQualifierValue = qualifierValue; - break; - } - } - - } - - if(classQualifierValue != null && !classQualifierValue.equalsIgnoreCase(qualifier.defaultValue)){ - returnQualifierObject = new QualifierValueObject(qualifier.name, - classQualifierValue, class_.getName() + " (" + - class_.getNearestPackage().getName() + ")" , -1); - } -// if (classQualifierValue == null && lastParent){ -// // set default value and definedIn emptyString -// returnQualifierObject = new QualifierValueObject(qualifier.name, -// qualifier.defaultValue, "", -1); -// } - - return returnQualifierObject; - } - - public QualifierValueObject checkIfInherited(Qualifier qualifier, Property property, boolean isReference, Class class_, boolean lastParent){ - QualifierValueObject returnQualifierObject = null; - - if(isReference && class_ instanceof AssociationClass){ - // property is a reference - AssociationClass thisClass = (AssociationClass)class_; - String propertyQualifierValue = null; - - if(qualifier.name.equalsIgnoreCase("Aggregate")){ - // check if parent association aggregates - Property otherEnd; - // get other association end - List associationEnds = thisClass.getOwnedEnds(); - if(associationEnds.size() >= 2){ - Property end1 = (Property)associationEnds.get(0); - Property end2 = (Property)associationEnds.get(1); - if(end1.getName().equalsIgnoreCase(property.getName())){ - otherEnd = end2; - } else { - otherEnd = end1; - } - } else { - return null; - } - // check if other end as aggregate qualifier - if(otherEnd.getAggregation().getValue() == AggregationKind.COMPOSITE || otherEnd.getAggregation().getValue() == AggregationKind.SHARED){ - propertyQualifierValue = "true"; - } else { - propertyQualifierValue = "false"; - } - - } else if(qualifier.name.equalsIgnoreCase("Min") || qualifier.name.equalsIgnoreCase("Max")){ - Property thisEnd; - // get this association end - List associationEnds = thisClass.getOwnedEnds(); - if(associationEnds.size() >= 2){ - Property end1 = (Property)associationEnds.get(0); - Property end2 = (Property)associationEnds.get(1); - if(end1.getName().equalsIgnoreCase(property.getName())){ - thisEnd = end1; - } else { - thisEnd = end2; - } - } else { - return null; - } - // get qualifier value - if(qualifier.name.equalsIgnoreCase("Min")){ - propertyQualifierValue = new Integer(thisEnd.getLower()).toString(); - } else { - propertyQualifierValue = new Integer(thisEnd.getUpper()).toString(); - } - } else if(!isReference){ - - } - - Property attribute = null; - - List attributeList = class_.getAttributes(); - for(int i = 0; i < attributeList.size(); i++){ - if(((Property)attributeList.get(i)).getName().equalsIgnoreCase(property.getName())){ - attribute = (Property)attributeList.get(i); - } - } - if(isReference){ - List endList = ((AssociationClass)class_).getOwnedEnds(); - for(int i = 0; i < endList.size(); i++){ - if(((Property)endList.get(i)).getName().equalsIgnoreCase(property.getName())){ - attribute = (Property)endList.get(i); - } - } - } - - - if(attribute != null){ - if (qualifier.name.equalsIgnoreCase("Description")){ - - EList list = attribute.getOwnedComments(); - Iterator it = list.iterator(); - while (it.hasNext()){ - Comment comment = (Comment)it.next(); - Stereotype stereo = comment.getApplicableStereotype("Default::Documentation"); - if(stereo != null){ - propertyQualifierValue = comment.getBody(); - } - } - - } else if (qualifier.name.equalsIgnoreCase("Deprecated")){ - Stereotype stereo = attribute.getAppliedStereotype("CIM::Deprecated"); - if(stereo != null){ - propertyQualifierValue = (String)attribute.getValue(stereo, "Value"); - } - - } else if (qualifier.name.equalsIgnoreCase("Key")){ - Stereotype stereo = attribute.getAppliedStereotype("CIM::Key"); - if(stereo != null){ - propertyQualifierValue = "true"; - } - - } else { - - //get all qualifiers witch are set in the Qualifiers-Stereotype - Stereotype cimStereotype = attribute.getAppliedStereotype("CIM::Qualifiers"); - List qualifierNames = (List) attribute.getValue(cimStereotype, "QualifierName"); - List qualifierValues = (List) attribute.getValue(cimStereotype, "QualifierValue"); - - for(int i=0; i < qualifierNames.size(); i++){ - String qualifierName = (String)qualifierNames.get(i); - String qualifierValue = (String)qualifierValues.get(i); - - if(qualifierName.equalsIgnoreCase(qualifier.name)){ - propertyQualifierValue = qualifierValue; - break; - } - } - } - } - - if(propertyQualifierValue != null && !propertyQualifierValue.equalsIgnoreCase(qualifier.defaultValue)){ - returnQualifierObject = new QualifierValueObject(qualifier.name, - propertyQualifierValue, class_.getName() + " (" + - class_.getNearestPackage().getName() + ")" , -1); - } - } - - return returnQualifierObject; - } - public String existsOCL(Class class_ ){ String value = null; @@ -365,61 +74,35 @@ } } - // return the cantent of the constraint + // return the content of the constraint return value; } - private ArrayList getInheritedClassQualifiers(NamedElement element, ArrayList applicableQualifiers, ArrayList allAvailableQualifiers){ - ArrayList inheritedList = new ArrayList(); - Class thisClass = (Class)element; - // get parent classes - ArrayList parents = getParentClasses(thisClass); - parents.trimToSize(); - - if(parents.size() > 0){ - for(int i = 0; i < applicableQualifiers.size(); i++){ - boolean lastParent = false; - for(int j = 0; j < parents.size(); j++){ - if(j == parents.size()-1) lastParent = true; - QualifierValueObject isInherited = checkIfInherited((Qualifier)applicableQualifiers.get(i), (Class)parents.get(j), lastParent); - if(isInherited != null){ - inheritedList.add(isInherited); - allAvailableQualifiers.remove((Qualifier)applicableQualifiers.get(i)); - break; - } - } - } - } - - return inheritedList; - } - private ArrayList getInheritedReferenceQualifiers(NamedElement element, ArrayList applicableQualifiers, ArrayList allAvailableQualifiers, boolean isReference){ - ArrayList inheritedList = new ArrayList(); - Property property = (Property)element; - if(overrides(element)){ - // get parent classes - ArrayList parents = getParentClasses((Class)property.getOwner()); - parents.trimToSize(); - - if(parents.size() > 0){ - for(int i = 0; i < applicableQualifiers.size(); i++){ - boolean lastParent = false; - for(int j = 0; j < parents.size(); j++){ - if(j == parents.size()-1) lastParent = true; - QualifierValueObject isInherited = checkIfInherited((Qualifier)applicableQualifiers.get(i), property, isReference, (Class)parents.get(j), lastParent); - if(isInherited != null){ - inheritedList.add(isInherited); - allAvailableQualifiers.remove((Qualifier)applicableQualifiers.get(i)); - break; - } - } - } - } - } - - return inheritedList; - } + public ArrayList getInheritedQualifers(NamedElement element, ArrayList allAvailableQualifiers, boolean isReference){ + + // get applicable qualifiers for the element + ArrayList applicableQualifiers = new ArrayList(); + for(int i = 0; i < allAvailableQualifiers.size(); i++){ + + Qualifier qualifier = (Qualifier)allAvailableQualifiers.get(i); + if(element instanceof Class && qualifier.classScope && !qualifier.RestrictedFlavor){ + applicableQualifiers.add(qualifier); + } else if(element instanceof AssociationClass && qualifier.associationScope && !qualifier.RestrictedFlavor){ + applicableQualifiers.add(qualifier); + } else if(element instanceof Property && !isReference && qualifier.propertyScope && !qualifier.RestrictedFlavor){ + applicableQualifiers.add(qualifier); + } else if(element instanceof Property && isReference && qualifier.referenceScope && !qualifier.RestrictedFlavor){ + applicableQualifiers.add(qualifier); + } else if(element instanceof Operation && qualifier.methodScope && !qualifier.RestrictedFlavor){ + applicableQualifiers.add(qualifier); + } else if(element instanceof Parameter && qualifier.parameterScope && !qualifier.RestrictedFlavor){ + applicableQualifiers.add(qualifier); + } + } + applicableQualifiers.trimToSize(); + return getEffectiveInheritedValues(element, applicableQualifiers, allAvailableQualifiers); + } private ArrayList getEffectiveInheritedValues(NamedElement element, ArrayList applicableQualifiers, ArrayList allAvailableQualifiers){ ArrayList inheritedList = new ArrayList(); @@ -444,33 +127,297 @@ return inheritedList; } +} - private ArrayList getParentClasses(Class thisClass){ - ArrayList parents = new ArrayList(); - List generals = thisClass.getGenerals(); - while (generals.size() > 0){ - Class class_ = (Class)generals.get(0); - parents.add(class_); - generals = class_.getGenerals(); - } - parents.remove(thisClass); - - return parents; - } +// public void sortValuesTableBy(int columnNumber){ +// +// Collator collator = Collator.getInstance(Locale.getDefault()); +// +// boolean decreasing = false; +// TableItem[] column = table.getItems(); +// for (int h = 0; h < column.length-1; h++) { +// String value1 = column[h].getText(columnNumber); +// String value2 = column[h+1].getText(columnNumber); +// if (collator.compare(value1, value2) > 0) { +// decreasing = true; +// } +// } +// +// TableItem[] items = table.getItems(); +// for (int i = 1; i < items.length; i++) { +// String value1 = items[i].getText(columnNumber); +// QualifierValueObject data1 = (QualifierValueObject)items[i].getData(); +// for (int j = 0; j < i; j++){ +// String value2 = items[j].getText(columnNumber); +// if(decreasing){ +// if (collator.compare(value1, value2) < 0) { +// String[] values = {items[i].getText(0), items[i].getText(1), items[i].getText(2), +// items[i].getText(3), items[i].getText(4), items[i].getText(5)}; +// items[i].dispose(); +// TableItem item = new TableItem(table, SWT.NONE, j); +// item.setText(values); +// item.setData(data1); +// items = table.getItems(); +// break; +// } +// } else { +// if (collator.compare(value1, value2) > 0) { +// String[] values = {items[i].getText(0), items[i].getText(1), items[i].getText(2), +// items[i].getText(3), items[i].getText(4), items[i].getText(5)}; +// items[i].dispose(); +// TableItem item = new TableItem(table, SWT.NONE, j); +// item.setText(values); +// item.setData(data1); +// items = table.getItems(); +// break; +// } +// } +// } +// } +//} + + + +//public QualifierValueObject checkIfInherited(Qualifier qualifier, Class class_, boolean lastParent){ +// QualifierValueObject returnQualifierObject = null; +// String classQualifierValue = null; +// +// if(qualifier.name.equalsIgnoreCase("Abstract")){ +// if(class_.isAbstract()){ +// classQualifierValue = "true"; +// } else { +// classQualifierValue = "false"; +// } +// } else if (qualifier.name.equalsIgnoreCase("Description")){ +// EList list = class_.getOwnedComments(); +// Iterator it = list.iterator(); +// while (it.hasNext()){ +// Comment comment = (Comment)it.next(); +// Stereotype stereo = comment.getApplicableStereotype("Default::Documentation"); +// if(stereo != null){ +// classQualifierValue = comment.getBody(); +// } +// } +// } else if (qualifier.name.equalsIgnoreCase("Deprecated")){ +// Stereotype stereo = class_.getAppliedStereotype("CIM::Deprecated"); +// if(stereo != null){ +// classQualifierValue = (String)class_.getValue(stereo, "Value"); +// } +// } else if (!(class_ instanceof AssociationClass) && qualifier.name.equalsIgnoreCase("OCL")){ +// String oclValue = existsOCL(class_); +// if(oclValue != null) +// classQualifierValue = oclValue; +// } else if (class_ instanceof AssociationClass && qualifier.name.equalsIgnoreCase("Aggregation")){ +// AssociationClass aClass = (AssociationClass)class_; +// EList ends = aClass.getOwnedEnds(); +// Iterator iter = ends.iterator(); +// while(iter.hasNext()){ +// Property prop = (Property)iter.next(); +// if(prop.getAggregation().getValue()== AggregationKind.SHARED || +// prop.getAggregation().getValue()== AggregationKind.COMPOSITE){ +// classQualifierValue = "true"; +// break; +// } +// } +// +// } else if (class_ instanceof AssociationClass && qualifier.name.equalsIgnoreCase("Composition")){ +// AssociationClass aClass = (AssociationClass)class_; +// EList ends = aClass.getOwnedEnds(); +// Iterator iter = ends.iterator(); +// while(iter.hasNext()){ +// Property prop = (Property)iter.next(); +// if(prop.getAggregation().getValue()== AggregationKind.COMPOSITE){ +// classQualifierValue = "true"; +// break; +// } +// } +// } else { +// +// //get all qualifiers witch are set in the Qualifiers-Stereotype +// Stereotype cimStereotype = class_.getAppliedStereotype("CIM::Qualifiers"); +// List qualifierNames = (List) class_.getValue(cimStereotype, "QualifierName"); +// List qualifierValues = (List) class_.getValue(cimStereotype, "QualifierValue"); +// +// for(int i=0; i<qualifierNames.size(); i++){ +// String qualifierName = (String)qualifierNames.get(i); +// String qualifierValue = (String)qualifierValues.get(i); +// +// if(qualifierName.equalsIgnoreCase(qualifier.name)){ +// classQualifierValue = qualifierValue; +// break; +// } +// } +// +// } +// +// if(classQualifierValue != null && !classQualifierValue.equalsIgnoreCase(qualifier.defaultValue)){ +// returnQualifierObject = new QualifierValueObject(qualifier.name, +// classQualifierValue, class_.getName() + " (" + +// class_.getNearestPackage().getName() + ")" , -1); +// } +//// if (classQualifierValue == null && lastParent){ +//// // set default value and definedIn emptyString +//// returnQualifierObject = new QualifierValueObject(qualifier.name, +//// qualifier.defaultValue, "", -1); +//// } +// +// return returnQualifierObject; +//} +// +//public QualifierValueObject checkIfInherited(Qualifier qualifier, Property property, boolean isReference, Class class_, boolean lastParent){ +// QualifierValueObject returnQualifierObject = null; +// +// if(isReference && class_ instanceof AssociationClass){ +// // property is a reference +// AssociationClass thisClass = (AssociationClass)class_; +// String propertyQualifierValue = null; +// +// if(qualifier.name.equalsIgnoreCase("Aggregate")){ +// // check if parent association aggregates +// Property otherEnd; +// // get other association end +// List associationEnds = thisClass.getOwnedEnds(); +// if(associationEnds.size() >= 2){ +// Property end1 = (Property)associationEnds.get(0); +// Property end2 = (Property)associationEnds.get(1); +// if(end1.getName().equalsIgnoreCase(property.getName())){ +// otherEnd = end2; +// } else { +// otherEnd = end1; +// } +// } else { +// return null; +// } +// // check if other end as aggregate qualifier +// if(otherEnd.getAggregation().getValue() == AggregationKind.COMPOSITE || otherEnd.getAggregation().getValue() == AggregationKind.SHARED){ +// propertyQualifierValue = "true"; +// } else { +// propertyQualifierValue = "false"; +// } +// +// } else if(qualifier.name.equalsIgnoreCase("Min") || qualifier.name.equalsIgnoreCase("Max")){ +// Property thisEnd; +// // get this association end +// List associationEnds = thisClass.getOwnedEnds(); +// if(associationEnds.size() >= 2){ +// Property end1 = (Property)associationEnds.get(0); +// Property end2 = (Property)associationEnds.get(1); +// if(end1.getName().equalsIgnoreCase(property.getName())){ +// thisEnd = end1; +// } else { +// thisEnd = end2; +// } +// } else { +// return null; +// } +// // get qualifier value +// if(qualifier.name.equalsIgnoreCase("Min")){ +// propertyQualifierValue = new Integer(thisEnd.getLower()).toString(); +// } else { +// propertyQualifierValue = new Integer(thisEnd.getUpper()).toString(); +// } +// } else if(!isReference){ +// +// } +// +// Property attribute = null; +// +// List attributeList = class_.getAttributes(); +// for(int i = 0; i < attributeList.size(); i++){ +// if(((Property)attributeList.get(i)).getName().equalsIgnoreCase(property.getName())){ +// attribute = (Property)attributeList.get(i); +// } +// } +// if(isReference){ +// List endList = ((AssociationClass)class_).getOwnedEnds(); +// for(int i = 0; i < endList.size(); i++){ +// if(((Property)endList.get(i)).getName().equalsIgnoreCase(property.getName())){ +// attribute = (Property)endList.get(i); +// } +// } +// } +// +// +// if(attribute != null){ +// if (qualifier.name.equalsIgnoreCase("Description")){ +// +// EList list = attribute.getOwnedComments(); +// Iterator it = list.iterator(); +// while (it.hasNext()){ +// Comment comment = (Comment)it.next(); +// Stereotype stereo = comment.getApplicableStereotype("Default::Documentation"); +// if(stereo != null){ +// propertyQualifierValue = comment.getBody(); +// } +// } +// +// } else if (qualifier.name.equalsIgnoreCase("Deprecated")){ +// Stereotype stereo = attribute.getAppliedStereotype("CIM::Deprecated"); +// if(stereo != null){ +// propertyQualifierValue = (String)attribute.getValue(stereo, "Value"); +// } +// +// } else if (qualifier.name.equalsIgnoreCase("Key")){ +// Stereotype stereo = attribute.getAppliedStereotype("CIM::Key"); +// if(stereo != null){ +// propertyQualifierValue = "true"; +// } +// +// } else { +// +// //get all qualifiers witch are set in the Qualifiers-Stereotype +// Stereotype cimStereotype = attribute.getAppliedStereotype("CIM::Qualifiers"); +// List qualifierNames = (List) attribute.getValue(cimStereotype, "QualifierName"); +// List qualifierValues = (List) attribute.getValue(cimStereotype, "QualifierValue"); +// +// for(int i=0; i < qualifierNames.size(); i++){ +// String qualifierName = (String)qualifierNames.get(i); +// String qualifierValue = (String)qualifierValues.get(i); +// +// if(qualifierName.equalsIgnoreCase(qualifier.name)){ +// propertyQualifierValue = qualifierValue; +// break; +// } +// } +// } +// } +// +// if(propertyQualifierValue != null && !propertyQualifierValue.equalsIgnoreCase(qualifier.defaultValue)){ +// returnQualifierObject = new QualifierValueObject(qualifier.name, +// propertyQualifierValue, class_.getName() + " (" + +// class_.getNearestPackage().getName() + ")" , -1); +// } +// } +// +// return returnQualifierObject; +//} - private boolean overrides(NamedElement element){ - - Stereotype cimStereotype = element.getAppliedStereotype("CIM::Qualifiers"); - List qualifierNames = (List) element.getValue(cimStereotype, "QualifierName"); - //List qualifierValues = (List) element.getValue(cimStereotype, "QualifierValue"); - - for(int i = 0; i < qualifierNames.size(); i++){ - if(((String)(qualifierNames.get(i))).equalsIgnoreCase("Override")){ - return true; - } - } - return false; - } +// private ArrayList getParentClasses(Class thisClass){ +// ArrayList parents = new ArrayList(); +// List generals = thisClass.getGenerals(); +// while (generals.size() > 0){ +// Class class_ = (Class)generals.get(0); +// parents.add(class_); +// generals = class_.getGenerals(); +// } +// parents.remove(thisClass); +// +// return parents; +// } + +// private boolean overrides(NamedElement element){ +// +// Stereotype cimStereotype = element.getAppliedStereotype("CIM::Qualifiers"); +// List qualifierNames = (List) element.getValue(cimStereotype, "QualifierName"); +// //List qualifierValues = (List) element.getValue(cimStereotype, "QualifierValue"); +// +// for(int i = 0; i < qualifierNames.size(); i++){ +// if(((String)(qualifierNames.get(i))).equalsIgnoreCase("Override")){ +// return true; +// } +// } +// return false; +// } // public class QualifierValueObject{ // private String name; @@ -547,4 +494,56 @@ // } // } // } -} + +// private ArrayList getInheritedClassQualifiers(NamedElement element, ArrayList applicableQualifiers, ArrayList allAvailableQualifiers){ +// ArrayList inheritedList = new ArrayList(); +// Class thisClass = (Class)element; +// // get parent classes +// ArrayList parents = getParentClasses(thisClass); +// parents.trimToSize(); +// +// if(parents.size() > 0){ +// for(int i = 0; i < applicableQualifiers.size(); i++){ +// boolean lastParent = false; +// for(int j = 0; j < parents.size(); j++){ +// if(j == parents.size()-1) lastParent = true; +// QualifierValueObject isInherited = checkIfInherited((Qualifier)applicableQualifiers.get(i), (Class)parents.get(j), lastParent); +// if(isInherited != null){ +// inheritedList.add(isInherited); +// allAvailableQualifiers.remove((Qualifier)applicableQualifiers.get(i)); +// break; +// } +// } +// } +// } +// +// return inheritedList; +//} +// +//private ArrayList getInheritedReferenceQualifiers(NamedElement element, ArrayList applicableQualifiers, ArrayList allAvailableQualifiers, boolean isReference){ +// ArrayList inheritedList = new ArrayList(); +// Property property = (Property)element; +// if(overrides(element)){ +// // get parent classes +// ArrayList parents = getParentClasses((Class)property.getOwner()); +// parents.trimToSize(); +// +// if(parents.size() > 0){ +// for(int i = 0; i < applicableQualifiers.size(); i++){ +// boolean lastParent = false; +// for(int j = 0; j < parents.size(); j++){ +// if(j == parents.size()-1) lastParent = true; +// QualifierValueObject isInherited = checkIfInherited((Qualifier)applicableQualifiers.get(i), property, isReference, (Class)parents.get(j), lastParent); +// if(isInherited != null){ +// inheritedList.add(isInherited); +// allAvailableQualifiers.remove((Qualifier)applicableQualifiers.get(i)); +// break; +// } +// } +// } +// } +// } +// +// return inheritedList; +//} + Index: QualifiersPropertySection.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/rsa/core/internal/properties/QualifiersPropertySection.java,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- QualifiersPropertySection.java 19 Jul 2005 16:10:47 -0000 1.20 +++ QualifiersPropertySection.java 20 Jul 2005 15:21:46 -0000 1.21 @@ -80,6 +80,7 @@ * @author Susanne Katz <ka...@de...> * Benjamin Bender <be...@de...> */ + public class QualifiersPropertySection extends AbstractModelerPropertySection{ // Copyright private static final String COPYRIGHT = License.COPYRIGHT; @@ -275,7 +276,7 @@ definedIn = ((NamedElement)element.getOwner()).getName() + "::" +element.getName()/*+" ("+owner.getNearestPackage().getName()+")"*/; } - //display all qualifiers witch are set in the Qualifiers-Stereotype + //display all qualifiers which are set in the Qualifiers-Stereotype Stereotype cimStereotype = element.getAppliedStereotype("CIM::Qualifiers"); List qualifierNames = (List) element.getValue(cimStereotype, "QualifierName"); List qualifierValues = (List) element.getValue(cimStereotype, "QualifierValue"); @@ -469,14 +470,15 @@ addQualiferToTable(qualifierName, "true", definedIn, qualifierObject, -1, false); } allAvailableQualifers.remove(qualifierObject); - } else { - Qualifier qualifierObject = qualifiersList.GetElement(qualifierName); - exists = existsQualifierInTable(qualifierName); - if (!exists){ - addQualiferToTable(qualifierName, "false", definedIn, qualifierObject, -1, false); - } - allAvailableQualifers.remove(qualifierObject); - } + } +// else { +// Qualifier qualifierObject = qualifiersList.GetElement(qualifierName); +// exists = existsQualifierInTable(qualifierName); +// if (!exists){ +// addQualiferToTable(qualifierName, "false", definedIn, qualifierObject, -1, false); +// } +// allAvailableQualifers.remove(qualifierObject); +// } } //Qualifier: Key qualifierName = "Key"; @@ -489,16 +491,25 @@ //Qualifier: Max, Min if(isOwnedEnd /*&& prop.getOwner() instanceof AssociationCla... [truncated message content] |
From: Benjamin B. <bg...@us...> - 2005-07-20 15:22:11
|
Update of /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/UMLBuffer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21123/Plugin/com/ibm/ecute/UMLBuffer Modified Files: UMLBuffer.java Log Message: flavors presentation rule implemented for values table in properties section and effectiveInheritedQualifier method implemented Index: UMLBuffer.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/UMLBuffer/UMLBuffer.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- UMLBuffer.java 19 Jul 2005 16:10:48 -0000 1.11 +++ UMLBuffer.java 20 Jul 2005 15:21:46 -0000 1.12 @@ -11,7 +11,8 @@ * You can obtain a current copy of the Common Public License from * http://oss.software.ibm.com/developerworks/opensource/license-cpl.html * - * Author: Angel Nunez Mencias <an...@de...> Contributors: + * Author: Angel Nunez Mencias <an...@de...> + * Contributors: Benjamin Bender <be...@de...> * * Description: Stores and after recreate a whole CIM model * @@ -50,14 +51,7 @@ private UMLRole lastRole2 = null; private UMLQualified lastAddedElement = null; boolean aggregateRole1 = true; - //boolean parentAggregates = false; UMLClass parentAggregateClass = null; - //boolean inheritedAggregate = false; - //boolean isFirstAggregate = false; - //boolean parentTwisted = false; - //boolean parentRole1Aggregates = false; - //boolean parentRole2Aggregates = false; - //boolean thisClassAggregates = false; boolean ready = false; private ProgressFrame log; public UMLBuffer(ProgressFrame log) { @@ -137,17 +131,9 @@ public void SetQualifier(int type, String name, String defaultValue) { UMLQualifier theQualifier = new UMLQualifier(name, defaultValue); if (type == TLINK1) -// if(!parentTwisted){ - lastRole1.addQualifier(theQualifier); -// } else { -// lastRole2.addQualifier(theQualifier); -// } + lastRole1.addQualifier(theQualifier); else if (type == TLINK2) -// if(!parentTwisted){ - lastRole2.addQualifier(theQualifier); -// } else { -// lastRole1.addQualifier(theQualifier); -// } + lastRole2.addQualifier(theQualifier); else if (lastAddedElement != null) lastAddedElement.addQualifier(theQualifier); else @@ -527,11 +513,9 @@ void CreateQualifiers(UMLQualified qualifiedElement) { if (UMLProgram instanceof RSAModelCreator){ - if(qualifiedElement.getType() == TCLASS){ lastCreatedClass = (UMLClass) qualifiedElement; } - getInheritedQualifiers(qualifiedElement); } @@ -620,11 +604,10 @@ // called with role 2 first to get the diamond on the correct end of the // association (the diamond is in RSA on the side of the second role // which is passed to AddAssociation) - if (role1Qualifier.name.equalsIgnoreCase("Aggregate") /*&& isFirstAggregate || parentRole1Aggregates*/){ + if (role1Qualifier.name.equalsIgnoreCase("Aggregate")){ //System.out.println("Role 1 is AGGREGATE"); aggregate = true; - //if(!inheritedAggregate) - aggregateRole1 = true; + aggregateRole1 = true; result = UMLProgram.AddAssociation(role2.endPointName, role2.name, role1.endPointName, role1.name, RclassDiagram); break; @@ -639,11 +622,10 @@ // if aggregate is defined in role 2 (MOF file) // aggregateRole1 is set to false to get the qualifiers (with SetQualifiers) // to the correct end of the aggregation/composition - if (role2Qualifier.name.equalsIgnoreCase("Aggregate") /*|| parentRole2Aggregates*/){ + if (role2Qualifier.name.equalsIgnoreCase("Aggregate")){ //System.out.println("Role 2 is AGGREGATE"); aggregate = true; - //if(!inheritedAggregate) - aggregateRole1 = false; + aggregateRole1 = false; result = UMLProgram.AddAssociation(role1.endPointName, role1.name, role2.endPointName, role2.name, RclassDiagram); break; @@ -666,9 +648,9 @@ result = UMLProgram.AddAssociation(role1.endPointName, role1.name, role2.endPointName, role2.name, RclassDiagram); } -// create the qualifiers of the roles -// it doesn't matter if the qualifiers of role 1 are created -// first or not + // create the qualifiers of the roles + // it doesn't matter if the qualifiers of role 1 are created + // first or not if (result == OK) { CreateQualifiers(role1); CreateQualifiers(role2); @@ -766,9 +748,6 @@ if(role.getQualifier("Max", true) == null && parentRole1.getQualifier("Max", true) != null){ role.getQualifiers(true).add(parentRole1.getQualifier("Max", true)); } -// if(role.getQualifier("Key", true) == null && parentRole1.getQualifier("Key", true) != null){ -// role.getQualifiers(true).add(parentRole1.getQualifier("Key", true)); -// } } else if(qualifiedElement.getType() == TLINK2 && role.getQualifier("Override", true) != null){ UMLRole parentRole2 = parentAssociationClass.getRole2(); @@ -779,9 +758,6 @@ if(role.getQualifier("Max", true) == null && parentRole2.getQualifier("Max", true) != null){ role.getQualifiers(true).add(parentRole2.getQualifier("Max", true)); } -// if(role.getQualifier("Key", true) == null && parentRole2.getQualifier("Key", true) != null){ -// role.getQualifiers(true).add(parentRole2.getQualifier("Key", true)); -// } } } @@ -791,8 +767,9 @@ UMLAttribute attribute = (UMLAttribute) qualifiedElement; if(attribute.getQualifier("Override", true) != null){ String overrideValue = ((UMLQualifier)attribute.getQualifier("Override", true)).value; - if(overrideValue == null){ + if(overrideValue == null || overrideValue.equalsIgnoreCase("")){ overrideValue = attribute.getName(); + ((UMLQualifier)attribute.getQualifier("Override", true)).value = attribute.getName(); } UMLAttribute overwrittenAttribute = null; @@ -843,8 +820,9 @@ UMLMethod method = (UMLMethod) qualifiedElement; if(method.getQualifier("Override", true) != null){ String overrideValue = ((UMLQualifier)method.getQualifier("Override", true)).value; - if(overrideValue == null){ + if(overrideValue == null || overrideValue.equalsIgnoreCase("")){ overrideValue = method.getName(); + ((UMLQualifier)method.getQualifier("Override", true)).value = method.getName(); } UMLMethod overwrittenMethod = null; @@ -852,17 +830,6 @@ boolean methodFound = false; while(lastCheckedClass.getBaseUMLClass() != null){ -// ArrayList parentClassAttributes = lastCheckedClass.getBaseUMLClass().getAttributes(true); - -// for(int i = 0; i < parentClassAttributes.size(); i++){ -// UMLAttribute parentAttribute = (UMLAttribute)parentClassAttributes.get(i); -// if(parentAttribute.getName().equalsIgnoreCase(overrideValue)){ -// overwrittenAttribute = parentAttribute; -// attributeFound = true; -// break; -// } -// } - ArrayList parentClassMethods = lastCheckedClass.getBaseUMLClass().getMethods(true); for(int i = 0; i < parentClassMethods.size(); i++){ UMLMethod parentMethod = (UMLMethod)parentClassMethods.get(i); @@ -907,25 +874,6 @@ if(overwrittenMethod != null){ -// ArrayList methodParameters = method.getParameters(); -// ArrayList overwrittenMethodParameters = overwrittenMethod.getParameters(); -// -// // check number of parameters -// if(methodParameters.size() != overwrittenMethodParameters.size()){ -// return; -// } -// -// // check names and types of parameters -// for(int i = 0; i < methodParameters.size(); i++){ -// UMLParameter parameter = (UMLParameter)methodParameters.get(i); -// UMLParameter parentParameter = (UMLParameter)overwrittenMethodParameters.get(i); -// -// if(!parameter.getDataType().equalsIgnoreCase(parentParameter.getDataType()) -// || !parameter.getName().equalsIgnoreCase(parentParameter.getName())){ -// return; -// } -// } - if(method.getQualifier("Octetstring", true) == null && overwrittenMethod.getQualifier("Octetstring", true) != null){ method.getQualifiers(true).add(overwrittenMethod.getQualifier("Octetstring", true)); @@ -937,6 +885,9 @@ } getInheritedParameterQualifiers(method, overwrittenMethod); + + } else { + method.removeQualifier("Override"); } } } @@ -946,22 +897,6 @@ ArrayList methodParameters = method.getParameters(); ArrayList parentMethodParameters = parentMethod.getParameters(); -// // check number of parameters -// if(methodParameters.size() != parentMethodParameters.size()){ -// return; -// } -// -// // check names and types of parameters -// for(int i = 0; i < methodParameters.size(); i++){ -// UMLParameter parameter = (UMLParameter)methodParameters.get(i); -// UMLParameter parentParameter = (UMLParameter)parentMethodParameters.get(i); -// -// if(!parameter.getDataType().equalsIgnoreCase(parentParameter.getDataType()) -// || !parameter.getName().equalsIgnoreCase(parentParameter.getName())){ -// return; -// } -// } - // set qualifiers for(int i = 0; i < methodParameters.size(); i++){ UMLParameter parameter = (UMLParameter)methodParameters.get(i); @@ -982,7 +917,6 @@ parameter.getQualifiers(true).add(parentParameter.getQualifier("Octetstring", true)); } } - } private void getInheritedAggregateQualifier(UMLRole role1, UMLRole role2){ |
From: Benjamin B. <bg...@us...> - 2005-07-20 15:22:00
|
Update of /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/UMLBuffer/UMLTree In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21123/Plugin/com/ibm/ecute/UMLBuffer/UMLTree Modified Files: UMLQualified.java Log Message: flavors presentation rule implemented for values table in properties section and effectiveInheritedQualifier method implemented Index: UMLQualified.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/UMLBuffer/UMLTree/UMLQualified.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- UMLQualified.java 18 Oct 2004 16:03:52 -0000 1.2 +++ UMLQualified.java 20 Jul 2005 15:21:46 -0000 1.3 @@ -60,6 +60,23 @@ qualifiers.add(theQualifier); } + + public void removeQualifier(String qualifierName){ + + int index = -1; + + for(int i = 0; i < qualifiers.size(); i++){ + UMLQualifier qualifier = (UMLQualifier)qualifiers.get(i); + if(qualifier.name.equalsIgnoreCase(qualifierName)){ + index = i; + break; + } + } + + if(index > -1){ + qualifiers.remove(index); + } + } public void addQualifiers(ArrayList qualifiers) { qualifiers.addAll(qualifiers); |
From: Viktor M. <mih...@us...> - 2005-07-20 08:40:57
|
Update of /cvsroot/sblim/sfcb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28451 Modified Files: sfcb.spec.in Log Message: Fixed download URL. Index: sfcb.spec.in =================================================================== RCS file: /cvsroot/sblim/sfcb/sfcb.spec.in,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- sfcb.spec.in 27 Apr 2005 17:48:29 -0000 1.10 +++ sfcb.spec.in 20 Jul 2005 08:40:38 -0000 1.11 @@ -13,7 +13,7 @@ Group: Systems Management/Base License: Common Public License 1.0 -Source0: ftp://www-126.ibm.com/pub/sblim/%{name}-%{version}.tar.bz2 +Source0: ftp://dl.sourceforge.net/pub/s/sb/sblim/%{name}-%{version}.tar.bz2 Provides: cimserver |
From: Gareth S B. <bes...@us...> - 2005-07-19 22:07:42
|
Update of /cvsroot/sblim/sfcb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3059 Modified Files: sfcb.cfg.pre.in Log Message: reordered options to make a bit more logical sense Index: sfcb.cfg.pre.in =================================================================== RCS file: /cvsroot/sblim/sfcb/sfcb.cfg.pre.in,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- sfcb.cfg.pre.in 6 Jul 2005 13:24:33 -0000 1.4 +++ sfcb.cfg.pre.in 19 Jul 2005 22:07:30 -0000 1.5 @@ -1,12 +1,12 @@ httpPort: 5988 +enableHttp: true httpProcs: 8 httpsPort: 5989 -enableHttp: true +enableHttps: false httpsProcs: 8 provProcs: 32 -enableHttps: false -basicAuthLib: sfcBasicAuthentication doBasicAuth: false +basicAuthLib: sfcBasicAuthentication useChunking: true keepaliveTimeout: 0 keepaliveMaxRequest: 10 |
From: Benjamin B. <bg...@us...> - 2005-07-19 16:11:05
|
Update of /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/UMLBuffer In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9740/Plugin/com/ibm/ecute/UMLBuffer Modified Files: UMLBuffer.java Log Message: Index: UMLBuffer.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/UMLBuffer/UMLBuffer.java,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- UMLBuffer.java 15 Jul 2005 13:43:39 -0000 1.10 +++ UMLBuffer.java 19 Jul 2005 16:10:48 -0000 1.11 @@ -42,6 +42,7 @@ private static final String COPYRIGHT = License.COPYRIGHT; private UMLFile mainFile; private UMLClass lastClass = null; + private UMLClass lastCreatedClass = null; private UMLClass lastAssociationClass = null; private UMLFile lastFile = null; private UMLMethod lastMethod = null; @@ -51,12 +52,12 @@ boolean aggregateRole1 = true; //boolean parentAggregates = false; UMLClass parentAggregateClass = null; - boolean inheritedAggregate = false; - boolean isFirstAggregate = false; - boolean parentTwisted = false; - boolean parentRole1Aggregates = false; - boolean parentRole2Aggregates = false; - boolean thisClassAggregates = false; + //boolean inheritedAggregate = false; + //boolean isFirstAggregate = false; + //boolean parentTwisted = false; + //boolean parentRole1Aggregates = false; + //boolean parentRole2Aggregates = false; + //boolean thisClassAggregates = false; boolean ready = false; private ProgressFrame log; public UMLBuffer(ProgressFrame log) { @@ -414,7 +415,7 @@ } break; } - ArrayList qualifiers = theClass.getQualifiers(!completeClasses); + //ArrayList qualifiers = theClass.getQualifiers(!completeClasses); CreateQualifiers(theClass); createAttributes(theClass.getAttributes(!completeClasses)); CreateMethods(theClass.getMethods(!completeClasses)); @@ -522,89 +523,16 @@ } return leftClasses; } + void CreateQualifiers(UMLQualified qualifiedElement) { if (UMLProgram instanceof RSAModelCreator){ - // set UMLClass attribute, if the references are twisted - // required for flavor inheritance - if (qualifiedElement.getType() == TCLASS && - ((UMLClass)qualifiedElement).getRole1() != null && - ((UMLClass)qualifiedElement).getRole2() != null){ - if(((UMLClass)qualifiedElement).getBaseUMLClass() == null){ //TODO change this condition - - parentAggregateClass = (UMLClass)qualifiedElement; - -// if(((UMLClass)qualifiedElement).getRole2().getQualifier("Aggregate", true) != null){ -// parentTwisted = true; -// //parentRole2Aggregates = true; -// } else if(((UMLClass)qualifiedElement).getRole1().getQualifier("Aggregate", true) != null){ -// parentTwisted = false; -// //parentRole1Aggregates = true; -// } else { -// parentTwisted = false; -// } - - //isFirstAggregate = true; - - } //else { - // isFirstAggregate = false; - //} - - } - if (qualifiedElement.getType() == TCLASS - && ((UMLClass)qualifiedElement).getRole1() != null - && ((UMLClass)qualifiedElement).getRole2() != null - && ((UMLClass)qualifiedElement).getBaseUMLClass() != null - && ((UMLClass)qualifiedElement).getQualifier("Aggregation", true) == null - && ((UMLClass)qualifiedElement).getQualifier("Composition", true) == null){ - - UMLClass thisClass = (UMLClass)qualifiedElement; - UMLClass parentClass = ((UMLClass)qualifiedElement).getBaseUMLClass(); - if(parentClass.getQualifier("Aggregation", true) != null && thisClass.getQualifier("Aggregation", true) == null){ - thisClass.getQualifiers(true).add(parentClass.getQualifier("Aggregation", true)); - } - if(parentClass.getQualifier("Composition", true) != null && thisClass.getQualifier("Composition", true) == null){ - thisClass.getQualifiers(true).add(parentClass.getQualifier("Composition", true)); - } - + if(qualifiedElement.getType() == TCLASS){ + lastCreatedClass = (UMLClass) qualifiedElement; } - if((qualifiedElement.getType() == TLINK1 || qualifiedElement.getType() == TLINK2) - && lastAssociationClass.getBaseUMLClass() != null - && lastAssociationClass.getBaseUMLClass().getRole1() != null - && lastAssociationClass.getBaseUMLClass().getRole2() != null){ - - UMLRole role = (UMLRole)qualifiedElement; - UMLClass parentAssociationClass = lastAssociationClass.getBaseUMLClass(); - - if(qualifiedElement.getType() == TLINK1){ - UMLRole parentRole1 = parentAssociationClass.getRole1(); - - if(role.getQualifier("Min", true) == null && parentRole1.getQualifier("Min", true) != null){ - role.getQualifiers(true).add(parentRole1.getQualifier("Min", true)); - } - if(role.getQualifier("Max", true) == null && parentRole1.getQualifier("Max", true) != null){ - role.getQualifiers(true).add(parentRole1.getQualifier("Max", true)); - } - if(role.getQualifier("Key", true) == null && parentRole1.getQualifier("Key", true) != null){ - role.getQualifiers(true).add(parentRole1.getQualifier("Key", true)); - } - - } else if(qualifiedElement.getType() == TLINK2){ - UMLRole parentRole2 = parentAssociationClass.getRole2(); - - if(role.getQualifier("Min", true) == null && parentRole2.getQualifier("Min", true) != null){ - role.getQualifiers(true).add(parentRole2.getQualifier("Min", true)); - } - if(role.getQualifier("Max", true) == null && parentRole2.getQualifier("Max", true) != null){ - role.getQualifiers(true).add(parentRole2.getQualifier("Max", true)); - } - if(role.getQualifier("Key", true) == null && parentRole2.getQualifier("Key", true) != null){ - role.getQualifiers(true).add(parentRole2.getQualifier("Key", true)); - } - } - } + getInheritedQualifiers(qualifiedElement); } ArrayList qualifiers = qualifiedElement.getQualifiers(!completeClasses); @@ -676,41 +604,7 @@ if (UMLProgram instanceof RSAModelCreator){ boolean aggregate = false; - - - // BB - set the aggregate diamond on the correct side of the association - // for normal and inherited associations - if(role1.getQualifier("Aggregate", true) == null && role2.getQualifier("Aggregate", true) == null){ - - if(parentAggregateClass != null && parentAggregateClass.getRole1() != null - && parentAggregateClass.getRole2() != null - /*theClass.getBaseUMLClass() != null && theClass.getBaseUMLClass().getRole1() != null - && theClass.getBaseUMLClass().getRole2() != null*/ ){ - - - //UMLClass parentAggregateClass = theClass.getBaseUMLClass(); - UMLRole parentRole1 = parentAggregateClass.getRole1(); - UMLRole parentRole2 = parentAggregateClass.getRole2(); - - if(parentRole1.getQualifier("Aggregate", true) != null /*&& !parentTwisted*/){ - role1.getQualifiers(true).add(parentRole1.getQualifier("Aggregate", true)); - //parentTwisted = true; - /*} else if(parentRole1.getQualifier("Aggregate", true) != null && parentTwisted){ - role2.getQualifiers(true).add(parentRole1.getQualifier("Aggregate", true)); - //parentTwisted = false; - } else if(parentRole2.getQualifier("Aggregate", true) != null && !parentTwisted){ - role2.getQualifiers(true).add(parentRole2.getQualifier("Aggregate", true)); - //parentTwisted = true;*/ - } else if(parentRole2.getQualifier("Aggregate", true) != null /*&& parentTwisted*/){ - role2.getQualifiers(true).add(parentRole2.getQualifier("Aggregate", true)); - //parentTwisted = false; - } - - //inheritedAggregate = true; - } /*else { - inheritedAggregate = false; - }*/ - } + getInheritedAggregateQualifier(role1, role2); //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // BB- this part influences the direction of the association in the property view + @@ -816,4 +710,300 @@ theTime = theTime + calendar.get(Calendar.SECOND); return theTime; } + + //********************************************************************* + // FLAVORS METHODS FOR RSA + //********************************************************************* + + private void getInheritedQualifiers(UMLQualified qualifiedElement){ + + // propagate class/associationClass qualifiers + if (qualifiedElement.getType() == TCLASS && + ((UMLClass)qualifiedElement).getRole1() != null && + ((UMLClass)qualifiedElement).getRole2() != null){ + if(((UMLClass)qualifiedElement).getBaseUMLClass() == null){ + parentAggregateClass = (UMLClass)qualifiedElement; + } + } + + if (qualifiedElement.getType() == TCLASS + && ((UMLClass)qualifiedElement).getRole1() != null + && ((UMLClass)qualifiedElement).getRole2() != null + && ((UMLClass)qualifiedElement).getBaseUMLClass() != null){ + + UMLClass thisClass = (UMLClass)qualifiedElement; + UMLClass parentClass = thisClass.getBaseUMLClass(); + + if(thisClass.getQualifier("Association", true) == null && parentClass.getQualifier("Association", true) != null){ + thisClass.getQualifiers(true).add(parentClass.getQualifier("Association", true)); + } + + if(thisClass.getQualifier("Aggregation", true) == null && parentClass.getQualifier("Aggregation", true) != null){ + thisClass.getQualifiers(true).add(parentClass.getQualifier("Aggregation", true)); + } + + if(thisClass.getQualifier("Composition", true) == null && parentClass.getQualifier("Composition", true) != null){ + thisClass.getQualifiers(true).add(parentClass.getQualifier("Composition", true)); + } + + } + + // propagate reference qualifiers + if((qualifiedElement.getType() == TLINK1 || qualifiedElement.getType() == TLINK2) + && lastAssociationClass.getBaseUMLClass() != null + && lastAssociationClass.getBaseUMLClass().getRole1() != null + && lastAssociationClass.getBaseUMLClass().getRole2() != null){ + + UMLRole role = (UMLRole)qualifiedElement; + UMLClass parentAssociationClass = lastAssociationClass.getBaseUMLClass(); + + if(qualifiedElement.getType() == TLINK1 && role.getQualifier("Override", true) != null){ + UMLRole parentRole1 = parentAssociationClass.getRole1(); + + if(role.getQualifier("Min", true) == null && parentRole1.getQualifier("Min", true) != null){ + role.getQualifiers(true).add(parentRole1.getQualifier("Min", true)); + } + if(role.getQualifier("Max", true) == null && parentRole1.getQualifier("Max", true) != null){ + role.getQualifiers(true).add(parentRole1.getQualifier("Max", true)); + } +// if(role.getQualifier("Key", true) == null && parentRole1.getQualifier("Key", true) != null){ +// role.getQualifiers(true).add(parentRole1.getQualifier("Key", true)); +// } + + } else if(qualifiedElement.getType() == TLINK2 && role.getQualifier("Override", true) != null){ + UMLRole parentRole2 = parentAssociationClass.getRole2(); + + if(role.getQualifier("Min", true) == null && parentRole2.getQualifier("Min", true) != null){ + role.getQualifiers(true).add(parentRole2.getQualifier("Min", true)); + } + if(role.getQualifier("Max", true) == null && parentRole2.getQualifier("Max", true) != null){ + role.getQualifiers(true).add(parentRole2.getQualifier("Max", true)); + } +// if(role.getQualifier("Key", true) == null && parentRole2.getQualifier("Key", true) != null){ +// role.getQualifiers(true).add(parentRole2.getQualifier("Key", true)); +// } + } + } + + // propagate property qualifiers + if(qualifiedElement.getType() == TATTRIBUTE){ + + UMLAttribute attribute = (UMLAttribute) qualifiedElement; + if(attribute.getQualifier("Override", true) != null){ + String overrideValue = ((UMLQualifier)attribute.getQualifier("Override", true)).value; + if(overrideValue == null){ + overrideValue = attribute.getName(); + } + + UMLAttribute overwrittenAttribute = null; + UMLClass lastCheckedClass = lastCreatedClass; + boolean attributeFound = false; + + while(lastCheckedClass.getBaseUMLClass() != null){ + ArrayList parentClassAttributes = lastCheckedClass.getBaseUMLClass().getAttributes(true); + + for(int i = 0; i < parentClassAttributes.size(); i++){ + UMLAttribute parentAttribute = (UMLAttribute)parentClassAttributes.get(i); + if(parentAttribute.getName().equalsIgnoreCase(overrideValue)){ + overwrittenAttribute = parentAttribute; + attributeFound = true; + break; + } + } + + if(!attributeFound){ + lastCheckedClass = lastCheckedClass.getBaseUMLClass(); + } else { + break; + } + } + + if(overwrittenAttribute != null){ + if(attribute.getQualifier("Octetstring", true) == null + && overwrittenAttribute.getQualifier("Octetstring", true) != null){ + attribute.getQualifiers(true).add(overwrittenAttribute.getQualifier("Octetstring", true)); + } + + if(attribute.getQualifier("Static", true) == null + && overwrittenAttribute.getQualifier("Static", true) != null){ + attribute.getQualifiers(true).add(overwrittenAttribute.getQualifier("Static", true)); + } + + if(attribute.getQualifier("Write", true) == null + && overwrittenAttribute.getQualifier("Write", true) != null){ + attribute.getQualifiers(true).add(overwrittenAttribute.getQualifier("Write", true)); + } + } + } + } + + // propagate method qualifiers + if(qualifiedElement.getType() == TMETHOD){ + + UMLMethod method = (UMLMethod) qualifiedElement; + if(method.getQualifier("Override", true) != null){ + String overrideValue = ((UMLQualifier)method.getQualifier("Override", true)).value; + if(overrideValue == null){ + overrideValue = method.getName(); + } + + UMLMethod overwrittenMethod = null; + UMLClass lastCheckedClass = lastCreatedClass; + boolean methodFound = false; + + while(lastCheckedClass.getBaseUMLClass() != null){ +// ArrayList parentClassAttributes = lastCheckedClass.getBaseUMLClass().getAttributes(true); + +// for(int i = 0; i < parentClassAttributes.size(); i++){ +// UMLAttribute parentAttribute = (UMLAttribute)parentClassAttributes.get(i); +// if(parentAttribute.getName().equalsIgnoreCase(overrideValue)){ +// overwrittenAttribute = parentAttribute; +// attributeFound = true; +// break; +// } +// } + + ArrayList parentClassMethods = lastCheckedClass.getBaseUMLClass().getMethods(true); + for(int i = 0; i < parentClassMethods.size(); i++){ + UMLMethod parentMethod = (UMLMethod)parentClassMethods.get(i); + if(parentMethod.getName().equalsIgnoreCase(overrideValue)){ + + overwrittenMethod = parentMethod; + + ArrayList methodParameters = method.getParameters(); + ArrayList overwrittenMethodParameters = overwrittenMethod.getParameters(); + + // check number of parameters + if(methodParameters.size() != overwrittenMethodParameters.size()){ + methodFound = false; + overwrittenMethod = null; + break; + } + + // check names and types of parameters + for(int j = 0; j < methodParameters.size(); j++){ + UMLParameter parameter = (UMLParameter)methodParameters.get(j); + UMLParameter parentParameter = (UMLParameter)overwrittenMethodParameters.get(j); + + if(!parameter.getDataType().equalsIgnoreCase(parentParameter.getDataType()) + || !parameter.getName().equalsIgnoreCase(parentParameter.getName())){ + methodFound = false; + overwrittenMethod = null; + break; + } + } + + methodFound = true; + break; + } + } + + if(!methodFound){ + lastCheckedClass = lastCheckedClass.getBaseUMLClass(); + } else { + break; + } + } + + if(overwrittenMethod != null){ + +// ArrayList methodParameters = method.getParameters(); +// ArrayList overwrittenMethodParameters = overwrittenMethod.getParameters(); +// +// // check number of parameters +// if(methodParameters.size() != overwrittenMethodParameters.size()){ +// return; +// } +// +// // check names and types of parameters +// for(int i = 0; i < methodParameters.size(); i++){ +// UMLParameter parameter = (UMLParameter)methodParameters.get(i); +// UMLParameter parentParameter = (UMLParameter)overwrittenMethodParameters.get(i); +// +// if(!parameter.getDataType().equalsIgnoreCase(parentParameter.getDataType()) +// || !parameter.getName().equalsIgnoreCase(parentParameter.getName())){ +// return; +// } +// } + + if(method.getQualifier("Octetstring", true) == null + && overwrittenMethod.getQualifier("Octetstring", true) != null){ + method.getQualifiers(true).add(overwrittenMethod.getQualifier("Octetstring", true)); + } + + if(method.getQualifier("Static", true) == null + && overwrittenMethod.getQualifier("Static", true) != null){ + method.getQualifiers(true).add(overwrittenMethod.getQualifier("Static", true)); + } + + getInheritedParameterQualifiers(method, overwrittenMethod); + } + } + } + } + + private void getInheritedParameterQualifiers(UMLMethod method, UMLMethod parentMethod){ + ArrayList methodParameters = method.getParameters(); + ArrayList parentMethodParameters = parentMethod.getParameters(); + +// // check number of parameters +// if(methodParameters.size() != parentMethodParameters.size()){ +// return; +// } +// +// // check names and types of parameters +// for(int i = 0; i < methodParameters.size(); i++){ +// UMLParameter parameter = (UMLParameter)methodParameters.get(i); +// UMLParameter parentParameter = (UMLParameter)parentMethodParameters.get(i); +// +// if(!parameter.getDataType().equalsIgnoreCase(parentParameter.getDataType()) +// || !parameter.getName().equalsIgnoreCase(parentParameter.getName())){ +// return; +// } +// } + + // set qualifiers + for(int i = 0; i < methodParameters.size(); i++){ + UMLParameter parameter = (UMLParameter)methodParameters.get(i); + UMLParameter parentParameter = (UMLParameter)parentMethodParameters.get(i); + + if(parameter.getQualifier("In", true) == null + && parentParameter.getQualifier("In", true) != null){ + parameter.getQualifiers(true).add(parentParameter.getQualifier("In", true)); + } + + if(parameter.getQualifier("Out", true) == null + && parentParameter.getQualifier("Out", true) != null){ + parameter.getQualifiers(true).add(parentParameter.getQualifier("Out", true)); + } + + if(parameter.getQualifier("Octetstring", true) == null + && parentParameter.getQualifier("Octetstring", true) != null){ + parameter.getQualifiers(true).add(parentParameter.getQualifier("Octetstring", true)); + } + } + + } + + private void getInheritedAggregateQualifier(UMLRole role1, UMLRole role2){ + // BB - set the aggregate diamond on the correct side of the association + // for normal and inherited associations + if(role1.getQualifier("Aggregate", true) == null && role2.getQualifier("Aggregate", true) == null){ + + if(parentAggregateClass != null && parentAggregateClass.getRole1() != null + && parentAggregateClass.getRole2() != null){ + + UMLRole parentRole1 = parentAggregateClass.getRole1(); + UMLRole parentRole2 = parentAggregateClass.getRole2(); + + if(parentRole1.getQualifier("Aggregate", true) != null){ + role1.getQualifiers(true).add(parentRole1.getQualifier("Aggregate", true)); + } else if(parentRole2.getQualifier("Aggregate", true) != null){ + role2.getQualifiers(true).add(parentRole2.getQualifier("Aggregate", true)); + } + } + } + } + + } \ No newline at end of file |
From: Benjamin B. <bg...@us...> - 2005-07-19 16:11:05
|
Update of /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/rsa/core/internal/properties In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9740/Plugin/com/ibm/ecute/rsa/core/internal/properties Modified Files: ValuesTableHelper.java QualifiersPropertySection.java FlavorsHelper.java Added Files: EffectiveInheritedValue.java Log Message: Index: FlavorsHelper.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/rsa/core/internal/properties/FlavorsHelper.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- FlavorsHelper.java 15 Jul 2005 13:43:39 -0000 1.2 +++ FlavorsHelper.java 19 Jul 2005 16:10:47 -0000 1.3 @@ -8,19 +8,24 @@ import java.io.IOException; import java.lang.reflect.InvocationTargetException; import java.util.ArrayList; +import java.util.Iterator; import java.util.List; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.emf.common.util.EList; import org.eclipse.uml2.AggregationKind; import org.eclipse.uml2.AssociationClass; import org.eclipse.uml2.Class; +import org.eclipse.uml2.Comment; import org.eclipse.uml2.Constraint; import org.eclipse.uml2.Model; import org.eclipse.uml2.NamedElement; import org.eclipse.uml2.OpaqueExpression; import org.eclipse.uml2.Operation; import org.eclipse.uml2.Package; +import org.eclipse.uml2.Parameter; +import org.eclipse.uml2.ParameterDirectionKind; import org.eclipse.uml2.Property; import org.eclipse.uml2.Stereotype; import org.eclipse.uml2.UML2Package; @@ -28,6 +33,7 @@ import com.ibm.ecute.EcuteEclipsePlugin; import com.ibm.ecute.Qualifiers.QualifiersList; import com.ibm.ecute.utils.License; +import com.ibm.ecute.rsa.core.internal.properties.EffectiveInheritedValue; import com.ibm.xtools.emf.msl.EditingDomain; import com.ibm.xtools.emf.msl.ResourceSetModifyOperation; import com.ibm.xtools.modeler.UMLModeler; @@ -440,7 +446,7 @@ } } - private Class getParentClass(Class class_){ + private static Class getParentClass(Class class_){ List parents = class_.getGenerals(); if(parents.size() > 0){ @@ -472,4 +478,359 @@ return null; } + + public static EffectiveInheritedValue effectiveInheritedValue(NamedElement element, String qualifierName){ + + // ABSTRACT + if(qualifierName.equalsIgnoreCase("Abstract")){ + return null; + //AGGREGATE + } else if(qualifierName.equalsIgnoreCase("Aggregate")){ + if(element instanceof Property && propertyIsOwnedEnd((Property)element) && override(element)){ + Property property = (Property)element; + Class parent = getParentClass((Class)property.getOwner()); + if(parent != null && parent instanceof AssociationClass){ + if(((AssociationClass)parent).getOwnedEnds().size() >= 2){ + Property parentEnd1 = (Property)((AssociationClass)parent).getOwnedEnds().get(0); + Property parentEnd2 = (Property)((AssociationClass)parent).getOwnedEnds().get(1); + Property otherEnd; + if(property.getName().equalsIgnoreCase(parentEnd1.getName())){ + otherEnd = parentEnd2; + } else { + otherEnd = parentEnd1; + } + // check if other end as aggregate qualifier + if(otherEnd.getAggregation().getValue() == AggregationKind.COMPOSITE || otherEnd.getAggregation().getValue() == AggregationKind.SHARED){ + return (new EffectiveInheritedValue("true", parent)); + } + } else { + return null; + } + } else { + return null; + } + } else { + return null; + } + // AGGREGATION + } else if(qualifierName.equalsIgnoreCase("Aggregation")){ + if(element instanceof AssociationClass){ + Class parent = getParentClass((AssociationClass)element); + if(parent != null && parent instanceof AssociationClass){ + AssociationClass aClass = (AssociationClass)parent; + EList ends = aClass.getOwnedEnds(); + Iterator iter = ends.iterator(); + while(iter.hasNext()){ + Property prop = (Property)iter.next(); + if(prop.getAggregation().getValue()== AggregationKind.SHARED || + prop.getAggregation().getValue()== AggregationKind.COMPOSITE){ + return (new EffectiveInheritedValue("true", parent)); + } + } + } else { + return null; + } + + } else { + return null; + } + // COMPOSITION + } else if(qualifierName.equalsIgnoreCase("Composition")){ + if(element instanceof AssociationClass){ + Class parent = getParentClass((AssociationClass)element); + if(parent != null && parent instanceof AssociationClass){ + AssociationClass aClass = (AssociationClass)parent; + EList ends = aClass.getOwnedEnds(); + Iterator iter = ends.iterator(); + while(iter.hasNext()){ + Property prop = (Property)iter.next(); + if(prop.getAggregation().getValue()== AggregationKind.COMPOSITE){ + return (new EffectiveInheritedValue("true", parent)); + } + } + } else { + return null; + } + + } else { + return null; + } + // DEPRECATED + } else if(qualifierName.equalsIgnoreCase("Deprecated")){ + return null; + // DESCRIPTION + } else if(qualifierName.equalsIgnoreCase("Description")){ + // getParentClasses + ArrayList parents = getParentClasses(element); + + if(element instanceof Class){ + if(parents.size() > 0){ + for(int j = 0; j < parents.size(); j++){ + String description = null; + + EList list = ((Class)parents.get(j)).getOwnedComments(); + Iterator it = list.iterator(); + while (it.hasNext()){ + Comment comment = (Comment)it.next(); + Stereotype stereo = comment.getApplicableStereotype("Default::Documentation"); + if(stereo != null){ + description = comment.getBody(); + } + } + if(description != null){ + return(new EffectiveInheritedValue(description, (Class)parents.get(j))); + } + } + return null; + } else { + return null; + } + + } else if (element instanceof Property && override(element)){ + + if(parents.size() > 0){ + Property property = (Property)element; + for(int j = 0; j < parents.size(); j++){ + String description = null; + Property attribute = null; + + List attributeList = ((Class)parents.get(j)).getAttributes(); + for(int i = 0; i < attributeList.size(); i++){ + if(((Property)attributeList.get(i)).getName().equalsIgnoreCase(property.getName())){ + attribute = (Property)attributeList.get(i); + } + } + if(propertyIsOwnedEnd(property)){ + List endList = ((AssociationClass)parents.get(j)).getOwnedEnds(); + for(int i = 0; i < endList.size(); i++){ + if(((Property)endList.get(i)).getName().equalsIgnoreCase(property.getName())){ + attribute = (Property)endList.get(i); + } + } + } + + if(attribute != null){ + + EList list = attribute.getOwnedComments(); + Iterator it = list.iterator(); + while (it.hasNext()){ + Comment comment = (Comment)it.next(); + Stereotype stereo = comment.getApplicableStereotype("Default::Documentation"); + if(stereo != null){ + description = comment.getBody(); + } + } + if(description != null){ + return(new EffectiveInheritedValue(description, (Class)parents.get(j))); + } + } + } + return null; + } else { + return null; + } + } else if (element instanceof Operation && override(element)){ + + if(parents.size() > 0){ + Operation operation = (Operation)element; + for(int j = 0; j < parents.size(); j++){ + String description = null; + Operation method = null; + + List operationsList = ((Class)parents.get(j)).getOwnedOperations(); + for(int i = 0; i < operationsList.size(); i++){ + if(((Operation)operationsList.get(i)).getName().equalsIgnoreCase(operation.getName())){ + method = (Operation)operationsList.get(i); + } + } + + if(method != null){ + + EList list = method.getOwnedComments(); + Iterator it = list.iterator(); + while (it.hasNext()){ + Comment comment = (Comment)it.next(); + Stereotype stereo = comment.getApplicableStereotype("Default::Documentation"); + if(stereo != null){ + description = comment.getBody(); + } + } + if(description != null){ + return(new EffectiveInheritedValue(description, (Class)parents.get(j))); + } + } + } + return null; + } else { + return null; + } + } else if (element instanceof Parameter){ + if(parents.size() > 0){ + Parameter parameter = (Parameter)element; + Operation operation = (Operation)parameter.getOwner(); + if(!override(operation)){ + return null; + } + for(int j = 0; j < parents.size(); j++){ + String description = null; + Parameter param = null; + + List operationsList = ((Class)parents.get(j)).getOwnedOperations(); + for(int i = 0; i < operationsList.size(); i++){ + if(((Operation)operationsList.get(i)).getName().equalsIgnoreCase(operation.getName())){ + List parameterList = ((Operation)operationsList.get(i)).getOwnedParameters(); + for(int k = 0; k < parameterList.size(); k++){ + if(((Parameter)parameterList.get(k)).getName().equalsIgnoreCase(parameter.getName())){ + param = (Parameter)parameterList.get(k); + } + } + } + } + + if(param != null){ + + EList list = param.getOwnedComments(); + Iterator it = list.iterator(); + while (it.hasNext()){ + Comment comment = (Comment)it.next(); + Stereotype stereo = comment.getApplicableStereotype("Default::Documentation"); + if(stereo != null){ + description = comment.getBody(); + } + } + if(description != null){ + return(new EffectiveInheritedValue(description, (Class)parents.get(j))); + } + } + } + return null; + } else { + return null; + } + } else { + return null; + } + // IN + } else if(qualifierName.equalsIgnoreCase("In") || qualifierName.equalsIgnoreCase("Out")){ + if(element instanceof Parameter){ + ArrayList parents = getParentClasses(element); + if(parents.size() > 0){ + Parameter parameter = (Parameter)element; + Operation operation = (Operation)parameter.getOwner(); + if(!override(operation)){ + return null; + } + for(int j = 0; j < parents.size(); j++){ + String description = null; + Parameter param = null; + + List operationsList = ((Class)parents.get(j)).getOwnedOperations(); + for(int i = 0; i < operationsList.size(); i++){ + if(((Operation)operationsList.get(i)).getName().equalsIgnoreCase(operation.getName())){ + List parameterList = ((Operation)operationsList.get(i)).getOwnedParameters(); + for(int k = 0; k < parameterList.size(); k++){ + if(((Parameter)parameterList.get(k)).getName().equalsIgnoreCase(parameter.getName())){ + param = (Parameter)parameterList.get(k); + } + } + } + } + + if(param != null){ + + ParameterDirectionKind direction = param.getDirection(); + String direct = null; + if(direction != null){ + direct = direction.getName(); + } + + if(direct != null){ + if(qualifierName.equalsIgnoreCase("In")){ + if(direct.equalsIgnoreCase("in") || direct.equalsIgnoreCase("inout")){ + return(new EffectiveInheritedValue("true", (Class)parents.get(j))); + } + } else { + if(direct.equalsIgnoreCase("out") || direct.equalsIgnoreCase("inout")){ + return(new EffectiveInheritedValue("true", (Class)parents.get(j))); + } + } + } + } + } + return null; + } else { + return null; + } + } else { + return null; + } + + } + return null; + } + + private static boolean propertyIsOwnedEnd(Property prop){ + + boolean isOwnedEnd = false; + if (prop.getOwner() instanceof AssociationClass){ + AssociationClass parentClass = (AssociationClass)prop.getOwner(); + List ends = parentClass.getOwnedEnds(); + if ((Property)ends.get(0) == prop){ + isOwnedEnd = true; + } + if ((Property)ends.get(1) == prop){ + isOwnedEnd = true; + } + return isOwnedEnd; + } else { + return false; + } + } + + private static ArrayList getParentClasses(Class thisClass){ + ArrayList parents = new ArrayList(); + List generals = thisClass.getGenerals(); + while (generals.size() > 0){ + Class class_ = (Class)generals.get(0); + parents.add(class_); + generals = class_.getGenerals(); + } + parents.remove(thisClass); + + return parents; + } + + private static ArrayList getParentClasses(NamedElement element){ + + ArrayList parents; + + if(element instanceof Class){ + parents = getParentClasses((Class)element); + } else if (element instanceof Parameter){ + parents = getParentClasses((Class)(((Parameter)element).getOwner().getOwner())); + } else { + parents = getParentClasses((Class)element.getOwner()); + } + + return parents; + } + + private static boolean override(NamedElement namedElement){ + + Stereotype cimStereotype = namedElement.getAppliedStereotype("CIM::Qualifiers"); + List qualifierNames = (List) namedElement.getValue(cimStereotype, "QualifierName"); + List qualifierValues = (List) namedElement.getValue(cimStereotype, "QualifierValue"); + + for(int i = 0; i < qualifierNames.size(); i++){ + String qualifierName = (String)qualifierNames.get(i); + if(qualifierName.equalsIgnoreCase("Override")){ + return true; + } + } + + return false; + } + + } + --- NEW FILE: EffectiveInheritedValue.java --- /* * Created on 19.07.2005 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - Code Templates */ package com.ibm.ecute.rsa.core.internal.properties; import org.eclipse.uml2.Class; /** * @author Benjamin Bender * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public class EffectiveInheritedValue { protected String value; protected Class definedIn; public EffectiveInheritedValue(String value, Class definedIn){ this.value = value; this.definedIn = definedIn; } public String getValue(){ return this.value; } public Class getDefinedIn(){ return this.definedIn; } } Index: ValuesTableHelper.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/rsa/core/internal/properties/ValuesTableHelper.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ValuesTableHelper.java 15 Jun 2005 09:41:47 -0000 1.1 +++ ValuesTableHelper.java 19 Jul 2005 16:10:47 -0000 1.2 @@ -89,10 +89,10 @@ // } // } - public ArrayList getInheritedQualifers(NamedElement element, ArrayList allAvailableQualifiers){ + public ArrayList getInheritedQualifers(NamedElement element, ArrayList allAvailableQualifiers, boolean isReference){ //TODO BB ArrayList inheritedList = new ArrayList(); - + // get applicable qualifiers for the element ArrayList applicableQualifiers = new ArrayList(); for(int i = 0; i < allAvailableQualifiers.size(); i++){ @@ -102,9 +102,9 @@ applicableQualifiers.add(qualifier); } else if(element instanceof AssociationClass && qualifier.associationScope && !qualifier.RestrictedFlavor){ applicableQualifiers.add(qualifier); - } else if(element instanceof Property && qualifier.propertyScope && !qualifier.RestrictedFlavor){ + } else if(element instanceof Property && !isReference && qualifier.propertyScope && !qualifier.RestrictedFlavor){ applicableQualifiers.add(qualifier); - } else if(element instanceof Property && qualifier.referenceScope && !qualifier.RestrictedFlavor){ + } else if(element instanceof Property && isReference && qualifier.referenceScope && !qualifier.RestrictedFlavor){ applicableQualifiers.add(qualifier); } else if(element instanceof Operation && qualifier.methodScope && !qualifier.RestrictedFlavor){ applicableQualifiers.add(qualifier); @@ -114,34 +114,14 @@ } applicableQualifiers.trimToSize(); - if(element instanceof Class && applicableQualifiers.size() > 0){ - Class thisClass = (Class)element; - // get parent classes - ArrayList parents = new ArrayList(); - List generals = thisClass.getGenerals(); - while (generals.size() > 0){ - Class class_ = (Class)generals.get(0); - parents.add(class_); - generals = class_.getGenerals(); - } - - if(parents.size() > 0){ - for(int i = 0; i < applicableQualifiers.size(); i++){ - boolean lastParent = false; - for(int j = 0; j < parents.size(); j++){ - if(j == parents.size()-1) lastParent = true; - QualifierValueObject isInherited = checkIfInherited((Qualifier)applicableQualifiers.get(i), (Class)parents.get(j), lastParent); - if(isInherited != null){ - inheritedList.add(isInherited); - allAvailableQualifiers.remove((Qualifier)applicableQualifiers.get(i)); - break; - } - } - } - } - } +// if((element instanceof Class || element instanceof AssociationClass) && applicableQualifiers.size() > 0){ +// inheritedList = getInheritedClassQualifiers(element, applicableQualifiers, allAvailableQualifiers); +// } else if(element instanceof Property && isReference && applicableQualifiers.size() > 0){ +// inheritedList = getInheritedReferenceQualifiers(element, applicableQualifiers, allAvailableQualifiers, isReference); +// } +// return inheritedList; - return inheritedList; + return getEffectiveInheritedValues(element, applicableQualifiers, allAvailableQualifiers); } public QualifierValueObject checkIfInherited(Qualifier qualifier, Class class_, boolean lastParent){ @@ -230,6 +210,134 @@ return returnQualifierObject; } + public QualifierValueObject checkIfInherited(Qualifier qualifier, Property property, boolean isReference, Class class_, boolean lastParent){ + QualifierValueObject returnQualifierObject = null; + + if(isReference && class_ instanceof AssociationClass){ + // property is a reference + AssociationClass thisClass = (AssociationClass)class_; + String propertyQualifierValue = null; + + if(qualifier.name.equalsIgnoreCase("Aggregate")){ + // check if parent association aggregates + Property otherEnd; + // get other association end + List associationEnds = thisClass.getOwnedEnds(); + if(associationEnds.size() >= 2){ + Property end1 = (Property)associationEnds.get(0); + Property end2 = (Property)associationEnds.get(1); + if(end1.getName().equalsIgnoreCase(property.getName())){ + otherEnd = end2; + } else { + otherEnd = end1; + } + } else { + return null; + } + // check if other end as aggregate qualifier + if(otherEnd.getAggregation().getValue() == AggregationKind.COMPOSITE || otherEnd.getAggregation().getValue() == AggregationKind.SHARED){ + propertyQualifierValue = "true"; + } else { + propertyQualifierValue = "false"; + } + + } else if(qualifier.name.equalsIgnoreCase("Min") || qualifier.name.equalsIgnoreCase("Max")){ + Property thisEnd; + // get this association end + List associationEnds = thisClass.getOwnedEnds(); + if(associationEnds.size() >= 2){ + Property end1 = (Property)associationEnds.get(0); + Property end2 = (Property)associationEnds.get(1); + if(end1.getName().equalsIgnoreCase(property.getName())){ + thisEnd = end1; + } else { + thisEnd = end2; + } + } else { + return null; + } + // get qualifier value + if(qualifier.name.equalsIgnoreCase("Min")){ + propertyQualifierValue = new Integer(thisEnd.getLower()).toString(); + } else { + propertyQualifierValue = new Integer(thisEnd.getUpper()).toString(); + } + } else if(!isReference){ + + } + + Property attribute = null; + + List attributeList = class_.getAttributes(); + for(int i = 0; i < attributeList.size(); i++){ + if(((Property)attributeList.get(i)).getName().equalsIgnoreCase(property.getName())){ + attribute = (Property)attributeList.get(i); + } + } + if(isReference){ + List endList = ((AssociationClass)class_).getOwnedEnds(); + for(int i = 0; i < endList.size(); i++){ + if(((Property)endList.get(i)).getName().equalsIgnoreCase(property.getName())){ + attribute = (Property)endList.get(i); + } + } + } + + + if(attribute != null){ + if (qualifier.name.equalsIgnoreCase("Description")){ + + EList list = attribute.getOwnedComments(); + Iterator it = list.iterator(); + while (it.hasNext()){ + Comment comment = (Comment)it.next(); + Stereotype stereo = comment.getApplicableStereotype("Default::Documentation"); + if(stereo != null){ + propertyQualifierValue = comment.getBody(); + } + } + + } else if (qualifier.name.equalsIgnoreCase("Deprecated")){ + Stereotype stereo = attribute.getAppliedStereotype("CIM::Deprecated"); + if(stereo != null){ + propertyQualifierValue = (String)attribute.getValue(stereo, "Value"); + } + + } else if (qualifier.name.equalsIgnoreCase("Key")){ + Stereotype stereo = attribute.getAppliedStereotype("CIM::Key"); + if(stereo != null){ + propertyQualifierValue = "true"; + } + + } else { + + //get all qualifiers witch are set in the Qualifiers-Stereotype + Stereotype cimStereotype = attribute.getAppliedStereotype("CIM::Qualifiers"); + List qualifierNames = (List) attribute.getValue(cimStereotype, "QualifierName"); + List qualifierValues = (List) attribute.getValue(cimStereotype, "QualifierValue"); + + for(int i=0; i < qualifierNames.size(); i++){ + String qualifierName = (String)qualifierNames.get(i); + String qualifierValue = (String)qualifierValues.get(i); + + if(qualifierName.equalsIgnoreCase(qualifier.name)){ + propertyQualifierValue = qualifierValue; + break; + } + } + } + } + + if(propertyQualifierValue != null && !propertyQualifierValue.equalsIgnoreCase(qualifier.defaultValue)){ + returnQualifierObject = new QualifierValueObject(qualifier.name, + propertyQualifierValue, class_.getName() + " (" + + class_.getNearestPackage().getName() + ")" , -1); + } + } + + return returnQualifierObject; + } + public String existsOCL(Class class_ ){ String value = null; @@ -261,6 +369,109 @@ return value; } + private ArrayList getInheritedClassQualifiers(NamedElement element, ArrayList applicableQualifiers, ArrayList allAvailableQualifiers){ + ArrayList inheritedList = new ArrayList(); + Class thisClass = (Class)element; + // get parent classes + ArrayList parents = getParentClasses(thisClass); + parents.trimToSize(); + + if(parents.size() > 0){ + for(int i = 0; i < applicableQualifiers.size(); i++){ + boolean lastParent = false; + for(int j = 0; j < parents.size(); j++){ + if(j == parents.size()-1) lastParent = true; + QualifierValueObject isInherited = checkIfInherited((Qualifier)applicableQualifiers.get(i), (Class)parents.get(j), lastParent); + if(isInherited != null){ + inheritedList.add(isInherited); + allAvailableQualifiers.remove((Qualifier)applicableQualifiers.get(i)); + break; + } + } + } + } + + return inheritedList; + } + + private ArrayList getInheritedReferenceQualifiers(NamedElement element, ArrayList applicableQualifiers, ArrayList allAvailableQualifiers, boolean isReference){ + ArrayList inheritedList = new ArrayList(); + Property property = (Property)element; + if(overrides(element)){ + // get parent classes + ArrayList parents = getParentClasses((Class)property.getOwner()); + parents.trimToSize(); + + if(parents.size() > 0){ + for(int i = 0; i < applicableQualifiers.size(); i++){ + boolean lastParent = false; + for(int j = 0; j < parents.size(); j++){ + if(j == parents.size()-1) lastParent = true; + QualifierValueObject isInherited = checkIfInherited((Qualifier)applicableQualifiers.get(i), property, isReference, (Class)parents.get(j), lastParent); + if(isInherited != null){ + inheritedList.add(isInherited); + allAvailableQualifiers.remove((Qualifier)applicableQualifiers.get(i)); + break; + } + } + } + } + } + + return inheritedList; + } + + private ArrayList getEffectiveInheritedValues(NamedElement element, ArrayList applicableQualifiers, ArrayList allAvailableQualifiers){ + ArrayList inheritedList = new ArrayList(); + + for(int i = 0; i < applicableQualifiers.size(); i++){ + EffectiveInheritedValue effectiveInheritedValue = FlavorsHelper.effectiveInheritedValue(element, ((Qualifier)applicableQualifiers.get(i)).name); + if(effectiveInheritedValue != null){ + if(element instanceof Parameter){ + inheritedList.add(new QualifierValueObject(((Qualifier)applicableQualifiers.get(i)).name, + effectiveInheritedValue.getValue(), effectiveInheritedValue.getDefinedIn().getNearestPackage().getName() + "::" + effectiveInheritedValue.getDefinedIn().getName() + + "::" + ((Operation)((Parameter)element).getOwner()).getName() + "::" +element.getName(), -1)); + } else if (element instanceof Class){ + inheritedList.add(new QualifierValueObject(((Qualifier)applicableQualifiers.get(i)).name, + effectiveInheritedValue.getValue(), effectiveInheritedValue.getDefinedIn().getNearestPackage().getName() + "::" + effectiveInheritedValue.getDefinedIn().getName(), -1)); + } else { + inheritedList.add(new QualifierValueObject(((Qualifier)applicableQualifiers.get(i)).name, + effectiveInheritedValue.getValue(), effectiveInheritedValue.getDefinedIn().getNearestPackage().getName() + "::" + effectiveInheritedValue.getDefinedIn().getName() + + "::" + element.getName(), -1)); + } + } + } + + return inheritedList; + } + + private ArrayList getParentClasses(Class thisClass){ + ArrayList parents = new ArrayList(); + List generals = thisClass.getGenerals(); + while (generals.size() > 0){ + Class class_ = (Class)generals.get(0); + parents.add(class_); + generals = class_.getGenerals(); + } + parents.remove(thisClass); + + return parents; + } + + private boolean overrides(NamedElement element){ + + Stereotype cimStereotype = element.getAppliedStereotype("CIM::Qualifiers"); + List qualifierNames = (List) element.getValue(cimStereotype, "QualifierName"); + //List qualifierValues = (List) element.getValue(cimStereotype, "QualifierValue"); + + for(int i = 0; i < qualifierNames.size(); i++){ + if(((String)(qualifierNames.get(i))).equalsIgnoreCase("Override")){ + return true; + } + } + return false; + } + // public class QualifierValueObject{ // private String name; // private String value; Index: QualifiersPropertySection.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/rsa/core/internal/properties/QualifiersPropertySection.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- QualifiersPropertySection.java 7 Jul 2005 15:42:49 -0000 1.19 +++ QualifiersPropertySection.java 19 Jul 2005 16:10:47 -0000 1.20 @@ -97,12 +97,11 @@ private Table qualifiersTable; private ArrayList defaultValueQualifiers; - private static QualifiersList qualifiersList = null; + private QualifiersList qualifiersList = null; private boolean qualifiersListChanged = false; ArrayList allAvailableQualifers = null; - - + public QualifiersPropertySection() { } @@ -237,7 +236,9 @@ public Object run() { - if(element instanceof Parameter){ + boolean isOwnedEnd = false; + + if(element instanceof Parameter){ //Do not show qualifiers for return parameters if(((Parameter)element).getDirection().getValue() == ParameterDirectionKind.RETURN) return null; @@ -265,11 +266,13 @@ String definedIn = ""; if(element instanceof Class){ - definedIn = element.getName()+" ("+element.getNearestPackage().getName()+")"; + definedIn = element.getName()/*+" ("+element.getNearestPackage().getName()+")"*/; + }else if(element instanceof Parameter){ + definedIn = ((NamedElement)element.getOwner().getOwner()).getName() + "::" + ((NamedElement)element.getOwner()).getName() + "::" + element.getName()/*+" ("+element.getNearestPackage().getName()+")"*/; }else{ Element owner = element.getOwner(); if(owner instanceof NamedElement) - definedIn = ((NamedElement)element.getOwner()).getName()+" ("+owner.getNearestPackage().getName()+")"; + definedIn = ((NamedElement)element.getOwner()).getName() + "::" +element.getName()/*+" ("+owner.getNearestPackage().getName()+")"*/; } //display all qualifiers witch are set in the Qualifiers-Stereotype @@ -434,7 +437,7 @@ Property prop = (Property)element; Property oppositeProp = null; - boolean isOwnedEnd = propertyIsOwnedEnd(prop); + isOwnedEnd = propertyIsOwnedEnd(prop); // get the property of the other association end if (isOwnedEnd /*&& prop.getOwner() instanceof AssociationClass*/){ @@ -558,21 +561,23 @@ } -// //TODO -// ValuesTableHelper tableHelper = new ValuesTableHelper(qualifiersTable); -// ArrayList inheritedQualifiers = tableHelper.getInheritedQualifers(element, allAvailableQualifers); -// for(int k = 0; k < inheritedQualifiers.size(); k++){ -// qualifierName = ((QualifierValueObject)inheritedQualifiers.get(k)).name; -// String qualifierValue = ((QualifierValueObject)inheritedQualifiers.get(k)).value; -// definedIn = ((QualifierValueObject)inheritedQualifiers.get(k)).definedIn; -// Qualifier qualifierObject = qualifiersList.GetElement(qualifierName); -// addQualiferToTable(qualifierName, qualifierValue, definedIn, qualifierObject, -1, false); -// allAvailableQualifers.remove(qualifierObject); -// } + //TODO Inherited qualifiers + // Get all inherited qualifiers which aren't already defined in this element + + ValuesTableHelper tableHelper = new ValuesTableHelper(qualifiersTable); + ArrayList inheritedQualifiers = tableHelper.getInheritedQualifers(element, allAvailableQualifers, isOwnedEnd); + for(int k = 0; k < inheritedQualifiers.size(); k++){ + qualifierName = ((QualifierValueObject)inheritedQualifiers.get(k)).name; + String qualifierValue = ((QualifierValueObject)inheritedQualifiers.get(k)).value; + definedIn = ((QualifierValueObject)inheritedQualifiers.get(k)).definedIn; + Qualifier qualifierObject = qualifiersList.GetElement(qualifierName); + addQualiferToTable(qualifierName, qualifierValue, definedIn, qualifierObject, -1, false); + allAvailableQualifers.remove(qualifierObject); + } //dispaly all qualifiers with default values if(showAllButton.getSelection()){ - definedIn = ""; + definedIn = null; for(Iterator iterator1 = allAvailableQualifers.iterator(); iterator1.hasNext();) { Qualifier qualifier = (Qualifier)iterator1.next(); @@ -786,7 +791,7 @@ String type = ""; if(definedIn==null) - definedIn = ""; + definedIn = "Default value"; //String scope = ""; String inheritance = ""; |
From: Benjamin B. <bg...@us...> - 2005-07-19 16:11:05
|
Update of /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/plugins/output/funcionality In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9740/Plugin/com/ibm/ecute/plugins/output/funcionality Modified Files: RoseREI.java Log Message: Index: RoseREI.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/plugins/output/funcionality/RoseREI.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- RoseREI.java 8 Apr 2005 09:11:16 -0000 1.7 +++ RoseREI.java 19 Jul 2005 16:10:49 -0000 1.8 @@ -949,7 +949,7 @@ } else if (name.equalsIgnoreCase("Aggregate")&&(!value.equalsIgnoreCase("false"))) { SetRole(theElement, "Aggregate", true); ChangeLineColor(lastDiagram, lastObject, aggregation); - } else if (name.equalsIgnoreCase("Min")) { + } else if (name.equalsIgnoreCase("Min") && !value.equalsIgnoreCase("NULL")) { if(value.length()==0) value = "0"; if (!lastCar.equalsIgnoreCase(value)) { @@ -967,7 +967,7 @@ } Dispatch.put(theElement, "Cardinality", lastCar); - } else if (name.equalsIgnoreCase("Max")) { + } else if (name.equalsIgnoreCase("Max") && !value.equalsIgnoreCase("NULL")) { if(value.length()==0) value = "n"; if (!lastCar.equalsIgnoreCase(value)) { |
From: Benjamin B. <bg...@us...> - 2005-07-19 16:11:05
|
Update of /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/utils In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9740/Plugin/com/ibm/ecute/utils Modified Files: Constants.java Log Message: Index: Constants.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/utils/Constants.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- Constants.java 29 Jun 2005 11:24:03 -0000 1.16 +++ Constants.java 19 Jul 2005 16:10:48 -0000 1.17 @@ -22,7 +22,7 @@ public class Constants { - public static final String pluginVersion="2.1 beta 1f"; + public static final String pluginVersion="2.1 beta 1g"; public static final String toolName="ECUTE"; public static final String qualifiersFileName="QualifiersList.txt"; |
From: Benjamin B. <bg...@us...> - 2005-07-19 16:11:05
|
Update of /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/UMLBuffer/UMLTree In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9740/Plugin/com/ibm/ecute/UMLBuffer/UMLTree Modified Files: UMLClass.java Log Message: Index: UMLClass.java =================================================================== RCS file: /cvsroot/sblim/ecute/Plugin/com/ibm/ecute/UMLBuffer/UMLTree/UMLClass.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- UMLClass.java 15 Jul 2005 13:43:39 -0000 1.6 +++ UMLClass.java 19 Jul 2005 16:10:49 -0000 1.7 @@ -49,7 +49,6 @@ private boolean isAssociation = false; private UMLRole role1 = null; private UMLRole role2 = null; - private boolean rolesTwisted = false; private Hashtable methods = new Hashtable(); private Hashtable attributes = new Hashtable(); @@ -140,18 +139,6 @@ return role2; } - public boolean getRolesTwisted(){ - return rolesTwisted; - } - - public void setRolesTwisted(){ - rolesTwisted = true; - } - - public void resetRolesTwisted(){ - rolesTwisted = false; - } - public void addMethod(UMLMethod method) { methods.put(method.getName(), method); } |
From: Viktor M. <mih...@us...> - 2005-07-19 14:44:00
|
Update of /cvsroot/sblim/sfcc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21069 Modified Files: client.c cmci.h test.c Removed Files: cimXmlResp.h Log Message: added scheme parameter to cmciConnect. Index: cmci.h =================================================================== RCS file: /cvsroot/sblim/sfcc/cmci.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- cmci.h 26 Jun 2005 21:46:02 -0000 1.7 +++ cmci.h 19 Jul 2005 14:43:32 -0000 1.8 @@ -449,7 +449,7 @@ CMCIClientFT *ft; }; -CMCIClient *cmciConnect(const char *hn, const char *port, +CMCIClient *cmciConnect(const char *hn, const char* scheme, const char *port, const char *user, const char *pwd, CMPIStatus *rc); #ifdef __cplusplus Index: client.c =================================================================== RCS file: /cvsroot/sblim/sfcc/client.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- client.c 26 Jun 2005 21:46:02 -0000 1.16 +++ client.c 19 Jul 2005 14:43:32 -0000 1.17 @@ -1848,7 +1848,7 @@ /* --------------------------------------------------------------------------*/ -CMCIClient *cmciConnect(const char *hn, const char *port, +CMCIClient *cmciConnect(const char *hn, const char *scheme, const char *port, const char *user, const char *pwd, CMPIStatus *rc) { ClientEnc *cc=(ClientEnc*)calloc(1,sizeof(ClientEnc)); @@ -1857,11 +1857,16 @@ cc->enc.ft=&clientFt; cc->data.hostName= hn ? strdup(hn) : "localhost"; - cc->data.port= port ? strdup(port) : "5988"; cc->data.user= user ? strdup(user) : NULL; cc->data.pwd= pwd ? strdup(pwd) : NULL; - cc->data.scheme= "http"; - + cc->data.scheme= scheme ? strdup(scheme) : "http"; + if (port == NULL) { + if (strcmp(cc->data.scheme,"http")==0) { + cc->data.port="5988"; + } else if (strcmp(cc->data.scheme,"https")==0) { + cc->data.port="5989"; + } + } cc->connection=initConnection(&cc->data); return (CMCIClient*)cc; Index: test.c =================================================================== RCS file: /cvsroot/sblim/sfcc/test.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- test.c 26 Jun 2005 21:46:02 -0000 1.13 +++ test.c 19 Jul 2005 14:43:32 -0000 1.14 @@ -89,7 +89,7 @@ char hostName[512]; /* Setup a conncetion to the CIMOM */ - cc = cmciConnect("localhost",NULL,NULL,NULL,NULL); + cc = cmciConnect("localhost","http",NULL,NULL,NULL,NULL); gethostname(hostName,511); _HOSTNAME=strdup(hostName); --- cimXmlResp.h DELETED --- |
From: yeechan <ibm...@us...> - 2005-07-18 20:30:11
|
Update of /cvsroot/sblim/sfcb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31488 Modified Files: instance.c Log Message: defect #: 1238359 Index: instance.c =================================================================== RCS file: /cvsroot/sblim/sfcb/instance.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- instance.c 13 Jul 2005 14:26:02 -0000 1.11 +++ instance.c 18 Jul 2005 20:30:02 -0000 1.12 @@ -237,14 +237,13 @@ data.state=CMPI_nullValue; } } else if (type == CMPI_dateTime) { - if (value && value->dateTime && value->dateTime->hdl) - data.value.dateTime = (char *) value->dateTime->hdl; - else { + if (value && value->dateTime) { + data.value.dateTime = value->dateTime; + } else { data.value.dateTime=NULL; data.state=CMPI_nullValue; } - data.type=CMPI_dateTime; - } else if (type == CMPI_sint64 || type == CMPI_uint64 || type == CMPI_real64) { + } else if (type == CMPI_sint64 || type == CMPI_uint64 || type == CMPI_real64) { data.value = *value; } else { data.value.Int = value->Int; |
From: yeechan <ibm...@us...> - 2005-07-18 20:29:53
|
Update of /cvsroot/sblim/sfcb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29558 Modified Files: datetime.c Log Message: defect # 1238359 Index: datetime.c =================================================================== RCS file: /cvsroot/sblim/sfcb/datetime.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- datetime.c 8 Jul 2005 22:15:29 -0000 1.3 +++ datetime.c 18 Jul 2005 20:29:35 -0000 1.4 @@ -318,19 +318,17 @@ CMPIUint64 msecs,secs; CMPIBoolean interval; + char *str; - if (string == NULL) - { + if (string == NULL) { if (rc) CMSetStatus(rc, CMPI_RC_ERR_INVALID_PARAMETER); return; } - -char *str = strdup(string); +str = strdup(string); interval = (str[21] == ':'); - // 0000000000111111111122222 // 0123456789012345678901234 // yyyymmddhhmmss mmmmmmsutc |