jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Sonar
  • SONAR-1898

Plugin.getName() was deprecated in Sonar 2.2, but still used and can cause errors

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.3
  • Fix Version/s: 2.8
  • Component/s: API
  • Labels:
    None

Description

Following plugin definition leads to an error during rendering plugins settings page ("/settings/index") :

public class ExamplePlugin implements Plugin {
  public String getKey() {
    return null;
  }

  public String getName() {
    return null;
  }

  public String getDescription() {
    return null;
  }

  public List<Class<? extends Extension>> getExtensions() {
    ...
  }
}

Part of error message :

Showing app/views/settings/_plugins.html.erb where line #24 raised:

undefined method `<=>' for nil:NilClass
Extracted source (around line #24):

21: </style>
22: <div id="plugins">
23: <% form_tag :controller => :settings, :action => :update do
24: plugins = controller.java_facade.getPlugins().sort {|p1,p2| p1.getName() <=> p2.getName()}
25: plugin_properties={}
26: plugins.each do |plugin|
27: properties = controller.java_facade.getPluginProperties(plugin).select do |property|

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Evgeny Mandrikov added a comment - 03/Nov/10 12:18 PM

Fixed in r5860.

Show
Evgeny Mandrikov added a comment - 03/Nov/10 12:18 PM Fixed in r5860.
Hide
Permalink
Simon Brandhof added a comment - 16/Nov/10 8:03 AM

Coding rules console in the ruby part uses Plugin.getName() to display name of rules engines.

Show
Simon Brandhof added a comment - 16/Nov/10 8:03 AM Coding rules console in the ruby part uses Plugin.getName() to display name of rules engines.
Hide
Permalink
Evgeny Mandrikov added a comment - 16/Nov/10 8:21 AM

Simon, I suppose that repository name should be shown in that case?

Show
Evgeny Mandrikov added a comment - 16/Nov/10 8:21 AM Simon, I suppose that repository name should be shown in that case?
Hide
Permalink
Simon Brandhof added a comment - 16/Nov/10 8:24 AM

Yes it should. The filter "plugin" in the search form should also be renamed.

Show
Simon Brandhof added a comment - 16/Nov/10 8:24 AM Yes it should. The filter "plugin" in the search form should also be renamed.
Hide
Permalink
Freddy Mallet added a comment - 22/Mar/11 4:40 PM

In fact, we should introduce a new SonarPlugin entry point to prevent any misunderstanding about the useless of the getKey(), getName() and getDescription() methods.

Show
Freddy Mallet added a comment - 22/Mar/11 4:40 PM In fact, we should introduce a new SonarPlugin entry point to prevent any misunderstanding about the useless of the getKey(), getName() and getDescription() methods.

People

  • Assignee:
    Evgeny Mandrikov
    Reporter:
    Evgeny Mandrikov
Vote (0)
Watch (0)

Dates

  • Created:
    21/Oct/10 4:13 PM
    Updated:
    17/May/11 2:00 AM
    Resolved:
    04/Apr/11 2:55 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.