variable might already have been assigned when it cannot be assigned

后端 未结 4 2073
梦如初夏
梦如初夏 2021-01-17 19:31

research this code:

public class TestFinalAndCatch {
    private final int i;

    TestFinalAndCatch(String[] args) {
        try {
            i = method1()         


        
4条回答
  •  南笙
    南笙 (楼主)
    2021-01-17 20:11

    https://bugs.openjdk.java.net/browse/JDK-6326693?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

    Looks like JDK bug. And now status - Fixed. But I cannot find from which version.

提交回复
热议问题