Skip to content
This repository has been archived by the owner on Feb 7, 2019. It is now read-only.

Conversation

ncharles
Copy link
Member

case s => s.trim().replaceAll("""[\p{Blank}]+"""," ") match {
case "" => None
case text => Some(text)
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it's exactly the same method, in the same project, we should dedup it. It really smell like bugs waiting to happen.

For the code, it's ok. I'm not sure if it make more sense to have:

  def optText(n:NodeSeq) = n.text match {
    case null => None
    case s => s.trim().replaceAll("""[\p{Blank}]+"""," ") match {
      case ""   => None
      case text => Some(text)
    }
}

so that the blank case is at the same place, but it's really not important.

… may fail to be parsed due to invalid sanitization of entry
@ncharles
Copy link
Member Author

Commit modified

@ncharles ncharles force-pushed the bug_10220/inventories_with_fields_containing_only_spaces_tabs_may_fail_to_be_parsed_due_to_invalid_sanitization_of_entry branch from 301ba58 to b5cf10c Compare February 16, 2017 13:35
@@ -1078,3 +1069,20 @@ class FusionReportUnmarshaller(
}
}
}


object OptText {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couldn't find a better name :(

@Normation-Quality-Assistant

OK, merging this PR

@Normation-Quality-Assistant Normation-Quality-Assistant merged commit b5cf10c into Normation:branches/rudder/3.1 Feb 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants