Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 69384 Details for
Bug 157905
When importing remote log files the CBEs are created in an XMI agent although large resource on Derby was configured
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch for eContainer
patch-157905.txt (text/plain), 26.24 KB, created by
Marius Slavescu
on 2007-05-30 16:34:03 EDT
(
hide
)
Description:
Patch for eContainer
Filename:
MIME Type:
Creator:
Marius Slavescu
Created:
2007-05-30 16:34:03 EDT
Size:
26.24 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.hyades.resources.database >Index: src/org/eclipse/hyades/resources/database/internal/impl/BasePagingList.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.resources.database/src/org/eclipse/hyades/resources/database/internal/impl/BasePagingList.java,v >retrieving revision 1.2 >diff -u -r1.2 BasePagingList.java >--- src/org/eclipse/hyades/resources/database/internal/impl/BasePagingList.java 7 May 2007 04:52:22 -0000 1.2 >+++ src/org/eclipse/hyades/resources/database/internal/impl/BasePagingList.java 30 May 2007 20:31:32 -0000 >@@ -30,6 +30,8 @@ > import org.eclipse.emf.ecore.resource.ResourceSet; > import org.eclipse.emf.ecore.util.DelegatingEcoreEList.Dynamic; > import org.eclipse.hyades.loaders.util.IPagingList; >+import org.eclipse.hyades.models.cbe.CBEPackage; >+import org.eclipse.hyades.models.hierarchy.HierarchyPackage; > import org.eclipse.hyades.models.hierarchy.util.IntList; > import org.eclipse.hyades.models.hierarchy.util.PerfUtil; > import org.eclipse.hyades.resources.database.internal.DBCollectedExceptions; >@@ -45,8 +47,11 @@ > * be returned in the generated and reflective EMF APIs. > * > * @author slavescu >+ * @since 4.4 > */ > public abstract class BasePagingList extends Dynamic implements IPagingList { >+ public static int RS_FETCH_SIZE = 200; >+ > public static class PageInfo { > List page; > int index; >@@ -95,7 +100,7 @@ > > protected ResultSet rs; > >- protected boolean modified=false; >+// protected boolean modified=false; > //private List cachedIds=null; > > protected List delegateList() { >@@ -154,10 +159,6 @@ > index = index*pagingSize; > } > >- getRS().setFetchSize(200); >- if (!getRS().absolute(index + 1)) >- throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + delegateSize()); >- > if (getDataType() != null) { > loadEDataType(index, length, (EDataType) getFeatureByColumn().getEType()); > } else { >@@ -195,6 +196,10 @@ > } > } > >+ getRS().setFetchSize(RS_FETCH_SIZE); >+ if (!getRS().absolute(index + 1)) >+ throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + delegateSize()); >+ > int i = 0; > currentPage = new ArrayList(); > do { >@@ -223,15 +228,23 @@ > return; > } > } >+ getRS().setFetchSize(RS_FETCH_SIZE); >+ if (!getRS().absolute(index + 1)) >+ throw new IndexOutOfBoundsException("Index: " + index + ", Size: " + delegateSize()); >+ > IdsTypes idsTypes = new IdsTypes(length); > int i = 0; > EClass columnClass = getOutputElementType(); > short classId = (short)getDBMap().getClassId(columnClass); >+ //hack for defaultEvents toArray >+ if(classId==(short)getDBMap().getClassId(HierarchyPackage.eINSTANCE.getAbstractDefaultEvent())) >+ classId=(short)getDBMap().getClassId(CBEPackage.eINSTANCE.getCBECommonBaseEvent()); >+ > do { > i++; > try { > //TODO add support for id_TYPE from query >- if(useId_TYPE()) >+ if(useId_TYPE() && getRS().getMetaData().getColumnCount()>1) > classId = getRS().getShort(getColumnPos() + 2); > idsTypes.add(getRS().getInt(getColumnPos() + 1),classId); > } catch (Exception e) { >@@ -336,9 +349,21 @@ > } > > protected int delegateLastIndexOf(Object object) { >- if (object == null) >+ if (object == null || size==0) >+ return -1; >+ if(size!=-1 && rs==null && currentPage!=null) >+ { >+ for (int i = currentPage.size()-1; i >= 0; i--) { >+ if(currentPage.get(i)==object) >+ return i; >+ } > return -1; >- return getIndex(object, -1, true); >+ } >+ else >+ { >+ return getIndex(object, -1, true); >+ } >+ > } > > protected ListIterator delegateListIterator() { >@@ -571,11 +596,11 @@ > } > protected ResultSet getRS() { > if(rs==null) >- intiRS(); >+ initRS(); > return rs; > } > >- protected abstract void intiRS(); >+ protected abstract void initRS(); > > protected List convertToTypes(List list) { > for (int i = 0; i < list.size(); i=i+2) { >Index: src/org/eclipse/hyades/resources/database/internal/impl/DynamicPagingListImpl.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.resources.database/src/org/eclipse/hyades/resources/database/internal/impl/DynamicPagingListImpl.java,v >retrieving revision 1.10 >diff -u -r1.10 DynamicPagingListImpl.java >--- src/org/eclipse/hyades/resources/database/internal/impl/DynamicPagingListImpl.java 7 May 2007 04:52:22 -0000 1.10 >+++ src/org/eclipse/hyades/resources/database/internal/impl/DynamicPagingListImpl.java 30 May 2007 20:31:32 -0000 >@@ -12,10 +12,15 @@ > **********************************************************************/ > package org.eclipse.hyades.resources.database.internal.impl; > import java.sql.ResultSet; >+import java.sql.SQLException; > import java.sql.Statement; >+import java.util.ArrayList; > import java.util.Collection; > import java.util.Collections; >+import java.util.Iterator; >+import java.util.List; > >+import org.eclipse.emf.common.notify.Notification; > import org.eclipse.emf.common.notify.NotificationChain; > import org.eclipse.emf.ecore.EAttribute; > import org.eclipse.emf.ecore.EClass; >@@ -32,7 +37,6 @@ > import org.eclipse.hyades.resources.database.internal.DBResource; > import org.eclipse.hyades.resources.database.internal.Database; > import org.eclipse.hyades.resources.database.internal.InternalDatabase; >-import org.eclipse.hyades.resources.database.internal.ReferenceQuery; > import org.eclipse.hyades.resources.database.internal.extensions.DBCommandFactory; > import org.eclipse.hyades.resources.database.internal.extensions.IdsTypes; > import org.eclipse.hyades.resources.database.internal.extensions.JDBCHelper; >@@ -46,6 +50,7 @@ > private static final long serialVersionUID = 3762247548060316217L; > protected InternalDatabase database; > protected int ownerId; >+ private int updateCount; > public DynamicPagingListImpl(InternalEObject owner, EStructuralFeature eStructuralFeature, DBResource resource, int pagingSize) { > super(owner, eStructuralFeature); > this.database = (InternalDatabase) resource.getDatabase(); >@@ -59,7 +64,7 @@ > protected void init(int pagingSize) { > this.pagingSize = pagingSize; > size = -1; >- modified = false; >+// modified = false; > this.cache = database.getObjectCache(); > Integer id = cache.getId(owner); > if(id==null) >@@ -71,7 +76,11 @@ > //TODO add better error handling here > } > if(id!=null) >+ { >+ id = new Integer(id.intValue()+1); >+ > cache.add(owner, id); >+ } > else > cache.add(owner, new Integer(0)); > } >@@ -89,16 +98,6 @@ > else > return resource.isInDatabase(); > } >- >- protected EObject[] getObjects(ReferenceQuery query) { >- EObject[] referenced = null; >- try { >- referenced = getInternalDatabase().getObjects(query); >- } catch (Exception e) { >- throw new DBCollectedExceptions(e); >- } >- return referenced; >- } > > /** > * @see org.eclipse.hyades.resources.getInternalDatabase().PagingList#getPagingSize() >@@ -133,18 +132,6 @@ > } > return database; > } >- protected void addAdapter(EObject object) { >- if (object == null) >- return; >- DBResource resource = (DBResource) object.eResource(); >- if (resource == null) >- return; >- EContentAdapter contentAdapter = resource.getContentAdapter(); >- if (contentAdapter == null) >- return; >- if (!object.eAdapters().contains(contentAdapter)) >- object.eAdapters().add(contentAdapter); >- } > > protected EStructuralFeature getFeatureByColumn() { > return getEStructuralFeature(); >@@ -163,8 +150,18 @@ > } > return null; > } >- protected void intiRS() { >+ protected void initRS() { > try { >+ if(updateCount>0) >+ { >+ try { >+ database.forceUpdates(); >+ } catch (Exception e) { >+ throw new DBCollectedExceptions(e); >+ } >+ updateCount=0; >+ } >+ > if(rs!=null) > rs.close(); > >@@ -175,7 +172,6 @@ > if(getEStructuralFeature() instanceof EReference) > { > query = factory.createReferenceQuery(idsTypes, (EReference)getEStructuralFeature(), getDBMap(), getJDBCHelper().getDatabaseType() , getEStructuralFeature().isOrdered()); >- > } > else > { >@@ -209,18 +205,7 @@ > return null; > } > } >-// protected void addCurrentPageToContainer() { >-// for (int i = 0,length =currentPage.size(); i < length; i++) { >-// if(currentPage.get(i)!=null && ((EObject)currentPage.get(i)).eContainer()==null) >-// { >-// InternalEObject elem = ((InternalEObject)currentPage.get(i)); >-// if(getInverseEReference()!=null) >-// elem.eBasicSetContainer(owner,getInverseFeatureID(),null); >-// else >-// elem.eBasicSetContainer(owner,elem.eContainerFeatureID(),null); >-// } >-// } >-// } >+ > protected boolean useId_TYPE() { > if(getDataType()==null) > return true; >@@ -241,5 +226,155 @@ > } > } > } >+ protected Object delegateGet(int index) { >+ if(updateCount>0) >+ { >+ try { >+ database.forceUpdates(); >+ } catch (Exception e) { >+ throw new DBCollectedExceptions(e); >+ } >+ updateCount=0; >+ } >+ return super.delegateGet(index); >+ } >+ protected void delegateAdd(Object object) { >+ delegateAdd(size(), object); >+ } >+ >+ >+ protected void delegateAdd(int index, Object element) { >+ if(element instanceof EObject) >+ { >+ DBResourceContentAdapter adapter = addAdapter((EObject)element); >+ if(adapter!=null) >+ { >+ adapter.notifyChanged(createNotification(Notification.ADD, null, element, index, delegateIsEmpty())); >+ addToPageIfLoaded(index,element); >+ } >+ } >+ else >+ { >+ for (Iterator iterator = owner.eAdapters().iterator(); iterator.hasNext();) { >+ Object adapter = (Object) iterator.next(); >+ if (adapter instanceof DBResourceContentAdapter) { >+ ((DBResourceContentAdapter)adapter).notifyChanged(createNotification(Notification.ADD, null, element, index, delegateIsEmpty())); >+ addToPageIfLoaded(index,element); >+ break; >+ } >+ } >+ } >+ delegateSize(); >+ size++; >+ updateCount++; >+ } >+ >+ protected void addToPageIfLoaded(int index, Object element) { >+ if(index-currentIndex > 0 && index-currentIndex<pagingSize-1) >+ { >+ if(currentPage==null) >+ currentPage = new ArrayList(pagingSize); >+ currentPage.add(element); >+ currentLength=currentPage.size(); >+ if(currentLength==pagingSize) >+ { >+ PageInfo pageInfo=new PageInfo(currentPage,currentIndex/pagingSize,currentLength); >+ if(getFIFO().size()==FIFO_LIMIT) >+ getFIFO().remove(0); >+ getFIFO().add(pageInfo); >+ currentPage=null; >+ } >+ } >+ else >+ { >+ int pageIndex = index/pagingSize; >+ pageIndex = pageIndex*pagingSize; >+ >+ PageInfo pageInfo = getPageByPageIndex(pageIndex); >+ if(pageInfo==null) >+ { >+ List l = new ArrayList(); >+ l.add(element); >+ pageInfo=new PageInfo(l,pageIndex*pagingSize,1); >+ if(getFIFO().size()==FIFO_LIMIT) >+ getFIFO().remove(0); >+ getFIFO().add(pageInfo); >+ } >+ } >+ if(rs!=null) >+ try { >+ rs.close(); >+ rs=null; >+ } catch (SQLException e) { >+ rs=null; >+ throw new DBCollectedExceptions(e); >+ } >+ } >+ >+ protected PageInfo getPageByPageIndex(int pageIndex) >+ { >+ //find page >+ for (int i = getFIFO().size(); i-->0;) { >+ PageInfo pageInfo = (PageInfo)getFIFO().get(i); >+ if(pageInfo.getIndex()==pageIndex ) >+ { >+ return pageInfo; >+ } >+ } >+ return null; >+ } >+ protected DBResourceContentAdapter addAdapter(EObject object) { >+ if (object != null) >+ { >+ DBResource resource = (DBResource) object.eResource(); >+ if (resource != null) >+ { >+ EContentAdapter contentAdapter = resource.getContentAdapter(); >+ if (contentAdapter != null) >+ { >+ if (!object.eAdapters().contains(contentAdapter)) >+ object.eAdapters().add(contentAdapter); >+ return (DBResourceContentAdapter)contentAdapter; >+ } >+ } >+ for (Iterator iterator = owner.eAdapters().iterator(); iterator.hasNext();) { >+ Object adapter = (Object) iterator.next(); >+ if (adapter instanceof DBResourceContentAdapter) { >+ if (!object.eAdapters().contains(adapter)) >+ object.eAdapters().add(adapter); >+ return (DBResourceContentAdapter)adapter; >+ } >+ } >+ } >+ else >+ { >+ for (Iterator iterator = owner.eAdapters().iterator(); iterator.hasNext();) { >+ Object adapter = (Object) iterator.next(); >+ if (adapter instanceof DBResourceContentAdapter) { >+ return (DBResourceContentAdapter)adapter; >+ } >+ } >+ } >+ return null; >+ } >+ >+ /* >+ * (non-Javadoc) >+ * >+ * @see org.eclipse.emf.common.util.DelegatingEList#delegateClear() >+ */ >+ protected void delegateClear() { >+ init(pagingSize); >+ size=0; >+ } > >+ >+ public void set(Object newValue) { >+ throw new UnsupportedOperationException(); >+ } >+ >+ public void unset() { >+ throw new UnsupportedOperationException(); >+ } >+ > } // DynamicPagingListImpl >Index: src/org/eclipse/hyades/resources/database/internal/impl/IndirectedList.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.resources.database/src/org/eclipse/hyades/resources/database/internal/impl/IndirectedList.java,v >retrieving revision 1.15 >diff -u -r1.15 IndirectedList.java >--- src/org/eclipse/hyades/resources/database/internal/impl/IndirectedList.java 7 May 2007 04:52:22 -0000 1.15 >+++ src/org/eclipse/hyades/resources/database/internal/impl/IndirectedList.java 30 May 2007 20:31:32 -0000 >@@ -12,7 +12,6 @@ > package org.eclipse.hyades.resources.database.internal.impl; > import java.sql.ResultSet; > import java.util.Collection; >-import java.util.List; > > import org.eclipse.emf.common.notify.NotificationChain; > import org.eclipse.emf.common.util.URI; >@@ -24,6 +23,8 @@ > import org.eclipse.emf.ecore.InternalEObject; > import org.eclipse.emf.ecore.resource.Resource; > import org.eclipse.emf.ecore.resource.ResourceSet; >+import org.eclipse.hyades.models.cbe.CBECommonBaseEvent; >+import org.eclipse.hyades.models.hierarchy.HierarchyPackage; > import org.eclipse.hyades.models.hierarchy.extensions.ExtensionsPackage; > import org.eclipse.hyades.models.hierarchy.extensions.Query; > import org.eclipse.hyades.models.hierarchy.extensions.SimpleOperand; >@@ -89,7 +90,7 @@ > protected EClass getOutputElementType() { > return ((SimpleOperand) query.getOutputElements().get(getColumnPos())).getType(); > } >- protected void intiRS() { >+ protected void initRS() { > //TODO MS try to reinitialize rs here > } > protected int getColumnPos() { >@@ -110,6 +111,13 @@ > protected Resource getResource() { > return resourceSet.getResource(URI.createURI((String)query.getSources().get(0)).trimFragment(), false); > } >+ >+ protected int findContainerType(EObject o){ >+ if(o instanceof CBECommonBaseEvent) >+ return dbMap.getClassId(HierarchyPackage.eINSTANCE.getTRCAgent()); >+ return -1; >+ } >+ > protected void addCurrentPageToContainer() throws Exception{ > if(currentPage==null || currentPage.size()==0 || !(eStructuralFeature instanceof EReference)) > return; >@@ -125,9 +133,14 @@ > if(id!=null) > { > String p_p = cache.getP_P(id); >- int start = p_p.lastIndexOf('/',p_p.length()-2) ==-1 ? 0 : p_p.lastIndexOf('/',p_p.length()-2); >- String sContainerId = p_p.substring(start,p_p.length()-1); >- Integer containerId = new Integer(sContainerId); >+ int preSlashIndex = p_p.lastIndexOf('/',p_p.length()-2); >+ >+ String sContainerId = p_p.substring(preSlashIndex>0?preSlashIndex:0,p_p.length()-1); >+ int cId = Integer.parseInt(sContainerId); >+ if(idsTypes.getIds().indexOf(cId, 0)!=-1) >+ continue; >+ >+ Integer containerId = new Integer(cId); > InternalEObject container = (InternalEObject)cache.getObject(containerId); > if(container!=null) > { >@@ -135,7 +148,9 @@ > eObject.eBasicSetContainer(container,0, (NotificationChain)null); > continue; > } >- int type = dbMap.getClassId((EClass)((EObject)o).eClass().eContainingFeature().getEType()); >+ >+ int type = findContainerType((EObject)o); >+ > idsTypes.add(Integer.parseInt(sContainerId), (short)type); > } > } >@@ -157,6 +172,7 @@ > } > > get.execute(); >+ > for (int i = 0,length = currentPage.size(); i < length; i++) { > Object o = currentPage.get(i); > if(o!=null && o instanceof EObject) >@@ -168,7 +184,9 @@ > if(id!=null) > { > String p_p = cache.getP_P(id); >- String sContainerId = p_p.substring(p_p.lastIndexOf('/',p_p.length()-2),p_p.length()-1); >+ int preSlashIndex = p_p.lastIndexOf('/',p_p.length()-2); >+ >+ String sContainerId = p_p.substring(preSlashIndex>0?preSlashIndex:0,p_p.length()-1); > Integer containerId = new Integer(sContainerId); > InternalEObject container = (InternalEObject)cache.getObject(containerId); > if(container!=null) >@@ -183,6 +201,10 @@ > } > protected void delegateClear() { > } >+ >+ public void clear() { >+ } >+ > public NotificationChain inverseRemove(Object object, NotificationChain notifications) { > return notifications; > } >Index: src/org/eclipse/hyades/resources/database/internal/impl/DBResourceContentAdapter.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.resources.database/src/org/eclipse/hyades/resources/database/internal/impl/DBResourceContentAdapter.java,v >retrieving revision 1.6 >diff -u -r1.6 DBResourceContentAdapter.java >--- src/org/eclipse/hyades/resources/database/internal/impl/DBResourceContentAdapter.java 7 May 2007 04:52:22 -0000 1.6 >+++ src/org/eclipse/hyades/resources/database/internal/impl/DBResourceContentAdapter.java 30 May 2007 20:31:32 -0000 >@@ -155,13 +155,15 @@ > > protected void processAdd(Notification notification) { > if (notification.getFeature() == null) >+ { > return; >+ } > > EObject owner = (EObject) notification.getNotifier(); > EStructuralFeature feature = (EStructuralFeature) notification.getFeature(); > if(feature.isTransient()) > return; >- if (owner.eGet(feature) instanceof PagingList) >+ if (owner.eGet(feature) instanceof DynamicPagingListImpl) > updateForPagingListAdd(notification, owner, (EReference) feature); > else if (feature.isMany() && resource.isInDatabase()) { > updateDatabase(notification, owner); >Index: src/org/eclipse/hyades/resources/database/internal/impl/UpdateCommand.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.resources.database/src/org/eclipse/hyades/resources/database/internal/impl/UpdateCommand.java,v >retrieving revision 1.5 >diff -u -r1.5 UpdateCommand.java >--- src/org/eclipse/hyades/resources/database/internal/impl/UpdateCommand.java 4 Mar 2007 08:42:35 -0000 1.5 >+++ src/org/eclipse/hyades/resources/database/internal/impl/UpdateCommand.java 30 May 2007 20:31:32 -0000 >@@ -214,8 +214,10 @@ > { > Integer sourceId = getObjectId(source); > Integer targetId = getObjectId(target); >+ > if (sourceId == null || targetId == null) { >- delayed.add(notification); >+ if(target!=null)//TODO MS - remove this hack, null cases should be handled also >+ delayed.add(notification); > continue; > } > if(!sourceToSourceType.containsKey(sourceId)) >Index: src/org/eclipse/hyades/resources/database/internal/extensions/AddCommand.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.hyades.resources.database/src/org/eclipse/hyades/resources/database/internal/extensions/AddCommand.java,v >retrieving revision 1.9 >diff -u -r1.9 AddCommand.java >--- src/org/eclipse/hyades/resources/database/internal/extensions/AddCommand.java 7 May 2007 04:52:22 -0000 1.9 >+++ src/org/eclipse/hyades/resources/database/internal/extensions/AddCommand.java 30 May 2007 20:31:32 -0000 >@@ -334,8 +334,9 @@ > } > protected void assignObjectsToIds(List objects) { > for (int i = 0, l = objects.size(); i < l; i++) { >- Integer key = new Integer(++largestDatabaseId); > Object object = objects.get(i); >+ Integer key = new Integer(++largestDatabaseId); >+ > objectsToKeys.put(object, key); > } > } >#P org.eclipse.tptp.platform.models >Index: src-hierarchy/org/eclipse/hyades/loaders/util/LoadersUtils.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.models/src-hierarchy/org/eclipse/hyades/loaders/util/LoadersUtils.java,v >retrieving revision 1.31 >diff -u -r1.31 LoadersUtils.java >--- src-hierarchy/org/eclipse/hyades/loaders/util/LoadersUtils.java 18 Apr 2007 14:56:24 -0000 1.31 >+++ src-hierarchy/org/eclipse/hyades/loaders/util/LoadersUtils.java 30 May 2007 20:31:33 -0000 >@@ -730,7 +730,7 @@ > * @deprecated Use {@link ModelDebugger#logCallstackWithLimit(Throwable,int)} instead > */ > public static void logCallstackWithLimit(Throwable e, final int limit) { >- ModelDebugger.logCallstackWithLimit(e, limit); >+ ModelDebugger.logCallstackWithLimit(e, limit,System.out); > } > > /** >Index: src-hierarchy/org/eclipse/hyades/loaders/util/HierarchyLookupService.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.models/src-hierarchy/org/eclipse/hyades/loaders/util/HierarchyLookupService.java,v >retrieving revision 1.6 >diff -u -r1.6 HierarchyLookupService.java >--- src-hierarchy/org/eclipse/hyades/loaders/util/HierarchyLookupService.java 8 Feb 2006 19:56:48 -0000 1.6 >+++ src-hierarchy/org/eclipse/hyades/loaders/util/HierarchyLookupService.java 30 May 2007 20:31:33 -0000 >@@ -60,11 +60,11 @@ > return true; > } > } else if (type == AgentsContext.class) { >- if (((AgentsContext) object).getId() != null) { >+// if (((AgentsContext) object).getId() != null) { > addOrRemove(typeMap, LoadersUtils.getLookUpKey(((AgentsContext) object).getId()), object, remove); > > return true; >- } >+// } > } else if (type == AgentProxyContext.class) { > AgentProxyContext c = (AgentProxyContext) object; > >Index: src-hierarchy/org/eclipse/hyades/models/hierarchy/util/HierarchyXMIResourceImpl.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.models/src-hierarchy/org/eclipse/hyades/models/hierarchy/util/HierarchyXMIResourceImpl.java,v >retrieving revision 1.22 >diff -u -r1.22 HierarchyXMIResourceImpl.java >--- src-hierarchy/org/eclipse/hyades/models/hierarchy/util/HierarchyXMIResourceImpl.java 8 Mar 2007 21:10:35 -0000 1.22 >+++ src-hierarchy/org/eclipse/hyades/models/hierarchy/util/HierarchyXMIResourceImpl.java 30 May 2007 20:31:33 -0000 >@@ -312,12 +312,14 @@ > if ((context != null) && (context.getAgentProxy() != null)) { > context.getAgentProxy().setAgent(null); > } >+ context=null; > // SaveUtil.removeDocument(this); > } > > public void doShallowUnload() { > unloadLookupContext(); > EMFUtil.unload(this); >+ context=null; > // SaveUtil.removeDocument(this); > } > >@@ -491,7 +493,7 @@ > > LookupServiceExtensions.getInstance().deregister(context); > LookupServiceExtensions.getInstance().deregister(null, HierarchyContext.class, getURI().toString()); >- context = null; >+// context = null; > } > } > >Index: src-hierarchy/org/eclipse/hyades/models/hierarchy/util/PerfUtil.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.models/src-hierarchy/org/eclipse/hyades/models/hierarchy/util/PerfUtil.java,v >retrieving revision 1.11 >diff -u -r1.11 PerfUtil.java >--- src-hierarchy/org/eclipse/hyades/models/hierarchy/util/PerfUtil.java 12 Oct 2006 19:49:04 -0000 1.11 >+++ src-hierarchy/org/eclipse/hyades/models/hierarchy/util/PerfUtil.java 30 May 2007 20:31:33 -0000 >@@ -105,7 +105,10 @@ > } > public void printStatus(PrintStream out) { > if(debug) >+ { > out.println(msg + ": deltaTime=" + getTime() + " - stopTime=" + stopTime + " - usedMemoryDelta=" + getUsedMemoryDelta() +" - freeMemoryDelta=" + getFreeMemoryDelta()+ " - totalMemoryDelta=" + getTotalMemoryDelta() + " - usedMemoryAfter=" + (stopTotMem-stopFreeMem)+ " - freeMemoryAfter=" + stopFreeMem +" - totalMemoryAfter=" + stopTotMem); >+ ModelDebugger.logCallstackWithLimit(new Throwable("PerfUtil"),ModelDebugger.INSTANCE.exceptionDepth,out); >+ } > } > /** > * @return >Index: src-utils/org/eclipse/hyades/models/util/ModelDebugger.java >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.models/src-utils/org/eclipse/hyades/models/util/ModelDebugger.java,v >retrieving revision 1.7 >diff -u -r1.7 ModelDebugger.java >--- src-utils/org/eclipse/hyades/models/util/ModelDebugger.java 23 Apr 2007 07:52:42 -0000 1.7 >+++ src-utils/org/eclipse/hyades/models/util/ModelDebugger.java 30 May 2007 20:31:33 -0000 >@@ -303,16 +303,16 @@ > if(msg!=null) > printStream.println(msg); > if (e != null) { >- logCallstackWithLimit(e,10000); >+ logCallstackWithLimit(e,10000,printStream); > } > else > { > printStream.print("\tnull Throwable"); > if(ModelDebugger.INSTANCE.exceptionDepth>0) >- logCallstackWithLimit(new Throwable("LOG_CALL_STACK"),ModelDebugger.INSTANCE.exceptionDepth); >+ logCallstackWithLimit(new Throwable("LOG_CALL_STACK"),ModelDebugger.INSTANCE.exceptionDepth,printStream); > } > } >- public static void logCallstackWithLimit(Throwable e, final int limit) { >+ public static void logCallstackWithLimit(Throwable e, final int limit, PrintStream out) { > StringWriter stringWriter = new StringWriter (){ > public String toString() { > StringBuffer buf = getBuffer(); >@@ -346,11 +346,11 @@ > } > }; > e.printStackTrace(new PrintWriter(stringWriter)); >- printStream.println(stringWriter.toString()); >+ out.println(stringWriter.toString()); > } > public static void log(String s) { > printStream.println(Thread.currentThread()+" - "+s); > if(INSTANCE.exceptionDepth > 0 ) >- logCallstackWithLimit(new Throwable("LOG_CALL_STACK"),ModelDebugger.INSTANCE.exceptionDepth); >+ logCallstackWithLimit(new Throwable("LOG_CALL_STACK"),ModelDebugger.INSTANCE.exceptionDepth,printStream); > } > } >\ No newline at end of file
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 157905
: 69384