Formatting fixes.
[jFCPlib.git] / src / net / pterodactylus / fcp / PersistentPut.java
index 8a1aae5..dc9ec4c 100644 (file)
@@ -23,7 +23,7 @@ package net.pterodactylus.fcp;
  * A “PersistentPut” message notifies a client about a persistent
  * {@link ClientPut} request.
  * 
- * @author <a href="mailto:dr@ina-germany.de">David Roden</a>
+ * @author David ‘Bombe’ Roden &lt;bombe@freenetproject.org&gt;
  */
 public class PersistentPut extends BaseMessage {
 
@@ -49,8 +49,8 @@ public class PersistentPut extends BaseMessage {
        /**
         * Returns the data length of the request.
         * 
-        * @return The data length of the request, or <code>-1</code> if the
-        *         length could not be parsed
+        * @return The data length of the request, or <code>-1</code> if the length
+        *         could not be parsed
         */
        public long getDataLength() {
                return FcpUtils.safeParseLong(getField("DataLength"));
@@ -80,8 +80,8 @@ public class PersistentPut extends BaseMessage {
         * <code>-1</code> is returned each block is tried forever.
         * 
         * @return The maximum number of retries for failed blocks, or
-        *         <code>-1</code> for unlimited retries, or <code>-2</code> if
-        *         the number of retries could not be parsed
+        *         <code>-1</code> for unlimited retries, or <code>-2</code> if the
+        *         number of retries could not be parsed
         */
        public int getMaxRetries() {
                return FcpUtils.safeParseInt(getField("MaxRetries"));
@@ -112,18 +112,14 @@ public class PersistentPut extends BaseMessage {
         *         priority could not be parsed
         */
        public Priority getPriority() {
-               try {
-                       return Priority.values()[Integer.valueOf(getField("PriorityClass"))];
-               } catch (NumberFormatException nfe1) {
-                       return Priority.unknown;
-               }
+               return Priority.values()[FcpUtils.safeParseInt(getField("PriorityClass"), Priority.unknown.ordinal())];
        }
 
        /**
         * Returns whether this request has started.
         * 
-        * @return <code>true</code> if the request has started,
-        *         <code>false</code> otherwise
+        * @return <code>true</code> if the request has started, <code>false</code>
+        *         otherwise
         */
        public boolean isStarted() {
                return Boolean.valueOf(getField("Started"));