commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwins...@apache.org
Subject svn commit: r771683 - in /commons/proper/net/branches/NET_2_0/src/main/java: examples/nntp/ org/apache/commons/net/nntp/
Date Tue, 05 May 2009 12:02:12 GMT
Author: rwinston
Date: Tue May  5 12:02:04 2009
New Revision: 771683

URL: http://svn.apache.org/viewvc?rev=771683&view=rev
Log:
NET-276: Use long instead of int for newsgroup article counts

Modified:
    commons/proper/net/branches/NET_2_0/src/main/java/examples/nntp/ExtendedNNTPOps.java
    commons/proper/net/branches/NET_2_0/src/main/java/examples/nntp/MessageThreading.java
    commons/proper/net/branches/NET_2_0/src/main/java/examples/nntp/NNTPUtils.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/nntp/ArticlePointer.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/nntp/NNTPClient.java
    commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/nntp/NewsgroupInfo.java

Modified: commons/proper/net/branches/NET_2_0/src/main/java/examples/nntp/ExtendedNNTPOps.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/examples/nntp/ExtendedNNTPOps.java?rev=771683&r1=771682&r2=771683&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/examples/nntp/ExtendedNNTPOps.java (original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/examples/nntp/ExtendedNNTPOps.java Tue
May  5 12:02:04 2009
@@ -58,8 +58,8 @@
             // XOVER
             NewsgroupInfo testGroup = new NewsgroupInfo();
             client.selectNewsgroup("alt.test", testGroup);
-            int lowArticleNumber = testGroup.getFirstArticle();
-            int highArticleNumber = lowArticleNumber + 100;
+            long lowArticleNumber = testGroup.getFirstArticle();
+            long  highArticleNumber = lowArticleNumber + 100;
             List<Article> articles = NNTPUtils.getArticleInfo(client, lowArticleNumber,
highArticleNumber);
 
             for (Article article : articles) {

Modified: commons/proper/net/branches/NET_2_0/src/main/java/examples/nntp/MessageThreading.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/examples/nntp/MessageThreading.java?rev=771683&r1=771682&r2=771683&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/examples/nntp/MessageThreading.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/examples/nntp/MessageThreading.java
Tue May  5 12:02:04 2009
@@ -56,8 +56,8 @@
         NewsgroupInfo group = new NewsgroupInfo();
         client.selectNewsgroup("alt.test", group);
         
-        int lowArticleNumber = group.getFirstArticle();
-        int highArticleNumber = lowArticleNumber + 5000;
+        long lowArticleNumber = group.getFirstArticle();
+        long highArticleNumber = lowArticleNumber + 5000;
         
         System.out.println("Retrieving articles between [" + lowArticleNumber + "] and ["
+ highArticleNumber + "]");
         List<Article> articles = NNTPUtils.getArticleInfo(client, lowArticleNumber,
highArticleNumber);

Modified: commons/proper/net/branches/NET_2_0/src/main/java/examples/nntp/NNTPUtils.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/examples/nntp/NNTPUtils.java?rev=771683&r1=771682&r2=771683&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/examples/nntp/NNTPUtils.java (original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/examples/nntp/NNTPUtils.java Tue May
 5 12:02:04 2009
@@ -45,7 +45,7 @@
 	 * @return Article[] An array of Article
 	 * @throws IOException
 	 */
-	public  static List<Article> getArticleInfo(NNTPClient client, int lowArticleNumber,
int highArticleNumber)
+	public  static List<Article> getArticleInfo(NNTPClient client, long lowArticleNumber,
long highArticleNumber)
 	throws IOException {
 		Reader reader = null;
 		List<Article> articles = new ArrayList<Article>();

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/nntp/ArticlePointer.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/nntp/ArticlePointer.java?rev=771683&r1=771682&r2=771683&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/nntp/ArticlePointer.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/nntp/ArticlePointer.java
Tue May  5 12:02:04 2009
@@ -28,7 +28,7 @@
 public final class ArticlePointer
 {
     /** The number of the referenced article. */
-    public int articleNumber;
+    public long articleNumber;
     /**
      * The unique id of the referenced article, including the enclosing
      * &lt and &gt symbols which are technically not part of the

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/nntp/NNTPClient.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/nntp/NNTPClient.java?rev=771683&r1=771682&r2=771683&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/nntp/NNTPClient.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/nntp/NNTPClient.java
Tue May  5 12:02:04 2009
@@ -108,7 +108,7 @@
             // Get article number
             try
             {
-                pointer.articleNumber = Integer.parseInt(tokenizer.nextToken());
+                pointer.articleNumber = Long.parseLong(tokenizer.nextToken());
             }
             catch (NumberFormatException e)
             {
@@ -153,9 +153,9 @@
 
             try
             {
-                info._setArticleCount(Integer.parseInt(count));
-                info._setFirstArticle(Integer.parseInt(first));
-                info._setLastArticle(Integer.parseInt(last));
+                info._setArticleCount(Long.parseLong(count));
+                info._setFirstArticle(Long.parseLong(first));
+                info._setLastArticle(Long.parseLong(last));
             }
             catch (NumberFormatException e)
             {
@@ -176,7 +176,7 @@
     {
         NewsgroupInfo result;
         StringTokenizer tokenizer;
-        int lastNum, firstNum;
+        long lastNum, firstNum;
         String last, first, permission;
 
         result = new NewsgroupInfo();
@@ -192,8 +192,8 @@
 
         try
         {
-            lastNum = Integer.parseInt(last);
-            firstNum = Integer.parseInt(first);
+            lastNum = Long.parseLong(last);
+            firstNum = Long.parseLong(first);
             result._setFirstArticle(firstNum);
             result._setLastArticle(lastNum);
 
@@ -1212,8 +1212,8 @@
      * @return a DotTerminatedReader if successful, null otherwise
      * @throws IOException
      */
-    public Reader retrieveArticleInfo(int lowArticleNumber,
-                                      int highArticleNumber)
+    public Reader retrieveArticleInfo(long lowArticleNumber,
+                                      long highArticleNumber)
         throws IOException
     {
         return

Modified: commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/nntp/NewsgroupInfo.java
URL: http://svn.apache.org/viewvc/commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/nntp/NewsgroupInfo.java?rev=771683&r1=771682&r2=771683&view=diff
==============================================================================
--- commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/nntp/NewsgroupInfo.java
(original)
+++ commons/proper/net/branches/NET_2_0/src/main/java/org/apache/commons/net/nntp/NewsgroupInfo.java
Tue May  5 12:02:04 2009
@@ -54,8 +54,8 @@
     public static final int PROHIBITED_POSTING_PERMISSION = 3;
 
     private String __newsgroup;
-    private int __estimatedArticleCount;
-    private int __firstArticle, __lastArticle;
+    private long __estimatedArticleCount;
+    private long __firstArticle, __lastArticle;
     private int __postingPermission;
 
     void _setNewsgroup(String newsgroup)
@@ -63,17 +63,17 @@
         __newsgroup = newsgroup;
     }
 
-    void _setArticleCount(int count)
+    void _setArticleCount(long count)
     {
         __estimatedArticleCount = count;
     }
 
-    void _setFirstArticle(int first)
+    void _setFirstArticle(long first)
     {
         __firstArticle = first;
     }
 
-    void _setLastArticle(int last)
+    void _setLastArticle(long last)
     {
         __lastArticle = last;
     }
@@ -99,7 +99,7 @@
      * <p>
      * @return The estimated number of articles in the newsgroup.
      ***/
-    public int getArticleCount()
+    public long getArticleCount()
     {
         return __estimatedArticleCount;
     }
@@ -109,7 +109,7 @@
      * <p>
      * @return The number of the first article in the newsgroup.
      ***/
-    public int getFirstArticle()
+    public long getFirstArticle()
     {
         return __firstArticle;
     }
@@ -119,7 +119,7 @@
      * <p>
      * @return The number of the last article in the newsgroup.
      ***/
-    public int getLastArticle()
+    public long getLastArticle()
     {
         return __lastArticle;
     }



Mime
View raw message