Java source code can be obtained by decompiling its bytecode, therefore, obfuscation by modifying the names of packages, classes, and methods is usually adopted as a means to reduce the readability to protect the source code. In this research work, we address the obfuscation through the following three steps: 1. transform Java programs into their corresponding graphs, 2. collect sub-graphs from the graphs of non-obfuscated programs to form patterns as a basis for similarity calculation, and 3. compare the similarity of graphs to obtain a most probable name for the unknown node. An experiment is also conducted to evaluate the benefit of our proposed approach with the extant CRF approach to show that our proposed approach is statistically more significant in improving the precision of predicting entity type than the extant CRF approach.