Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 330148 - MetaType service ignores min and max restrictions for STRING and PASSWORD when specified independently.
Summary: MetaType service ignores min and max restrictions for STRING and PASSWORD whe...
Status: RESOLVED FIXED
Alias: None
Product: Equinox
Classification: Eclipse Project
Component: Compendium (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.7 M4   Edit
Assignee: John Ross CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-12 16:24 EST by John Ross CLA
Modified: 2010-11-19 16:29 EST (History)
1 user (show)

See Also:


Attachments
Proposed Patch 1 (1.87 KB, patch)
2010-11-12 16:58 EST, John Ross CLA
no flags Details | Diff
Test Patch 1 (14.66 KB, patch)
2010-11-12 17:30 EST, John Ross CLA
tjwatson: iplog+
Details | Diff
Proposed Patch 2 (1.15 KB, patch)
2010-11-15 16:11 EST, John Ross CLA
tjwatson: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description John Ross CLA 2010-11-12 16:24:05 EST
Build Identifier: 

Given the following attribute definitions and the current implementation

<AD default="password" id="password1" min="3" type="Password"/>
<AD default="password" id="password2" max="8" type="Password"/>
<AD default="password" id="password3" max="8" min="3" type="Password"/>

A value of "12" is valid for password1.
A value of "123456789" is valid for password2.
Both are invalid for password3.

The implementation ignores max or min when specified independently. This only happens for the String and Password attribute types. I can find no justification for this. Seems to me min or max should always be honored.

Reproducible: Always
Comment 1 John Ross CLA 2010-11-12 16:58:43 EST
Created attachment 183049 [details]
Proposed Patch 1

Splits min and max into two separate checks instead of one. Note this patch has some residue from Bug 327173. I'll repatch once that is released if needed.
Comment 2 John Ross CLA 2010-11-12 17:30:35 EST
Created attachment 183051 [details]
Test Patch 1

Adds some MetaType tests to compendium.tests related to this bug.
Comment 3 Thomas Watson CLA 2010-11-15 09:08:43 EST
(In reply to comment #1)
> Created an attachment (id=183049) [details]
> Proposed Patch 1
> 
> Splits min and max into two separate checks instead of one. Note this patch has
> some residue from Bug 327173. I'll repatch once that is released if needed.

I released the fix in bug327173.  Please provide an updated patch.  Thanks.
Comment 4 John Ross CLA 2010-11-15 16:11:27 EST
Created attachment 183171 [details]
Proposed Patch 2

Repatched from latest HEAD contents.
Comment 5 Thomas Watson CLA 2010-11-15 17:16:18 EST
Thanks John.  I released the latest patch.
Comment 6 Thomas Watson CLA 2010-11-19 16:29:04 EST
I released the test patch also.