Uploaded image for project: 'Apache Twill (Retired)'
  1. Apache Twill (Retired)
  2. TWILL-136

Override equals and hashCode for JvmOptions.DebugOptions to test equality

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.6.0-incubating
    • core
    • None

    Description

      The current code for JvmOptions.DebugOptions does not have equals and hashCode overriden for equality test.

      This would cause fail comparison for DebugOptions.NO_DEBUG when being used in YarnTwillPreparer:

      final class YarnTwillPreparer implements TwillPreparer {
      
      ...
      
        @Override
        public TwillPreparer enableDebugging(boolean doSuspend, String... runnables) {
          this.debugOptions = new JvmOptions.DebugOptions(true, doSuspend, ImmutableSet.copyOf(runnables));
          return this;
        }
      
      ....
        private void saveJvmOptions(Map<String, LocalFile> localFiles) throws IOException {
          if ((extraOptions == null || extraOptions.isEmpty()) &&
            JvmOptions.DebugOptions.NO_DEBUG.equals(this.debugOptions)) {
            // If no vm options, no need to localize the file.
            return;
          }
          ...
        }
      
      ...
      }
      

      Attachments

        Activity

          People

            hsaputra Henry Saputra
            hsaputra Henry Saputra
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: