<artifactId>sonar-plugin-api</artifactId> | <artifactId>sonar-plugin-api</artifactId> | ||||
<version>${project.version}</version> | <version>${project.version}</version> | ||||
</dependency> | </dependency> | ||||
<dependency> | |||||
<groupId>org.codehaus.sonar</groupId> | |||||
<artifactId>sonar-deprecated</artifactId> | |||||
<version>${project.version}</version> | |||||
</dependency> | |||||
<dependency> | <dependency> | ||||
<groupId>org.apache.maven</groupId> | <groupId>org.apache.maven</groupId> | ||||
<artifactId>maven-project</artifactId> | <artifactId>maven-project</artifactId> |
<?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||||
<pmd version="4.2.5" timestamp="2010-09-12T21:47:59.064"> | |||||
<pmd version="4.2.5" timestamp="2010-09-14T13:20:30.108"> | |||||
</pmd> | </pmd> |
</properties> | </properties> | ||||
<dependencies> | <dependencies> | ||||
<dependency> | |||||
<groupId>org.codehaus.sonar</groupId> | |||||
<artifactId>sonar-deprecated</artifactId> | |||||
<version>${project.version}</version> | |||||
</dependency> | |||||
<dependency> | <dependency> | ||||
<groupId>org.codehaus.sonar</groupId> | <groupId>org.codehaus.sonar</groupId> | ||||
<artifactId>sonar-plugin-api</artifactId> | <artifactId>sonar-plugin-api</artifactId> |
/** | /** | ||||
* @since 1.10 | * @since 1.10 | ||||
* @deprecated since 2.3. Too much "black-box". | |||||
*/ | */ | ||||
@Deprecated | |||||
public abstract class AbstractViolationsStaxParser { | public abstract class AbstractViolationsStaxParser { | ||||
protected RulesManager rulesManager; | protected RulesManager rulesManager; |
package org.sonar.api.rules; | package org.sonar.api.rules; | ||||
import java.util.List; | import java.util.List; | ||||
import org.sonar.api.rules.Rule; | |||||
@Deprecated | @Deprecated | ||||
public interface ConfigurationImportable { | public interface ConfigurationImportable { |
import java.util.Set; | import java.util.Set; | ||||
/** | /** | ||||
* Manage and access rules defined in Sonar. | |||||
* | |||||
* @deprecated UGLY COMPONENT - WILL BE COMPLETELY REFACTORED IN SONAR 2.3 | |||||
* @deprecated since 2.3 | |||||
*/ | */ | ||||
@Deprecated | @Deprecated | ||||
public abstract class RulesManager { | public abstract class RulesManager { |
import java.util.List; | import java.util.List; | ||||
/** | /** | ||||
* The interface to implement to create a repository of rules | |||||
* | |||||
* @param <LANG> | |||||
* @deprecated since 2.3 | |||||
*/ | */ | ||||
@Deprecated | @Deprecated | ||||
public interface RulesRepository<LANG extends Language> extends BatchExtension, ServerExtension { | public interface RulesRepository<LANG extends Language> extends BatchExtension, ServerExtension { |
*/ | */ | ||||
package org.sonar.api.rules; | package org.sonar.api.rules; | ||||
import org.hamcrest.core.Is; | |||||
import org.junit.Test; | import org.junit.Test; | ||||
import static org.hamcrest.CoreMatchers.nullValue; | import static org.hamcrest.CoreMatchers.nullValue; | ||||
assertThat(rule.getConfigKey(), nullValue()); | assertThat(rule.getConfigKey(), nullValue()); | ||||
assertThat(rule.getParams().size(), is(0)); | assertThat(rule.getParams().size(), is(0)); | ||||
assertThat(rule.getDescription(), is("Description")); | assertThat(rule.getDescription(), is("Description")); | ||||
assertThat(rule.getCardinality(), is(Rule.Cardinality.SINGLE)); | |||||
assertThat(rule.getRulesCategory().getName(), is(Iso9126RulesCategories.RELIABILITY.getName())); | |||||
assertThat(rule.getCardinality(), Is.is(Rule.Cardinality.SINGLE)); | |||||
assertThat(rule.getRulesCategory().getName(), Is.is(Iso9126RulesCategories.RELIABILITY.getName())); | |||||
} | } | ||||
@Test | @Test |
package org.sonar.api.rules; | package org.sonar.api.rules; | ||||
import static junit.framework.Assert.assertEquals; | import static junit.framework.Assert.assertEquals; | ||||
import junit.framework.Assert; | |||||
import org.junit.Test; | import org.junit.Test; | ||||
public class RulePriorityTest { | public class RulePriorityTest { | ||||
@Test | @Test | ||||
public void testValueOfString() { | public void testValueOfString() { | ||||
assertEquals(RulePriority.INFO, RulePriority.valueOfString("info")); | |||||
assertEquals(RulePriority.MAJOR, RulePriority.valueOfString("MAJOR")); | |||||
assertEquals(RulePriority.MAJOR, RulePriority.valueOfString("ERROR")); | |||||
assertEquals(RulePriority.INFO, RulePriority.valueOfString("WARNING")); | |||||
assertEquals(RulePriority.MAJOR, RulePriority.valueOfString("ErRor")); | |||||
assertEquals(RulePriority.INFO, RulePriority.valueOfString("WaRnInG")); | |||||
Assert.assertEquals(RulePriority.INFO, RulePriority.valueOfString("info")); | |||||
Assert.assertEquals(RulePriority.MAJOR, RulePriority.valueOfString("MAJOR")); | |||||
Assert.assertEquals(RulePriority.MAJOR, RulePriority.valueOfString("ERROR")); | |||||
Assert.assertEquals(RulePriority.INFO, RulePriority.valueOfString("WARNING")); | |||||
Assert.assertEquals(RulePriority.MAJOR, RulePriority.valueOfString("ErRor")); | |||||
Assert.assertEquals(RulePriority.INFO, RulePriority.valueOfString("WaRnInG")); | |||||
} | } | ||||
@Test(expected = IllegalArgumentException.class) | @Test(expected = IllegalArgumentException.class) |
import static org.hamcrest.core.Is.is; | import static org.hamcrest.core.Is.is; | ||||
import static org.junit.Assert.*; | import static org.junit.Assert.*; | ||||
import org.hamcrest.core.Is; | |||||
import org.junit.Assert; | |||||
import org.junit.Test; | import org.junit.Test; | ||||
import java.util.Arrays; | import java.util.Arrays; | ||||
public void descriptionShouldBeCleaned() { | public void descriptionShouldBeCleaned() { | ||||
Rule rule = new Rule(); | Rule rule = new Rule(); | ||||
rule.setDescription(" my description "); | rule.setDescription(" my description "); | ||||
assertEquals("my description", rule.getDescription()); | |||||
Assert.assertEquals("my description", rule.getDescription()); | |||||
rule.setDescription(null); | rule.setDescription(null); | ||||
assertNull(rule.getDescription()); | assertNull(rule.getDescription()); | ||||
@Test | @Test | ||||
public void defaultPriorityIsMajor() { | public void defaultPriorityIsMajor() { | ||||
Rule rule = new Rule(); | Rule rule = new Rule(); | ||||
assertThat(rule.getPriority(), is(RulePriority.MAJOR)); | |||||
assertThat(rule.getPriority(), Is.is(RulePriority.MAJOR)); | |||||
rule = new Rule("name", "key"); | rule = new Rule("name", "key"); | ||||
assertThat(rule.getPriority(), is(RulePriority.MAJOR)); | |||||
assertThat(rule.getPriority(), Is.is(RulePriority.MAJOR)); | |||||
rule = new Rule("pkey", "key", "name", Iso9126RulesCategories.EFFICIENCY, null, null); | rule = new Rule("pkey", "key", "name", Iso9126RulesCategories.EFFICIENCY, null, null); | ||||
assertThat(rule.getPriority(), is(RulePriority.MAJOR)); | |||||
assertThat(rule.getPriority(), Is.is(RulePriority.MAJOR)); | |||||
rule.setPriority(RulePriority.BLOCKER); | rule.setPriority(RulePriority.BLOCKER); | ||||
assertThat(rule.getPriority(), is(RulePriority.BLOCKER)); | |||||
assertThat(rule.getPriority(), Is.is(RulePriority.BLOCKER)); | |||||
rule.setPriority(null); | rule.setPriority(null); | ||||
assertThat(rule.getPriority(), is(RulePriority.MAJOR)); | |||||
assertThat(rule.getPriority(), Is.is(RulePriority.MAJOR)); | |||||
} | } | ||||
import static org.mockito.Matchers.eq; | import static org.mockito.Matchers.eq; | ||||
import static org.mockito.Mockito.mock; | import static org.mockito.Mockito.mock; | ||||
import static org.mockito.Mockito.when; | import static org.mockito.Mockito.when; | ||||
import org.mockito.Matchers; | |||||
import org.sonar.api.CoreProperties; | import org.sonar.api.CoreProperties; | ||||
import java.util.Map; | import java.util.Map; | ||||
@Test | @Test | ||||
public void getPriorityWeights() { | public void getPriorityWeights() { | ||||
Configuration conf = mock(Configuration.class); | Configuration conf = mock(Configuration.class); | ||||
when(conf.getString(eq(CoreProperties.CORE_RULE_WEIGHTS_PROPERTY), anyString())).thenReturn("info=0;minor=1;major=2;critical=5;blocker=10"); | |||||
when(conf.getString(Matchers.eq(CoreProperties.CORE_RULE_WEIGHTS_PROPERTY), anyString())).thenReturn("info=0;minor=1;major=2;critical=5;blocker=10"); | |||||
final Map<RulePriority, Integer> map = RuleUtils.getPriorityWeights(conf); | final Map<RulePriority, Integer> map = RuleUtils.getPriorityWeights(conf); | ||||
@Test | @Test | ||||
public void loadMissingWeights() { | public void loadMissingWeights() { | ||||
Configuration conf = mock(Configuration.class); | Configuration conf = mock(Configuration.class); | ||||
when(conf.getString(eq(CoreProperties.CORE_RULE_WEIGHTS_PROPERTY), anyString())).thenReturn("foo=0;bar=1;CRITICAL=5"); | |||||
when(conf.getString(Matchers.eq(CoreProperties.CORE_RULE_WEIGHTS_PROPERTY), anyString())).thenReturn("foo=0;bar=1;CRITICAL=5"); | |||||
final Map<RulePriority, Integer> map = RuleUtils.getPriorityWeights(conf); | final Map<RulePriority, Integer> map = RuleUtils.getPriorityWeights(conf); | ||||
import org.apache.commons.io.IOUtils; | import org.apache.commons.io.IOUtils; | ||||
import static org.hamcrest.CoreMatchers.is; | import static org.hamcrest.CoreMatchers.is; | ||||
import static org.junit.Assert.*; | import static org.junit.Assert.*; | ||||
import org.hamcrest.CoreMatchers; | |||||
import org.junit.Assert; | |||||
import org.junit.Test; | import org.junit.Test; | ||||
import org.sonar.api.profiles.RulesProfile; | import org.sonar.api.profiles.RulesProfile; | ||||
import org.sonar.api.rules.xml.Profile; | import org.sonar.api.rules.xml.Profile; | ||||
RulesProfile profile = standardProfileXmlParser.importConfiguration(IOUtils.toString(input)); | RulesProfile profile = standardProfileXmlParser.importConfiguration(IOUtils.toString(input)); | ||||
List<ActiveRule> results = profile.getActiveRules(); | List<ActiveRule> results = profile.getActiveRules(); | ||||
assertThat("Sonar way", is(profile.getName())); | |||||
assertThat("Sonar way", CoreMatchers.is(profile.getName())); | |||||
assertThat(results.size(), is(activeRulesExpected.size())); | assertThat(results.size(), is(activeRulesExpected.size())); | ||||
assertActiveRulesAreEquals(results, activeRulesExpected); | assertActiveRulesAreEquals(results, activeRulesExpected); | ||||
} | } | ||||
ActiveRule activeRule2 = activeRules2.get(i); | ActiveRule activeRule2 = activeRules2.get(i); | ||||
assertTrue(activeRule1.getRule().equals(activeRule2.getRule()) && activeRule1.getPriority().equals(activeRule2.getPriority())); | assertTrue(activeRule1.getRule().equals(activeRule2.getRule()) && activeRule1.getPriority().equals(activeRule2.getPriority())); | ||||
assertEquals(activeRule1.getActiveRuleParams().size(), (activeRule2.getActiveRuleParams().size())); | |||||
Assert.assertEquals(activeRule1.getActiveRuleParams().size(), (activeRule2.getActiveRuleParams().size())); | |||||
for (int j = 0; j < activeRule1.getActiveRuleParams().size(); j++) { | for (int j = 0; j < activeRule1.getActiveRuleParams().size(); j++) { | ||||
ActiveRuleParam activeRuleParam1 = activeRule1.getActiveRuleParams().get(j); | ActiveRuleParam activeRuleParam1 = activeRule1.getActiveRuleParams().get(j); | ||||
ActiveRuleParam activeRuleParam2 = activeRule2.getActiveRuleParams().get(j); | ActiveRuleParam activeRuleParam2 = activeRule2.getActiveRuleParams().get(j); |
*/ | */ | ||||
package org.sonar.api.rules; | package org.sonar.api.rules; | ||||
import org.hamcrest.core.Is; | |||||
import org.junit.Test; | import org.junit.Test; | ||||
import org.sonar.api.utils.SonarException; | import org.sonar.api.utils.SonarException; | ||||
Rule rule = rules.get(0); | Rule rule = rules.get(0); | ||||
assertThat(rule.getName(), is("Local Variable Name")); | assertThat(rule.getName(), is("Local Variable Name")); | ||||
assertThat(rule.getDescription(), is("Checks that local, non-final variable names conform to a format specified by the format property.")); | assertThat(rule.getDescription(), is("Checks that local, non-final variable names conform to a format specified by the format property.")); | ||||
assertThat(rule.getPriority(), is(RulePriority.BLOCKER)); | |||||
assertThat(rule.getCardinality(), is(Rule.Cardinality.MULTIPLE)); | |||||
assertThat(rule.getPriority(), Is.is(RulePriority.BLOCKER)); | |||||
assertThat(rule.getCardinality(), Is.is(Rule.Cardinality.MULTIPLE)); | |||||
assertThat(rule.getConfigKey(), is("Checker/TreeWalker/LocalVariableName")); | assertThat(rule.getConfigKey(), is("Checker/TreeWalker/LocalVariableName")); | ||||
assertThat(rule.getParams().size(), is(2)); | assertThat(rule.getParams().size(), is(2)); | ||||
List<Rule> rules = StandardRuleXmlFormat.parseXml(getClass().getResourceAsStream("/org/sonar/api/rules/StandardRuleXmlFormatTest/deprecated.xml")); | List<Rule> rules = StandardRuleXmlFormat.parseXml(getClass().getResourceAsStream("/org/sonar/api/rules/StandardRuleXmlFormatTest/deprecated.xml")); | ||||
assertThat(rules.size(), is(1)); | assertThat(rules.size(), is(1)); | ||||
Rule rule = rules.get(0); | Rule rule = rules.get(0); | ||||
assertThat(rule.getPriority(), is(RulePriority.CRITICAL)); | |||||
assertThat(rule.getPriority(), Is.is(RulePriority.CRITICAL)); | |||||
assertThat(rule.getKey(), is("org.sonar.it.checkstyle.MethodsCountCheck")); | assertThat(rule.getKey(), is("org.sonar.it.checkstyle.MethodsCountCheck")); | ||||
assertThat(rule.getParam("minMethodsCount"), not(nullValue())); | assertThat(rule.getParam("minMethodsCount"), not(nullValue())); | ||||
} | } |
import static org.hamcrest.MatcherAssert.assertThat; | import static org.hamcrest.MatcherAssert.assertThat; | ||||
import static org.hamcrest.Matchers.is; | import static org.hamcrest.Matchers.is; | ||||
import static org.junit.Assert.*; | import static org.junit.Assert.*; | ||||
import org.junit.Assert; | |||||
import org.junit.Test; | import org.junit.Test; | ||||
import java.util.List; | import java.util.List; | ||||
assertEquals(1, rules.size()); | assertEquals(1, rules.size()); | ||||
Rule rule = rules.get(0); | Rule rule = rules.get(0); | ||||
assertEquals("key1", rule.getKey()); | |||||
assertEquals("my name", rule.getName()); | |||||
assertEquals("my_config_key", rule.getConfigKey()); | |||||
assertEquals("my description", rule.getDescription()); | |||||
assertEquals(2, rule.getParams().size()); | |||||
assertEquals("param1", rule.getParams().get(0).getKey()); | |||||
assertEquals("s", rule.getParams().get(0).getType()); | |||||
assertEquals("param description", rule.getParams().get(0).getDescription()); | |||||
Assert.assertEquals("key1", rule.getKey()); | |||||
Assert.assertEquals("my name", rule.getName()); | |||||
Assert.assertEquals("my_config_key", rule.getConfigKey()); | |||||
Assert.assertEquals("my description", rule.getDescription()); | |||||
Assert.assertEquals(2, rule.getParams().size()); | |||||
Assert.assertEquals("param1", rule.getParams().get(0).getKey()); | |||||
Assert.assertEquals("s", rule.getParams().get(0).getType()); | |||||
Assert.assertEquals("param description", rule.getParams().get(0).getDescription()); | |||||
} | } | ||||
@Test | @Test | ||||
String xml = "<rules><rule><category name='cat1' /></rule></rules>"; | String xml = "<rules><rule><category name='cat1' /></rule></rules>"; | ||||
List<Rule> rules = parser.parse(xml); | List<Rule> rules = parser.parse(xml); | ||||
assertNotNull(rules.get(0).getRulesCategory()); | assertNotNull(rules.get(0).getRulesCategory()); | ||||
assertEquals("cat1", rules.get(0).getRulesCategory().getName()); | |||||
Assert.assertEquals("cat1", rules.get(0).getRulesCategory().getName()); | |||||
assertNull(rules.get(0).getRulesCategory().getId()); | assertNull(rules.get(0).getRulesCategory().getId()); | ||||
assertNull(rules.get(0).getRulesCategory().getDescription()); | assertNull(rules.get(0).getRulesCategory().getDescription()); | ||||
} | } | ||||
String xml = "<rules><rule key='1' priority='CRITICAL'><category name='cat1'/></rule></rules>"; | String xml = "<rules><rule key='1' priority='CRITICAL'><category name='cat1'/></rule></rules>"; | ||||
List<Rule> rules = parser.parse(xml); | List<Rule> rules = parser.parse(xml); | ||||
assertNotNull(rules.get(0).getRulesCategory()); | assertNotNull(rules.get(0).getRulesCategory()); | ||||
assertEquals(RulePriority.CRITICAL, rules.get(0).getPriority()); | |||||
Assert.assertEquals(RulePriority.CRITICAL, rules.get(0).getPriority()); | |||||
assertNull(rules.get(0).getRulesCategory().getId()); | assertNull(rules.get(0).getRulesCategory().getId()); | ||||
assertNull(rules.get(0).getRulesCategory().getDescription()); | assertNull(rules.get(0).getRulesCategory().getDescription()); | ||||
} | } | ||||
StandardRulesXmlParser parser = new StandardRulesXmlParser(); | StandardRulesXmlParser parser = new StandardRulesXmlParser(); | ||||
String xml = "<rules><rule key='1'><category name='cat1'/></rule></rules>"; | String xml = "<rules><rule key='1'><category name='cat1'/></rule></rules>"; | ||||
List<Rule> rules = parser.parse(xml); | List<Rule> rules = parser.parse(xml); | ||||
assertEquals(RulePriority.MAJOR, rules.get(0).getPriority()); | |||||
Assert.assertEquals(RulePriority.MAJOR, rules.get(0).getPriority()); | |||||
} | } | ||||
@Test | @Test | ||||
String xml = "<rules><rule key='key1' category='cat1' /><rule key='key2' category='cat1' /></rules>"; | String xml = "<rules><rule key='key1' category='cat1' /><rule key='key2' category='cat1' /></rules>"; | ||||
List<Rule> rules = parser.parse(xml); | List<Rule> rules = parser.parse(xml); | ||||
assertEquals(2, rules.size()); | assertEquals(2, rules.size()); | ||||
assertEquals("key1", rules.get(0).getKey()); | |||||
assertEquals("key2", rules.get(1).getKey()); | |||||
Assert.assertEquals("key1", rules.get(0).getKey()); | |||||
Assert.assertEquals("key2", rules.get(1).getKey()); | |||||
} | } | ||||
@Test | @Test | ||||
String xml = "<rules><rule key='key1' category='cat1'><description> <![CDATA[<xml> </nodes> and accents Žˆ˜ ]]> </description></rule></rules>"; | String xml = "<rules><rule key='key1' category='cat1'><description> <![CDATA[<xml> </nodes> and accents Žˆ˜ ]]> </description></rule></rules>"; | ||||
List<Rule> rules = parser.parse(xml); | List<Rule> rules = parser.parse(xml); | ||||
assertEquals(1, rules.size()); | assertEquals(1, rules.size()); | ||||
assertEquals("<xml> </nodes> and accents Žˆ˜", rules.get(0).getDescription()); | |||||
Assert.assertEquals("<xml> </nodes> and accents Žˆ˜", rules.get(0).getDescription()); | |||||
} | } | ||||
@Test | @Test | ||||
assertEquals(1, rules.size()); | assertEquals(1, rules.size()); | ||||
Rule rule = rules.get(0); | Rule rule = rules.get(0); | ||||
assertEquals("key1", rule.getKey()); | |||||
assertEquals(1, rule.getParams().size()); | |||||
assertEquals("param1", rule.getParams().get(0).getKey()); | |||||
Assert.assertEquals("key1", rule.getKey()); | |||||
Assert.assertEquals(1, rule.getParams().size()); | |||||
Assert.assertEquals("param1", rule.getParams().get(0).getKey()); | |||||
} | } | ||||
@Test | @Test |
/* | |||||
* Sonar, open source software quality management tool. | |||||
* Copyright (C) 2009 SonarSource SA | |||||
* mailto:contact AT sonarsource DOT com | |||||
* | |||||
* Sonar is free software; you can redistribute it and/or | |||||
* modify it under the terms of the GNU Lesser General Public | |||||
* License as published by the Free Software Foundation; either | |||||
* version 3 of the License, or (at your option) any later version. | |||||
* | |||||
* Sonar is distributed in the hope that it will be useful, | |||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | |||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |||||
* Lesser General Public License for more details. | |||||
* | |||||
* You should have received a copy of the GNU Lesser General Public | |||||
* License along with Sonar; if not, write to the Free Software | |||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02 | |||||
*/ | |||||
package org.sonar.api; | |||||
import java.util.ArrayList; | |||||
import java.util.List; | |||||
import org.sonar.api.batch.Sensor; | |||||
import org.sonar.api.resources.AbstractLanguage; | |||||
import org.sonar.api.resources.Language; | |||||
import org.sonar.api.rules.RulesRepository; | |||||
public class FakePlugin implements Plugin { | |||||
private Language lang; | |||||
private String key; | |||||
private Class<? extends RulesRepository> rulesClass; | |||||
private Class<? extends Sensor> sensor = null; | |||||
public FakePlugin(String key, Language lang) { | |||||
this.lang = lang; | |||||
this.key = key; | |||||
} | |||||
public FakePlugin(String key, Language lang, Class<? extends RulesRepository> rulesClass) { | |||||
this.lang = lang; | |||||
this.key = key; | |||||
this.rulesClass = rulesClass; | |||||
} | |||||
public FakePlugin(String key, Language lang, Class<? extends RulesRepository> rulesClass, Class<? extends Sensor> sensor) { | |||||
this.lang = lang; | |||||
this.key = key; | |||||
this.rulesClass = rulesClass; | |||||
this.sensor = sensor; | |||||
} | |||||
FakePlugin() { | |||||
this("fake", new AbstractLanguage("fake", "Fake") { | |||||
public String[] getFileSuffixes() { | |||||
return new String[0]; | |||||
} | |||||
}); | |||||
} | |||||
public String getKey() { | |||||
return key; | |||||
} | |||||
public String getName() { | |||||
return null; | |||||
} | |||||
public String getDescription() { | |||||
return null; | |||||
} | |||||
public Language getLanguage() { | |||||
return lang; | |||||
} | |||||
public List<Class<? extends Extension>> getExtensions() { | |||||
List<Class<? extends Extension>> list = new ArrayList<Class<? extends Extension>>(); | |||||
if (sensor != null) { | |||||
list.add(sensor); | |||||
} | |||||
if (rulesClass != null) { | |||||
list.add(rulesClass); | |||||
} | |||||
return list; | |||||
} | |||||
} |