Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Java Annotations Using Java's Built-In Annotations The @SuppressWarnings Annotation - Suppressing Multiple Warnings

Possibly bogus @SuppressWarnings challenge..

When I tried this this line:

@SuppressWarnings ({"SpellCheckingInspection","asleeponkeyboard","wet"})

..it gave me:

Bummer! Almost there, but you have specified only 2/3 warnings in the annotation.

Stuff.java
public class Stuff {
  @SuppressWarnings ({"SpellCheckingInspection","asleeponkeyboard","wet"})
  public void doThings() {
    // Nothing to see here

    // Or here


    // Or here


    // Or here

  }    
}
console.txt
Stuff.java:6 warning: [spellingerror] A spelling error was found. Wherever possible,
  use correct spelling.
Stuff.java:9 warning: [asleeponkeyboard] You have a sequence of characters suggesting 
  that you fell asleep on your keyboard.
Stuff.java:12 warning: [wet] Duplicate code above this line suggests that you may be 
  violating the DRY principle. Remember: Do not Repeat Yourself.

Of course I know it probably wanted:

Stuff.java
public class Stuff {
  @SuppressWarnings ({"spellingerror","asleeponkeyboard","wet"})
  public void doThings() {
    // Nothing to see here

    // Or here


    // Or here


    // Or here

  }    
}

However there is an actual (real) @SuppressWarnings that to do with spell checking in Android:

http://stackoverflow.com/questions/14048936/idea-how-to-suppress-warnings-for-spelling-typos

http://kurrytran.blogspot.com/2014/05/android-studio-list-of-suppress-warning.html

I seriously think that if the intention was that the console.txt was supposed to have a bunch of fictitious warnings, then some other type of fake output warning should have been used.


In addition, I noticed in the video that this was line of code was used:

Stuff.java
package com.teamtreehouse.suppresswarnings;

Of course it generates a compiler error, but

maybe there should be some hint that it is specifically not required for these challenges.