Advertisement
Guest User

Untitled

a guest
Apr 19th, 2014
40
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. package testit;
  2.  
  3. import java.util.Map;
  4. import java.util.Map.Entry;
  5.  
  6. import com.google.common.base.Optional;
  7.  
  8. public class Test {
  9.  
  10. private static final Object NO_VALUE = new Object();
  11.  
  12. public void method(Map<String, ?> map) {
  13. for (Entry<String, ?> entry : map.entrySet()) {
  14. Optional.fromNullable(entry.getValue()).or(NO_VALUE);
  15. // ^^ error here
  16. }
  17. }
  18. }
  19.  
  20. Optional.fromNullable((Object)entry.getValue()).or(NO_VALUE);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement