RE: Missing type information (not seen in visitor)

2017-09-25 Thread Showalter, Jim
org.apache.bcel

-Original Message-
From: Gary Gregory [mailto:garydgreg...@gmail.com] 
Sent: Monday, September 25, 2017 6:15 PM
To: Commons Users List 
Subject: Re: Missing type information (not seen in visitor)

Which Commons component are you using?

Gary

On Sep 25, 2017 17:05, "Showalter, Jim"  wrote:

> We have two classes like this:
>
> package com.intuit.foo;
>
> public class Foo {
> }
>
> public class FooHolder {
>private List foos = new ArrayList<>(); }
>
> After visiting both classes and dumping out the info, I see this:
>
> com/intuit/foo/Foo:
>   class, lines 0 to ~2, deletable, public
>
> com/intuit/foo/Foos:
>   class, lines 0 to ~2, not-deletable, public
>   type references
> 
>   field declarations
> com/intuit/obill/v1/quote/response/Quote:chargeDetails:
> Ljava/util/List;
>
> Note that the type Foo is not seen in when visiting the Foos. Because 
> there are no other references to Foo anywhere, this results in a 
> false-positive delete of Foo.java.
>
> I collect all of the referred-to types in the visitor like this:
>
>@Override
>public void visitConstantClass(final ConstantClass obj) {
>   String className = 
> JavaUtils.dotsToSlashes( 
> javaClass().getConstantPool().getConstant(obj.getNameIndex()).toString
> ().replace("\")",
> "").replaceAll("^.*\"", ""));
>   if (ignore(className)) {
>  return;
>   }
>   type().addTypeReference(className);
>}
>
> What am I doing wrong?
>
> Jim Showalter
> Programmer
> Intuit, 2003H-265Z
> Garcia Avenue
> Mountain View, CA 94043
> (408) 353-4954 [home]
> (408) 204-1661 [personal cell]
> (669) 271-2257 [work cell]
>
>


Re: Missing type information (not seen in visitor)

2017-09-25 Thread Gary Gregory
Which Commons component are you using?

Gary

On Sep 25, 2017 17:05, "Showalter, Jim"  wrote:

> We have two classes like this:
>
> package com.intuit.foo;
>
> public class Foo {
> }
>
> public class FooHolder {
>private List foos = new ArrayList<>();
> }
>
> After visiting both classes and dumping out the info, I see this:
>
> com/intuit/foo/Foo:
>   class, lines 0 to ~2, deletable, public
>
> com/intuit/foo/Foos:
>   class, lines 0 to ~2, not-deletable, public
>   type references
> 
>   field declarations
> com/intuit/obill/v1/quote/response/Quote:chargeDetails:
> Ljava/util/List;
>
> Note that the type Foo is not seen in when visiting the Foos. Because
> there are no other references to Foo anywhere, this results in a
> false-positive delete of Foo.java.
>
> I collect all of the referred-to types in the visitor like this:
>
>@Override
>public void visitConstantClass(final ConstantClass obj) {
>   String className = JavaUtils.dotsToSlashes(
> javaClass().getConstantPool().getConstant(obj.getNameIndex()).toString().replace("\")",
> "").replaceAll("^.*\"", ""));
>   if (ignore(className)) {
>  return;
>   }
>   type().addTypeReference(className);
>}
>
> What am I doing wrong?
>
> Jim Showalter
> Programmer
> Intuit, 2003H-265Z
> Garcia Avenue
> Mountain View, CA 94043
> (408) 353-4954 [home]
> (408) 204-1661 [personal cell]
> (669) 271-2257 [work cell]
>
>


Missing type information (not seen in visitor)

2017-09-25 Thread Showalter, Jim
We have two classes like this:

package com.intuit.foo;

public class Foo {
}

public class FooHolder {
   private List foos = new ArrayList<>();
}

After visiting both classes and dumping out the info, I see this:

com/intuit/foo/Foo:
  class, lines 0 to ~2, deletable, public

com/intuit/foo/Foos:
  class, lines 0 to ~2, not-deletable, public
  type references

  field declarations
com/intuit/obill/v1/quote/response/Quote:chargeDetails:Ljava/util/List;

Note that the type Foo is not seen in when visiting the Foos. Because there are 
no other references to Foo anywhere, this results in a false-positive delete of 
Foo.java.

I collect all of the referred-to types in the visitor like this:

   @Override
   public void visitConstantClass(final ConstantClass obj) {
  String className = 
JavaUtils.dotsToSlashes(javaClass().getConstantPool().getConstant(obj.getNameIndex()).toString().replace("\")",
 "").replaceAll("^.*\"", ""));
  if (ignore(className)) {
 return;
  }
  type().addTypeReference(className);
   }

What am I doing wrong?

Jim Showalter
Programmer
Intuit, 2003H-265Z
Garcia Avenue
Mountain View, CA 94043
(408) 353-4954 [home]
(408) 204-1661 [personal cell]
(669) 271-2257 [work cell]



Re: [fileupload] API compatibility across versions

2017-09-25 Thread Benedikt Ritter
Hello Christopher,

> Am 20.09.2017 um 18:18 schrieb Christopher Schultz 
> :
> 
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA256
> 
> All,
> 
> I've taken a look back at the "recent" fileupload release
> announcements, and I can't seem to see any documentation on the API
> compatibility between fileupload 1.2.x and fileupload 1.3.x.
> 
> The release announcement for 1.3 points to the 1.3 release notes[1]
> which don't mention compatibility with previous versions (i.e. 1.2.x).
> 
> The RELEASE-NOTES.txt found in the 1.3 release in svn[2] indicates
> that 1.3 is a "maintenance release" which leads me to believe that 1.3
> should be backward-compatible with 1.2.x versions.
> 
> I'm just writing to get some confirmation of that fact.

Yes this is correct.

> 
> (Also, could you please put a link to the current Release Notes on the
> commons-fileupload website? I had to dig into mailing list archives
> and svn to find them. Maybe this is a personal ignorance of
> Maven-generated sites, but finding a changelog or release notes seems
> unnecessarily difficult.)

I’ve added a link to the lastest release notes to the projects website. Thank 
you for your feedback.

Cheers,
Benedikt

> 
> Thanks,
> - -chris
> 
> [1] http://www.apache.org/dist/commons/fileupload/RELEASE-NOTES.txt
> [2]
> http://svn.apache.org/viewvc/commons/_moved_to_git/fileupload/tags/FILEU
> PLOAD_1_3/RELEASE-NOTES.txt?revision=1754665=markup
> -BEGIN PGP SIGNATURE-
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
> 
> iQIcBAEBCAAGBQJZwpTwAAoJEBzwKT+lPKRYKbkQALgJvPz/sMJXoCbWPtA5+Cgq
> mHwReKSNRf2The+YijYBTiMY/yxSGpmJJaJizGNg0sht6pOdwKdaXMtfjiEdQwnY
> SJRVMc+2ZP8MQRnsrL8sp3Zb6WHSRSCXbcwn9bfzw/X3uP5aqDk9pPJ8wjhODV6m
> CX2KJvK3jZvf7Fh9ajtAj0oHINaYBWxXsVgaPqx1/F08fVYeSbeka5JVb4DbUTrM
> 9flT1Ljl9lHa1WKdtJFZEjpwOMl2AqE2ht43MeOEQltU4ZCBlS9fS1/vZxeUe6g2
> yafsVswbginpaXtPH2XHluXtuPriOdfWgyqiToVdA37p6O+zz1gKBSXlZT4NVN1D
> pE28pwKCuTXHDQNBaFa1fk6kue87tOGwwK8UkupxRXeOqJX4zd2IAEKQJJ2D+OGu
> IDKmKmj9JgeLg+NnSBIWCNlmOCviDqJCz4sTG2ku++wmzSeM4y5HJbnAhpztRNsD
> hioCM09B4jP3rhSmHLuyJvs5yPupVHLeBhuF+eN1kwcG2yFSlpvZD1l0MsyqmMUT
> n4QzQIfw9qRVNMdCji/WsB05ZlJQQgVJLQY7EChfllI2iDxAs7LROMAhOMjVRbaN
> AhbFZQ7vBTqp8YkUUe0npNSa5WLSwQfIpISXEfdkfWHpAnL1LfqdYRtdgni+KTAW
> zfuJavZi+DKro4PpwPFb
> =QfuL
> -END PGP SIGNATURE-
> 
> -
> To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
> For additional commands, e-mail: user-h...@commons.apache.org
> 


-
To unsubscribe, e-mail: user-unsubscr...@commons.apache.org
For additional commands, e-mail: user-h...@commons.apache.org



Re: [VFS] How to override a FileContent / FileContentInfo provider for an existing filesystem?

2017-09-25 Thread Gary Gregory
I'm curious at what Ralph thinks. You could consider providing a PR to add
the feature to make the class pluggable and see how much code that
touches...

Gary

On Mon, Sep 25, 2017 at 10:23 AM, Carl Eric Codere <
cecod...@yahoo.ca.invalid> wrote:

> Greetings, Thanks for your quick reply!  Yes, you are
> correct.  I would like to have a way to change the provider, I would
> subclass the implementation that you have and use that as content and
> contentInfo provider. Otherwise, if its not the case, currently i need to
> reimplement everything, right?
>
> Best regards,Carl
>
>   From: Gary Gregory 
>  To: Commons Users List ; Carl Eric Codere <
> cecod...@yahoo.ca>
>  Sent: Monday, September 25, 2017 5:07 PM
>  Subject: Re: [VFS] How to override a FileContent / FileContentInfo
> provider for an existing filesystem?
>
> Hi Carl,
>
> Do you mean org.apache.commons.vfs2.impl.DefaultFileContentInfo
> and org.apache.commons.vfs2.impl.FileContentInfo?
>
> Ralph, do have issue as to make this pluggable?
>
> Gary
>
> On Mon, Sep 25, 2017 at 8:31 AM, Carl Eric Codere
>  > wrote:
>
> > Greetings,I am interested in using the VFS library for
> one
> > of my projects, as it has almost everything I need, but i have some
> > questions on it though.
> > My use case is as follows:* For the local file system, I use DESCRIPT.ION
> > files to store attributes of files and directories, so I would need to
> > override some methods of DefaultFileInfo() , mainly all the attribute
> > related functions. How can I set my own FileInfo provider? I did not find
> > any API in the interfaces to do this, maybe, i missed something.
> > * The same is true of FileContent, how can I set my own FileContentInfo
> > provider in FileContent ? I would probably use a feature of JDK 1.6 (the
> > FileTypeMap class) to override the default implementation.
> >
> > Finally an unrelated question, why you do not use the DataSource
> interface
> > in FileObject available in JDK 1.6, is it because of Android
> compatibility
> > issues?
> > Thanks in advance for your help,Carl
> >
> >
> >
> >
> >
> >
>
>
>


Re: [VFS] How to override a FileContent / FileContentInfo provider for an existing filesystem?

2017-09-25 Thread Carl Eric Codere
Greetings,
 Yes, I was talking about javax.activation.DataSource, which 
seems to be consistent with what you are doing, but it does not seem to have 
available in Android i think, so it could be an issue, also same for 
FileTypeMap, thanks for the clarification.
Best regards,Carl

  From: Gary Gregory 
 To: Commons Users List ; Carl Eric Codere 
 
 Sent: Monday, September 25, 2017 5:10 PM
 Subject: Re: [VFS] How to override a FileContent / FileContentInfo provider 
for an existing filesystem?
   
Hi Carl,

WRT DataSource, this is a JDBC interface, which does not seem appropriate
for a file system. Or do you mean javax.activation.DataSource. Apache
Commons VFS was started a long time ago and not adapted to newer JREs in
this area (obviously.)

Gary


On Mon, Sep 25, 2017 at 8:31 AM, Carl Eric Codere  wrote:

> Greetings,                I am interested in using the VFS library for one
> of my projects, as it has almost everything I need, but i have some
> questions on it though.
> My use case is as follows:* For the local file system, I use DESCRIPT.ION
> files to store attributes of files and directories, so I would need to
> override some methods of DefaultFileInfo() , mainly all the attribute
> related functions. How can I set my own FileInfo provider? I did not find
> any API in the interfaces to do this, maybe, i missed something.
> * The same is true of FileContent, how can I set my own FileContentInfo
> provider in FileContent ? I would probably use a feature of JDK 1.6 (the
> FileTypeMap class) to override the default implementation.
>
> Finally an unrelated question, why you do not use the DataSource interface
> in FileObject available in JDK 1.6, is it because of Android compatibility
> issues?
> Thanks in advance for your help,Carl
>
>
>
>
>
>


   

Re: [VFS] How to override a FileContent / FileContentInfo provider for an existing filesystem?

2017-09-25 Thread Carl Eric Codere
Greetings,             Thanks for your quick reply!  Yes, you are correct.  I 
would like to have a way to change the provider, I would subclass the 
implementation that you have and use that as content and contentInfo provider. 
Otherwise, if its not the case, currently i need to reimplement everything, 
right?
               
    Best regards,Carl

  From: Gary Gregory 
 To: Commons Users List ; Carl Eric Codere 
 
 Sent: Monday, September 25, 2017 5:07 PM
 Subject: Re: [VFS] How to override a FileContent / FileContentInfo provider 
for an existing filesystem?
   
Hi Carl,

Do you mean org.apache.commons.vfs2.impl.DefaultFileContentInfo
and org.apache.commons.vfs2.impl.FileContentInfo?

Ralph, do have issue as to make this pluggable?

Gary

On Mon, Sep 25, 2017 at 8:31 AM, Carl Eric Codere  wrote:

> Greetings,                I am interested in using the VFS library for one
> of my projects, as it has almost everything I need, but i have some
> questions on it though.
> My use case is as follows:* For the local file system, I use DESCRIPT.ION
> files to store attributes of files and directories, so I would need to
> override some methods of DefaultFileInfo() , mainly all the attribute
> related functions. How can I set my own FileInfo provider? I did not find
> any API in the interfaces to do this, maybe, i missed something.
> * The same is true of FileContent, how can I set my own FileContentInfo
> provider in FileContent ? I would probably use a feature of JDK 1.6 (the
> FileTypeMap class) to override the default implementation.
>
> Finally an unrelated question, why you do not use the DataSource interface
> in FileObject available in JDK 1.6, is it because of Android compatibility
> issues?
> Thanks in advance for your help,Carl
>
>
>
>
>
>


   

Re: [VFS] How to override a FileContent / FileContentInfo provider for an existing filesystem?

2017-09-25 Thread Gary Gregory
Hi Carl,

WRT DataSource, this is a JDBC interface, which does not seem appropriate
for a file system. Or do you mean javax.activation.DataSource. Apache
Commons VFS was started a long time ago and not adapted to newer JREs in
this area (obviously.)

Gary


On Mon, Sep 25, 2017 at 8:31 AM, Carl Eric Codere  wrote:

> Greetings,I am interested in using the VFS library for one
> of my projects, as it has almost everything I need, but i have some
> questions on it though.
> My use case is as follows:* For the local file system, I use DESCRIPT.ION
> files to store attributes of files and directories, so I would need to
> override some methods of DefaultFileInfo() , mainly all the attribute
> related functions. How can I set my own FileInfo provider? I did not find
> any API in the interfaces to do this, maybe, i missed something.
> * The same is true of FileContent, how can I set my own FileContentInfo
> provider in FileContent ? I would probably use a feature of JDK 1.6 (the
> FileTypeMap class) to override the default implementation.
>
> Finally an unrelated question, why you do not use the DataSource interface
> in FileObject available in JDK 1.6, is it because of Android compatibility
> issues?
> Thanks in advance for your help,Carl
>
>
>
>
>
>


Re: [VFS] How to override a FileContent / FileContentInfo provider for an existing filesystem?

2017-09-25 Thread Gary Gregory
Hi Carl,

Do you mean org.apache.commons.vfs2.impl.DefaultFileContentInfo
and org.apache.commons.vfs2.impl.FileContentInfo?

Ralph, do have issue as to make this pluggable?

Gary

On Mon, Sep 25, 2017 at 8:31 AM, Carl Eric Codere  wrote:

> Greetings,I am interested in using the VFS library for one
> of my projects, as it has almost everything I need, but i have some
> questions on it though.
> My use case is as follows:* For the local file system, I use DESCRIPT.ION
> files to store attributes of files and directories, so I would need to
> override some methods of DefaultFileInfo() , mainly all the attribute
> related functions. How can I set my own FileInfo provider? I did not find
> any API in the interfaces to do this, maybe, i missed something.
> * The same is true of FileContent, how can I set my own FileContentInfo
> provider in FileContent ? I would probably use a feature of JDK 1.6 (the
> FileTypeMap class) to override the default implementation.
>
> Finally an unrelated question, why you do not use the DataSource interface
> in FileObject available in JDK 1.6, is it because of Android compatibility
> issues?
> Thanks in advance for your help,Carl
>
>
>
>
>
>


[VFS] How to override a FileContent / FileContentInfo provider for an existing filesystem?

2017-09-25 Thread Carl Eric Codere
Greetings,    I am interested in using the VFS library for one of 
my projects, as it has almost everything I need, but i have some questions on 
it though.
My use case is as follows:* For the local file system, I use DESCRIPT.ION files 
to store attributes of files and directories, so I would need to override some 
methods of DefaultFileInfo() , mainly all the attribute related functions. How 
can I set my own FileInfo provider? I did not find any API in the interfaces to 
do this, maybe, i missed something.
* The same is true of FileContent, how can I set my own FileContentInfo 
provider in FileContent ? I would probably use a feature of JDK 1.6 (the 
FileTypeMap class) to override the default implementation.

Finally an unrelated question, why you do not use the DataSource interface in 
FileObject available in JDK 1.6, is it because of Android compatibility issues?
Thanks in advance for your help,Carl