AttributeType unit test fails

Description

Recent change to optimize DefaultAttributeType caused it to fail a unit test. The optimization involved the removal of an instance of test.

The unit test has been commented out for now, either it needs to be removed permenatly or the code needs to be repaired so that the test passes again.

The test which now fails can be found at:
http://modules.geotools.org/defaultcore/xref-test/org/geotools/feature/AttributeTypeTest.html#106 - http://modules.geotools.org/defaultcore/xref-test/org/geotools/feature/AttributeTypeTest.html#106

Environment

None

Activity

Show:
codehaus
April 10, 2015, 3:22 PM

CodeHaus Comment From: aaime - Time: Sat, 7 Feb 2004 15:36:18 -0600
---------------------
I'd lend for removing my micro-optimization, since the

AttributeType interface requires both parse and validate...

the only things that I'm a bit concerned about is that

the above optimization, althought small, removed work

done twice in a method that gets called thousands of

times...

codehaus
April 10, 2015, 3:22 PM

CodeHaus Comment From: jmacgill - Time: Sun, 8 Feb 2004 18:06:01 -0600
---------------------
Perhaps we need to remove the need for it to be executed twice, either we force parse to call validate (and remove the need to call the method afterwards) or we remove the check from parse implemenations.

Are either sensible?

codehaus
April 10, 2015, 3:22 PM

CodeHaus Comment From: aaime - Time: Tue, 10 Feb 2004 05:21:22 -0600
---------------------
I've reverted the changes. Given that the two methods are both public and can be called in isolation, I don't see how to avoid the double

checks: validate is supposed to do perform checks that in subclasses

are not part of the parse method, and the parse method have to test

the input class type in order to perform its work...

codehaus
April 10, 2015, 3:22 PM

CodeHaus Comment From: aaime - Time: Sat, 19 Aug 2006 02:26:07 -0500
---------------------
Oh well, since then I've tried twice to remove checks and could not find any measurable perf. improvement (to my surprise...)

Assignee

Unassigned

Reporter

codehaus

Triage

None

Components

Priority

Medium
Configure