SpMapper | simple Sharepoint Lists object mapper | Content Management System library
kandi X-RAY | SpMapper Summary
kandi X-RAY | SpMapper Summary
simple Sharepoint Lists object mapper
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of SpMapper
SpMapper Key Features
SpMapper Examples and Code Snippets
Community Discussions
Trending Discussions on SpMapper
QUESTION
When we have a try block without any code is finally block, the compiler compiles it fine. However, there is no purpose of try here - because we are neither catching a exception nor cleaning up code in finally block.
...ANSWER
Answered 2017-Jun-06 at 09:04Using a try-finally
statement without declaring a catch
statement is legal.
From the JLS :
14.20.2. Execution of try-finally and try-catch-finally
A try statement with a finally block is executed by first executing the try block. Then there is a choice:
If execution of the try block completes normally, then the finally block is executed, and then there is a choice:
If the finally block completes normally, then the try statement completes normally.
If the finally block completes abruptly for reason S, then the try statement completes abruptly for reason S.
You said :
we are neither catching a exception nor cleaning up code in finally block. If thats the case, why does JAVA has not considered a compile time check on this ?
What you write in the finally
statement is of course at the hand of the developer.
Having a empty finally
statement is useless but it is the same thing that having an empty if
or for
statement.
These are helpless but the compiler will not complain about it as it stays valid code in terms of compilation.
However, IDEs could emit warnings about it to point bad smells.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install SpMapper
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page