Fixed javadoc and other minor issues.
authorGorka Ion Damián <gorkaion.damian@openbravo.com>
Wed, 20 Oct 2010 19:37:46 +0200
changeset 8727 8e2f3b483784
parent 8726 bdc6f026333a
child 8728 dfae3020f070
Fixed javadoc and other minor issues.
src/org/openbravo/erpCommon/utility/SystemInfo.java
--- a/src/org/openbravo/erpCommon/utility/SystemInfo.java	Wed Oct 20 19:22:43 2010 +0200
+++ b/src/org/openbravo/erpCommon/utility/SystemInfo.java	Wed Oct 20 19:37:46 2010 +0200
@@ -94,9 +94,6 @@
 
   /**
    * Loads system information but ID
-   * 
-   * @param conn
-   * @throws ServletException
    */
   public static void load(ConnectionProvider conn) throws ServletException {
     try {
@@ -114,9 +111,6 @@
 
   /**
    * Loads ID information
-   * 
-   * @param conn
-   * @throws ServletException
    */
   public static void loadId(ConnectionProvider conn) throws ServletException {
     for (Item i : Item.values()) {
@@ -133,7 +127,7 @@
       systemInfo.put(i, getSystemIdentifier(conn));
       break;
     case MAC_IDENTIFIER:
-      systemInfo.put(i, calculateMacAddress());
+      systemInfo.put(i, calculateMacIdentifier());
       break;
     case DB_IDENTIFIER:
       systemInfo.put(i, getDBIdentifier(conn));
@@ -237,21 +231,21 @@
     }
   }
 
-  public final static String getSystemIdentifier() throws ServletException {
+  public final static synchronized String getSystemIdentifier() throws ServletException {
     if (systemIdentifier == null)
       systemIdentifier = getSystemIdentifier(new DalConnectionProvider());
     return systemIdentifier;
   }
 
-  public final static String getDBIdentifier() {
+  public final static synchronized String getDBIdentifier() {
     if (databaseIdentifier == null)
       databaseIdentifier = getDBIdentifier(new DalConnectionProvider());
     return databaseIdentifier;
   }
 
-  public final static String getMacAddress() {
+  public final static synchronized String getMacAddress() {
     if (macAddress == null)
-      macAddress = calculateMacAddress();
+      macAddress = calculateMacIdentifier();
     return macAddress;
   }
 
@@ -270,10 +264,8 @@
    * 
    * In case multiple interfaces are present, it is taken the first one with mac address of the list
    * sorted in this way: loopbacks are sorted at the end, the rest of interfaces are sorted by name.
-   * 
-   * @return
    */
-  private final static String calculateMacAddress() {
+  private final static String calculateMacIdentifier() {
     List<NetworkInterface> interfaces = new ArrayList<NetworkInterface>();
     try {
       interfaces = Collections.list(NetworkInterface.getNetworkInterfaces());
@@ -341,7 +333,7 @@
         crc.update(id.getBytes());
         return Long.toHexString(crc.getValue());
       } catch (SQLException e) {
-        log4j.error("Error obtaining Oracle's DB identifier");
+        log4j.error("Error obtaining Oracle's DB identifier", e);
         return "";
       } finally {
         try {
@@ -395,9 +387,6 @@
    * of paths + commands.
    * 
    * Currently only checks for Apache.
-   * 
-   * @param conn
-   * @throws ServletException
    */
   private final static String[] getWebserver(ConnectionProvider conn) {
     List<String> commands = new ArrayList<String>();
@@ -468,10 +457,6 @@
 
   /**
    * Obtain all the modules installed in the instance.
-   * 
-   * @param i
-   * 
-   * @return
    */
   private final static String getModules() {
     try {
@@ -553,8 +538,6 @@
 
   /**
    * In case it is an OBPS instance, it returns the CRC of the activation key
-   * 
-   * @return
    */
   private static String getOBPSInstance() {
     if (ActivationKey.getInstance().isOPSInstance()) {