ER-202 Disallows to use a particular type or package in a particular context.

Severity2
Enabledyes
Waivable
Configuration
Disallowed types:
	type: java.io.LineNumberInputStream
	type: javax.accessibility.AccessibleResourceBundle
	type: java.io.StringBufferInputStream
	type: org.omg.CORBA.Principal
	type: java.security.Identity
	type: java.rmi.server.LogStream
	type: java.security.IdentityScope
	type: javax.swing.text.DefaultTextUI
	type: javax.swing.text.TableView.TableCell
	type: java.rmi.server.Operation
	type: org.omg.CORBA.PrincipalHolder
	type: java.security.Signer
Violation
        
import java.util.Vector;

class DoNotUseTypeRuleViolationTestCase 
{
	private void violate() 
	{
 	
		Vector list = new Vector();
		
        list.add("some text");
	}
}
Fix
        
        import java.util.List;
        import java.util.ArrayList;
        
class DoNotUseTypeRuleFixTestCase 
{
	private void fix() 
	{
	
		List list = new ArrayList();
		
        list.add("some text");
	}
}


Hammurapi 3 Copyright © 2004 Hammurapi Group. All Rights Reserved.