You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by Tharindu Dananjaya <th...@gmail.com> on 2017/07/18 06:06:03 UTC

Bug 60966 : getClass().getResource() does not work as a File if the classpath contains spaces

can some one give me more information of this bug?

Re: Bug 60966 : getClass().getResource() does not work as a File if the classpath contains spaces

Posted by Felix Schumacher <fe...@internetallee.de>.
Am 01.08.2017 um 19:10 schrieb Tharindu Dananjaya:
> Hi Felix,
>               I checked the class that named as
> ApdexPerTransactionTest.java.In there I have no idea how above problem
> happens.how can i give some test cases to check that bug?can you explain
> that simply? :P
That class currently has no getClass().getResource() calls. It uses 
getResourceAsStream() which is safe in regard to whitespace in paths.

Maybe you want to look in the subversion (git might be faster) history 
of that class. The change #1790830 is the one, that changed 
getResource() to getResourceAsStream(). I think (haven't checked), that 
the test will fail, if the jmeter source is placed inside a directory, 
that contains a space.

Felix

>


Re: Bug 60966 : getClass().getResource() does not work as a File if the classpath contains spaces

Posted by Tharindu Dananjaya <th...@gmail.com>.
Hi Felix,
             I checked the class that named as
ApdexPerTransactionTest.java.In there I have no idea how above problem
happens.how can i give some test cases to check that bug?can you explain
that simply? :P

Re: Bug 60966 : getClass().getResource() does not work as a File if the classpath contains spaces

Posted by Felix Schumacher <fe...@internetallee.de>.
Am 18.07.2017 um 08:06 schrieb Tharindu Dananjaya:
> can some one give me more information of this bug?
>
I think this is a marker for anyone working on the code to lookout for 
usages of getClass().getResource().

You could look at the code and search for such occurrences. The quest is 
to decide, whether they are safe, when confronted with filenames that 
have spaces in them.

Felix