Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 197179
Collapse All | Expand All

(-)src/org/eclipse/tptp/platform/analysis/core/history/AnalysisHistory.java (-2 / +29 lines)
Lines 18-24 Link Here
18
import java.util.List;
18
import java.util.List;
19
import java.util.Map;
19
import java.util.Map;
20
20
21
import org.eclipse.tptp.platform.analysis.core.AnalysisConstants;
22
import org.eclipse.tptp.platform.analysis.core.CoreMessages;
21
import org.eclipse.tptp.platform.analysis.core.CoreMessages;
23
import org.eclipse.tptp.platform.analysis.core.element.AbstractAnalysisElement;
22
import org.eclipse.tptp.platform.analysis.core.element.AbstractAnalysisElement;
24
import org.eclipse.tptp.platform.analysis.core.result.AbstractAnalysisResult;
23
import org.eclipse.tptp.platform.analysis.core.result.AbstractAnalysisResult;
Lines 55-60 Link Here
55
    private	 static final DateFormat df = new SimpleDateFormat( CoreMessages.history_timestamp_format );
54
    private	 static final DateFormat df = new SimpleDateFormat( CoreMessages.history_timestamp_format );
56
   
55
   
57
	
56
	
57
	private final static class Counter {
58
		private int value ;
59
		public Counter(int value){
60
			this.value = value;
61
		}
62
		public int getIntValue(){
63
			return value;
64
		}
65
		public void increaseValue(){
66
			value++;
67
		}
68
		public void decreaseValue(){
69
			value--;
70
		}
71
	}
72
	
73
	static final private Counter counter;
74
	
75
	static {
76
		counter = new Counter(0);
77
	}
78
	
58
    /**
79
    /**
59
	 * Construct a new analysis history for the specified configuration
80
	 * Construct a new analysis history for the specified configuration
60
	 * 
81
	 * 
Lines 66-72 Link Here
66
    public AnalysisHistory( AnalysisHistoryFactory factoryValue, String configValue )
87
    public AnalysisHistory( AnalysisHistoryFactory factoryValue, String configValue )
67
    {
88
    {
68
    	historyTimestamp = System.currentTimeMillis();
89
    	historyTimestamp = System.currentTimeMillis();
69
		historyId=AnalysisConstants.BLANK + historyTimestamp;
90
91
    	// make sure that no 2 histories will have the same ID
92
    	synchronized (counter) {
93
    		counter.increaseValue();
94
    		historyId= Integer.toString(counter.getIntValue());
95
		}
96
		
70
     	selectedElements = new ArrayList(10);
97
     	selectedElements = new ArrayList(10);
71
     	selectAnalysisElements = new ArrayList(10);
98
     	selectAnalysisElements = new ArrayList(10);
72
     	this.configName = configValue;
99
     	this.configName = configValue;

Return to bug 197179