Changeset 14003 in josm


Ignore:
Timestamp:
2018-07-06T00:51:36+02:00 (6 years ago)
Author:
Don-vip
Message:

attempt to fix frequent errors of DrawActionTest.testTicket12011`: fix NPE seen when running the test manually

Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/mapmode/DrawAction.java

    r13941 r14003  
    854854     * mouseReleased() (FIXME).
    855855     */
    856     private void computeHelperLine() {
     856    private synchronized void computeHelperLine() {
    857857        if (mousePos == null) {
    858858            // Don't draw the line.
     
    931931     * uses also lastUsedNode field
    932932     */
    933     private void determineCurrentBaseNodeAndPreviousNode(Collection<OsmPrimitive> selection) {
     933    private synchronized void determineCurrentBaseNodeAndPreviousNode(Collection<OsmPrimitive> selection) {
    934934        Node selectedNode = null;
    935935        Way selectedWay = null;
     
    10411041     * @return the current base node (can be null). If not-null, it's guaranteed the node is usable
    10421042     */
    1043     public Node getCurrentBaseNode() {
     1043    public synchronized Node getCurrentBaseNode() {
    10441044        if (currentBaseNode != null && (currentBaseNode.getDataSet() == null || !currentBaseNode.isUsable())) {
    10451045            currentBaseNode = null;
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

    r13809 r14003  
    265265
    266266    protected void writeUnlock(boolean locked) {
    267         if (locked) {
     267        if (locked && dataSet != null) {
    268268            // It shouldn't be possible for dataset to become null because
    269269            // method calling setDataset would need write lock which is owned by this thread
Note: See TracChangeset for help on using the changeset viewer.