From 41e72531b209b74571589296a3a33354eb2a1c39 Mon Sep 17 00:00:00 2001
From: Matthew Swift <matthew.swift@forgerock.com>
Date: Tue, 03 Jan 2012 17:05:22 +0000
Subject: [PATCH] Fix OPENDJ-394: Do not declare unchecked exceptions in method declarations

---
 opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/schema/Schema.java |   67 ++++++---------------------------
 1 files changed, 12 insertions(+), 55 deletions(-)

diff --git a/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/schema/Schema.java b/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/schema/Schema.java
index fc65ffe..651cfc9 100644
--- a/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/schema/Schema.java
+++ b/opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/schema/Schema.java
@@ -23,7 +23,7 @@
  *
  *
  *      Copyright 2009-2010 Sun Microsystems, Inc.
- *      Portions copyright 2011 ForgeRock AS
+ *      Portions copyright 2011-2012 ForgeRock AS
  */
 package org.forgerock.opendj.ldap.schema;
 
@@ -134,7 +134,6 @@
 
     @Override
     public DITContentRule getDITContentRule(final String name)
-        throws UnknownSchemaElementException
     {
       throw new UnknownSchemaElementException(WARN_DCR_UNKNOWN.get(name));
     }
@@ -160,7 +159,6 @@
 
     @Override
     public DITStructureRule getDITStructureRule(final int ruleID)
-        throws UnknownSchemaElementException
     {
       throw new UnknownSchemaElementException(WARN_DSR_UNKNOWN.get(String
           .valueOf(ruleID)));
@@ -196,7 +194,6 @@
 
     @Override
     public MatchingRule getMatchingRule(final String name)
-        throws UnknownSchemaElementException
     {
       throw new UnknownSchemaElementException(WARN_MR_UNKNOWN.get(name));
     }
@@ -229,7 +226,6 @@
 
     @Override
     public MatchingRuleUse getMatchingRuleUse(final String name)
-        throws UnknownSchemaElementException
     {
       throw new UnknownSchemaElementException(WARN_MRU_UNKNOWN.get(name));
     }
@@ -255,7 +251,6 @@
 
     @Override
     public NameForm getNameForm(final String name)
-        throws UnknownSchemaElementException
     {
       throw new UnknownSchemaElementException(WARN_NAMEFORM_UNKNOWN.get(name));
     }
@@ -288,7 +283,6 @@
 
     @Override
     public ObjectClass getObjectClass(final String name)
-        throws UnknownSchemaElementException
     {
       throw new UnknownSchemaElementException(
           WARN_OBJECTCLASS_UNKNOWN.get(name));
@@ -427,8 +421,7 @@
 
   private static interface Impl
   {
-    AttributeType getAttributeType(String name)
-        throws UnknownSchemaElementException;
+    AttributeType getAttributeType(String name);
 
 
 
@@ -444,8 +437,7 @@
 
 
 
-    DITContentRule getDITContentRule(String name)
-        throws UnknownSchemaElementException;
+    DITContentRule getDITContentRule(String name);
 
 
 
@@ -457,8 +449,7 @@
 
 
 
-    DITStructureRule getDITStructureRule(int ruleID)
-        throws UnknownSchemaElementException;
+    DITStructureRule getDITStructureRule(int ruleID);
 
 
 
@@ -474,8 +465,7 @@
 
 
 
-    MatchingRule getMatchingRule(String name)
-        throws UnknownSchemaElementException;
+    MatchingRule getMatchingRule(String name);
 
 
 
@@ -491,8 +481,7 @@
 
 
 
-    MatchingRuleUse getMatchingRuleUse(String name)
-        throws UnknownSchemaElementException;
+    MatchingRuleUse getMatchingRuleUse(String name);
 
 
 
@@ -504,7 +493,7 @@
 
 
 
-    NameForm getNameForm(String name) throws UnknownSchemaElementException;
+    NameForm getNameForm(String name);
 
 
 
@@ -520,8 +509,7 @@
 
 
 
-    ObjectClass getObjectClass(String name)
-        throws UnknownSchemaElementException;
+    ObjectClass getObjectClass(String name);
 
 
 
@@ -537,7 +525,7 @@
 
 
 
-    Syntax getSyntax(String numericOID) throws UnknownSchemaElementException;
+    Syntax getSyntax(String numericOID);
 
 
 
@@ -634,7 +622,6 @@
 
     @Override
     public AttributeType getAttributeType(final String name)
-        throws UnknownSchemaElementException
     {
       if (!strictImpl.hasAttributeType(name))
       {
@@ -681,7 +668,6 @@
 
     @Override
     public DITContentRule getDITContentRule(final String name)
-        throws UnknownSchemaElementException
     {
       return strictImpl.getDITContentRule(name);
     }
@@ -707,7 +693,6 @@
 
     @Override
     public DITStructureRule getDITStructureRule(final int ruleID)
-        throws UnknownSchemaElementException
     {
       return strictImpl.getDITStructureRule(ruleID);
     }
@@ -742,7 +727,6 @@
 
     @Override
     public MatchingRule getMatchingRule(final String name)
-        throws UnknownSchemaElementException
     {
       return strictImpl.getMatchingRule(name);
     }
@@ -775,7 +759,6 @@
 
     @Override
     public MatchingRuleUse getMatchingRuleUse(final String name)
-        throws UnknownSchemaElementException
     {
       return strictImpl.getMatchingRuleUse(name);
     }
@@ -801,7 +784,6 @@
 
     @Override
     public NameForm getNameForm(final String name)
-        throws UnknownSchemaElementException
     {
       return strictImpl.getNameForm(name);
     }
@@ -834,7 +816,6 @@
 
     @Override
     public ObjectClass getObjectClass(final String name)
-        throws UnknownSchemaElementException
     {
       return strictImpl.getObjectClass(name);
     }
@@ -1102,7 +1083,6 @@
 
     @Override
     public AttributeType getAttributeType(final String name)
-        throws UnknownSchemaElementException
     {
       final AttributeType type = numericOID2AttributeTypes.get(name);
       if (type != null)
@@ -1160,7 +1140,6 @@
 
     @Override
     public DITContentRule getDITContentRule(final String name)
-        throws UnknownSchemaElementException
     {
       final DITContentRule rule = numericOID2ContentRules.get(name);
       if (rule != null)
@@ -1210,7 +1189,6 @@
 
     @Override
     public DITStructureRule getDITStructureRule(final int ruleID)
-        throws UnknownSchemaElementException
     {
       final DITStructureRule rule = id2StructureRules.get(ruleID);
       if (rule == null)
@@ -1269,7 +1247,6 @@
 
     @Override
     public MatchingRule getMatchingRule(final String name)
-        throws UnknownSchemaElementException
     {
       final MatchingRule rule = numericOID2MatchingRules.get(name);
       if (rule != null)
@@ -1326,7 +1303,6 @@
 
     @Override
     public MatchingRuleUse getMatchingRuleUse(final String name)
-        throws UnknownSchemaElementException
     {
       final MatchingRuleUse rule = numericOID2MatchingRuleUses.get(name);
       if (rule != null)
@@ -1376,7 +1352,6 @@
 
     @Override
     public NameForm getNameForm(final String name)
-        throws UnknownSchemaElementException
     {
       final NameForm form = numericOID2NameForms.get(name);
       if (form != null)
@@ -1443,7 +1418,6 @@
 
     @Override
     public ObjectClass getObjectClass(final String name)
-        throws UnknownSchemaElementException
     {
       final ObjectClass oc = numericOID2ObjectClasses.get(name);
       if (oc != null)
@@ -1502,7 +1476,6 @@
 
     @Override
     public Syntax getSyntax(final String numericOID)
-        throws UnknownSchemaElementException
     {
       final Syntax syntax = numericOID2Syntaxes.get(numericOID);
       if (syntax == null)
@@ -1743,8 +1716,6 @@
   public static FutureResult<Schema> readSchemaAsync(
       final Connection connection, final DN name,
       final ResultHandler<? super Schema> handler)
-      throws UnsupportedOperationException, IllegalStateException,
-      NullPointerException
   {
     final FutureResultTransformer<SchemaBuilder, Schema> future =
       new FutureResultTransformer<SchemaBuilder, Schema>(handler)
@@ -1794,9 +1765,7 @@
    *           If the {@code connection} or {@code name} was {@code null}.
    */
   public static Schema readSchema(final Connection connection, final DN name)
-      throws ErrorResultException, InterruptedException,
-      UnsupportedOperationException, IllegalStateException,
-      NullPointerException
+      throws ErrorResultException, InterruptedException
   {
     return new SchemaBuilder().addSchema(connection, name, true).toSchema();
   }
@@ -1836,8 +1805,6 @@
   public static FutureResult<Schema> readSchemaForEntryAsync(
       final Connection connection, final DN name,
       final ResultHandler<? super Schema> handler)
-      throws UnsupportedOperationException, IllegalStateException,
-      NullPointerException
   {
     final FutureResultTransformer<SchemaBuilder, Schema> future =
       new FutureResultTransformer<SchemaBuilder, Schema>(handler)
@@ -1895,9 +1862,7 @@
    *           If the {@code connection} or {@code name} was {@code null}.
    */
   public static Schema readSchemaForEntry(final Connection connection,
-      final DN name) throws ErrorResultException, InterruptedException,
-      UnsupportedOperationException, IllegalStateException,
-      NullPointerException
+      final DN name) throws ErrorResultException, InterruptedException
   {
     return new SchemaBuilder().addSchemaForEntry(connection, name, true)
         .toSchema();
@@ -2115,7 +2080,6 @@
    *           not found or if the provided name is ambiguous.
    */
   public AttributeType getAttributeType(final String name)
-      throws UnknownSchemaElementException
   {
     return impl.getAttributeType(name);
   }
@@ -2179,7 +2143,6 @@
    *           not found or if the provided name is ambiguous.
    */
   public DITContentRule getDITContentRule(final String name)
-      throws UnknownSchemaElementException
   {
     return impl.getDITContentRule(name);
   }
@@ -2227,7 +2190,6 @@
    *           was not found.
    */
   public DITStructureRule getDITStructureRule(final int ruleID)
-      throws UnknownSchemaElementException
   {
     return impl.getDITStructureRule(ruleID);
   }
@@ -2293,7 +2255,6 @@
    *           not found or if the provided name is ambiguous.
    */
   public MatchingRule getMatchingRule(final String name)
-      throws UnknownSchemaElementException
   {
     return impl.getMatchingRule(name);
   }
@@ -2357,7 +2318,6 @@
    *           was not found or if the provided name is ambiguous.
    */
   public MatchingRuleUse getMatchingRuleUse(final String name)
-      throws UnknownSchemaElementException
   {
     return impl.getMatchingRuleUse(name);
   }
@@ -2406,7 +2366,6 @@
    *           found or if the provided name is ambiguous.
    */
   public NameForm getNameForm(final String name)
-      throws UnknownSchemaElementException
   {
     return impl.getNameForm(name);
   }
@@ -2470,7 +2429,6 @@
    *           found or if the provided name is ambiguous.
    */
   public ObjectClass getObjectClass(final String name)
-      throws UnknownSchemaElementException
   {
     return impl.getObjectClass(name);
   }
@@ -2534,7 +2492,6 @@
    *           or if the provided name is ambiguous.
    */
   public Syntax getSyntax(final String numericOID)
-      throws UnknownSchemaElementException
   {
     return impl.getSyntax(numericOID);
   }
@@ -2730,7 +2687,7 @@
    * @throws NullPointerException
    *           If {@code entry} was {@code null}.
    */
-  public Entry toEntry(final Entry entry) throws NullPointerException
+  public Entry toEntry(final Entry entry)
   {
     Attribute attr = new LinkedAttribute(Schema.ATTR_LDAP_SYNTAXES);
     for (final Syntax syntax : getSyntaxes())

--
Gitblit v1.10.0