Redundant instance variable initialization elision

US10127133B2 · US · B2

Patent metadata
FieldValue
Publication numberUS-10127133-B2
Application numberUS-201615094783-A
CountryUS
Kind codeB2
Filing dateApr 8, 2016
Priority dateApr 8, 2016
Publication dateNov 13, 2018
Grant dateNov 13, 2018

How to read this patent

A practical reading order for non-experts. Skip the full description unless you need deep technical detail.

  1. Title

    What the patent document calls the invention.

  2. Abstract

    A short plain-language summary of the technical disclosure.

  3. Assignees and inventors

    Who owns or filed the patent and who is credited as inventor.

  4. Key dates

    Filing, priority, publication, and grant dates set the timeline.

  5. First independent claim

    The legal scope of protection — read this for what is actually claimed.

  6. CPC / IPC classifications

    Technology tags used to group this patent with similar filings.

  7. Citations and related patents

    Prior art links and similar publications in this corpus.

Abstract

Official abstract text for this publication.

A compiler, IDE or other code analyzer may determine whether an instance variable declaration assignment is redundant. The code analyzer may also take action based on that determination. A code analyzer may be able to determine with certainty that a particular instance variable initialization or assignment is definitely redundant. The code analyzer may cause a compiler to automatically elide the redundant assignment from compiled source code. The code analyzer may be able to determine with certainty that a particular assignment is definitely not redundant. Additionally, a code analyzer may not be able to determine with certainty whether an instance variable assignment is definitely redundant or definitely not redundant. Additionally, the code analyzer may report a warning or other informative message indicating the redundancy property of the assignment, thus alerting the programming to a (possibly) redundant assignment.

First claim

Opening claim text (preview).

What is claimed is: 1. A non-transitory, computer-readable storage medium storing program instructions that when executed on a computing device cause the computing device to perform: implementing a code analyzer configured to: access source code; identify, within the source code, an instance variable declaration comprising an assignment that assigns a value to an instance variable; determine whether the assigned value is a default value for the instance variable; apply, based at least in part on determining that the assigned value is a default value for the instance variable, a set of rules to determine whether the instance variable declaration assignment is definitely redundant with respect to the default value; and indicate, based at least in part on determining that the instance variable declaration assignment is definitely redundant, that the instance variable declaration assignment is definitely redundant. 2. The non-transitory, computer-readable storage medium of claim 1 , wherein the code analyzer is further configured to: determine that the assigned value is not the default value for the instance variable; and in response to determining that the assigned value is not the default value, determine that the instance variable declaration assignment is definitely not redundant with respect to the default value such that no indication is made regarding the instance variable declaration assignment being definitely redundant. 3. The non-transitory, computer-readable storage medium of claim 1 , wherein to apply the set of rules, the code analyzer is configured to: determine whether the instance variable is assigned a value prior to the instance variable declaration assignment according to an execution order of the source code. 4. The non-transitory, computer-readable storage medium of claim 3 , wherein the code analyzer is further configured to: determine, based at least in part on determining that the instance variable is assigned a value prior to the instance variable declaration assignment, that the instance variable declaration is definitely not redundant with respect to the default value. 5. The non-transitory, computer-readable storage medium of claim 1 , wherein to determine whether the instance variable declaration assignment is definitely redundant, the code analyzer is further configured to: determine whether the source code includes one or more earlier blocks of code, executable prior to the instance variable declaration assignment according to an execution order of the source code, that assign a value to the instance variable; and determine, based at least in part on determining that the source code does not include one or more earlier blocks of code that assign a value to the instance variable, that the instance variable declaration assignment is definitely redundant with respect to the default value. 6. The non-transitory, computer-readable storage medium of claim 1 , wherein to determine whether the instance variable declaration assignment is definitely redundant, the code analyzer is further configured to: determine whether the source code includes one or more earlier blocks of code, executable prior to the instance variable declaration assignment according to an execution order of the source code, that possibly assign a value to the instance variable; and apply, based at least in part on determining that the source code includes one or more earlier blocks of code that possibly assigns a value to the instance variable, the set of rules to each of the one or more earlier blocks of code to determine whether the one or more earlier blocks of code assign a value to the instance variable. 7. The non-transitory, computer-readable storage medium of claim 6 , wherein the code analyzer is further configured to: determine, based at least in part on applying the set of rules to each of the one or more earlier blocks of code, that none of the one or more earlier blocks of code assign a value to the instance variable; and determine, based at least in part on determining that none of the one or more earlier blocks of code assign a value to the instance variable, that the instance variable declaration is definitely redundant with respect to the default value. 8. The non-transitory, computer-readable storage medium of claim 6 , wherein the code analyzer is further configured to: determine, based at least in part on applying the set of rules to each of the one or more earlier blocks of code, that at least one of the one or more earlier blocks of code assigns a value to the instance variable; and determine, based at least in part on determining that the at least of the one or more earlier blocks of code assigns a value to the instance variable, that the instance variable declaration is definitely not redundant with respect to the default value. 9. The non-transitory, computer-readable storage medium of claim 6 , wherein to determine whether the source code includes one or more earlier blocks of code that possibly assign a value to the instance variable, the code analyzer is further configured to: determine whether the source code includes any earlier blocks of code, executable prior to the instance variable declaration assignment according to an execution order for the source code, that comprise any of: a method invocation; a class construction involving the instance variable; a class construction involving an object that includes the instance variable; an expression involving the object that includes the instance variable; or an instruction involving the object that includes the instance variable. 10. The non-transitory, computer-readable storage medium of claim 1 , wherein the code analyzer is further configured to: determine that the source code includes one or more earlier blocks of code, executable prior to the instance variable declaration assignment according to an execution order of the source code, that possibly assign a value to the instance variable; apply the set of rules to each of the one or more earlier blocks of code; determine, based at least in part on applying the set of rules to each of the one or more earlier blocks of code, that it cannot be determined, for at least one of the one or more earlier blocks of code, whether the at least one earlier block of code assigns a value to the instance variable declaration assignment; and indicate that it cannot be determined whether the instance variable declaration assignment is definitely redundant with respect to the default value. 11. The non-transitory, computer-readable storage medium of claim 1 , wherein the code analyzer is further configured to: include a compiler hint in the source code indicating that the instance variable declaration assignment should not be included in a compiled version of the source code. 12. A computing device, comprising: a processor; and a memory comprising program instructions, that when executed on the processor cause the processor to implement a code analyzer configured to: access source code; identify, within the source code, an instance variable declaration comprising an assignment that assigns a value to an instance variable; determine whether the assigned value is a default value for the instance variable; apply, based at least in part on determining that the assigned value is a default value for the instance variable, a set of rules to determine whether the instance variable declaration assignment is definitely redundant with respect to the default value; and indicate, based at least in part on determining that the instance variable declaration assignment is definitely redundant, that the instance variable declaration assignment

Assignees

Inventors

Classifications

  • Compiler construction; Parser generation · CPC title

  • Reducing the execution time required by the program code · CPC title

  • Analysis of software for verifying properties of programs (testing of software G06F11/3668) · CPC title

  • Optimisation · CPC title

  • Detection or removal of dead or redundant code · CPC title

Patent family

Related publications grouped by family.

External sources

Frequently asked questions

Answers are generated from the same data shown on this page.

What does patent US10127133B2 cover?
A compiler, IDE or other code analyzer may determine whether an instance variable declaration assignment is redundant. The code analyzer may also take action based on that determination. A code analyzer may be able to determine with certainty that a particular instance variable initialization or assignment is definitely redundant. The code analyzer may cause a compiler to automatically elide th…
Who is the assignee on this patent?
Oracle Int Corp
What technology area does this patent fall under?
Primary CPC classification G06F11/3604. Mapped technology areas include Physics.
When was this patent published?
Publication date Tue Nov 13 2018 00:00:00 GMT+0000 (Coordinated Universal Time) (B2). Legal status and post-grant events are not shown on this page.
What related patents are in patentsdb?
We list 3 related publications on this page (citations in our corpus or others sharing the same primary CPC).