Merge branch 'merge/develop_JAL-3725' into develop
[jalview.git] / src / jalview / gui / PopupMenu.java
index 2f77959..7b284a9 100644 (file)
@@ -20,6 +20,8 @@
  */
 package jalview.gui;
 
+import java.util.Locale;
+
 import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.event.ActionEvent;
@@ -837,15 +839,14 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
       /*
        * show local rather than linked feature coordinates
        */
-      int[] beginRange = mf.getMappedPositions(start, start);
-      int[] endRange = mf.getMappedPositions(end, end);
-      if (beginRange == null || endRange == null)
+      int[] localRange = mf.getMappedPositions(start, end);
+      if (localRange == null)
       {
         // e.g. variant extending to stop codon so not mappable
         return;
       }
-      start = beginRange[0];
-      end = endRange[endRange.length - 1];
+      start = localRange[0];
+      end = localRange[localRange.length - 1];
     }
     StringBuilder desc = new StringBuilder();
     desc.append(sf.getType()).append(" ").append(String.valueOf(start));
@@ -1130,7 +1131,7 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
         for (int d = 0; d < nd; d++)
         {
           DBRefEntry e = dbr.get(d);
-          String src = e.getSource(); // jalview.util.DBRefUtils.getCanonicalName(dbr[d].getSource()).toUpperCase();
+          String src = e.getSource(); // jalview.util.DBRefUtils.getCanonicalName(dbr[d].getSource()).toUpperCase(Locale.ROOT);
           Object[] sarray = commonDbrefs.get(src);
           if (sarray == null)
           {
@@ -1176,7 +1177,7 @@ public class PopupMenu extends JPopupMenu implements ColourChangeListener
       boolean usingNames = false;
       // Now see which parts of the group apply for this URL
       String ltarget = urlLink.getTarget(); // jalview.util.DBRefUtils.getCanonicalName(urlLink.getTarget());
-      Object[] idset = commonDbrefs.get(ltarget.toUpperCase());
+      Object[] idset = commonDbrefs.get(ltarget.toUpperCase(Locale.ROOT));
       String[] seqstr, ids; // input to makeUrl
       if (idset != null)
       {