Uploaded image for project: 'Apache NiFi'
  1. Apache NiFi
  2. NIFI-5711

NLKBufferedReader appears extend and copy portions of the JDK BufferedReader

Details

    • Bug
    • Status: Resolved
    • Blocker
    • Resolution: Fixed
    • None
    • 1.8.0
    • Extensions
    • None

    Description

      NLKBufferedReader appears to extend from then copy then alter JDK code. Extension and alter is fine. Copy and paste to get there is not. The JDK code is not licensed in a manner conducive for ALv2

      Attachments

        Issue Links

          Activity

            joewitt Joe Witt added a comment - our source: https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/util/NLKBufferedReader.java jdk source: http://hg.openjdk.java.net/jdk8/jdk8/jdk/file/687fd7c7986d/src/share/classes/java/io/BufferedReader.java This is clearly copying numerous lines of code.
            markap14 Mark Payne added a comment -

            I think we have most of what we need already in utility code in the codebase, and this is a good chance to tie it up into a prettier utility that does what we need anyway. I'll address this.

            markap14 Mark Payne added a comment - I think we have most of what we need already in utility code in the codebase, and this is a good chance to tie it up into a prettier utility that does what we need anyway. I'll address this.
            githubbot ASF GitHub Bot added a comment -

            GitHub user patricker opened a pull request:

            https://github.com/apache/nifi/pull/3085

            NIFI-5711 NLKBufferedReader appears extend and copy portions of the J…

            …DK BufferedReader

            Thank you for submitting a contribution to Apache NiFi.

            In order to streamline the review of the contribution we ask you
            to ensure the following steps have been taken:

                1. For all changes:
            • [x] Is there a JIRA ticket associated with this PR? Is it referenced
              in the commit message?
            • [x] Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
            • [x] Has your PR been rebased against the latest commit within the target branch (typically master)?
            • [x] Is your initial contribution a single, squashed commit?
                1. For code changes:
            • [ ] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder?
            • [ ] Have you written or updated unit tests to verify your changes?
            • [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
            • [ ] If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly?
            • [ ] If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly?
            • [ ] If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties?
                1. For documentation related changes:
            • [ ] Have you ensured that format looks appropriate for the output in which it is rendered?
                1. Note:
                  Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.

            You can merge this pull request into a Git repository by running:

            $ git pull https://github.com/patricker/nifi NIFI-5711

            Alternatively you can review and apply these changes as the patch at:

            https://github.com/apache/nifi/pull/3085.patch

            To close this pull request, make a commit to your master/trunk branch
            with (at least) the following in the commit message:

            This closes #3085


            commit d0d9f0172839e62cf624fe1801f8f532d42a783d
            Author: patricker <patricker@...>
            Date: 2018-10-16T21:56:55Z

            NIFI-5711 NLKBufferedReader appears extend and copy portions of the JDK BufferedReader


            githubbot ASF GitHub Bot added a comment - GitHub user patricker opened a pull request: https://github.com/apache/nifi/pull/3085 NIFI-5711 NLKBufferedReader appears extend and copy portions of the J… …DK BufferedReader Thank you for submitting a contribution to Apache NiFi. In order to streamline the review of the contribution we ask you to ensure the following steps have been taken: For all changes: [x] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message? [x] Does your PR title start with NIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. [x] Has your PR been rebased against the latest commit within the target branch (typically master)? [x] Is your initial contribution a single, squashed commit? For code changes: [ ] Have you ensured that the full suite of tests is executed via mvn -Pcontrib-check clean install at the root nifi folder? [ ] Have you written or updated unit tests to verify your changes? [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0] ( http://www.apache.org/legal/resolved.html#category-a)? [ ] If applicable, have you updated the LICENSE file, including the main LICENSE file under nifi-assembly? [ ] If applicable, have you updated the NOTICE file, including the main NOTICE file found under nifi-assembly? [ ] If adding new Properties, have you added .displayName in addition to .name (programmatic access) for each of the new properties? For documentation related changes: [ ] Have you ensured that format looks appropriate for the output in which it is rendered? Note: Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible. You can merge this pull request into a Git repository by running: $ git pull https://github.com/patricker/nifi NIFI-5711 Alternatively you can review and apply these changes as the patch at: https://github.com/apache/nifi/pull/3085.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #3085 commit d0d9f0172839e62cf624fe1801f8f532d42a783d Author: patricker <patricker@...> Date: 2018-10-16T21:56:55Z NIFI-5711 NLKBufferedReader appears extend and copy portions of the JDK BufferedReader
            pwicks Peter Wicks added a comment -

            markap14 I had a change underway, just finished. If there is a good replacement for this class in Util's then great, otherwise the PR is available; with all tests for ReplaceText and RouteText passing.

            pwicks Peter Wicks added a comment - markap14 I had a change underway, just finished. If there is a good replacement for this class in Util's then great, otherwise the PR is available; with all tests for ReplaceText and RouteText passing.
            githubbot ASF GitHub Bot added a comment -

            Github user markap14 commented on the issue:

            https://github.com/apache/nifi/pull/3085

            Will review...

            githubbot ASF GitHub Bot added a comment - Github user markap14 commented on the issue: https://github.com/apache/nifi/pull/3085 Will review...

            Commit 95e42946738fb4875e66ef80755d1a668df45954 in nifi's branch refs/heads/master from patricker
            [ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=95e4294 ]

            NIFI-5711 NLKBufferedReader appears extend and copy portions of the JDK BufferedReader

            jira-bot ASF subversion and git services added a comment - Commit 95e42946738fb4875e66ef80755d1a668df45954 in nifi's branch refs/heads/master from patricker [ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=95e4294 ] NIFI-5711 NLKBufferedReader appears extend and copy portions of the JDK BufferedReader

            Commit d6422e2d2caf855125583455e3c97496e66cc964 in nifi's branch refs/heads/master from markap14
            [ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=d6422e2 ]

            NIFI-5711: Replaced JavaDocs that appear also to be copied/pasted from BufferedReader, ran IDE code formatter to get consistent whitespace/formatting

            This closes #3085.

            Signed-off-by: Mark Payne <markap14@hotmail.com>

            jira-bot ASF subversion and git services added a comment - Commit d6422e2d2caf855125583455e3c97496e66cc964 in nifi's branch refs/heads/master from markap14 [ https://git-wip-us.apache.org/repos/asf?p=nifi.git;h=d6422e2 ] NIFI-5711 : Replaced JavaDocs that appear also to be copied/pasted from BufferedReader, ran IDE code formatter to get consistent whitespace/formatting This closes #3085. Signed-off-by: Mark Payne <markap14@hotmail.com>
            githubbot ASF GitHub Bot added a comment -

            Github user asfgit closed the pull request at:

            https://github.com/apache/nifi/pull/3085

            githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/nifi/pull/3085
            githubbot ASF GitHub Bot added a comment -

            Github user markap14 commented on the issue:

            https://github.com/apache/nifi/pull/3085

            @patricker thanks for the submission! I did a code review and everything looks correct to me. I did some testing and verified everything. However, I did notice difference in performance between this PR and 1.7.1. I have created a new JIRA to track that so that it can be addressed in the future. However, since the scope of the performance change is limited, I think that it makes sense to merge this as-is and allow 1.8.0 release process to continue and then can improve performance afterwards. +1 merged to master. Thanks again!

            githubbot ASF GitHub Bot added a comment - Github user markap14 commented on the issue: https://github.com/apache/nifi/pull/3085 @patricker thanks for the submission! I did a code review and everything looks correct to me. I did some testing and verified everything. However, I did notice difference in performance between this PR and 1.7.1. I have created a new JIRA to track that so that it can be addressed in the future. However, since the scope of the performance change is limited, I think that it makes sense to merge this as-is and allow 1.8.0 release process to continue and then can improve performance afterwards. +1 merged to master. Thanks again!
            githubbot ASF GitHub Bot added a comment -

            Github user patricker commented on the issue:

            https://github.com/apache/nifi/pull/3085

            @markap14 Thanks Mark. One thing I didn't test, and I don't know if it's covered by the current test suite, is very long lines. I didn't think about it until this morning, but with the way I re-wrote this, if a file has a single very long line I don't think it will fail when the length of the line exceeds the buffer; which is what the docs say should happen. This is because I just call `read()`, and read handles keeping the buffer filled...

            githubbot ASF GitHub Bot added a comment - Github user patricker commented on the issue: https://github.com/apache/nifi/pull/3085 @markap14 Thanks Mark. One thing I didn't test, and I don't know if it's covered by the current test suite, is very long lines. I didn't think about it until this morning, but with the way I re-wrote this, if a file has a single very long line I don't think it will fail when the length of the line exceeds the buffer; which is what the docs say should happen. This is because I just call `read()`, and read handles keeping the buffer filled...
            githubbot ASF GitHub Bot added a comment -

            Github user markap14 commented on the issue:

            https://github.com/apache/nifi/pull/3085

            @patricker you do have a good point... interestingly, though, that's not a bug introduced in your PR, as the call to `readLine()` that existed before would also never check the max buffer size. the docs say "Specifies the maximum amount of data to buffer (per file or per line, depending on the Evaluation Mode)" but unless I'm missing something, it has never been enforced per-line. Also, I did put up a PR, https://github.com/apache/nifi/pull/3100, that addresses the performance concern and in that PR, it does actually enforce the max buffer size (as a 'weak limit'), which until now I had not noticed that we were previously not doing.

            githubbot ASF GitHub Bot added a comment - Github user markap14 commented on the issue: https://github.com/apache/nifi/pull/3085 @patricker you do have a good point... interestingly, though, that's not a bug introduced in your PR, as the call to `readLine()` that existed before would also never check the max buffer size. the docs say "Specifies the maximum amount of data to buffer (per file or per line, depending on the Evaluation Mode)" but unless I'm missing something, it has never been enforced per-line. Also, I did put up a PR, https://github.com/apache/nifi/pull/3100 , that addresses the performance concern and in that PR, it does actually enforce the max buffer size (as a 'weak limit'), which until now I had not noticed that we were previously not doing.

            People

              markap14 Mark Payne
              joewitt Joe Witt
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: