Skip to content

Releases: CodesAway/BEXCodeCompare

v0.13.0

28 Oct 00:20
fd81026
Compare
Choose a tag to compare

Added

  • BEX Parsing now indicates if a state occurs within a parent state (such as a String literal within a JSP tag) (fixes #104 and fixes #105)

    • Interface Indexed
    • Class IndexedValue (implementation of Indexed interface)
    • Class ParsingStateValue - implementation of ParsingState with a current state and the parent state
    • BEXUtilities.index - static method to create IndexedValue
    • Add unwrap parsing state utility method (fixes #108)
  • BEXParsingLanguage.TEXT - language which gives no special meaning to any characters

  • ParsingState default methods (fixes #95)

    • isComment
    • isStringLiteral
    • isWhitespace
    • hasParent
    • getParent
  • IntRange default methods

    • getInclusiveStart
    • getInclusiveEnd
    • getCanonicalEnd
    • isSingleValue
  • Overriden method DiffHelper.combineToDiffBlocks which takes a BiPredicate to give control whether two blocks are combined

  • BEXPair.hasEqualValues (fixes #97)

  • Method BEXPattern.pattern which returns the pattern used to create the BEXPattern

  • BEXChangeInfo constructor taking boolean and int change number (in BEX plugin)

Changed

  • Moved parsing functionality from package info.codesaway.bex.matching to info.codesaway.bex.parsing

    • Renamed BEXMatchingLanguage to BEXParsingLanguage

    • Renamed MatchingLanguage to ParsingLanguage

    • Renamed BEXMatchingStateOption to BEXParsingState

    • Renamed MatchingStateOption to ParsingState

    • Renamed MatchingDelimiterState to ParsingDelimiterState

    • Renamed MatchingDelimiterResult to ParsingDelimiterResult

    • Renamed BEXMatchingUtilities to BEXParsingUtilities

  • ParsingLanguage has been annotated as a @FunctionalInterface (fixes #94)

  • DiffWithIndex now implements Indexed

Fixed

  • BEXParsingLanguage.JSP

    • Fix JSP parsing (#102)
    • Recognize comments (fixes #93)
  • BEX Eclipse Plugin

    • Regression bug where final keyword only change should be seen as non-important change (fixes #107)
    • Recognition of commented out lines (now uses BEXString to perform the parsing) (fixes #100)
    • When combining changes, keep important and non-important changes separately (so UI shows fewer changes when important and non-important changes are on consecutive lines) (fixes #103)
  • Combine changes if have same type and are not important (fixes #91)

  • Click top level should go to first change (fixes #92)

  • Ignoring comments didn't show range in BEX view if lines are on right side (fixes #99)

  • In compare window, if selecting inserted / deleted line in BEX View, remove selection from side where there is no line (fixes #10)

  • MethodSignature.getSignatureWithClass doesn't return short classname if getting short signature (fixes #101)

0.12.0

17 Oct 00:01
40d6198
Compare
Choose a tag to compare

Added

  • Method IntBEXRange.singleton
  • DiffHelper methods
    • determineEnclosedRange(DiffUnit)
    • determineEnclosedRange(Collection)

Changed

  • Changed Javadoc to allow compiling against Java 14 (minimum version remains Java 8)

  • BEXMatchingLanguage.SQL handling of word characters when next to '#' and '$'

  • BEX Eclipse plugin (beta version 0.4.0)

    • RangeComparatorBEX refactored to use BEXPair to reduce code
    • Better handling of ignoring commented out code (when option is enabled)
    • Group together consecutive unimportant changes
    • Fix wonky scrolling in compare window
  • Upgraded backend libraries

    • RegExPlus from version 1.2.0 to 2.0.0
    • maven-javadoc-plugin from version 2.9.1 to 3.2.0

v0.11.0

23 Aug 22:23
6d2cd8b
Compare
Choose a tag to compare

Added

  • Support for parsing SQL

    • Includes support for ensuring BEGIN / END delimiters are balanced in a match
    • Added support for matching custom delimiters in a language (like BEGIN / END for SQL)
    • Method BEXMatchingUtilities.parseSQLTextStates
  • MatchingLanguage interface

    • Allows users to define custom language, if a sutable one isn't implemented
    • For example, this would be used to allow writing a parser to match language specific keywords (no plans / need to implement in BEX Matching, but user could implement for their own needs)
  • Part of custom delimiters

    • MatchingLanguage methods

      • findStartDelimiter
      • findEndDelimiter
    • BEXMatcher now internally tracks the MatchingLanguage, so that custom delimiters can be matched as part of a search

    • Internal BEXMatchingState changed to accept collection of delimiters versus a String of brackets

    • Enum MatchingDelimiterResult

    • Class MatchingDelimiterState

    • Interface MatchingLanguageSetting

      • No methods to implement
      • Used just to indicate a setting, so can write custom settings (trying to be flexible in design)
    • MatchingLanguageOption (implements MatchingLanguageSetting)

  • MatchingStateOption interface (implemented by BEXMatchingStateOption)

  • BEXMatchingUtilities

    • Method hasText which takes parameter to indicate if text search should be case-insensitive
    • Method hasCaseInsensitiveText
  • hashCode / equals method in BEXListPair and BEXMapPair (per SpotBugs warning)

Changed

  • BEXMatchingLanguage renamed extract method to parse

  • BEXMatchingUtilities renamed various extract methods to parse

  • BEXMatchingStateOption renamed MISMATCHED_BRACKETS to MISMATCHED_DELIMITERS

  • Changed to use MatchingStateOption interface instead of BEXMatchingStateOption enum

    • BEXMatcher
    • BEXMatchingUtilities
    • BEXString
  • BEXString keeps track of MatchingLanguage used when parser (helps BEXMatcher handle custom delimiters)

  • Minor tweaks to how BEXPattern caches patterns (ran into corner case with tests that checked for cached patterns)

v0.10.1

16 Aug 21:19
d309bf9
Compare
Choose a tag to compare

Fixed issue related to mismatched brackets or part of the match was inside brackets but not entire match. Previously, it would give up and not try to find a mater later in the text. Now, it retries.

v0.10.0

15 Aug 23:32
91b80d1
Compare
Choose a tag to compare

Added

  • BEXPattern syntax

    • :[group\n] to match rest of line, including line terminator
    • :[group\n$] to match rest of line, including line terminator (will also match if last line in text with no line terminator)
  • BEXPair interface extends Comparable interface (so elements are comparable, left then right, if the type is comparable

  • BEXString substring method overridden to take IntPair (including IntRange)

  • BEXPairs.bexPair helper method to create a BEXPair (can use static import)

  • IntRange.length method

Changed

  • Renamed methods which reference start/end now refer to as range
    • BEXMatcher
    • BEXMatchResult
    • ASTNodeUtilities

Fixed

  • In BEXMatcher / BEXMatchResult, throw IllegalStateException if try to get match info if a successful match hasn't occurred yet
  • IntBEXRange will throw exception if range is invalid (start and end match and exclusive on both ends, such as (1, 1))

v0.9.1

10 Aug 23:49
13d08f8
Compare
Choose a tag to compare

Fixed

  • Short-term bug fix for infinite loop in some cases related to mismatched brackets
  • A long-term fix is still being investigated (#75)

v0.9.0

09 Aug 18:59
cadd4b0
Compare
Choose a tag to compare

Added

  • Added support for Comby style of regex :[groupName~regex]
  • Added some unit tests from Comby (found and fixed several bugs as a result)
  • BEXMatcher / BEXMatchResult method entrySet()
  • ImmutableIntRangeMap.asMapOfRanges
  • Made AbstractImmutableSet public (used by ImmutableIntRangeMap and BEXMatcher)
  • BEXUtilities.entry method
    • Creates an immutable entry (used lots in tests)
    • Similar to Java 9 Map.entry method

Changed

  • In regex, added multiline flag by default, so ^ and $ match for each separate line
    • This should be more common
    • Can always disable using the (?-m) remove multiline flag option in regex

v0.8.0

06 Aug 20:32
b28e44d
Compare
Choose a tag to compare

Added

  • ImmutableIntRangeMap

  • IntRange / IntBEXRange methods

  • BEXPattern

    • Basic caching of BEXPattern (done behind the scenes)
    • Method getThreadLocalMatcher
    • matcher method which takes no arguments (can then call reset to set text)
  • BEXMatcher methods

    • toMatchResult

Changed

  • Refactored matching code to use ImmutableIntRangeMap

Removed

  • Code no longer needed after change to use ImmutableIntRangeMap

    • Class BEXMatchingTextState
    • BEXUtilities methods
      • getEntryInRanges
      • hasEntryInRanges
  • In BECR, ASTNodeUtilities, removed methods which aren't used (may be added back if a need arises)

    • getCommentRanges
    • findNode

0.7.0

05 Aug 21:13
71fe744
Compare
Choose a tag to compare

Added

  • Initial support for matching JSP

    • Added BEXMatchingLanguage enum
    • Passes function to extract the necessary information (used in BEXString)
    • BEXMatchingUtilities has the methods
  • BEXPatternFlag to REQUIRE_SPACE

    • When this flag is passed, spaces in the pattern are always required
    • By default, spaces are usually optional (except in certain circumstancances - to allow matching without regard to exact formatting in the code)
  • Improvements to IntBEXRange (can created closed range)

  • Method IntRange.canonical to "normalize" the int range

Changed

  • Simplified BEXMatcher code and removed repeated code
  • BEXMatchingTextState now implements IntRange

Fixed

  • 0.6.0 didn't have all the code checked in (such as supporting star group to indicate the entire match)
  • Whitespace before and after group in match is optional if not next to word character
    • For example, the pattern method(:[1] , :[2]) now allows the space before and after the comma to be optional
    • If want to always require space, can use the new flag REQUIRE_SPACE
    • If want just this specific space to be required, can put two spaces in the pattern

0.6.0

04 Aug 23:12
e7e0f4a
Compare
Choose a tag to compare

Added

  • BEXPattern

    • Syntax
      • :[@] to escape @ symbol (rarely needed, mainly useful for BEXPattern.literal
      • :[group:d] to to have group consisting of only digits (similar to :[group:w] which is group consisting of only word characters)
    • In group / get method, can specify group name as "*" to get the entire match (similar to group 0 for regex)
    • Methods
      • literal (use to specify literal text in pattern)
      • compile (method that just takes String pattern, makes easier to use in IDE)
  • BEXMatcher

    • Replacement functionality (similar to what's provided in regex's Matcher class
    • Can specify :[group] for a specific group's value or :[*] for the entire match's value
    • Methods
      • replaceAll (including method which takes Function<BEXMatchResult, String>
      • replaceFirst
      • getReplacement
      • appendReplacement / appendTail
      • quoteReplacement (use to specify literal text in replacement)
      • reset
  • IntBEXPair / IntBEXRange equals and hashCode method

Changed

  • BEX will contain all code that doesn't require the Eclipse JDT dependency (such as the new structured matching functionality)

  • Moved info.codesaway.becr.matching package to info.codesaway.bex.matching

    • Moved from BECR to BEX project
    • Renamed classes to mention BEX instead of BECR
    • Renamed classes to clarify that they were used for matching
  • Moved IntRange from BECR to BEX project

  • Moved functions in BECRUtilities to BEXUtilities