parent
238d17c066
commit
7e87449e5a
|
@ -1,5 +1,5 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||||
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
||||||
* This program is free software; you can redistribute it and/or modify it *
|
* This program is free software; you can redistribute it and/or modify it *
|
||||||
* under the terms version 2 of the GNU General Public License as published *
|
* under the terms version 2 of the GNU General Public License as published *
|
||||||
|
@ -16,12 +16,16 @@
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
package org.compiere.util;
|
package org.compiere.util;
|
||||||
|
|
||||||
import java.io.*;
|
import java.io.File;
|
||||||
import java.sql.*;
|
import java.sql.PreparedStatement;
|
||||||
import java.text.*;
|
import java.sql.ResultSet;
|
||||||
import java.util.*;
|
import java.sql.SQLException;
|
||||||
import java.util.logging.*;
|
import java.text.MessageFormat;
|
||||||
import org.compiere.*;
|
import java.util.Iterator;
|
||||||
|
import java.util.Properties;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
import org.compiere.Adempiere;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reads all Messages and stores them in a HashMap
|
* Reads all Messages and stores them in a HashMap
|
||||||
|
@ -142,7 +146,8 @@ public final class Msg
|
||||||
s_log.log(Level.SEVERE, "initMsg", e);
|
s_log.log(Level.SEVERE, "initMsg", e);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
finally {
|
finally
|
||||||
|
{
|
||||||
DB.close(rs, pstmt);
|
DB.close(rs, pstmt);
|
||||||
rs = null; pstmt = null;
|
rs = null; pstmt = null;
|
||||||
}
|
}
|
||||||
|
@ -165,11 +170,11 @@ public final class Msg
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// clear all languages
|
// clear all languages
|
||||||
Iterator iterator = m_languages.values().iterator();
|
Iterator<CCache<String, String>> iterator = m_languages.values().iterator();
|
||||||
while (iterator.hasNext())
|
while (iterator.hasNext())
|
||||||
{
|
{
|
||||||
HashMap hm = (HashMap)iterator.next();
|
CCache<String, String> hm = iterator.next();
|
||||||
hm.clear();
|
hm.reset();
|
||||||
}
|
}
|
||||||
m_languages.clear();
|
m_languages.clear();
|
||||||
} // reset
|
} // reset
|
||||||
|
@ -227,7 +232,7 @@ public final class Msg
|
||||||
if (text.equals("CopyRight"))
|
if (text.equals("CopyRight"))
|
||||||
return Adempiere.COPYRIGHT;
|
return Adempiere.COPYRIGHT;
|
||||||
//
|
//
|
||||||
HashMap langMap = getMsgMap(AD_Language);
|
CCache<String, String> langMap = getMsgMap(AD_Language);
|
||||||
if (langMap == null)
|
if (langMap == null)
|
||||||
return null;
|
return null;
|
||||||
return (String)langMap.get(text);
|
return (String)langMap.get(text);
|
||||||
|
@ -404,7 +409,7 @@ public final class Msg
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
className += language.getLanguageCode().toUpperCase();
|
className += language.getLanguageCode().toUpperCase();
|
||||||
Class clazz = Class.forName(className);
|
Class<?> clazz = Class.forName(className);
|
||||||
AmtInWords aiw = (AmtInWords)clazz.newInstance();
|
AmtInWords aiw = (AmtInWords)clazz.newInstance();
|
||||||
return aiw.getAmtInWords(amount);
|
return aiw.getAmtInWords(amount);
|
||||||
}
|
}
|
||||||
|
@ -504,7 +509,8 @@ public final class Msg
|
||||||
s_log.log(Level.SEVERE, "getElement", e);
|
s_log.log(Level.SEVERE, "getElement", e);
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
finally {
|
finally
|
||||||
|
{
|
||||||
DB.close(rs, pstmt);
|
DB.close(rs, pstmt);
|
||||||
rs = null; pstmt = null;
|
rs = null; pstmt = null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue