Skip to content

Commit

Permalink
Added generics in LDAPException
Browse files Browse the repository at this point in the history
  • Loading branch information
edewata committed Jun 4, 2019
1 parent 4c23680 commit 9af4491
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
13 changes: 7 additions & 6 deletions java-sdk/ietfldap/org/ietf/ldap/LDAPException.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@
* ***** END LICENSE BLOCK ***** */
package org.ietf.ldap;

import java.util.*;
import org.ietf.ldap.client.*;
import org.ietf.ldap.client.opers.*;
import java.io.*;
import java.io.IOException;
import java.io.Serializable;
import java.util.Hashtable;
import java.util.Locale;
import java.util.PropertyResourceBundle;

/**
* Indicates that an error has occurred. An <CODE>LDAPException</CODE>
Expand Down Expand Up @@ -599,7 +600,7 @@ public class LDAPException extends Exception
private String matchedDN = null;
private Throwable rootException = null;
private Locale m_locale = Locale.getDefault();
private static Hashtable cacheResource = new Hashtable();
private static Hashtable<String, PropertyResourceBundle> cacheResource = new Hashtable<>();
private static final String baseName = "org/ietf/ldap/errors/ErrorCodes";

/**
Expand Down Expand Up @@ -1056,7 +1057,7 @@ public synchronized static String resultCodeToString( int code,
try {
String localeStr = locale.toString();
PropertyResourceBundle p =
(PropertyResourceBundle)cacheResource.get(localeStr);
cacheResource.get(localeStr);

if (p == null) {
p = LDAPResourceBundle.getBundle(baseName);
Expand Down
18 changes: 9 additions & 9 deletions java-sdk/ldapjdk/netscape/ldap/LDAPException.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@
* ***** END LICENSE BLOCK ***** */
package netscape.ldap;

import java.util.*;
import netscape.ldap.client.*;
import netscape.ldap.client.opers.*;
import java.io.*;
import java.io.IOException;
import java.util.Hashtable;
import java.util.Locale;
import java.util.PropertyResourceBundle;

/**
* Indicates that an error has occurred. An <CODE>LDAPException</CODE>
Expand Down Expand Up @@ -139,7 +139,7 @@
* 95 <A HREF="#MORE_RESULTS_TO_RETURN">MORE_RESULTS_TO_RETURN</A>
* 96 <A HREF="#CLIENT_LOOP">CLIENT_LOOP</A>
* 97 <A HREF="#REFERRAL_LIMIT_EXCEEDED">REFERRAL_LIMIT_EXCEEDED</A>
* 112 <A HREF="#TLS_NOT_SUPPORTED">TLS_NOT_SUPPORTED</A> (LDAP v3)
* 112 <A HREF="#TLS_NOT_SUPPORTED">TLS_NOT_SUPPORTED</A> (LDAP v3)
* </PRE>
* <P>
*
Expand Down Expand Up @@ -590,7 +590,7 @@ public class LDAPException extends java.lang.Exception
private String extraMessage = null;
private String matchedDN = null;
private Locale m_locale = Locale.getDefault();
private static Hashtable cacheResource = new Hashtable();
private static Hashtable<String, PropertyResourceBundle> cacheResource = new Hashtable<>();
private static final String baseName = "netscape/ldap/errors/ErrorCodes";

/**
Expand Down Expand Up @@ -760,7 +760,7 @@ public int getLDAPResultCode () {
public String getLDAPErrorMessage () {
return errorMessage;
}


/**
* Adds additional explanation to the error message
Expand All @@ -777,7 +777,7 @@ void setExtraMessage (String msg) {
/**
* Returns the maximal subset of a DN which could be matched by the
* server.
*
*
* The method should be used if the server returned one of the
* following errors:
* <UL>
Expand Down Expand Up @@ -925,7 +925,7 @@ public synchronized static String errorCodeToString(int code, Locale locale) {
try {
String localeStr = locale.toString();
PropertyResourceBundle p =
(PropertyResourceBundle)cacheResource.get(localeStr);
cacheResource.get(localeStr);

if (p == null) {
p = LDAPResourceBundle.getBundle(baseName);
Expand Down

0 comments on commit 9af4491

Please sign in to comment.