No compilation warning with @Deprecated annotation?

According to Java tutorial on Oracle, if deprecated method marked with @Deprecated annotation is used, compiler should be giving warning on compilation. But with following code sample, I am not getting any warning in the console. Java version used: 1.8.0_112 Please let me know what could be missing here. Thanks. public class PreDefinedAnnotationTypesTest { /** * This method is deprecated

没有使用@Deprecated注释的编译警告?

根据Oracle的Java教程,如果使用标记为@Deprecated注释的不推荐使用的方法,编译器应该在编译时给出警告。 但通过以下代码示例,我没有在控制台中收到任何警告。 使用的Java版本:1.8.0_112 请让我知道这里可能会丢失什么。 谢谢。 public class PreDefinedAnnotationTypesTest { /** * This method is deprecated. * @deprecated */ @Deprecated public void m1(){ } public static void main(String[] args) {

Which @NotNull Java annotation should I use?

I'm looking to make my code more readable as well as use tooling like IDE code inspection and/or static code analysis (FindBugs and Sonar) to avoid NullPointerExceptions. Many of the tools seem incompatible with each others' @NotNull / @NonNull / @Nonnull annotation and listing all of them in my code would be terrible to read. Any suggestions of which one is the 'best'? Here is

我应该使用哪个@NotNull Java注释?

我期望让代码更具可读性,并使用IDE代码检查和/或静态代码分析(FindBugs和Sonar)等工具来避免NullPointerException。 许多工具似乎与其他人的@NotNull / @NonNull / @Nonnull注解不兼容,并且在我的代码中列出所有这些工具会非常糟糕。 任何建议哪一个是'最好的'? 以下是我找到的等效注释列表: javax.validation.constraints.NotNull 创建用于运行时验证,而不是静态分析。 文件 edu.umd.cs.findbugs.annot

How to determine the unique number of changed lines in Git

Executing the following gives me the differences in line count between local changes and the remote versions of the file: git diff --shortstat C:devSprint7 origin/master:C:devSprint7 Example result: 18 files changed, 11 insertions(+), 8 deletions(-) Please, how do I calculate the total number of unique changed lines? For instance, if line 5 of Login.jsp file is deleted and same line 5 is re

如何确定Git中更改行的唯一编号

执行以下操作会给我本地更改和文件的远程版本之间的行计数差异: git diff --shortstat C:devSprint7 origin/master:C:devSprint7 示例结果: 18 files changed, 11 insertions(+), 8 deletions(-) 请问,如何计算唯一更改的行的总数? 例如,如果Login.jsp文件的第5行被删除,并且第5行被另一行(或字符串)替换(即删除和插入在第5行完成),我希望这被计为1改变的行。 我可以通过总结插入和删除从上面的命令中得到这

OData Provider in Ruby/Java

是否有任何适用于Ruby或Java的OData 提供程序 SDK? There are none, unfortunately. There are only clients. I've used ruby_odata successfully. It works well against a simple model and provides mappings for all the basic query options, although you do need to know the operators (like eq, substringof, etc). I did run into a more complex model and needed to tweak the code a bit. It's easy

OData提供者在Ruby / Java中

是否有任何适用于Ruby或Java的OData 提供程序 SDK? 不幸的是,没有一个。 只有客户。 我已经成功地使用了ruby_odata。 它对一个简单的模型运行良好,并为所有基本查询选项提供映射,尽管您确实需要了解运算符(如eq,substringof等)。 我遇到了一个更复杂的模型,需要稍微调整代码。 很容易找到:http://odetocode.com/Blogs/scott/archive/2010/07/11/odata-and-ruby.aspx 这里有Ruby和Java的提供者:http://www.oda

Mapping between Wingdings/Symbol characters and their Unicode equivalents

MsWord uses Wingdings and Symbol characters for bullets, by default their hex values are F0A7 and F0B7. I want to convert the bullets to their Unicode equivalents. Of course, it depends on the actual font used, so F0A7 Wingding would become Unicode 25AA (●). I've found a partial mapping from Wingdings to Unicode and from Symbol to Unicode. Is there a general a library (preferably in Java)

Wingdings / Symbol字符与它们的Unicode等价物之间的映射

MsWord使用Wingdings和Symbol字符作为项目符号,默认情况下它们的十六进制值是F0A7和F0B7。 我想将项目符号转换为它们的Unicode等价物。 当然,这取决于使用的实际字体,所以F0A7 Wingding将成为Unicode 25AA(●)。 我发现了从Wingdings到Unicode以及从Symbol到Unicode的部分映射。 有没有一个通用的库(最好是Java)或者这些映射的数据库? 这些信息嵌入在.ttf文件中 - 我不确定如何在java中访问它。 AFAIK java.awt.F

MIME type text/html

Hi I'm working on a project and try to add css to a page but its not loading and when i check srourcecode at the browser I get a : Resource interpreted as Stylesheet but transferred with MIME type text/html: I tried to load css in every way, with - " rel="stylesheet"> - - even with @import file ( not a best practice but i tried...) and its not working. Files: Project

MIME类型text / html

您好我正在一个项目,并尝试添加CSS到页面,但它不加载,当我检查在浏览器srourcecode我得到一个: 将资源解释为样式表,但使用MIME类型text / html传输: 我尝试以各种方式加载css,使用 - “rel =”stylesheet“> - - 即使使用@import文件(不是最佳做法,但我尝试过......) 它不工作。 文件:项目: -网页内容 -resources - css -main.css -WEB-INF- -MTEA-INF web.xml中: <?

type incorrectly for csv

I've created .csv file using excel and I wrote following code using apache tika: public static boolean checkThatMimeTypeIsCsv(InputStream inputStream) throws IOException { BufferedInputStream bis = new BufferedInputStream(inputStream); AutoDetectParser parser = new AutoDetectParser(); Detector detector = parser.getDetector(); Metadata md = new Metadata(); MediaType mediaT

为csv键入错误

我使用excel创建了.csv文件,我使用apache tika编写了以下代码: public static boolean checkThatMimeTypeIsCsv(InputStream inputStream) throws IOException { BufferedInputStream bis = new BufferedInputStream(inputStream); AutoDetectParser parser = new AutoDetectParser(); Detector detector = parser.getDetector(); Metadata md = new Metadata(); MediaType mediaType = detector.detect(bi

How do I get the File Extention for a Mime Type (Content Type)

There are tons of ways to get the Mime Type from a given InputStream or File. But given a MimeType or (in HTTP terms: content type) how do I get a list of file extensions. Java's activation library has MimetypesFileTypeMap but that goes File Ext -> Mime Type. I need Mime Type -> File Ext. It seems like I would have to copy the pseudo private code that is in com.sun.activation to l

如何获取MIME类型的文件扩展名(内容类型)

有很多方法可以从给定的InputStream或File获取MIME类型。 但是,给定一个MimeType或(以HTTP的形式:内容类型)我如何获得文件扩展名列表。 Java的激活库有MimetypesFileTypeMap,但是文件分机 - > Mime类型。 我需要Mime Type - > File Ext。 看起来我必须复制com.sun.activation中的伪私有代码来加载MIME类型映射。 Apache带有一个mime.types文件。 你可以解析这个文件并使用它来映射文件扩展名到内容类型,反

How to include a external jar in a GWT (Google Web Toolkit) project?

I have a external jar file named "xxx.jar". I use "xxx.jar" in my GWT project. When I attempt to build the JavaScript version of my project in Ant, I get one of the following type of errors at every location in which I use xxx. I get a error of this kind when doing the "gwtc" task in Ant, the javac compilation process proceeds just fine. [ERROR] Line 45: No sou

如何在GWT(Google Web Toolkit)项目中包含外部jar?

我有一个名为“xxx.jar”的外部jar文件。 我在我的GWT项目中使用“xxx.jar”。 当我尝试在Ant中构建我的项目的JavaScript版本时,在我使用xxx的每个位置出现以下类型的错误之一。 在Ant中执行“gwtc”任务时出现此类错误,javac编译过程进行得很顺利。 [错误]第45行:没有源代码可用于org.xxx.ObjectName类型; 你忘了继承一个必需的模块吗? 好吧,很显然,它无法看到/使用xxx.jar。 然而,解决这个问题在GWT中并不像在“普通

Displaying Unicode in a Java JTextArea

I am trying to print unicode in a JTextArea. I have gotten it to print fine to the console but when I try to print it to the textarea, I get boxes for all of the two byte unicode characters. Any help would be much appreciated. package edu.afit.jieddo; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class JTextAreaDemo extends JFrame { StringBuffer m = new StringBu

在Java JTextArea中显示Unicode

我正尝试在JTextArea中打印unicode。 我已经将它打印到控制台上,但是当我尝试将它打印到textarea时,我得到了所有两个字节的unicode字符的框。 任何帮助将非常感激。 package edu.afit.jieddo; import java.awt.*; import java.awt.event.*; import javax.swing.*; public class JTextAreaDemo extends JFrame { StringBuffer m = new StringBuffer("u14c7 u14c4 u1557 u00d6"); StringBuffer m2 =new StringBuffer("