Janusgraph: Fix access specifier manipulation in Hex.java

Created on 19 Jan 2017  路  5Comments  路  Source: JanusGraph/janusgraph

Fortify says we should not modify accessibility:

  1. Hex.java
kinbupossible

Most helpful comment

@amcp thanks for finding all of these issues via Fortify!

The links you have with line numbers in all of these issues are very handy as direct pointers to the issues; however, if any of those files are modified, the line number may become invalid, because master is a moving target. Thus, by the time someone comes around to fix this issue, they may not be able to find which code this is/was referring to.

A way to address files in a way that will not change in the future is by using the latest git hash for the file in place of master in the URL spec, e.g.,

Now you have a stable pointer to a file that will not change in the future, since we only move master forward and don't delete old commits.

If you want to do this globally / programmatically, the way to do it is to find the globally-latest commit to master for the repo, and just search-and-replace master with that hash in your links.

All 5 comments

@amcp thanks for finding all of these issues via Fortify!

The links you have with line numbers in all of these issues are very handy as direct pointers to the issues; however, if any of those files are modified, the line number may become invalid, because master is a moving target. Thus, by the time someone comes around to fix this issue, they may not be able to find which code this is/was referring to.

A way to address files in a way that will not change in the future is by using the latest git hash for the file in place of master in the URL spec, e.g.,

Now you have a stable pointer to a file that will not change in the future, since we only move master forward and don't delete old commits.

If you want to do this globally / programmatically, the way to do it is to find the globally-latest commit to master for the repo, and just search-and-replace master with that hash in your links.

@mbrukman I will fix the links as you describe!

It's used to convert from char[] to String without copying the underlying array. It doesn't look like there's an alternative "no-copy" solution. We could remove it and force use of a "copy" implementation (e.g. new String(char[])). Not sure how significant and/or widespread the performance implications would be (if at all).

@sjudeng lets try and copy.

How widespread are the usages? If it's something used widely (such as when moving all data in/out of storage backend) it might be worthwhile to include some kind of performance assessment as part of the the proposed update.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jerryjch picture jerryjch  路  5Comments

lazharichir picture lazharichir  路  5Comments

lmcrazy picture lmcrazy  路  5Comments

pluradj picture pluradj  路  4Comments

jerryjch picture jerryjch  路  3Comments