Just-in-time compilation (JITC) and ahead-of-time compilation (AOTC) has been proposed to improve the performance of Java virtual machine (JVM). These techniques adopt Java specific optimizations as well as traditional compiler optimizations. One of Java specific optimizations is a null pointer check elimination, which is considered to be a mandatory optimization in most JVM, since it can achieve noticeable performance improvement by eliminating redundant overhead of checking null pointers. In this paper, we propose an extended null pointer check elimination using specialization. The proposed technique extends the scope of existing null pointer check elimination and can eliminate additional null pointer checks. In addition, the proposed technique can be adopted to existing Just-in-time compiler and Ahead-of-time compiler, because it preserves the semantic of existing null pointer check elimination optimization. We observed meaningful performance improvement with benchmark programs as well as real applications after applying the proposed optimization.