Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make configuration properties explicit #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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" value="false"/>
<define-configuration-property name="com.google.gwt.safehtml.ForceCheckValidUri" is-multi-valued="false"/>
<set-configuration-property name="com.google.gwt.safehtml.ForceCheckValidUri" value="false"/>
</module>