Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jul 20th, 2012  |  syntax: None  |  size: 1.21 KB  |  hits: 15  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. How to fix this warning?
  2. /**
  3.  * ADT for persons which is completed which subclasses
  4.  * to creating actors with specific properties
  5. */
  6. public class Person {
  7.  
  8.     /**
  9.      * Name of the Person.
  10.      */
  11.   public String name;
  12.  
  13.     /**
  14.      * The World which this Person is associated with.
  15.      */
  16.   public World world;
  17.  
  18.     /**
  19.      * Tells where this Person is at the moment.
  20.      */
  21.   public Place where;
  22.  
  23.     /**
  24.      * The inventory, contains Things.
  25.      */
  26.   public Collection<Thing> inventory;
  27.  
  28.     /**
  29.      * Shows how the Person looks like
  30.      */
  31.   public Image appearance;
  32.  
  33.     /**
  34.      * Create Person named `name' in world `world'.
  35.      *
  36.      * @param world The world where the Person is created.
  37.      * @param name Name of the Person.
  38.      * @param app An image used to display the Person.
  39.      */
  40.   public Person( World world, String name, Image app ) {
  41.     this.world = world;
  42.     this.name = name;
  43.     this.appearance = app;
  44.  
  45.     where = world.defaultPlace();
  46.     where.enter( this );
  47.  
  48.     inventory = Collections.synchronizedCollection( new LinkedList() );
  49.   }
  50.        
  51. List<Person> people = Collections.synchronizedList(new LinkedList<Person>());
  52.        
  53. inventory = Collections.synchronizedCollection( new LinkedList<Thing>());