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

Mustache.java 0.8.x #244

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

Mustache.java 0.8.x #244

wants to merge 8 commits into from

Conversation

songwonseock
Copy link

@songwonseock songwonseock commented Jan 10, 2020

I found the error
So I'm going to suggest a solution and I think it would be fine to modify my code like this.
if, else syntax
If the conversion parameter contained in it is an OS parameter, the OS parameter value is given priority to change the value. So for now, it's time to delete the code that converts the environment first.

*** example error syntax ( OS environment)
window OS enveronment value => %USERNAME%

{{#userName}}
{{userName}}
{{/userName}}
{{^userName}}
{{/userName}}

************ Referral Code

import com.samskivert.mustache.DefaultCollector;
import com.samskivert.mustache.Mustache.VariableFetcher;
import java.util.Map;

public class CustomMustacheColletor extends DefaultCollector {

@OverRide
public VariableFetcher createFetcher(Object ctx, String name) {
VariableFetcher fetcher = super.createFetcher(ctx, name);
if (fetcher != null ) {
return fetcher;
}

return null;

}
}

*************** MustacheEnvironmentCollector.java

@OverRide
public VariableFetcher createFetcher(Object ctx, String name) {
VariableFetcher fetcher = super.createFetcher(ctx, name);
if (fetcher != null) {
return fetcher;
}
if (this.environment.containsProperty(name)) {
return this.propertyFetcher;
}
return null;
}
===>

@OverRide
public VariableFetcher createFetcher(Object ctx, String name) {
VariableFetcher fetcher = super.createFetcher(ctx, name);
if (fetcher != null) {
return fetcher;
}
return null;
}

****** this code deleted

if (this.environment.containsProperty(name)) {
return this.propertyFetcher;
}

@ghost
Copy link

ghost commented Jan 10, 2020

DeepCode's analysis on #06d95d found:

  • 0 critical issues. ⚠️ 0 warnings and 0 minor issues. ✔️ 0 issues were fixed.

💬 This comment has been generated by the DeepCode bot, installed by the owner of the repository. The DeepCode bot protects your repository by detecting and commenting on security vulnerabilities or other critical issues.


☺️ If you want to provide feedback on our bot, here is how to contact us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants