This method is only used in tests and is broken, schedule it for
removal.
Change-Id: I4b3820fd9e02d4903087271e2982390e8c2573a2
Signed-off-by: Robert Varga <rovarga@cisco.com>
* <li>if <code>basePackageName</code> equals <code>null</code></li>
* <li>if <code>typeDefinition</code> equals <code>null</code></li>
* </ul>
* <li>if <code>basePackageName</code> equals <code>null</code></li>
* <li>if <code>typeDefinition</code> equals <code>null</code></li>
* </ul>
+ * @deprecated This method ignores typeDefinition argument and its result is only
+ * <code>indingMapping.normalizePackageName(basePackageName)</code>.
+ * Aside from tests, there is not a single user in OpenDaylight codebase,
+ * hence it can be considered buggy and defunct. It is scheduled for removal
+ * in Boron release.
public static String packageNameForTypeDefinition(final String basePackageName,
final TypeDefinition<?> typeDefinition) {
if (basePackageName == null) {
public static String packageNameForTypeDefinition(final String basePackageName,
final TypeDefinition<?> typeDefinition) {
if (basePackageName == null) {
throw new IllegalArgumentException("Type Definition reference cannot be NULL!");
}
throw new IllegalArgumentException("Type Definition reference cannot be NULL!");
}
- final StringBuilder builder = new StringBuilder();
- builder.append(basePackageName);
- return BindingMapping.normalizePackageName(builder.toString());
+ return BindingMapping.normalizePackageName(basePackageName);
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
import com.google.common.base.Optional;
import java.io.File;
import java.io.IOException;
import com.google.common.base.Optional;
import java.io.File;
import java.io.IOException;
@Rule
public ExpectedException expectedEx = ExpectedException.none();
@Rule
public ExpectedException expectedEx = ExpectedException.none();
- private static List<File> loadTestResources(String testFile) {
+ private static List<File> loadTestResources(final String testFile) {
final List<File> testModels = new ArrayList<File>();
File listModelFile;
try {
final List<File> testModels = new ArrayList<File>();
File listModelFile;
try {
public void testPackageNameForTypeDefinitionNullBasePackageName() {
expectedEx.expect(IllegalArgumentException.class);
expectedEx.expectMessage("Base Package Name cannot be NULL!");
public void testPackageNameForTypeDefinitionNullBasePackageName() {
expectedEx.expect(IllegalArgumentException.class);
expectedEx.expectMessage("Base Package Name cannot be NULL!");
public void testPackageNameForTypeDefinitionNullTypeDefinition() {
expectedEx.expect(IllegalArgumentException.class);
expectedEx.expectMessage("Type Definition reference cannot be NULL!");
public void testPackageNameForTypeDefinitionNullTypeDefinition() {
expectedEx.expect(IllegalArgumentException.class);
expectedEx.expectMessage("Type Definition reference cannot be NULL!");