EcmascriptParserOptions extends ParserOptions { public void setRhinoLanguageVersion(Version rhinoLanguageVersion) { this.rhinoLanguageVersion = rhinoLanguageVersion; } EcmascriptParserOptions();  EcmascriptParserOptions(Rule rule); boolean isRecordingComments(); void setRecordingComments(boolean recordingComments); boolean isRecordingLocalJsDocComments(); void setRecordingLocalJsDocComments(boolean recordingLocalJsDocComments); Version getRhinoLanguageVersion(); void setRhinoLanguageVersion(Version rhinoLanguageVersion); @Override int hashCode(); @Override boolean equals(Object obj); static final BooleanProperty RECORDING_COMMENTS_DESCRIPTOR; static final BooleanProperty RECORDING_LOCAL_JSDOC_COMMENTS_DESCRIPTOR; static final EnumeratedProperty<Version> RHINO_LANGUAGE_VERSION; }
@Test public void testEqualsHashcode() throws Exception { BooleanProperty[] properties = {EcmascriptParserOptions.RECORDING_COMMENTS_DESCRIPTOR, EcmascriptParserOptions.RECORDING_LOCAL_JSDOC_COMMENTS_DESCRIPTOR, }; for (int i = 0; i < properties.length; i++) { BooleanProperty property = properties[i]; MyRule rule = new MyRule(); rule.setProperty(property, true); ParserOptions options1 = rule.getParserOptions(); rule.setProperty(property, false); ParserOptions options2 = rule.getParserOptions(); rule.setProperty(property, true); ParserOptions options3 = rule.getParserOptions(); rule.setProperty(property, false); ParserOptions options4 = rule.getParserOptions(); verifyOptionsEqualsHashcode(options1, options2, options3, options4); } EcmascriptParserOptions options1 = new EcmascriptParserOptions(); options1.setSuppressMarker("foo"); EcmascriptParserOptions options2 = new EcmascriptParserOptions(); options2.setSuppressMarker("bar"); EcmascriptParserOptions options3 = new EcmascriptParserOptions(); options3.setSuppressMarker("foo"); EcmascriptParserOptions options4 = new EcmascriptParserOptions(); options4.setSuppressMarker("bar"); verifyOptionsEqualsHashcode(options1, options2, options3, options4); options1 = new EcmascriptParserOptions(); options1.setRhinoLanguageVersion(EcmascriptParserOptions.Version.VERSION_DEFAULT); options2 = new EcmascriptParserOptions(); options2.setRhinoLanguageVersion(EcmascriptParserOptions.Version.VERSION_1_8); options3 = new EcmascriptParserOptions(); options3.setRhinoLanguageVersion(EcmascriptParserOptions.Version.VERSION_DEFAULT); options4 = new EcmascriptParserOptions(); options4.setRhinoLanguageVersion(EcmascriptParserOptions.Version.VERSION_1_8); verifyOptionsEqualsHashcode(options1, options2, options3, options4); }