JetBrains/kotlin — pull request #206 by ponomandr (2013-02-21 14:02:53+00:00)
Title: Small improvements in Java to Kotlin converter

### J2K: Detect @NotNull fields

If a field is annotated with @NotNull it is converted to non-nullable type:
```Java
@NotNull String myStr = "String2";
```
```Kotlin
var myStr : String = "String2"
```
Before this fix it was converted to nullable type.

### J2K: Detect @NotNull references in call chains
If a chain call contains non-nullable references, they are not guarded with safe-call
```Java
class Bar {
@NotNull
Foo fooNotNull = Foo();
Foo fooNullable = null;
}

public void test(@NotNull Bar barNotNull, Bar barNullable) {
barNotNull.fooNotNull.execute();
barNotNull.fooNullable.execute();
barNullable.fooNotNull.execute();
barNullable.fooNullable.execute();
}
```
```Kotlin
barNotNull.fooNotNull.execute()
barNotNull.fooNullable?.execute()
barNullable?.fooNotNull?.execute()
barNullable?.fooNullable?.execute()
```
Before this fix it always used safe call:
```Kotlin
barNotNull?.fooNotNull?.execute()
...
```

### J2K: enum constants are non-nullable
Assume we have a enum with FOO constant:
```Kotlin
MyEnum.FOO.doSomething()
```
Before this fix it used safe call.