Kengo's blog

Technical articles about original projects, JVM, Static Analysis and TypeScript.

java

Apache Wink will become a top level project

Developers reported it at their mailing list. Congratulation!

findbugs-slf4j:0.2 is released

Today I released new version of finsbugs-slf4j and deployed it to Maven central. bug fix fixed findbugs.xml update SLF4J_LOGGER_SHOULD_BE_PRIVATE bug pattern

findbugs-slf4j:0.1 released

Today I released finsbugs-slf4j and deployed it to Maven central. This project is a FinfBugs plugin to support SLF4J user. You can use it from your Maven project like below. <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>findbugs-maven-plugin</artifactId> <version>2.5.2</version> </plugin>

A way to build FindBugs plugin with Maven3

This week, I will release a FindBugs plugin for SLF4J user. From this project, I got some tips to build FindBugs plugin. This article is a simple summary about them. https://gist.github.com/3970468 I wish this article would be helpful for …

findbugs-slf4j is updated

I have added test cases to findbugs-slf4j project. https://github.com/eller86/findbugs-slf4j It still has a TODO comment, so I cannot release it yet. I guess it needs 1 or 2 weeks to fix.

On-memory cache in Guava libraries

2 years ago, I introduced a cache implementation with LinkedHashMap. But if you want to use on-memory cache for your product, I recommend you to try the cache package of Guava libraries. 以前の記事でLinkedHashMapによるキャッシュ実装を紹介…

FindBugs plugin for SLF4J might be stable

I tested my FindBugs plugin for SLF4J by hands, and I think it is now stable. I will release it next week. Currently this plugin helps you to check the count of placeholder. For instance: class Foo { private final Logger logger = LoggerFac…

SLF4Jが可変長引数をサポート

Javaのログ系ライブラリSLF4Jが、今月6日にリリースされた1.7.0で可変長引数をサポートしました。つまり今まで自分でObject配列を作っていた部分を、可変長引数でシンプルに書き直せるということです。 公式ML ニュース(最新情報) SLF4Jをご存じない方にこ…

FindBugsのバグパターンを実装する

SLF4J用PMDルールセットの実装に限界が見えたのでFindBugsに乗り換えました。で、FingBugsプラグイン実装関連の日本語情報がわりとないようなので、試行錯誤の過程を残しておきます。まだ自分も完全にはできていないので、情報をお持ちでしたらぜひご指摘く…

ruleset-for-SLF4J version 0.4 has been released

I fixed some NPE in version 0.3. eller86/ruleset-for-SLF4J · GitHub But I found that parsing code is not enough to detect bugs. For example, we cannot know the difference between: // this is OK, both of placeholder and parameter is only on…

ruleset-for-SLF4J version 0.2 has been released

New version of ruleset-for-SLF4J has been released! Now it helps you to check number of placeholder. https://github.com/eller86/ruleset-for-SLF4J There are few limitations to use. Please read document for detail.

Maven使いのためのPMD入門(2012年夏)

PMDは「枯れた技術」だと思うしネット上にも日本語情報は多いですが、わりと古いものが多い気がするし1箇所にまとまってたほうが便利だと思うのでまとめてみます。 なお著者のスペックの都合上、SBTのようなナウでヤングなビルドツールは対象にしていません…

SLF4JのポカミスをPMDで自動検出する

※本記事は昨日世に出た個人プロダクトruleset-for-SLF4Jの宣伝と解説です。 SLF4Jをお使いの方はで有用でコントロールしやすいログを出すための工夫の一貫として、Logger生成時に生成元クラスを渡しているはずです。 private final Logger logger = LoggerFa…

ruleset-for-SLF4J is now on Maven central!

I am excited to announce the ruleset-for-SLF4J is now on Maven central! Many thanks for sonatype!So, you can use it easily with Maven like: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-pmd-plugin</artifactId> <version>2.7.1</version> <dependencies> <dependency> <groupId>jp.…</groupid></dependency></dependencies></plugin>

PARTAKE開発に復帰します

中国への引越しなどがあって疎遠になっていたPARTAKE開発ですが、このたびPARTAKEのGitHubへの引越しを機に復帰します。今後はマイルストーンに従いつつ、テストの充実とCIの導入、いろんな実験ができればいいなと持っています。今まで迷惑をかけてしまって…

memo: How to generate code automatically for Java project

There are many way to generate code automatically. I think that the most common way is Annotation Processing Tool and Pluggable Annotation Processing API, but always I use PMD or ASM because I'm familiar with these libraries. Annotation Pr…

Combinators in Guava libraries

Do you want to use combinators in Java code? Guava libraries provide them for you. Iterators.filter(unfiltered, predicate); Iterators.transform(fromIterator, function); Maps.filterKeys(unfiltered, keyPredicate); Maps.filterValues(unfiltere…

jenkins-regression-report-plugin is released at Jenkins plugin manager

Today jenkins-regression-report-plugin is released at Jenkins plugin manager. Thanks for jenkins folks! Wiki page is here. I'll release 1.1 ASAP. Regression Report Plugin - Jenkins - Jenkins Wiki

Maven tips in my repository

Currently my GitHub has 22 repositories. I think reading all of them is little hard. So I've picked up some tips from them, they'll be helpful for you. rejecting old maven To force user to use new Maven, you can use prerequisites property. <prerequisites></prerequisites>…

jenkins-regression-report-plugin released

Today I released jenkins-regression-report-plugin at GitHub. It helps you to import CI into running project. GitHubでjenkins-regression-report-pluginをリリースしました。主に既存プロジェクトにCIを導入するケースを想定したものです。 eller86/j…

ObjectWeb ASM 3.3 Tips

# This article is translated from my old blog.Coding with ASM is little difficult for me, because I cannot find tips at the internet especially Japanese one. This article is memo for me. It was written for ASM 3.3, and it may work well for…

jsr305-maven-plugin 1.1 released

Today I've released new version for jsr305-maven-plugin. eller86/jsr305-maven-plugin · GitHub This plugin injects precondition check into class file. It means that you don't have to code boring check logics like if (argument == null) {...}…

Creating tree walker for accessing parsed words

In the last article I generated a simple parser, but I cannot access parsed words. It means that I cannot know 'what is provided as S'. It's very big defect so I had to try to solve this problem. To access parsed words, dyn.js uses 'tree w…

How to generate simple parser with ANTLR3

I've found that dynjs depends on ANTLR3. I have to learn ANTLR3 to read dynjs, so I'm trying to use it with Maven3. pom.xml To use ANTLR3, we have to write 1 dependency and 1 plugin in pom.xml. Sample is here. <dependencies> <dependency> <groupId>org.antlr</groupId> <artifactId>antlr-runtime</artifactid></dependency></dependencies>

Java SE Specifications for Java7

Today I found documents about Java SE Specifications for Java7. The Java™ Language Specification The Java™ Virtual Machine Specification I'm ashamed to say that I don't have read specs about dynamic invoke, try-with-resources and other fea…

My ideal Java coding rule checker

I think coding rule and code analysis is helpful solution for Java. They develop advantage of Java, solidness, and help to change your project easy to read. We can use checkstyle, PMD, findbugs and another solution. コーディングルールやコ…

Ruleset for SLF4J has been updated

Today I updated ruleset for SLF4J. There is no enhancement but many fixing. ruleset for SLF4Jを更新しました。バグ修正が主な変更となっています。 Comparing 3fefc4f29b...a9dd209 · eller86/ruleset-for-SLF4J · GitHub The biggest fix is avoiding…

How to use "Bootstrap, from twitter" in Maven site

Apache releases a skin for maven site which uses Bootstrap. So we can use bootstrap in our original project site easily. 各所で使われているBootstrapですが、ApacheがMavenサイト用のスキンをリリースしており簡単に使えます。これはとっつきやすい…

PMD ruleset for SLF4J

I wanted to use ruleset to validate my codes so I asked to ML of SLF4J, but there is no tool to help. So I've created a PMD ruleset for SLF4J. It may help to code with unified valid logging. コードを統一するためのルールセットがほしくてSLF4…

Deploying Maven's site to GitHub Pages

Are you using Maven's site feature? How about GitHub Pages? If you're using both of them, GitHub's site-maven-plugin helps you to host your site on Pages. MavenのsiteとGitHub Pagesを使っている方に朗報です。GitHub社がsiteをPagesにデプロイす…