Author: chris.laprun(a)jboss.com
Date: 2011-09-22 11:10:35 -0400 (Thu, 22 Sep 2011)
New Revision: 7490
Modified:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/registration/RegistrationPropertyDescription.java
Log:
- Use ParameterValidation.isOldAndNewDifferent instead of local version.
- Added getter for ValueChangeListener.
Modified:
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/registration/RegistrationPropertyDescription.java
===================================================================
---
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/registration/RegistrationPropertyDescription.java 2011-09-22
14:32:41 UTC (rev 7489)
+++
components/wsrp/trunk/common/src/main/java/org/gatein/wsrp/registration/RegistrationPropertyDescription.java 2011-09-22
15:10:35 UTC (rev 7490)
@@ -1,6 +1,6 @@
/*
* JBoss, a division of Red Hat
- * Copyright 2010, Red Hat Middleware, LLC, and individual
+ * Copyright 2011, Red Hat Middleware, LLC, and individual
* contributors as indicated by the @authors tag. See the
* copyright.txt in the distribution for a full listing of
* individual contributors.
@@ -160,7 +160,7 @@
public void setName(QName name)
{
- if (valueWillBeUpdated(this.name, name))
+ if (ParameterValidation.isOldAndNewDifferent(this.name, name))
{
QName oldName = this.name;
this.name = name;
@@ -322,6 +322,11 @@
this.valueChangeListener = listener;
}
+ public ValueChangeListener getValueChangeListener()
+ {
+ return valueChangeListener;
+ }
+
private void notifyParentOfChangeIfNeeded(Object oldValue, Object newValue)
{
if (valueChangeListener != null)
@@ -332,7 +337,7 @@
public Object modifyIfNeeded(Object oldValue, Object newValue)
{
- if (valueWillBeUpdated(oldValue, newValue))
+ if (ParameterValidation.isOldAndNewDifferent(oldValue, newValue))
{
notifyParentOfChangeIfNeeded(oldValue, newValue);
oldValue = newValue;
@@ -341,11 +346,6 @@
return oldValue;
}
- private boolean valueWillBeUpdated(Object oldValue, Object newValue)
- {
- return (oldValue != null && !oldValue.equals(newValue)) || (oldValue ==
null && newValue != null);
- }
-
/**
* Tries to heuristically determine the language for this
RegistrationPropertyDescription
*
Show replies by date