question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Exclude Main method from "Add null check" refactoring

See original GitHub issue
public static class Program
{
    public static void Main(string[] args) // CTRL + . on args suggests to "Add null check"
    {
    }
}

The analyzer can special-case the Main method in that case and don’t emit a diagnostic.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
sharwellcommented, Aug 17, 2020

I never thought of referencing an executable to another project.

Referencing an executable works exactly the same way as referencing a class library. If you didn’t stop to look at the file extensions, you might never even notice the difference. 😃

0reactions
jasonmalinowskicommented, Aug 24, 2020

We discussed this in our design meeting and agreed to leave this as is, and count the bug as by design.

Read more comments on GitHub >

github_iconTop Results From Across the Web

null checking refactoring in java
Reflection allows you to get metadata about classes (like: fields in class, methods and other). Among other things you can invoke class methods....
Read more >
Avoid Check for Null Statement in Java
Learn several strategies for avoiding the all-too-familiar boilerplate conditional statements to check for null values in Java.
Read more >
Introduce Null Object
From the class in question, create a subclass that will perform the role of null object. · In both classes, create the method...
Read more >
Code Smells: Null | The IntelliJ IDEA Blog
This is part of a series investigating code that looks suspicious ("code smells"), and exploring possible alternatives.
Read more >
Automated Refactoring to the Null Object Design Pattern
Objective: This work proposes a novel method for automated refactoring to Null Object that eliminates null-checking conditionals associated with.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found