[ https://issues.apache.org/jira/browse/HADOOP-6876?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12891390#action_12891390 ]
Jordan Sissel commented on HADOOP-6876: --------------------------------------- Updated my own code and confirmed that my suggested workaround does work. > 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.