Skip to content

Commit 6d00709

Browse files
committed
Made properties of EGL trace-related objects settable
1 parent 7d4d5fd commit 6d00709

File tree

12 files changed

+76
-38
lines changed

12 files changed

+76
-38
lines changed

plugins/org.eclipse.epsilon.egl.traceability.fine/src/org/eclipse/epsilon/egl/engine/traceability/fine/internal/EglFineTraceabilityListener.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public class EglFineTraceabilityListener extends PropertyAccessExecutionListener
2121

2222
protected TracedPropertyAccessLedger ledger;
2323
protected Stack<List<PropertyAccess>> propertyAccessesStack = new Stack<>();
24-
protected final WeakHashMap<ModuleElement, Stack<TraceData>> cache = new WeakHashMap<>();
24+
protected WeakHashMap<ModuleElement, Stack<TraceData>> cache = new WeakHashMap<>();
2525
protected List<String> printMethods = Arrays.asList("printdyn", "println", "print", "prinx");
2626

2727
public EglFineTraceabilityListener(TracedPropertyAccessLedger ledger) {

plugins/org.eclipse.epsilon.egl.traceability.fine/src/org/eclipse/epsilon/egl/engine/traceability/fine/internal/TraceLinkCreatingTemplateExecutionListener.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020

2121
public class TraceLinkCreatingTemplateExecutionListener extends DefaultTemplateExecutionListener {
2222

23-
private final Trace trace;
24-
private final TracedPropertyAccessLedger ledger;
23+
protected Trace trace;
24+
protected TracedPropertyAccessLedger ledger;
2525

2626
public TraceLinkCreatingTemplateExecutionListener(Trace trace, TracedPropertyAccessLedger ledger) {
2727
this.trace = trace;

plugins/org.eclipse.epsilon.egl.traceability.fine/src/org/eclipse/epsilon/egl/engine/traceability/fine/internal/TracedPropertyAccess.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*/
2020
class TracedPropertyAccess extends PropertyAccess {
2121

22-
private final Region region;
22+
protected Region region;
2323

2424
public TracedPropertyAccess(Object modelElement, String propertyName, Region region) {
2525
super(modelElement, propertyName);
@@ -33,4 +33,8 @@ public TracedPropertyAccess(IPropertyAccess propertyAccess, Region region) {
3333
public Region getRegion() {
3434
return region;
3535
}
36+
37+
public void setRegion(Region region) {
38+
this.region = region;
39+
}
3640
}

plugins/org.eclipse.epsilon.egl.traceability.fine/src/org/eclipse/epsilon/egl/engine/traceability/fine/internal/TracedPropertyAccessLedger.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
public class TracedPropertyAccessLedger {
2020

21-
private final Multimap<EglTemplate, TracedPropertyAccess> accessesByTemplate = new Multimap<>();
21+
protected Multimap<EglTemplate, TracedPropertyAccess> accessesByTemplate = new Multimap<>();
2222

2323
void associate(IPropertyAccess access, Region region, EglTemplate template) {
2424
accessesByTemplate.put(template, new TracedPropertyAccess(access, region));

plugins/org.eclipse.epsilon.egl.traceability.fine/src/org/eclipse/epsilon/egl/engine/traceability/fine/trace/ModelLocation.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,31 @@
1414

1515
public class ModelLocation {
1616

17-
public final Object modelElement;
18-
public final String propertyName;
17+
//TODO: Make these protected in 3.0
18+
public Object modelElement;
19+
public String propertyName;
1920

2021
public ModelLocation(Object modelElement, String propertyName) {
2122
this.modelElement = modelElement;
2223
this.propertyName = propertyName;
2324
}
2425

25-
26-
// Getters for compatibility with JavaModel, which are used in acceptance tests
27-
2826
public Object getModelElement() {
2927
return modelElement;
3028
}
3129

30+
public void setModelElement(Object modelElement) {
31+
this.modelElement = modelElement;
32+
}
33+
3234
public String getPropertyName() {
3335
return propertyName;
3436
}
35-
37+
38+
public void setPropertyName(String propertyName) {
39+
this.propertyName = propertyName;
40+
}
41+
3642
public Collection<? extends Object> getAllContents() {
3743
return Arrays.asList(this, modelElement);
3844
}

plugins/org.eclipse.epsilon.egl.traceability.fine/src/org/eclipse/epsilon/egl/engine/traceability/fine/trace/Region.java

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
import java.util.Objects;
1414

1515
public class Region {
16-
16+
17+
//TODO: Make these protected in 3.0
1718
public int offset, length;
1819
public String text;
1920

@@ -23,20 +24,29 @@ public Region(int offset, int length, String text) {
2324
this.text = text;
2425
}
2526

26-
27-
// Getters for compatibility with JavaModel, which are used in acceptance tests
28-
2927
public int getOffset() {
3028
return offset;
3129
}
3230

31+
public void setOffset(int offset) {
32+
this.offset = offset;
33+
}
34+
3335
public int getLength() {
3436
return length;
3537
}
36-
38+
39+
public void setLength(int length) {
40+
this.length = length;
41+
}
42+
3743
public String getText() {
3844
return text;
3945
}
46+
47+
public void setText(String text) {
48+
this.text = text;
49+
}
4050

4151
@Override
4252
public boolean equals(Object obj) {

plugins/org.eclipse.epsilon.egl.traceability.fine/src/org/eclipse/epsilon/egl/engine/traceability/fine/trace/TextLocation.java

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,15 @@
1515

1616
public class TextLocation {
1717

18-
public final Region region;
19-
public final String resource;
18+
//TODO: Make these protected in 3.0
19+
public Region region;
20+
public String resource;
2021

2122
public TextLocation(Region region, String resource) {
2223
this.region = region;
2324
this.resource = resource;
2425
}
2526

26-
27-
// Getters for compatibility with JavaModel, which are used in acceptance tests
28-
2927
public String getResource() {
3028
return resource;
3129
}
@@ -34,6 +32,14 @@ public Region getRegion() {
3432
return region;
3533
}
3634

35+
public void setRegion(Region region) {
36+
this.region = region;
37+
}
38+
39+
public void setResource(String resource) {
40+
this.resource = resource;
41+
}
42+
3743
public Collection<? extends Object> getAllContents() {
3844
final List<Object> allContents = new LinkedList<>();
3945
allContents.add(this);

plugins/org.eclipse.epsilon.egl.traceability.fine/src/org/eclipse/epsilon/egl/engine/traceability/fine/trace/Trace.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@
1717

1818
public class Trace {
1919

20-
public final List<TextLocation> locations = new LinkedList<>();
21-
public final Set<TraceLink> traceLinks = new LinkedHashSet<>();
20+
//TODO: Make these protected in 3.0
21+
public List<TextLocation> locations = new LinkedList<>();
22+
public Set<TraceLink> traceLinks = new LinkedHashSet<>();
2223
public String destination;
2324

24-
25-
// Getters for compatibility with JavaModel, which are used in acceptance tests
26-
2725
public Set<TraceLink> getTraceLinks() {
2826
return traceLinks;
2927
}

plugins/org.eclipse.epsilon.egl.traceability.fine/src/org/eclipse/epsilon/egl/engine/traceability/fine/trace/TraceLink.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,15 @@
1414
import java.util.List;
1515

1616
public class TraceLink {
17-
18-
public final ModelLocation source;
19-
public final TextLocation destination;
17+
18+
//TODO: Make these protected in 3.0
19+
public ModelLocation source;
20+
public TextLocation destination;
2021

2122
public TraceLink(ModelLocation source, TextLocation destination) {
2223
this.source = source;
2324
this.destination = destination;
2425
}
25-
26-
27-
// Getters for compatibility with JavaModel, which are used in acceptance tests
2826

2927
public ModelLocation getSource() {
3028
return source;
@@ -34,6 +32,14 @@ public TextLocation getDestination() {
3432
return destination;
3533
}
3634

35+
public void setSource(ModelLocation source) {
36+
this.source = source;
37+
}
38+
39+
public void setDestination(TextLocation destination) {
40+
this.destination = destination;
41+
}
42+
3743
public Collection<? extends Object> getAllContents() {
3844
final List<Object> allContents = new LinkedList<>();
3945
allContents.add(this);

plugins/org.eclipse.epsilon.eol.engine/src/org/eclipse/epsilon/eol/execute/introspection/recording/PropertyAccess.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313

1414
public class PropertyAccess implements IPropertyAccess {
1515

16-
protected final Object modelElement;
17-
protected final String propertyName;
16+
protected Object modelElement;
17+
protected String propertyName;
1818

1919
public PropertyAccess(Object modelElement, String propertyName) {
2020
this.modelElement = modelElement;
@@ -26,10 +26,18 @@ public Object getModelElement() {
2626
return this.modelElement;
2727
}
2828

29+
public void setModelElement(Object modelElement) {
30+
this.modelElement = modelElement;
31+
}
32+
2933
@Override
3034
public String getPropertyName() {
3135
return this.propertyName;
3236
}
37+
38+
public void setPropertyName(String propertyName) {
39+
this.propertyName = propertyName;
40+
}
3341

3442
@Override
3543
public boolean equals(Object object) {

0 commit comments

Comments
 (0)