Skip to content

Commit

Permalink
Make configuration properties explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
zbynek committed Mar 17, 2023
1 parent 99d2afb commit 1071332
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ public class SafeStylesHostedModeUtils {

private static boolean forceCheck;

static {
setForceCheckValidStyleFromProperty();
}

/**
* Checks if the provided string is a valid style property name.
*
Expand Down
2 changes: 1 addition & 1 deletion gwt-safecss/src/main/module.gwt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
<inherits name="org.gwtproject.safehtml.SafeHtml"/>

<define-configuration-property name="org.gwtproject.safecss.ForceCheckValidStyles" is-multi-valued="false"/>

<set-configuration-property name="org.gwtproject.safecss.ForceCheckValidStyles" value="false"/>
<source path="shared"/>
</module>
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ private static void checkArgument(boolean completeHtml, String message) {
@GwtIncompatible
@Override
public boolean getForceCheckCompleteHtmlFromProperty() {
return System.getProperty(FORCE_CHECK_COMPLETE_HTML) != null;
return "true".equals(System.getProperty(FORCE_CHECK_COMPLETE_HTML));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public static void setForceCheckValidUri(boolean check) {
//
// @VisibleForTesting
public static void setForceCheckValidUriFromProperty() {
forceCheckValidUri = impl.getForceCheckValieUriFromProperty();
forceCheckValidUri = impl.getForceCheckValidUriFromProperty();
}

private static class JsImpl {
Expand All @@ -143,7 +143,7 @@ public boolean isValidUri(String uri) {
return true;
}

public boolean getForceCheckValieUriFromProperty() {
public boolean getForceCheckValidUriFromProperty() {
return false;
}
}
Expand All @@ -169,8 +169,8 @@ public boolean isValidUri(String uri) {

@GwtIncompatible
@Override
public boolean getForceCheckValieUriFromProperty() {
return System.getProperty(FORCE_CHECK_VALID_URI) != null;
public boolean getForceCheckValidUriFromProperty() {
return "true".equals(System.getProperty(FORCE_CHECK_VALID_URI));
}
}
}
5 changes: 5 additions & 0 deletions gwt-safehtml/src/main/module.gwt.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,9 @@
<!-- sources -->
<source path="client"/>
<source path="shared"/>

<define-configuration-property name="com.google.gwt.safehtml.ForceCheckCompleteHtml" is-multi-valued="false"/>
<set-configuration-property name="com.google.gwt.safehtml.ForceCheckCompleteHtml" is-multi-valued="false"/>
<define-configuration-property name="com.google.gwt.safehtml.ForceCheckValidUri" is-multi-valued="false"/>
<set-configuration-property name="com.google.gwt.safehtml.ForceCheckValidUri" is-multi-valued="false"/>
</module>

0 comments on commit 1071332

Please sign in to comment.