You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mahout.apache.org by "Benson Margulies (JIRA)" <ji...@apache.org> on 2009/05/29 15:50:45 UTC

[jira] Created: (MAHOUT-127) Remove warnings

Remove warnings 
----------------

                 Key: MAHOUT-127
                 URL: https://issues.apache.org/jira/browse/MAHOUT-127
             Project: Mahout
          Issue Type: Bug
            Reporter: Benson Margulies


The patch I'm about to attach gets rid of all the current yellow triangles for Eclipse 3.4.



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Re: [jira] Commented: (MAHOUT-127) Remove warnings

Posted by Sean Owen <sr...@gmail.com>.
By default ID do you mean no serialVersionUID? Then I agree. Setting any
particular value though would introduce the concern I mentioned. And fixing
it to a particular vale like 1 would be even more problematic.

On May 29, 2009 4:11 PM, "Benson Margulies (JIRA)" <ji...@apache.org> wrote:


   [
https://issues.apache.org/jira/browse/MAHOUT-127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12714480#action_12714480]

Benson Margulies commented on MAHOUT-127:
-----------------------------------------

The cast changes were overuse of the Eclipse code clean-up wizard on my
part. Oops, in other words. For the reason alone, I want to revert all and
rerun the process.

I should have asked first. If you'd prefer the 'default' ID to the generated
ID, I'll do that.

> Remove warnings > ---------------- > > Key: MAHOUT-127 > URL: ...

Re: [jira] Commented: (MAHOUT-127) Remove warnings

Posted by Sean Owen <sr...@gmail.com>.
I can't find any documentation that 1L is a special value, that
prompts the JVM to go construct its own value. I find some posts to
the contrary too, like
http://www.nabble.com/serialVersionUID-td23001300.html and
https://jira.jboss.org/jira/browse/SECURITY-341

Setting it to 1L is worse than setting it explicitly to the value that
the JVM would compute anyway, since it connotes that "this is the
right value, I intended to override the JVM mechanism, I'm subtly
suggesting all versions of this class will be
serialization-compatible." and that's no good.

Personally I find it weird that javac's default lint settings include
warning about classes without serialVersionUID since, in fact, it
seems like quite an exceptional thing to define this field.

On Fri, May 29, 2009 at 4:36 PM, Benson Margulies (JIRA)
<ji...@apache.org> wrote:
>
>    [ https://issues.apache.org/jira/browse/MAHOUT-127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12714487#action_12714487 ]
>
> Benson Margulies commented on MAHOUT-127:
> -----------------------------------------
>
> Are you sure? Eclipse claims that coding '1' has the effect of getting the default behavior without getting a warning.
>
>> Remove warnings
>> ----------------
>>
>>                 Key: MAHOUT-127
>>                 URL: https://issues.apache.org/jira/browse/MAHOUT-127
>>             Project: Mahout
>>          Issue Type: Bug
>>            Reporter: Benson Margulies
>>         Attachments: warnings.diff
>>
>>
>> The patch I'm about to attach gets rid of all the current yellow triangles for Eclipse 3.4.
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>

[jira] Commented: (MAHOUT-127) Remove warnings

Posted by "Benson Margulies (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAHOUT-127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12714920#action_12714920 ] 

Benson Margulies commented on MAHOUT-127:
-----------------------------------------

did we both forget to run mvn clean install?




> Remove warnings 
> ----------------
>
>                 Key: MAHOUT-127
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-127
>             Project: Mahout
>          Issue Type: Improvement
>    Affects Versions: 0.2
>            Reporter: Benson Margulies
>            Assignee: Sean Owen
>            Priority: Minor
>             Fix For: 0.2
>
>         Attachments: warnings.diff, warnings.patch
>
>
> The patch I'm about to attach gets rid of all the current yellow triangles for Eclipse 3.4.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (MAHOUT-127) Remove warnings

Posted by "Sean Owen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MAHOUT-127?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sean Owen resolved MAHOUT-127.
------------------------------

    Resolution: Fixed

> Remove warnings 
> ----------------
>
>                 Key: MAHOUT-127
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-127
>             Project: Mahout
>          Issue Type: Improvement
>    Affects Versions: 0.2
>            Reporter: Benson Margulies
>            Assignee: Sean Owen
>            Priority: Minor
>             Fix For: 0.2
>
>         Attachments: warnings.diff, warnings.patch
>
>
> The patch I'm about to attach gets rid of all the current yellow triangles for Eclipse 3.4.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (MAHOUT-127) Remove warnings

Posted by "Benson Margulies (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MAHOUT-127?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benson Margulies updated MAHOUT-127:
------------------------------------

    Attachment: warnings.diff

> Remove warnings 
> ----------------
>
>                 Key: MAHOUT-127
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-127
>             Project: Mahout
>          Issue Type: Bug
>            Reporter: Benson Margulies
>         Attachments: warnings.diff
>
>
> The patch I'm about to attach gets rid of all the current yellow triangles for Eclipse 3.4.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MAHOUT-127) Remove warnings

Posted by "Sean Owen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAHOUT-127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12714913#action_12714913 ] 

Sean Owen commented on MAHOUT-127:
----------------------------------

I think javac is right, though I find myself a little confused as to exactly why. In the meantime I reverted the change.

LongWritable implements WritableComparable<T> but does not bound the generic type. It almost surely should. That's the issue, it seems. But I suppose I am not 100% clear on why javac does not consider LongWritable to be assignment-compatible with WritableComparable<?> since that is, AFAIK, equivalent to WritableComparable (raw type).

> Remove warnings 
> ----------------
>
>                 Key: MAHOUT-127
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-127
>             Project: Mahout
>          Issue Type: Improvement
>    Affects Versions: 0.2
>            Reporter: Benson Margulies
>            Assignee: Sean Owen
>            Priority: Minor
>             Fix For: 0.2
>
>         Attachments: warnings.diff, warnings.patch
>
>
> The patch I'm about to attach gets rid of all the current yellow triangles for Eclipse 3.4.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (MAHOUT-127) Remove warnings

Posted by "Benson Margulies (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MAHOUT-127?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benson Margulies updated MAHOUT-127:
------------------------------------

    Attachment:     (was: warnings.diff)

> Remove warnings 
> ----------------
>
>                 Key: MAHOUT-127
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-127
>             Project: Mahout
>          Issue Type: Bug
>            Reporter: Benson Margulies
>         Attachments: warnings.diff
>
>
> The patch I'm about to attach gets rid of all the current yellow triangles for Eclipse 3.4.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MAHOUT-127) Remove warnings

Posted by "Benson Margulies (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAHOUT-127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12714935#action_12714935 ] 

Benson Margulies commented on MAHOUT-127:
-----------------------------------------

This is a hadoop prank and I'm not sure what to do about it.

The 'right' thing to put in DummyOutputCollector is 

public class DummyOutputCollector<K extends WritableComparable<BinaryComparable>, V extends Writable> implements OutputCollector<K, V> {

That doesn't work, however, because of the use of LongWritable in EvalMapperTest. LongWritable inherits the WritableComparable interface without any parameters. So I think an @SuppressWarnings is called for in DummyOutputCollector until/unless Hadoop gets better, unless someone wants to find a way around using LongWritable.


> Remove warnings 
> ----------------
>
>                 Key: MAHOUT-127
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-127
>             Project: Mahout
>          Issue Type: Improvement
>    Affects Versions: 0.2
>            Reporter: Benson Margulies
>            Assignee: Sean Owen
>            Priority: Minor
>             Fix For: 0.2
>
>         Attachments: warnings.diff, warnings.patch
>
>
> The patch I'm about to attach gets rid of all the current yellow triangles for Eclipse 3.4.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (MAHOUT-127) Remove warnings

Posted by "Sean Owen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MAHOUT-127?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sean Owen updated MAHOUT-127:
-----------------------------

             Priority: Minor  (was: Major)
    Affects Version/s: 0.2
        Fix Version/s: 0.2
             Assignee: Sean Owen
           Issue Type: Improvement  (was: Bug)

> Remove warnings 
> ----------------
>
>                 Key: MAHOUT-127
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-127
>             Project: Mahout
>          Issue Type: Improvement
>    Affects Versions: 0.2
>            Reporter: Benson Margulies
>            Assignee: Sean Owen
>            Priority: Minor
>             Fix For: 0.2
>
>         Attachments: warnings.diff, warnings.patch
>
>
> The patch I'm about to attach gets rid of all the current yellow triangles for Eclipse 3.4.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MAHOUT-127) Remove warnings

Posted by "Sean Owen (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAHOUT-127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12714477#action_12714477 ] 

Sean Owen commented on MAHOUT-127:
----------------------------------

- I like the changes you mentioned, like @SuppressWarnings

- I personally favor keeping in explicit widening casts to show the reader what is happening. It might avoid subtle integer-division bugs. However it is a small point of preference. While I am inclined to say, let's not change it, I would go along with a change if there is other support from committers

- (Although casting from char to int in String.indexOf() is a tad over the top. I can live with reversing that.)

- I personally do not like putting serialVersionUID in Serializable classes. The default serialization logic is never wrong; it just might falsely conclude two versions of a class are not serialization-compatible when they are. When you add serialVersionUID, you introduce a burden to update it when fields change. And if you fail to, you create a much worse problem -- two versions are deemed compatible when they are not. I think there is no value to serialVersionUID unless compatibility of serialized form is necessary across revisions of a class, and that does not seem to be the case here.



> Remove warnings 
> ----------------
>
>                 Key: MAHOUT-127
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-127
>             Project: Mahout
>          Issue Type: Bug
>            Reporter: Benson Margulies
>         Attachments: warnings.diff
>
>
> The patch I'm about to attach gets rid of all the current yellow triangles for Eclipse 3.4.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MAHOUT-127) Remove warnings

Posted by "Benson Margulies (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAHOUT-127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12714487#action_12714487 ] 

Benson Margulies commented on MAHOUT-127:
-----------------------------------------

Are you sure? Eclipse claims that coding '1' has the effect of getting the default behavior without getting a warning. 

> Remove warnings 
> ----------------
>
>                 Key: MAHOUT-127
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-127
>             Project: Mahout
>          Issue Type: Bug
>            Reporter: Benson Margulies
>         Attachments: warnings.diff
>
>
> The patch I'm about to attach gets rid of all the current yellow triangles for Eclipse 3.4.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MAHOUT-127) Remove warnings

Posted by "Benson Margulies (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAHOUT-127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12714936#action_12714936 ] 

Benson Margulies commented on MAHOUT-127:
-----------------------------------------

Index: core/src/test/java/org/apache/mahout/utils/DummyOutputCollector.java
===================================================================
--- core/src/test/java/org/apache/mahout/utils/DummyOutputCollector.java	(revision 780524)
+++ core/src/test/java/org/apache/mahout/utils/DummyOutputCollector.java	(working copy)
@@ -28,6 +28,9 @@
 import java.util.Set;
 import java.util.TreeMap;
 
+// due to HADOOP-5946, it's pretty much impossible to get rid of the
+// unchecked warning on WritableComparable.
+@SuppressWarnings("unchecked")
 public class DummyOutputCollector<K extends WritableComparable, V extends Writable> implements OutputCollector<K, V> {
 
   final Map<String, List<V>> data = new TreeMap<String, List<V>>();


> Remove warnings 
> ----------------
>
>                 Key: MAHOUT-127
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-127
>             Project: Mahout
>          Issue Type: Improvement
>    Affects Versions: 0.2
>            Reporter: Benson Margulies
>            Assignee: Sean Owen
>            Priority: Minor
>             Fix For: 0.2
>
>         Attachments: warnings.diff, warnings.patch
>
>
> The patch I'm about to attach gets rid of all the current yellow triangles for Eclipse 3.4.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MAHOUT-127) Remove warnings

Posted by "Deneche A. Hakim (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAHOUT-127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12714907#action_12714907 ] 

Deneche A. Hakim commented on MAHOUT-127:
-----------------------------------------

I'm getting Compilation errors after this path has been commited !!!

I did a fresh checkout, and when launching 'mvn install' I get the following errors (when compiling core-tests):

{noformat}
[INFO] Compilation failure

<MAHOUT-PATH>\core\src\test\java\org\apache\mahout\ga\watchmaker\
EvalMapperTest.java:[48,25] type parameter org.apache.hadoop.io.LongWritable is not within its bound

<MAHOUT-PATH>\core\src\test\java\org\apache\mahout\ga\watchmaker\
EvalMapperTest.java:[48,91] type parameter org.apache.hadoop.io.LongWritable is not within its bound
{noformat}

Those errors point to the following line in EvalMapperTest.java:

{noformat}
DummyOutputCollector<LongWritable,DoubleWritable> collector = new DummyOutputCollector<LongWritable,DoubleWritable>();
{noformat}

I went to DummyOutputCollector.java, who has been modified by this patch, and restored it to its previous version (removed <?> from the class definition), and after that 'mvn install' went Ok.

I got this error both on Windows Vista and Ubuntu (Yep I got Ubuntu now =D ). Here is what I get with 'mvn -version':

On Windows Vista:
{noformat}
Apache Maven 2.1.0 (r755702; 2009-03-18 20:10:27+0100)
Java version: 1.6.0_07
Java home: C:\Program Files\Java\jdk1.6.0_07\jre
Default locale: fr_FR, platform encoding: Cp1252
OS name: "windows vista" version: "6.0" arch: "x86" Family: "windows"
{noformat}

and on Ubuntu:
{noformat}
Maven version: 2.0.9
Java version: 1.6.0_0
OS name: "linux" version: "2.6.28-11-generic" arch: "i386" Family: "unix" 
{noformat}

But the strangest part is that Eclipse IDE, who is configured to use the same JDK used by maven, compiles all the code without any problem at all and on both platforms !!!

> Remove warnings 
> ----------------
>
>                 Key: MAHOUT-127
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-127
>             Project: Mahout
>          Issue Type: Improvement
>    Affects Versions: 0.2
>            Reporter: Benson Margulies
>            Assignee: Sean Owen
>            Priority: Minor
>             Fix For: 0.2
>
>         Attachments: warnings.diff, warnings.patch
>
>
> The patch I'm about to attach gets rid of all the current yellow triangles for Eclipse 3.4.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MAHOUT-127) Remove warnings

Posted by "Benson Margulies (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAHOUT-127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12714480#action_12714480 ] 

Benson Margulies commented on MAHOUT-127:
-----------------------------------------

The cast changes were overuse of the Eclipse code clean-up wizard on my part. Oops, in other words. For the reason alone, I want to revert all and rerun the process.

I should have asked first. If you'd prefer the 'default' ID to the generated ID, I'll do that.



> Remove warnings 
> ----------------
>
>                 Key: MAHOUT-127
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-127
>             Project: Mahout
>          Issue Type: Bug
>            Reporter: Benson Margulies
>         Attachments: warnings.diff
>
>
> The patch I'm about to attach gets rid of all the current yellow triangles for Eclipse 3.4.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (MAHOUT-127) Remove warnings

Posted by "Sean Owen (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MAHOUT-127?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Sean Owen updated MAHOUT-127:
-----------------------------

    Attachment: warnings.patch

How about this patch? removed the serialVersionUID and tweaked what appeared to be some unintended spacing/line break changes.

> Remove warnings 
> ----------------
>
>                 Key: MAHOUT-127
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-127
>             Project: Mahout
>          Issue Type: Bug
>            Reporter: Benson Margulies
>         Attachments: warnings.diff, warnings.patch
>
>
> The patch I'm about to attach gets rid of all the current yellow triangles for Eclipse 3.4.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (MAHOUT-127) Remove warnings

Posted by "Benson Margulies (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/MAHOUT-127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12714604#action_12714604 ] 

Benson Margulies commented on MAHOUT-127:
-----------------------------------------

OK, I'm convinced that I should turn off this warning in eclipse instead of putting all those '1's in here. 

I'll post a trimmed patch.

> Remove warnings 
> ----------------
>
>                 Key: MAHOUT-127
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-127
>             Project: Mahout
>          Issue Type: Bug
>            Reporter: Benson Margulies
>         Attachments: warnings.diff
>
>
> The patch I'm about to attach gets rid of all the current yellow triangles for Eclipse 3.4.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (MAHOUT-127) Remove warnings

Posted by "Benson Margulies (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/MAHOUT-127?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benson Margulies updated MAHOUT-127:
------------------------------------

    Attachment: warnings.diff

Here is a patch with less gratuitous changes. Perhaps few enough?

> Remove warnings 
> ----------------
>
>                 Key: MAHOUT-127
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-127
>             Project: Mahout
>          Issue Type: Bug
>            Reporter: Benson Margulies
>         Attachments: warnings.diff
>
>
> The patch I'm about to attach gets rid of all the current yellow triangles for Eclipse 3.4.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.