Thread: [Joafip-svn] SF.net SVN: joafip:[2911] trunk
Brought to you by:
luc_peuvrier
|
From: <luc...@us...> - 2011-10-01 17:08:55
|
Revision: 2911
http://joafip.svn.sourceforge.net/joafip/?rev=2911&view=rev
Author: luc_peuvrier
Date: 2011-10-01 17:08:48 +0000 (Sat, 01 Oct 2011)
Log Message:
-----------
IInstanceFactory field are now transient
Modified Paths:
--------------
trunk/joafip/src/main/java/net/sf/joafip/service/ExclusiveDataAccessSession.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/manager/AbstractObjectIOManagerIOForObject.java
trunk/joafip-4test/src/main/java/net/sf/joafip/autosave/SpellCheckJoafipDAO.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractPerfService.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/Exporter.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/Garbage.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/Inserter.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/Searcher.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/AbstractPLinkedTreeSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/AbstractPTreeSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/MapCollectionValues.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PHashMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PHashMapKeySet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PHashSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PLinkedHashMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PLinkedHashSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PLinkedMapKeySet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PLinkedTreeMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PMapKeyNavigableSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PSynchronizedList.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PTreeMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/arraylist/ArrayListSupport.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/hash/HashSupport.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/hash/HashSupportIterator.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/hash/HashSupportNodeEntry.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/linked/hash/LinkedHashSupport.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/linked/tree/LinkedTreeSupport.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/linkedlist/LinkedListSupport.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/tree/TreeSupport.java
trunk/joafip-rbtree/src/main/java/net/sf/joafip/redblacktree/impl/memory/service/RBTNodeManager.java
trunk/joafip-rbtree/src/main/java/net/sf/joafip/redblacktree/service/RedBlackTree.java
Added Paths:
-----------
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractInserter.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractSearcher.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/ImportSearcher.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/Importer.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterFewInsertAndExport.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/MainExportScanner.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/MainExportTransform.java
trunk/joafip-4test/src/main/resources/extract.xsl
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2011-10-01 17:08:58
|
Revision: 2911
http://joafip.svn.sourceforge.net/joafip/?rev=2911&view=rev
Author: luc_peuvrier
Date: 2011-10-01 17:08:48 +0000 (Sat, 01 Oct 2011)
Log Message:
-----------
IInstanceFactory field are now transient
Modified Paths:
--------------
trunk/joafip/src/main/java/net/sf/joafip/service/ExclusiveDataAccessSession.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/manager/AbstractObjectIOManagerIOForObject.java
trunk/joafip-4test/src/main/java/net/sf/joafip/autosave/SpellCheckJoafipDAO.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractPerfService.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/Exporter.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/Garbage.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/Inserter.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/Searcher.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/AbstractPLinkedTreeSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/AbstractPTreeSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/MapCollectionValues.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PHashMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PHashMapKeySet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PHashSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PLinkedHashMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PLinkedHashSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PLinkedMapKeySet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PLinkedTreeMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PMapKeyNavigableSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PSynchronizedList.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PTreeMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/arraylist/ArrayListSupport.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/hash/HashSupport.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/hash/HashSupportIterator.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/hash/HashSupportNodeEntry.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/linked/hash/LinkedHashSupport.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/linked/tree/LinkedTreeSupport.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/linkedlist/LinkedListSupport.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/tree/TreeSupport.java
trunk/joafip-rbtree/src/main/java/net/sf/joafip/redblacktree/impl/memory/service/RBTNodeManager.java
trunk/joafip-rbtree/src/main/java/net/sf/joafip/redblacktree/service/RedBlackTree.java
Added Paths:
-----------
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractInserter.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractSearcher.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/ImportSearcher.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/Importer.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/InserterFewInsertAndExport.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/MainExportScanner.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/MainExportTransform.java
trunk/joafip-4test/src/main/resources/extract.xsl
Modified: trunk/joafip/src/main/java/net/sf/joafip/service/ExclusiveDataAccessSession.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/service/ExclusiveDataAccessSession.java 2011-10-01 16:45:37 UTC (rev 2910)
+++ trunk/joafip/src/main/java/net/sf/joafip/service/ExclusiveDataAccessSession.java 2011-10-01 17:08:48 UTC (rev 2911)
@@ -39,7 +39,8 @@
private static final String SAVE_ERROR = "save error";
- private final IInstanceFactory instanceFactory = new InstanceFactory(this);
+ private final transient IInstanceFactory instanceFactory = new InstanceFactory(
+ this);
public ExclusiveDataAccessSession(final FilePersistence filePersistence) {
super(filePersistence);
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/manager/AbstractObjectIOManagerIOForObject.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/manager/AbstractObjectIOManagerIOForObject.java 2011-10-01 16:45:37 UTC (rev 2910)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/manager/AbstractObjectIOManagerIOForObject.java 2011-10-01 17:08:48 UTC (rev 2911)
@@ -166,7 +166,7 @@
*/
private int zipCompressionLevel = Deflater.BEST_SPEED;
- private IInstanceFactory instanceFactory;
+ private transient IInstanceFactory instanceFactory;
protected final HelperBinaryConversion helperBinaryConversion;
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/autosave/SpellCheckJoafipDAO.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/autosave/SpellCheckJoafipDAO.java 2011-10-01 16:45:37 UTC (rev 2910)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/autosave/SpellCheckJoafipDAO.java 2011-10-01 17:08:48 UTC (rev 2911)
@@ -40,7 +40,7 @@
private IDataAccessSession session;
- private IInstanceFactory instanceFactory;
+ private transient IInstanceFactory instanceFactory;
private SpellCheckBase spellCheckBase;
Added: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractInserter.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractInserter.java (rev 0)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractInserter.java 2011-10-01 17:08:48 UTC (rev 2911)
@@ -0,0 +1,455 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.performance.items.service;
+
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.lang.reflect.Field;
+import java.util.List;
+import java.util.Map;
+
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.StorableAccess;
+import net.sf.joafip.entity.EnumFilePersistenceCloseAction;
+import net.sf.joafip.file.entity.PageNode;
+import net.sf.joafip.file.service.RandomAccessFileReadWriteCache;
+import net.sf.joafip.java.util.PLinkedTreeSet;
+import net.sf.joafip.meminspector.service.MemInspectorException;
+import net.sf.joafip.meminspector.service.inspect.MemInspector;
+import net.sf.joafip.meminspector.service.show.ShowObjectTree;
+import net.sf.joafip.performance.items.entity.Item;
+import net.sf.joafip.performance.items.entity.ItemList;
+import net.sf.joafip.performance.items.entity.ItemTemplate;
+import net.sf.joafip.performance.items.entity.ItemTemplateList;
+import net.sf.joafip.service.FilePersistenceClassNotFoundException;
+import net.sf.joafip.service.FilePersistenceDataCorruptedException;
+import net.sf.joafip.service.FilePersistenceException;
+import net.sf.joafip.service.FilePersistenceInvalidClassException;
+import net.sf.joafip.service.FilePersistenceNotSerializableException;
+import net.sf.joafip.service.FilePersistenceTooBigForSerializationException;
+import net.sf.joafip.service.IDataAccessSession;
+import net.sf.joafip.service.MemInspectorJoafipSetup;
+import net.sf.joafip.store.service.StoreClassNotFoundException;
+import net.sf.joafip.store.service.StoreException;
+import net.sf.joafip.store.service.proxy.StaticProxyCallBack;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@SuppressWarnings("PMD")
+@NotStorableClass
+@StorableAccess
+public class AbstractInserter extends AbstractPerfService {
+
+ private static final File FILE_FOR_LUC = new File(RUNTIME_DIR
+ + "/forLuc.txt");
+
+ public static final File MEM_BIN = new File(RUNTIME_DIR + "/mem.bin");
+
+ private static final File MEM2_BIN = new File(RUNTIME_DIR + "/mem2.bin");
+
+ private static final boolean MEM_INSPECT = false;
+
+ private static final boolean OBJ_MEM_SIZE = false;
+
+ private MemInspector memInspector;
+
+ private boolean markNew;
+
+ private int pageSetSize;
+
+ private int readCacheMapSize;
+
+ private int writeCacheMapSize;
+
+ private int freePageRootNodeSize;
+
+ private int usedPageRootNodeSize;
+
+ public AbstractInserter(final String pathName)
+ throws FilePersistenceException,
+ FilePersistenceInvalidClassException,
+ FilePersistenceNotSerializableException,
+ FilePersistenceClassNotFoundException,
+ FilePersistenceDataCorruptedException, StoreClassNotFoundException,
+ FilePersistenceTooBigForSerializationException {
+ super(pathName);
+ }
+
+ protected void run(final int numberOfItem) throws FilePersistenceException,
+ StoreException, FilePersistenceClassNotFoundException,
+ FilePersistenceInvalidClassException,
+ FilePersistenceDataCorruptedException,
+ FilePersistenceNotSerializableException, MemInspectorException,
+ IOException, SecurityException, IllegalArgumentException,
+ NoSuchFieldException, IllegalAccessException,
+ FilePersistenceTooBigForSerializationException {
+ final Runtime runtime = Runtime.getRuntime();
+ final MemInspector memInspectorForMemory = new MemInspector();
+ addTemplate();
+ long maxMemUse = 0;
+ long maxMemUse2 = 0;
+ pageSetSize = 0;
+ readCacheMapSize = 0;
+ writeCacheMapSize = 0;
+ freePageRootNodeSize = 0;
+ usedPageRootNodeSize = 0;
+ final IDataAccessSession session = filePersistence
+ .createDataAccessSession();
+ initMemInspector();
+ session.open();
+ initializeByItemDuration();
+ boolean added = false;
+ long duration = 0;
+ for (int identifier = 0; !added && identifier < numberOfItem + 1; identifier++) {
+ // final ItemTemplateList itemTemplateList =
+ // getItemTemplateList(session);
+ // final ItemTemplate itemTemplate;
+ // switch (identifier % 3) {
+ // case 0:
+ // itemTemplate = itemTemplateList.getItemTemplate(1);
+ // break;
+ // case 1:
+ // itemTemplate = itemTemplateList.getItemTemplate(2);
+ // break;
+ // case 2:
+ // itemTemplate = itemTemplateList.getItemTemplate(3);
+ // break;
+ // default:
+ // itemTemplate = null;
+ // }
+ addItem(session, identifier);
+
+ if (identifier % BATCH_SIZE == BATCH_SIZE - 1) {
+
+ final long startTime = System.currentTimeMillis();
+ session.closeAndWait(EnumFilePersistenceCloseAction.SAVE);
+ final long currentTime = System.currentTimeMillis();
+ System.gc();
+ added = checkAdded(byItemIndex);
+ duration += (currentTime - startTime);
+ final long byItem = duration * 1000 / (identifier + 1);
+ final long memUse = runtime.totalMemory()
+ - runtime.freeMemory();
+ byItemMem[byItemIndex] = (int) (memUse / 1024);
+ if (memUse > maxMemUse) {
+ maxMemUse = memUse;
+ }
+ byItemDuration[byItemIndex] = (int) byItem;
+ final StringBuilder builder = new StringBuilder();
+ builder.append('\n');
+ builder.append(duration);
+ builder.append(" mS ");
+ builder.append(identifier + 1);
+ builder.append(" appened, by item ");
+ builder.append(byItem);
+ builder.append(" µS\nmem used=");
+ builder.append(mem(memUse));
+ builder.append("\nmax= ");
+ builder.append(mem(maxMemUse));
+ if (OBJ_MEM_SIZE) {
+ final long memUse2 = memInspectorForMemory
+ .memoryUsed(filePersistence);
+ if (memUse2 > maxMemUse2) {// NOPMD
+ maxMemUse2 = memUse2;
+ }
+ byItemMem2[byItemIndex] = (int) (memUse2 / 1024);
+ builder.append("\n\nuse= ");
+ builder.append(mem(memUse2));
+ builder.append("\nmax= ");
+ builder.append(mem(maxMemUse2));
+ }
+ if (FILE_CACHE) {
+ builder.append("\npageSet size=");
+ builder.append(pageSetSize);
+ builder.append('/');
+ builder.append(NUMBER_OF_PAGE);
+ builder.append("\nreadCacheMapSize size=");
+ builder.append(readCacheMapSize);
+ builder.append("\nwriteCacheMapSize size=");
+ builder.append(writeCacheMapSize);
+ builder.append("\nfreePageRootNodeSize size=");
+ builder.append(freePageRootNodeSize);
+ builder.append("\nusedPageRootNodeSize size=");
+ builder.append(usedPageRootNodeSize);
+ }
+ builder.append("\nWO SIZE=");
+ builder.append(StaticProxyCallBack.size());
+ logger.info(builder.toString());
+ byItemIndex++;
+
+ session.open();
+ }
+ }
+
+ session.closeAndWait(EnumFilePersistenceCloseAction.SAVE);
+
+ session.open();
+ final ItemList itemList = getItemList(session);
+ itemList.removeItem(NUMBER_OF_ITEM);
+ session.closeAndWait(EnumFilePersistenceCloseAction.SAVE);
+
+ FILE_FOR_LUC.delete();
+
+ logSize(-1, duration);
+
+ // startTime = System.currentTimeMillis();
+ // final int numberGarbaged = filePersistence.garbageSweep();
+ // endTime = System.currentTimeMillis();
+ // duration = (endTime - startTime);
+ //
+ // logSize(numberGarbaged, duration);
+
+ ObjectOutputStream objectOutputStream = new ObjectOutputStream(
+ new FileOutputStream(DURATION_BIN));
+ objectOutputStream.writeObject(byItemDuration);
+ objectOutputStream.close();
+
+ objectOutputStream = new ObjectOutputStream(new FileOutputStream(
+ MEM_BIN));
+ objectOutputStream.writeObject(byItemMem);
+ objectOutputStream.close();
+
+ if (OBJ_MEM_SIZE) {
+ objectOutputStream = new ObjectOutputStream(new FileOutputStream(
+ MEM2_BIN));
+ objectOutputStream.writeObject(byItemMem2);
+ objectOutputStream.close();
+ }
+
+ if (added) {
+ ShowObjectTree.show("runtime/mem.bin");
+ }
+ }
+
+ protected void close() throws FilePersistenceException {
+ filePersistence.close();
+ }
+
+ private void initMemInspector() throws MemInspectorException {
+ if (MEM_INSPECT) {
+ memInspector = new MemInspector();
+ MemInspectorJoafipSetup.setup(memInspector);
+ // memInspector.inspect(this, false);
+ markNew = false;
+ }
+ }
+
+ @SuppressWarnings("unchecked")
+ private boolean checkAdded(final int byItemIndex)
+ throws MemInspectorException, SecurityException,
+ NoSuchFieldException, IllegalArgumentException,
+ IllegalAccessException {
+ final boolean added;
+ if (MEM_INSPECT) {
+ if (markNew) {
+ memInspector.inspect(this, true);
+ added = memInspector.added();
+ if (added) {
+ memInspector.serialize(new File("runtime/mem.bin"));
+ }
+ } else {
+ memInspector.inspect(this, false);
+ markNew = byItemIndex >= 2;
+ added = false;
+ }
+ if (FILE_CACHE) {
+ final List<Object> list = memInspector
+ .getInstanceOfClass("net.sf.joafip.file.service.RandomAccessFileReadWriteCache");
+ if (list.size() != 1) {
+ throw new MemInspectorException(
+ "bad number of RandomAccessFileReadWriteCache instance: "
+ + list.size());
+ }
+ final Object fileCache = list.get(0);
+ Field field = RandomAccessFileReadWriteCache.class
+ .getDeclaredField("pageSet");
+ field.setAccessible(true);
+ final PLinkedTreeSet<Long> pageSet = (PLinkedTreeSet<Long>) field
+ .get(fileCache);
+ pageSetSize = pageSet.size();
+
+ field = RandomAccessFileReadWriteCache.class
+ .getDeclaredField("readCacheMap");
+ field.setAccessible(true);
+ final Map<Long, PageNode> readCacheMap = (Map<Long, PageNode>) field
+ .get(fileCache);
+ readCacheMapSize = readCacheMap.size();
+
+ field = RandomAccessFileReadWriteCache.class
+ .getDeclaredField("writeCacheMap");
+ field.setAccessible(true);
+ final Map<Long, PageNode> writeCacheMap = (Map<Long, PageNode>) field
+ .get(fileCache);
+ writeCacheMapSize = writeCacheMap.size();
+
+ field = RandomAccessFileReadWriteCache.class
+ .getDeclaredField("freePageRootNode");
+ field.setAccessible(true);
+ PageNode pageNode = (PageNode) field.get(fileCache);
+ freePageRootNodeSize = pageNodeListSize(pageNode);
+
+ field = RandomAccessFileReadWriteCache.class
+ .getDeclaredField("usedPageRootNode");
+ field.setAccessible(true);
+ pageNode = (PageNode) field.get(fileCache);
+ usedPageRootNodeSize = pageNodeListSize(pageNode);
+ }
+ } else {
+ added = false;
+ }
+ return added;
+ }
+
+ /**
+ * @param numberGarbaged
+ * @param duration
+ * @throws FilePersistenceException
+ * @throws FileNotFoundException
+ */
+ private void logSize(final int numberGarbaged, final long duration)
+ throws FilePersistenceException, FileNotFoundException {
+ PrintWriter writer;
+ writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(
+ new FileOutputStream(FILE_FOR_LUC, true))));
+ String message;
+ message = "-----------------------";
+ printMessage(writer, message);
+
+ message = "nb of item=" + NUMBER_OF_ITEM;
+ printMessage(writer, message);
+ message = "batch size=" + BATCH_SIZE;
+ printMessage(writer, message);
+ message = "duration=" + duration + " mS";
+ printMessage(writer, message);
+
+ if (numberGarbaged >= 0) {
+ message = "garbaged=" + numberGarbaged;
+ printMessage(writer, message);
+ }
+ if (filePersistence.isGarbageManagement()) {
+ message = "to garbage=" + filePersistence.getNumberOfToGarbage();
+ printMessage(writer, message);
+ message = "garbage candidate="
+ + filePersistence.getNumberOfGarbageCandidate();
+ printMessage(writer, message);
+ }
+ message = "nb of data record="
+ + filePersistence.getNumberOfDataRecord();
+ printMessage(writer, message);
+ message = "nb of free record="
+ + filePersistence.getNumberOfFreeRecord();
+ printMessage(writer, message);
+ message = "used size=" + filePersistence.usedSize();
+ printMessage(writer, message);
+ message = "free size=" + filePersistence.freeSize();
+ printMessage(writer, message);
+ message = "heap size=" + filePersistence.totalSize();
+ printMessage(writer, message);
+ writer.close();
+ }
+
+ private int pageNodeListSize(final PageNode pageNode) {
+ int size = 0;
+ PageNode current = pageNode;
+ while (current != null) {
+ size++;
+ current = current.next;
+ }
+ return size;
+ }
+
+ private String mem(final long value) {
+ final long ktot = value / 1024;
+ final int b = (int) (value % 1024);
+ final int k = (int) (ktot % 1024);
+ final long mtot = ktot / 1024;
+ final long m = mtot % 1024;
+ final long gtot = mtot / 1024;
+ return String.format("%03d g %04d m %04d k %04d b", gtot, m, k, b);
+ }
+
+ /**
+ * @param writer
+ * @param message
+ */
+ private void printMessage(final PrintWriter writer, final String message) {
+ logger.info(message);
+ writer.println(message);
+ }
+
+ /**
+ * @param session
+ * @param identifier
+ * @throws FilePersistenceException
+ */
+ private void addItem(final IDataAccessSession session, final int identifier)
+ throws FilePersistenceException {
+ try {
+ final Item item = new Item(identifier, null/* itemTemplate */,
+ "item" + identifier);
+ final ItemList itemList = getItemList(session);
+ itemList.addItem(item);
+ } catch (final RuntimeException exception) {
+ logger.fatal("adding item " + identifier, exception);
+ throw exception;
+ }
+ }
+
+ private void addTemplate() throws FilePersistenceException,
+ FilePersistenceClassNotFoundException,
+ FilePersistenceInvalidClassException,
+ FilePersistenceDataCorruptedException,
+ FilePersistenceNotSerializableException,
+ FilePersistenceTooBigForSerializationException {
+ final ItemTemplate itemTemplate1 = new ItemTemplate(1, "template1");
+ final ItemTemplate itemTemplate2 = new ItemTemplate(2, "template2");
+ final ItemTemplate itemTemplate3 = new ItemTemplate(3, "template3");
+ final IDataAccessSession session = filePersistence
+ .createDataAccessSession();
+ session.open();
+ final ItemTemplateList itemTemplateList = getItemTemplateList(session);
+ itemTemplateList.addItemTemplate(itemTemplate1);
+ itemTemplateList.addItemTemplate(itemTemplate2);
+ itemTemplateList.addItemTemplate(itemTemplate3);
+ session.closeAndWait(EnumFilePersistenceCloseAction.SAVE);
+ }
+
+ protected void export(final String directoryName)
+ throws FilePersistenceException,
+ FilePersistenceClassNotFoundException,
+ FilePersistenceInvalidClassException,
+ FilePersistenceDataCorruptedException,
+ FilePersistenceNotSerializableException,
+ FilePersistenceTooBigForSerializationException {
+ filePersistence.xmlExport(directoryName, directoryName + "/tmp", false);
+ }
+}
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractPerfService.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractPerfService.java 2011-10-01 16:45:37 UTC (rev 2910)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractPerfService.java 2011-10-01 17:08:48 UTC (rev 2911)
@@ -41,13 +41,13 @@
@StorableAccess
public class AbstractPerfService {
+ protected final JoafipLogger logger = JoafipLogger.getLogger(getClass());// NOPMD
+
protected static final String RUNTIME_DIR = "runtime_perf";
public static final File DURATION_BIN = new File(RUNTIME_DIR
+ "/duration.bin");
- protected final JoafipLogger logger = JoafipLogger.getLogger(getClass());// NOPMD
-
protected static final int BATCH_SIZE = 1000;
protected static final int NUMBER_OF_ITEM = 1000000;
@@ -77,7 +77,8 @@
protected int byItemIndex;
- public AbstractPerfService() throws FilePersistenceException,
+ public AbstractPerfService(final String pathName)
+ throws FilePersistenceException,
FilePersistenceInvalidClassException,
FilePersistenceNotSerializableException,
FilePersistenceClassNotFoundException,
@@ -86,7 +87,7 @@
super();
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
try {
- builder.setPathName(RUNTIME_DIR);
+ builder.setPathName(pathName);
builder.setRemoveFiles(false);
builder.setProxyMode(true);
builder.setCrashSafeMode(CRASH_SAFE_MODE);
Added: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractSearcher.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractSearcher.java (rev 0)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractSearcher.java 2011-10-01 17:08:48 UTC (rev 2911)
@@ -0,0 +1,123 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.performance.items.service;
+
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectOutputStream;
+import java.util.LinkedList;
+import java.util.List;
+
+import net.sf.joafip.entity.EnumFilePersistenceCloseAction;
+import net.sf.joafip.logger.JoafipLogger;
+import net.sf.joafip.performance.items.entity.ItemList;
+import net.sf.joafip.service.FilePersistenceClassNotFoundException;
+import net.sf.joafip.service.FilePersistenceDataCorruptedException;
+import net.sf.joafip.service.FilePersistenceException;
+import net.sf.joafip.service.FilePersistenceInvalidClassException;
+import net.sf.joafip.service.FilePersistenceNotSerializableException;
+import net.sf.joafip.service.FilePersistenceTooBigForSerializationException;
+import net.sf.joafip.service.IDataAccessSession;
+import net.sf.joafip.store.service.StoreClassNotFoundException;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+public class AbstractSearcher extends AbstractPerfService {
+
+ private final JoafipLogger logger = JoafipLogger.getLogger(getClass());
+
+ public AbstractSearcher(final String pathName)
+ throws FilePersistenceException,
+ FilePersistenceInvalidClassException,
+ FilePersistenceNotSerializableException,
+ FilePersistenceClassNotFoundException,
+ FilePersistenceDataCorruptedException, StoreClassNotFoundException,
+ FilePersistenceTooBigForSerializationException {
+ super(pathName);
+ }
+
+ protected void run() throws FilePersistenceException,
+ FilePersistenceClassNotFoundException,
+ FilePersistenceInvalidClassException,
+ FilePersistenceDataCorruptedException,
+ FilePersistenceNotSerializableException, FileNotFoundException,
+ IOException, FilePersistenceTooBigForSerializationException {
+
+ long maxSearchTime = Long.MIN_VALUE;
+ long minSearchTime = Long.MAX_VALUE;
+ final long startTime = System.currentTimeMillis();
+ final IDataAccessSession session = filePersistence
+ .createDataAccessSession();
+ session.open();
+ initializeByItemDuration();
+ int missingCount = 0;
+ final List<Integer> missingList = new LinkedList<Integer>();
+ for (int identifier = 0; identifier < NUMBER_OF_ITEM; identifier++) {
+ final ItemList itemList = getItemList(session);
+ final long startSearchTime = System.currentTimeMillis();
+ if (itemList.get(identifier) == null) {
+ // throw new
+ // IllegalStateException("missing item for identifier "
+ // + identifier);
+ logger.info("missing item for identifier " + identifier);
+ missingCount++;
+ if (missingCount < 20) {
+ missingList.add(identifier);
+ }
+ }
+ final long currentTime = System.currentTimeMillis();
+ final long searchDuration = currentTime - startSearchTime;
+ if (searchDuration > maxSearchTime) {
+ maxSearchTime = searchDuration;
+ }
+ if (searchDuration < minSearchTime) {
+ minSearchTime = searchDuration;
+ }
+ if (identifier % BATCH_SIZE == BATCH_SIZE - 1) {
+ session.close(EnumFilePersistenceCloseAction.DO_NOT_SAVE);
+ session.open();
+ final long duration = (currentTime - startTime);
+ final long byItem = duration * 1000 / (identifier + 1);
+ byItemDuration[byItemIndex++] = (int) byItem;
+ logger.info(duration + " mS " + (identifier + 1)
+ + " found, by item " + byItem + " uS");
+ }
+ }
+ session.close(EnumFilePersistenceCloseAction.DO_NOT_SAVE);
+ final long endTime = System.currentTimeMillis();
+ logger.info("min search time " + minSearchTime);
+ logger.info("max search time " + maxSearchTime);
+ logger.info((endTime - startTime) + " mS for " + NUMBER_OF_ITEM
+ + " items");
+ logger.info("missing count=" + missingCount);
+ logger.info("missing list=" + missingList.toString());
+ final ObjectOutputStream objectOutputStream = new ObjectOutputStream(
+ new FileOutputStream(DURATION_BIN));
+ objectOutputStream.writeObject(byItemDuration);
+ objectOutputStream.close();
+ }
+}
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/Exporter.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/Exporter.java 2011-10-01 16:45:37 UTC (rev 2910)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/Exporter.java 2011-10-01 17:08:48 UTC (rev 2911)
@@ -64,12 +64,6 @@
FilePersistenceClassNotFoundException,
FilePersistenceDataCorruptedException,
FilePersistenceTooBigForSerializationException {
- // final FilePersistence filePersistence = new FilePersistence(1, null,
- // "runtime_perf",
- // /**/false/* do not remove files */,
- // /**/1024/* PAGE_SIZE */, 1024/* NUMBER_OF_PAGE */,
- // /**/false/* GARBAGE */,
- // /**/false/* CRASH_SAFE_MODE */);
final FilePersistenceBuilder builder = new FilePersistenceBuilder();
builder.setPathName("runtime_perf");
builder.setFileCache(/**/1024/* PAGE_SIZE */, 1024/* NUMBER_OF_PAGE */);
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/Garbage.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/Garbage.java 2011-10-01 16:45:37 UTC (rev 2910)
+++ trunk/jo...
[truncated message content] |
|
From: <luc...@us...> - 2011-10-03 03:24:48
|
Revision: 2915
http://joafip.svn.sourceforge.net/joafip/?rev=2915&view=rev
Author: luc_peuvrier
Date: 2011-10-03 03:24:41 +0000 (Mon, 03 Oct 2011)
Log Message:
-----------
after check for static field persistence
Modified Paths:
--------------
trunk/joafip/doc/_todo.txt
trunk/joafip/src/main/java/net/sf/joafip/reflect/HelperReflect.java
trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java
trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/StoreSynchro.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/FieldInfo.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/AbstractDelegatingToStoreManagers.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/AbstractExporter.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/PersistableWithStaticField.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestAutoSaveWithStatic.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectfortest/Bob1.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/manager/TestObjectIOManagerStaticFieldCase.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/serialize/ObjectIOStaticTest.java
trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/service/HeapFileDataManager.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2011-10-03 03:24:49
|
Revision: 2915
http://joafip.svn.sourceforge.net/joafip/?rev=2915&view=rev
Author: luc_peuvrier
Date: 2011-10-03 03:24:41 +0000 (Mon, 03 Oct 2011)
Log Message:
-----------
after check for static field persistence
Modified Paths:
--------------
trunk/joafip/doc/_todo.txt
trunk/joafip/src/main/java/net/sf/joafip/reflect/HelperReflect.java
trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java
trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/StoreSynchro.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/FieldInfo.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/AbstractDelegatingToStoreManagers.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/AbstractExporter.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/PersistableWithStaticField.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestAutoSaveWithStatic.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectfortest/Bob1.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/manager/TestObjectIOManagerStaticFieldCase.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/serialize/ObjectIOStaticTest.java
trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/service/HeapFileDataManager.java
Modified: trunk/joafip/doc/_todo.txt
===================================================================
--- trunk/joafip/doc/_todo.txt 2011-10-02 08:34:45 UTC (rev 2914)
+++ trunk/joafip/doc/_todo.txt 2011-10-03 03:24:41 UTC (rev 2915)
@@ -20,6 +20,7 @@
- java agent changed
- project divided on sub project
- export speed up
+- kept in memory for object referenced by static field
minor changes:
- added search last in red black tree manager
@@ -74,6 +75,8 @@
currently:
-------------------------------------------------------------------------------------
+export/import problem.
+
changes for garbage management because of autosave
- tests to add
- test for state machine
Modified: trunk/joafip/src/main/java/net/sf/joafip/reflect/HelperReflect.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/reflect/HelperReflect.java 2011-10-02 08:34:45 UTC (rev 2914)
+++ trunk/joafip/src/main/java/net/sf/joafip/reflect/HelperReflect.java 2011-10-03 03:24:41 UTC (rev 2915)
@@ -166,6 +166,9 @@
* static fields
*/
if (!Modifier.isFinal(modifiers)) {
+ /*
+ * only not final field can be acceded
+ */
staticFieldInfoList.add(fieldInfo);
}
} else {
@@ -280,6 +283,7 @@
if (fieldInfo.isFieldDefined()) {
field = fieldInfo.getField();
} else {
+ // FIXMELUC ________why this case field undefined
try {
final Class<?> clazz = fieldInfo.getDeclaringClass();
final String fieldName = fieldInfo.getFieldName();
Modified: trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java 2011-10-02 08:34:45 UTC (rev 2914)
+++ trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java 2011-10-03 03:24:41 UTC (rev 2915)
@@ -1188,6 +1188,26 @@
}
@Override
+ public void referencedByPesistedStaticField(
+ final Class<?> classHavingStaticFieldReferenced)
+ throws FilePersistenceException {
+ try {
+ store.referencedByPesistedStaticField(classHavingStaticFieldReferenced);
+ } catch (final StoreException exception) {
+ throw new FilePersistenceException(exception);
+ }
+ }
+
+ @Override
+ public void referencedByPesistedStaticField(
+ final Class<?>[] classHavingStaticFieldReferenced)
+ throws FilePersistenceException {
+ for (Class<?> clazz : classHavingStaticFieldReferenced) {
+ referencedByPesistedStaticField(clazz);
+ }
+ }
+
+ @Override
public String keyOfObjectKeptInMemory(final Object object) {
return store.keyOfObjectKeptInMemory(object);
}
Modified: trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java 2011-10-02 08:34:45 UTC (rev 2914)
+++ trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java 2011-10-03 03:24:41 UTC (rev 2915)
@@ -1204,6 +1204,16 @@
void keptInMemory(final String key, final Object object)
throws FilePersistenceException;
+ // FIXMELUC _______________javadoc
+ void referencedByPesistedStaticField(
+ Class<?> classHavingStaticFieldReferenced)
+ throws FilePersistenceException;
+
+ // FIXMELUC _______________javadoc
+ void referencedByPesistedStaticField(
+ Class<?>[] classHavingStaticFieldReferenced)
+ throws FilePersistenceException;
+
/**
*
* @param object
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/entity/StoreSynchro.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/StoreSynchro.java 2011-10-02 08:34:45 UTC (rev 2914)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/StoreSynchro.java 2011-10-03 03:24:41 UTC (rev 2915)
@@ -42,8 +42,6 @@
public StoreSynchro() { // NOPMD
super();
- // FIXMELUC _____________________for test
- Thread.dumpStack();
}
public void setPersistenceId(final int persistenceId) {
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/FieldInfo.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/FieldInfo.java 2011-10-02 08:34:45 UTC (rev 2914)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/FieldInfo.java 2011-10-03 03:24:41 UTC (rev 2915)
@@ -36,7 +36,7 @@
private static final String NOT_DEFINED = "not defined:\n";
- private static final DoPrivilegedSetFieldAccessible setFieldAccessible = // NOPMD
+ private static final DoPrivilegedSetFieldAccessible SET_FIELD_ACCESSIBLE =
/**/DoPrivilegedSetFieldAccessible.getInstance();
public static final FieldInfo NULL = new FieldInfo();
@@ -104,7 +104,7 @@
public FieldInfo(final Field field, final ClassInfo declaringClass,
final ClassInfo fieldType) throws ClassInfoException {
this.field = field;
- setFieldAccessible.set(field);
+ SET_FIELD_ACCESSIBLE.set(field);
this.fieldType = fieldType;
primitiveType = fieldType.isPrimitiveType();
basicType = fieldType.isBasicType();
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/AbstractDelegatingToStoreManagers.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/AbstractDelegatingToStoreManagers.java 2011-10-02 08:34:45 UTC (rev 2914)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/AbstractDelegatingToStoreManagers.java 2011-10-03 03:24:41 UTC (rev 2915)
@@ -36,6 +36,7 @@
import net.sf.joafip.store.entity.StoreHeader;
import net.sf.joafip.store.entity.StoreSynchro;
import net.sf.joafip.store.entity.classinfo.ClassInfo;
+import net.sf.joafip.store.entity.classinfo.FieldInfo;
import net.sf.joafip.store.entity.heaprecordable.IHeapRecordable;
import net.sf.joafip.store.entity.kept.KeptInMemoryObjectKey;
import net.sf.joafip.store.entity.kept.SubstituteOfEnum;
@@ -587,6 +588,7 @@
} catch (final ClassInfoException exception) {
throw new StoreException(exception);
}
+ // FIXMELUC _______________________not good classInfo.setKeptInMemory()
classInfo.setKeptInMemory();
setSubstituteObjectManager(objectClass, KeptInMemoryObjectKey.class,
keptInMemorySubstituteObjectManager);
@@ -594,6 +596,34 @@
}
@Override
+ public void referencedByPesistedStaticField(
+ final Class<?> classHavingStaticFieldReferenced)
+ throws StoreException {
+ ClassInfo classInfo;
+ try {
+ classInfo = classInfoFactory
+ .getNoProxyClassInfo(classHavingStaticFieldReferenced);
+ final FieldInfo[] fieldsInfo = classInfo
+ .getAllDeclaredStaticFields();
+ for (FieldInfo fieldInfo : fieldsInfo) {
+ final Object value = helperReflect.getFieldValue(null,
+ fieldInfo, true);
+ final StringBuilder keyBuilder = new StringBuilder();// NOPMD
+ keyBuilder.append(classInfo.getName());
+ keyBuilder.append('#');
+ keyBuilder.append(fieldInfo.getDeclaringClassInfo().getName());
+ keyBuilder.append('#');
+ keyBuilder.append(fieldInfo.getFieldName());
+ keptInMemory(keyBuilder.toString(), value);
+ }
+ } catch (final ClassInfoException exception) {
+ throw new StoreException(exception);
+ } catch (ReflectException exception) {
+ throw new StoreException(exception);
+ }
+ }
+
+ @Override
public void storedImmutableEnum(final Class<? extends Enum<?>> enumClass)
throws StoreException {
setSubstituteObjectManager(enumClass, SubstituteOfEnum.class,
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java 2011-10-02 08:34:45 UTC (rev 2914)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java 2011-10-03 03:24:41 UTC (rev 2915)
@@ -686,6 +686,9 @@
void keptInMemory(String key, Object object) throws StoreException;
+ void referencedByPesistedStaticField(
+ Class<?> classHavingStaticFieldReferenced) throws StoreException;
+
String keyOfObjectKeptInMemory(Object object);
void setRecordSaveActions(boolean recordActions);
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/AbstractExporter.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/AbstractExporter.java 2011-10-02 08:34:45 UTC (rev 2914)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/AbstractExporter.java 2011-10-03 03:24:41 UTC (rev 2915)
@@ -67,7 +67,7 @@
final protected JoafipLogger logger = JoafipLogger.getLogger(getClass());// NOPMD
- private final static DoPrivilegedSetFieldAccessible setFieldAccessible = // NOPMD
+ private final static DoPrivilegedSetFieldAccessible SET_FIELD_ACCESSIBLE =
/**/DoPrivilegedSetFieldAccessible.getInstance();
final private static HelperReflect helperReflect = HelperReflect// NOPMD
@@ -609,7 +609,7 @@
for (final FieldInfo fieldInfo : fieldInfos) {
if (fieldInfo.isPersisted()) {
final Field field = fieldInfo.getField();
- setFieldAccessible.set(field);
+ SET_FIELD_ACCESSIBLE.set(field);
final Object fieldValue;
fieldValue = field.get(null);
final ClassInfo fieldClassInfo = fieldInfo
@@ -667,7 +667,7 @@
for (final FieldInfo fieldInfo : fieldInfos) {
if (fieldInfo.isPersisted()) {
final Field field = fieldInfo.getField();
- setFieldAccessible.set(field);
+ SET_FIELD_ACCESSIBLE.set(field);
final Object fieldValue;
fieldValue = field.get(object);
final ClassInfo fieldClassInfo = fieldInfo
@@ -725,7 +725,7 @@
// <<<<<<< .working
if (fieldInfo.isPersisted()) {
final Field field = fieldInfo.getField();
- setFieldAccessible.set(field);
+ SET_FIELD_ACCESSIBLE.set(field);
final Object fieldValue;
fieldValue = field.get(object);
final ClassInfo fieldClassInfo = fieldInfo
@@ -1059,7 +1059,7 @@
// <<<<<<< .working
if (fieldInfo.isPersisted()) {
final Field field = fieldInfo.getField();
- setFieldAccessible.set(field);
+ SET_FIELD_ACCESSIBLE.set(field);
final Object fieldValue;
fieldValue = field.get(enumObject);
final ClassInfo fieldClassInfo = fieldInfo
@@ -1117,7 +1117,7 @@
for (final FieldInfo fieldInfo : fieldInfos) {
if (fieldInfo.isPersisted()) {
final Field field = fieldInfo.getField();
- setFieldAccessible.set(field);
+ SET_FIELD_ACCESSIBLE.set(field);
final Object fieldValue;
fieldValue = field.get(enumObject);
final ClassInfo fieldClassInfo = fieldInfo
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/rel400/PersistableWithStaticField.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/rel400/PersistableWithStaticField.java 2011-10-02 08:34:45 UTC (rev 2914)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/rel400/PersistableWithStaticField.java 2011-10-03 03:24:41 UTC (rev 2915)
@@ -25,6 +25,7 @@
import java.util.Map;
import net.sf.joafip.StorableClass;
+import net.sf.joafip.java.util.PTreeMap;
/**
*
@@ -44,6 +45,12 @@
map.put(EMPTY.getKey(), EMPTY);
}
+ private static final Map<String, String> MAP2 = new PTreeMap<String, String>();
+
+ static {
+ MAP2.put("1", "xxx");
+ }
+
private final String key;
public PersistableWithStaticField(final String key) {
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestAutoSaveWithStatic.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestAutoSaveWithStatic.java 2011-10-02 08:34:45 UTC (rev 2914)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestAutoSaveWithStatic.java 2011-10-03 03:24:41 UTC (rev 2915)
@@ -54,18 +54,51 @@
}
@SuppressWarnings("PMD")
- public void test() throws FilePersistenceException,
+ public void testReferencedStaticField() throws FilePersistenceException,
FilePersistenceInvalidClassException,
FilePersistenceNotSerializableException,
FilePersistenceClassNotFoundException,
FilePersistenceDataCorruptedException,
FilePersistenceTooBigForSerializationException {
- createFilePersistence();
+ createFilePersistenceForReferencedStaticField();
+ createFilePersistenceForReferencedStaticField();
+ }
+
+ private void createFilePersistenceForReferencedStaticField()
+ throws FilePersistenceException,
+ FilePersistenceInvalidClassException,
+ FilePersistenceNotSerializableException,
+ FilePersistenceClassNotFoundException,
+ FilePersistenceDataCorruptedException,
+ FilePersistenceTooBigForSerializationException {
+ final FilePersistenceBuilder builder = new FilePersistenceBuilder();
+ builder.setPathName(path.getAbsolutePath());
+ builder.setProxyMode(true);
+ builder.setRemoveFiles(true);
+ final IFilePersistence filePersistence = builder.build();
+ filePersistence
+ .referencedByPesistedStaticField(PersistableWithStaticField.class);
+ final IExclusiveDataAccessSession session = filePersistence
+ .createExclusiveDataAccessSession();
+ session.open();
+ session.close();
+ filePersistence.close();
+ }
+
+ @SuppressWarnings("PMD")
+ public void testStoredStatic() throws FilePersistenceException,
+ FilePersistenceInvalidClassException,
+ FilePersistenceNotSerializableException,
+ FilePersistenceClassNotFoundException,
+ FilePersistenceDataCorruptedException,
+ FilePersistenceTooBigForSerializationException {
+ createFilePersistenceForStoredStatic();
// second failed before correction
- createFilePersistence();
+ createFilePersistenceForStoredStatic();
}
- private void createFilePersistence() throws FilePersistenceException,
+ private void createFilePersistenceForStoredStatic()
+ throws FilePersistenceException,
FilePersistenceInvalidClassException,
FilePersistenceNotSerializableException,
FilePersistenceClassNotFoundException,
Modified: trunk/joafip/src/test/java/net/sf/joafip/store/service/objectfortest/Bob1.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/store/service/objectfortest/Bob1.java 2011-10-02 08:34:45 UTC (rev 2914)
+++ trunk/joafip/src/test/java/net/sf/joafip/store/service/objectfortest/Bob1.java 2011-10-03 03:24:41 UTC (rev 2915)
@@ -26,6 +26,10 @@
@StoreNotUseStandardSerialization
public class Bob1 implements IBob, Serializable {// NOPMD
+
+ @SuppressWarnings("unused")
+ private static long aStaticFinalLongField = -1L;// NOPMD
+
/**
*
*/
Modified: trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/manager/TestObjectIOManagerStaticFieldCase.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/manager/TestObjectIOManagerStaticFieldCase.java 2011-10-02 08:34:45 UTC (rev 2914)
+++ trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/manager/TestObjectIOManagerStaticFieldCase.java 2011-10-03 03:24:41 UTC (rev 2915)
@@ -80,11 +80,12 @@
writeResult);
assertReferenceChange(objectAndPersistInfo, new Class[] { null },
new Class[] { Integer.class }, writeResult);
- assertType(new int[] { HelperBinaryConversion.INTEGER_TYPE,
+ assertType(new int[] { HelperBinaryConversion.LONG_TYPE,
+ HelperBinaryConversion.INTEGER_TYPE,
HelperBinaryConversion.REFERENCE_TYPE }, writeResult);
assertWriteInformationCleared(objectAndPersistInfo);
- assertOriginalValue(new Object[] { Integer.valueOf(0), fieldValue },
- objectAndPersistInfo);
+ assertOriginalValue(new Object[] { Long.valueOf(-1),
+ Integer.valueOf(0), fieldValue }, objectAndPersistInfo);
/* second write state not change */
writeResult = write(objectAndPersistInfo);
@@ -95,8 +96,8 @@
writeResult);
assertNoReferenceChange(writeResult);
assertWriteInformationCleared(objectAndPersistInfo);
- assertOriginalValue(new Object[] { Integer.valueOf(0), fieldValue },
- objectAndPersistInfo);
+ assertOriginalValue(new Object[] { Long.valueOf(-1),
+ Integer.valueOf(0), fieldValue }, objectAndPersistInfo);
/* third write state change */
fieldValue = Integer.valueOf(1);
@@ -109,11 +110,12 @@
assertReferenceChange(objectAndPersistInfo,
new Class[] { Integer.class }, new Class[] { Integer.class },
writeResult);
- assertType(new int[] { HelperBinaryConversion.INTEGER_TYPE,
+ assertType(new int[] { HelperBinaryConversion.LONG_TYPE,
+ HelperBinaryConversion.INTEGER_TYPE,
HelperBinaryConversion.REFERENCE_TYPE }, writeResult);
assertWriteInformationCleared(objectAndPersistInfo);
- assertOriginalValue(new Object[] { Integer.valueOf(1), fieldValue },
- objectAndPersistInfo);
+ assertOriginalValue(new Object[] { Long.valueOf(-1),
+ Integer.valueOf(1), fieldValue }, objectAndPersistInfo);
/* fourth write state change */
Bob1.setObject(null);
@@ -124,11 +126,12 @@
assertReferenceChange(objectAndPersistInfo,
new Class[] { Integer.class }, new Class[] { null },
writeResult);
- assertType(new int[] { HelperBinaryConversion.INTEGER_TYPE,
+ assertType(new int[] { HelperBinaryConversion.LONG_TYPE,
+ HelperBinaryConversion.INTEGER_TYPE,
HelperBinaryConversion.REFERENCE_TYPE }, writeResult);
assertWriteInformationCleared(objectAndPersistInfo);
- assertOriginalValue(new Object[] { Integer.valueOf(1), null },
- objectAndPersistInfo);
+ assertOriginalValue(new Object[] { Long.valueOf(-1),
+ Integer.valueOf(1), null }, objectAndPersistInfo);
/* fifth write state change */
fieldValue = Integer.valueOf(3);
@@ -141,11 +144,12 @@
writeResult);
assertReferenceChange(objectAndPersistInfo, new Class[] { null },
new Class[] { Integer.class }, writeResult);
- assertType(new int[] { HelperBinaryConversion.INTEGER_TYPE,
+ assertType(new int[] { HelperBinaryConversion.LONG_TYPE,
+ HelperBinaryConversion.INTEGER_TYPE,
HelperBinaryConversion.REFERENCE_TYPE }, writeResult);
assertWriteInformationCleared(objectAndPersistInfo);
- assertOriginalValue(new Object[] { Integer.valueOf(2), fieldValue },
- objectAndPersistInfo);
+ assertOriginalValue(new Object[] { Long.valueOf(-1),
+ Integer.valueOf(2), fieldValue }, objectAndPersistInfo);
/**/
writeSon(writeResult);
Modified: trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/serialize/ObjectIOStaticTest.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/serialize/ObjectIOStaticTest.java 2011-10-02 08:34:45 UTC (rev 2914)
+++ trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/serialize/ObjectIOStaticTest.java 2011-10-03 03:24:41 UTC (rev 2915)
@@ -55,6 +55,7 @@
classInfoFactory, proxyManager2, helperBinaryConversion);
final ClassInfo classInfo = classInfoFactory
.getNoProxyClassInfo(Bob1.class);
+ // 10 as static field value to save
Bob1.setStaticValue(10);
final ObjectAndPersistInfo objectAndPersistInfo =
/**/new ObjectAndPersistInfo(classInfo);
@@ -69,7 +70,9 @@
*/, objectAndPersistInfo, false/* updateOriginalValue */);
final ObjectInputStatic objectInput = new ObjectInputStatic(this,
classInfoFactory, proxyManager2, helperBinaryConversion);
+ // change static field value to 0
Bob1.setStaticValue(0);
+ // read static field value and check it is 10
objectInput.setObjectStaticState(objectAndPersistInfo, binary, offset);
assertEquals("bad value", 10, Bob1.getStaticValue());
}
Modified: trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/service/HeapFileDataManager.java
===================================================================
--- trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/service/HeapFileDataManager.java 2011-10-02 08:34:45 UTC (rev 2914)
+++ trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/service/HeapFileDataManager.java 2011-10-03 03:24:41 UTC (rev 2915)
@@ -240,7 +240,7 @@
dataRecordIdentifier);
} else {
created = false;
- // FIXMELUC __________________data not change case
+ // FIXMELUC _____________data not change case
if (data.length != heapRecord.getDataAssociatedSize()) {
deleteDataRecord(dataRecordIdentifier);
heapRecord = createHeapRecordForData(data.length,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2011-10-11 04:30:12
|
Revision: 2916
http://joafip.svn.sourceforge.net/joafip/?rev=2916&view=rev
Author: luc_peuvrier
Date: 2011-10-11 04:30:04 +0000 (Tue, 11 Oct 2011)
Log Message:
-----------
direct field access checker WIP
Modified Paths:
--------------
trunk/joafip/doc/_todo.txt
trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java
trunk/joafip/src/main/java/net/sf/joafip/service/ClassLoaderProvider.java
trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfo.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfoAttributes.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/kept/KeptInMemoryObjectKey.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/kept/SubstituteOfEnum.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/ClassEnhancer.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/classinfo/ClassInfoFactory.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/classinfo/IClassInfoFactory.java
trunk/joafip/src/test/java/net/sf/joafip/entity/AbstractClassForExport.java
trunk/joafip/src/test/java/net/sf/joafip/entity/BobForExport.java
trunk/joafip/src/test/java/net/sf/joafip/entity/ClassForExport.java
trunk/joafip/src/test/java/net/sf/joafip/entity/rel310/ClassTwo301bReplacement.java
trunk/joafip/src/test/java/net/sf/joafip/export_import/AbstractClassOne301b.java
trunk/joafip/src/test/java/net/sf/joafip/export_import/Bob300.java
trunk/joafip/src/test/java/net/sf/joafip/export_import/ClassOne301b.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/StoreForTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/bug/ContrainteForTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionArrayListNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionHashMapNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionHashSetNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionHashSetNosubsWithG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionHashTableNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionLinkedHashSetNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionLinkedHashSetNosubsWithG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionLinkedListNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionTreeSetNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionTreeSetNosubsWithG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionTroveHashMapNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionVectorNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/copier/AbstractTestDeepCopier.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectfortest/AbstractBobSerialize.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectfortest/Bob1.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectfortest/Bob1Substitute.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectfortest/Bob2.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectfortest/Bob3.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectfortest/BobString.java
trunk/joafip/src/test/resources/log4j.properties
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/AbstractPLinkedTreeSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/AbstractPTreeSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PArrayList.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PHashMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PHashSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PLinkedHashMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PLinkedHashSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PLinkedList.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PTreeList.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PTreeMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PVector.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/arraylist/ArrayListSupport.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/hash/HashSupport.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/hash/HashSupportNodeSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/linked/hash/LinkedHashSupport.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/linked/tree/LinkedTreeSupport.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/linkedlist/LinkedListSupport.java
trunk/joafip-common/src/main/java/net/sf/joafip/logger/JoafipLogger.java
Added Paths:
-----------
trunk/joafip/doc/byte_code_control_flow.txt
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/DirectAccessInfo.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/EnumStackEltType.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/EnumType.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNode.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeAloadThis.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDup.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDup2.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDup2X1.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDup2X2.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDupX1.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDupX2.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeGet.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeLdc.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeMethod.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeMultiANewArray.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodePop.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodePop2.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodePut.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeSwap.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/StackElement.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/CheckMethodVisitor.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/ClassConstraintChecker.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/ICheckMethodListener.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/OpcodeInterpreter.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/RuntimeEnhanceException.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/CheckMethodListener.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/AbstractToCheckClass.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/ForTestCheckMethodVisitor.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/TestCheckMethodVisitor.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/ToCheckClass.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2011-10-11 04:30:14
|
Revision: 2916
http://joafip.svn.sourceforge.net/joafip/?rev=2916&view=rev
Author: luc_peuvrier
Date: 2011-10-11 04:30:04 +0000 (Tue, 11 Oct 2011)
Log Message:
-----------
direct field access checker WIP
Modified Paths:
--------------
trunk/joafip/doc/_todo.txt
trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java
trunk/joafip/src/main/java/net/sf/joafip/service/ClassLoaderProvider.java
trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfo.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfoAttributes.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/kept/KeptInMemoryObjectKey.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/kept/SubstituteOfEnum.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/ClassEnhancer.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/classinfo/ClassInfoFactory.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/classinfo/IClassInfoFactory.java
trunk/joafip/src/test/java/net/sf/joafip/entity/AbstractClassForExport.java
trunk/joafip/src/test/java/net/sf/joafip/entity/BobForExport.java
trunk/joafip/src/test/java/net/sf/joafip/entity/ClassForExport.java
trunk/joafip/src/test/java/net/sf/joafip/entity/rel310/ClassTwo301bReplacement.java
trunk/joafip/src/test/java/net/sf/joafip/export_import/AbstractClassOne301b.java
trunk/joafip/src/test/java/net/sf/joafip/export_import/Bob300.java
trunk/joafip/src/test/java/net/sf/joafip/export_import/ClassOne301b.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/StoreForTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/bug/ContrainteForTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionArrayListNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionHashMapNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionHashSetNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionHashSetNosubsWithG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionHashTableNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionLinkedHashSetNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionLinkedHashSetNosubsWithG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionLinkedListNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionTreeSetNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionTreeSetNosubsWithG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionTroveHashMapNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionVectorNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/copier/AbstractTestDeepCopier.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectfortest/AbstractBobSerialize.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectfortest/Bob1.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectfortest/Bob1Substitute.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectfortest/Bob2.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectfortest/Bob3.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectfortest/BobString.java
trunk/joafip/src/test/resources/log4j.properties
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/AbstractPLinkedTreeSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/AbstractPTreeSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PArrayList.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PHashMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PHashSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PLinkedHashMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PLinkedHashSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PLinkedList.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PTreeList.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PTreeMap.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PVector.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/arraylist/ArrayListSupport.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/hash/HashSupport.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/hash/HashSupportNodeSet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/linked/hash/LinkedHashSupport.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/linked/tree/LinkedTreeSupport.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/linkedlist/LinkedListSupport.java
trunk/joafip-common/src/main/java/net/sf/joafip/logger/JoafipLogger.java
Added Paths:
-----------
trunk/joafip/doc/byte_code_control_flow.txt
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/DirectAccessInfo.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/EnumStackEltType.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/EnumType.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNode.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeAloadThis.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDup.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDup2.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDup2X1.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDup2X2.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDupX1.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeDupX2.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeGet.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeLdc.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeMethod.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeMultiANewArray.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodePop.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodePop2.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodePut.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeSwap.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/StackElement.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/CheckMethodVisitor.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/ClassConstraintChecker.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/ICheckMethodListener.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/OpcodeInterpreter.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/RuntimeEnhanceException.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/CheckMethodListener.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/AbstractToCheckClass.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/ForTestCheckMethodVisitor.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/TestCheckMethodVisitor.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/ToCheckClass.java
Modified: trunk/joafip/doc/_todo.txt
===================================================================
--- trunk/joafip/doc/_todo.txt 2011-10-03 03:24:41 UTC (rev 2915)
+++ trunk/joafip/doc/_todo.txt 2011-10-11 04:30:04 UTC (rev 2916)
@@ -21,6 +21,7 @@
- project divided on sub project
- export speed up
- kept in memory for object referenced by static field
+- check field access constraints, direct field access disallow to force use of getter and/or setter
minor changes:
- added search last in red black tree manager
@@ -75,8 +76,32 @@
currently:
-------------------------------------------------------------------------------------
+persistence constraint check at enhancement for proxy creation
+==> update http://joafip.sourceforge.net/presentation/ppojo.html#prules
+- check done at enhancement -> exception
+- private are intercepted, correct the doc
+
+upgrade Maven plugins :
+maven-jar-plugin ..................................... 2.3.1 -> 2.3.2
+[INFO] maven-javadoc-plugin ..................................... 2.7 -> 2.8
+[INFO] maven-release-plugin ................................... 2.1 -> 2.2.1
+[INFO] org.codehaus.mojo:build-helper-maven-plugin .............. 1.5 -> 1.7
+[INFO] org.codehaus.mojo:buildnumber-maven-plugin ........ 1.0-beta-4 -> 1.0
+[INFO] org.codehaus.mojo:exec-maven-plugin .................... 1.2 -> 1.2.1
+
+
export/import problem.
+garbage management error with jhupedom
+
+keptinmemory problem
+
+static field persistence problem
+
+joafip reflect project (see setAccessible )
+- joafip
+- joafip-log4j
+
changes for garbage management because of autosave
- tests to add
- test for state machine
@@ -96,6 +121,7 @@
a java agent to change "new Xxx" to call to newInstance proxied object factory for auto save
+collection apache and google
-------------------------------------------------------------------------------------
copier:
- case of enum field
Added: trunk/joafip/doc/byte_code_control_flow.txt
===================================================================
--- trunk/joafip/doc/byte_code_control_flow.txt (rev 0)
+++ trunk/joafip/doc/byte_code_control_flow.txt 2011-10-11 04:30:04 UTC (rev 2916)
@@ -0,0 +1,109 @@
+Determining Basic Blocks
+We can use the following rules to determine the basic
+blocks, that is, by finding the set of leaders.
+
+- The first instruction of the method and each first
+instruction of every handler for the method are
+leaders.
+
+- Each instruction that is the target of an uncondi-
+tional branch (goto, goto_w, jsr, jsr_w, and ret)
+is a leader.
+
+- Each instruction that is the target of a condi-
+tional branch (ifeq, iflt, ifle, ifne, ifgt,
+ifge, ifnull, ifnonnull, if_icmpeq, if_icmpne,
+if_icmplt, if_icmpgt, if_icmple, if_icmpge,
+if_acmpeq, if_acmpne, lcmp, fcmpl, fcmpg,
+dcmpl, dcmpg) is a leader.
+
+- Each instruction that is one of the target of a
+compound conditional branch (tableswitch or
+lookupswitch) is a leader.
+
+- Each instruction that immediately follows a con-
+ditional or unconditional branch, or a <T>return
+(ireturn, lreturn, freturn, dreturn, areturn,
+and return), or a compound conditional branch
+instruction is a leader.
+
+- Now, each individual leader give rise to a basic block,
+consisting of all instructions up to the next leader or
+the end of the bytecode. Furthermore, we enclose each
+method invocation (invokevirtual, invokespecial,
+invokestatic, and invokeinterface) in a basic block
+of its own.
+
+
+ ----
+
+unconditional branch
+* goto
+* goto_w
+* jsr
+* jsr_w
+* ret end
+
+conditional branch
+* ifeq
+* iflt
+* ifle
+* ifne
+* ifgt,
+* ifge
+* ifnull
+* ifnonnull
+* if_icmpeq
+* if_icmpne
+* if_icmplt
+* if_icmpgt
+* if_icmple
+* if_icmpge
+* if_acmpeq
+* if_acmpne
+
+lcmp ? not a jump
+fcmpl ? not a jump
+fcmpg ? not a jump
+dcmpl ? not a jump
+dcmpg ? not a jump
+
+
+compound conditional branch
+* tableswitch end
+* lookupswitch end
+
+* ireturn end
+* lreturn end
+* freturn end
+* dreturn end
+* areturn end
+* return end
+* throw end ? missing
+
+Building the CFGs
+-----------------
+
+Once we divide instructions of a method into basic
+blocks, we can use the following rules to construct the
+CFG for the method. Let u 2 V and v 2 V be two basic
+blocks:
+
+An arc (u; v) is added to A if v follows u in the byte-
+code and u does not terminate in a unconditional
+branch.
+
+An arc (u; v) is added to A if the last instruction
+of u is a conditional or unconditional branch to the
+first instruction in v.
+
+An arc id added an arc (u; v) to A from the basic
+block of each tableswitch or lookupswitch to the
+basic block of each instruction that is defined as the
+target in the switch.
+
+For each subroutine call, two arcs are added to A:
+one from the basic block of the jsr or jsr_w to the
+basic block of target, and one from the basic block
+containing the corresponding ret to the basic block
+of the instruction that immediately follows the call.
Modified: trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java 2011-10-03 03:24:41 UTC (rev 2915)
+++ trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -16,6 +16,8 @@
*/
package net.sf.joafip.service;//NOPMD
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collection;
@@ -648,6 +650,22 @@
}
@Override
+ public void addNotCheckedMethod(final Method method) {
+ store.addNotCheckedMethod(method);
+ }
+
+ @Override
+ public void addNotCheckedMethod(final Constructor<?> constructor) {
+ store.addNotCheckedMethod(constructor);
+ }
+
+ @Override
+ public void addNotCheckedMethod(final String objectClassName,
+ final String absoluteMethodName) {
+ store.addNotCheckedMethod(objectClassName, absoluteMethodName);
+ }
+
+ @Override
public void setObjectIOForClass(final Class<?> objectClass,
final Class<? extends IObjectInput> objectInputClass,
final Class<? extends IObjectOutput> objectOutputClass)
Modified: trunk/joafip/src/main/java/net/sf/joafip/service/ClassLoaderProvider.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/service/ClassLoaderProvider.java 2011-10-03 03:24:41 UTC (rev 2915)
+++ trunk/joafip/src/main/java/net/sf/joafip/service/ClassLoaderProvider.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -23,6 +23,7 @@
package net.sf.joafip.service;
import java.io.File;
+import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.MalformedURLException;
@@ -95,6 +96,7 @@
if (toUseClassLoader == null || url == null) {
url = ClassLoader.getSystemResource(resourceName);
}
+
if (url == null) {
final URI uri = new File(resourceName).toURI();
url = uri.toURL();
@@ -102,6 +104,29 @@
return url;
}
+ public InputStream getResourceAsStream(final String resourceName) {
+ ClassLoader toUseClassLoader;
+ InputStream inputStream = null;
+ if (classLoader == null) {
+ toUseClassLoader = getCurrentThreadContextClassLoader();
+ if (toUseClassLoader != null) {
+ inputStream = toUseClassLoader
+ .getResourceAsStream(resourceName);
+ }
+ } else {
+ toUseClassLoader = classLoader;
+ inputStream = toUseClassLoader.getResourceAsStream(resourceName);
+ }
+ if (toUseClassLoader == null || inputStream == null) {
+ toUseClassLoader = ClassLoader.getSystemClassLoader();
+ inputStream = toUseClassLoader.getResourceAsStream(resourceName);
+ }
+ if (toUseClassLoader == null || inputStream == null) {
+ inputStream = toUseClassLoader.getResourceAsStream(resourceName);
+ }
+ return inputStream;
+ }
+
/**
* Get the Thread Context Loader which is a JDK 1.2 feature. If we are
* running under JDK 1.1 or anything else goes wrong the
Modified: trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java 2011-10-03 03:24:41 UTC (rev 2915)
+++ trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -16,6 +16,8 @@
*/
package net.sf.joafip.service;//NOPMD
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.Collection;
@@ -610,6 +612,12 @@
*/
void setForceEnhance(String[] objectClassNames);
+ void addNotCheckedMethod(Method method);
+
+ void addNotCheckedMethod(Constructor<?> constructor);
+
+ void addNotCheckedMethod(String objectClassName, String absoluteMethodName);
+
/**
* set object input output manager for a class<br>
* if class not accessible see {@link #setObjectIOForClass(String, Class)}<br>
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfo.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfo.java 2011-10-03 03:24:41 UTC (rev 2915)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfo.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -32,7 +32,9 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
+import java.util.Set;
import java.util.TreeMap;
+import java.util.TreeSet;
import net.sf.joafip.DeprecatedInStoreClass;
import net.sf.joafip.NotStorableClass;
@@ -271,6 +273,8 @@
private final Exception creationTrace = new Exception("creation trace");
+ private final Set<String> notCheckedMethodSet = new TreeSet<String>();
+
/**
*
* @param objectClass
@@ -932,6 +936,10 @@
forceEnhance = true;
}
+ public void addNotCheckedMethod(final String absoluteMethodName) {
+ notCheckedMethodSet.add(absoluteMethodName);
+ }
+
public void setSubstitute(final ClassInfo substituteClassInfo,
final ISubstituteObjectManager substituteObjectManager) {
substituted = true;
@@ -966,6 +974,10 @@
return forceEnhance;
}
+ public Set<String> getNotCheckedMethod() {
+ return notCheckedMethodSet;
+ }
+
public boolean isNotStorable() {
return notStorable;
}
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfoAttributes.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfoAttributes.java 2011-10-03 03:24:41 UTC (rev 2915)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfoAttributes.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -22,6 +22,9 @@
*/
package net.sf.joafip.store.entity.classinfo;
+import java.util.Set;
+import java.util.TreeSet;
+
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.store.service.objectio.manager.ISubsituteSynchronizer;
import net.sf.joafip.store.service.objectio.manager.ISubstituteObjectManager;
@@ -54,6 +57,8 @@
private boolean forceEnhance;
+ private final Set<String> notCheckedMethodSet = new TreeSet<String>();
+
private Class<?> substituteObjectClass;
private ISubstituteObjectManager substituteObjectManager;
@@ -136,10 +141,18 @@
forceEnhance = true;
}
+ public void addNotCheckedMethod(final String absoluteMethodName) {
+ notCheckedMethodSet.add(absoluteMethodName);
+ }
+
public boolean isForceEnhance() {
return forceEnhance;
}
+ public Set<String> getNotCheckedMethodSet() {
+ return notCheckedMethodSet;
+ }
+
public void setSubstituteObjectManager(
final Class<?> substituteObjectClass,
final ISubstituteObjectManager substituteObjectManager) {
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/entity/kept/KeptInMemoryObjectKey.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/kept/KeptInMemoryObjectKey.java 2011-10-03 03:24:41 UTC (rev 2915)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/kept/KeptInMemoryObjectKey.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -67,9 +67,9 @@
// return false;
final KeptInMemoryObjectKey other = (KeptInMemoryObjectKey) obj;
if (key == null) {
- if (other.key != null)
+ if (other.getKey() != null)
return false;
- } else if (!key.equals(other.key))
+ } else if (!key.equals(other.getKey()))
return false;
return true;
}
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/entity/kept/SubstituteOfEnum.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/kept/SubstituteOfEnum.java 2011-10-03 03:24:41 UTC (rev 2915)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/kept/SubstituteOfEnum.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -57,9 +57,9 @@
@Override
public int compareTo(final SubstituteOfEnum other) {
- int compareTo = enumClassName.compareTo(other.enumClassName);
+ int compareTo = enumClassName.compareTo(other.getEnumClassName());
if (compareTo == 0) {
- compareTo = enumName.compareTo(other.enumName);
+ compareTo = enumName.compareTo(other.getEnumName());
}
return compareTo;
}
Added: trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/DirectAccessInfo.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/DirectAccessInfo.java (rev 0)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/DirectAccessInfo.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -0,0 +1,90 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.store.entity.proxy;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+public class DirectAccessInfo implements Comparable<DirectAccessInfo> {
+
+ private final String methodAbsoluteName;
+
+ private final String labeledAddress;
+
+ private final int sourceLineNumber;
+
+ public DirectAccessInfo(final String methodAbsoluteName,
+ final String labeledAddress, final int sourceLineNumber) {
+ super();
+ this.methodAbsoluteName = methodAbsoluteName;
+ this.labeledAddress = labeledAddress;
+ this.sourceLineNumber = sourceLineNumber;
+ }
+
+ public String getMethodAbsoluteName() {
+ return methodAbsoluteName;
+ }
+
+ public String getLabeledAddress() {
+ return labeledAddress;
+ }
+
+ public int getSourceLineNumber() {
+ return sourceLineNumber;
+ }
+
+ @Override
+ public String toString() {
+ return "in \"" + methodAbsoluteName + "\" opcode at " + labeledAddress
+ + ", source line number " + sourceLineNumber;
+ }
+
+ @Override
+ public int compareTo(final DirectAccessInfo other) {
+ int compareTo = methodAbsoluteName.compareTo(other
+ .getMethodAbsoluteName());
+ if (compareTo == 0) {
+ compareTo = sourceLineNumber - other.getSourceLineNumber();
+ }
+ return compareTo;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime
+ * result
+ + ((methodAbsoluteName == null) ? 0 : methodAbsoluteName
+ .hashCode());
+ result = prime * result + sourceLineNumber;
+ return result;
+ }
+
+ @Override
+ public boolean equals(final Object obj) {
+ return compareTo((DirectAccessInfo) obj) == 0;
+ }
+}
Added: trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/EnumStackEltType.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/EnumStackEltType.java (rev 0)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/EnumStackEltType.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -0,0 +1,55 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.store.entity.proxy;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+public enum EnumStackEltType {
+ /** no type */
+ VOID(0),
+ /** reference on object or array */
+ REF(1),
+ /**/
+ INT_SHORT_CHAR_BYTE_BOOL(1),
+ /**/
+ LONG_L(2), LONG_H(2),
+ /**/
+ FLOAT(1),
+ /**/
+ DOUBLE_L(2), DOUBLE_H(2),
+ /**/
+ OPCODE_ADDRESS(0);
+
+ private final int category;
+
+ private EnumStackEltType(final int category) {
+ this.category = category;
+ }
+
+ public int getCategory() {
+ return category;
+ }
+}
Added: trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/EnumType.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/EnumType.java (rev 0)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/EnumType.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -0,0 +1,76 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.store.entity.proxy;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+public enum EnumType {
+ /** no type */
+ VOID(0, EnumStackEltType.VOID, null),
+ /** reference on object or array */
+ REF(1, EnumStackEltType.REF, null),
+ /**/
+ INT(1, EnumStackEltType.INT_SHORT_CHAR_BYTE_BOOL, null),
+ /**/
+ LONG(2, EnumStackEltType.LONG_L, EnumStackEltType.LONG_H),
+ /**/
+ FLOAT(1, EnumStackEltType.FLOAT, null),
+ /**/
+ DOUBLE(2, EnumStackEltType.DOUBLE_L, EnumStackEltType.DOUBLE_H),
+ /**/
+ SHORT(1, EnumStackEltType.INT_SHORT_CHAR_BYTE_BOOL, null),
+ /**/
+ CHAR(1, EnumStackEltType.INT_SHORT_CHAR_BYTE_BOOL, null),
+ /**/
+ BYTE_BOOL(1, EnumStackEltType.INT_SHORT_CHAR_BYTE_BOOL, null),
+ /**/
+ OPCODE_ADDRESS(0, EnumStackEltType.OPCODE_ADDRESS, null);
+
+ private final int category;
+
+ private final EnumStackEltType lowType;
+
+ private final EnumStackEltType highType;
+
+ private EnumType(final int category, final EnumStackEltType lowType,
+ final EnumStackEltType highType) {
+ this.category = category;
+ this.lowType = lowType;
+ this.highType = highType;
+ }
+
+ public int getCategory() {
+ return category;
+ }
+
+ public EnumStackEltType getLowType() {
+ return lowType;
+ }
+
+ public EnumStackEltType getHighType() {
+ return highType;
+ }
+}
Added: trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNode.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNode.java (rev 0)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNode.java 2011-10-11 04:30:04 UTC (rev 2916)
@@ -0,0 +1,177 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is dist...
[truncated message content] |
|
From: <luc...@us...> - 2011-10-12 03:04:28
|
Revision: 2917
http://joafip.svn.sourceforge.net/joafip/?rev=2917&view=rev
Author: luc_peuvrier
Date: 2011-10-12 03:04:21 +0000 (Wed, 12 Oct 2011)
Log Message:
-----------
direct field access checker WIP
Modified Paths:
--------------
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/EnumStackEltType.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/EnumType.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNode.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/CheckMethodVisitor.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/ClassConstraintChecker.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/OpcodeInterpreter.java
trunk/joafip/src/test/java/net/sf/joafip/entity/BobForExport.java
trunk/joafip/src/test/java/net/sf/joafip/entity/ClassForExport.java
trunk/joafip/src/test/java/net/sf/joafip/export_import/Container.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionTreeMapNosubsNoG.java
trunk/joafip/src/test/resources/log4j.properties
trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/store/service/bytecode/StoreServiceByteCodeTests.java
Added Paths:
-----------
trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/proxy/
trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/proxy/AbstractToCheckClass.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/proxy/ForTestCheckMethodVisitor.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/proxy/TestCheckMethodVisitor.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/proxy/ToCheckClass.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/store/service/bytecode/proxy/
trunk/joafip-testsuite/src/main/java/net/sf/joafip/store/service/bytecode/proxy/StoreServiceByteCodeProxyTests.java
Removed Paths:
-------------
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/AbstractToCheckClass.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/ForTestCheckMethodVisitor.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/TestCheckMethodVisitor.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/ToCheckClass.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2011-10-12 03:04:30
|
Revision: 2917
http://joafip.svn.sourceforge.net/joafip/?rev=2917&view=rev
Author: luc_peuvrier
Date: 2011-10-12 03:04:21 +0000 (Wed, 12 Oct 2011)
Log Message:
-----------
direct field access checker WIP
Modified Paths:
--------------
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/EnumStackEltType.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/EnumType.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNode.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/CheckMethodVisitor.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/ClassConstraintChecker.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/OpcodeInterpreter.java
trunk/joafip/src/test/java/net/sf/joafip/entity/BobForExport.java
trunk/joafip/src/test/java/net/sf/joafip/entity/ClassForExport.java
trunk/joafip/src/test/java/net/sf/joafip/export_import/Container.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionTreeMapNosubsNoG.java
trunk/joafip/src/test/resources/log4j.properties
trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/store/service/bytecode/StoreServiceByteCodeTests.java
Added Paths:
-----------
trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/proxy/
trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/proxy/AbstractToCheckClass.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/proxy/ForTestCheckMethodVisitor.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/proxy/TestCheckMethodVisitor.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/proxy/ToCheckClass.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/store/service/bytecode/proxy/
trunk/joafip-testsuite/src/main/java/net/sf/joafip/store/service/bytecode/proxy/StoreServiceByteCodeProxyTests.java
Removed Paths:
-------------
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/AbstractToCheckClass.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/ForTestCheckMethodVisitor.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/TestCheckMethodVisitor.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/ToCheckClass.java
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/EnumStackEltType.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/EnumStackEltType.java 2011-10-11 04:30:04 UTC (rev 2916)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/EnumStackEltType.java 2011-10-12 03:04:21 UTC (rev 2917)
@@ -28,8 +28,6 @@
*
*/
public enum EnumStackEltType {
- /** no type */
- VOID(0),
/** reference on object or array */
REF(1),
/**/
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/EnumType.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/EnumType.java 2011-10-11 04:30:04 UTC (rev 2916)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/EnumType.java 2011-10-12 03:04:21 UTC (rev 2917)
@@ -29,7 +29,7 @@
*/
public enum EnumType {
/** no type */
- VOID(0, EnumStackEltType.VOID, null),
+ VOID(0, null, null),
/** reference on object or array */
REF(1, EnumStackEltType.REF, null),
/**/
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNode.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNode.java 2011-10-11 04:30:04 UTC (rev 2916)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNode.java 2011-10-12 03:04:21 UTC (rev 2917)
@@ -94,7 +94,9 @@
public void setBeforeExecutionStackElement(
final StackElement beforeExecutionStackElement) {
- assert this.beforeExecutionStackElement == null;
+ assert this.beforeExecutionStackElement == null : "to set to\n"
+ + beforeExecutionStackElement + "\n and is\n"
+ + this.beforeExecutionStackElement;
this.beforeExecutionStackElement = beforeExecutionStackElement;
}
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/CheckMethodVisitor.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/CheckMethodVisitor.java 2011-10-11 04:30:04 UTC (rev 2916)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/CheckMethodVisitor.java 2011-10-12 03:04:21 UTC (rev 2917)
@@ -35,8 +35,8 @@
import net.sf.joafip.asm.Label;
import net.sf.joafip.asm.MethodVisitor;
import net.sf.joafip.asm.Opcodes;
+import net.sf.joafip.logger.JoafipLogger;
import net.sf.joafip.store.entity.proxy.DirectAccessInfo;
-import net.sf.joafip.store.entity.proxy.EnumStackEltType;
import net.sf.joafip.store.entity.proxy.OpcodeNode;
import net.sf.joafip.store.entity.proxy.OpcodeNodeAloadThis;
import net.sf.joafip.store.entity.proxy.OpcodeNodeDup;
@@ -64,6 +64,9 @@
@NotStorableClass
public class CheckMethodVisitor implements MethodVisitor, Opcodes {
+ private final static JoafipLogger LOGGER = JoafipLogger
+ .getLogger(CheckMethodVisitor.class);
+
private final ICheckMethodListener listener;
private transient OpcodeNode startOpcodeNode;
@@ -138,6 +141,9 @@
final String unassembled = listener.unassembled(methodAbsoluteName);
throw new RuntimeEnhanceException(new EnhanceException(
"checking:\n" + unassembled, exception));
+ } catch (Error error) {
+ LOGGER.error(listener.unassembled(methodAbsoluteName));
+ throw error;
} finally {
currentOpcodeNode = null;// NOPMD
opcodeByLabelMap = null;// NOPMD
@@ -153,8 +159,7 @@
final Deque<StackElement> stackElementQue = new LinkedList<StackElement>();
final Set<OpcodeNode> visited = new HashSet<OpcodeNode>();
OpcodeNode currentOpcodeNode = startOpcodeNode;
- StackElement stackElement = new StackElement(null,
- EnumStackEltType.VOID);
+ StackElement stackElement = null;
while (currentOpcodeNode != null) {
listener.currentOpcode(currentOpcodeNode);
currentOpcodeNode.setBeforeExecutionStackElement(stackElement);
@@ -169,9 +174,10 @@
stackElementQue.add(stackElement);
}
// FIXMELUC __________________________stack change
- // else if (stackElement != next
- // .getBeforeExecutionStackElement()) {
- // throw new EnhanceException("stack change");
+ // else if (stackElement !=
+ // next.getBeforeExecutionStackElement()) {
+ // throw new EnhanceException("stack change:\n" + stackElement
+ // + "\n" + next.getBeforeExecutionStackElement());
// }
}
currentOpcodeNode = toVisitQue.poll();
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/ClassConstraintChecker.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/ClassConstraintChecker.java 2011-10-11 04:30:04 UTC (rev 2916)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/ClassConstraintChecker.java 2011-10-12 03:04:21 UTC (rev 2917)
@@ -100,23 +100,23 @@
if (checkMethodListener.hasDirectAccess()) {
final StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("direct field access:\n");
- String previousMethodAbsoluteName = null;
+ // String previousMethodAbsoluteName = null;
for (DirectAccessInfo directAccessInfo : checkMethodListener
.getDirectAccessSet()) {
stringBuilder.append(directAccessInfo.toString());
stringBuilder.append('\n');
- if (previousMethodAbsoluteName != null
- && !previousMethodAbsoluteName.equals(directAccessInfo
- .getMethodAbsoluteName())) {
- stringBuilder.append(checkMethodListener
- .unassembled(directAccessInfo
- .getMethodAbsoluteName()));
- }
- previousMethodAbsoluteName = directAccessInfo
- .getMethodAbsoluteName();
+ // if (previousMethodAbsoluteName != null
+ // && !previousMethodAbsoluteName.equals(directAccessInfo
+ // .getMethodAbsoluteName())) {
+ // stringBuilder.append(checkMethodListener
+ // .unassembled(directAccessInfo
+ // .getMethodAbsoluteName()));
+ // }
+ // previousMethodAbsoluteName = directAccessInfo
+ // .getMethodAbsoluteName();
}
- stringBuilder.append(checkMethodListener
- .unassembled(previousMethodAbsoluteName));
+ // stringBuilder.append(checkMethodListener
+ // .unassembled(previousMethodAbsoluteName));
stringBuilder.append('\n');
throw new EnhanceException(stringBuilder.toString());
}
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/OpcodeInterpreter.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/OpcodeInterpreter.java 2011-10-11 04:30:04 UTC (rev 2916)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/OpcodeInterpreter.java 2011-10-12 03:04:21 UTC (rev 2917)
@@ -38,6 +38,8 @@
@NotStorableClass
public final class OpcodeInterpreter {
+ private static final String EMPTY_STACK = "empty stack";
+
private static class OpcodeDesc {
private static final EnumType[] EMPTY_POP_TYPES = new EnumType[] {};
@@ -632,16 +634,19 @@
public StackElement pop(final StackElement pointer, final EnumType type)
throws EnhanceException {
+ if (pointer == null) {
+ throw new EnhanceException(EMPTY_STACK);
+ }
EnumStackEltType stackEltType = pointer.getType();
if (!stackEltType.equals(type.getLowType())) {
throw new EnhanceException("type mismatch " + stackEltType
+ " in the stack for " + type.getLowType() + " expected");
}
StackElement newPointer = pointer.getPrevious();
- if (newPointer == null) {
- throw new EnhanceException("empty stack");
- }
if (type.getCategory() == 2) {
+ if (newPointer == null) {
+ throw new EnhanceException(EMPTY_STACK);
+ }
stackEltType = newPointer.getType();
if (!stackEltType.equals(type.getHighType())) {
throw new EnhanceException("type mismatch " + stackEltType
@@ -649,9 +654,6 @@
+ " expected");
}
newPointer = newPointer.getPrevious();
- if (newPointer == null) {
- throw new EnhanceException("empty stack");
- }
}
return newPointer;
}
@@ -735,11 +737,10 @@
private StackElement pop(final StackElement currentStackElement)
throws EnhanceException {
- final StackElement previous = currentStackElement.getPrevious();
- if (previous == null) {
- throw new EnhanceException("empty stack");
+ if (currentStackElement == null) {
+ throw new EnhanceException(EMPTY_STACK);
}
- return previous;
+ return currentStackElement.getPrevious();
}
public StackElement interpretePop2(final StackElement currentStackElement)
Modified: trunk/joafip/src/test/java/net/sf/joafip/entity/BobForExport.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/entity/BobForExport.java 2011-10-11 04:30:04 UTC (rev 2916)
+++ trunk/joafip/src/test/java/net/sf/joafip/entity/BobForExport.java 2011-10-12 03:04:21 UTC (rev 2917)
@@ -572,7 +572,9 @@
} else if (!objectList.equals(other.getObjectList())) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("objectList not equals\nthis:\n"
+ + objectList.getClass().getName() + "\n"
+ objectList.toString() + "\nother:\n"
+ + other.getObjectList().getClass().getName() + "\n"
+ other.getObjectList());
}
return false;
Modified: trunk/joafip/src/test/java/net/sf/joafip/entity/ClassForExport.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/entity/ClassForExport.java 2011-10-11 04:30:04 UTC (rev 2916)
+++ trunk/joafip/src/test/java/net/sf/joafip/entity/ClassForExport.java 2011-10-12 03:04:21 UTC (rev 2917)
@@ -97,12 +97,12 @@
if (field == null) {
if (other.getField() != null)
return false;
- } else if (!field.equals(other.getField()))
+ } else if (!field.equals(other.getField2()))
return false;
if (transientField == null) {
if (other.getTransientField() != null)
return false;
- } else if (!transientField.equals(other.getTransientField()))
+ } else if (!transientField.equals(other.getTransientField2()))
return false;
return true;
}
Modified: trunk/joafip/src/test/java/net/sf/joafip/export_import/Container.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/export_import/Container.java 2011-10-11 04:30:04 UTC (rev 2916)
+++ trunk/joafip/src/test/java/net/sf/joafip/export_import/Container.java 2011-10-12 03:04:21 UTC (rev 2917)
@@ -703,7 +703,7 @@
LOGGER.error("bad subTreeMap size");
stateOk = false;
}
- if (LOGGER.debugEnabled) {
+ if (LOGGER.isDebugEnabled()) {
final StringBuilder stringBuilder = new StringBuilder();
for (Map.Entry<String, String> entry : subTreeMap.entrySet()) {
stringBuilder.append(entry.getKey());
@@ -723,7 +723,7 @@
LOGGER.error("subTreeMapSetIterator must have next");
stateOk = false;
}
- if (LOGGER.debugEnabled) {
+ if (LOGGER.isDebugEnabled()) {
LOGGER.debug("subTreeMapValueIterator is "
+ subTreeMapValueIterator.getClass());
final Iterator<Entry<String, String>> iterator =
Copied: trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/proxy/AbstractToCheckClass.java (from rev 2916, trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/AbstractToCheckClass.java)
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/proxy/AbstractToCheckClass.java (rev 0)
+++ trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/proxy/AbstractToCheckClass.java 2011-10-12 03:04:21 UTC (rev 2917)
@@ -0,0 +1,137 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.store.service.bytecode.proxy;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+public class AbstractToCheckClass {
+
+ private Object object;
+
+ private boolean booleanValue;
+
+ private byte byteValue;
+
+ private char charValue;
+
+ private short shortValue;
+
+ private int intValue;
+
+ private long longValue;
+
+ private float floatValue;
+
+ private double doubleValue;
+
+ public AbstractToCheckClass() {
+ super();
+ }
+
+ public AbstractToCheckClass(final Object object, final boolean booleanValue) {
+ super();
+ this.object = object;
+ this.booleanValue = booleanValue;
+ }
+
+ public AbstractToCheckClass(final Object object, final byte byteValue) {
+ super();
+ this.object = object;
+ this.byteValue = byteValue;
+ }
+
+ public AbstractToCheckClass(final Object object, final char charValue) {
+ super();
+ this.object = object;
+ this.charValue = charValue;
+ }
+
+ public AbstractToCheckClass(final Object object, final short shortValue) {
+ super();
+ this.object = object;
+ this.shortValue = shortValue;
+ }
+
+ public AbstractToCheckClass(final Object object, final int intValue) {
+ super();
+ this.object = object;
+ this.intValue = intValue;
+ }
+
+ public AbstractToCheckClass(final Object object, final long longValue) {
+ super();
+ this.object = object;
+ this.longValue = longValue;
+ }
+
+ public AbstractToCheckClass(final Object object, final float floatValue) {
+ super();
+ this.object = object;
+ this.floatValue = floatValue;
+ }
+
+ public AbstractToCheckClass(final Object object, final double doubleValue) {
+ super();
+ this.object = object;
+ this.doubleValue = doubleValue;
+ }
+
+ public Object getObject() {
+ return object;
+ }
+
+ public boolean isBooleanValue() {
+ return booleanValue;
+ }
+
+ public byte getByteValue() {
+ return byteValue;
+ }
+
+ public char getCharValue() {
+ return charValue;
+ }
+
+ public short getShortValue() {
+ return shortValue;
+ }
+
+ public int getIntValue() {
+ return intValue;
+ }
+
+ public long getLongValue() {
+ return longValue;
+ }
+
+ public float getFloatValue() {
+ return floatValue;
+ }
+
+ public double getDoubleValue() {
+ return doubleValue;
+ }
+}
Copied: trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/proxy/ForTestCheckMethodVisitor.java (from rev 2916, trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/ForTestCheckMethodVisitor.java)
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/proxy/ForTestCheckMethodVisitor.java (rev 0)
+++ trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/proxy/ForTestCheckMethodVisitor.java 2011-10-12 03:04:21 UTC (rev 2917)
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.store.service.bytecode.proxy;
+
+import net.sf.joafip.store.service.bytecode.proxy.CheckMethodVisitor;
+import net.sf.joafip.store.service.bytecode.proxy.ICheckMethodListener;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+public class ForTestCheckMethodVisitor extends CheckMethodVisitor {
+
+ public ForTestCheckMethodVisitor(final ICheckMethodListener listener,
+ final String aboluteMethodName) {
+ super(listener, aboluteMethodName);
+ }
+}
Copied: trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/proxy/TestCheckMethodVisitor.java (from rev 2916, trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/TestCheckMethodVisitor.java)
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/proxy/TestCheckMethodVisitor.java (rev 0)
+++ trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/proxy/TestCheckMethodVisitor.java 2011-10-12 03:04:21 UTC (rev 2917)
@@ -0,0 +1,308 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.store.service.bytecode.proxy;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+
+import net.sf.joafip.AbstractJoafipTestCase;
+import net.sf.joafip.TestException;
+import net.sf.joafip.asm.AnnotationVisitor;
+import net.sf.joafip.asm.Attribute;
+import net.sf.joafip.asm.ClassReader;
+import net.sf.joafip.asm.ClassVisitor;
+import net.sf.joafip.asm.FieldVisitor;
+import net.sf.joafip.asm.MethodVisitor;
+import net.sf.joafip.asm.Type;
+import net.sf.joafip.store.entity.proxy.DirectAccessInfo;
+import net.sf.joafip.store.service.bytecode.EnhanceException;
+import net.sf.joafip.store.service.proxy.CheckMethodListener;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+public class TestCheckMethodVisitor extends AbstractJoafipTestCase implements
+ ClassVisitor {
+
+ private transient String className;
+
+ private transient CheckMethodListener checkMethodListener;
+
+ private transient String methodName;
+
+ private transient String methodDescriptor;
+
+ public TestCheckMethodVisitor() throws TestException {
+ super();
+ }
+
+ public TestCheckMethodVisitor(final String name) throws TestException {
+ super(name);
+ }
+
+ @Override
+ protected void setUp() throws Exception { // NOPMD
+ checkMethodListener = new CheckMethodListener();
+ super.setUp();
+ }
+
+ @Override
+ protected void tearDown() throws Exception { // NOPMD
+ className = null;// NOPMD
+ checkMethodListener = null;// NOPMD
+ methodName = null;// NOPMD
+ methodDescriptor = null;// NOPMD
+ super.tearDown();
+ }
+
+ public void testDefaultConstructor() throws NoSuchMethodException,
+ IOException, EnhanceException {
+ check(null, new Class[] {});
+ assertFalse("default constructor must be ok\n" + directAccess(),
+ checkMethodListener.hasDirectAccess());
+ }
+
+ public void testBooleanConstructor() throws NoSuchMethodException,
+ IOException, EnhanceException {
+ check(null, new Class[] { boolean.class });
+ assertFalse("constructor(boolean) must be ok\n" + directAccess(),
+ checkMethodListener.hasDirectAccess());
+ }
+
+ public void testByteConstructor() throws NoSuchMethodException,
+ IOException, EnhanceException {
+ check(null, new Class[] { byte.class });
+ assertFalse("constructor(byte) must be ok\n" + directAccess(),
+ checkMethodListener.hasDirectAccess());
+ }
+
+ public void testCharConstructor() throws NoSuchMethodException,
+ IOException, EnhanceException {
+ check(null, new Class[] { char.class });
+ assertFalse("constructor(char) must be ok\n" + directAccess(),
+ checkMethodListener.hasDirectAccess());
+ }
+
+ public void testShortConstructor() throws NoSuchMethodException,
+ IOException, EnhanceException {
+ check(null, new Class[] { short.class });
+ assertFalse("constructor(short) must be ok\n" + directAccess(),
+ checkMethodListener.hasDirectAccess());
+ }
+
+ public void testIntConstructor() throws NoSuchMethodException, IOException,
+ EnhanceException {
+ check(null, new Class[] { int.class });
+ assertFalse("constructor(int) must be ok\n" + directAccess(),
+ checkMethodListener.hasDirectAccess());
+ }
+
+ public void testLongConstructor() throws NoSuchMethodException,
+ IOException, EnhanceException {
+ check(null, new Class[] { long.class });
+ assertFalse("constructor(long) must be ok\n" + directAccess(),
+ checkMethodListener.hasDirectAccess());
+ }
+
+ public void testFloatConstructor() throws NoSuchMethodException,
+ IOException, EnhanceException {
+ check(null, new Class[] { float.class });
+ assertFalse("constructor(float) must be ok\n" + directAccess(),
+ checkMethodListener.hasDirectAccess());
+ }
+
+ public void testDoubleConstructor() throws NoSuchMethodException,
+ IOException, EnhanceException {
+ check(null, new Class[] { double.class });
+ assertFalse("constructor(double) must be ok\n" + directAccess(),
+ checkMethodListener.hasDirectAccess());
+ }
+
+ public void testGetGlobalCount() throws IOException, EnhanceException,
+ SecurityException, NoSuchMethodException {
+ check("getGlobalCount", new Class[] {});
+ assertFalse("getGlobalCount() must be ok\n" + directAccess(),
+ checkMethodListener.hasDirectAccess());
+ }
+
+ public void testSetGlobalCount() throws IOException, EnhanceException,
+ SecurityException, NoSuchMethodException {
+ check("setGlobalCount", new Class[] { int.class });
+ assertFalse("setGlobalCount(int) must be ok\n" + directAccess(),
+ checkMethodListener.hasDirectAccess());
+ }
+
+ public void testGetaStaticCount() throws IOException, EnhanceException,
+ SecurityException, NoSuchMethodException {
+ check("getaStaticCount", new Class[] {});
+ assertFalse("getaStaticCount() must be ok\n" + directAccess(),
+ checkMethodListener.hasDirectAccess());
+ }
+
+ public void testSetaStaticCount() throws IOException, EnhanceException,
+ SecurityException, NoSuchMethodException {
+ check("setaStaticCount", new Class[] { int.class });
+ assertFalse("setaStaticCount(int) must be ok\n" + directAccess(),
+ checkMethodListener.hasDirectAccess());
+ }
+
+ public void testWhileOkMethod() throws IOException, EnhanceException,
+ SecurityException, NoSuchMethodException {
+ check("whileOkMethod", new Class[] {});
+ assertFalse("whileOkMethod() must be ok\n" + directAccess(),
+ checkMethodListener.hasDirectAccess());
+ }
+
+ public void testWhileMethod() throws NoSuchMethodException, IOException,
+ EnhanceException {
+ check("whileMethod", new Class[] { Class.class });
+ assertFalse("whileOkMethod() must be ok\n" + directAccess(),
+ checkMethodListener.hasDirectAccess());
+ }
+
+ private String directAccess() {
+ final StringBuilder stringBuilder = new StringBuilder();
+ for (DirectAccessInfo directAccessInfo : checkMethodListener
+ .getDirectAccessSet()) {
+ stringBuilder.append(directAccessInfo.toString());
+ stringBuilder.append('\n');
+ stringBuilder.append(checkMethodListener
+ .unassembled(directAccessInfo.getMethodAbsoluteName()));
+ stringBuilder.append('\n');
+ }
+ return stringBuilder.toString();
+ }
+
+ private void check(final String name, final Class<?>[] parameterTypes)
+ throws NoSuchMethodException, IOException, EnhanceException {
+ if (name == null) {
+ setConstructorTotest(parameterTypes);
+ } else {
+ setMethodTotest(name, parameterTypes);
+ }
+ final InputStream inputStream = ClassLoader
+ .getSystemResourceAsStream("net/sf/joafip/store/service/bytecode/proxy/ToCheckClass.class");
+ final ByteArrayOutputStream byteOutputStream = new ByteArrayOutputStream();
+ int byteValue;
+ while ((byteValue = inputStream.read()) != -1) {// NOPMD
+ byteOutputStream.write(byteValue);
+ }
+ byteOutputStream.close();
+ inputStream.close();
+ final byte[] originalCode = byteOutputStream.toByteArray();
+ final int off = 0;
+ final int len = originalCode.length;
+ final ClassReader classreader = new ClassReader(originalCode, off, len);
+ try {
+ classreader.accept(this, ClassReader.SKIP_FRAMES);
+ } catch (RuntimeEnhanceException exception) {
+ throw (EnhanceException) exception.getCause();
+ }
+ if (logger.debugEnabled) {
+ logger.debug(checkMethodListener.unassembled());
+ }
+ }
+
+ private void setMethodTotest(final String methodName,
+ final Class<?>[] parameterTypes) throws NoSuchMethodException {
+ this.methodName = methodName;
+ final Method method = ToCheckClass.class.getDeclaredMethod(methodName,
+ parameterTypes);
+ methodDescriptor = Type.getMethodDescriptor(method);
+ }
+
+ private void setConstructorTotest(final Class<?>[] parameterTypes)
+ throws NoSuchMethodException {
+ methodName = "<init>";
+ final Constructor<ToCheckClass> constructor = ToCheckClass.class
+ .getConstructor(parameterTypes);
+ methodDescriptor = Type.getConstructorDescriptor(constructor);
+
+ }
+
+ @Override
+ public void visit(final int version, final int access, final String name,
+ final String signature, final String superName,
+ final String[] interfaces) {
+ this.className = name;
+ }
+
+ @Override
+ public MethodVisitor visitMethod(final int access, final String name,
+ final String desc, final String signature, final String[] exceptions) {
+ final ForTestCheckMethodVisitor methodVisitor;
+ if (name.equals(methodName) && desc.equals(methodDescriptor)) {
+ methodVisitor = new ForTestCheckMethodVisitor(checkMethodListener,
+ className + "#" + name + desc);
+ } else {
+ methodVisitor = null;
+ }
+ return methodVisitor;
+ }
+
+ @Override
+ public void visitSource(final String source, final String debug) {
+ // no implementation
+ }
+
+ @Override
+ public void visitOuterClass(final String owner, final String name,
+ final String desc) {
+ // no implementation
+ }
+
+ @Override
+ public AnnotationVisitor visitAnnotation(final String desc,
+ final boolean visible) {
+ // no implementation
+ return null;
+ }
+
+ @Override
+ public void visitAttribute(final Attribute attr) {
+ // no implementation
+ }
+
+ @Override
+ public void visitInnerClass(final String name, final String outerName,
+ final String innerName, final int access) {
+ // no implementation
+ }
+
+ @Override
+ public FieldVisitor visitField(final int access, final String name,
+ final String desc, final String signature, final Object value) {
+ // no implementation
+ return null;
+ }
+
+ @Override
+ public void v...
[truncated message content] |
|
From: <luc...@us...> - 2011-10-14 08:55:48
|
Revision: 2920
http://joafip.svn.sourceforge.net/joafip/?rev=2920&view=rev
Author: luc_peuvrier
Date: 2011-10-14 08:55:42 +0000 (Fri, 14 Oct 2011)
Log Message:
-----------
tests jhupedom ok
Modified Paths:
--------------
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/CheckMethodVisitor.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/HashMapEntryComparator.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2011-10-14 08:55:48
|
Revision: 2920
http://joafip.svn.sourceforge.net/joafip/?rev=2920&view=rev
Author: luc_peuvrier
Date: 2011-10-14 08:55:42 +0000 (Fri, 14 Oct 2011)
Log Message:
-----------
tests jhupedom ok
Modified Paths:
--------------
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/CheckMethodVisitor.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/HashMapEntryComparator.java
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/CheckMethodVisitor.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/CheckMethodVisitor.java 2011-10-14 06:01:04 UTC (rev 2919)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/CheckMethodVisitor.java 2011-10-14 08:55:42 UTC (rev 2920)
@@ -127,8 +127,6 @@
}
}
- // FIXMELUC _______________________________cas du jsr/ret
-
final List<OpcodeNode> nextOpcodeNodeList = startOpcodeNode
.getNextOpcodeNodeList();
for (OpcodeNode opcodeNode : nextOpcodeNodeList) {
Modified: trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/HashMapEntryComparator.java
===================================================================
--- trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/HashMapEntryComparator.java 2011-10-14 06:01:04 UTC (rev 2919)
+++ trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/HashMapEntryComparator.java 2011-10-14 08:55:42 UTC (rev 2920)
@@ -49,7 +49,7 @@
// keyComparator = null;
// }
- private HashMapEntryComparator(final IEqualsHashComparator keyComparator) {
+ protected HashMapEntryComparator(final IEqualsHashComparator keyComparator) {
super();
this.keyComparator = keyComparator;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2011-10-16 04:45:37
|
Revision: 2921
http://joafip.svn.sourceforge.net/joafip/?rev=2921&view=rev
Author: luc_peuvrier
Date: 2011-10-16 04:45:29 +0000 (Sun, 16 Oct 2011)
Log Message:
-----------
auto save done when create new instance
Modified Paths:
--------------
trunk/joafip/doc/_todo.txt
trunk/joafip/src/main/java/net/sf/joafip/reflect/HelperReflect.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/objectio/ObjectAndPersistInfo.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/objectio/ObjectStateMap.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/AbstractDelegatingToStoreManagers.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/EnhanceCodeGenerator.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/ExportStoreQue.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/DetachedProxyCallBack.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/IProxyCallBackProxyDelegation.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/IProxyCallBackToImplement.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/NullProxyCallBack.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/ProxyCallBack.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/ProxyManager2.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/StaticProxyCallBack.java
trunk/joafip/src/test/java/net/sf/joafip/entity/rel400/BobASDelegatingListenDelegate.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestTreeListIteratorIntercept.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestAutoSave.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/ProxyCallBackForTest.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PMapKeyNavigableSet.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/service/rel400/ServiceRel400Tests.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/store/service/proxy/ProxyTests.java
Added Paths:
-----------
trunk/joafip/src/test/java/net/sf/joafip/entity/rel400/KeyDef.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestConstructEntrySetIteratorOfPMapKeyNavigableSet.java
trunk/joafip/src/test/java/net/sf/joafip/store/entity/proxy/BobCallInConstructor.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/TestProxyCreationConstructed.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2011-10-16 04:45:37
|
Revision: 2921
http://joafip.svn.sourceforge.net/joafip/?rev=2921&view=rev
Author: luc_peuvrier
Date: 2011-10-16 04:45:29 +0000 (Sun, 16 Oct 2011)
Log Message:
-----------
auto save done when create new instance
Modified Paths:
--------------
trunk/joafip/doc/_todo.txt
trunk/joafip/src/main/java/net/sf/joafip/reflect/HelperReflect.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/objectio/ObjectAndPersistInfo.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/objectio/ObjectStateMap.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/AbstractDelegatingToStoreManagers.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/EnhanceCodeGenerator.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/ExportStoreQue.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/DetachedProxyCallBack.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/IProxyCallBackProxyDelegation.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/IProxyCallBackToImplement.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/NullProxyCallBack.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/ProxyCallBack.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/ProxyManager2.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/StaticProxyCallBack.java
trunk/joafip/src/test/java/net/sf/joafip/entity/rel400/BobASDelegatingListenDelegate.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestTreeListIteratorIntercept.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestAutoSave.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/ProxyCallBackForTest.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PMapKeyNavigableSet.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/service/rel400/ServiceRel400Tests.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/store/service/proxy/ProxyTests.java
Added Paths:
-----------
trunk/joafip/src/test/java/net/sf/joafip/entity/rel400/KeyDef.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestConstructEntrySetIteratorOfPMapKeyNavigableSet.java
trunk/joafip/src/test/java/net/sf/joafip/store/entity/proxy/BobCallInConstructor.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/TestProxyCreationConstructed.java
Modified: trunk/joafip/doc/_todo.txt
===================================================================
--- trunk/joafip/doc/_todo.txt 2011-10-14 08:55:42 UTC (rev 2920)
+++ trunk/joafip/doc/_todo.txt 2011-10-16 04:45:29 UTC (rev 2921)
@@ -22,6 +22,7 @@
- export speed up
- kept in memory for object referenced by static field
- check field access constraints, direct field access disallow to force use of getter and/or setter
+- static field persistence feature removed because a non sense
minor changes:
- added search last in red black tree manager
@@ -94,10 +95,8 @@
garbage management error with jhupedom
-keptinmemory problem
+kept in memory problem
-static field persistence problem
-
joafip reflect project (see setAccessible )
- joafip
- joafip-log4j
Modified: trunk/joafip/src/main/java/net/sf/joafip/reflect/HelperReflect.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/reflect/HelperReflect.java 2011-10-14 08:55:42 UTC (rev 2920)
+++ trunk/joafip/src/main/java/net/sf/joafip/reflect/HelperReflect.java 2011-10-16 04:45:29 UTC (rev 2921)
@@ -573,6 +573,12 @@
}
stringBuilder.append('\n');
}
+ final Constructor<?>[] constructors = objectClass
+ .getDeclaredConstructors();
+ stringBuilder.append("constructors:\n");
+ for (Constructor<?> constructor : constructors) {
+ stringBuilder.append(constructor.toString());
+ }
return new ReflectException(stringBuilder.toString(), exception);
}
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/entity/objectio/ObjectAndPersistInfo.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/objectio/ObjectAndPersistInfo.java 2011-10-14 08:55:42 UTC (rev 2920)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/objectio/ObjectAndPersistInfo.java 2011-10-16 04:45:29 UTC (rev 2921)
@@ -460,6 +460,7 @@
public void clearSubstitution() {
if (substitutionOfObject != null) {
substitutionOfObject.substituteObjectAndPersistInfo = null;// NOPMD
+ substitutionOfObject = null;// NOPMD
}
}
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/entity/objectio/ObjectStateMap.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/objectio/ObjectStateMap.java 2011-10-14 08:55:42 UTC (rev 2920)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/objectio/ObjectStateMap.java 2011-10-16 04:45:29 UTC (rev 2921)
@@ -425,7 +425,7 @@
queueSize = 0;
queueNumberOfWeakRef = 0;
}
- // FIXMELUC ____________________static persistence information live
+ // FIXMELUC _________________static persistence information live
// with file persistence
staticStateMap.clear();
// checkNullFieldError();
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/AbstractDelegatingToStoreManagers.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/AbstractDelegatingToStoreManagers.java 2011-10-14 08:55:42 UTC (rev 2920)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/AbstractDelegatingToStoreManagers.java 2011-10-16 04:45:29 UTC (rev 2921)
@@ -588,7 +588,7 @@
} catch (final ClassInfoException exception) {
throw new StoreException(exception);
}
- // FIXMELUC _______________________not good classInfo.setKeptInMemory()
+ // FIXMELUC ___________________not good classInfo.setKeptInMemory()
classInfo.setKeptInMemory();
setSubstituteObjectManager(objectClass, KeptInMemoryObjectKey.class,
keptInMemorySubstituteObjectManager);
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/EnhanceCodeGenerator.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/EnhanceCodeGenerator.java 2011-10-14 08:55:42 UTC (rev 2920)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/EnhanceCodeGenerator.java 2011-10-16 04:45:29 UTC (rev 2921)
@@ -85,6 +85,11 @@
private String forceLoadMethodDesc;
+ private static final String SET_IN_CONSTRUCTION_METHOD_NAME =
+ /**/"setInConstruction$JOAFIP$";
+
+ private String setInConstructionMethodDesc;
+
private static final String[] FORCE_LOAD_EXCEPTION = new String[] {
/**/Type.getInternalName(ObjectIOException.class),
/**/Type.getInternalName(ObjectIODataRecordNotFoundException.class),
@@ -189,6 +194,11 @@
forceLoadMethodDesc = Type.getMethodDescriptor(method);
method = IProxyCallBack.class.getMethod(
+ /**/SET_IN_CONSTRUCTION_METHOD_NAME,
+ /**/new Class[] { boolean.class });
+ setInConstructionMethodDesc = Type.getMethodDescriptor(method);
+
+ method = IProxyCallBack.class.getMethod(
/**/UNLOAD_METHOD_NAME,
/**/NO_PARAMETERS);
unloadMethodDesc = Type.getMethodDescriptor(method);
@@ -456,6 +466,33 @@
methodVisitor.visitEnd();
/*
+ * setInConstruction
+ */
+
+ methodVisitor = classWriter.visitMethod(
+ /**/ACC_PUBLIC,
+ /**/SET_IN_CONSTRUCTION_METHOD_NAME,
+ /**/setInConstructionMethodDesc,
+ /**/null,
+ /**/null);
+ methodVisitor.visitCode();
+ methodVisitor.visitVarInsn(ALOAD, 0);
+ methodVisitor.visitFieldInsn(
+ /**/GETFIELD,
+ /**/classInternalName,
+ /**/PROXY_CALL_BACK_FIELD_NAME, I_PROXY_CALL_BACK_DELEGATION_DESC);
+ methodVisitor.visitVarInsn(ILOAD, 1);
+ methodVisitor.visitMethodInsn(
+ /**/INVOKEINTERFACE,
+ /**/I_PROXY_CALL_BACK_INTERFACE,
+ /**/SET_IN_CONSTRUCTION_METHOD_NAME,
+ /**/setInConstructionMethodDesc);
+ methodVisitor.visitInsn(RETURN);
+ // FIXMELUC _visitmaxs call needed ?
+ methodVisitor.visitMaxs(0, 0);
+ methodVisitor.visitEnd();
+
+ /*
* unload
*/
methodVisitor = classWriter.visitMethod(
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/ExportStoreQue.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/ExportStoreQue.java 2011-10-14 08:55:42 UTC (rev 2920)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/ExportStoreQue.java 2011-10-16 04:45:29 UTC (rev 2921)
@@ -80,12 +80,6 @@
heapDataManagerForSet.stopService();
}
- // FIXMELUC ___________________no more needed because of auto save
- // public void save() throws HeapException {
- // heapDataManagerForQue.flush();
- // heapDataManagerForSet.flush();
- // }
-
public DataRecordIdentifier pollFirst() throws HeapException {
return heapDataManagerForQue.removeFirstDataRecord();
}
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/DetachedProxyCallBack.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/DetachedProxyCallBack.java 2011-10-14 08:55:42 UTC (rev 2920)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/DetachedProxyCallBack.java 2011-10-16 04:45:29 UTC (rev 2921)
@@ -121,4 +121,10 @@
public IObjectIOManagerForProxyObjectIO getObjectIOManager$JOAFIP$() {
throw new UnsupportedOperationException();
}
+
+ @SuppressWarnings("PMD")
+ @Override
+ public void setInConstruction$JOAFIP$(final boolean inConstruction) {
+ throw new UnsupportedOperationException();
+ }
}
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/IProxyCallBackProxyDelegation.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/IProxyCallBackProxyDelegation.java 2011-10-14 08:55:42 UTC (rev 2920)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/IProxyCallBackProxyDelegation.java 2011-10-16 04:45:29 UTC (rev 2921)
@@ -110,4 +110,7 @@
@SuppressWarnings("PMD")
ObjectAndPersistInfo getInstance$JOAFIP$();
+
+ @SuppressWarnings("PMD")
+ void setInConstruction$JOAFIP$(boolean inConstruction);
}
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/IProxyCallBackToImplement.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/IProxyCallBackToImplement.java 2011-10-14 08:55:42 UTC (rev 2920)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/IProxyCallBackToImplement.java 2011-10-16 04:45:29 UTC (rev 2921)
@@ -66,4 +66,7 @@
@Fortest
@SuppressWarnings("PMD")
int getInObjectCount$JOAFIP$();
+
+ @SuppressWarnings("PMD")
+ boolean isAutoSaveEnabled$JOAFIP$();
}
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/NullProxyCallBack.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/NullProxyCallBack.java 2011-10-14 08:55:42 UTC (rev 2920)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/NullProxyCallBack.java 2011-10-16 04:45:29 UTC (rev 2921)
@@ -179,4 +179,16 @@
public int getInObjectCount$JOAFIP$() {
throw new UnsupportedOperationException();
}
+
+ @Override
+ @SuppressWarnings("PMD")
+ public boolean isAutoSaveEnabled$JOAFIP$() {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ @SuppressWarnings("PMD")
+ public void setInConstruction$JOAFIP$(final boolean inConstruction) {
+ throw new UnsupportedOperationException();
+ }
}
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/ProxyCallBack.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/ProxyCallBack.java 2011-10-14 08:55:42 UTC (rev 2920)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/ProxyCallBack.java 2011-10-16 04:45:29 UTC (rev 2921)
@@ -88,6 +88,8 @@
private final boolean autoSaveEnabled;
+ private boolean inConstruction;
+
public static void setUseJavaAgent(final boolean useJavaAgent) {
ProxyCallBack.useJavaAgent = useJavaAgent;
}
@@ -206,6 +208,7 @@
}
if (!loaded
+ && !inConstruction
&& !FINALIZER_THREAD_NAME.equals(Thread.currentThread()
.getName())) {
/*
@@ -277,7 +280,7 @@
ObjectIOClassNotFoundException, ObjectIODataCorruptedException,
ObjectIONotSerializableException {
synchronized (storeMutex) {
- if (!loading) {
+ if (!loading && !inConstruction) {
loading = true;
if (!loaded) {
load();
@@ -296,7 +299,7 @@
/*
* inObjectCount==0 because can not unload object when running its code
*/
- if (loaded) {
+ if (loaded && !inConstruction) {
if (!loading && inObjectCount == 0) {
loaded = false;
objectIOManager.unsetProxyObjectState(getInstance$JOAFIP$());
@@ -376,6 +379,18 @@
}
@Override
+ @SuppressWarnings("PMD")
+ public void setInConstruction$JOAFIP$(final boolean inConstruction) {
+ this.inConstruction = inConstruction;
+ }
+
+ @Override
+ @SuppressWarnings("PMD")
+ public boolean isAutoSaveEnabled$JOAFIP$() {
+ return autoSaveEnabled;
+ }
+
+ @Override
public String toString() {
return super.toString() + ", for " + getInstance$JOAFIP$().toString();
}
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/ProxyManager2.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/ProxyManager2.java 2011-10-14 08:55:42 UTC (rev 2920)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/ProxyManager2.java 2011-10-16 04:45:29 UTC (rev 2921)
@@ -290,9 +290,12 @@
if (constructed) {
assert getProxyCallBack(instanceCreated) != NULL_PROXY_CALL_BACK_INSTANCE;
+ setNotInConstruction(instanceCreated);
+ // set is loaded last for auto save
objectAndPersistInfo.setIsLoaded();
}
} else {
+ // FIXMELUC ___________one method for objectAndPersistInfo action
// created by save
assert constructed;
objectAndPersistInfo.unWeakReferenceOnObject();
@@ -304,6 +307,9 @@
* objectAndPersistInfo.setIsLoaded() should be good to, may be
* better
*/
+ // objectAndPersistInfo.getProxyCallBackOfObject().setInConstruction$JOAFIP$(false);
+ setNotInConstruction(instanceCreated);
+ // set is loaded last for auto save
setIsLoaded(instanceCreated);
}
return objectAndPersistInfo;
@@ -394,6 +400,15 @@
}
}
+ private void setNotInConstruction(final Object object) {
+ if (useJavaAgent) {
+ StaticProxyCallBack.setInConstruction(object, false);
+ } else if (isProxy(object)) {
+ ((IProxyCallBackProxyDelegation) object)
+ .setInConstruction$JOAFIP$(false);
+ }
+ }
+
public static void setIsLoadedNoSave(final Object object)
throws ProxyException {
try {
@@ -546,6 +561,15 @@
+ object.getClass().getName()
+ "@"
+ System.identityHashCode(object);
+ // FIXMELUC _______________________old proxy call back
+ // FIXMELUC _______________________only for autosave
+ // if(proxyCallBack.isAutoSaveEnabled$JOAFIP$())
+ final IProxyCallBackToImplement oldProxyCallBack = proxy
+ .getProxyCallBack$JOAFIP$();
+ if (oldProxyCallBack == NULL_PROXY_CALL_BACK_INSTANCE) {// NOPMD
+ // in construction
+ proxyCallBack.setInConstruction$JOAFIP$(true);
+ }
proxy.setProxyCallBack$JOAFIP$(proxyCallBack);
}
proxyCallBack.setInstance$JOAFIP$(objectAndPersistInfo);
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/StaticProxyCallBack.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/StaticProxyCallBack.java 2011-10-14 08:55:42 UTC (rev 2920)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/StaticProxyCallBack.java 2011-10-16 04:45:29 UTC (rev 2921)
@@ -141,6 +141,17 @@
}
}
+ public static void setInConstruction(final Object object,
+ final boolean inConstruction) {
+ final IProxyCallBackProxyDelegation proxyCallBack;
+ synchronized (StaticProxyCallBack.class) {
+ proxyCallBack = proxyCallBackOfObject(object);
+ }
+ if (proxyCallBack != null) {
+ proxyCallBack.setInConstruction$JOAFIP$(inConstruction);
+ }
+ }
+
public static void setIsLoadedNoSave(final Object object)
throws ObjectIOException {
final IProxyCallBackProxyDelegation proxyCallBack;
Modified: trunk/joafip/src/test/java/net/sf/joafip/entity/rel400/BobASDelegatingListenDelegate.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/entity/rel400/BobASDelegatingListenDelegate.java 2011-10-14 08:55:42 UTC (rev 2920)
+++ trunk/joafip/src/test/java/net/sf/joafip/entity/rel400/BobASDelegatingListenDelegate.java 2011-10-16 04:45:29 UTC (rev 2921)
@@ -44,6 +44,7 @@
if (delegate == null) {
throw new IllegalStateException("delegate must not be null");
}
+ initialize();// NOPMD
}
public static BobASDelegatingListenDelegate newInstance(
@@ -60,6 +61,10 @@
return newInstance;
}
+ public void initialize() {
+ // no implementation
+ }
+
public void action() {
// delegate action job
delegate.action();
Added: trunk/joafip/src/test/java/net/sf/joafip/entity/rel400/KeyDef.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/entity/rel400/KeyDef.java (rev 0)
+++ trunk/joafip/src/test/java/net/sf/joafip/entity/rel400/KeyDef.java 2011-10-16 04:45:29 UTC (rev 2921)
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.entity.rel400;
+
+import net.sf.joafip.StorableClass;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@StorableClass
+public class KeyDef {
+
+ private final String name;
+
+ public KeyDef(final String name) {
+ super();
+ this.name = name;
+ }
+
+ public String getName() {
+ return name;
+ }
+}
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/TestTreeListIteratorIntercept.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/TestTreeListIteratorIntercept.java 2011-10-14 08:55:42 UTC (rev 2920)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestTreeListIteratorIntercept.java 2011-10-16 04:45:29 UTC (rev 2921)
@@ -138,4 +138,15 @@
final ObjectAndPersistInfo objectAndPersistInfo) {
// no implementation
}
+
+ @Override
+ public boolean isAutoSaveEnabled$JOAFIP$() {// NOPMD
+ // no implementation
+ return false;
+ }
+
+ @Override
+ public void setInConstruction$JOAFIP$(final boolean inConstruction) {// NOPMD
+ // no implementation
+ }
}
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestAutoSave.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestAutoSave.java 2011-10-14 08:55:42 UTC (rev 2920)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestAutoSave.java 2011-10-16 04:45:29 UTC (rev 2921)
@@ -20,8 +20,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-package net.sf.joafip.service.rel400;
+package net.sf.joafip.service.rel400;//NOPMD
+import java.util.Iterator;
+import java.util.Map.Entry;
+
import net.sf.joafip.AbstractDeleteFileTestCase;
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.StorableAccess;
@@ -30,6 +33,8 @@
import net.sf.joafip.entity.rel400.BobASDelegatingListenDelegate;
import net.sf.joafip.entity.rel400.BobASWithTransientCaller;
import net.sf.joafip.entity.rel400.BobForAutoSaveTest;
+import net.sf.joafip.entity.rel400.KeyDef;
+import net.sf.joafip.java.util.PTreeMap;
import net.sf.joafip.service.FilePersistence;
import net.sf.joafip.service.FilePersistenceBuilder;
import net.sf.joafip.service.FilePersistenceClassNotFoundException;
@@ -41,6 +46,7 @@
import net.sf.joafip.service.IAutoSaveEventListener;
import net.sf.joafip.service.IExclusiveDataAccessSession;
import net.sf.joafip.store.entity.objectio.ObjectAndPersistInfo;
+import net.sf.joafip.store.entity.proxy.BobCallInConstructor;
import net.sf.joafip.store.service.objectfortest.Bob1;
import net.sf.joafip.store.service.objectfortest.Bob2;
import net.sf.joafip.store.service.objectio.ObjectIOException;
@@ -411,6 +417,49 @@
session.close();
}
+ public void testCallInConstructor() throws FilePersistenceException,
+ FilePersistenceClassNotFoundException,
+ FilePersistenceInvalidClassException,
+ FilePersistenceDataCorruptedException,
+ FilePersistenceNotSerializableException,
+ FilePersistenceTooBigForSerializationException {
+ final IInstanceFactory instanceFactory = session.getInstanceFactory();
+ session.open();
+ final Class<?> objectClass = BobCallInConstructor.class;
+ saveDoneFlag = false;
+ instanceFactory.newInstance(objectClass,
+ new Class<?>[] { String.class }, new Object[] { "a name" });
+ assertTrue(MUST_SAVE, saveDoneFlag);
+ session.close();
+ }
+
+ private static final KeyDef KEY_DEF_1 = new KeyDef("key1");
+
+ private static final KeyDef KEY_DEF_2 = new KeyDef("key2");
+
+ @SuppressWarnings("unchecked")
+ public void testRefToStatic() throws FilePersistenceException,
+ FilePersistenceClassNotFoundException,
+ FilePersistenceInvalidClassException,
+ FilePersistenceDataCorruptedException,
+ FilePersistenceNotSerializableException {
+ final IInstanceFactory instanceFactory = session.getInstanceFactory();
+ session.open();
+ final PTreeMap<String, KeyDef> map = (PTreeMap<String, KeyDef>) instanceFactory
+ .newInstance(PTreeMap.class);
+ map.put(KEY_DEF_1.getName(), KEY_DEF_1);
+ map.put(KEY_DEF_2.getName(), KEY_DEF_2);
+ final Iterator<Entry<String, KeyDef>> iterator = map.entrySet()
+ .iterator();
+ assertTrue("must has next", iterator.hasNext());
+ Entry<String, KeyDef> next = iterator.next();
+ assertEquals("bad key", KEY_DEF_1.getName(), next.getKey());
+ assertTrue("must has next", iterator.hasNext());
+ next = iterator.next();
+ assertEquals("bad key", KEY_DEF_2.getName(), next.getKey());
+ assertFalse("must not has next", iterator.hasNext());
+ }
+
@Override
public boolean doSave() {
return true;
Added: trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestConstructEntrySetIteratorOfPMapKeyNavigableSet.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestConstructEntrySetIteratorOfPMapKeyNavigableSet.java (rev 0)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestConstructEntrySetIteratorOfPMapKeyNavigableSet.java 2011-10-16 04:45:29 UTC (rev 2921)
@@ -0,0 +1,81 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.service.rel400;
+
+import java.util.Iterator;
+import java.util.NavigableMap;
+
+import net.sf.joafip.AbstractJoafipCommonTestCase;
+import net.sf.joafip.TestException;
+import net.sf.joafip.java.util.PMapKeyNavigableSet;
+import net.sf.joafip.java.util.PTreeMap;
+import net.sf.joafip.reflect.HelperReflect;
+import net.sf.joafip.reflect.ReflectException;
+import net.sf.joafip.service.FilePersistenceRuntimeException;
+import net.sf.joafip.store.service.proxy.IInstanceFactory;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+public class TestConstructEntrySetIteratorOfPMapKeyNavigableSet extends
+ AbstractJoafipCommonTestCase implements IInstanceFactory {
+
+ public TestConstructEntrySetIteratorOfPMapKeyNavigableSet()
+ throws TestException {
+ super();
+ }
+
+ public TestConstructEntrySetIteratorOfPMapKeyNavigableSet(final String name)
+ throws TestException {
+ super(name);
+ }
+
+ @SuppressWarnings("unchecked")
+ public void test() { // NOPMD
+ final NavigableMap<String, String> navigableMap = new PTreeMap<String, String>();
+ final PMapKeyNavigableSet<String, String> map = PMapKeyNavigableSet
+ .newInstance(this, navigableMap);
+ final Iterator<String> iterator = map.iterator();
+ assertFalse("must be empty", iterator.hasNext());
+ final Iterator<String> descendingIterator = map.descendingIterator();
+ assertFalse("must be empty", descendingIterator.hasNext());
+ }
+
+ @Override
+ public Object newInstance(final Class<?> objectClass,
+ final Class<?>[] parameterTypes, final Object[] initargs) {
+ try {
+ return HelperReflect.getInstance().newInstanceConstruct(
+ objectClass, parameterTypes, initargs);
+ } catch (ReflectException exception) {
+ throw new FilePersistenceRuntimeException(exception);
+ }
+ }
+
+ @Override
+ public Object newInstance(final Class<?> objectClass) {
+ throw new UnsupportedOperationException("should not be used");
+ }
+}
Added: trunk/joafip/src/test/java/net/sf/joafip/store/entity/proxy/BobCallInConstructor.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/store/entity/proxy/BobCallInConstructor.java (rev 0)
+++ trunk/joafip/src/test/java/net/sf/joafip/store/entity/proxy/BobCallInConstructor.java 2011-10-16 04:45:29 UTC (rev 2921)
@@ -0,0 +1,61 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.store.entity.proxy;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+public class BobCallInConstructor {
+
+ private String name;
+
+ private int age;
+
+ public BobCallInConstructor(final String name, final int age) {
+ super();
+ setName(name);// NOPMD
+ setAge(age);// NOPMD
+ }
+
+ public BobCallInConstructor(final String name) {
+ this(name, -1);
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(final int age) {
+ this.age = age;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(final String name) {
+ this.name = name;
+ }
+}
Modified: trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/ProxyCallBackForTest.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/ProxyCallBackForTest.java 2011-10-14 08:55:42 UTC (rev 2920)
+++ trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/ProxyCallBackForTest.java 2011-10-16 04:45:29 UTC (rev 2921)
@@ -292,4 +292,17 @@
throws ObjectIOException {
// no implementation
}
+
+ @SuppressWarnings("PMD")
+ @Override
+ public boolean isAutoSaveEnabled$JOAFIP$() {
+ // no implementation
+ return false;
+ }
+
+ @SuppressWarnings("PMD")
+ @Override
+ public void setInConstruction$JOAFIP$(final boolean inConstruction) {
+ // no implementation
+ }
}
Added: trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/TestProxyCreationConstructed.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/TestProxyCreationConstructed.java (rev 0)
+++ trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/TestProxyCreationConstructed.java 2011-10-16 04:45:29 UTC (rev 2921)
@@ -0,0 +1,101 @@
+/*
+ * Copyright 2011 Luc Peuvrier
...
[truncated message content] |
|
From: <luc...@us...> - 2011-10-16 08:35:34
|
Revision: 2922
http://joafip.svn.sourceforge.net/joafip/?rev=2922&view=rev
Author: luc_peuvrier
Date: 2011-10-16 08:35:26 +0000 (Sun, 16 Oct 2011)
Log Message:
-----------
no more static field persistence
Modified Paths:
--------------
trunk/joafip/src/main/java/net/sf/joafip/entity/FilePersistenceProperties.java
trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java
trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistence.java
trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistencePropertiesReader.java
trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/objectio/ObjectAndPersistInfo.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/objectio/ObjectStateMap.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/saver/StoreSaverSession.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/conversion/AbstractObjectReplacer.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/conversion/ObjectReplacerForImport.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/conversion/ObjectReplacerOnTheFly.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/in/AbstractImporter.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/in/InObjectsHandler.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/AbstractExporter.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/StoreAccessForExport.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/manager/AbstractObjectIOManagerDelegatingToStateMap.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/manager/AbstractObjectIOManagerIOForObject.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/manager/HeaderReader.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/manager/HeaderWriter.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/manager/IObjectIOManagerForProxyObjectIO.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/manager/ObjectIOManager.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/manager/ObjectStateMgr.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/manager/SerializerObjectIOManager.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/serialize/input/AbstractObjectInputGeneric.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/saver/StoreSaver3.java
trunk/joafip/src/test/java/net/sf/joafip/entity/AbstractClassForExport.java
trunk/joafip/src/test/java/net/sf/joafip/entity/ClassForExport.java
trunk/joafip/src/test/java/net/sf/joafip/entity/rel310/ClassTwo301bReplacement.java
trunk/joafip/src/test/java/net/sf/joafip/export_import/AbstractClassOne301b.java
trunk/joafip/src/test/java/net/sf/joafip/export_import/ClassOne301b.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestExportImport.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel310/Abstract301Usage.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/StoreForTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/copier/AbstractTestDeepCopier.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectfortest/Bob1.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/manager/AbstractTestIoManager.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/serialize/AbstractObjectIOTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/AbstractObjectIoManagerForProxyTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/ProxyCallBackForTest.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/service/rel301/ServiceRel301Tests.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/service/rel400/ServiceRel400Tests.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/store/service/objectio/manager/ObjectIOManagerTests.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/store/service/objectio/serialize/ObjectIOSerializeTests.java
Removed Paths:
-------------
trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/serialize/input/ObjectInputStatic.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/serialize/output/ObjectOutputStatic.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel301/TestStaticPersisted.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestAutoSaveWithStatic.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/manager/TestObjectIOManagerStaticFieldCase.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/serialize/ObjectIOStaticTest.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2011-10-16 08:35:36
|
Revision: 2922
http://joafip.svn.sourceforge.net/joafip/?rev=2922&view=rev
Author: luc_peuvrier
Date: 2011-10-16 08:35:26 +0000 (Sun, 16 Oct 2011)
Log Message:
-----------
no more static field persistence
Modified Paths:
--------------
trunk/joafip/src/main/java/net/sf/joafip/entity/FilePersistenceProperties.java
trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java
trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistence.java
trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistencePropertiesReader.java
trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/objectio/ObjectAndPersistInfo.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/objectio/ObjectStateMap.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/saver/StoreSaverSession.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/conversion/AbstractObjectReplacer.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/conversion/ObjectReplacerForImport.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/conversion/ObjectReplacerOnTheFly.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/in/AbstractImporter.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/in/InObjectsHandler.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/AbstractExporter.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/out/StoreAccessForExport.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/manager/AbstractObjectIOManagerDelegatingToStateMap.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/manager/AbstractObjectIOManagerIOForObject.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/manager/HeaderReader.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/manager/HeaderWriter.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/manager/IObjectIOManagerForProxyObjectIO.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/manager/ObjectIOManager.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/manager/ObjectStateMgr.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/manager/SerializerObjectIOManager.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/serialize/input/AbstractObjectInputGeneric.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/saver/StoreSaver3.java
trunk/joafip/src/test/java/net/sf/joafip/entity/AbstractClassForExport.java
trunk/joafip/src/test/java/net/sf/joafip/entity/ClassForExport.java
trunk/joafip/src/test/java/net/sf/joafip/entity/rel310/ClassTwo301bReplacement.java
trunk/joafip/src/test/java/net/sf/joafip/export_import/AbstractClassOne301b.java
trunk/joafip/src/test/java/net/sf/joafip/export_import/ClassOne301b.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestExportImport.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel310/Abstract301Usage.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/StoreForTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/copier/AbstractTestDeepCopier.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectfortest/Bob1.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/manager/AbstractTestIoManager.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/serialize/AbstractObjectIOTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/AbstractObjectIoManagerForProxyTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/ProxyCallBackForTest.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/service/rel301/ServiceRel301Tests.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/service/rel400/ServiceRel400Tests.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/store/service/objectio/manager/ObjectIOManagerTests.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/store/service/objectio/serialize/ObjectIOSerializeTests.java
Removed Paths:
-------------
trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/serialize/input/ObjectInputStatic.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/serialize/output/ObjectOutputStatic.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel301/TestStaticPersisted.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestAutoSaveWithStatic.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/manager/TestObjectIOManagerStaticFieldCase.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/serialize/ObjectIOStaticTest.java
Modified: trunk/joafip/src/main/java/net/sf/joafip/entity/FilePersistenceProperties.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/entity/FilePersistenceProperties.java 2011-10-16 04:45:29 UTC (rev 2921)
+++ trunk/joafip/src/main/java/net/sf/joafip/entity/FilePersistenceProperties.java 2011-10-16 08:35:26 UTC (rev 2922)
@@ -17,7 +17,6 @@
package net.sf.joafip.entity;// NOPMD
import java.io.InputStream;
-import java.util.Map;
import java.util.NavigableMap;
import java.util.Set;
import java.util.TreeMap;
@@ -76,9 +75,6 @@
private boolean recordSaveActions;
- private final Map<String, Boolean> storedStaticMap =
- /**/new TreeMap<String, Boolean>();
-
private EnumNoMoreDataAction noMoreDataAction = EnumNoMoreDataAction.DELETE_FILE;
public FilePersistenceProperties() {
@@ -336,10 +332,6 @@
return storeProperties.isUseCacheMode();
}
- public Map<String, Boolean> getStoredStaticMap() {
- return storedStaticMap;
- }
-
public void setMaintenedInMemory(final boolean maintenedInMemory) {
storeProperties.setMaintenedInMemory(maintenedInMemory);
}
Modified: trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java 2011-10-16 04:45:29 UTC (rev 2921)
+++ trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java 2011-10-16 08:35:26 UTC (rev 2922)
@@ -736,29 +736,6 @@
storedMutableEnum((Class<? extends Enum<?>>) enumObject.getClass());
}
- @Override
- public void storedStaticField(
- final Class<?>[] classHavingStaticFieldToPersistList)
- throws FilePersistenceException {
- try {
- for (final Class<?> classHavingStaticFieldToPersist : classHavingStaticFieldToPersistList) {
- store.storedStaticField(classHavingStaticFieldToPersist);
- }
- } catch (final StoreException exception) {
- throw new FilePersistenceException(exception);
- }
- }
-
- @Override
- public void storedStaticField(final Class<?> classHavingStaticFieldToPersist)
- throws FilePersistenceException {
- try {
- store.storedStaticField(classHavingStaticFieldToPersist);
- } catch (final StoreException exception) {
- throw new FilePersistenceException(exception);
- }
- }
-
/**
* set enum state from file
*
Modified: trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistence.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistence.java 2011-10-16 04:45:29 UTC (rev 2921)
+++ trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistence.java 2011-10-16 08:35:26 UTC (rev 2922)
@@ -289,25 +289,6 @@
}
}
- private void setStoredStaticFromProperties()
- throws FilePersistenceClassNotFoundException,
- FilePersistenceException {
- try {
- final Map<String, Boolean> storedStaticMap = filePersistenceProperties
- .getStoredStaticMap();
- for (final Map.Entry<String, Boolean> entry : storedStaticMap
- .entrySet()) {
- if (entry.getValue().booleanValue()) {
- store.storedStaticField(entry.getKey());
- }
- }
- } catch (final StoreClassNotFoundException exception) {
- throw new FilePersistenceClassNotFoundException(exception);
- } catch (final StoreException exception) {
- throw new FilePersistenceException(exception);
- }
- }
-
private void setSubstitutionFromProperties()
throws FilePersistenceException {
final Set<FilePersistencePropertyEntry> set =
@@ -540,7 +521,6 @@
setStoreOnlyMarkedStorable(filePersistenceProperties
.isStoreOnlyMarkedStorable());
setRecordSaveActions(filePersistenceProperties.isRecordSaveActions());
- setStoredStaticFromProperties();
}
private void newAccessSessionAndReadOrCreateRootObject(
Modified: trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistencePropertiesReader.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistencePropertiesReader.java 2011-10-16 04:45:29 UTC (rev 2921)
+++ trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistencePropertiesReader.java 2011-10-16 08:35:26 UTC (rev 2922)
@@ -117,8 +117,6 @@
/** set substitution */
private static final String JOAFIP_SUBSTITUTE = "joafip.substitute.";
- private static final String JOAFIP_STORED_STATIC = "joafip.storedStatic.";
-
private static final String JOAFIP_MAINTENED_IN_MEMORY = "joafip.maintainedInMemory";
private static final String JOAFIP_MAINTENED_IN_MEMORY_QUOTA = "joafip.maintainedInMemoryQuota";
@@ -276,10 +274,6 @@
.setBackgroundGarbageSweepSleepTime(intValue(
key, value));
}
- } else if (key.startsWith(JOAFIP_STORED_STATIC)) {
- addStoredStatic(filePersistenceProperties,
- key.substring(JOAFIP_STORED_STATIC.length()),
- isEnabled(key, value));
} else if (key.equals(JOAFIP_MAINTENED_IN_MEMORY)) {
filePersistenceProperties.setMaintenedInMemory(isEnabled(
key, value));
@@ -422,12 +416,6 @@
value);
}
- private void addStoredStatic(
- final FilePersistenceProperties filePersistenceProperties,
- final String className, final boolean enabled) {
- filePersistenceProperties.getStoredStaticMap().put(className, enabled);
- }
-
private void addStoredMutableEnum(
final FilePersistenceProperties filePersistenceProperties,
final String enumClassName, final boolean enabled) {
Modified: trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java 2011-10-16 04:45:29 UTC (rev 2921)
+++ trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java 2011-10-16 08:35:26 UTC (rev 2922)
@@ -757,25 +757,7 @@
void storedEnum(Enum<?> enumObject) throws FilePersistenceException;
/**
- * set classes which for static field must be persisted
*
- * @param classHavingStaticFieldToPersistList
- * @throws FilePersistenceException
- */
- void storedStaticField(Class<?>[] classHavingStaticFieldToPersistList)
- throws FilePersistenceException;
-
- /**
- * set class which for static field must be persisted
- *
- * @param classHavingStaticFieldToPersist
- * @throws FilePersistenceException
- */
- void storedStaticField(Class<?> classHavingStaticFieldToPersist)
- throws FilePersistenceException;
-
- /**
- *
* @return true if manage garbage
* @throws FilePersistenceException
*/
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/entity/objectio/ObjectAndPersistInfo.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/objectio/ObjectAndPersistInfo.java 2011-10-16 04:45:29 UTC (rev 2921)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/objectio/ObjectAndPersistInfo.java 2011-10-16 08:35:26 UTC (rev 2922)
@@ -123,9 +123,6 @@
private ObjectAndPersistInfoWeakReference weakReference;
- /** true if static field persistence information */
- public final boolean staticPersistence;
-
public FieldInfo[] fieldToSetInfo;
private IProxyCallBackToImplement proxyCallBack = NULL_PROXY_CALL_BACK_INSTANCE;
@@ -147,26 +144,10 @@
*/
private ObjectAndPersistInfo(final boolean valueDefined) {
super(valueDefined);
- staticPersistence = false;
proxyIntanceOrEnhanced = false;
}
/**
- * static persistence information
- *
- * @param objectClassInfo
- * @throws ObjectIOException
- */
- public ObjectAndPersistInfo(final ClassInfo objectClassInfo)
- throws ObjectIOException {
- super(objectClassInfo);
- staticPersistence = true;
- joafipReleaseId = -1;
- dataModelIdentifier = -1;
- proxyIntanceOrEnhanced = false;
- }
-
- /**
* storage info not set<br>
*
* @param object
@@ -180,7 +161,6 @@
final ClassInfo objectClassInfo) throws ObjectIOException,
ClassInfoException {
super(object, objectClassInfo);
- staticPersistence = false;
joafipReleaseId = -1;
dataModelIdentifier = -1;
this.proxyIntanceOrEnhanced = proxyIntanceOrEnhanced;
@@ -200,7 +180,6 @@
final ClassInfo objectClassInfo, final StorageInfo storageInfo)
throws ClassInfoException, ObjectIOException {
super(object, objectClassInfo);
- staticPersistence = false;
headerDataSize = storageInfo.getHeaderDataSize();
replacementDefList = storageInfo.getReplacementDefList();
joafipReleaseId = storageInfo.getJoafipReleaseId();
@@ -215,7 +194,6 @@
final int joafipReleaseId, final int dataModelIdentifier)
throws ClassInfoException {
super(object, objectClassInfo);
- staticPersistence = false;
this.replacementDefList = replacementDefList;
this.joafipReleaseId = joafipReleaseId;
this.dataModelIdentifier = dataModelIdentifier;
@@ -300,7 +278,7 @@
// ASSERTX
assert assertStoreRootDataRecordIdentifier(dataRecordIdentifier);
// ASSERTX
- assert object != null || staticPersistence : "null can not have data record identifier";
+ assert object != null : "null can not have data record identifier";
// ASSERTX
assert this.dataRecordIdentifier == null : "data record identifier already set";
this.dataRecordIdentifier = dataRecordIdentifier;
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/entity/objectio/ObjectStateMap.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/objectio/ObjectStateMap.java 2011-10-16 04:45:29 UTC (rev 2921)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/objectio/ObjectStateMap.java 2011-10-16 08:35:26 UTC (rev 2922)
@@ -48,10 +48,6 @@
private final Map<IObjectIdentityKey, ObjectAndPersistInfo> stateMap =
/**/new HashMap<IObjectIdentityKey, ObjectAndPersistInfo>();
- /** map for persisted object static fields */
- private final Map<ClassInfo, ObjectAndPersistInfo> staticStateMap =
- /**/new TreeMap<ClassInfo, ObjectAndPersistInfo>();
-
/**
* map to obtains object persistence information by data record identifier
*/
@@ -152,9 +148,7 @@
// ASSERTX
assert objectAndPersistInfo.isNotWeak();
// ASSERTX
- assert staticStateMap.containsKey(objectAndPersistInfo
- .getObjectClassInfo())
- || stateMap.containsKey(objectAndPersistInfo);
+ assert stateMap.containsKey(objectAndPersistInfo);
final DataRecordIdentifier dataRecordIdentifier = objectAndPersistInfo.dataRecordIdentifier;
final ObjectAndPersistInfo previous = stateMapByIdentifier.put(
dataRecordIdentifier, objectAndPersistInfo);
@@ -312,61 +306,7 @@
referencedQueueSize++;
}
- // // FIXME-LUC _________for test
- // private boolean inQueue(final ObjectAndPersistInfo objectAndPersistInfo)
- // {
- // boolean found = false;
- // ObjectAndPersistInfo current = queueHead;
- // while (!found && current != null) {
- // found = current == objectAndPersistInfo || current.hasReferences()//
- // NOPMD
- // && current.getObject() == objectAndPersistInfo.getObject();
- // current = current.next;
- // }
- // return found;
- // }
-
/**
- *
- * @param objectClassInfo
- * the class information of the object
- * @return get or created class static field persistence information
- * @throws ObjectIOException
- */
- public ObjectAndPersistInfo getOrCreateObjectAndPersistInfoOfClass(
- final ClassInfo objectClassInfo) throws ObjectIOException {
- ObjectAndPersistInfo objectAndPersistInfo = staticStateMap
- .get(objectClassInfo);
- if (objectAndPersistInfo == null) {
- objectAndPersistInfo = createObjectAndPersistInfoOfClass(objectClassInfo);
- }
- return objectAndPersistInfo;
- }
-
- public ObjectAndPersistInfo createObjectAndPersistInfoOfClass(
- final ClassInfo objectClassInfo) throws ObjectIOException {
- ObjectAndPersistInfo objectAndPersistInfo;
- objectAndPersistInfo = new ObjectAndPersistInfo(objectClassInfo);
- objectAndPersistInfo.setObjectStateMap(this);
- staticStateMap.put(objectClassInfo, objectAndPersistInfo);
- return objectAndPersistInfo;
- }
-
- /**
- * Get existing, class static field persistence information.<br>
- *
- * @param objectClassInfo
- * the class information
- * @return get class static field persistence information, null if not
- * defined
- * @throws ObjectIOException
- */
- public ObjectAndPersistInfo getObjectAndPersistInfoOfClass(
- final ClassInfo objectClassInfo) throws ObjectIOException {
- return staticStateMap.get(objectClassInfo);
- }
-
- /**
* to know if object have persistence state associated to it
*
* @param objectAndPersistInfo
@@ -425,10 +365,6 @@
queueSize = 0;
queueNumberOfWeakRef = 0;
}
- // FIXMELUC _________________static persistence information live
- // with file persistence
- staticStateMap.clear();
- // checkNullFieldError();
}
}
@@ -542,10 +478,6 @@
}
}
- public Collection<ObjectAndPersistInfo> staticObjectAndPersistInfoSet() {
- return staticStateMap.values();
- }
-
/**
* object is accessed
*
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/entity/saver/StoreSaverSession.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/saver/StoreSaverSession.java 2011-10-16 04:45:29 UTC (rev 2921)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/saver/StoreSaverSession.java 2011-10-16 08:35:26 UTC (rev 2922)
@@ -119,12 +119,7 @@
*/
public boolean addToVisitedForSave(
final ObjectAndPersistInfo objectAndPersistInfo) {
- final boolean add;
- if (objectAndPersistInfo.staticPersistence) {
- add = true;
- } else {
- add = visitedForSave.add(objectAndPersistInfo);
- }
+ final boolean add = visitedForSave.add(objectAndPersistInfo);
if (add && keepToVisitForSaveRemoveEnabled) {
// no more keep to visit because visited for save
keepToVisitForSave.remove(objectAndPersistInfo);
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java 2011-10-16 04:45:29 UTC (rev 2921)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java 2011-10-16 08:35:26 UTC (rev 2922)
@@ -347,12 +347,6 @@
@Deprecated
void setEnumState(Enum<?> enumObject) throws StoreException;
- void storedStaticField(Class<?> classHavingStaticFieldToPersist)
- throws StoreException;
-
- void storedStaticField(String nameOfClassHavingStaticFieldToPersist)
- throws StoreClassNotFoundException, StoreException;
-
/**
* read root object
*
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java 2011-10-16 04:45:29 UTC (rev 2921)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java 2011-10-16 08:35:26 UTC (rev 2922)
@@ -30,7 +30,6 @@
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
-import java.util.Set;
import java.util.TreeMap;
import java.util.TreeSet;
import java.util.Vector;
@@ -64,7 +63,6 @@
import net.sf.joafip.store.service.binary.HelperBinaryConversion;
import net.sf.joafip.store.service.classinfo.ClassInfoException;
import net.sf.joafip.store.service.classinfo.ClassInfoFactory;
-import net.sf.joafip.store.service.garbage.GarbageException;
import net.sf.joafip.store.service.heaprecordable.HeapRecordableException;
import net.sf.joafip.store.service.objectio.ObjectIOClassNotFoundException;
import net.sf.joafip.store.service.objectio.ObjectIODataCorruptedException;
@@ -149,11 +147,6 @@
// private final Map<EnumKey, Enum> storedEnumMap = new PTreeMap<EnumKey,
// Enum>();
- /** set of class which for static field are persisted */
- private final Set<Class<?>> classHavingStaticFieldToPersistSet = new HashSet<Class<?>>();
-
- private boolean storedStaticFieldAdded = true;
-
/** exception throws in background */
private StoreException bacgroundException;
@@ -998,7 +991,6 @@
true ^ proxyMode).getObject();
assert storeRoot != null;
updateStoredEnumMap();
- updateStoredStaticField();
read = true;
} catch (final ObjectIODataRecordNotFoundException exception) {
@@ -1146,103 +1138,7 @@
}
}
- @StorableAccess
- private void addStoredStaticField() throws StoreException {
- try {
- if (!storedStaticFieldAdded) {
- storedStaticFieldAdded = true;
- Set<Long> set = storeRoot.getDataRecordIdOfpersistedStaticSet();
- if (set == null) {
- set = new PTreeSet<Long>();
- storeRoot.setDataRecordIdOfpersistedStaticSet(set);
- }
-
- for (final Class<?> classHavingStaticFieldToPersist : classHavingStaticFieldToPersistSet) {
- final ClassInfo classInfo = classInfoFactory
- .getNoProxyClassInfo(classHavingStaticFieldToPersist);
- final ObjectAndPersistInfo objectAndPersistInfo = objectIOManager
- .getOrCreateObjectAndPersistInfoOfClass(classInfo);
- if (objectAndPersistInfo.dataRecordIdentifier == null) {
- final DataRecordIdentifier dataRecordIdentifier = dataManager
- .getNewDataRecordIdentifier();
- objectAndPersistInfo
- .setDataRecordIdentifier(dataRecordIdentifier);
- set.add(dataRecordIdentifier.value);
- }
- }
- }
- } catch (final ObjectIOException exception) {
- throw new StoreException(exception);
- } catch (final ClassInfoException exception) {
- throw new StoreException(exception);
- } catch (final HeapException exception) {
- throw new StoreException(exception);
- }
- }
-
- @StorableAccess
- private void updateStoredStaticField() throws StoreException {
- try {
- final Set<Long> set = storeRoot
- .getDataRecordIdOfpersistedStaticSet();
- final List<DataRecordIdentifier> unexistingList = new LinkedList<DataRecordIdentifier>();
- if (set != null) {
- for (final long dataRecordIdentifierValue : set) {
- final DataRecordIdentifier dataRecordIdentifier = new DataRecordIdentifier(// NOPMD
- dataRecordIdentifierValue);
- if (objectIOManager.setStaticState(dataRecordIdentifier)
- .classDoesNotExist()) {
- unexistingList.add(dataRecordIdentifier);
- }
- }
- }
- if (garbageManagement) {
- for (final DataRecordIdentifier dataRecordIdentifier : unexistingList) {
- garbageManager.addToGarbage(dataRecordIdentifier);
- set.remove(dataRecordIdentifier.value);
- }
- }
-
- } catch (final ObjectIOException exception) {
- throw new StoreException(exception);
- } catch (final ObjectIODataCorruptedException exception) {
- throw new StoreException(exception);
- } catch (final ObjectIODataRecordNotFoundException exception) {
- throw new StoreException(exception);
- } catch (final ObjectIOClassNotFoundException exception) {
- throw new StoreException(exception);
- } catch (final ObjectIOInvalidClassException exception) {
- throw new StoreException(exception);
- } catch (final ObjectIONotSerializableException exception) {
- throw new StoreException(exception);
- } catch (final GarbageException exception) {
- throw new StoreException(exception);
- }
- }
-
@Override
- public void storedStaticField(final Class<?> classHavingStaticFieldToPersist)
- throws StoreException {
- classHavingStaticFieldToPersistSet.add(classHavingStaticFieldToPersist);
- storedStaticFieldAdded = false;
- }
-
- @Override
- public void storedStaticField(
- final String nameOfClassHavingStaticFieldToPersist)
- throws StoreClassNotFoundException, StoreException {
- Class<?> classHavingStaticFieldToPersist;
- try {
- classHavingStaticFieldToPersist = classInfoFactory
- .classForName(nameOfClassHavingStaticFieldToPersist);
- } catch (final ClassNotFoundException exception) {
- throw new StoreClassNotFoundException(exception);
- }
- classHavingStaticFieldToPersistSet.add(classHavingStaticFieldToPersist);
- storedStaticFieldAdded = false;
- }
-
- @Override
public void setAutoSaveEventListener(
final IAutoSaveEventListener saveEventListener) {
objectIOManager.setAutoSaveEventListener(saveEventListener);
@@ -1264,7 +1160,6 @@
throw new StoreException(FILE_ACCESS_SESSION_CLOSED);
}
- addStoredStaticField();
storeSaver.setRootOfObjectsToSave(storeRoot);
/*
* else { setStoreRootIsAlwaysUnreference(); }
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/conversion/AbstractObjectReplacer.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/conversion/AbstractObjectReplacer.java 2011-10-16 04:45:29 UTC (rev 2921)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/conversion/AbstractObjectReplacer.java 2011-10-16 08:35:26 UTC (rev 2922)
@@ -47,7 +47,6 @@
/**
* @param conversionMode
- * @param staticFieldConversion
* @param objectIOManager
* @param converterList
* @param originalValuedFieldList
@@ -56,7 +55,6 @@
* @throws ConversionException
*/
public ValuedFieldList convert(final EnumConversionMode conversionMode,
- final boolean staticFieldConversion,
final IObjectIOManagerForObjectIO objectIOManager,
final Deque<ClassReplacementDef> replacementDefList,
final ValuedFieldList originalValuedFieldList,
@@ -64,14 +62,9 @@
ValuedFieldList valuedFieldList = originalValuedFieldList;
for (ClassReplacementDef replacementDef : replacementDefList) {
final ClassInfo converterClass;
- if (staticFieldConversion) {
- converterClass = replacementDef.getStaticConverterClass();
- } else {
- converterClass = replacementDef.getConverterClass();
- }
+ converterClass = replacementDef.getConverterClass();
if (ClassInfo.NULL.equals(converterClass)) {
- valuedFieldList = convertByReplacementDef(
- staticFieldConversion, valuedFieldList,
+ valuedFieldList = convertByReplacementDef(valuedFieldList,
fieldsToSetInfo, replacementDef);
if (valuedFieldList == null) {
throw new ConversionException("replacement "
@@ -92,7 +85,6 @@
}
protected abstract ValuedFieldList convertByReplacementDef(
- final boolean staticFieldConversion,
final ValuedFieldList valuedFieldList,
final FieldInfo[] fieldsToSetInfo,
final ClassReplacementDef replacementDef)
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/conversion/ObjectReplacerForImport.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/conversion/ObjectReplacerForImport.java 2011-10-16 04:45:29 UTC (rev 2921)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/conversion/ObjectReplacerForImport.java 2011-10-16 08:35:26 UTC (rev 2922)
@@ -50,7 +50,6 @@
@Override
protected ValuedFieldList convertByReplacementDef(
- final boolean staticFieldConversion,
final ValuedFieldList valuedFieldList,
final FieldInfo[] fieldsToSetInfo,
final ClassReplacementDef replacementDef)
@@ -61,13 +60,8 @@
// replacement for read field by fieldInfo
final FieldInfo fieldInfo = fieldValue.getFieldInfo();
final FieldReplacementDef fieldReplacementDef;
- if (staticFieldConversion) {
- fieldReplacementDef = replacementDef
- .getReplacementStaticFieldInfo(fieldInfo);
- } else {
- fieldReplacementDef = replacementDef
- .getReplacementFieldInfo(fieldInfo);
- }
+ fieldReplacementDef = replacementDef
+ .getReplacementFieldInfo(fieldInfo);
final ObjectAndPersistInfo fiedlValue = fieldValue.getValue();
if (fieldReplacementDef == null) {
result.addNewFieldAndItsValue(index++, fieldInfo, fiedlValue);
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/conversion/ObjectReplacerOnTheFly.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/conversion/ObjectReplacerOnTheFly.java 2011-10-16 04:45:29 UTC (rev 2921)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/conversion/ObjectReplacerOnTheFly.java 2011-10-16 08:35:26 UTC (rev 2922)
@@ -55,14 +55,13 @@
/**
*
- * @param staticFieldConversion
* @param objectIOManager
* @param objectAndPersistInfo
* @param fieldValueList
* @return
* @throws ConversionException
*/
- public ValuedFieldList convert(final boolean staticFieldConversion,
+ public ValuedFieldList convert(
final IObjectIOManagerForObjectIO objectIOManager,
final ObjectAndPersistInfo objectAndPersistInfo,
final List<ObjectAndPersistInfo> fieldValueList)
@@ -71,14 +70,13 @@
.getReplacementDefList();
final ValuedFieldList valuedFieldList = new ValuedFieldList(
fieldValueList);
- return convert(EnumConversionMode.ON_THE_FLY, staticFieldConversion,
- objectIOManager, replacementDefList, valuedFieldList,
+ return convert(EnumC...
[truncated message content] |
|
From: <luc...@us...> - 2011-10-17 03:49:27
|
Revision: 2926
http://joafip.svn.sourceforge.net/joafip/?rev=2926&view=rev
Author: luc_peuvrier
Date: 2011-10-17 03:49:21 +0000 (Mon, 17 Oct 2011)
Log Message:
-----------
substitution management refactoring
Modified Paths:
--------------
trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java
trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistence.java
trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfo.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfoAttributes.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/classinfo/ClassInfoFactory.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/classinfo/IClassInfoFactory.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/manager/AbstractObjectIOManagerIOForObject.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/savenum/TestEnumKeptInMemory.java
trunk/joafip/src/test/java/net/sf/joafip/store/entity/classinfo/AbstractClassInfoTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/StoreForTest.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2011-10-17 03:49:28
|
Revision: 2926
http://joafip.svn.sourceforge.net/joafip/?rev=2926&view=rev
Author: luc_peuvrier
Date: 2011-10-17 03:49:21 +0000 (Mon, 17 Oct 2011)
Log Message:
-----------
substitution management refactoring
Modified Paths:
--------------
trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java
trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistence.java
trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfo.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfoAttributes.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/classinfo/ClassInfoFactory.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/classinfo/IClassInfoFactory.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/manager/AbstractObjectIOManagerIOForObject.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/savenum/TestEnumKeptInMemory.java
trunk/joafip/src/test/java/net/sf/joafip/store/entity/classinfo/AbstractClassInfoTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/StoreForTest.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
Modified: trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java 2011-10-17 02:46:26 UTC (rev 2925)
+++ trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java 2011-10-17 03:49:21 UTC (rev 2926)
@@ -233,43 +233,43 @@
}
@Override
- public void setSubstitution(final Class<?> replaced,
+ public void setWriteSubstitution(final Class<?> replaced,
final Class<?> substitute, final ISubsituteSynchronizer synchronizer)
throws FilePersistenceException {
try {
- store.setSubstitution(replaced, substitute, synchronizer);
+ store.setWriteSubstitution(replaced, substitute, synchronizer);
} catch (final StoreException exception) {
throw new FilePersistenceException(exception);
}
}
@Override
- public void removeSubstitution(final Class<?> replaced)
+ public void removeWriteSubstitution(final Class<?> replaced)
throws FilePersistenceException {
try {
- store.removeSubstitution(replaced);
+ store.removeWriteSubstitution(replaced);
} catch (final StoreException exception) {
throw new FilePersistenceException(exception);
}
}
@Override
- public void setSubstitution(final String replacedName,
+ public void setWriteSubstitution(final String replacedName,
final Class<?> substitute, final ISubsituteSynchronizer synchronizer)
throws FilePersistenceException {
try {
- store.setSubstitution(replacedName, substitute, synchronizer);
+ store.setWriteSubstitution(replacedName, substitute, synchronizer);
} catch (final StoreException exception) {
throw new FilePersistenceException(exception);
}
}
@Override
- public void removeSubstitution(final String replacedName)
+ public void removeWriteSubstitution(final String replacedName)
throws FilePersistenceException,
FilePersistenceClassNotFoundException {
try {
- store.removeSubstitution(replacedName);
+ store.removeWriteSubstitution(replacedName);
} catch (final StoreException exception) {
throw new FilePersistenceException(exception);
} catch (final StoreClassNotFoundException exception) {
Modified: trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistence.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistence.java 2011-10-17 02:46:26 UTC (rev 2925)
+++ trunk/joafip/src/main/java/net/sf/joafip/service/FilePersistence.java 2011-10-17 03:49:21 UTC (rev 2926)
@@ -308,7 +308,7 @@
.forName(synchronizerClassName);
final ISubsituteSynchronizer synchronizer = synchronizerClass
.newInstance();
- setSubstitution(toSubstituteClass, substituteClass,
+ setWriteSubstitution(toSubstituteClass, substituteClass,
synchronizer);
} catch (final ClassNotFoundException exception) {
throw new FilePersistenceException(exception);
Modified: trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java 2011-10-17 02:46:26 UTC (rev 2925)
+++ trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java 2011-10-17 03:49:21 UTC (rev 2926)
@@ -126,7 +126,7 @@
/**
* record a class substitution at write<br>
* if class is not accessible see
- * {@link #setSubstitution(String, Class, ISubsituteSynchronizer)} <br>
+ * {@link #setWriteSubstitution(String, Class, ISubsituteSynchronizer)} <br>
* (PROPS) can be set using properties file see
* {@link net.sf.joafip.service.FilePersistence#FilePersistence(String, boolean)}
* <br>
@@ -139,11 +139,12 @@
* the state synchronizer for class and its substitute
* @throws FilePersistenceException
*/
- void setSubstitution(Class<?> replaced, Class<?> substitute,
+ void setWriteSubstitution(Class<?> replaced, Class<?> substitute,
ISubsituteSynchronizer synchronizer)
throws FilePersistenceException;
- void removeSubstitution(Class<?> replaced) throws FilePersistenceException;
+ void removeWriteSubstitution(Class<?> replaced)
+ throws FilePersistenceException;
/**
* record a class substitution at write<br>
@@ -159,11 +160,11 @@
* the state synchronizer for class and its substitute
* @throws FilePersistenceException
*/
- void setSubstitution(String replacedName, Class<?> substitute,
+ void setWriteSubstitution(String replacedName, Class<?> substitute,
ISubsituteSynchronizer synchronizer)
throws FilePersistenceException;
- void removeSubstitution(String replacedName)
+ void removeWriteSubstitution(String replacedName)
throws FilePersistenceException,
FilePersistenceClassNotFoundException;
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfo.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfo.java 2011-10-17 02:46:26 UTC (rev 2925)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfo.java 2011-10-17 03:49:21 UTC (rev 2926)
@@ -940,24 +940,20 @@
notCheckedMethodSet.add(absoluteMethodName);
}
- public void setSubstitute(final ClassInfo substituteClassInfo,
+ public void setSubstituted(final ClassInfo substituteClassInfo,
final ISubstituteObjectManager substituteObjectManager) {
substituted = true;
this.substituteObjectManager = substituteObjectManager;
this.substituteClassInfo = substituteClassInfo;
+ substituteClassInfo.substituteObjectManager = substituteObjectManager;
+ substituteClassInfo.substitution = true;
+ substituteClassInfo.substituteOfClassInfo = this;
}
public boolean isSubstituted() {
return substituted;
}
- public void setSubstituteOf(final ClassInfo substituteOfClassInfo,
- final ISubstituteObjectManager substituteObjectManager) {
- substitution = true;
- this.substituteObjectManager = substituteObjectManager;
- this.substituteOfClassInfo = substituteOfClassInfo;
- }
-
public ClassInfo getSubstituteOfClassInfo() {
return substituteOfClassInfo;
}
@@ -1139,7 +1135,7 @@
this.useSpecificObjectIO = useSpecificObjectIO;
}
- public void setSubstitution(final ClassInfo substituteClassInfo,
+ public void setWriteSubstituted(final ClassInfo substituteClassInfo,
final ISubsituteSynchronizer subsituteSynchronizer) {
this.substituteClassInfo = substituteClassInfo;
this.subsituteSynchronizer = subsituteSynchronizer;
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfoAttributes.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfoAttributes.java 2011-10-17 02:46:26 UTC (rev 2925)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfoAttributes.java 2011-10-17 03:49:21 UTC (rev 2926)
@@ -63,7 +63,7 @@
private ISubstituteObjectManager substituteObjectManager;
- private Class<?> substitute;
+ private Class<?> writeSubstitution;
private ISubsituteSynchronizer synchronizer;
@@ -172,14 +172,14 @@
return substituteObjectManager;
}
- public void setSubstitution(final Class<?> substitute,
+ public void setWriteSubstitution(final Class<?> writeSubstitution,
final ISubsituteSynchronizer synchronizer) {
- this.substitute = substitute;
+ this.writeSubstitution = writeSubstitution;
this.synchronizer = synchronizer;
}
- public Class<?> getSubstitute() {
- return substitute;
+ public Class<?> getWriteSubstition() {
+ return writeSubstitution;
}
public ISubsituteSynchronizer getSynchronizer() {
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java 2011-10-17 02:46:26 UTC (rev 2925)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java 2011-10-17 03:49:21 UTC (rev 2926)
@@ -135,15 +135,15 @@
* the state synchronizer for class and its substitute
* @throws StoreException
*/
- void setSubstitution(Class<?> replaced, Class<?> substitute,
+ void setWriteSubstitution(Class<?> replaced, Class<?> substitute,
ISubsituteSynchronizer synchronizer) throws StoreException;
- void removeSubstitution(Class<?> replaced) throws StoreException;
+ void removeWriteSubstitution(Class<?> replaced) throws StoreException;
- void setSubstitution(String replacedName, Class<?> substitute,
+ void setWriteSubstitution(String replacedName, Class<?> substitute,
ISubsituteSynchronizer synchronizer) throws StoreException;
- void removeSubstitution(String replacedName) throws StoreException,
+ void removeWriteSubstitution(String replacedName) throws StoreException,
StoreClassNotFoundException;
/**
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java 2011-10-17 02:46:26 UTC (rev 2925)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java 2011-10-17 03:49:21 UTC (rev 2926)
@@ -224,54 +224,56 @@
final MapSynchronizer mapSynchronizer = new MapSynchronizer();
final ListSynchronizer listSynchronizer = new ListSynchronizer();
- setSubstitution(Vector.class, PVector.class, listSynchronizer);
+ setWriteSubstitution(Vector.class, PVector.class, listSynchronizer);
- setSubstitution(LinkedList.class, PLinkedList.class,
+ setWriteSubstitution(LinkedList.class, PLinkedList.class,
listSynchronizer);
- setSubstitution(ArrayList.class, PArrayList.class, listSynchronizer);
+ setWriteSubstitution(ArrayList.class, PArrayList.class,
+ listSynchronizer);
- setSubstitution(HashSet.class, PHashSet.class, setSynchronizer);
+ setWriteSubstitution(HashSet.class, PHashSet.class, setSynchronizer);
- setSubstitution(LinkedHashSet.class, PLinkedHashSet.class,
+ setWriteSubstitution(LinkedHashSet.class, PLinkedHashSet.class,
setSynchronizer);
- setSubstitution(TreeSet.class, PTreeSet.class, setSynchronizer);
+ setWriteSubstitution(TreeSet.class, PTreeSet.class, setSynchronizer);
- setSubstitution(Hashtable.class, PHashMap.class, mapSynchronizer);
+ setWriteSubstitution(Hashtable.class, PHashMap.class,
+ mapSynchronizer);
- setSubstitution(HashMap.class, PHashMap.class, mapSynchronizer);
+ setWriteSubstitution(HashMap.class, PHashMap.class, mapSynchronizer);
- setSubstitution(ConcurrentHashMap.class, PConcurrentHashMap.class,
- mapSynchronizer);
+ setWriteSubstitution(ConcurrentHashMap.class,
+ PConcurrentHashMap.class, mapSynchronizer);
- setSubstitution(LinkedHashMap.class, PLinkedHashMap.class,
+ setWriteSubstitution(LinkedHashMap.class, PLinkedHashMap.class,
mapSynchronizer);
- setSubstitution(TreeMap.class, PTreeMap.class, mapSynchronizer);
+ setWriteSubstitution(TreeMap.class, PTreeMap.class, mapSynchronizer);
} else {
- removeSubstitution(Vector.class);
+ removeWriteSubstitution(Vector.class);
- removeSubstitution(LinkedList.class);
+ removeWriteSubstitution(LinkedList.class);
- removeSubstitution(ArrayList.class);
+ removeWriteSubstitution(ArrayList.class);
- removeSubstitution(HashSet.class);
+ removeWriteSubstitution(HashSet.class);
- removeSubstitution(LinkedHashSet.class);
+ removeWriteSubstitution(LinkedHashSet.class);
- removeSubstitution(TreeSet.class);
+ removeWriteSubstitution(TreeSet.class);
- removeSubstitution(Hashtable.class);
+ removeWriteSubstitution(Hashtable.class);
- removeSubstitution(HashMap.class);
+ removeWriteSubstitution(HashMap.class);
- removeSubstitution(ConcurrentHashMap.class);
+ removeWriteSubstitution(ConcurrentHashMap.class);
- removeSubstitution(LinkedHashMap.class);
+ removeWriteSubstitution(LinkedHashMap.class);
- removeSubstitution(TreeMap.class);
+ removeWriteSubstitution(TreeMap.class);
}
}
@@ -349,7 +351,7 @@
}
@Override
- public final void setSubstitution(final Class<?> replacedClass,
+ public final void setWriteSubstitution(final Class<?> replacedClass,
final Class<?> substituteClass,
final ISubsituteSynchronizer subsituteSynchronizer)
throws StoreException {
@@ -359,7 +361,7 @@
.getNoProxyClassInfo(replacedClass);
final ClassInfo substituteClassInfo = classInfoFactory
.getNoProxyClassInfo(substituteClass);
- replacedClassInfo.setSubstitution(substituteClassInfo,
+ replacedClassInfo.setWriteSubstituted(substituteClassInfo,
subsituteSynchronizer);
} catch (final ClassInfoException exception) {
throw new StoreException(exception);
@@ -368,7 +370,7 @@
}
@Override
- public void removeSubstitution(final Class<?> replacedClass)
+ public void removeWriteSubstitution(final Class<?> replacedClass)
throws StoreException {
synchronized (mutex) {
try {
@@ -382,12 +384,12 @@
}
@Override
- public void setSubstitution(final String replacedName,
+ public void setWriteSubstitution(final String replacedName,
final Class<?> substitute, final ISubsituteSynchronizer synchronizer)
throws StoreException {
synchronized (mutex) {
try {
- classInfoFactory.setSubstitution(replacedName, substitute,
+ classInfoFactory.setWriteSubstitution(replacedName, substitute,
synchronizer);
} catch (final ClassInfoException exception) {
throw new StoreException(exception);
@@ -396,7 +398,7 @@
}
@Override
- public void removeSubstitution(final String replacedName)
+ public void removeWriteSubstitution(final String replacedName)
throws StoreException, StoreClassNotFoundException {
synchronized (mutex) {
try {
@@ -773,10 +775,8 @@
.getNoProxyClassInfo(objectClass);
final ClassInfo substituteClassInfo = classInfoFactory
.getNoProxyClassInfo(substituteObjectClass);
- classInfo.setSubstitute(substituteClassInfo,
+ classInfo.setSubstituted(substituteClassInfo,
substituteObjectManager);
- substituteClassInfo.setSubstituteOf(classInfo,
- substituteObjectManager);
} catch (final Exception exception) {
throw new StoreException(exception);
}
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/classinfo/ClassInfoFactory.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/classinfo/ClassInfoFactory.java 2011-10-17 02:46:26 UTC (rev 2925)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/classinfo/ClassInfoFactory.java 2011-10-17 03:49:21 UTC (rev 2926)
@@ -394,15 +394,13 @@
if (classInfoAttributes.haveSubstituteObjectManager()) {
final ClassInfo substituteClassInfo = getNoProxyClassInfo(classInfoAttributes
.getSubstituteObjectClass());
- classInfo.setSubstitute(substituteClassInfo,
+ classInfo.setSubstituted(substituteClassInfo,
classInfoAttributes.getSubstituteObjectManager());
- substituteClassInfo.setSubstituteOf(classInfo,
- classInfoAttributes.getSubstituteObjectManager());
}
- if (classInfoAttributes.getSubstitute() != null) {
+ if (classInfoAttributes.getWriteSubstition() != null) {
final ClassInfo substituteClassInfo = getNoProxyClassInfo(classInfoAttributes
- .getSubstitute());
- classInfo.setSubstitution(substituteClassInfo,
+ .getWriteSubstition());
+ classInfo.setWriteSubstituted(substituteClassInfo,
classInfoAttributes.getSynchronizer());
}
if (classInfoAttributes.getObjectInput() != null
@@ -556,24 +554,24 @@
substituteObjectClass, substituteObjectManager);
} else {
final ClassInfo substituteClassInfo = getNoProxyClassInfo(substituteObjectClass);
- classInfo.setSubstitute(substituteClassInfo,
+ classInfo.setSubstituted(substituteClassInfo,
substituteObjectManager);
- substituteClassInfo.setSubstituteOf(classInfo,
+ substituteClassInfo.setSubstituted(classInfo,
substituteObjectManager);
}
}
@Override
- public void setSubstitution(final String replacedName,
+ public void setWriteSubstitution(final String replacedName,
final Class<?> substitute, final ISubsituteSynchronizer synchronizer)
throws ClassInfoException {
final ClassInfo classInfo = classInfoMap.get(replacedName);
if (classInfo == null) {
final ClassInfoAttributes classInfoAttributes = getOrCreateClassInfoAttribute(replacedName);
- classInfoAttributes.setSubstitution(substitute, synchronizer);
+ classInfoAttributes.setWriteSubstitution(substitute, synchronizer);
} else {
final ClassInfo substituteClassInfo = getNoProxyClassInfo(substitute);
- classInfo.setSubstitution(substituteClassInfo, synchronizer);
+ classInfo.setWriteSubstituted(substituteClassInfo, synchronizer);
}
}
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/classinfo/IClassInfoFactory.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/classinfo/IClassInfoFactory.java 2011-10-17 02:46:26 UTC (rev 2925)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/classinfo/IClassInfoFactory.java 2011-10-17 03:49:21 UTC (rev 2926)
@@ -101,7 +101,7 @@
ISubstituteObjectManager substituteObjectManager)
throws ClassInfoException;
- void setSubstitution(String replacedName, Class<?> substitute,
+ void setWriteSubstitution(String replacedName, Class<?> substitute,
ISubsituteSynchronizer synchronizer) throws ClassInfoException;
void setObjectIOForClass(String objectClassName, IObjectInput objectInput,
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/manager/AbstractObjectIOManagerIOForObject.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/manager/AbstractObjectIOManagerIOForObject.java 2011-10-17 02:46:26 UTC (rev 2925)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/objectio/manager/AbstractObjectIOManagerIOForObject.java 2011-10-17 03:49:21 UTC (rev 2926)
@@ -595,10 +595,8 @@
if (objectAndPersistInfo == null) {
objectAndPersistInfo = createObjectReadingInStore(
dataRecordIdentifier, notLazy);
- } else if (objectAndPersistInfo.isSubstitution()) {
- objectAndPersistInfo = substitutionOrOriginal(objectAndPersistInfo);
}
- return objectAndPersistInfo;
+ return original(objectAndPersistInfo);
}
/**
@@ -710,7 +708,7 @@
}
notToGarbage(dataRecordIdentifier, objectAndPersistInfo);
- return substitutionOrOriginal(objectAndPersistInfo);
+ return original(objectAndPersistInfo);
}
private boolean assertOriginalClassInfo(final ClassInfo classInfo,
@@ -927,15 +925,15 @@
return replacementDefList;
}
- protected ObjectAndPersistInfo substitutionOrOriginal(
+ protected ObjectAndPersistInfo original(
final ObjectAndPersistInfo objectAndPersistInfo)
throws ObjectIOException, ObjectIODataCorruptedException,
ObjectIODataRecordNotFoundException, ObjectIOInvalidClassException,
ObjectIOClassNotFoundException, ObjectIONotSerializableException {
final ObjectAndPersistInfo result;
if (objectAndPersistInfo.isSubstitution()) {
- final ClassInfo classInfo2 = objectAndPersistInfo.objectClassInfo;
- final ISubstituteObjectManager substituteObjectManager = classInfo2
+ final ClassInfo classInfo = objectAndPersistInfo.objectClassInfo;
+ final ISubstituteObjectManager substituteObjectManager = classInfo
.getSubstituteObjectManager();
/*
* substituted in storage, the original object before to be
@@ -947,10 +945,10 @@
/* original/substituted in storage is not persisted, never a proxy */
result = getOrCreateObjectPersistInfoOfObject(substitutedObject,
- Boolean.FALSE, classInfo2.getSubstituteOfClassInfo(), false/*
- * not
- * persisted
- */);
+ Boolean.FALSE, classInfo.getSubstituteOfClassInfo(), false/*
+ * not
+ * persisted
+ */);
} else {
result = objectAndPersistInfo;
}
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/bug/savenum/TestEnumKeptInMemory.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/bug/savenum/TestEnumKeptInMemory.java 2011-10-17 02:46:26 UTC (rev 2925)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/bug/savenum/TestEnumKeptInMemory.java 2011-10-17 03:49:21 UTC (rev 2926)
@@ -96,7 +96,7 @@
}
@Override
- protected void tearDown() throws Exception {
+ protected void tearDown() throws Exception { // NOPMD
try {
filePersistence.close();
} catch (final Exception exception) {// NOPMD
Modified: trunk/joafip/src/test/java/net/sf/joafip/store/entity/classinfo/AbstractClassInfoTest.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/store/entity/classinfo/AbstractClassInfoTest.java 2011-10-17 02:46:26 UTC (rev 2925)
+++ trunk/joafip/src/test/java/net/sf/joafip/store/entity/classinfo/AbstractClassInfoTest.java 2011-10-17 03:49:21 UTC (rev 2926)
@@ -189,7 +189,7 @@
}
@Override
- public void setSubstitution(final String replacedName,
+ public void setWriteSubstitution(final String replacedName,
final Class<?> substitute, final ISubsituteSynchronizer synchronizer)
throws ClassInfoException {
throw new UnsupportedOperationException();
Modified: trunk/joafip/src/test/java/net/sf/joafip/store/service/StoreForTest.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/store/service/StoreForTest.java 2011-10-17 02:46:26 UTC (rev 2925)
+++ trunk/joafip/src/test/java/net/sf/joafip/store/service/StoreForTest.java 2011-10-17 03:49:21 UTC (rev 2926)
@@ -624,12 +624,12 @@
public void removeSubstitution(final Class<?> replacedClass)
throws StoreException {
- store.removeSubstitution(replacedClass);
+ store.removeWriteSubstitution(replacedClass);
}
public void removeSubstitution(final String replacedName)
throws StoreException, StoreClassNotFoundException {
- store.removeSubstitution(replacedName);
+ store.removeWriteSubstitution(replacedName);
}
public void save(final boolean closing, final boolean autoSave)
@@ -899,18 +899,18 @@
substituteObjectClass, substituteObjectManager);
}
- public final void setSubstitution(final Class<?> replacedClass,
+ public final void setWriteSubstitution(final Class<?> replacedClass,
final Class<?> substituteClass,
final ISubsituteSynchronizer subsituteSynchronizer)
throws StoreException {
- store.setSubstitution(replacedClass, substituteClass,
+ store.setWriteSubstitution(replacedClass, substituteClass,
subsituteSynchronizer);
}
- public void setSubstitution(final String replacedName,
+ public void setWriteSubstitution(final String replacedName,
final Class<?> substitute, final ISubsituteSynchronizer synchronizer)
throws StoreException {
- store.setSubstitution(replacedName, substitute, synchronizer);
+ store.setWriteSubstitution(replacedName, substitute, synchronizer);
}
public void setSubstitutionOfJavaUtilCollection(final boolean enabled)
Modified: trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
===================================================================
--- trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java 2011-10-17 02:46:26 UTC (rev 2925)
+++ trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java 2011-10-17 03:49:21 UTC (rev 2926)
@@ -24,13 +24,13 @@
import junit.framework.Test;
import junit.framework.TestSuite;
-import net.sf.joafip.service.TestExportImport;
-import net.sf.joafip.service.rel310.TestImport301ConversionA;
-import net.sf.joafip.service.rel310.TestImport301ConversionB;
-import net.sf.joafip.service.rel310.TestUseRuntime301LazyConversionA;
-import net.sf.joafip.service.rel310.TestUseRuntime301LazyConversionB;
-import net.sf.joafip.service.rel310.TestUseRuntime301NotLazyConversionA;
-import net.sf.joafip.service.rel310.TestUseRuntime301NotLazyConversionB;
+import net.sf.joafip.service.bug.savenum.TestEnumKeptInMemory;
+import net.sf.joafip.service.rel300.TestClassLoaderPersistence;
+import net.sf.joafip.service.rel300.TestKeptInMemory;
+import net.sf.joafip.service.rel300.TestSubstitutionSerialize;
+import net.sf.joafip.service.rel300.TestSubstitutionSerializeReadWriteMethod;
+import net.sf.joafip.service.rel300.TestSubstitutionSubstitutedSerializable;
+import net.sf.joafip.service.rel300.TestSubstitutionWithDataAccessSession;
/**
*
@@ -47,13 +47,13 @@
public static Test suite() {
final TestSuite suite = new TestSuite("in error Tests");
// $JUnit-BEGIN$
- suite.addTestSuite(TestExportImport.class);
- suite.addTestSuite(TestImport301ConversionA.class);
- suite.addTestSuite(TestImport301ConversionB.class);
- suite.addTestSuite(TestUseRuntime301LazyConversionA.class);
- suite.addTestSuite(TestUseRuntime301LazyConversionB.class);
- suite.addTestSuite(TestUseRuntime301NotLazyConversionA.class);
- suite.addTestSuite(TestUseRuntime301NotLazyConversionB.class);
+ suite.addTestSuite(TestEnumKeptInMemory.class);
+ suite.addTestSuite(TestSubstitutionWithDataAccessSession.class);
+ suite.addTestSuite(TestSubstitutionSubstitutedSerializable.class);
+ suite.addTestSuite(TestSubstitutionSerialize.class);
+ suite.addTestSuite(TestSubstitutionSerializeReadWriteMethod.class);
+ suite.addTestSuite(TestClassLoaderPersistence.class);
+ suite.addTestSuite(TestKeptInMemory.class);
// suite.addTest(xxxx.suite());
// $JUnit-END$
return suite;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2011-10-21 01:41:02
|
Revision: 2933
http://joafip.svn.sourceforge.net/joafip/?rev=2933&view=rev
Author: luc_peuvrier
Date: 2011-10-21 01:40:53 +0000 (Fri, 21 Oct 2011)
Log Message:
-----------
storage annotation check added in tests
Modified Paths:
--------------
trunk/joafip/src/test/java/net/sf/joafip/entity/TestFilePersistenceProperties.java
trunk/joafip/src/test/java/net/sf/joafip/entity/rel400/BobASDelegatingListenDelegate.java
trunk/joafip/src/test/java/net/sf/joafip/ograph/OGraphTest.java
trunk/joafip/src/test/java/net/sf/joafip/service/AbstractCopyRuntime.java
trunk/joafip/src/test/java/net/sf/joafip/service/AbstractTestCustomObjectIO.java
trunk/joafip/src/test/java/net/sf/joafip/service/AbstractTestFilePersistence.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestBobSerializeStackOverflow.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestClear.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestCrashSafe.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestCustomObjectIOWithBob1Custom.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestCustomObjectIOWithSerializer.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestCustomObjectIOWithSerializerZipper.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceNoG.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceOpenClose.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceWithG.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestMultipleFilePersistenceInstance.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestVersion.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/TestBugChangeLog.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/TestGarbageModeError.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/TestRootObjectMapAutoSave.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/TestSaveUnloaded.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/java/util/TestPArrayList.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/primitive/TestPrimitiveIO.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/savenum/TestEnumPersistence.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/savenum/TestEnumPersistenceMemory.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestClassLoaderPersistence.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestImport222NotLazy.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestThisInConstructor.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestUseRuntime222NotLazy.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel301/TestUseRuntime300NotLazy.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel310/TestUseRuntime301NotLazyConversionA.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel310/TestUseRuntime301NotLazyConversionB.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestAutoSave.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestConstructEntrySetIteratorOfPMapKeyNavigableSet.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestProxyTestList.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestRuntime310Garbage.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestSaveInExclusiveDataAccessSession.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/AbstractDataManagerTestCase.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/AbstractGarbageTestCase.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/AbstractTestGarbage.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/AbstractTestStoreMemoryLeak.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestGarbageForegroundFile.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestGarbageForegroundMemory.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestGarbageInBackground.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestObjectReferenceLinkInMemory.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreMemoryLeakCacheNoGarbage.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreMemoryLeakNoCacheGarbage.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreMemoryLeakNoCacheNoGarbage.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreOpenClose.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreOpenCloseNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/Test16BitsConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/Test32BitsConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/Test64BitsConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/Test8BitsConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestBooleanConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestBooleanNullableConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestByteConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestByteNullableConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestCharConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestCharNullableConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestDoubleConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestDoubleNullableConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestFloatConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestFloatNullableConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestIntegerConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestIntegerNullableConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestLongConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestLongNullableConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestReferenceConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestReferenceNullableConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestShortConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestShortNullableConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/TestForTransform.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/TestPersistableCodeGeneratorInner.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/agent/TestPackageMgr.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/proxy/TestCheckMethodVisitor.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/classinfo/TestClassInfoFactory.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/classinfo/TestClassReplacement.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionHashMapNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionHashMapNosubsWithG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionHashTableNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionHashTableNosubsWithG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionTreeMapNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionTreeMapNosubsWithG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionTroveHashMapNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionTroveHashMapNosubsWithG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionVectorNosubsWithG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/conversion/TestConvertionDefinitionReader.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/conversion/TestReplacementDefMap.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/copier/AbstractTestDeepCopier.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/copier/TestDeepCopier.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/copier/TestProxyDeepCopier.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/garbage/TestLinkManager.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/garbage/TestReferenceLinkGraph.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/garbage/TestStoreGarbager.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/garbage/recordmgr/AbstractGarbageManagerTestCase.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/garbage/recordmgr/TestGarbageCandidateRecordManager.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/garbage/recordmgr/TestLinkRecordManager.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/garbage/recordmgr/TestToGarbageRecordManager.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/heaprecordable/TestHeapRecordableManager.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/TestClassNameManager.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/manager/AbstractBinaryDump.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/manager/AbstractTestIoManager.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/manager/TestObjectIOManagerGenericCases.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/manager/TestObjectIOManagerSerializeCase.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/manager/TestSerializerObjectIOManager.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/serialize/AbstractObjectIOTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/serialize/AbstractSerializeTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/serialize/ObjectIOBasicTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/serialize/ObjectIOWithSerialPersistenceFieldsTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/serialize/ObjectIOWithSerialPersistenceFieldsUnsharedTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/serialize/ObjectIOWithSerializeCycleTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/serialize/ObjectIOWithSerializeMethodTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/AbstractObjectIoManagerForProxyTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/ProxyCallBackForTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/TestProxyCreation.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/TestProxyCreationConstructed.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/TestProxyManager2.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/synchronizer/TestHashsetSynchronizer.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/synchronizer/TestLinkedListSynchronizer.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/synchronizer/TestMapSynchronizer.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/tree/TreeSupport.java
trunk/joafip-collection/src/test/java/net/sf/joafip/java/util/TestIterPArrayList.java
trunk/joafip-common/src/main/java/net/sf/joafip/logger/DummyLogger.java
trunk/joafip-common/src/main/java/net/sf/joafip/logger/IJoafipLogger.java
trunk/joafip-common/src/main/java/net/sf/joafip/logger/JoafipLogger.java
trunk/joafip-common/src/test/java/net/sf/joafip/AbstractJoafipCommonTestCase.java
trunk/joafip-example-simplestore/src/test/java/net/sf/joafip/simplestore/TestSimpleStore.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomAccessFileReadWriteCacheTest.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileTest.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/record/TestIdNode.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/record/entity/TestAbstractFileStorable.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/record/entity/TestDataRecordIdentifier.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/record/entity/TestMarshall.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/record/service/TestHeapElementManager.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/record/service/TestHeapRecordManage.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/record/service/TestRandomAccessFileCache.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/record/service/TestStoreRestore.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/AbstractTestHeapDataManager.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/AbstractTestHeapDataManagerRecord.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapDataManager.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapDataManagerBackup.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapDataManagerFreeing.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapDataMgrWithScenario.java
trunk/joafip-log4j/src/main/java/net/sf/joafip/logger/Log4jAdapter.java
trunk/joafip-meminspector/src/test/java/net/sf/joafip/meminspector/TestMemInspector.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/AbstractTestByPosition.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/AbstractTestDelete.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/AbstractTestInsert.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/AbstractTestNumberOfChild.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/TestAppend.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/TestByPositionDuplicate.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/TestByPositionUnique.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/TestDeleteDuplicate.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/TestDeleteUnique.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/TestFirstLastNext.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/TestIndex.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/TestInsertDuplicate.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/TestInsertUnique.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/TestNumberOfChildDoNotManageNodeIndex.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/TestNumberOfChildManageNodeIndex.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/TestSearchDuplicate.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/TestSearchUnique.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/service/rel400/ServiceRel400Tests.java
Added Paths:
-----------
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestTreeMapIteratorAutoSave.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestTreeSetIteratorAutoSave.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestTreeSupportIterator.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestTreeSupportIteratorAutoSave.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2011-10-21 01:41:05
|
Revision: 2933
http://joafip.svn.sourceforge.net/joafip/?rev=2933&view=rev
Author: luc_peuvrier
Date: 2011-10-21 01:40:53 +0000 (Fri, 21 Oct 2011)
Log Message:
-----------
storage annotation check added in tests
Modified Paths:
--------------
trunk/joafip/src/test/java/net/sf/joafip/entity/TestFilePersistenceProperties.java
trunk/joafip/src/test/java/net/sf/joafip/entity/rel400/BobASDelegatingListenDelegate.java
trunk/joafip/src/test/java/net/sf/joafip/ograph/OGraphTest.java
trunk/joafip/src/test/java/net/sf/joafip/service/AbstractCopyRuntime.java
trunk/joafip/src/test/java/net/sf/joafip/service/AbstractTestCustomObjectIO.java
trunk/joafip/src/test/java/net/sf/joafip/service/AbstractTestFilePersistence.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestBobSerializeStackOverflow.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestClear.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestCrashSafe.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestCustomObjectIOWithBob1Custom.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestCustomObjectIOWithSerializer.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestCustomObjectIOWithSerializerZipper.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceNoG.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceOpenClose.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceWithG.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestMultipleFilePersistenceInstance.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestVersion.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/TestBugChangeLog.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/TestGarbageModeError.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/TestRootObjectMapAutoSave.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/TestSaveUnloaded.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/java/util/TestPArrayList.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/primitive/TestPrimitiveIO.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/savenum/TestEnumPersistence.java
trunk/joafip/src/test/java/net/sf/joafip/service/bug/savenum/TestEnumPersistenceMemory.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestClassLoaderPersistence.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestImport222NotLazy.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestThisInConstructor.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel300/TestUseRuntime222NotLazy.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel301/TestUseRuntime300NotLazy.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel310/TestUseRuntime301NotLazyConversionA.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel310/TestUseRuntime301NotLazyConversionB.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestAutoSave.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestConstructEntrySetIteratorOfPMapKeyNavigableSet.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestProxyTestList.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestRuntime310Garbage.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestSaveInExclusiveDataAccessSession.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/AbstractDataManagerTestCase.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/AbstractGarbageTestCase.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/AbstractTestGarbage.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/AbstractTestStoreMemoryLeak.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestGarbageForegroundFile.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestGarbageForegroundMemory.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestGarbageInBackground.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestObjectReferenceLinkInMemory.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreMemoryLeakCacheNoGarbage.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreMemoryLeakNoCacheGarbage.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreMemoryLeakNoCacheNoGarbage.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreOpenClose.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/TestStoreOpenCloseNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/Test16BitsConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/Test32BitsConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/Test64BitsConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/Test8BitsConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestBooleanConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestBooleanNullableConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestByteConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestByteNullableConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestCharConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestCharNullableConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestDoubleConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestDoubleNullableConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestFloatConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestFloatNullableConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestIntegerConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestIntegerNullableConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestLongConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestLongNullableConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestReferenceConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestReferenceNullableConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestShortConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/binary/TestShortNullableConverter.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/TestForTransform.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/TestPersistableCodeGeneratorInner.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/agent/TestPackageMgr.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/proxy/TestCheckMethodVisitor.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/classinfo/TestClassInfoFactory.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/classinfo/TestClassReplacement.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionHashMapNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionHashMapNosubsWithG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionHashTableNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionHashTableNosubsWithG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionTreeMapNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionTreeMapNosubsWithG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionTroveHashMapNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionTroveHashMapNosubsWithG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionVectorNosubsWithG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/conversion/TestConvertionDefinitionReader.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/conversion/TestReplacementDefMap.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/copier/AbstractTestDeepCopier.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/copier/TestDeepCopier.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/copier/TestProxyDeepCopier.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/garbage/TestLinkManager.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/garbage/TestReferenceLinkGraph.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/garbage/TestStoreGarbager.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/garbage/recordmgr/AbstractGarbageManagerTestCase.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/garbage/recordmgr/TestGarbageCandidateRecordManager.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/garbage/recordmgr/TestLinkRecordManager.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/garbage/recordmgr/TestToGarbageRecordManager.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/heaprecordable/TestHeapRecordableManager.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/TestClassNameManager.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/manager/AbstractBinaryDump.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/manager/AbstractTestIoManager.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/manager/TestObjectIOManagerGenericCases.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/manager/TestObjectIOManagerSerializeCase.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/manager/TestSerializerObjectIOManager.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/serialize/AbstractObjectIOTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/serialize/AbstractSerializeTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/serialize/ObjectIOBasicTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/serialize/ObjectIOWithSerialPersistenceFieldsTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/serialize/ObjectIOWithSerialPersistenceFieldsUnsharedTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/serialize/ObjectIOWithSerializeCycleTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/objectio/serialize/ObjectIOWithSerializeMethodTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/AbstractObjectIoManagerForProxyTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/ProxyCallBackForTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/TestProxyCreation.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/TestProxyCreationConstructed.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/proxy/TestProxyManager2.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/synchronizer/TestHashsetSynchronizer.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/synchronizer/TestLinkedListSynchronizer.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/synchronizer/TestMapSynchronizer.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/tree/TreeSupport.java
trunk/joafip-collection/src/test/java/net/sf/joafip/java/util/TestIterPArrayList.java
trunk/joafip-common/src/main/java/net/sf/joafip/logger/DummyLogger.java
trunk/joafip-common/src/main/java/net/sf/joafip/logger/IJoafipLogger.java
trunk/joafip-common/src/main/java/net/sf/joafip/logger/JoafipLogger.java
trunk/joafip-common/src/test/java/net/sf/joafip/AbstractJoafipCommonTestCase.java
trunk/joafip-example-simplestore/src/test/java/net/sf/joafip/simplestore/TestSimpleStore.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomAccessFileReadWriteCacheTest.java
trunk/joafip-file/src/test/java/net/sf/joafip/file/service/RandomFileTest.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/record/TestIdNode.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/record/entity/TestAbstractFileStorable.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/record/entity/TestDataRecordIdentifier.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/record/entity/TestMarshall.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/record/service/TestHeapElementManager.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/record/service/TestHeapRecordManage.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/record/service/TestRandomAccessFileCache.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/record/service/TestStoreRestore.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/AbstractTestHeapDataManager.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/AbstractTestHeapDataManagerRecord.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapDataManager.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapDataManagerBackup.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapDataManagerFreeing.java
trunk/joafip-heapfile/src/test/java/net/sf/joafip/heapfile/service/TestHeapDataMgrWithScenario.java
trunk/joafip-log4j/src/main/java/net/sf/joafip/logger/Log4jAdapter.java
trunk/joafip-meminspector/src/test/java/net/sf/joafip/meminspector/TestMemInspector.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/AbstractTestByPosition.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/AbstractTestDelete.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/AbstractTestInsert.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/AbstractTestNumberOfChild.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/TestAppend.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/TestByPositionDuplicate.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/TestByPositionUnique.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/TestDeleteDuplicate.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/TestDeleteUnique.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/TestFirstLastNext.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/TestIndex.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/TestInsertDuplicate.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/TestInsertUnique.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/TestNumberOfChildDoNotManageNodeIndex.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/TestNumberOfChildManageNodeIndex.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/TestSearchDuplicate.java
trunk/joafip-rbtree/src/test/java/net/sf/joafip/redblacktree/service/TestSearchUnique.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/service/rel400/ServiceRel400Tests.java
Added Paths:
-----------
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestTreeMapIteratorAutoSave.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestTreeSetIteratorAutoSave.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestTreeSupportIterator.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestTreeSupportIteratorAutoSave.java
Modified: trunk/joafip/src/test/java/net/sf/joafip/entity/TestFilePersistenceProperties.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/entity/TestFilePersistenceProperties.java 2011-10-21 01:36:31 UTC (rev 2932)
+++ trunk/joafip/src/test/java/net/sf/joafip/entity/TestFilePersistenceProperties.java 2011-10-21 01:40:53 UTC (rev 2933)
@@ -18,12 +18,14 @@
import net.sf.joafip.AbstractJoafipTestCase;
import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestException;
import net.sf.joafip.service.ClassLoaderProvider;
import net.sf.joafip.service.FilePersistenceException;
import net.sf.joafip.service.FilePersistencePropertiesReader;
@NotStorableClass
+@StorableAccess
public class TestFilePersistenceProperties extends AbstractJoafipTestCase {
private static final String PROP =
Modified: trunk/joafip/src/test/java/net/sf/joafip/entity/rel400/BobASDelegatingListenDelegate.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/entity/rel400/BobASDelegatingListenDelegate.java 2011-10-21 01:36:31 UTC (rev 2932)
+++ trunk/joafip/src/test/java/net/sf/joafip/entity/rel400/BobASDelegatingListenDelegate.java 2011-10-21 01:40:53 UTC (rev 2933)
@@ -37,6 +37,8 @@
@AssertNotNull
private final BobAsDelegateNotifyDelegating delegate;
+ private final boolean constructed;
+
public BobASDelegatingListenDelegate(final IInstanceFactory instanceFactory) {
super();
delegate = BobAsDelegateNotifyDelegating.newInstance(instanceFactory,
@@ -45,8 +47,13 @@
throw new IllegalStateException("delegate must not be null");
}
initialize();// NOPMD
+ constructed = true;
}
+ public boolean isConstructed() {
+ return constructed;
+ }
+
public static BobASDelegatingListenDelegate newInstance(
final IInstanceFactory instanceFactory) {
final BobASDelegatingListenDelegate newInstance;
Modified: trunk/joafip/src/test/java/net/sf/joafip/ograph/OGraphTest.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/ograph/OGraphTest.java 2011-10-21 01:36:31 UTC (rev 2932)
+++ trunk/joafip/src/test/java/net/sf/joafip/ograph/OGraphTest.java 2011-10-21 01:40:53 UTC (rev 2933)
@@ -5,6 +5,7 @@
import java.util.Set;
import net.sf.joafip.AbstractJoafipTestCase;
+import net.sf.joafip.NoStorableAccess;
import net.sf.joafip.NotStorableClass;
import net.sf.joafip.TestException;
import net.sf.joafip.logger.JoafipLogger;
@@ -15,6 +16,7 @@
import net.sf.joafip.store.service.objectfortest.BobContainer;
@NotStorableClass
+@NoStorableAccess
public class OGraphTest extends AbstractJoafipTestCase {
private static final String BAD_PATH = "bad path";
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/AbstractCopyRuntime.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/AbstractCopyRuntime.java 2011-10-21 01:36:31 UTC (rev 2932)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/AbstractCopyRuntime.java 2011-10-21 01:40:53 UTC (rev 2933)
@@ -30,6 +30,7 @@
import net.sf.joafip.AbstractDeleteFileTestCase;
import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestException;
/**
@@ -38,6 +39,7 @@
*
*/
@NotStorableClass
+@StorableAccess
public abstract class AbstractCopyRuntime extends AbstractDeleteFileTestCase {
public AbstractCopyRuntime() throws TestException {
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/AbstractTestCustomObjectIO.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/AbstractTestCustomObjectIO.java 2011-10-21 01:36:31 UTC (rev 2932)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/AbstractTestCustomObjectIO.java 2011-10-21 01:40:53 UTC (rev 2933)
@@ -18,6 +18,7 @@
import net.sf.joafip.AbstractDeleteFileTestCase;
import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestException;
import net.sf.joafip.entity.EnumFilePersistenceCloseAction;
import net.sf.joafip.store.service.objectfortest.Bob1;
@@ -25,6 +26,7 @@
import net.sf.joafip.store.service.objectfortest.Bob3;
@NotStorableClass
+@StorableAccess
public abstract class AbstractTestCustomObjectIO extends
AbstractDeleteFileTestCase {
@@ -41,7 +43,7 @@
}
@Override
- protected void setUp() throws Exception {
+ protected void setUp() throws Exception { // NOPMD
super.setUp();
// filePersistence = new FilePersistence(1, null, path,
// /**/false/* do not remove files */,
@@ -56,7 +58,7 @@
}
@Override
- protected void tearDown() throws Exception {
+ protected void tearDown() throws Exception { // NOPMD
try {
filePersistence.close();
} catch (final Throwable throwable) {// NOPMD
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/AbstractTestFilePersistence.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/AbstractTestFilePersistence.java 2011-10-21 01:36:31 UTC (rev 2932)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/AbstractTestFilePersistence.java 2011-10-21 01:40:53 UTC (rev 2933)
@@ -18,6 +18,7 @@
import net.sf.joafip.AbstractDeleteFileTestCase;
import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestException;
import net.sf.joafip.entity.EnumFilePersistenceCloseAction;
import net.sf.joafip.store.entity.garbage.ReferenceLinkGarbageException;
@@ -26,6 +27,7 @@
import net.sf.joafip.store.service.objectfortest.BobContainer;
@NotStorableClass
+@StorableAccess
public abstract class AbstractTestFilePersistence extends
AbstractDeleteFileTestCase {
@@ -47,7 +49,7 @@
}
@Override
- protected void tearDown() throws Exception {
+ protected void tearDown() throws Exception { // NOPMD
try {
filePersistence.close();
} catch (final Throwable throwable) {// NOPMD
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/TestBobSerializeStackOverflow.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/TestBobSerializeStackOverflow.java 2011-10-21 01:36:31 UTC (rev 2932)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestBobSerializeStackOverflow.java 2011-10-21 01:40:53 UTC (rev 2933)
@@ -25,6 +25,8 @@
import java.util.Set;
import net.sf.joafip.AbstractDeleteFileTestCase;
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestException;
import net.sf.joafip.entity.EnumFilePersistenceCloseAction;
import net.sf.joafip.java.util.PLinkedTreeSet;
@@ -35,6 +37,8 @@
*
* @author luc peuvrier
*/
+@NotStorableClass
+@StorableAccess
public class TestBobSerializeStackOverflow extends AbstractDeleteFileTestCase {
private static final String BIG_BOB_KEY = "bigBobKey";
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/TestClear.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/TestClear.java 2011-10-21 01:36:31 UTC (rev 2932)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestClear.java 2011-10-21 01:40:53 UTC (rev 2933)
@@ -24,6 +24,7 @@
import net.sf.joafip.AbstractDeleteFileTestCase;
import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestException;
import net.sf.joafip.entity.EnumFilePersistenceCloseAction;
import net.sf.joafip.store.service.objectfortest.Bob1;
@@ -34,6 +35,7 @@
*
*/
@NotStorableClass
+@StorableAccess
public class TestClear extends AbstractDeleteFileTestCase {
private static final String BOB1_KEY = "bob1";
@@ -64,7 +66,7 @@
}
@Override
- protected void tearDown() throws Exception {
+ protected void tearDown() throws Exception { // NOPMD
try {
filePersistence.close();
} catch (final Throwable throwable) {// NOPMD
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/TestCrashSafe.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/TestCrashSafe.java 2011-10-21 01:36:31 UTC (rev 2932)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestCrashSafe.java 2011-10-21 01:40:53 UTC (rev 2933)
@@ -28,6 +28,7 @@
import net.sf.joafip.AbstractDeleteFileTestCase;
import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestConstant;
import net.sf.joafip.TestException;
import net.sf.joafip.entity.EnumFilePersistenceCloseAction;
@@ -51,6 +52,7 @@
*
*/
@NotStorableClass
+@StorableAccess
public class TestCrashSafe extends AbstractDeleteFileTestCase {
private static final JoafipLogger LOGGER = JoafipLogger
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/TestCustomObjectIOWithBob1Custom.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/TestCustomObjectIOWithBob1Custom.java 2011-10-21 01:36:31 UTC (rev 2932)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestCustomObjectIOWithBob1Custom.java 2011-10-21 01:40:53 UTC (rev 2933)
@@ -17,10 +17,12 @@
package net.sf.joafip.service;
import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestException;
import net.sf.joafip.store.service.objectfortest.Bob1;
@NotStorableClass
+@StorableAccess
public class TestCustomObjectIOWithBob1Custom extends // NOPMD
AbstractTestCustomObjectIO {
@@ -34,7 +36,7 @@
}
@Override
- protected void setUp() throws Exception {
+ protected void setUp() throws Exception { // NOPMD
super.setUp();
filePersistence.setObjectIOForClass(Bob1.class,
Bob1ObjectInputForTestCustom.class,
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/TestCustomObjectIOWithSerializer.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/TestCustomObjectIOWithSerializer.java 2011-10-21 01:36:31 UTC (rev 2932)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestCustomObjectIOWithSerializer.java 2011-10-21 01:40:53 UTC (rev 2933)
@@ -17,12 +17,14 @@
package net.sf.joafip.service;
import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestException;
import net.sf.joafip.store.service.objectfortest.Bob1;
import net.sf.joafip.store.service.objectio.serialize.input.ObjectInputSerialize;
import net.sf.joafip.store.service.objectio.serialize.output.ObjectOutputSerialize;
@NotStorableClass
+@StorableAccess
public class TestCustomObjectIOWithSerializer extends // NOPMD
AbstractTestCustomObjectIO {
@@ -36,7 +38,7 @@
}
@Override
- protected void setUp() throws Exception {
+ protected void setUp() throws Exception { // NOPMD
super.setUp();
filePersistence.setObjectIOForClass(Bob1.class,
ObjectInputSerialize.class, ObjectOutputSerialize.class);
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/TestCustomObjectIOWithSerializerZipper.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/TestCustomObjectIOWithSerializerZipper.java 2011-10-21 01:36:31 UTC (rev 2932)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestCustomObjectIOWithSerializerZipper.java 2011-10-21 01:40:53 UTC (rev 2933)
@@ -17,12 +17,14 @@
package net.sf.joafip.service;
import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestException;
import net.sf.joafip.store.service.objectfortest.Bob1;
import net.sf.joafip.store.service.objectio.serialize.input.ObjectInputSerializeZipped;
import net.sf.joafip.store.service.objectio.serialize.output.ObjectOutputSerializeZipped;
@NotStorableClass
+@StorableAccess
public class TestCustomObjectIOWithSerializerZipper extends // NOPMD
AbstractTestCustomObjectIO {
@@ -36,7 +38,7 @@
}
@Override
- protected void setUp() throws Exception {
+ protected void setUp() throws Exception { // NOPMD
super.setUp();
filePersistence.setObjectIOForClass(Bob1.class,
ObjectInputSerializeZipped.class,
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceNoG.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceNoG.java 2011-10-21 01:36:31 UTC (rev 2932)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceNoG.java 2011-10-21 01:40:53 UTC (rev 2933)
@@ -1,9 +1,11 @@
package net.sf.joafip.service;
import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.StorableAccess;
import net.sf.joafip.TestException;
@NotStorableClass
+@StorableAccess
public class TestFilePersistenceNoG extends AbstractTestFilePersistence {// NOPMD
public TestFilePersistenceNoG() throws TestException {
@@ -15,7 +17,7 @@
}
@Override
- protected void setUp() throws Exception {
+ protected void setUp() throws Exception { // NOPMD
super.setUp();
// filePersistence = new FilePersistence(1, null, path,
// /**/false/* do not remove files */,
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceOpenClose.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceOpenClose.java 2011-10-21 01:36:31 UTC (rev 2932)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceOpenClose.java 2011-10-21 01:40:53 ...
[truncated message content] |
|
From: <luc...@us...> - 2011-10-29 16:17:41
|
Revision: 2951
http://joafip.svn.sourceforge.net/joafip/?rev=2951&view=rev
Author: luc_peuvrier
Date: 2011-10-29 16:17:34 +0000 (Sat, 29 Oct 2011)
Log Message:
-----------
add byte code check for prsistence constraints
Modified Paths:
--------------
trunk/joafip/doc/_todo.txt
trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java
trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfo.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfoAttributes.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNode.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeMethod.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/CheckMethodVisitor.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/ClassConstraintChecker.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/ICheckMethodListener.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/OpcodeInterpreter.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/classinfo/ClassInfoFactory.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/classinfo/IClassInfoFactory.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/ProxyManager2.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/AbstractTestObjectReferenceLink.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/StoreForTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/proxy/ForTestCheckMethodVisitor.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/proxy/TestCheckMethodVisitor.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionArrayListNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionHashMapNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionHashSetNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionHashSetNosubsWithG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionHashTableNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionLinkedHashSetNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionLinkedHashSetNosubsWithG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionLinkedListNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionTreeMapNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionTreeSetNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionTreeSetNosubsWithG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionTroveHashMapNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionVectorNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/subs/TestStoreCollectionTreeMapSubsNoG.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PHashMapEntrySet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PHashMapKeySet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/tree/TreeSupport.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/service/rel400/ServiceRel400Tests.java
Added Paths:
-----------
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/MethodId.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/CheckMethodListener.java
trunk/joafip/src/test/java/net/sf/joafip/entity/rel400/Element.java
trunk/joafip/src/test/java/net/sf/joafip/entity/rel400/ElementKo.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestPHashMapNewInstance.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestPrivateAccess.java
Removed Paths:
-------------
trunk/joafip/doc/current.txt
trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/CheckMethodListener.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2011-10-29 16:17:43
|
Revision: 2951
http://joafip.svn.sourceforge.net/joafip/?rev=2951&view=rev
Author: luc_peuvrier
Date: 2011-10-29 16:17:34 +0000 (Sat, 29 Oct 2011)
Log Message:
-----------
add byte code check for prsistence constraints
Modified Paths:
--------------
trunk/joafip/doc/_todo.txt
trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java
trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfo.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfoAttributes.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNode.java
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeMethod.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/CheckMethodVisitor.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/ClassConstraintChecker.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/ICheckMethodListener.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/OpcodeInterpreter.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/classinfo/ClassInfoFactory.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/classinfo/IClassInfoFactory.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/ProxyManager2.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/AbstractTestObjectReferenceLink.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/StoreForTest.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/proxy/ForTestCheckMethodVisitor.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/bytecode/proxy/TestCheckMethodVisitor.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionArrayListNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionHashMapNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionHashSetNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionHashSetNosubsWithG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionHashTableNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionLinkedHashSetNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionLinkedHashSetNosubsWithG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionLinkedListNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionTreeMapNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionTreeSetNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionTreeSetNosubsWithG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionTroveHashMapNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/nosubs/TestStoreCollectionVectorNosubsNoG.java
trunk/joafip/src/test/java/net/sf/joafip/store/service/collection/subs/TestStoreCollectionTreeMapSubsNoG.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PHashMapEntrySet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/PHashMapKeySet.java
trunk/joafip-collection/src/main/java/net/sf/joafip/java/util/support/tree/TreeSupport.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/InErrorTests.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/service/rel400/ServiceRel400Tests.java
Added Paths:
-----------
trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/MethodId.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/CheckMethodListener.java
trunk/joafip/src/test/java/net/sf/joafip/entity/rel400/Element.java
trunk/joafip/src/test/java/net/sf/joafip/entity/rel400/ElementKo.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestPHashMapNewInstance.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestPrivateAccess.java
Removed Paths:
-------------
trunk/joafip/doc/current.txt
trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/CheckMethodListener.java
Modified: trunk/joafip/doc/_todo.txt
===================================================================
--- trunk/joafip/doc/_todo.txt 2011-10-28 03:28:45 UTC (rev 2950)
+++ trunk/joafip/doc/_todo.txt 2011-10-29 16:17:34 UTC (rev 2951)
@@ -80,7 +80,8 @@
persistence constraint check at enhancement for proxy creation
==> update http://joafip.sourceforge.net/presentation/ppojo.html#prules
- check done at enhancement -> exception
-- private are intercepted, correct the doc
+-- check direct field access
+-- check private method invocation
upgrade Maven plugins :
maven-jar-plugin ..................................... 2.3.1 -> 2.3.2
Deleted: trunk/joafip/doc/current.txt
===================================================================
--- trunk/joafip/doc/current.txt 2011-10-28 03:28:45 UTC (rev 2950)
+++ trunk/joafip/doc/current.txt 2011-10-29 16:17:34 UTC (rev 2951)
@@ -1,7 +0,0 @@
-108738, 118200, 132948, 142808, 165872
-
- 1 1010 1000 1100 0010
- 1 1100 1101 1011 1000
- 10 0000 0111 0101 0100
-1 0100 0010 1000 0000 1000
- 10 1000 0111 1111 0000
\ No newline at end of file
Modified: trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java 2011-10-28 03:28:45 UTC (rev 2950)
+++ trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java 2011-10-29 16:17:34 UTC (rev 2951)
@@ -650,19 +650,19 @@
}
@Override
- public void addNotCheckedMethod(final Method method) {
- store.addNotCheckedMethod(method);
+ public void addToNotCheckMethod(final Method method) {
+ store.addToNotCheckMethod(method);
}
@Override
- public void addNotCheckedMethod(final Constructor<?> constructor) {
- store.addNotCheckedMethod(constructor);
+ public void addToNotCheckMethod(final Constructor<?> constructor) {
+ store.addToNotCheckMethod(constructor);
}
@Override
- public void addNotCheckedMethod(final String objectClassName,
+ public void addToNotCheckMethod(final String objectClassName,
final String absoluteMethodName) {
- store.addNotCheckedMethod(objectClassName, absoluteMethodName);
+ store.addToNotCheckMethod(objectClassName, absoluteMethodName);
}
@Override
Modified: trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java 2011-10-28 03:28:45 UTC (rev 2950)
+++ trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java 2011-10-29 16:17:34 UTC (rev 2951)
@@ -613,11 +613,11 @@
*/
void setForceEnhance(String[] objectClassNames);
- void addNotCheckedMethod(Method method);
+ void addToNotCheckMethod(Method method);
- void addNotCheckedMethod(Constructor<?> constructor);
+ void addToNotCheckMethod(Constructor<?> constructor);
- void addNotCheckedMethod(String objectClassName, String absoluteMethodName);
+ void addToNotCheckMethod(String objectClassName, String absoluteMethodName);
/**
* set object input output manager for a class<br>
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfo.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfo.java 2011-10-28 03:28:45 UTC (rev 2950)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfo.java 2011-10-29 16:17:34 UTC (rev 2951)
@@ -270,7 +270,7 @@
private final Exception creationTrace = new Exception("creation trace");
- private final Set<String> notCheckedMethodSet = new TreeSet<String>();
+ private final Set<String> toNotCheckMethodSet = new TreeSet<String>();
private boolean keptInMemory;
@@ -935,8 +935,8 @@
forceEnhance = true;
}
- public void addNotCheckedMethod(final String absoluteMethodName) {
- notCheckedMethodSet.add(absoluteMethodName);
+ public void addToNotCheckMethod(final String absoluteMethodName) {
+ toNotCheckMethodSet.add(absoluteMethodName);
}
public void setSubstituted(final ClassInfo substituteClassInfo,
@@ -981,8 +981,8 @@
return forceEnhance;
}
- public Set<String> getNotCheckedMethod() {
- return notCheckedMethodSet;
+ public Set<String> getToNotCheckMethodSet() {
+ return toNotCheckMethodSet;
}
public boolean isNotStorable() {
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfoAttributes.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfoAttributes.java 2011-10-28 03:28:45 UTC (rev 2950)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/classinfo/ClassInfoAttributes.java 2011-10-29 16:17:34 UTC (rev 2951)
@@ -57,7 +57,7 @@
private boolean forceEnhance;
- private final Set<String> notCheckedMethodSet = new TreeSet<String>();
+ private final Set<String> toNotCheckMethodSet = new TreeSet<String>();
private Class<?> substituteObjectClass;
@@ -141,16 +141,16 @@
forceEnhance = true;
}
- public void addNotCheckedMethod(final String absoluteMethodName) {
- notCheckedMethodSet.add(absoluteMethodName);
+ public void addToNotCheckMethod(final String absoluteMethodName) {
+ toNotCheckMethodSet.add(absoluteMethodName);
}
public boolean isForceEnhance() {
return forceEnhance;
}
- public Set<String> getNotCheckedMethodSet() {
- return notCheckedMethodSet;
+ public Set<String> getToNotCheckMethodSet() {
+ return toNotCheckMethodSet;
}
public void setSubstituteObjectManager(
Added: trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/MethodId.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/MethodId.java (rev 0)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/MethodId.java 2011-10-29 16:17:34 UTC (rev 2951)
@@ -0,0 +1,105 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.store.entity.proxy;
+
+import net.sf.joafip.NotStorableClass;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@NotStorableClass
+public class MethodId implements Comparable<MethodId> {
+
+ private final String methodName;
+
+ private final String desc;
+
+ public MethodId(final String methodName, final String desc) {
+ super();
+ this.methodName = methodName;
+ this.desc = desc;
+ }
+
+ public String getMethodName() {
+ return methodName;
+ }
+
+ public String getDesc() {
+ return desc;
+ }
+
+ @Override
+ public int compareTo(final MethodId other) {
+ int compareTo = methodName.compareTo(other.methodName);
+ if (compareTo == 0) {
+ compareTo = desc.compareTo(other.desc);
+ }
+ return compareTo;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((desc == null) ? 0 : desc.hashCode());
+ result = prime * result
+ + ((methodName == null) ? 0 : methodName.hashCode());
+ return result;
+ }
+
+ @SuppressWarnings("PMD")
+ @Override
+ public boolean equals(Object obj) {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ MethodId other = (MethodId) obj;
+ if (desc == null) {
+ if (other.desc != null)
+ return false;
+ } else if (!desc.equals(other.desc))
+ return false;
+ if (methodName == null) {
+ if (other.methodName != null)
+ return false;
+ } else if (!methodName.equals(other.methodName))
+ return false;
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ final StringBuilder builder = new StringBuilder();
+ builder.append("MethodId [methodName=");
+ builder.append(methodName);
+ builder.append(", desc=");
+ builder.append(desc);
+ builder.append("]");
+ return builder.toString();
+ }
+}
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNode.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNode.java 2011-10-28 03:28:45 UTC (rev 2950)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNode.java 2011-10-29 16:17:34 UTC (rev 2951)
@@ -196,4 +196,8 @@
protected String mnemonic() {
return OPCODE_INTERPRETER.mnemonic(opcode);
}
+
+ public boolean isOwnedMethodCallOfOtherInstance() {
+ return false;
+ }
}
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeMethod.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeMethod.java 2011-10-28 03:28:45 UTC (rev 2950)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/proxy/OpcodeNodeMethod.java 2011-10-29 16:17:34 UTC (rev 2951)
@@ -33,19 +33,57 @@
@NotStorableClass
public class OpcodeNodeMethod extends OpcodeNode {
+ private final String className;
+
+ private final String methodName;
+
private final String desc;
+ private final boolean ownedMethodCall;
+
+ private boolean ownedMethodCallOfOtherInstance;
+
public OpcodeNodeMethod(final int opcode, final int address,
final int lineNumber, final OpcodeNode previousOpcode,
- final String desc) {
+ final boolean ownedMethodCall, final String className,
+ final String methodName, final String desc) {
super(opcode, address, lineNumber, previousOpcode);
+ this.ownedMethodCall = ownedMethodCall;
+ this.className = className;
+ this.methodName = methodName;
this.desc = desc;
}
@Override
protected StackElement interprete(final StackElement currentStackElement)
throws EnhanceException {
- return OPCODE_INTERPRETER.interpreteInvoke(opcode, desc,
- currentStackElement);
+ final StackElement pointer = OPCODE_INTERPRETER.interpreteInvoke(
+ opcode, ownedMethodCall, desc, currentStackElement);
+ if (!OPCODE_INTERPRETER.isInternalCall()) {
+ ownedMethodCallOfOtherInstance = true;
+ }
+ return pointer;
}
+
+ @Override
+ public boolean isOwnedMethodCallOfOtherInstance() {
+ return ownedMethodCallOfOtherInstance;
+ }
+
+ public String getClassName() {
+ return className;
+ }
+
+ public String getMethodName() {
+ return methodName;
+ }
+
+ public String getDesc() {
+ return desc;
+ }
+
+ @Override
+ public String toString() {
+ return super.toString() + " " + methodName + " " + desc;
+ }
}
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java 2011-10-28 03:28:45 UTC (rev 2950)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java 2011-10-29 16:17:34 UTC (rev 2951)
@@ -245,11 +245,11 @@
void setForceEnhance(String objectClassName);
- void addNotCheckedMethod(Method method);
+ void addToNotCheckMethod(Method method);
- void addNotCheckedMethod(Constructor<?> constructor);
+ void addToNotCheckMethod(Constructor<?> constructor);
- void addNotCheckedMethod(String objectClassName, String absoluteMethodName);
+ void addToNotCheckMethod(String objectClassName, String absoluteMethodName);
/**
* set object input output manager for a class<br>
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java 2011-10-28 03:28:45 UTC (rev 2950)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java 2011-10-29 16:17:34 UTC (rev 2951)
@@ -661,36 +661,39 @@
}
}
- public void addNotCheckedMethod(final Class<?> clazz) {
+ public void addToNotCheckMethod(final Class<?> clazz) {
final Constructor<?>[] constructors = clazz.getDeclaredConstructors();
for (Constructor<?> constructor : constructors) {
- addNotCheckedMethod(constructor);
+ addToNotCheckMethod(constructor);
}
final Method[] methods = clazz.getDeclaredMethods();
for (Method method : methods) {
- addNotCheckedMethod(method);
+ addToNotCheckMethod(method);
}
}
- public void addNotCheckedMethod(final Method method) {
+ @Override
+ public void addToNotCheckMethod(final Method method) {
final String className = method.getDeclaringClass().getName();
final String methodName = method.getName();
final String methodDescriptor = Type.getMethodDescriptor(method);
- addNotCheckedMethod(className, className + "#" + methodName
+ addToNotCheckMethod(className, className + "#" + methodName
+ methodDescriptor);
}
- public void addNotCheckedMethod(final Constructor<?> constructor) {
+ @Override
+ public void addToNotCheckMethod(final Constructor<?> constructor) {
final String className = constructor.getDeclaringClass().getName();
final String methodDescriptor = Type
.getConstructorDescriptor(constructor);
- addNotCheckedMethod(className, className + "#<init>" + methodDescriptor);
+ addToNotCheckMethod(className, className + "#<init>" + methodDescriptor);
}
- public void addNotCheckedMethod(final String objectClassName,
+ @Override
+ public void addToNotCheckMethod(final String objectClassName,
final String absoluteMethodName) {
synchronized (mutex) {
- classInfoFactory.addNotCheckedMethod(objectClassName,
+ classInfoFactory.addToNotCheckMethod(objectClassName,
absoluteMethodName);
}
}
Copied: trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/CheckMethodListener.java (from rev 2947, trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/CheckMethodListener.java)
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/CheckMethodListener.java (rev 0)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/CheckMethodListener.java 2011-10-29 16:17:34 UTC (rev 2951)
@@ -0,0 +1,151 @@
+/*
+ * Copyright 2011 Luc Peuvrier
+ *
+ * This file is a part of JOAFIP.
+ *
+ * JOAFIP is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License.
+ *
+ * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
+ * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.gnu.org/licenses/lgpl.html
+ *
+ * JOAFIP is distributed in the hope that it will be useful, but
+ * unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package net.sf.joafip.store.service.bytecode.proxy;
+
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.TreeSet;
+
+import net.sf.joafip.NotStorableClass;
+import net.sf.joafip.store.entity.proxy.DirectAccessInfo;
+import net.sf.joafip.store.entity.proxy.MethodId;
+import net.sf.joafip.store.entity.proxy.OpcodeNode;
+import net.sf.joafip.store.entity.proxy.OpcodeNodeMethod;
+
+/**
+ *
+ * @author luc peuvrier
+ *
+ */
+@NotStorableClass
+public class CheckMethodListener implements ICheckMethodListener {
+
+ private final Set<DirectAccessInfo> directAccessSet = new TreeSet<DirectAccessInfo>();
+
+ private final Map<String, List<OpcodeNode>> codeOfMethod = new TreeMap<String, List<OpcodeNode>>();
+
+ private final Set<String> fullyVisitedMethodSet = new TreeSet<String>();
+
+ private final List<OpcodeNodeMethod> ownedMethodCallOfOtherInstanceList = new LinkedList<OpcodeNodeMethod>();
+
+ private final Set<MethodId> privateMethodSet = new TreeSet<MethodId>();
+
+ private transient List<OpcodeNode> opcodeList;
+
+ @Override
+ public void directAccess(final DirectAccessInfo directAccessInfo) {
+ directAccessSet.add(directAccessInfo);
+ }
+
+ public boolean hasDirectAccess() {
+ return true ^ directAccessSet.isEmpty();
+ }
+
+ public Set<DirectAccessInfo> getDirectAccessSet() {
+ return directAccessSet;
+ }
+
+ @Override
+ public void beginVisit(final String methodAbsoluteName) {
+ opcodeList = new LinkedList<OpcodeNode>();
+ codeOfMethod.put(methodAbsoluteName, opcodeList);
+ }
+
+ @Override
+ public void currentOpcode(final OpcodeNode currentOpcodeNode) {
+ opcodeList.add(currentOpcodeNode);
+ }
+
+ @Override
+ public void codeVisisted(final String methodAbsoluteName) {
+ fullyVisitedMethodSet.add(methodAbsoluteName);
+ }
+
+ @Override
+ public void endVisit(final String methodAbsoluteName) {
+ // no implementation
+ }
+
+ @Override
+ public void addOwnedMethodCallOfOtherInstance(
+ final OpcodeNodeMethod currentOpcodeNode) {
+ ownedMethodCallOfOtherInstanceList.add(currentOpcodeNode);
+ }
+
+ public void addPrivateMethodName(final String methodName, final String desc) {
+ privateMethodSet.add(new MethodId(methodName, desc));
+ }
+
+ public List<OpcodeNodeMethod> getOtherInstancePrivateCallList() {
+ final List<OpcodeNodeMethod> list = new LinkedList<OpcodeNodeMethod>();
+ for (OpcodeNodeMethod opcodeNodeMethod : ownedMethodCallOfOtherInstanceList) {
+ final MethodId key =
+ /**/new MethodId(opcodeNodeMethod.getMethodName(),// NOPMD
+ opcodeNodeMethod.getDesc());
+ if (privateMethodSet.contains(key)) {
+ list.add(opcodeNodeMethod);
+ }
+ }
+ return list;
+ }
+
+ @Override
+ public String unassembled(final String methodAbsoluteName) {
+ final StringBuilder stringBuilder = new StringBuilder();
+ final List<OpcodeNode> list = codeOfMethod.get(methodAbsoluteName);
+ unassembled(methodAbsoluteName, list, stringBuilder);
+ return stringBuilder.toString();
+ }
+
+ public String unassembled() {
+ final StringBuilder stringBuilder = new StringBuilder();
+ for (Map.Entry<String, List<OpcodeNode>> entry : codeOfMethod
+ .entrySet()) {
+ final String methodAbsoluteName = entry.getKey();
+ final List<OpcodeNode> list = entry.getValue();
+ unassembled(methodAbsoluteName, list, stringBuilder);
+ }
+ return stringBuilder.toString();
+ }
+
+ private void unassembled(final String methodAbsoluteName,
+ final List<OpcodeNode> list, final StringBuilder stringBuilder) {
+ stringBuilder.append(methodAbsoluteName);
+ stringBuilder.append('\n');
+ if (list == null) {
+ stringBuilder.append("has not the code ...");
+ } else {
+ for (OpcodeNode opcodeNode : list) {
+ stringBuilder.append(opcodeNode.toString());
+ stringBuilder.append('\n');
+ }
+ if (!fullyVisitedMethodSet.contains(methodAbsoluteName)) {
+ stringBuilder.append("ending code not available\n");
+ }
+ }
+ stringBuilder.append('\n');
+ }
+}
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/CheckMethodVisitor.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/CheckMethodVisitor.java 2011-10-28 03:28:45 UTC (rev 2950)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/CheckMethodVisitor.java 2011-10-29 16:17:34 UTC (rev 2951)
@@ -90,12 +90,15 @@
private transient Set<Label> handlerEntrySet;
+ private final String className;
+
private final String methodAbsoluteName;
public CheckMethodVisitor(final ICheckMethodListener listener,
- final String methodAbsoluteName) {
+ final String className, final String methodAbsoluteName) {
super();
this.listener = listener;
+ this.className = className;
this.methodAbsoluteName = methodAbsoluteName;
}
@@ -169,7 +172,9 @@
listener.currentOpcode(currentOpcodeNode);
currentOpcodeNode.setBeforeExecutionStackElement(stackElement);
stackElement = currentOpcodeNode.interprete();
-
+ if (currentOpcodeNode.isOwnedMethodCallOfOtherInstance()) {
+ listener.addOwnedMethodCallOfOtherInstance((OpcodeNodeMethod) currentOpcodeNode);
+ }
if (currentOpcodeNode.isDirectAccess()) {
notifyDirectAccess(currentOpcodeNode);
}
@@ -287,8 +292,11 @@
@Override
public void visitMethodInsn(final int opcode, final String owner,
final String name, final String desc) {
+ final boolean ownedMethodCall = owner.replace('/', '.').equals(
+ className);
currentOpcodeNode = new OpcodeNodeMethod(opcode, currentAddress++,
- currentLineNumber, currentOpcodeNode, desc);
+ currentLineNumber, currentOpcodeNode, ownedMethodCall,
+ className, name, desc);
opcodeByLabelUpdate();
}
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/ClassConstraintChecker.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/ClassConstraintChecker.java 2011-10-28 03:28:45 UTC (rev 2950)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/bytecode/proxy/ClassConstraintChecker.java 2011-10-29 16:17:34 UTC (rev 2951)
@@ -25,6 +25,7 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
+import java.util.List;
import java.util.Set;
import java.util.TreeSet;
@@ -38,10 +39,10 @@
import net.sf.joafip.asm.Opcodes;
import net.sf.joafip.service.ClassLoaderProvider;
import net.sf.joafip.store.entity.proxy.DirectAccessInfo;
+import net.sf.joafip.store.entity.proxy.OpcodeNodeMethod;
import net.sf.joafip.store.service.bytecode.EnhanceException;
import net.sf.joafip.store.service.classinfo.ClassInfoException;
import net.sf.joafip.store.service.classinfo.ClassInfoFactory;
-import net.sf.joafip.store.service.proxy.CheckMethodListener;
/**
*
@@ -61,7 +62,7 @@
private transient CheckMethodListener checkMethodListener;
- private transient Set<String> notCheckedMethod;
+ private transient Set<String> toNotCheckMethodSet;
public static ClassConstraintChecker getInstance() {
return INSTANCE;
@@ -86,8 +87,8 @@
while (currentClassName != null && checkedSet.add(currentClassName)) {
// while (!Object.class.getName().equals(currentClassName)) {
try {
- notCheckedMethod = classInfoFactory
- .getNotCheckedMethod(currentClassName);
+ toNotCheckMethodSet = classInfoFactory
+ .getToNotCheckMethodSet(currentClassName);
checkCurrentClass();
currentClassName = classInfoFactory
.superClassName(currentClassName);
@@ -97,27 +98,48 @@
throw new EnhanceException(exception);
}
}
- if (checkMethodListener.hasDirectAccess()) {
+
+ final List<OpcodeNodeMethod> list = checkMethodListener
+ .getOtherInstancePrivateCallList();
+ if (checkMethodListener.hasDirectAccess() || !list.isEmpty()) {
final StringBuilder stringBuilder = new StringBuilder();
- stringBuilder.append("direct field access:\n");
- // String previousMethodAbsoluteName = null;
- for (DirectAccessInfo directAccessInfo : checkMethodListener
- .getDirectAccessSet()) {
- stringBuilder.append(directAccessInfo.toString());
+ stringBuilder.append('\n');
+ if (!list.isEmpty()) {
+ stringBuilder.append("private method call:\n");
+ for (OpcodeNodeMethod opcodeNodeMethod : list) {
+ stringBuilder.append(opcodeNodeMethod.getClassName());
+ stringBuilder.append('#');
+ stringBuilder.append(opcodeNodeMethod.getMethodName());
+ stringBuilder.append(' ');
+ stringBuilder.append(opcodeNodeMethod.getDesc());
+ stringBuilder.append(" line ");
+ stringBuilder.append(opcodeNodeMethod.getLineNumber());
+ stringBuilder.append('\n');
+ }
+ }
+
+ if (checkMethodListener.hasDirectAccess()) {
+ stringBuilder.append("direct field access:\n");
+ // String previousMethodAbsoluteName = null;
+ for (DirectAccessInfo directAccessInfo : checkMethodListener
+ .getDirectAccessSet()) {
+ stringBuilder.append(directAccessInfo.toString());
+ stringBuilder.append('\n');
+ // if (previousMethodAbsoluteName != null
+ // && !previousMethodAbsoluteName.equals(directAccessInfo
+ // .getMethodAbsoluteName())) {
+ // stringBuilder.append(checkMethodListener
+ // .unassembled(directAccessInfo
+ // .getMethodAbsoluteName()));
+ // }
+ // previousMethodAbsoluteName = directAccessInfo
+ // .getMethodAbsoluteName();
+ }
+ // stringBuilder.append(checkMethodListener
+ // .unassem...
[truncated message content] |
|
From: <luc...@us...> - 2011-10-29 20:06:19
|
Revision: 2953
http://joafip.svn.sourceforge.net/joafip/?rev=2953&view=rev
Author: luc_peuvrier
Date: 2011-10-29 20:06:13 +0000 (Sat, 29 Oct 2011)
Log Message:
-----------
do not write data record if data does not change
added toNotCheckMethod(Class<?> clazz) to IFilePersistence
Modified Paths:
--------------
trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java
trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceSetupByProperties.java
trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/service/HeapFileDataManager.java
trunk/joafip-rbtree/src/main/java/net/sf/joafip/redblacktree/service/RedBlackTree.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2011-10-29 20:06:19
|
Revision: 2953
http://joafip.svn.sourceforge.net/joafip/?rev=2953&view=rev
Author: luc_peuvrier
Date: 2011-10-29 20:06:13 +0000 (Sat, 29 Oct 2011)
Log Message:
-----------
do not write data record if data does not change
added toNotCheckMethod(Class<?> clazz) to IFilePersistence
Modified Paths:
--------------
trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java
trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java
trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceSetupByProperties.java
trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/service/HeapFileDataManager.java
trunk/joafip-rbtree/src/main/java/net/sf/joafip/redblacktree/service/RedBlackTree.java
Modified: trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java 2011-10-29 16:24:23 UTC (rev 2952)
+++ trunk/joafip/src/main/java/net/sf/joafip/service/AbstractFilePersistenceDelegatingToStore.java 2011-10-29 20:06:13 UTC (rev 2953)
@@ -650,6 +650,11 @@
}
@Override
+ public void addToNotCheckMethod(final Class<?> clazz) {
+ store.addToNotCheckMethod(clazz);
+ }
+
+ @Override
public void addToNotCheckMethod(final Method method) {
store.addToNotCheckMethod(method);
}
Modified: trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java 2011-10-29 16:24:23 UTC (rev 2952)
+++ trunk/joafip/src/main/java/net/sf/joafip/service/IFilePersistence.java 2011-10-29 20:06:13 UTC (rev 2953)
@@ -613,6 +613,8 @@
*/
void setForceEnhance(String[] objectClassNames);
+ void addToNotCheckMethod(Class<?> clazz);
+
void addToNotCheckMethod(Method method);
void addToNotCheckMethod(Constructor<?> constructor);
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java 2011-10-29 16:24:23 UTC (rev 2952)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/IStore.java 2011-10-29 20:06:13 UTC (rev 2953)
@@ -245,6 +245,8 @@
void setForceEnhance(String objectClassName);
+ void addToNotCheckMethod(Class<?> clazz);
+
void addToNotCheckMethod(Method method);
void addToNotCheckMethod(Constructor<?> constructor);
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java 2011-10-29 16:24:23 UTC (rev 2952)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/Store.java 2011-10-29 20:06:13 UTC (rev 2953)
@@ -661,6 +661,7 @@
}
}
+ @Override
public void addToNotCheckMethod(final Class<?> clazz) {
final Constructor<?>[] constructors = clazz.getDeclaredConstructors();
for (Constructor<?> constructor : constructors) {
Modified: trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceSetupByProperties.java
===================================================================
--- trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceSetupByProperties.java 2011-10-29 16:24:23 UTC (rev 2952)
+++ trunk/joafip/src/test/java/net/sf/joafip/service/TestFilePersistenceSetupByProperties.java 2011-10-29 20:06:13 UTC (rev 2953)
@@ -73,6 +73,7 @@
}
filePersistence = new FilePersistence(
"net/sf/joafip/service/joafip_for_test.properties", true);
+ filePersistence.addToNotCheckMethod(Bob1.class);
session = filePersistence.createDataAccessSession();
// Logger.getLogger(ProxyCallBackInterceptEnd.class).setLevel(Level.DEBUG);
// Logger.getLogger(StoreSaver3.class).setLevel(Level.DEBUG);
Modified: trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/service/HeapFileDataManager.java
===================================================================
--- trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/service/HeapFileDataManager.java 2011-10-29 16:24:23 UTC (rev 2952)
+++ trunk/joafip-heapfile/src/main/java/net/sf/joafip/heapfile/service/HeapFileDataManager.java 2011-10-29 20:06:13 UTC (rev 2953)
@@ -18,6 +18,7 @@
import java.io.File;
import java.io.FilenameFilter;
+import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
@@ -238,16 +239,20 @@
created = true;
heapRecord = createHeapRecordForData(data.length,
dataRecordIdentifier);
+ heapRecord.setDataAssociated(data);
} else {
created = false;
- // FIXMELUC ___________data not change case
- if (data.length != heapRecord.getDataAssociatedSize()) {
+ if (data.length == heapRecord.getDataAssociatedSize()) {
+ if (!Arrays.equals(data, heapRecord.getDataAssociated())) {
+ heapRecord.setDataAssociated(data);
+ }
+ } else {
deleteDataRecord(dataRecordIdentifier);
heapRecord = createHeapRecordForData(data.length,
dataRecordIdentifier);
+ heapRecord.setDataAssociated(data);
}
}
- heapRecord.setDataAssociated(data);
if (logger.debugEnabled) {
logger.debug("create heap record #" + dataRecordIdentifier
+ FOR_DATA_SIZE + data.length);
Modified: trunk/joafip-rbtree/src/main/java/net/sf/joafip/redblacktree/service/RedBlackTree.java
===================================================================
--- trunk/joafip-rbtree/src/main/java/net/sf/joafip/redblacktree/service/RedBlackTree.java 2011-10-29 16:24:23 UTC (rev 2952)
+++ trunk/joafip-rbtree/src/main/java/net/sf/joafip/redblacktree/service/RedBlackTree.java 2011-10-29 20:06:13 UTC (rev 2953)
@@ -1003,7 +1003,8 @@
public void deleteExistingNode(final IRBTNode<E> nodeToDelete)
throws RBTException {
// ASSERTX
- assert isNodeAttachedToTree(nodeToDelete) : "node to delete must be attached to the tree";
+ assert isNodeAttachedToTree(nodeToDelete) : "node to delete must be attached to the tree "
+ + nodeToDelete.getClass().getName();
rootNode = nodeManager.getRootNode();
privateDeleteExistingNode(nodeToDelete);
nodeManager.setRootNode(rootNode);
@@ -1308,7 +1309,8 @@
public int index(final IRBTNode<E> node) throws RBTException {
assertManageNodeIndex();
// ASSERTX
- assert isNodeAttachedToTree(node) : "node must be attached to the tree";
+ assert isNodeAttachedToTree(node) : "node must be attached to the tree "
+ + node.getClass().getName();
int index;
IRBTNode<E> current = node;
if (current.isSentinel()) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2011-10-30 03:34:35
|
Revision: 2955
http://joafip.svn.sourceforge.net/joafip/?rev=2955&view=rev
Author: luc_peuvrier
Date: 2011-10-30 03:34:28 +0000 (Sun, 30 Oct 2011)
Log Message:
-----------
fix done, no more NullProxyCallBack
Modified Paths:
--------------
trunk/joafip/src/main/java/net/sf/joafip/store/entity/objectio/ObjectAndPersistInfo.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/ProxyManager2.java
trunk/joafip-4test/src/main/java/net/sf/joafip/store/service/bytecode/SuperExternalizableExtend.java
trunk/joafip-4test/src/main/java/net/sf/joafip/store/service/bytecode/SuperSerializableExtend.java
trunk/joafip-4test/src/main/java/net/sf/joafip/store/service/bytecode/UsingNullProxyCallBack.java
Removed Paths:
-------------
trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/NullProxyCallBack.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2011-10-30 03:34:35
|
Revision: 2955
http://joafip.svn.sourceforge.net/joafip/?rev=2955&view=rev
Author: luc_peuvrier
Date: 2011-10-30 03:34:28 +0000 (Sun, 30 Oct 2011)
Log Message:
-----------
fix done, no more NullProxyCallBack
Modified Paths:
--------------
trunk/joafip/src/main/java/net/sf/joafip/store/entity/objectio/ObjectAndPersistInfo.java
trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/ProxyManager2.java
trunk/joafip-4test/src/main/java/net/sf/joafip/store/service/bytecode/SuperExternalizableExtend.java
trunk/joafip-4test/src/main/java/net/sf/joafip/store/service/bytecode/SuperSerializableExtend.java
trunk/joafip-4test/src/main/java/net/sf/joafip/store/service/bytecode/UsingNullProxyCallBack.java
Removed Paths:
-------------
trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/NullProxyCallBack.java
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/entity/objectio/ObjectAndPersistInfo.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/entity/objectio/ObjectAndPersistInfo.java 2011-10-30 03:09:09 UTC (rev 2954)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/entity/objectio/ObjectAndPersistInfo.java 2011-10-30 03:34:28 UTC (rev 2955)
@@ -41,7 +41,6 @@
import net.sf.joafip.store.service.objectio.ObjectIOInvalidClassException;
import net.sf.joafip.store.service.proxy.IProxyCallBackProxyDelegation;
import net.sf.joafip.store.service.proxy.IProxyCallBackToImplement;
-import net.sf.joafip.store.service.proxy.NullProxyCallBack;
import net.sf.joafip.store.service.proxy.ProxyManager2;
/**
@@ -52,9 +51,6 @@
@NotStorableClass
public class ObjectAndPersistInfo extends ObjectAndItsClassInfo {
- private static final NullProxyCallBack NULL_PROXY_CALL_BACK_INSTANCE = NullProxyCallBack
- .getInstance();
-
private static final ObjectClassInfoAndDeclared[] NO_WROTE_OBJECTS =
/**/new ObjectClassInfoAndDeclared[0];
@@ -125,7 +121,7 @@
public FieldInfo[] fieldToSetInfo;
- private IProxyCallBackToImplement proxyCallBack = NULL_PROXY_CALL_BACK_INSTANCE;
+ private IProxyCallBackToImplement proxyCallBack;
private final boolean proxyIntanceOrEnhanced;
Deleted: trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/NullProxyCallBack.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/NullProxyCallBack.java 2011-10-30 03:09:09 UTC (rev 2954)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/NullProxyCallBack.java 2011-10-30 03:34:28 UTC (rev 2955)
@@ -1,201 +0,0 @@
-/*
- * Copyright 2009 Luc Peuvrier
- *
- * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE
- * Licensed under the LGPL License, Version 3, 29 June 2007 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.gnu.org/licenses/lgpl.html
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package net.sf.joafip.store.service.proxy;
-
-import net.sf.joafip.NotStorableClass;
-import net.sf.joafip.store.entity.objectio.ObjectAndPersistInfo;
-import net.sf.joafip.store.service.classinfo.ClassInfoFactory;
-import net.sf.joafip.store.service.objectio.ObjectIOClassNotFoundException;
-import net.sf.joafip.store.service.objectio.ObjectIODataCorruptedException;
-import net.sf.joafip.store.service.objectio.ObjectIODataRecordNotFoundException;
-import net.sf.joafip.store.service.objectio.ObjectIOException;
-import net.sf.joafip.store.service.objectio.ObjectIOInvalidClassException;
-import net.sf.joafip.store.service.objectio.ObjectIONotSerializableException;
-import net.sf.joafip.store.service.objectio.manager.IObjectIOManagerForProxyObjectIO;
-
-/**
- *
- * @author luc peuvrier
- *
- */
-@NotStorableClass
-public final class NullProxyCallBack implements IProxyCallBack,
- IProxyCallBackToImplement {
-
- public static final NullProxyCallBack INSTANCE =
- /**/new NullProxyCallBack();
-
- private NullProxyCallBack() {
- super();
- }
-
- public static NullProxyCallBack getInstance() {
- return INSTANCE;
- }
-
- @Override
- @SuppressWarnings("PMD")
- public void initialize$JOAFIP$(IProxyCallBackToImplement proxyCallBack)
- throws ProxyException {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void initializeFileAccessSessionIdentifier(
- final IObjectIOManagerForProxyObjectIO objectIOManager) {
- throw new UnsupportedOperationException();
- // do nothing
- }
-
- @Override
- @SuppressWarnings("PMD")
- public void intercept$JOAFIP$() {
- // FIXMELUC ___call when proxied construct, construct not need
- // interception
- // throw new UnsupportedOperationException();
- // do nothing
- }
-
- @SuppressWarnings("PMD")
- @Override
- public void constructorEnd$JOAFIP$() {
- // no implementation
- }
-
- @Override
- @SuppressWarnings("PMD")
- public void methodEnd$JOAFIP$() {
- // FIXMELUC ___call when proxied construct, construct not need
- // interception
- // throw new UnsupportedOperationException();
- // do nothing
- }
-
- @Override
- @SuppressWarnings("PMD")
- public boolean isLoaded$JOAFIP$() {
- throw new UnsupportedOperationException();
- // not loaded also means not construct
- // return false;
- }
-
- @Override
- @SuppressWarnings("PMD")
- public void forceLoad$JOAFIP$() throws ObjectIOException,
- ObjectIODataRecordNotFoundException, ObjectIOInvalidClassException,
- ObjectIOClassNotFoundException, ObjectIODataCorruptedException,
- ObjectIONotSerializableException {
- // do nothing
- throw new UnsupportedOperationException();
- }
-
- @Override
- @SuppressWarnings("PMD")
- public void unload$JOAFIP$() {
- // do nothing
- throw new UnsupportedOperationException();
- }
-
- @Override
- @SuppressWarnings("PMD")
- public long getMyFileAccessSessionIdentifier$JOAFIP$() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- @SuppressWarnings("PMD")
- public void setIsLoaded$JOAFIP$() throws ObjectIOException {
- throw new UnsupportedOperationException();
- }
-
- @SuppressWarnings("PMD")
- @Override
- public void setIsLoadedNoSave$JOAFIP$() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- @SuppressWarnings("PMD")
- public void setLoading$JOAFIP$(final boolean loading) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- @SuppressWarnings("PMD")
- public IObjectIOManagerForProxyObjectIO getObjectIOManager$JOAFIP$() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- @SuppressWarnings("PMD")
- public ClassInfoFactory getClassInfoFactory$JOAFIP$() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- @SuppressWarnings("PMD")
- public void setInstance$JOAFIP$(
- final ObjectAndPersistInfo objectAndPersistInfo) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- @SuppressWarnings("PMD")
- public ObjectAndPersistInfo getInstance$JOAFIP$() {
- throw new UnsupportedOperationException();
- // return null;
- }
-
- @Override
- public IProxyCallBackToImplement getProxyCallBack$JOAFIP$() {// NOPMD
- return this;
- }
-
- @Override
- @SuppressWarnings("PMD")
- public void setProxyCallBack$JOAFIP$(
- final IProxyCallBackToImplement proxyCallBack) {
- // no implementation
- throw new UnsupportedOperationException();
- }
-
- // @Override
- // @SuppressWarnings("PMD")
- // public Exception getLoadTrace$JOAFIP$() {
- // // no implementation
- // return null;
- // }
-
- // @Override
- // @SuppressWarnings("PMD")
- // public Exception getUnloadTrace$JOAFIP$() {
- // // no implementation
- // return null;
- // }
-
- @Override
- @SuppressWarnings("PMD")
- public int getInObjectCount$JOAFIP$() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- @SuppressWarnings("PMD")
- public boolean isAutoSaveEnabled$JOAFIP$() {
- throw new UnsupportedOperationException();
- }
-}
Modified: trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/ProxyManager2.java
===================================================================
--- trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/ProxyManager2.java 2011-10-30 03:09:09 UTC (rev 2954)
+++ trunk/joafip/src/main/java/net/sf/joafip/store/service/proxy/ProxyManager2.java 2011-10-30 03:34:28 UTC (rev 2955)
@@ -48,9 +48,6 @@
@NotStorableClass
public final class ProxyManager2 implements IProxyManagerForObjectIO {
- private static final NullProxyCallBack NULL_PROXY_CALL_BACK_INSTANCE = NullProxyCallBack
- .getInstance();
-
private static final String NO_OBJECT_CLASS =
/**/"object class information is not defined: error proxy call back is not setted for ";
@@ -279,7 +276,6 @@
objectAndPersistInfo.setStorageInfo(storageInfo);
if (constructed) {
- assert getProxyCallBack(instanceCreated) != NULL_PROXY_CALL_BACK_INSTANCE;
assert objectAndPersistInfo.isNotWeak();
objectAndPersistInfo.setIsLoaded();
}
@@ -592,8 +588,7 @@
final Object object) {
final IProxyCallBackToImplement proxyCallBack = getProxyCallBack(object);
final ObjectAndPersistInfo objectAndPersistInfo;
- if (proxyCallBack == null
- || proxyCallBack == NULL_PROXY_CALL_BACK_INSTANCE) {// NOPMD
+ if (proxyCallBack == null) {
objectAndPersistInfo = null;
} else {
objectAndPersistInfo = proxyCallBack.getInstance$JOAFIP$();
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/store/service/bytecode/SuperExternalizableExtend.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/store/service/bytecode/SuperExternalizableExtend.java 2011-10-30 03:09:09 UTC (rev 2954)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/store/service/bytecode/SuperExternalizableExtend.java 2011-10-30 03:34:28 UTC (rev 2955)
@@ -4,19 +4,16 @@
import java.io.ObjectInput;
import net.sf.joafip.store.service.proxy.IProxyCallBackProxyDelegation;
-import net.sf.joafip.store.service.proxy.NullProxyCallBack;
@SuppressWarnings("PMD")
public class SuperExternalizableExtend extends SuperExternalizable {
+ @SuppressWarnings("unused")
private IProxyCallBackProxyDelegation $proxyCallBack$;// NOPMD
@Override
public void readExternal(final ObjectInput in) throws IOException,
ClassNotFoundException {
- if ($proxyCallBack$ == null) {
- $proxyCallBack$ = NullProxyCallBack.INSTANCE;
- }
super.readExternal(in);
}
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/store/service/bytecode/SuperSerializableExtend.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/store/service/bytecode/SuperSerializableExtend.java 2011-10-30 03:09:09 UTC (rev 2954)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/store/service/bytecode/SuperSerializableExtend.java 2011-10-30 03:34:28 UTC (rev 2955)
@@ -4,7 +4,6 @@
import java.io.ObjectInputStream;
import net.sf.joafip.store.service.proxy.IProxyCallBackProxyDelegation;
-import net.sf.joafip.store.service.proxy.NullProxyCallBack;
@SuppressWarnings("PMD")
public class SuperSerializableExtend extends SuperSerializable {
@@ -14,14 +13,12 @@
*/
private static final long serialVersionUID = -5560800790933799145L;
+ @SuppressWarnings("unused")
private IProxyCallBackProxyDelegation $proxyCallBack$;// NOPMD
@Override
protected void readObject(final ObjectInputStream in) throws IOException,
ClassNotFoundException {
- if ($proxyCallBack$ == null) {
- $proxyCallBack$ = NullProxyCallBack.INSTANCE;
- }
super.readObject(in);
}
Modified: trunk/joafip-4test/src/main/java/net/sf/joafip/store/service/bytecode/UsingNullProxyCallBack.java
===================================================================
--- trunk/joafip-4test/src/main/java/net/sf/joafip/store/service/bytecode/UsingNullProxyCallBack.java 2011-10-30 03:09:09 UTC (rev 2954)
+++ trunk/joafip-4test/src/main/java/net/sf/joafip/store/service/bytecode/UsingNullProxyCallBack.java 2011-10-30 03:34:28 UTC (rev 2955)
@@ -1,12 +1,11 @@
package net.sf.joafip.store.service.bytecode;
import net.sf.joafip.store.service.proxy.IProxyCallBack;
-import net.sf.joafip.store.service.proxy.NullProxyCallBack;
@SuppressWarnings("PMD")
public class UsingNullProxyCallBack {
- IProxyCallBack proxyCallBack = NullProxyCallBack.INSTANCE;
+ IProxyCallBack proxyCallBack;
public UsingNullProxyCallBack() {// NOPMD
super();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <luc...@us...> - 2011-11-18 02:52:33
|
Revision: 2970
http://joafip.svn.sourceforge.net/joafip/?rev=2970&view=rev
Author: luc_peuvrier
Date: 2011-11-18 02:52:27 +0000 (Fri, 18 Nov 2011)
Log Message:
-----------
error in xml value import reading corrected
Modified Paths:
--------------
trunk/joafip/doc/_todo.txt
trunk/joafip/doc/missing.txt
trunk/joafip/src/main/java/net/sf/joafip/store/service/export_import/in/InValueHandler.java
trunk/joafip/src/test/java/net/sf/joafip/entity/rel400/Item.java
trunk/joafip/src/test/java/net/sf/joafip/service/rel400/TestEnumMap.java
trunk/joafip-4test/src/main/java/net/sf/joafip/asm/MainAsmForNewProxyCallBack.java
trunk/joafip-4test/src/main/java/net/sf/joafip/asm/NewProxyCallBack.java
trunk/joafip-4test/src/main/java/net/sf/joafip/bugtree/MainTreeBlockFile.java
trunk/joafip-4test/src/main/java/net/sf/joafip/bugtree/MainTreeDual.java
trunk/joafip-4test/src/main/java/net/sf/joafip/bugtree/MainTreeMultiFile.java
trunk/joafip-4test/src/main/java/net/sf/joafip/bugtree/TreeMem.java
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/AbstractSearcher.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/PersistanceTestsNoLongTests.java
Added Paths:
-----------
trunk/joafip/src/test/java/net/sf/joafip/util/TestXmlWriter.java
trunk/joafip-testsuite/src/main/java/net/sf/joafip/util/
trunk/joafip-testsuite/src/main/java/net/sf/joafip/util/UtilTests.java
Removed Paths:
-------------
trunk/joafip-4test/src/main/java/net/sf/joafip/performance/items/service/MainExportScanner.java
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|