[kaffe] CVS kaffe (robilad): Resynced with GNU Classpath: fixed coding style diffs for javax/security classes

Kaffe CVS cvs-commits at kaffe.org
Wed Feb 2 02:20:14 PST 2005


PatchSet 5961 
Date: 2005/02/02 10:15:26
Author: robilad
Branch: HEAD
Tag: (none) 
Log:
Resynced with GNU Classpath: fixed coding style diffs for javax/security classes

Members: 
	ChangeLog:1.3500->1.3501 
	libraries/javalib/javax/security/auth/callback/Callback.java:1.3->1.4 
	libraries/javalib/javax/security/auth/callback/CallbackHandler.java:1.3->1.4 
	libraries/javalib/javax/security/auth/callback/ChoiceCallback.java:1.3->1.4 
	libraries/javalib/javax/security/auth/callback/ConfirmationCallback.java:1.3->1.4 
	libraries/javalib/javax/security/auth/callback/LanguageCallback.java:1.3->1.4 
	libraries/javalib/javax/security/auth/callback/NameCallback.java:1.3->1.4 
	libraries/javalib/javax/security/auth/callback/PasswordCallback.java:1.3->1.4 
	libraries/javalib/javax/security/auth/callback/TextInputCallback.java:1.3->1.4 
	libraries/javalib/javax/security/auth/callback/TextOutputCallback.java:1.3->1.4 
	libraries/javalib/javax/security/auth/callback/UnsupportedCallbackException.java:1.3->1.4 
	libraries/javalib/javax/security/auth/login/AccountExpiredException.java:1.2->1.3 
	libraries/javalib/javax/security/auth/login/AppConfigurationEntry.java:1.2->1.3 
	libraries/javalib/javax/security/auth/login/CredentialExpiredException.java:1.2->1.3 
	libraries/javalib/javax/security/auth/login/FailedLoginException.java:1.2->1.3 
	libraries/javalib/javax/security/auth/login/LoginException.java:1.2->1.3 
	libraries/javalib/javax/security/cert/CertificateEncodingException.java:1.4->1.5 

Index: kaffe/ChangeLog
diff -u kaffe/ChangeLog:1.3500 kaffe/ChangeLog:1.3501
--- kaffe/ChangeLog:1.3500	Wed Feb  2 02:45:36 2005
+++ kaffe/ChangeLog	Wed Feb  2 10:15:26 2005
@@ -1,6 +1,27 @@
 2005-02-02  Dalibor Topic  <robilad at kaffe.org>
 
-        libraries/javalib/javax/security/auth/AuthPermission.java,
+	* libraries/javalib/javax/security/auth/callback/Callback.java,
+	libraries/javalib/javax/security/auth/callback/CallbackHandler.java,
+	libraries/javalib/javax/security/auth/callback/ChoiceCallback.java,
+	libraries/javalib/javax/security/auth/callback/ConfirmationCallback.java,
+	libraries/javalib/javax/security/auth/callback/LanguageCallback.java,        
+	libraries/javalib/javax/security/auth/callback/NameCallback.java,
+	libraries/javalib/javax/security/auth/callback/PasswordCallback.java,        
+	libraries/javalib/javax/security/auth/callback/TextInputCallback.java,
+	libraries/javalib/javax/security/auth/callback/TextOutputCallback.java,
+	libraries/javalib/javax/security/auth/callback/UnsupportedCallbackException.java,
+	libraries/javalib/javax/security/auth/login/AccountExpiredException.java,
+	libraries/javalib/javax/security/auth/login/AppConfigurationEntry.java,
+	libraries/javalib/javax/security/auth/login/CredentialExpiredException.java,
+	libraries/javalib/javax/security/auth/login/FailedLoginException.java,
+	libraries/javalib/javax/security/auth/login/LoginException.java,
+        libraries/javalib/javax/security/cert/CertificateEncodingException.java:
+	Resynced with GNU Classpath: fixed the diffs caused by 
+	classpath's coding style.
+
+2005-02-02  Dalibor Topic  <robilad at kaffe.org>
+
+        * libraries/javalib/javax/security/auth/AuthPermission.java,
 	libraries/javalib/javax/security/auth/DestroyFailedException.java,
         libraries/javalib/javax/security/auth/Destroyable.java,
         libraries/javalib/javax/security/auth/Policy.java,
Index: kaffe/libraries/javalib/javax/security/auth/callback/Callback.java
diff -u kaffe/libraries/javalib/javax/security/auth/callback/Callback.java:1.3 kaffe/libraries/javalib/javax/security/auth/callback/Callback.java:1.4
--- kaffe/libraries/javalib/javax/security/auth/callback/Callback.java:1.3	Wed Feb  2 02:45:39 2005
+++ kaffe/libraries/javalib/javax/security/auth/callback/Callback.java	Wed Feb  2 10:15:30 2005
@@ -61,4 +61,4 @@
  * @see TextOutputCallback
  */
 public interface Callback {
-}
\ No newline at end of file
+}
Index: kaffe/libraries/javalib/javax/security/auth/callback/CallbackHandler.java
diff -u kaffe/libraries/javalib/javax/security/auth/callback/CallbackHandler.java:1.3 kaffe/libraries/javalib/javax/security/auth/callback/CallbackHandler.java:1.4
--- kaffe/libraries/javalib/javax/security/auth/callback/CallbackHandler.java:1.3	Wed Feb  2 02:45:39 2005
+++ kaffe/libraries/javalib/javax/security/auth/callback/CallbackHandler.java	Wed Feb  2 10:15:30 2005
@@ -84,72 +84,72 @@
 public interface CallbackHandler
 {
 
-   /**
-    * <p>Retrieve or display the information requested in the provided
-    * {@link Callback}s.</p>
-    *
-    * <p>The <code>handle()</code> method implementation checks the instance(s)
-    * of the {@link Callback} object(s) passed in to retrieve or display the
-    * requested information. The following example is provided to help
-    * demonstrate what an <code>handle()</code> method implementation might look
-    * like. This example code is for guidance only. Many details, including
-    * proper error handling, are left out for simplicity.</p>
-    *
-    * <pre>
-    *public void handle(Callback[] callbacks)
-    *throws IOException, UnsupportedCallbackException {
-    *   for (int i = 0; i < callbacks.length; i++) {
-    *      if (callbacks[i] instanceof TextOutputCallback) {
-    *         // display the message according to the specified type
-    *         TextOutputCallback toc = (TextOutputCallback)callbacks[i];
-    *         switch (toc.getMessageType()) {
-    *         case TextOutputCallback.INFORMATION:
-    *            System.out.println(toc.getMessage());
-    *            break;
-    *         case TextOutputCallback.ERROR:
-    *            System.out.println("ERROR: " + toc.getMessage());
-    *            break;
-    *         case TextOutputCallback.WARNING:
-    *            System.out.println("WARNING: " + toc.getMessage());
-    *            break;
-    *         default:
-    *            throw new IOException("Unsupported message type: "
-    *                  + toc.getMessageType());
-    *         }
-    *      } else if (callbacks[i] instanceof NameCallback) {
-    *         // prompt the user for a username
-    *         NameCallback nc = (NameCallback)callbacks[i];
-    *         // ignore the provided defaultName
-    *         System.err.print(nc.getPrompt());
-    *         System.err.flush();
-    *         nc.setName((new BufferedReader(
-    *               new InputStreamReader(System.in))).readLine());
-    *      } else if (callbacks[i] instanceof PasswordCallback) {
-    *         // prompt the user for sensitive information
-    *         PasswordCallback pc = (PasswordCallback)callbacks[i];
-    *         System.err.print(pc.getPrompt());
-    *         System.err.flush();
-    *         pc.setPassword(readPassword(System.in));
-    *      } else {
-    *         throw new UnsupportedCallbackException(
-    *               callbacks[i], "Unrecognized Callback");
-    *      }
-    *   }
-    *}
-    *
-    * // Reads user password from given input stream.
-    *private char[] readPassword(InputStream in) throws IOException {
-    *   // insert code to read a user password from the input stream
-    *}
-    * </pre>
-    *
-    * @param callbacks an array of {@link Callback} objects provided by an
-    * underlying security service which contains the information requested to
-    * be retrieved or displayed.
-    * @throws IOException if an input or output error occurs.
-    * @throws UnsupportedCallbackException if the implementation of this method
-    * does not support one or more of the Callbacks specified in the
-    * <code>callbacks</code> parameter.
-    */
-   void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException;
-}
\ No newline at end of file
+  /**
+   * <p>Retrieve or display the information requested in the provided
+   * {@link Callback}s.</p>
+   *
+   * <p>The <code>handle()</code> method implementation checks the instance(s)
+   * of the {@link Callback} object(s) passed in to retrieve or display the
+   * requested information. The following example is provided to help
+   * demonstrate what an <code>handle()</code> method implementation might look
+   * like. This example code is for guidance only. Many details, including
+   * proper error handling, are left out for simplicity.</p>
+   *
+   * <pre>
+   *public void handle(Callback[] callbacks)
+   *throws IOException, UnsupportedCallbackException {
+   *   for (int i = 0; i < callbacks.length; i++) {
+   *      if (callbacks[i] instanceof TextOutputCallback) {
+   *         // display the message according to the specified type
+   *         TextOutputCallback toc = (TextOutputCallback)callbacks[i];
+   *         switch (toc.getMessageType()) {
+   *         case TextOutputCallback.INFORMATION:
+   *            System.out.println(toc.getMessage());
+   *            break;
+   *         case TextOutputCallback.ERROR:
+   *            System.out.println("ERROR: " + toc.getMessage());
+   *            break;
+   *         case TextOutputCallback.WARNING:
+   *            System.out.println("WARNING: " + toc.getMessage());
+   *            break;
+   *         default:
+   *            throw new IOException("Unsupported message type: "
+   *                  + toc.getMessageType());
+   *         }
+   *      } else if (callbacks[i] instanceof NameCallback) {
+   *         // prompt the user for a username
+   *         NameCallback nc = (NameCallback)callbacks[i];
+   *         // ignore the provided defaultName
+   *         System.err.print(nc.getPrompt());
+   *         System.err.flush();
+   *         nc.setName((new BufferedReader(
+   *               new InputStreamReader(System.in))).readLine());
+   *      } else if (callbacks[i] instanceof PasswordCallback) {
+   *         // prompt the user for sensitive information
+   *         PasswordCallback pc = (PasswordCallback)callbacks[i];
+   *         System.err.print(pc.getPrompt());
+   *         System.err.flush();
+   *         pc.setPassword(readPassword(System.in));
+   *      } else {
+   *         throw new UnsupportedCallbackException(
+   *               callbacks[i], "Unrecognized Callback");
+   *      }
+   *   }
+   *}
+   *
+   * // Reads user password from given input stream.
+   *private char[] readPassword(InputStream in) throws IOException {
+   *   // insert code to read a user password from the input stream
+   *}
+   * </pre>
+   *
+   * @param callbacks an array of {@link Callback} objects provided by an
+   * underlying security service which contains the information requested to
+   * be retrieved or displayed.
+   * @throws IOException if an input or output error occurs.
+   * @throws UnsupportedCallbackException if the implementation of this method
+   * does not support one or more of the Callbacks specified in the
+   * <code>callbacks</code> parameter.
+   */
+  void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException;
+}
Index: kaffe/libraries/javalib/javax/security/auth/callback/ChoiceCallback.java
diff -u kaffe/libraries/javalib/javax/security/auth/callback/ChoiceCallback.java:1.3 kaffe/libraries/javalib/javax/security/auth/callback/ChoiceCallback.java:1.4
--- kaffe/libraries/javalib/javax/security/auth/callback/ChoiceCallback.java:1.3	Wed Feb  2 02:45:39 2005
+++ kaffe/libraries/javalib/javax/security/auth/callback/ChoiceCallback.java	Wed Feb  2 10:15:30 2005
@@ -51,186 +51,186 @@
 public class ChoiceCallback implements Callback, Serializable
 {
 
-   // Constants and variables
-   // -------------------------------------------------------------------------
+  // Constants and variables
+  // -------------------------------------------------------------------------
 
-   /**
-    * @serial
-    * @since 1.4
-    */
-   private String prompt;
-
-   /**
-    * @serial the list of choices.
-    * @since 1.4
-    */
-   private String[] choices;
-
-   /**
-    * @serial the choice to be used as the default choice.
-    * @since 1.4
-    */
-   private int defaultChoice;
-
-   /**
-    * @serial whether multiple selections are allowed from the list of choices.
-    * @since 1.4
-    */
-   private boolean multipleSelectionsAllowed;
-
-   /**
-    * @serial the selected choices, represented as indexes into the choices list.
-    * @since 1.4
-    */
-   private int[] selections;
-
-   // Constructor(s)
-   //--------------------------------------------------------------------------
-
-   /**
-    * Construct a <code>ChoiceCallback</code> with a prompt, a list of choices,
-    * a default choice, and a boolean specifying whether or not multiple
-    * selections from the list of choices are allowed.
-    *
-    * @param prompt the prompt used to describe the list of choices.
-    * @param choices the list of choices.
-    * @param defaultChoice the choice to be used as the default choice when the
-    * list of choices are displayed. This value is represented as an index into
-    * the <code>choices</code> array.
-    * @param multipleSelectionsAllowed boolean specifying whether or not
-    * multiple selections can be made from the list of choices.
-    * @throws IllegalArgumentException if <code>prompt</code> is <code>null</code>,
-    * if <code>prompt</code> has a length of <code>0</code>, if <code>choices</code>
-    * is <code>null</code>, if <code>choices</code> has a length of <code>0</code>,
-    * if any element from <code>choices</code> is <code>null</code>, if any
-    * element from <code>choices</code> has a length of <code>0</code> or if
-    * <code>defaultChoice</code> does not fall within the array boundaries of
-    * <code>choices</code>.
-    */
-   public ChoiceCallback(String prompt, String[] choices, int defaultChoice,
+  /**
+   * @serial
+   * @since 1.4
+   */
+  private String prompt;
+
+  /**
+   * @serial the list of choices.
+   * @since 1.4
+   */
+  private String[] choices;
+
+  /**
+   * @serial the choice to be used as the default choice.
+   * @since 1.4
+   */
+  private int defaultChoice;
+
+  /**
+   * @serial whether multiple selections are allowed from the list of choices.
+   * @since 1.4
+   */
+  private boolean multipleSelectionsAllowed;
+
+  /**
+   * @serial the selected choices, represented as indexes into the choices list.
+   * @since 1.4
+   */
+  private int[] selections;
+
+  // Constructor(s)
+  //--------------------------------------------------------------------------
+
+  /**
+   * Construct a <code>ChoiceCallback</code> with a prompt, a list of choices,
+   * a default choice, and a boolean specifying whether or not multiple
+   * selections from the list of choices are allowed.
+   *
+   * @param prompt the prompt used to describe the list of choices.
+   * @param choices the list of choices.
+   * @param defaultChoice the choice to be used as the default choice when the
+   * list of choices are displayed. This value is represented as an index into
+   * the <code>choices</code> array.
+   * @param multipleSelectionsAllowed boolean specifying whether or not
+   * multiple selections can be made from the list of choices.
+   * @throws IllegalArgumentException if <code>prompt</code> is <code>null</code>,
+   * if <code>prompt</code> has a length of <code>0</code>, if <code>choices</code>
+   * is <code>null</code>, if <code>choices</code> has a length of <code>0</code>,
+   * if any element from <code>choices</code> is <code>null</code>, if any
+   * element from <code>choices</code> has a length of <code>0</code> or if
+   * <code>defaultChoice</code> does not fall within the array boundaries of
+   * <code>choices</code>.
+   */
+  public ChoiceCallback(String prompt, String[] choices, int defaultChoice,
 			boolean multipleSelectionsAllowed)
   {
-      super();
+    super();
 
-      setPrompt(prompt);
-      setChoices(choices);
+    setPrompt(prompt);
+    setChoices(choices);
     if (defaultChoice < 0 || defaultChoice >= this.choices.length)
       {
-         throw new IllegalArgumentException("default choice is out of bounds");
+	throw new IllegalArgumentException("default choice is out of bounds");
       }
-      this.defaultChoice = defaultChoice;
-      this.multipleSelectionsAllowed = multipleSelectionsAllowed;
-   }
-
-   // Instance methods
-   // -------------------------------------------------------------------------
-
-   /**
-    * Get the prompt.
-    *
-    * @return the prompt.
-    */
+    this.defaultChoice = defaultChoice;
+    this.multipleSelectionsAllowed = multipleSelectionsAllowed;
+  }
+
+  // Instance methods
+  // -------------------------------------------------------------------------
+
+  /**
+   * Get the prompt.
+   *
+   * @return the prompt.
+   */
   public String getPrompt()
   {
-      return prompt;
-   }
+    return prompt;
+  }
 
-   /**
-    * Get the list of choices.
-    *
-    * @return the list of choices.
-    */
+  /**
+   * Get the list of choices.
+   *
+   * @return the list of choices.
+   */
   public String[] getChoices()
   {
-      return choices;
-   }
+    return choices;
+  }
 
-   /**
-    * Get the defaultChoice.
-    *
-    * @return the defaultChoice, represented as an index into the choices list.
-    */
+  /**
+   * Get the defaultChoice.
+   *
+   * @return the defaultChoice, represented as an index into the choices list.
+   */
   public int getDefaultChoice()
   {
-      return defaultChoice;
-   }
+    return defaultChoice;
+  }
 
-   /**
-    * Get the boolean determining whether multiple selections from the choices
-    * list are allowed.
-    *
-    * @return whether multiple selections are allowed.
-    */
+  /**
+   * Get the boolean determining whether multiple selections from the choices
+   * list are allowed.
+   *
+   * @return whether multiple selections are allowed.
+   */
   public boolean allowMultipleSelections()
   {
-      return multipleSelectionsAllowed;
-   }
+    return multipleSelectionsAllowed;
+  }
 
-   /**
-    * Set the selected choice.
-    *
-    * @param selection the selection represented as an index into the choices
-    * list.
-    * @see #getSelectedIndexes()
-    */
+  /**
+   * Set the selected choice.
+   *
+   * @param selection the selection represented as an index into the choices
+   * list.
+   * @see #getSelectedIndexes()
+   */
   public void setSelectedIndex(int selection)
   {
-      this.selections = new int[1];
-      this.selections[0] = selection;
-   }
-
-   /**
-    * Set the selected choices.
-    *
-    * @param selections the selections represented as indexes into the choices
-    * list.
-    * @throws UnsupportedOperationException if multiple selections are not
-    * allowed, as determined by <code>allowMultipleSelections</code>.
-    * @see #getSelectedIndexes()
-    */
+    this.selections = new int[1];
+    this.selections[0] = selection;
+  }
+
+  /**
+   * Set the selected choices.
+   *
+   * @param selections the selections represented as indexes into the choices
+   * list.
+   * @throws UnsupportedOperationException if multiple selections are not
+   * allowed, as determined by <code>allowMultipleSelections</code>.
+   * @see #getSelectedIndexes()
+   */
   public void setSelectedIndexes(int[] selections)
   {
     if (!multipleSelectionsAllowed)
       {
-         throw new UnsupportedOperationException("not allowed");
+	throw new UnsupportedOperationException("not allowed");
       }
 
-      this.selections = selections;
-   }
+    this.selections = selections;
+  }
 
-   /**
-    * Get the selected choices.
-    *
-    * @return the selected choices, represented as indexes into the choices list.
-    * @see #setSelectedIndexes(int[])
-    */
+  /**
+   * Get the selected choices.
+   *
+   * @return the selected choices, represented as indexes into the choices list.
+   * @see #setSelectedIndexes(int[])
+   */
   public int[] getSelectedIndexes()
   {
-      return selections;
-   }
+    return selections;
+  }
 
   private void setPrompt(String prompt) throws IllegalArgumentException
   {
     if ((prompt == null) || (prompt.length() == 0))
       {
-         throw new IllegalArgumentException("invalid prompt");
+	throw new IllegalArgumentException("invalid prompt");
       }
-      this.prompt = prompt;
-   }
+    this.prompt = prompt;
+  }
 
   private void setChoices(String[] choices) throws IllegalArgumentException
   {
     if (choices == null || choices.length == 0)
       {
-         throw new IllegalArgumentException("invalid choices");
+	throw new IllegalArgumentException("invalid choices");
       }
     for (int i = 0; i < choices.length; i++)
       {
 	if (choices[i] == null || choices[i].length() == 0)
 	  {
-            throw new IllegalArgumentException("invalid choice at index #"+i);
-         }
+	    throw new IllegalArgumentException("invalid choice at index #"+i);
+	  }
       }
-      this.choices = choices;
-   }
-}
\ No newline at end of file
+    this.choices = choices;
+  }
+}
Index: kaffe/libraries/javalib/javax/security/auth/callback/ConfirmationCallback.java
diff -u kaffe/libraries/javalib/javax/security/auth/callback/ConfirmationCallback.java:1.3 kaffe/libraries/javalib/javax/security/auth/callback/ConfirmationCallback.java:1.4
--- kaffe/libraries/javalib/javax/security/auth/callback/ConfirmationCallback.java:1.3	Wed Feb  2 02:45:39 2005
+++ kaffe/libraries/javalib/javax/security/auth/callback/ConfirmationCallback.java	Wed Feb  2 10:15:30 2005
@@ -51,377 +51,377 @@
 public class ConfirmationCallback implements Callback, Serializable
 {
 
-   // Constants and variables
-   // -------------------------------------------------------------------------
+  // Constants and variables
+  // -------------------------------------------------------------------------
 
-   /**
-    * <p>Unspecified option type.</p>
-    *
-    * <p>The <code>getOptionType</code> method returns this value if this
-    * <code>ConfirmationCallback</code> was instantiated with <code>options</code>
-    * instead of an <code>optionType</code>.</p>
-    */
-   public static final int UNSPECIFIED_OPTION = -1;
-
-   /**
-    * <p>YES/NO confirmation option.</p>
-    *
-    * <p>An underlying security service specifies this as the <code>optionType</code>
-    * to a <code>ConfirmationCallback</code> constructor if it requires a
-    * confirmation which can be answered with either <code>YES</code> or
-    * <code>NO</code>.</p>
-    */
-   public static final int YES_NO_OPTION = 0;
-
-   /**
-    * <p>YES/NO/CANCEL confirmation confirmation option.</p>
-    *
-    * <p>An underlying security service specifies this as the <code>optionType</code>
-    * to a <code>ConfirmationCallback</code> constructor if it requires a
-    * confirmation which can be answered with either <code>YES</code>,
-    * <code>NO</code> or <code>CANCEL</code>.
-    */
-   public static final int YES_NO_CANCEL_OPTION = 1;
-
-   /**
-    * <p>OK/CANCEL confirmation confirmation option.</p>
-    *
-    * <p>An underlying security service specifies this as the <code>optionType</code>
-    * to a <code>ConfirmationCallback</code> constructor if it requires a
-    * confirmation which can be answered with either <code>OK</code> or
-    * <code>CANCEL</code>.</p>
-    */
-   public static final int OK_CANCEL_OPTION = 2;
-
-   /**
-    * <p>YES option.</p>
-    *
-    * <p>If an <code>optionType</code> was specified to this
-    * <code>ConfirmationCallback</code>, this option may be specified as a
-    * <code>defaultOption</code> or returned as the selected index.</p>
-    */
-   public static final int YES = 0;
-
-   /**
-    * <p>NO option.</p>
-    *
-    * <p>If an <code>optionType</code> was specified to this
-    * <code>ConfirmationCallback</code>, this option may be specified as a
-    * <code>defaultOption</code> or returned as the selected index.</p>
-    */
-   public static final int NO = 1;
-
-   /**
-    * <p>CANCEL option.</p>
-    *
-    * <p>If an <code>optionType</code> was specified to this
-    * <code>ConfirmationCallback</code>, this option may be specified as a
-    * <code>defaultOption</code> or returned as the selected index.</p>
-    */
-   public static final int CANCEL = 2;
-
-   /**
-    * <p>OK option.</p>
-    *
-    * <p>If an <code>optionType</code> was specified to this
-    * <code>ConfirmationCallback</code>, this option may be specified as a
-    * <code>defaultOption</code> or returned as the selected index.</p>
-    */
-   public static final int OK = 3;
-
-   /** INFORMATION message type. */
-   public static final int INFORMATION = 0;
-
-   /** WARNING message type. */
-   public static final int WARNING = 1;
-
-   /** ERROR message type. */
-   public static final int ERROR = 2;
-
-   /**
-    * @serial
-    * @since 1.4
-    */
-   private String prompt;
-
-   /**
-    * @serial
-    * @since 1.4
-    */
-   private int messageType;
-
-   /**
-    * @serial
-    * @since 1.4
-    */
-   private int optionType;
-
-   /**
-    * @serial
-    * @since 1.4
-    */
-   private int defaultOption;
-
-   /**
-    * @serial
-    * @since 1.4
-    */
-   private String[] options = null;
-
-   /**
-    * @serial
-    * @since 1.4
-    */
-   private int selection;
-
-   // Constructor(s)
-   // -------------------------------------------------------------------------
-
-   /**
-    * <p>Construct a <code>ConfirmationCallback</code> with a message type, an
-    * option type and a default option.</p>
-    *
-    * <p>Underlying security services use this constructor if they require
-    * either a YES/NO, YES/NO/CANCEL or OK/CANCEL confirmation.</p>
-    *
-    * @param messageType the message type (INFORMATION, WARNING or ERROR).
-    * @param optionType the option type (YES_NO_OPTION, YES_NO_CANCEL_OPTION or
-    * OK_CANCEL_OPTION).
-    * @param defaultOption the default option from the provided optionType (YES,
-    * NO, CANCEL or OK).
-    * @throws IllegalArgumentException if <code>messageType</code> is not either
-    * <code>INFORMATION</code>, <code>WARNING</code>, or <code>ERROR</code>, if
-    * <code>optionType</code> is not either <code>YES_NO_OPTION</code>,
-    * <code>YES_NO_CANCEL_OPTION</code>, or <code>OK_CANCEL_OPTION</code>, or if
-    * <code>defaultOption</code> does not correspond to one of the options in
-    * <code>optionType</code>.
-    */
-   public ConfirmationCallback(int messageType, int optionType, int defaultOption)
+  /**
+   * <p>Unspecified option type.</p>
+   *
+   * <p>The <code>getOptionType</code> method returns this value if this
+   * <code>ConfirmationCallback</code> was instantiated with <code>options</code>
+   * instead of an <code>optionType</code>.</p>
+   */
+  public static final int UNSPECIFIED_OPTION = -1;
+
+  /**
+   * <p>YES/NO confirmation option.</p>
+   *
+   * <p>An underlying security service specifies this as the <code>optionType</code>
+   * to a <code>ConfirmationCallback</code> constructor if it requires a
+   * confirmation which can be answered with either <code>YES</code> or
+   * <code>NO</code>.</p>
+   */
+  public static final int YES_NO_OPTION = 0;
+
+  /**
+   * <p>YES/NO/CANCEL confirmation confirmation option.</p>
+   *
+   * <p>An underlying security service specifies this as the <code>optionType</code>
+   * to a <code>ConfirmationCallback</code> constructor if it requires a
+   * confirmation which can be answered with either <code>YES</code>,
+   * <code>NO</code> or <code>CANCEL</code>.
+   */
+  public static final int YES_NO_CANCEL_OPTION = 1;
+
+  /**
+   * <p>OK/CANCEL confirmation confirmation option.</p>
+   *
+   * <p>An underlying security service specifies this as the <code>optionType</code>
+   * to a <code>ConfirmationCallback</code> constructor if it requires a
+   * confirmation which can be answered with either <code>OK</code> or
+   * <code>CANCEL</code>.</p>
+   */
+  public static final int OK_CANCEL_OPTION = 2;
+
+  /**
+   * <p>YES option.</p>
+   *
+   * <p>If an <code>optionType</code> was specified to this
+   * <code>ConfirmationCallback</code>, this option may be specified as a
+   * <code>defaultOption</code> or returned as the selected index.</p>
+   */
+  public static final int YES = 0;
+
+  /**
+   * <p>NO option.</p>
+   *
+   * <p>If an <code>optionType</code> was specified to this
+   * <code>ConfirmationCallback</code>, this option may be specified as a
+   * <code>defaultOption</code> or returned as the selected index.</p>
+   */
+  public static final int NO = 1;
+
+  /**
+   * <p>CANCEL option.</p>
+   *
+   * <p>If an <code>optionType</code> was specified to this
+   * <code>ConfirmationCallback</code>, this option may be specified as a
+   * <code>defaultOption</code> or returned as the selected index.</p>
+   */
+  public static final int CANCEL = 2;
+
+  /**
+   * <p>OK option.</p>
+   *
+   * <p>If an <code>optionType</code> was specified to this
+   * <code>ConfirmationCallback</code>, this option may be specified as a
+   * <code>defaultOption</code> or returned as the selected index.</p>
+   */
+  public static final int OK = 3;
+
+  /** INFORMATION message type. */
+  public static final int INFORMATION = 0;
+
+  /** WARNING message type. */
+  public static final int WARNING = 1;
+
+  /** ERROR message type. */
+  public static final int ERROR = 2;
+
+  /**
+   * @serial
+   * @since 1.4
+   */
+  private String prompt;
+
+  /**
+   * @serial
+   * @since 1.4
+   */
+  private int messageType;
+
+  /**
+   * @serial
+   * @since 1.4
+   */
+  private int optionType;
+
+  /**
+   * @serial
+   * @since 1.4
+   */
+  private int defaultOption;
+
+  /**
+   * @serial
+   * @since 1.4
+   */
+  private String[] options = null;
+
+  /**
+   * @serial
+   * @since 1.4
+   */
+  private int selection;
+
+  // Constructor(s)
+  // -------------------------------------------------------------------------
+
+  /**
+   * <p>Construct a <code>ConfirmationCallback</code> with a message type, an
+   * option type and a default option.</p>
+   *
+   * <p>Underlying security services use this constructor if they require
+   * either a YES/NO, YES/NO/CANCEL or OK/CANCEL confirmation.</p>
+   *
+   * @param messageType the message type (INFORMATION, WARNING or ERROR).
+   * @param optionType the option type (YES_NO_OPTION, YES_NO_CANCEL_OPTION or
+   * OK_CANCEL_OPTION).
+   * @param defaultOption the default option from the provided optionType (YES,
+   * NO, CANCEL or OK).
+   * @throws IllegalArgumentException if <code>messageType</code> is not either
+   * <code>INFORMATION</code>, <code>WARNING</code>, or <code>ERROR</code>, if
+   * <code>optionType</code> is not either <code>YES_NO_OPTION</code>,
+   * <code>YES_NO_CANCEL_OPTION</code>, or <code>OK_CANCEL_OPTION</code>, or if
+   * <code>defaultOption</code> does not correspond to one of the options in
+   * <code>optionType</code>.
+   */
+  public ConfirmationCallback(int messageType, int optionType, int defaultOption)
     throws IllegalArgumentException
   {
-      super();
+    super();
 
-      setMessageType(messageType);
-      setOptionType(optionType, defaultOption);
-      this.defaultOption = defaultOption;
-   }
-
-   /**
-    * <p>Construct a <code>ConfirmationCallback</code> with a message type, a
-    * list of options and a default option.</p>
-    *
-    * <p>Underlying security services use this constructor if they require a
-    * confirmation different from the available preset confirmations provided
-    * (for example, CONTINUE/ABORT or STOP/GO). The confirmation options are
-    * listed in the <code>options</code> array, and are displayed by the
-    * {@link CallbackHandler} implementation in a manner consistent with the
-    * way preset options are displayed.</p>
-    *
-    * @param messageType the message type (INFORMATION, WARNING or ERROR).
-    * @param options the list of confirmation options.
-    * @param defaultOption the default option, represented as an index into the
-    * <code>options</code> array.
-    * @throws IllegalArgumentException if <code>messageType</code> is not either
-    * <code>INFORMATION</code>, <code>WARNING</code>, or <code>ERROR</code>, if
-    * <code>options</code> is <code>null</code>, if <code>options</code> has a
-    * length of <code>0</code>, if any element from <code>options</code> is
-    * <code>null</code>, if any element from <code>options</code> has a length
-    * of <code>0</code>, or if <code>defaultOption</code> does not lie within
-    * the array boundaries of <code>options</code>.
-    */
+    setMessageType(messageType);
+    setOptionType(optionType, defaultOption);
+    this.defaultOption = defaultOption;
+  }
+
+  /**
+   * <p>Construct a <code>ConfirmationCallback</code> with a message type, a
+   * list of options and a default option.</p>
+   *
+   * <p>Underlying security services use this constructor if they require a
+   * confirmation different from the available preset confirmations provided
+   * (for example, CONTINUE/ABORT or STOP/GO). The confirmation options are
+   * listed in the <code>options</code> array, and are displayed by the
+   * {@link CallbackHandler} implementation in a manner consistent with the
+   * way preset options are displayed.</p>
+   *
+   * @param messageType the message type (INFORMATION, WARNING or ERROR).
+   * @param options the list of confirmation options.
+   * @param defaultOption the default option, represented as an index into the
+   * <code>options</code> array.
+   * @throws IllegalArgumentException if <code>messageType</code> is not either
+   * <code>INFORMATION</code>, <code>WARNING</code>, or <code>ERROR</code>, if
+   * <code>options</code> is <code>null</code>, if <code>options</code> has a
+   * length of <code>0</code>, if any element from <code>options</code> is
+   * <code>null</code>, if any element from <code>options</code> has a length
+   * of <code>0</code>, or if <code>defaultOption</code> does not lie within
+   * the array boundaries of <code>options</code>.
+   */
   public ConfirmationCallback(int messageType, String[] options, int defaultOption)
   {
-      super();
+    super();
 
-      setMessageType(messageType);
-      setOptions(options, defaultOption);
-      this.defaultOption = defaultOption;
-   }
-
-   /**
-    * <p>Construct a <code>ConfirmationCallback</code> with a prompt, message
-    * type, an option type and a default option.</p>
-    *
-    * <p>Underlying security services use this constructor if they require
-    * either a YES/NO, YES/NO/CANCEL or OK/CANCEL confirmation.</p>
-    *
-    * @param prompt the prompt used to describe the list of options.
-    * @param messageType the message type (INFORMATION, WARNING or ERROR).
-    * @param optionType the option type (YES_NO_OPTION, YES_NO_CANCEL_OPTION or
-    * OK_CANCEL_OPTION).
-    * @param defaultOption the default option from the provided optionType (YES,
-    * NO, CANCEL or OK).
-    * @throws IllegalArgumentException if <code>prompt</code> is <code>null</code>,
-    * if <code>prompt</code> has a length of <code>0</code>, if
-    * <code>messageType</code> is not either <ode>INFORMATION</code>,
-    * <code>WARNING</code>, or <code>ERROR</code>, if <code>optionType</code> is
-    * not either <code>YES_NO_OPTION</code>, <code>YES_NO_CANCEL_OPTION</code>,
-    * or <code>OK_CANCEL_OPTION</code>, or if <code>defaultOption</code> does
-    * not correspond to one of the options in <code>optionType</code>.
-    */
-   public ConfirmationCallback(String prompt, int messageType, int optionType,
+    setMessageType(messageType);
+    setOptions(options, defaultOption);
+    this.defaultOption = defaultOption;
+  }
+
+  /**
+   * <p>Construct a <code>ConfirmationCallback</code> with a prompt, message
+   * type, an option type and a default option.</p>
+   *
+   * <p>Underlying security services use this constructor if they require
+   * either a YES/NO, YES/NO/CANCEL or OK/CANCEL confirmation.</p>
+   *
+   * @param prompt the prompt used to describe the list of options.
+   * @param messageType the message type (INFORMATION, WARNING or ERROR).
+   * @param optionType the option type (YES_NO_OPTION, YES_NO_CANCEL_OPTION or
+   * OK_CANCEL_OPTION).
+   * @param defaultOption the default option from the provided optionType (YES,
+   * NO, CANCEL or OK).
+   * @throws IllegalArgumentException if <code>prompt</code> is <code>null</code>,
+   * if <code>prompt</code> has a length of <code>0</code>, if
+   * <code>messageType</code> is not either <ode>INFORMATION</code>,
+   * <code>WARNING</code>, or <code>ERROR</code>, if <code>optionType</code> is
+   * not either <code>YES_NO_OPTION</code>, <code>YES_NO_CANCEL_OPTION</code>,
+   * or <code>OK_CANCEL_OPTION</code>, or if <code>defaultOption</code> does
+   * not correspond to one of the options in <code>optionType</code>.
+   */
+  public ConfirmationCallback(String prompt, int messageType, int optionType,
 			      int defaultOption)
   {
-      super();
+    super();
 
-      setPrompt(prompt);
-      setMessageType(messageType);
-      setOptionType(optionType, defaultOption);
-      this.defaultOption = defaultOption;
-   }
-
-   /**
-    * <p>Construct a <code>ConfirmationCallback</code> with a prompt, message
-    * type, a list of options and a default option.</p>
-    *
-    * <p>Underlying security services use this constructor if they require a
-    * confirmation different from the available preset confirmations provided
-    * (for example, CONTINUE/ABORT or STOP/GO). The confirmation options are
-    * listed in the <code>options</code> array, and are displayed by the
-    * {@link CallbackHandler} implementation in a manner consistent with the
-    * way preset options are displayed.</p>
-    *
-    * @param prompt the prompt used to describe the list of options.
-    * @param messageType the message type (INFORMATION, WARNING or ERROR).
-    * @param options the list of confirmation options.
-    * @param defaultOption the default option, represented as an index into the
-    * <code>options</code> array.
-    * @throws IllegalArgumentException if <code>prompt</code> is <code>null</code>,
-    * if <code>prompt</code> has a length of <code>0</code>, if
-    * <code>messageType</code> is not either <ode>INFORMATION</code>,
-    * <code>WARNING</code>, or <code>ERROR</code>, if <code>options</code> is
-    * <code>null</code>, if <code>options</code> has a length of <code>0</code>,
-    * if any element from <code>options</code> is <code>null</code>, if any
-    * element from <code>options</code> has a length of <code>0</code>, or if
-    * <code>defaultOption</code> does not lie within the array boundaries of

*** Patch too long, truncated ***




More information about the kaffe mailing list