You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Jordan Sissel (JIRA)" <ji...@apache.org> on 2010/07/22 23:51:53 UTC

[jira] Created: (HADOOP-6876) Path.suffix(...) on a path url with no "path" results in NullPointerException

Path.suffix(...) on a path url with no "path" results in NullPointerException
-----------------------------------------------------------------------------

                 Key: HADOOP-6876
                 URL: https://issues.apache.org/jira/browse/HADOOP-6876
             Project: Hadoop Common
          Issue Type: Bug
    Affects Versions: 0.20.2
            Reporter: Jordan Sissel


I can most briefly demo this using the hbase jruby shell (as it has hadoop in the classpath:

{noformat}

hbase(main):001:0> path = org.apache.hadoop.fs.Path.new("hdfs://testing/")
=> #<Java::OrgApacheHadoopFs::Path:0x6128453c @java_object=#<Java::JavaObject:0x1ad997f9>>
hbase(main):002:0> path.suffix("Test")
NativeException: java.lang.NullPointerException: null
{noformat}

I expected instead that path.suffix("Test") would simply generate a new path with 'Test' appended. For above, this would be the path "hdfs://testing/Test"

Workaround: This should work - instead of using path.suffix(), use this (java):
{noformat}
   Path newpath = new Path(oldpath.toString() + "mysuffix");
{noformat}



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.