Downloads Documentation Community Contribute Demo






Show Sidebar
Login | Register

Ticket #787: openmrs-787.patch

File openmrs-787.patch, 1.5 kB (added by upul, 2 years ago)
  • src/web/org/openmrs/web/taglib/fieldgen/FieldGenHandlerFactory.java

    old new  
    2828        private Map<String,String> handlers = null; 
    2929         
    3030        private static FieldGenHandlerFactory singleton; 
    31          
     31 
    3232        /** 
    3333         * Generic constructor 
    3434         */ 
    3535        public FieldGenHandlerFactory() { 
    36                 singleton = this; 
     36                if (singleton == null) 
     37                        singleton = this; 
    3738        } 
    3839         
    3940        /** 
     
    5253         * @return Returns the handlers. 
    5354         */ 
    5455        public Map<String,String> getHandlers() { 
    55                 return handlers; 
     56                return singleton.handlers; 
    5657        } 
    5758 
    5859        /** 
     
    6162         * @param handlers The handlers to set. 
    6263         */ 
    6364        public void setHandlers(Map<String,String> handlers) { 
    64                 if (this.handlers == null) 
    65                         this.handlers = handlers; 
     65                if (singleton.handlers == null) 
     66                        singleton.handlers = handlers; 
    6667                else 
    67                         this.handlers.putAll(handlers); 
     68                        singleton.handlers.putAll(handlers); 
    6869        } 
    6970         
    7071        /** 
     
    7576         */ 
    7677        public String getHandlerByClassName(String className) { 
    7778                if ( className != null ) { 
    78                         if ( handlers.containsKey(className) ) { 
    79                                 return handlers.get(className); 
     79                        if ( singleton.handlers.containsKey(className) ) { 
     80                                return singleton.handlers.get(className); 
    8081                        } else { 
    8182                                return null; 
    8283                        }