# Found Bug in Diff#setDiffTypes(String)

**URL:** <https://forum.liquibase.org/t/found-bug-in-diff-setdifftypes-string/1385>\
**Category:** Liquibase Development\
**Created:** [March 11, 2010, 6:58pm UTC](https://forum.liquibase.org/t/found-bug-in-diff-setdifftypes-string/1385 "2010-03-11T18:58:00Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![r351574nc3](https://avatars.discourse-cdn.com/v4/letter/r/b4bc9f/32.png) [@r351574nc3](https://forum.liquibase.org/u/r351574nc3)\
**Post date:** [March 11, 2010, 6:58pm UTC](https://forum.liquibase.org/t/found-bug-in-diff-setdifftypes-string/1385/1 "2010-03-11T18:58:00Z")

</div>

I can’t seem to find a place to report this. If there is a better place, I’d be glad to know of it.

I am using Liquibase 1.9.5. I haven’t verified this in 2.0 because I can’t find the source code. If anyone knows where, please point me to it.

I found in this method this:  
Set types = new HashSet(Arrays.asList(diffTypes.toLowerCase().split("\s\*,\s\*")));

It converts diffTypes to lowercase. This seems fine. Usually, a good idea when doing string parsing/comparisons. Further, down I found this:

diffPrimaryKeys = types.contains(“primaryKeys”);  
diffUniqueConstraints = types.contains(“uniqueConstraints”);  
diffIndexes = types.contains(“indexes”);  
diffForeignKeys = types.contains(“foreignKeys”);  
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;  
Note the uppercase ‘K’ and ‘C’. Basically, when using setDiffTypes() diffForeignKeys, diffPrimaryKeys, and diffUniqueConstraints is always false.

Bummer. I actually use this class, so please fix whenever you get around to it. Meanwhile, I’ll use a locally patched version.

---

<div class="post-metadata">

**Author:** ![r351574nc3](https://avatars.discourse-cdn.com/v4/letter/r/b4bc9f/32.png) [@r351574nc3](https://forum.liquibase.org/u/r351574nc3)\
**Post date:** [March 11, 2010, 6:58pm UTC](https://forum.liquibase.org/t/found-bug-in-diff-setdifftypes-string/1385/2 "2010-03-11T18:58:00Z")

</div>

Ok. I found [http://liquibase.jira.com](http://liquibase.jira.com) . I’ll put this there instead. Thanks everyone for not flaming me for posting this in the wrong place.

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [March 11, 2010, 6:58pm UTC](https://forum.liquibase.org/t/found-bug-in-diff-setdifftypes-string/1385/3 "2010-03-11T18:58:00Z")

</div>

No problem.&nbsp; It is often vague where to post it, so either place is fine.&nbsp;

Nathan

---

<div class="post-metadata">

**Author:** ![gadge\_suffix](https://avatars.discourse-cdn.com/v4/letter/g/0ea827/32.png) [@gadge\_suffix](https://forum.liquibase.org/u/gadge_suffix)\
**Post date:** [March 11, 2010, 6:58pm UTC](https://forum.liquibase.org/t/found-bug-in-diff-setdifftypes-string/1385/4 "2010-03-11T18:58:00Z")

</div>

to r351574nc3:  
So, would you fix it for 2.0 trunk-version?

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [March 11, 2010, 6:58pm UTC](https://forum.liquibase.org/t/found-bug-in-diff-setdifftypes-string/1385/5 "2010-03-11T18:58:00Z")

</div>

Definitely in trunk (2.0).&nbsp; If the fix is easy, it would be worth applying to the 1.9 branch as well, the diff code is re-organized but similar.

Nathan
