Question

I have no idea what it means. Eclipse shouldn't have to give an answer like that. Here is my code. Please help me.

    import java.util.ArrayList;
import java.util.List;

/**
 * An immutable class to represent a snapshot of the state of a table.
 * 
 */
public class DetailedHoldemTable extends Table {

        private static final long serialVersionUID = 1647960710321459407L; //Here is the   error

        (name = "player");
        private final List<SeatedPlayer> players;

        private final boolean playing;

        private final TableConfiguration property;

        private final Pots pots;

        private final SeatedPlayer dealer;


        private final List<Card> communityCards;

        private final Round round;

        public DetailedHoldemTable(TableId id, String name, List<SeatedPlayer> players,
                        boolean playing, TableConfiguration property, Pots pots, SeatedPlayer dealer, List<Card> communityCards, Round round) {
                super(id,name);
                this.players = players==null? new ArrayList<SeatedPlayer>():new     ArrayList<SeatedPlayer>(players);
                this.playing = playing;
                this.property = property;
                this.pots = pots;
                this.dealer = dealer;
                this.communityCards = communityCards==null? new ArrayList<Card>():new        ArrayList<Card>(communityCards);
                this.round = round;
        }

        public DetailedHoldemTable(TableId id, String name, List<SeatedPlayer> players,
                        boolean playing, TableConfiguration property) {
                this(id,name, players, playing, property, null, null, null, null);
        }

        protected DetailedHoldemTable() {
                this.players = null;
                this.playing = false;
                this.property = null;
                this.pots = null;
                this.dealer = null;
                this.communityCards = null;
                this.round = null;
        }

        /**
         * Returns the list of players at this table.
         * 
         * @return The list of players at this table.
         */
        public List<SeatedPlayer> getPlayers() {
                return players;
        }

        /**
         * The number of players seated at this table.
         * 
         * @return The number of players seated at this table.
         */
        public int getNbPlayers() {
                return players.size();
        }

        /**
         * The playing status of this table.
         * 
         * @return True if the players are playing, false otherwise.
         */
        public boolean isPlaying() {
                return playing;
        }

        /**
         * Returns the game property of this table.
         * 
         * @return The game property of this table.
         */
        public TableConfiguration getTableConfiguration() {
                return property;
        }

        public Pots getPots(){
                return pots;
        }

        public SeatedPlayer getDealer(){
                return dealer;
        }

        public List<Card> getCommunityCards(){
                return communityCards;
        }

        public Round getRound() {
                return round;
        }

}

The error is at the 5th line, where I defined the serialVersionUID. As I wrote in the title, eclipse asks for the symbol < after the comma but it makes no sense in my opinion. The message it gives me is the same that there is in the title

Was it helpful?

Solution 2

Eclipse doesn't like the code below the line you point to:

(name = "player");

I'm guessing that, by the fact you call the superclass Table with the value of name, you want to replace

super(id,name);

With:

super(id,"player");

OTHER TIPS

Eclipse is just pointing to (name = "player");

You need to define name as something like

private final String name = "player";

and your error should be resolved

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top