JSwingRipples2016 / jswingripples

Port of JRipples Eclipse Plugin to Swing
1 stars 3 forks source link

RS028: Synchronized access to JSwingRipplesEIG node structure #51

Closed javierobledo closed 7 years ago

javierobledo commented 7 years ago

Description: This means make this object a synchronized resource, only accessed when it is ready. In the original JRipples plugin, this is achieved using boolean fields like "locked" or "ready" to determinate if the resource is used, ready or other kind of states. Source: Team / Teacher Priority: Medium Stability: Negotiable Last Update: 2016-11-20 State: Not longer necessary Increment: 2 Type: Interation Associated user: End-User

Software Change Process:

sgioia9 commented 7 years ago

You can use a mutex:

public class SomeClass {
private static final Object lock = new Object();

    xxx yyy someMethodWithACriticalSection() {
       ...
       synchronized(lock) {
           // crtitical section
           // access node structure here
        }
       ...
    }
}
javierobledo commented 7 years ago

no longer needed after #52

javierobledo commented 7 years ago

Initialization

Synchronized access to JSwingRipplesEIG node structure

javierobledo commented 7 years ago

Concept Location

Significant concepts: Synchronized, JSwingRipplesEIG, Node Concept Synchronized located in History, JSwingRipplesEIG Concept JSwingRipplesEIG is a class itself Concept Node located in JSwingRipplesEIG, JSwingRipplesNode

javierobledo commented 7 years ago

Impact Analysis

From JSwingRipplesEIG: History,JSwingRipplesEIGEdge, JSwingRipplesEIGEdgeEvent, JSwingRipplesEIGEvent, JSwingRipplesEIGListener, JSwingRipplesEIGNode, JSwingRipplesEIGNodeEvent, MemberHierarchySupportTest, NodeSearchBuilder, StartAnalysisDialog From JSwingRipplesEIGNode: JSwingRipplesEIG, JSwingRipplesEIGEdge, JSwingRipplesEIGNodeEvent, MemberHierarchySupportTest, AbstractMemberRenderer From History: UndoAction, JSwingRipplesEIG, HistoryTest

javierobledo commented 7 years ago

Prefactoring, Actualization, Postfactoring

No modification were made to the code

javierobledo commented 7 years ago

Conclusion

This problem was fixed by another method, which was declared in the issue #50, with the pull request #52