Unified all the getObjectReference() and getObject() methods to only return reference...
authorMarco Zanon <info@marcozanon.com>
Wed, 28 Oct 2015 14:18:44 +0000 (14:18 +0000)
committerMarco Zanon <info@marcozanon.com>
Wed, 28 Oct 2015 14:18:44 +0000 (14:18 +0000)
4.x/src/java/com/marcozanon/macaco/conversion/MDateConverter.java
4.x/src/java/com/marcozanon/macaco/conversion/MNumberConverter.java
4.x/src/java/com/marcozanon/macaco/json/MJsonArray.java
4.x/src/java/com/marcozanon/macaco/json/MJsonObject.java
4.x/src/java/com/marcozanon/macaco/logging/MLogDatabaseTable.java
4.x/src/java/com/marcozanon/macaco/logging/MLogFilter.java
4.x/src/java/com/marcozanon/macaco/logging/MLogPlainTextFile.java
4.x/src/java/com/marcozanon/macaco/sql/MSqlConnection.java
4.x/src/java/com/marcozanon/macaco/sql/MSqlStatementResults.java
4.x/src/java/com/marcozanon/macaco/sql/MSqlTable.java
4.x/src/java/com/marcozanon/macaco/text/MTranslator.java

index 4a53334e59de94955dc92f6414612a27f361cf51..e9282f7da55389c4b88816564b82fa63d95dd013 100644 (file)
@@ -76,21 +76,12 @@ public class MDateConverter extends MObject {
         }
     }
 
-    protected LinkedHashSet<String> getDateFormatsReference() {
-        return this.dateFormats;
-    }
-
     public LinkedHashSet<String> getDateFormats() {
-        LinkedHashSet<String> tmpDateFormats = new LinkedHashSet<String>();
-        Iterator i = this.getDateFormatsReference().iterator();
-        while (i.hasNext()) {
-            tmpDateFormats.add((String)i.next());
-        }
-        return tmpDateFormats;
+        return this.dateFormats;
     }
 
     public String getDefaultDateFormat() {
-        return this.getDateFormatsReference().iterator().next();
+        return this.getDateFormats().iterator().next();
     }
 
     /* Locale. */
@@ -117,12 +108,8 @@ public class MDateConverter extends MObject {
         this.timeZone = timeZone;
     }
 
-    protected TimeZone getTimeZoneReference() {
-        return this.timeZone;
-    }
-
     public TimeZone getTimeZone() {
-        return (TimeZone)this.getTimeZoneReference().clone();
+        return this.timeZone;
     }
 
     /* Conversions. */
@@ -198,9 +185,9 @@ public class MDateConverter extends MObject {
 
     public Date getDateFromString(String x) throws MInvalidConversionFormatException {
         Date y = null;
-        for (String dateFormat: this.getDateFormatsReference()) {
+        for (String dateFormat: this.getDateFormats()) {
             try {
-                y = this.getDateFromStringByParameters(x, dateFormat, this.getLocale(), this.getTimeZoneReference());
+                y = this.getDateFromStringByParameters(x, dateFormat, this.getLocale(), this.getTimeZone());
                 return y;
             }
             catch (MInvalidConversionFormatException exception) {
@@ -213,7 +200,7 @@ public class MDateConverter extends MObject {
     }
 
     public String getStringFromDate(Date x) {
-        return this.getStringFromDateByParameters(x, this.getDefaultDateFormat(), this.getLocale(), this.getTimeZoneReference());
+        return this.getStringFromDateByParameters(x, this.getDefaultDateFormat(), this.getLocale(), this.getTimeZone());
     }
 
     /* Helpers. */
index 2b69a632d1d7ca49ab78908be3745a1479cb79f7..a266afac81835165c34875d32d588fe73ef99c9e 100644 (file)
@@ -67,21 +67,12 @@ public class MNumberConverter extends MObject {
         }
     }
 
-    protected LinkedHashSet<String> getNumberFormatsReference() {
-        return this.numberFormats;
-    }
-
     public LinkedHashSet<String> getNumberFormats() {
-        LinkedHashSet<String> tmpNumberFormats = new LinkedHashSet<String>();
-        Iterator i = this.getNumberFormatsReference().iterator();
-        while (i.hasNext()) {
-            tmpNumberFormats.add((String)i.next());
-        }
-        return tmpNumberFormats;
+        return this.numberFormats;
     }
 
     public String getDefaultNumberFormat() {
-        return this.getNumberFormatsReference().iterator().next();
+        return this.getNumberFormats().iterator().next();
     }
 
     /* Locale. */
@@ -149,7 +140,7 @@ public class MNumberConverter extends MObject {
 
     public BigDecimal getNumberFromString(String x) throws MInvalidConversionFormatException {
         BigDecimal y = null;
-        for (String numberFormat: this.getNumberFormatsReference()) {
+        for (String numberFormat: this.getNumberFormats()) {
             try {
                 y = this.getNumberFromStringByParameters(x, numberFormat, this.getLocale());
                 return y;
index 1b170bc931764621958956976c497a18381ed16c..202b795013de361f6e4d0063371baaada1cf422b 100644 (file)
@@ -49,7 +49,7 @@ public class MJsonArray extends MJsonValue {
             throw new IllegalArgumentException("Invalid 'x': null.");
         }
         //
-        this.getValuesReference().add(x);
+        this.getValues().add(x);
     }
 
     public void setValue(int index, MJsonValue x) {
@@ -60,10 +60,10 @@ public class MJsonArray extends MJsonValue {
             throw new IllegalArgumentException("Invalid 'x': null.");
         }
         //
-        this.getValuesReference().set(index, x);
+        this.getValues().set(index, x);
     }
 
-    protected LinkedList<MJsonValue> getValuesReference() {
+    protected LinkedList<MJsonValue> getValues() {
         return this.values;
     }
 
@@ -72,11 +72,11 @@ public class MJsonArray extends MJsonValue {
             throw new IllegalArgumentException(String.format("Invalid 'index': %s: out of range.", index));
         }
         //
-        return this.getValuesReference().get(index).clone();
+        return this.getValues().get(index).clone();
     }
 
     public int getValueCount() {
-        return this.getValuesReference().size();
+        return this.getValues().size();
     }
 
     public void removeValue(int index) {
@@ -84,11 +84,11 @@ public class MJsonArray extends MJsonValue {
             throw new IllegalArgumentException(String.format("Invalid 'index': %s: out of range.", index));
         }
         //
-        this.getValuesReference().remove(index);
+        this.getValues().remove(index);
     }
 
     public void clearValues() {
-        this.getValuesReference().clear();
+        this.getValues().clear();
     }
 
     /* Parsers. */
@@ -199,7 +199,7 @@ public class MJsonArray extends MJsonValue {
             if (0 < i) {
                 s.append(", ");
             }
-            s.append(this.getValuesReference().get(i).getJsonValue());
+            s.append(this.getValues().get(i).getJsonValue());
         }
         s.append("]");
         return s.toString();
index 6c5060ac983b458c9e10821f8f863e1f85e8caf2..8b168b13b0d10e17926be41bf567beb2ec559ec1 100644 (file)
@@ -55,10 +55,10 @@ public class MJsonObject extends MJsonValue {
             throw new IllegalArgumentException("Invalid 'x': null.");
         }
         //
-        this.getValuesReference().put(key, x);
+        this.getValues().put(key, x);
     }
 
-    protected LinkedHashMap<String, MJsonValue> getValuesReference() {
+    protected LinkedHashMap<String, MJsonValue> getValues() {
         return this.values;
     }
 
@@ -70,11 +70,11 @@ public class MJsonObject extends MJsonValue {
         if (!this.containsKey(key)) {
             throw new IllegalArgumentException(String.format("Invalid 'key': %s: not available.", key));
         }
-        return this.getValuesReference().get(key).clone();
+        return this.getValues().get(key).clone();
     }
 
     public int getValueCount() {
-        return this.getValuesReference().size();
+        return this.getValues().size();
     }
 
     public void removeValue(String key) {
@@ -85,11 +85,11 @@ public class MJsonObject extends MJsonValue {
         if (!this.containsKey(key)) {
             throw new IllegalArgumentException(String.format("Invalid 'key': %s: not available.", key));
         }
-        this.getValuesReference().remove(key);
+        this.getValues().remove(key);
     }
 
     public void clearValues() {
-        this.getValuesReference().clear();
+        this.getValues().clear();
     }
 
     public boolean containsKey(String key) {
@@ -97,12 +97,12 @@ public class MJsonObject extends MJsonValue {
             throw new IllegalArgumentException("Invalid 'key': null or empty.");
         }
         //
-        return this.getValuesReference().containsKey(key);
+        return this.getValues().containsKey(key);
     }
 
     public LinkedHashSet<String> getKeys() {
         LinkedHashSet<String> keys = new LinkedHashSet<String>();
-        for (String key: this.getValuesReference().keySet()) {
+        for (String key: this.getValues().keySet()) {
             keys.add(key);
         }
         return keys;
@@ -246,13 +246,13 @@ public class MJsonObject extends MJsonValue {
         StringBuilder s = new StringBuilder("");
         s.append("{");
         int k = 0;
-        for (String key: this.getValuesReference().keySet()) {
+        for (String key: this.getValues().keySet()) {
             if (0 < k) {
                 s.append(", ");
             }
             s.append("\"" + MJsonString.getEscapedString(key, false) + "\"");
             s.append(": ");
-            s.append(this.getValuesReference().get(key).getJsonValue());
+            s.append(this.getValues().get(key).getJsonValue());
             k++;
         }
         s.append("}");
index 71d9f34e7b1709669c783e55a8350637f1badea8..575eed70079c439b5231ebb5c82e0079d0e85cfa 100644 (file)
@@ -52,7 +52,7 @@ public class MLogDatabaseTable extends MLogTarget {
 
     public void close() throws MLoggingException {
         try {
-            this.getSqlConnectionReference().close();
+            this.getSqlConnection().close();
         }
         catch (MSqlConnectionFailureException exception) {
             throw new MLoggingException("Could not close Sql connection.", exception);
@@ -61,7 +61,7 @@ public class MLogDatabaseTable extends MLogTarget {
 
     /* Sql connection generator. */
 
-    protected MSqlConnectionGenerator getSqlConnectionGeneratorReference() {
+    protected MSqlConnectionGenerator getSqlConnectionGenerator() {
         return this.sqlConnectionGenerator;
     }
 
@@ -81,7 +81,7 @@ public class MLogDatabaseTable extends MLogTarget {
 
     /* Sql connection. */
 
-    protected MSqlConnection getSqlConnectionReference() {
+    protected MSqlConnection getSqlConnection() {
         return this.sqlConnection;
     }
 
@@ -107,13 +107,13 @@ public class MLogDatabaseTable extends MLogTarget {
                 separator.append(" ");
             }
             //
-            if (null == this.getSqlConnectionReference()) {
-                this.sqlConnection = this.getSqlConnectionGeneratorReference().getNewConnection();
+            if (null == this.getSqlConnection()) {
+                this.sqlConnection = this.getSqlConnectionGenerator().getNewConnection();
             }
             //
             LinkedHashMap<String, Object> p = new LinkedHashMap<String, Object>();
             p.put(this.getLogDatabaseField(), timestamp + separator + message);
-            (new MSqlTable(this.getSqlConnectionReference(), this.getLogDatabaseTable(), this.getLogDatabaseTablePrimaryKey())).setRecord(p, null);
+            (new MSqlTable(this.getSqlConnection(), this.getLogDatabaseTable(), this.getLogDatabaseTablePrimaryKey())).setRecord(p, null);
         }
         catch (MSqlConnectionFailureException exception) {
             throw new MLoggingException("Could not write to database table.", exception);
index 4669c922fe73b3a5c7b81e3e87a82afe1282a050..cb7cc8d9f52a97b4afb58449e912aa8f67daee43 100644 (file)
@@ -33,7 +33,7 @@ public class MLogFilter extends MObject {
     }
 
     public void close() throws MLoggingException {
-        for (MLogTarget t: this.getLogTargetsReference()) {
+        for (MLogTarget t: this.getLogTargets()) {
             t.close();
         }
     }
@@ -72,7 +72,7 @@ public class MLogFilter extends MObject {
         }
     }
 
-    protected LinkedList<MLogTarget> getLogTargetsReference() {
+    protected LinkedList<MLogTarget> getLogTargets() {
         return this.logTargets;
     }
 
@@ -116,7 +116,7 @@ public class MLogFilter extends MObject {
             String message = logMessage.getMessage();
             int indentation = logMessage.getIndentation();
             //
-            for (MLogTarget logTarget: this.getLogTargetsReference()) {
+            for (MLogTarget logTarget: this.getLogTargets()) {
                 logTarget.appendMessage(message, indentation);
             }
         }
index 0f225d51fe31f6d93c84ed1512f50ceab8a232cd..49b4a78262826bf497124e1e114e81167745841f 100644 (file)
@@ -45,7 +45,7 @@ public class MLogPlainTextFile extends MLogTarget {
 
     public void close() throws MLoggingException {
         try {
-            this.getBufferReference().close();
+            this.getBuffer().close();
         }
         catch (IOException exception) {
             throw new MLoggingException("Could not close file.", exception);
@@ -60,7 +60,7 @@ public class MLogPlainTextFile extends MLogTarget {
 
     /* Buffer. */
 
-    protected BufferedWriter getBufferReference() {
+    protected BufferedWriter getBuffer() {
         return this.buffer;
     }
 
@@ -86,10 +86,10 @@ public class MLogPlainTextFile extends MLogTarget {
                 separator.append(" ");
             }
             //
-            synchronized (this.getBufferReference()) {
-                this.getBufferReference().write(timestamp + separator + message);
-                this.getBufferReference().newLine();
-                this.getBufferReference().flush();
+            synchronized (this.getBuffer()) {
+                this.getBuffer().write(timestamp + separator + message);
+                this.getBuffer().newLine();
+                this.getBuffer().flush();
             }
         }
         catch (IOException exception) {
index dc8c5ea66c877845400856247e8a7fd57332f759..12ab73613148181f99d1f5c59b58d9ad449de614 100644 (file)
@@ -75,7 +75,7 @@ public class MSqlConnection extends MObject {
         }
         // Set SQL mode to standard ANSI.
         try {
-            this.getConnectionReference().createStatement().executeUpdate("SET SQL_MODE='ANSI'");
+            this.getConnection().createStatement().executeUpdate("SET SQL_MODE='ANSI'");
         }
         catch (SQLException exception) {
             throw new MSqlConnectionFailureException("Could not set SQL mode to ANSI.", exception);
@@ -84,7 +84,7 @@ public class MSqlConnection extends MObject {
 
     public void close() throws MSqlConnectionFailureException {
         try {
-            this.getConnectionReference().close();
+            this.getConnection().close();
         }
         catch (SQLException exception) {
             throw new MSqlConnectionFailureException("Could not close connection.", exception);
@@ -93,7 +93,7 @@ public class MSqlConnection extends MObject {
 
     public boolean isClosed() throws MSqlConnectionFailureException {
         try {
-            return this.getConnectionReference().isClosed();
+            return this.getConnection().isClosed();
         }
         catch (SQLException exception) {
             throw new MSqlConnectionFailureException("Could not determine the state.", exception);
@@ -134,7 +134,7 @@ public class MSqlConnection extends MObject {
 
     /* Connection. */
 
-    protected Connection getConnectionReference() {
+    protected Connection getConnection() {
         return this.connection;
     }
 
@@ -157,8 +157,8 @@ public class MSqlConnection extends MObject {
             throw new MSqlTransactionException("Nested transactions not allowed.");
         }
         try {
-            this.getConnectionReference().setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
-            this.getConnectionReference().setAutoCommit(false);
+            this.getConnection().setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
+            this.getConnection().setAutoCommit(false);
             this.setTransactionStatus(MSqlConnection.TransactionStatus.SUCCESSFUL);
         }
         catch (SQLException exception) {
@@ -171,8 +171,8 @@ public class MSqlConnection extends MObject {
             throw new MSqlTransactionException("Transaction not started.");
         }
         try {
-            this.getConnectionReference().rollback();
-            this.getConnectionReference().setAutoCommit(true);
+            this.getConnection().rollback();
+            this.getConnection().setAutoCommit(true);
             this.setTransactionStatus(MSqlConnection.TransactionStatus.CLOSED);
         }
         catch (SQLException exception) {
@@ -185,8 +185,8 @@ public class MSqlConnection extends MObject {
         switch (this.getTransactionStatus()) {
             case SUCCESSFUL:
                 try {
-                    this.getConnectionReference().commit();
-                    this.getConnectionReference().setAutoCommit(true);
+                    this.getConnection().commit();
+                    this.getConnection().setAutoCommit(true);
                     this.setTransactionStatus(MSqlConnection.TransactionStatus.CLOSED);
                     return MSqlConnection.TransactionStatus.SUCCESSFUL;
                 }
@@ -220,7 +220,7 @@ public class MSqlConnection extends MObject {
         PreparedStatement preparedStatement = null;
         try {
             // Prepare the statement.
-            preparedStatement = this.getConnectionReference().prepareStatement(statement, PreparedStatement.RETURN_GENERATED_KEYS);
+            preparedStatement = this.getConnection().prepareStatement(statement, PreparedStatement.RETURN_GENERATED_KEYS);
             for (int p = 0; parameters.size() > p; p++) {
                 preparedStatement.setObject(p + 1, parameters.get(p));
             }
index 459d228de36ddc94679ebbf9b1201cbcd320681f..7d3210a23953a18bcb86869dbd91a72de27450f6 100644 (file)
@@ -38,16 +38,16 @@ public class MSqlStatementResults extends MObject {
         this.preparedStatement = preparedStatement;
         //
         try {
-            this.resultSet = this.getPreparedStatementReference().getResultSet();
-            if (null != this.getResultSetReference()) {
-                while (this.getResultSetReference().next()) {
-                    ResultSetMetaData resultSetMetaData = this.getResultSetReference().getMetaData();
+            this.resultSet = this.getPreparedStatement().getResultSet();
+            if (null != this.getResultSet()) {
+                while (this.getResultSet().next()) {
+                    ResultSetMetaData resultSetMetaData = this.getResultSet().getMetaData();
                     LinkedHashMap<String, Object> record = new LinkedHashMap<String, Object>();
                     for (int f = 0; resultSetMetaData.getColumnCount() > f; f++) {
                         String field = resultSetMetaData.getColumnLabel(f + 1);
-                        record.put(field, this.getResultSetReference().getObject(field));
+                        record.put(field, this.getResultSet().getObject(field));
                     }
-                    this.getRecordsReference().add(record);
+                    this.getRecords().add(record);
                 }
             }
         }
@@ -56,9 +56,9 @@ public class MSqlStatementResults extends MObject {
         }
         //
         try {
-            ResultSet generatedKeysResultSet = this.getPreparedStatementReference().getGeneratedKeys();
+            ResultSet generatedKeysResultSet = this.getPreparedStatement().getGeneratedKeys();
             while (generatedKeysResultSet.next()) {
-                this.getGeneratedKeysReference().add(generatedKeysResultSet.getObject(1));
+                this.getGeneratedKeys().add(generatedKeysResultSet.getObject(1));
             }
             generatedKeysResultSet.close();
         }
@@ -69,10 +69,10 @@ public class MSqlStatementResults extends MObject {
 
     public void close() throws MSqlConnectionFailureException {
         try {
-            if (null != this.getResultSetReference()) {
-                this.getResultSetReference().close();
+            if (null != this.getResultSet()) {
+                this.getResultSet().close();
             }
-            this.getPreparedStatementReference().close();
+            this.getPreparedStatement().close();
         }
         catch (SQLException exception) {
             throw new MSqlConnectionFailureException("Could not close statement and/or result set references.", exception);
@@ -89,30 +89,18 @@ public class MSqlStatementResults extends MObject {
 
     /* References. */
 
-    protected PreparedStatement getPreparedStatementReference() {
+    protected PreparedStatement getPreparedStatement() {
         return this.preparedStatement;
     }
 
-    public ResultSet getResultSetReference() {
+    public ResultSet getResultSet() {
         return this.resultSet;
     }
 
     /* Records. */
 
-    protected LinkedList<LinkedHashMap<String, Object>> getRecordsReference() {
-        return this.records;
-    }
-
     public LinkedList<LinkedHashMap<String, Object>> getRecords() {
-        LinkedList<LinkedHashMap<String, Object>> tmpRecords = new LinkedList<LinkedHashMap<String, Object>>();
-        for (LinkedHashMap<String, Object> record: this.getRecordsReference()) {
-            LinkedHashMap<String, Object> tmpRecord = new LinkedHashMap<String, Object>();
-            for (String key: record.keySet()) {
-                tmpRecord.put(key, record.get(key));
-            }
-            tmpRecords.add(tmpRecord);
-        }
-        return tmpRecords;
+        return this.records;
     }
 
     public LinkedList<Object> getRecordsByField(String field) {
@@ -121,7 +109,7 @@ public class MSqlStatementResults extends MObject {
         }
         //
         LinkedList<Object> recordsByField = new LinkedList<Object>();
-        for (LinkedHashMap<String, Object> record: this.getRecordsReference()) {
+        for (LinkedHashMap<String, Object> record: this.getRecords()) {
             Object r = record.get(field);
             if (null == r) {
                 throw new IllegalArgumentException(String.format("Invalid 'field': %s.", field));
@@ -133,17 +121,8 @@ public class MSqlStatementResults extends MObject {
 
     /* Generated keys. */
 
-    protected LinkedHashSet<Object> getGeneratedKeysReference() {
-        return this.generatedKeys;
-    }
-
     public LinkedHashSet<Object> getGeneratedKeys() {
-        LinkedHashSet<Object> tmpGeneratedKeys = new LinkedHashSet<Object>();
-        Iterator i = this.getGeneratedKeysReference().iterator();
-        while (i.hasNext()) {
-            tmpGeneratedKeys.add(i.next());
-        }
-        return tmpGeneratedKeys;
+        return this.generatedKeys;
     }
 
 }
index e172e77bc0259dd082e336ee20619ade6020b6f9..1c7cca47bafd3afbdf35b9dc259b20e082f023f0 100644 (file)
@@ -40,7 +40,7 @@ public class MSqlTable extends MObject {
 
     /* Connection. */
 
-    protected MSqlConnection getConnectionReference() {
+    protected MSqlConnection getConnection() {
         return this.connection;
     }
 
@@ -73,10 +73,10 @@ public class MSqlTable extends MObject {
         }
         fields.delete(fields.length() - 2, fields.length());
         s.delete(s.length() - 2, s.length());
-        return this.getConnectionReference().executePreparedStatement(" INSERT INTO \"" + this.getTable() + "\""
-                                                                    + "             (" + fields + ")"
-                                                                    + " VALUES      (" + s + ")",
-                                                                      p);
+        return this.getConnection().executePreparedStatement(" INSERT INTO \"" + this.getTable() + "\""
+                                                           + "             (" + fields + ")"
+                                                           + " VALUES      (" + s + ")",
+                                                             p);
     }
 
     protected MSqlStatementResults updateRecord(LinkedHashMap<String, Object> map, Object id) throws MSqlStatementException {
@@ -95,10 +95,10 @@ public class MSqlTable extends MObject {
         }
         s.delete(s.length() - 2, s.length());
         p.add(id);
-        return this.getConnectionReference().executePreparedStatement(" UPDATE  \"" + this.getTable() + "\""
-                                                                    + " SET     " + s
-                                                                    + " WHERE   (\"" + this.getTable() + "\".\"" + this.getPrimaryKey() + "\" = ?)",
-                                                                      p);
+        return this.getConnection().executePreparedStatement(" UPDATE  \"" + this.getTable() + "\""
+                                                           + " SET     " + s
+                                                           + " WHERE   (\"" + this.getTable() + "\".\"" + this.getPrimaryKey() + "\" = ?)",
+                                                             p);
     }
 
     public MSqlStatementResults setRecord(LinkedHashMap<String, Object> map, Object id) throws MSqlStatementException {
@@ -117,10 +117,10 @@ public class MSqlTable extends MObject {
         //
         LinkedList<Object> p = new LinkedList<Object>();
         p.add(id);
-        return this.getConnectionReference().executePreparedStatement(" SELECT  *"
-                                                                    + " FROM    \"" + this.getTable() + "\""
-                                                                    + " WHERE   (\"" + this.getTable() + "\".\"" + this.getPrimaryKey() + "\" = ?)",
-                                                                      p);
+        return this.getConnection().executePreparedStatement(" SELECT  *"
+                                                           + " FROM    \"" + this.getTable() + "\""
+                                                           + " WHERE   (\"" + this.getTable() + "\".\"" + this.getPrimaryKey() + "\" = ?)",
+                                                             p);
     }
 
     public MSqlStatementResults deleteRecord(Object id) throws MSqlStatementException {
@@ -130,9 +130,9 @@ public class MSqlTable extends MObject {
         //
         LinkedList<Object> p = new LinkedList<Object>();
         p.add(id);
-        return this.getConnectionReference().executePreparedStatement(" DELETE FROM \"" + this.getTable() + "\""
-                                                                    + " WHERE       (\"" + this.getTable() + "\".\"" + this.getPrimaryKey() + "\" = ?)",
-                                                                      p);
+        return this.getConnection().executePreparedStatement(" DELETE FROM \"" + this.getTable() + "\""
+                                                           + " WHERE       (\"" + this.getTable() + "\".\"" + this.getPrimaryKey() + "\" = ?)",
+                                                             p);
     }
 
     public MSqlStatementResults deleteRecords(LinkedHashSet idSet) throws MSqlStatementException {
@@ -146,9 +146,9 @@ public class MSqlTable extends MObject {
             whereClause.append(" OR (\"" + this.getTable() + "\".\"" + this.getPrimaryKey() + "\" = ?)");
             p.add(id);
         }
-        return this.getConnectionReference().executePreparedStatement(" DELETE FROM \"" + this.getTable() + "\""
-                                                                    + " WHERE       (" + whereClause + ")",
-                                                                      p);
+        return this.getConnection().executePreparedStatement(" DELETE FROM \"" + this.getTable() + "\""
+                                                           + " WHERE       (" + whereClause + ")",
+                                                             p);
     }
 
 }
index 9e2a3b5359aa2205c833b75d606f6b9136ef0b36..dcbf4d85b5e8f829f0950d431c44f96c5298468b 100644 (file)
@@ -63,7 +63,7 @@ public class MTranslator extends MObject {
 
     /* String management. */
 
-    protected LinkedHashMap<String, LinkedHashMap<String, String>> getMessagesReference() {
+    protected LinkedHashMap<String, LinkedHashMap<String, String>> getMessages() {
         return this.messages;
     }
 
@@ -83,7 +83,7 @@ public class MTranslator extends MObject {
         }
         String message = null;
         String line = null;
-        synchronized (this.getMessagesReference()) {
+        synchronized (this.getMessages()) {
             while (true) {
                 try {
                     line = buffer.readLine();
@@ -104,10 +104,10 @@ public class MTranslator extends MObject {
                 }
                 else if (null == message) {
                     message = line;
-                    if (this.getMessagesReference().containsKey(message)) {
+                    if (this.getMessages().containsKey(message)) {
                         throw new MTranslationFileParsingException(String.format("Invalid line: %s: duplicated message: %s.", buffer.getLineNumber(), message));
                     }
-                    this.getMessagesReference().put(message, new LinkedHashMap<String, String>());
+                    this.getMessages().put(message, new LinkedHashMap<String, String>());
                 }
                 else {
                     int a = line.indexOf("=");
@@ -116,10 +116,10 @@ public class MTranslator extends MObject {
                     }
                     String localeRepresentation = line.substring(0, a).trim();
                     String translation = line.substring(a + 1).trim();
-                    if (this.getMessagesReference().get(message).containsKey(localeRepresentation)) {
+                    if (this.getMessages().get(message).containsKey(localeRepresentation)) {
                         throw new MTranslationFileParsingException(String.format("Invalid line: %s: duplicated translation for locale: %s.", buffer.getLineNumber(), message));
                     }
-                    this.getMessagesReference().get(message).put(localeRepresentation, translation);
+                    this.getMessages().get(message).put(localeRepresentation, translation);
                 }
             }
         }
@@ -132,8 +132,8 @@ public class MTranslator extends MObject {
     }
 
     public void clear() {
-        synchronized (this.getMessagesReference()) {
-            this.getMessagesReference().clear();
+        synchronized (this.getMessages()) {
+            this.getMessages().clear();
         }
     }
 
@@ -163,7 +163,7 @@ public class MTranslator extends MObject {
             throw new IllegalArgumentException("Invalid 'locale': null.");
         }
         //
-        if (!this.getMessagesReference().containsKey(message)) {
+        if (!this.getMessages().containsKey(message)) {
             if (strictMode) {
                 throw new MTranslationValueNotFoundException(String.format("Invalid 'message': %s: not available.", message));
             }
@@ -172,7 +172,7 @@ public class MTranslator extends MObject {
         if (this.getBasicLocale().equals(locale)) {
             return message;
         }
-        LinkedHashMap<String, String> messageTranslations = this.getMessagesReference().get(message);
+        LinkedHashMap<String, String> messageTranslations = this.getMessages().get(message);
         String localeRepresentation = locale.toString();
         if (!messageTranslations.containsKey(localeRepresentation)) {
             if (strictMode) {