[midPoint-git] [Evolveum/midpoint] 23d159: Use String.indexOf() instead of String.contains()

Radovan Semancik radovan.semancik at evolveum.com
Mon Sep 4 09:51:49 CEST 2017


  Branch: refs/heads/master
  Home:   https://github.com/Evolveum/midpoint
  Commit: 23d159657c953aa209f9ef780c95942759c897f9
      https://github.com/Evolveum/midpoint/commit/23d159657c953aa209f9ef780c95942759c897f9
  Author: Robert Varga <nite at hq.sk>
  Date:   2017-09-02 (Sat, 02 Sep 2017)

  Changed paths:
    M infra/prism/src/main/java/com/evolveum/midpoint/prism/lex/json/yaml/MidpointYAMLGenerator.java

  Log Message:
  -----------
  Use String.indexOf() instead of String.contains()

String.indexOf() is char-based and hence faster than general-purpose
String-based String.contains().

Signed-off-by: Robert Varga <nite at hq.sk>


  Commit: 3356e166e71e0bc650d083b1861ae5eb9df6fca0
      https://github.com/Evolveum/midpoint/commit/3356e166e71e0bc650d083b1861ae5eb9df6fca0
  Author: Robert Varga <nite at hq.sk>
  Date:   2017-09-02 (Sat, 02 Sep 2017)

  Changed paths:
    M infra/prism/src/main/java/com/evolveum/midpoint/prism/marshaller/TrivialItemPathParser.java
    M infra/prism/src/main/java/com/evolveum/midpoint/prism/polystring/PrismDefaultPolyStringNormalizer.java
    M infra/prism/src/main/java/com/evolveum/midpoint/prism/util/PrismPrettyPrinter.java
    M infra/util/src/main/java/com/evolveum/midpoint/util/DOMUtil.java
    M infra/util/src/main/java/com/evolveum/midpoint/util/QNameUtil.java

  Log Message:
  -----------
  Pre-compile regular expressions

Pattern is thread-safe and pre-compiling it provides superior
performance when compared to String.matches()/replace()/replaceAll().

Signed-off-by: Robert Varga <nite at hq.sk>


  Commit: 9fe255cde94fdcf9479aebaf2f01ddde13c59bee
      https://github.com/Evolveum/midpoint/commit/9fe255cde94fdcf9479aebaf2f01ddde13c59bee
  Author: Robert Varga <nite at hq.sk>
  Date:   2017-09-02 (Sat, 02 Sep 2017)

  Changed paths:
    M infra/util/src/main/java/com/evolveum/midpoint/util/MiscUtil.java

  Log Message:
  -----------
  Use StringBuilder instead of StringBuffer

While the JVM can optimize synchronized methods of StringBuffer
using escape analysis, it is best to just use StringBuilder instead.

Signed-off-by: Robert Varga <nite at hq.sk>


  Commit: 735b6288fb874622f375e72e78443a6293767de9
      https://github.com/Evolveum/midpoint/commit/735b6288fb874622f375e72e78443a6293767de9
  Author: Robert Varga <nite at hq.sk>
  Date:   2017-09-02 (Sat, 02 Sep 2017)

  Changed paths:
    M infra/common/src/main/java/com/evolveum/midpoint/common/LoggingConfigurationManager.java
    M infra/prism/src/main/java/com/evolveum/midpoint/prism/marshaller/ItemPathHolder.java
    M infra/prism/src/main/java/com/evolveum/midpoint/prism/query/ObjectPaging.java

  Log Message:
  -----------
  Do not use String concat for StringBuilder.append() argument

Instantiating a temporary string just to place it into a StringBuilder
is inefficient -- just use multiple calls to StringBuilder.append().

Signed-off-by: Robert Varga <nite at hq.sk>


  Commit: bf01d7d4e55d8019e2e961b4b9f273954ca5ed35
      https://github.com/Evolveum/midpoint/commit/bf01d7d4e55d8019e2e961b4b9f273954ca5ed35
  Author: Robert Varga <nite at hq.sk>
  Date:   2017-09-02 (Sat, 02 Sep 2017)

  Changed paths:
    M infra/common/src/main/java/com/evolveum/midpoint/common/LoggingConfigurationManager.java

  Log Message:
  -----------
  Iterate directly over String.split() result

Use syntactic sugar to make it clear that we are processing
all entries and do not care about the actual array.

Signed-off-by: Robert Varga <nite at hq.sk>


  Commit: 29a9c7565bd0a4e5dd938b66a929d2081e73863b
      https://github.com/Evolveum/midpoint/commit/29a9c7565bd0a4e5dd938b66a929d2081e73863b
  Author: Radovan Semancik <radovan.semancik at evolveum.com>
  Date:   2017-09-04 (Mon, 04 Sep 2017)

  Changed paths:
    M infra/common/src/main/java/com/evolveum/midpoint/common/LoggingConfigurationManager.java
    M infra/prism/src/main/java/com/evolveum/midpoint/prism/lex/json/yaml/MidpointYAMLGenerator.java
    M infra/prism/src/main/java/com/evolveum/midpoint/prism/marshaller/ItemPathHolder.java
    M infra/prism/src/main/java/com/evolveum/midpoint/prism/marshaller/TrivialItemPathParser.java
    M infra/prism/src/main/java/com/evolveum/midpoint/prism/polystring/PrismDefaultPolyStringNormalizer.java
    M infra/prism/src/main/java/com/evolveum/midpoint/prism/query/ObjectPaging.java
    M infra/prism/src/main/java/com/evolveum/midpoint/prism/util/PrismPrettyPrinter.java
    M infra/util/src/main/java/com/evolveum/midpoint/util/DOMUtil.java
    M infra/util/src/main/java/com/evolveum/midpoint/util/MiscUtil.java
    M infra/util/src/main/java/com/evolveum/midpoint/util/QNameUtil.java

  Log Message:
  -----------
  Merge pull request #43 from rovarga/simple-opts

Simple string optimizations


Compare: https://github.com/Evolveum/midpoint/compare/76fdbe246916...29a9c7565bd0


More information about the midPoint-svn mailing list