@Override public Object clone() { try { Configuration copy = (Configuration) super.clone(); copy.sharedVariables = new HashMap(sharedVariables); copy.localeToCharsetMap = new ConcurrentHashMap(localeToCharsetMap); copy.recreateTemplateCacheWith( cache.getTemplateLoader(), cache.getCacheStorage(), cache.getTemplateLookupStrategy(), cache.getTemplateNameFormat(), cache.getTemplateConfigurations()); return copy; } catch (CloneNotSupportedException e) { throw new BugException("Cloning failed", e); } }
public Object clone() { try { Configuration copy = (Configuration)super.clone(); copy.variables = new HashMap(variables); copy.encodingMap = new HashMap(encodingMap); copy.createTemplateCache(cache.getTemplateLoader(), cache.getCacheStorage()); return copy; } catch (CloneNotSupportedException e) { throw new RuntimeException("Clone is not supported, but it should be: " + e.getMessage()); } }
@Override public Object clone() { try { Configuration copy = (Configuration) super.clone(); copy.sharedVariables = new HashMap(sharedVariables); copy.localeToCharsetMap = new ConcurrentHashMap(localeToCharsetMap); copy.recreateTemplateCacheWith( cache.getTemplateLoader(), cache.getCacheStorage(), cache.getTemplateLookupStrategy(), cache.getTemplateNameFormat(), cache.getTemplateConfigurations()); return copy; } catch (CloneNotSupportedException e) { throw new BugException("Cloning failed", e); } }
@Override public Object clone() { try { Configuration copy = (Configuration) super.clone(); copy.sharedVariables = new HashMap(sharedVariables); copy.localeToCharsetMap = new ConcurrentHashMap(localeToCharsetMap); copy.recreateTemplateCacheWith( cache.getTemplateLoader(), cache.getCacheStorage(), cache.getTemplateLookupStrategy(), cache.getTemplateNameFormat(), cache.getTemplateConfigurations()); return copy; } catch (CloneNotSupportedException e) { throw new BugException("Cloning failed", e); } }