dc.contributor.author |
Amanda, R.P |
|
dc.date.accessioned |
2022-03-16T05:36:53Z |
|
dc.date.available |
2022-03-16T05:36:53Z |
|
dc.date.issued |
2021 |
|
dc.identifier.citation |
Amanda, R.P (2021) Retrofitting kjava optional through automated refactoring. BSc. Dissertation Informatics Institute of Technology |
en_US |
dc.identifier.issn |
2017416 |
|
dc.identifier.uri |
http://dlib.iit.ac.lk/xmlui/handle/123456789/994 |
|
dc.description.abstract |
"
NullPointerExceptions (NPEs) are very common in Java programming. Tony Hoare,
who introduced null references into the programing world described his own idea as a
‘billion-dollar mistake’. The reason is the confusion created among developers by the
ambiguity of returning null to represent “empty” or “missing information” which can
lead to NPEs and is considered a bad practice.
A research done using open-source codebases shows that 35% of the conditional
statements in Java code include null checks and 71% of those null checks refer to
values returned from methods. (Osman et al., 2016) There are many researches done
in the area, all concluding towards eliminating returning null references from methods
to reduce the frequency of NPEs.
Introduction of Optional class in Java with Java 8 provides a mechanism to write better
code that can avoid NPEs, but in general, the cost of code refactoring acts as a barrier
to retrofit new code features to existing legacy code bases. This research presents a
proof of concept of a tool to assist the developer to locate the code blocks where
returning a null reference is a possibility and provide automated refactoring of the code
to use Optional.
" |
en_US |
dc.language.iso |
en |
en_US |
dc.subject |
Optional |
en_US |
dc.subject |
Null Pointer Dereferences |
en_US |
dc.subject |
Static Analysis |
en_US |
dc.subject |
Software Maintenance |
en_US |
dc.title |
Retrofitting kjava optional through automated refactoring |
en_US |
dc.type |
Thesis |
en_US |