For reasons beyond the scope of this bug, we need the strings to be in the code. So we changed the code into:
String [] people = new String[]

{"a name", "some name", "another name", "some other name"}

;
and
String [] houses = new String[]

{"a house", "some house", "another house", "some other house"}

;

The string arrays are also detected as duplicates. Although I technically understand why this is happening, I think this prevents developers from creating multiple large arrays with strings in any part of the code.

Is this the desired effect and if so, how do the people who wrote the CPD plugin suggest this is solved, given that the strings can not be externalized (the need to be part of the code, per requirement of the customer).

Freddy Mallet
added a comment - 27/Jan/10 9:45 AM You're right Rolf.
When the "Ignore Literals" is set to false, the statement "peopleList.add("a name").add("another name")" is tokenized to get the following tokens : 'people', 'add', 'a name', 'add', 'another name'.
When the "Ignore Literals" is set to true, with the same statement, we get the following list of tokens : 'people', 'add', 'literal', 'add', 'literal'.
In fact 'literal' token should not be included in the token list and we should get 'people', 'add', 'add'.
if you agree, I'm going to change the type of this ticket from Bug to Improvement.