Guava r07、GWT 和 javax.annotation.Nullable [英] Guava r07, GWT and javax.annotation.Nullable

查看:32
本文介绍了Guava r07、GWT 和 javax.annotation.Nullable的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在 GWT 项目中使用 Guava,但没有成功(准确地说是 HashMultimap).我得到一个永无止境的类堆栈跟踪列表:

I'm trying to use Guava in a GWT project without success (a HashMultimap, to be precise). I get a never-ending list of stacktraces for classes:

  • com.google.common.collect.ComparisonChain
  • com.google.common.collect.ForwardingSortedSetMultimap
  • com.google.common.collect.Ordering
  • ...

每个堆栈跟踪都遵循:

  • 第 xx 行:无法解析导入的 javax.annotation
  • 第 xx 行:Nullable 无法解析为类型
  • 第 xx 行:Nullable 无法解析为类型
  • 第 xx 行:Nullable 无法解析为类型
  • ...

看代码,每个抛出错误的文件包括:

Looking at the code, each file that throws an error includes:

import javax.annotation.Nullable;

import javax.annotation.Nullable;

并且,查看 guava-src-r07.jar,每个提到的类都使用 @Nullable 注释.

and, looking at the guava-src-r07.jar, each mentioned classes uses a @Nullable annotation.

我正在使用 JDK6 并查看 JDK6 javadoc 和...好吧,我找不到任何这样的注释.我可以让这些库与 GWT 项目和 JDK6 一起使用吗?

I'm using JDK6 and looking at the JDK6 javadoc and...well, I can't find any such annotation. Can I get these libraries to work with a GWT project and JDK6?

附言- 您在那里使用的是什么版本的 Java?

P.S. - What version of Java are you using over there?

推荐答案

嗯...我想这就是您要找的 jsr305.看看

Hum... I think it's the jsr305 you're looking for. Take a look at

http://www.findjar.com/jar/com/google/code/findbugs/jsr305/1.3.9/jsr305-1.3.9.jar.html

这里一定更好:http://code.google.com/p/guava-libraries/source/browse/#svn/trunk/lib我在哪里看到@Nullable 注释

It must be better here: http://code.google.com/p/guava-libraries/source/browse/#svn/trunk/lib where I see the @Nullable annotation

这篇关于Guava r07、GWT 和 javax.annotation.Nullable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆