Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

RuntimeException

EdChouaffeMar 25 2011 — edited Mar 25 2011
Hi Guys.

Is there any good reasons why an RuntimeException is not thrown although it should?
Look at the following code snippset:
Note: colConstraints is a HashMap object.
Set<String> newValueSet = .... (here is the object initialized with some values)
for (String key : newValuesSet) {
				if (colConstraints.containsKey(key)) {
					System.out.println(colConstraints + "  " + key);
					throw new RuntimeException(
							"SQLQueryBuilder.UpdateQuery: Misplacement " + key
									+ " cannot be a primary or foreign key");
				}
			}
I wonder why I dont get any error thrown even though there are cases where key is contained within colConstraints.
Best regrads.

Edmond

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Apr 22 2011
Added on Mar 25 2011
1 comment
184 views