Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Don't know if this will work but it's worth a try.</p> <p>You can't extend Obsolete, because its final, but maybe you can create your own attribute, and mark that class as obsolete like this:</p> <pre><code>[Obsolete("Should be refactored")] public class MustRefactor: System.Attribute{} </code></pre> <p>Then when you mark your methods with the "MustRefactor" attribute, the compile warnings might show.</p> <p>I said "maybe" and "might" because I haven't tried this. Please tell me if it doesn't work so I'll remove the answer.</p> <p>Regards!</p> <p>UPDATE: Tested it. It generates a compile time warning, but the error message looks funny, you should see it for yourself and choose. This is very close to what you wanted to achieve. </p> <p><strong>UPDATE2: With <a href="http://pastie.org/282556" rel="noreferrer">this code</a> It generates <a href="http://img402.imageshack.us/my.php?image=dibujodl4.jpg" rel="noreferrer">this warnings</a> (not very nice, but I don't think there's something better).</strong></p> <pre><code>public class User { private String userName; [TooManyArgs] // Will show warning: Try removing some arguments public User(String userName) { this.userName = userName; } public String UserName { get { return userName; } } [MustRefactor] // will show warning: Refactor is needed Here public override string ToString() { return "User: " + userName; } } [Obsolete("Refactor is needed Here")] public class MustRefactor : System.Attribute { } [Obsolete("Try removing some arguments")] public class TooManyArgs : System.Attribute { } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload