ref 6061: using * at the beginning of search pattern triggers a search on abbrevTitle...
authorKatja Luther <k.luther@bgbm.org>
Thu, 15 Sep 2016 11:22:59 +0000 (13:22 +0200)
committerKatja Luther <k.luther@bgbm.org>
Thu, 15 Sep 2016 11:22:59 +0000 (13:22 +0200)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NomenclaturalAuthorSelectionDialog.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/ui/dialog/selection/NomenclaturalReferenceSelectionDialog.java

index baad25d457b4510f88f30aa531799b6c88e86a32..7fb99183a2a453c205df9013a14912fd8daa6ef7 100644 (file)
@@ -188,17 +188,21 @@ public class NomenclaturalAuthorSelectionDialog extends AgentSelectionDialog {
 
                        @Override
                        public boolean matchItem(Object item) {
-                               String text = null;
+                               String textTitleCache = null;
+                               String abbrevTitleCache = null;
                                if(item instanceof UuidAndTitleCache){
                                        if (((UuidAndTitleCache) item).getAbbrevTitleCache() != null){
-                                               text = ((UuidAndTitleCache) item).getAbbrevTitleCache();
-                                       } else{
-                                               text = ((UuidAndTitleCache) item).getTitleCache();
+                                               abbrevTitleCache = ((UuidAndTitleCache) item).getAbbrevTitleCache();
+                                       } 
+                                       if (((UuidAndTitleCache) item).getTitleCache() != null ){
+                                               textTitleCache = ((UuidAndTitleCache) item).getTitleCache();
                                        }
                                }else if(item instanceof String){
-                                       text = (String) item;
+                                       textTitleCache = (String) item;
                                }
-                               return text != null ? matches(text) : false;
+                               
+                               return  (matches(textTitleCache) || matches(abbrevTitleCache)) ;
+                               
                        }
 
                };
index 68cf6fe8b2a596562902c13702956e06c775f371..be5750fcc3b27c1c4ab66e398d319805046c91e1 100755 (executable)
@@ -112,17 +112,18 @@ public class NomenclaturalReferenceSelectionDialog extends
 
                        @Override
                        public boolean matchItem(Object item) {
-                               String text = null;
-                               if(item instanceof UuidAndTitleCache){
-                                       if (((UuidAndTitleCache) item).getAbbrevTitleCache() != null){
-                                               text = ((UuidAndTitleCache) item).getAbbrevTitleCache();
-                                       } else{
-                                               text = ((UuidAndTitleCache) item).getTitleCache();
-                                       }
-                               }else if(item instanceof String){
-                                       text = (String) item;
-                               }
-                               return text != null ? matches(text) : false;
+                               return true;
+//                             String text = null;
+//                             if(item instanceof UuidAndTitleCache){
+//                                     if (((UuidAndTitleCache) item).getAbbrevTitleCache() != null){
+//                                             text = ((UuidAndTitleCache) item).getAbbrevTitleCache();
+//                                     } else{
+//                                             text = ((UuidAndTitleCache) item).getTitleCache();
+//                                     }
+//                             }else if(item instanceof String){
+//                                     text = (String) item;
+//                             }
+//                             return text != null ? matches(text) : false;
                        }
 
                };