catch clause parameter is always not null
This commit is contained in:
committed by
Pavel V. Talanov
parent
d0b46704d3
commit
5be56e15ba
@@ -418,10 +418,10 @@ public open class Converter() {
|
|||||||
return parameters.map { parameterToParameter(it!!) }
|
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()!!),
|
return Parameter(Identifier(parameter.getName()!!),
|
||||||
typeToType(parameter.getType(),
|
typeToType(parameter.getType(),
|
||||||
isAnnotatedAsNotNull(parameter.getModifierList())), true)
|
forceNotNull || isAnnotatedAsNotNull(parameter.getModifierList())), true)
|
||||||
}
|
}
|
||||||
|
|
||||||
public open fun argumentsToExpressionList(expression: PsiCallExpression): List<Expression> {
|
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 catchBlocks = statement?.getCatchBlocks()!!
|
||||||
val catchBlockParameters = statement?.getCatchBlockParameters()!!
|
val catchBlockParameters = statement?.getCatchBlockParameters()!!
|
||||||
for (i in 0..catchBlocks.size - 1) {
|
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)))
|
getConverter().blockToBlock(catchBlocks[i], true)))
|
||||||
}
|
}
|
||||||
myResult = TryStatement(getConverter().blockToBlock(statement?.getTryBlock(), true),
|
myResult = TryStatement(getConverter().blockToBlock(statement?.getTryBlock(), true),
|
||||||
|
|||||||
@@ -2,10 +2,10 @@ try
|
|||||||
{
|
{
|
||||||
callMethod(params)
|
callMethod(params)
|
||||||
}
|
}
|
||||||
catch (e : Exception?) {
|
catch (e : Exception) {
|
||||||
println(1)
|
println(1)
|
||||||
}
|
}
|
||||||
catch (e : IOException?) {
|
catch (e : IOException) {
|
||||||
println(0)
|
println(0)
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
catch (e : Exception?) {
|
catch (e : Exception) {
|
||||||
println(1)
|
println(1)
|
||||||
}
|
}
|
||||||
catch (e : IOException?) {
|
catch (e : IOException) {
|
||||||
println(0)
|
println(0)
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
catch (e : Exception?) {
|
catch (e : Exception) {
|
||||||
println(1)
|
println(1)
|
||||||
}
|
}
|
||||||
catch (e : IOException?) {
|
catch (e : IOException) {
|
||||||
println(0)
|
println(0)
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
catch (e : Exception?) {
|
catch (e : Exception) {
|
||||||
println(1)
|
println(1)
|
||||||
}
|
}
|
||||||
catch (e : IOException?) {
|
catch (e : IOException) {
|
||||||
println(0)
|
println(0)
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user