Removing redundant code
AssigneeInternational Business Machines Corporation
InventorsMichihiro Horie, Kazunori Ogata
Life of this patent
Estimating the term…
Abstract
Embodiments determine that a compiler option is not provided to enable an assertion for a reachable class in a target application, determine that there is no application program interface (API) being used to enable the assertion found in a reachable method in the reachable class, determine that there is no assertion being executed before an initialization of the reachable class, and remove assertion related code from the reachable class.
Claims20
A computer-implemented method, comprising:
- determining, by the processor set, that a compiler option is not provided to enable an assertion for a reachable class in a target application;
- determining, by the processor set, that there is no application program interface (API) being used to enable the assertion found in a reachable method in the reachable class in response to a determination that the compiler option is not provided to enable the assertion for the reachable class;
- determining, by the processor set, that there is no assertion being executed before an initialization of the reachable class in response to a determination that there is no API being used to enable the assertion found in the reachable method in the reachable class;
- and
- removing, by the processor set, assertion related code from the reachable class in response to a determination that there is no assertion being executed before the initialization of the reachable class.
A computer program product comprising one or more computer readable storage media having program instructions collectively stored on the one or more computer readable storage media, the program instructions executable to:
- determine that a compiler option is not provided to enable an assertion for a reachable class in a target application;
- determine that there is no application program interface (API) being used to enable the assertion found in a reachable method in the reachable class in response to a determination that the compiler option is not provided to enable the assertion for the reachable class;
- determine that there is no assertion being executed before an initialization of the reachable class in response to a determination that there is no API being used to enable the assertion found in the reachable method in the reachable class;
- and
- remove assertion related code from the reachable class in response to a determination that there is no assertion being executed before the initialization of the reachable class.
A system comprising:
- a processor set, one or more computer readable storage media, and program instructions collectively stored on the one or more computer readable storage media, the program instructions executable to:
- determine that a compiler option is not provided to enable an assertion for a reachable class in a target application;
- determine that there is no application program interface (API) being used to enable the assertion found in a reachable method in the reachable class in response to a determination that the compiler option is not provided to enable the assertion for the reachable class;
- determine that there is no assertion being executed before an initialization of the reachable class in response to a determination that there is no API being used to enable the assertion found in the reachable method in the reachable class;
- and
- remove assertion related code from the reachable class in response to a determination that there is no assertion being executed before the initialization of the reachable class.
Dependencies are inferred from the claim text.