Skip to content

Commit

Permalink
ph-commons 11.1.5; Java 21 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
phax committed Mar 27, 2024
1 parent ad5a0cc commit b040a42
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 17 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,9 @@ Configuration items are:

## News and noteworthy

* v7.0.2 - work in progress
* Updated to ph-commons 11.1.5
* Created Java 21 compatibility
* v7.0.1 - 2023-07-31
* Updated to ph-commons 11.1
* v7.0.0 - 2023-02-01
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ protected void modifyExpressionMembers (@Nonnull final ICommonsList <ICSSExpress
// assumed to be 0.
// * one of the keywords: none, auto, or initial.

final ICSSExpressionMember aMember = aExpressionMembers.getFirst ();
final ICSSExpressionMember aMember = aExpressionMembers.getFirstOrNull ();
final String sCSS = aMember.getAsCSSString ();
if (CCSSValue.INITIAL.equals (sCSS))
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected void modifyExpressionMembers (@Nonnull final ICommonsList <ICSSExpress
if (nSize == 1)
{
// 4px -> 4px 4px 4px 4px
final ICSSExpressionMember aMember = aExpressionMembers.getFirst ();
final ICSSExpressionMember aMember = aExpressionMembers.getFirstOrNull ();
for (int i = 0; i < 3; ++i)
aExpressionMembers.add (aMember.getClone ());
}
Expand Down
7 changes: 4 additions & 3 deletions ph-css/src/main/java/com/helger/css/parser/CSSCharStream.java
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,9 @@ private int _handleUnescape (final int cSrcFiltered) throws IOException
return nCodePoint;
}

public int read (@Nonnull final char [] buf, @Nonnegative final int nOfs, @Nonnegative final int nLen)
throws IOException
public int read (@Nonnull final char [] buf,
@Nonnegative final int nOfs,
@Nonnegative final int nLen) throws IOException
{
ValueEnforcer.notNull (buf, "buf");
ValueEnforcer.isGE0 (nOfs, "Ofs");
Expand Down Expand Up @@ -613,7 +614,7 @@ public void done ()
*
* @param nNewLine
* line index
* @param newCol
* @param nNewCol
* column index
*/
public void adjustBeginLineColumn (final int nNewLine, final int nNewCol)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ public class CSSValueMultiValue implements ICSSMultiValue
{
private final ICommonsList <CSSValue> m_aValues = new CommonsArrayList <> ();

public CSSValueMultiValue (@Nonnull final ICSSProperty aProperty, @Nonnull @Nonempty final String [] aValues, final boolean bIsImportant)
public CSSValueMultiValue (@Nonnull final ICSSProperty aProperty,
@Nonnull @Nonempty final String [] aValues,
final boolean bIsImportant)
{
ValueEnforcer.notNull (aProperty, "Property");
ValueEnforcer.notEmptyNoNullValue (aValues, "Values");
Expand All @@ -66,7 +68,7 @@ public ICommonsList <CSSValue> getAllContainedValues ()
@Nonnull
public ECSSProperty getProp ()
{
return m_aValues.getFirst ().getProp ();
return m_aValues.getFirstOrNull ().getProp ();
}

@Nonnull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ public static String createLoggingStringParseError (@Nonnull final Token aLastVa
return retval.toString ();
}

public void onCSSParseError (@Nonnull final ParseException aParseEx, @Nullable final Token aLastSkippedToken)
throws ParseException
public void onCSSParseError (@Nonnull final ParseException aParseEx,
@Nullable final Token aLastSkippedToken) throws ParseException
{
if (aParseEx.expectedTokenSequences == null)
LOGGER.warn (aParseEx.getMessage ());
Expand Down Expand Up @@ -178,8 +178,6 @@ public void onCSSUnexpectedRule (@Nonnull final Token aCurrentToken,
* The prefix token found (like '$' or '*'). Never <code>null</code>.
* @param aIdentifierToken
* The identifier token found. Never <code>null</code>.
* @throws ParseException
* In case the error is fatal and should be propagated.
* @return The concatenated string with source location, etc. May neither be
* <code>null</code> nor empty.
*/
Expand Down Expand Up @@ -239,10 +237,8 @@ public void onCSSBrowserCompliantSkip (@Nullable final ParseException ex,
public static String createLoggingStringIllegalCharacter (final char cIllegalChar)
{
final String sCharHex = "0x" + StringHelper.getHexStringLeadingZero (cIllegalChar, 4);
final String sPrintableChar = cIllegalChar <= 32 || cIllegalChar > 255 ? sCharHex : cIllegalChar +
" (" +
sCharHex +
")";
final String sPrintableChar = cIllegalChar <= 32 || cIllegalChar > 255 ? sCharHex
: cIllegalChar + " (" + sCharHex + ")";
return "Found illegal character: " + sPrintableChar;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

/**
* Example how to extract all selectors from a certain CSS file using a
* {@link DefaultCSSUrlVisitor}.
* {@link DefaultCSSVisitor}.
*
* @author Philip Helger
*/
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<dependency>
<groupId>com.helger.commons</groupId>
<artifactId>ph-commons-parent-pom</artifactId>
<version>11.1.4</version>
<version>11.1.5</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down

0 comments on commit b040a42

Please sign in to comment.