DO NOT REPLY [Bug 33840] - [beanutils] PropertyUtils.isReadable() and PropertyUtils.getProperty() not consistent

2005-08-02 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33840.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33840





--- Additional Comments From [EMAIL PROTECTED]  2005-08-02 17:18 ---
Furthermore, at least the 1.7 implementation is not sufficiently robust.  For
example, if I try:

PropertyUtils.isReadable(new WrapDynaBean(new Socket()), inputStream)

returns 'true'.  A subsequent read of this field will yield:

java.lang.IllegalArgumentException: Property 'inputStream' has no read method

PropertyUtils should either inspect DynaBeans in a manner that WrapDynaBean (and
presumably other types of DynaBeans) can modulate (for instance: template
methods DynaBean.isReadable()/isWriteable()) or it should special-case
WrapDynaBean to perform the more thorough PropertyDescriptor test on the
WrapDynaBean.instance() return value:

// Return the requested result
Object realInstance;
if (bean instanceof WrapDynaBean) {
realInstance = ((WrapDynaBean) bean).getInstance();
} else {
realInstance = bean;
}
try {
  PropertyDescriptor desc =
  getPropertyDescriptor(bean, name);
  if (desc != null) {
  Method readMethod = desc.getReadMethod();
  if ((readMethod == null) 
  (desc instanceof IndexedPropertyDescriptor)) {
  readMethod = ((IndexedPropertyDescriptor)
desc).getIndexedReadMethod();
  }
  return (readMethod != null);
  } else {
  return (false);
  }
  } catch (IllegalAccessException e) {
  return (false);
  } catch (InvocationTargetException e) {
  return (false);
  } catch (NoSuchMethodException e) {
  return (false);
  }
}

For that matter, is there a reason the read/write status of a property is not
just part of the DynaProperty structure?



-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 33840] - [beanutils] PropertyUtils.isReadable() and PropertyUtils.getProperty() not consistent

2005-08-02 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33840.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33840





--- Additional Comments From [EMAIL PROTECTED]  2005-08-02 17:29 ---
My example was inaccurate - it showed a different problem, namely that
IllegalArgumentException is being thrown in WrapDynaBean get() without a cause
being set, which is misleading.  In that case inputStream is indeed available to
read, however an exception occurs (probably because the socket is not 
connection).

One can choose any other arbitrary object to illustrate the problem I was trying
to describe however.  For example, URL will report host as writeable when it
really isn't.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 33840] - [beanutils] PropertyUtils.isReadable() and PropertyUtils.getProperty() not consistent

2005-06-09 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33840.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33840





--- Additional Comments From [EMAIL PROTECTED]  2005-06-09 09:01 ---
I agree that PropertyUtils.isReadable(obj, propname) should not be returning
true for public properties of non-public classes. And the patch looks fine.

However I am concerned about backwards compatibility if we change the behaviour
of an existing method to report false where it used to report true.

An alternative would be to create a separate method
PropertyUtils.isReadableProperty or somesuch which has the new behaviour, and
then deprecate the old method.

By the way, whatever change is made probably should be applied to
PropertyUtils.isWriteable too.

Comments?

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 33840] - [beanutils] PropertyUtils.isReadable() and PropertyUtils.getProperty() not consistent

2005-03-21 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33840.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33840


[EMAIL PROTECTED] changed:

   What|Removed |Added

Summary|[BeanUtils] |[beanutils]
   |PropertyUtils.isReadable()  |PropertyUtils.isReadable()
   |and |and
   |PropertyUtils.getProperty() |PropertyUtils.getProperty()
   |not consistent  |not consistent




-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 33840] - [BeanUtils] PropertyUtils.isReadable() and PropertyUtils.getProperty() not consistent

2005-03-11 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33840.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33840





--- Additional Comments From [EMAIL PROTECTED]  2005-03-11 20:54 ---
Is this already in SVN ?
I've tried it out yesterday, but I still have the same problem.

regards,
Maarten

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: DO NOT REPLY [Bug 33840] - [BeanUtils] PropertyUtils.isReadable() and PropertyUtils.getProperty() not consistent

2005-03-11 Thread Clark Archer
Hello Maarten,

Friday, March 11, 2005, 1:54:17 PM, you wrote:

bao http://issues.apache.org/bugzilla/show_bug.cgi?id=33840

bao --- Additional Comments From [EMAIL PROTECTED]  2005-03-11 20:54 
---
bao Is this already in SVN ?
bao I've tried it out yesterday, but I still have the same problem.

No, I just attached a patch to the bug; you'll have to grab
the patch and apply it to your local sources to use it.
BTW, it only makes the two methods consistent so that
isReadable() will return false for your original test case.

-Clark



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 33840] - [BeanUtils] PropertyUtils.isReadable() and PropertyUtils.getProperty() not consistent

2005-03-11 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33840.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33840





--- Additional Comments From [EMAIL PROTECTED]  2005-03-11 21:08 ---
No, I just attached a patch to the bug; you'll have to grab
the patch and apply it to your local sources to use it.
BTW, it only makes the two methods consistent so that
isReadable() will return false for your original test case.

-Clark

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 33840] - [BeanUtils] PropertyUtils.isReadable() and PropertyUtils.getProperty() not consistent

2005-03-11 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33840.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33840





--- Additional Comments From [EMAIL PROTECTED]  2005-03-11 22:34 ---
I guess I was confused about the status RESOLVED and resolution FIXED. Is this 
the standard procedure to mark an issue FIXED before it is committed to SVN?

it's ok for me that the isReadable() method now returns false, as long as I 
can use it to be sure the getProperty() method won't throw a 
NoSuchMethodException. 

Maarten

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 33840] - [BeanUtils] PropertyUtils.isReadable() and PropertyUtils.getProperty() not consistent

2005-03-11 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33840.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33840


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |




--- Additional Comments From [EMAIL PROTECTED]  2005-03-12 00:33 ---
Reopened bug; no patch has yet been committed.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 33840] - [BeanUtils] PropertyUtils.isReadable() and PropertyUtils.getProperty() not consistent

2005-03-06 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33840.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33840


[EMAIL PROTECTED] changed:

   What|Removed |Added

  Attachment #14400|0   |1
is obsolete||




--- Additional Comments From [EMAIL PROTECTED]  2005-03-06 21:28 ---
Created an attachment (id=14416)
 -- (http://issues.apache.org/bugzilla/attachment.cgi?id=14416action=view)
checks that PropertyUtils.isReadable() reports false on innaccessible methods


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 33840] - [BeanUtils] PropertyUtils.isReadable() and PropertyUtils.getProperty() not consistent

2005-03-06 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33840.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33840





--- Additional Comments From [EMAIL PROTECTED]  2005-03-06 21:29 ---
Created an attachment (id=14417)
 -- (http://issues.apache.org/bugzilla/attachment.cgi?id=14417action=view)
changed isReadable() to use MethodUtis.getAccessibleMethod()


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 33840] - [BeanUtils] PropertyUtils.isReadable() and PropertyUtils.getProperty() not consistent

2005-03-06 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33840.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33840


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED




--- Additional Comments From [EMAIL PROTECTED]  2005-03-06 21:32 ---
After looking at this problem, it stemmed from the fact that
PropertyUtils.isReadable() had a looser criteria for determining if a method was
readable than PropertyUtils.getProperty().  The patch brings isReadable() in
line with getProperty(), which I think makes for a cleaner solution than
throwing new exceptions in getProperty().

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 33840] - [BeanUtils] PropertyUtils.isReadable() and PropertyUtils.getProperty() not consistent

2005-03-05 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33840.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33840


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |ASSIGNED




--- Additional Comments From [EMAIL PROTECTED]  2005-03-06 02:37 ---
I have encountered this problem several times myself.  I think we should
probably just throw a more informative exception as I've wasted time stepping
through the code one more than one occasion before realizing that one of the
beans was an instance of a non-public class.  I'll see what I can do.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 33840] - [BeanUtils] PropertyUtils.isReadable() and PropertyUtils.getProperty() not consistent

2005-03-04 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33840.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33840





--- Additional Comments From [EMAIL PROTECTED]  2005-03-04 10:58 ---
Created an attachment (id=14400)
 -- (http://issues.apache.org/bugzilla/attachment.cgi?id=14400action=view)
A junit test illustrating the problem


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 33840] - [BeanUtils] PropertyUtils.isReadable() and PropertyUtils.getProperty() not consistent

2005-03-04 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
http://issues.apache.org/bugzilla/show_bug.cgi?id=33840.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=33840





--- Additional Comments From [EMAIL PROTECTED]  2005-03-04 11:00 ---
I'm using beanutils 1.7.0 (isn't listed in the Version drop-down)

regards,
Maarten

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]