uDIG
  1. uDIG
  2. UDIG-1781

Inconsistent getMap() method in LayerList2 class.

    Details

    • Type: Bug Bug
    • Status: Open Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: UDIG 1.2.2
    • Fix Version/s: UDIG 1.4.1
    • Component/s: framework
    • Labels:
      None

      Description

      Cannot use ApplicationGIS.copyMap(ApplicationGIS.getActiveMap()) to create map copy for MapViewer:

      java.lang.IllegalStateException: Owner should be IMap or ContextModel
      at net.refractions.udig.project.internal.impl.LayersList2.getMap(LayersList2.java:127)
      at net.refractions.udig.project.internal.impl.LayersList2.assign(LayersList2.java:114)
      at org.eclipse.emf.common.util.BasicEList.addAllUnique(BasicEList.java:514)
      at org.eclipse.emf.common.notify.impl.NotifyingListImpl.doAddAllUnique(NotifyingListImpl.java:506)
      at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addAllUnique(NotifyingListImpl.java:478)
      at org.eclipse.emf.common.notify.impl.NotifyingListImpl.addAllUnique(NotifyingListImpl.java:406)
      at org.eclipse.emf.common.util.AbstractEList.addAll(AbstractEList.java:374)
      at org.eclipse.emf.ecore.util.EcoreUtil$Copier.copyContainment(EcoreUtil.java:568)
      at org.eclipse.emf.ecore.util.EcoreUtil$Copier.copy(EcoreUtil.java:488)
      at org.eclipse.emf.ecore.util.EcoreUtil$Copier.copyContainment(EcoreUtil.java:574)
      at org.eclipse.emf.ecore.util.EcoreUtil$Copier.copy(EcoreUtil.java:488)
      at org.eclipse.emf.ecore.util.EcoreUtil.copy(EcoreUtil.java:360)
      at net.refractions.udig.project.ui.ApplicationGIS.copyMap(ApplicationGIS.java:1007)

      In debugger owner of LayersList2 is ContextModelImpl (implementation of ContextModel), but i got exception, that it is not. In getMethod() check is made only for IMap type, so ContextModel can't be passed as valid parameter.

        Activity

        Hide
        Siarhei Khamenka added a comment -
        Any workaround to make a copy of ApplicationGIS.getActiveMap() is welcomed too.
        Show
        Siarhei Khamenka added a comment - Any workaround to make a copy of ApplicationGIS.getActiveMap() is welcomed too.
        Hide
        Jody Garnett added a comment -
        I think this is now resolved with the recent regeneration of the EMF model.
        Show
        Jody Garnett added a comment - I think this is now resolved with the recent regeneration of the EMF model.

          People

          • Assignee:
            Jody Garnett
            Reporter:
            Siarhei Khamenka
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: