KT-4418 Converter from java should honor "@Nullable" annotations
#KT-4418 Fixed
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
//file
|
||||
// !specifyLocalVariableTypeByDefault: true
|
||||
package test;
|
||||
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class Test {
|
||||
@Nullable String myStr = "String2";
|
||||
|
||||
public Test(@Nullable String str) {
|
||||
myStr = str;
|
||||
}
|
||||
|
||||
public void sout(@Nullable String str) {
|
||||
System.out.println(str);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String dummy(@Nullable String str) {
|
||||
return str;
|
||||
}
|
||||
|
||||
public void test() {
|
||||
sout("String");
|
||||
@Nullable String test = "String2";
|
||||
sout(test);
|
||||
sout(dummy(test));
|
||||
|
||||
new Test(test);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user