catch clause parameter is always not null

This commit is contained in:
Dmitry Jemerov
2012-06-01 17:47:25 +02:00
committed by Pavel V. Talanov
parent d0b46704d3
commit 5be56e15ba
6 changed files with 11 additions and 11 deletions
+2 -2
View File
@@ -418,10 +418,10 @@ public open class Converter() {
return parameters.map { parameterToParameter(it!!) }
}
public open fun parameterToParameter(parameter: PsiParameter): Parameter {
public open fun parameterToParameter(parameter: PsiParameter, forceNotNull: Boolean = false): Parameter {
return Parameter(Identifier(parameter.getName()!!),
typeToType(parameter.getType(),
isAnnotatedAsNotNull(parameter.getModifierList())), true)
forceNotNull || isAnnotatedAsNotNull(parameter.getModifierList())), true)
}
public open fun argumentsToExpressionList(expression: PsiCallExpression): List<Expression> {
@@ -188,7 +188,7 @@ public open class StatementVisitor(converter: Converter): ElementVisitor(convert
val catchBlocks = statement?.getCatchBlocks()!!
val catchBlockParameters = statement?.getCatchBlockParameters()!!
for (i in 0..catchBlocks.size - 1) {
catches.add(CatchStatement(getConverter().parameterToParameter(catchBlockParameters[i]!!),
catches.add(CatchStatement(getConverter().parameterToParameter(catchBlockParameters[i]!!, true),
getConverter().blockToBlock(catchBlocks[i], true)))
}
myResult = TryStatement(getConverter().blockToBlock(statement?.getTryBlock(), true),
@@ -2,10 +2,10 @@ try
{
callMethod(params)
}
catch (e : Exception?) {
catch (e : Exception) {
println(1)
}
catch (e : IOException?) {
catch (e : IOException) {
println(0)
}
finally
@@ -1,10 +1,10 @@
try
{
}
catch (e : Exception?) {
catch (e : Exception) {
println(1)
}
catch (e : IOException?) {
catch (e : IOException) {
println(0)
}
finally
@@ -1,10 +1,10 @@
try
{
}
catch (e : Exception?) {
catch (e : Exception) {
println(1)
}
catch (e : IOException?) {
catch (e : IOException) {
println(0)
}
finally
@@ -1,9 +1,9 @@
try
{
}
catch (e : Exception?) {
catch (e : Exception) {
println(1)
}
catch (e : IOException?) {
catch (e : IOException) {
println(0)
}