DSL error when comparing two string variables

The most reasonable thing would be to remove from the examples in the openHAB Documentation the explicit types provided to variables and constants (val and var), when these types are not necessary at runtime, when the types make no difference at runtime. This way users will not do spelling mistakes, when they try to spell the return type. Currently the documentation has examples with val int dimAsInt = dimVal.intValue, so a user logically concludes that it is similar to write val string text = item.state.toString.

As to int vs Integer in variable types, I do not think it makes any difference here. It would make difference, if Xbase was used to generate .java files, but in openHAB Xbase is used to interpret the code. In the past I tried to create variables of types int and Integer, then called on them .class.toString and in both case the class was the same - so even Java primitives, when interpreted by Xbase, are the same as the corresponding object.

To find all potential places, where the explicit variabale type can be removed, one can use git grep -P "va[lr] +[^ =]+ +[a-zA-Z]+ *=", More Xbase style by dilyanpalauzov · Pull Request #2699 · openhab/openhab-docs · GitHub proposes the removal of redundant variable type on one place - from val ReentrantLock lock = new ReentrantLock.