[jira] [Commented] (THRIFT-4643) Update links to repository on project website

2018-09-28 Thread Brian Forbis (JIRA)


[ 
https://issues.apache.org/jira/browse/THRIFT-4643?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16632678#comment-16632678
 ] 

Brian Forbis commented on THRIFT-4643:
--

This is still broken in the tutorials section

> Update links to repository on project website
> -
>
> Key: THRIFT-4643
> URL: https://issues.apache.org/jira/browse/THRIFT-4643
> Project: Thrift
>  Issue Type: Documentation
>  Components: Website
>Reporter: David Jung
>Assignee: James E. King III
>Priority: Minor
>
> The project website at [https://thrift.apache.org|https://thrift.apache.org/] 
> indicates that the source Git repository is located at 
> [https://git-wip-us.apache.org/repos/asf/thrift.git] and links to it in 
> several placed.  However, clicking those links or attempting to clone from 
> them just give a 'not found' error.
> Please update the links. 
> The GitHub unofficial repository is mentioned once at the bottom, but new 
> developers have no idea what that contains in relation to the official repo.
> Thanks.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Resolved] (THRIFT-4496) Dealing with language keywords in Thrift (e.g. service method names)

2018-09-28 Thread James E. King III (JIRA)


 [ 
https://issues.apache.org/jira/browse/THRIFT-4496?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James E. King III resolved THRIFT-4496.
---
   Resolution: Fixed
Fix Version/s: 0.12.0

Pull request was committed - thanks!

> Dealing with language keywords in Thrift (e.g. service method names)
> 
>
> Key: THRIFT-4496
> URL: https://issues.apache.org/jira/browse/THRIFT-4496
> Project: Thrift
>  Issue Type: New Feature
>  Components: Compiler (General)
>Reporter: Vera Filippova
>Assignee: James E. King III
>Priority: Minor
> Fix For: 0.12.0
>
>
> Apache Thrift compiler doesn't allow to use keywords in any of supported 
> languages as field names. However, there are other compilers, like Scrooge, 
> which do allow using some keywords as field identifiers, which leads to 
> incompatibility.
> Assume we had a service with 'delete' method, with Java code generated by 
> Scrooge. Now we'd like to generate Python code with Apache Thrift, but 
> encounter an error because of the 'delete' keyword.
> I understand that using only Apache Thrift compiler, a user will never 
> encounter this problem, but I think enabling keywords by request seems 
> feasible.
> h1. Proposal
> It's possible to tweak keywords on code generation stage, e.g. use 'delete_' 
> as a name of a generated function instead of 'delete', then use the original 
> method name for a protocol message: writeMethodBegin('delete').
> This feature could be enabled with an additional flag, e.g. --screen-keywords.
> I have a draft for python generator here [https://github.com/nsrtvwls/thrift]
> The questions are, is this functionality welcome? If yes, would it require to 
> have it supported for all languages?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (THRIFT-4496) Dealing with language keywords in Thrift (e.g. service method names)

2018-09-28 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/THRIFT-4496?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16631993#comment-16631993
 ] 

ASF GitHub Bot commented on THRIFT-4496:


jeking3 closed pull request #1567: THRIFT-4496: python specific list of 
keywords for python generator
URL: https://github.com/apache/thrift/pull/1567
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/compiler/cpp/CMakeLists.txt b/compiler/cpp/CMakeLists.txt
index 5da28aad44..e61887704e 100644
--- a/compiler/cpp/CMakeLists.txt
+++ b/compiler/cpp/CMakeLists.txt
@@ -62,6 +62,9 @@ set(thrift-compiler_SOURCES
 src/thrift/audit/t_audit.cpp
 )
 
+set(thrift_compiler_LANGS
+)
+
 # This macro adds an option THRIFT_COMPILER_${NAME}
 # that allows enabling or disabling certain languages
 macro(THRIFT_ADD_COMPILER name description initial)
@@ -70,6 +73,7 @@ macro(THRIFT_ADD_COMPILER name description initial)
 option(${enabler} ${description} ${initial})
 if(${enabler})
 list(APPEND thrift-compiler_SOURCES ${src})
+list(APPEND thrift_compiler_LANGS ${name})
 endif()
 endmacro()
 
diff --git a/compiler/cpp/src/thrift/generate/t_generator.cc 
b/compiler/cpp/src/thrift/generate/t_generator.cc
index 7549d5dc2e..ca3f5dd682 100644
--- a/compiler/cpp/src/thrift/generate/t_generator.cc
+++ b/compiler/cpp/src/thrift/generate/t_generator.cc
@@ -76,6 +76,77 @@ void t_generator::generate_program() {
   close_generator();
 }
 
+std::set t_generator::lang_keywords() const {
+  std::string keywords[] = { "BEGIN", "END", "__CLASS__", "__DIR__", 
"__FILE__", "__FUNCTION__",
+  "__LINE__", "__METHOD__", "__NAMESPACE__", "abstract", "alias", "and", 
"args", "as",
+  "assert", "begin", "break", "case", "catch", "class", "clone", 
"continue", "declare",
+  "def", "default", "del", "delete", "do", "dynamic", "elif", "else", 
"elseif", "elsif",
+  "end", "enddeclare", "endfor", "endforeach", "endif", "endswitch", 
"endwhile", "ensure",
+  "except", "exec", "finally", "float", "for", "foreach", "from", 
"function", "global",
+  "goto", "if", "implements", "import", "in", "inline", "instanceof", 
"interface", "is",
+  "lambda", "module", "native", "new", "next", "nil", "not", "or", 
"package", "pass",
+  "public", "print", "private", "protected", "raise", "redo", "rescue", 
"retry", "register",
+  "return", "self", "sizeof", "static", "super", "switch", "synchronized", 
"then", "this",
+  "throw", "transient", "try", "undef", "unless", "unsigned", "until", 
"use", "var",
+  "virtual", "volatile", "when", "while", "with", "xor", "yield" };
+  return std::set(keywords, keywords + 
sizeof(keywords)/sizeof(keywords[0]) );
+}
+
+void t_generator::validate_input() const {
+  validate(program_->get_enums());
+  validate(program_->get_typedefs());
+  validate(program_->get_objects());
+  validate(program_->get_consts());
+  validate(program_->get_services());
+}
+
+template 
+void t_generator::validate(const vector& list) const{
+  typename vector::const_iterator it;
+  for(it=list.begin(); it != list.end(); ++it) {
+  validate(*it);
+  }
+}
+
+void t_generator::validate(t_function const* f) const {
+  validate_id(f->get_name());
+  validate(f->get_arglist());
+  validate(f->get_xceptions());
+}
+
+void t_generator::validate(t_service const* s) const {
+  validate_id(s->get_name());
+  validate(s->get_functions());
+}
+
+void t_generator::validate(t_enum const* en) const {
+  validate_id(en->get_name());
+  validate(en->get_constants());
+}
+void t_generator::validate(t_struct const* s) const {
+  validate_id(s->get_name());
+  validate(s->get_members());
+}
+
+void t_generator::validate(t_enum_value const* en_val) const {
+  validate_id(en_val->get_name());
+}
+void t_generator::validate(t_typedef const* td) const {
+  validate_id(td->get_name());
+}
+void t_generator::validate(t_const const* c) const {
+  validate_id(c->get_name());
+}
+void t_generator::validate(t_field const* f) const {
+  validate_id(f->get_name());
+}
+
+void t_generator::validate_id(const string& id) const {
+  if (keywords_.find(id) != keywords_.end()) {
+failure("Cannot use reserved language keyword: \"%s\"", id.c_str());
+  }
+}
+
 string t_generator::escape_string(const string& in) const {
   string result = "";
   for (string::const_iterator it = in.begin(); it < in.end(); it++) {
diff --git a/compiler/cpp/src/thrift/generate/t_generator.h 
b/compiler/cpp/src/thrift/generate/t_generator.h
index abe31fec94..cb9d076b50 100644
--- a/compiler/cpp/src/thrift/generate/t_generator.h
+++ b/compiler/cpp/src/thrift/generate/t_generator.h
@@ -42,7 +42,8 @@
  */
 class t_generator {
 public:
-  t_generator(t_program* program) 

[jira] [Assigned] (THRIFT-4496) Dealing with language keywords in Thrift (e.g. service method names)

2018-09-28 Thread James E. King III (JIRA)


 [ 
https://issues.apache.org/jira/browse/THRIFT-4496?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James E. King III reassigned THRIFT-4496:
-

Assignee: James E. King III

> Dealing with language keywords in Thrift (e.g. service method names)
> 
>
> Key: THRIFT-4496
> URL: https://issues.apache.org/jira/browse/THRIFT-4496
> Project: Thrift
>  Issue Type: New Feature
>  Components: Compiler (General)
>Reporter: Vera Filippova
>Assignee: James E. King III
>Priority: Minor
>
> Apache Thrift compiler doesn't allow to use keywords in any of supported 
> languages as field names. However, there are other compilers, like Scrooge, 
> which do allow using some keywords as field identifiers, which leads to 
> incompatibility.
> Assume we had a service with 'delete' method, with Java code generated by 
> Scrooge. Now we'd like to generate Python code with Apache Thrift, but 
> encounter an error because of the 'delete' keyword.
> I understand that using only Apache Thrift compiler, a user will never 
> encounter this problem, but I think enabling keywords by request seems 
> feasible.
> h1. Proposal
> It's possible to tweak keywords on code generation stage, e.g. use 'delete_' 
> as a name of a generated function instead of 'delete', then use the original 
> method name for a protocol message: writeMethodBegin('delete').
> This feature could be enabled with an additional flag, e.g. --screen-keywords.
> I have a draft for python generator here [https://github.com/nsrtvwls/thrift]
> The questions are, is this functionality welcome? If yes, would it require to 
> have it supported for all languages?



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Resolved] (THRIFT-4625) let / const variable decorators for es6 compiler

2018-09-28 Thread James E. King III (JIRA)


 [ 
https://issues.apache.org/jira/browse/THRIFT-4625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James E. King III resolved THRIFT-4625.
---
   Resolution: Fixed
Fix Version/s: 0.12.0

Committed - thanks.

> let / const variable decorators for es6 compiler
> 
>
> Key: THRIFT-4625
> URL: https://issues.apache.org/jira/browse/THRIFT-4625
> Project: Thrift
>  Issue Type: Improvement
>  Components: JavaScript - Compiler, Node.js - Compiler
>Reporter: Brian Forbis
>Assignee: James E. King III
>Priority: Minor
> Fix For: 0.12.0
>
>
> With support for the ES6 compiler, variables should be scoped using the ES6 
> *let* and *const* variable decorators to define variable scoping and 
> read/write behavior.
> This brings the generated code into compliance with the 
> [no-var|https://eslint.org/docs/rules/no-var] eslint rule.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Assigned] (THRIFT-4625) let / const variable decorators for es6 compiler

2018-09-28 Thread James E. King III (JIRA)


 [ 
https://issues.apache.org/jira/browse/THRIFT-4625?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James E. King III reassigned THRIFT-4625:
-

Assignee: James E. King III

> let / const variable decorators for es6 compiler
> 
>
> Key: THRIFT-4625
> URL: https://issues.apache.org/jira/browse/THRIFT-4625
> Project: Thrift
>  Issue Type: Improvement
>  Components: JavaScript - Compiler, Node.js - Compiler
>Reporter: Brian Forbis
>Assignee: James E. King III
>Priority: Minor
>
> With support for the ES6 compiler, variables should be scoped using the ES6 
> *let* and *const* variable decorators to define variable scoping and 
> read/write behavior.
> This brings the generated code into compliance with the 
> [no-var|https://eslint.org/docs/rules/no-var] eslint rule.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (THRIFT-4382) Replace the use of Perl Indirect Object Syntax calls to new()

2018-09-28 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/THRIFT-4382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16631786#comment-16631786
 ] 

ASF GitHub Bot commented on THRIFT-4382:


djzort commented on issue #1261: THRIFT-4382: Replace the use of Indirect 
Object Syntax calls to new()
URL: https://github.com/apache/thrift/pull/1261#issuecomment-425423925
 
 
   > I rebased on master which passes CI (sometimes with a little help, but it 
passes).
   
   Sorry I have been snowed under and unable to look at this more. But am 
looking at it now having been inspired by your comment.
   


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Replace the use of Perl Indirect Object Syntax calls to new() 
> --
>
> Key: THRIFT-4382
> URL: https://issues.apache.org/jira/browse/THRIFT-4382
> Project: Thrift
>  Issue Type: Improvement
>  Components: Perl - Compiler
>Reporter: Dean Hamstead
>Priority: Minor
>
> Using Indirect Object Syntax to instantiate objects is not recommended as per 
> https://perldoc.perl.org/perlobj.html#Invoking-Class-Methods



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (THRIFT-4615) Broken links on Thrift index page

2018-09-28 Thread James E. King III (JIRA)


 [ 
https://issues.apache.org/jira/browse/THRIFT-4615?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James E. King III updated THRIFT-4615:
--
Issue Type: Documentation  (was: Bug)

> Broken links on Thrift index page
> -
>
> Key: THRIFT-4615
> URL: https://issues.apache.org/jira/browse/THRIFT-4615
> Project: Thrift
>  Issue Type: Documentation
>  Components: Website
>Reporter: Sándor Nagy
>Priority: Minor
>
> On the main page of the Thrift project in the Example section the links for 
> the source code sections are broken. See the last page on the content section 
> of the examples.
>  
> "This snippet was generated by Apache Thrift's *source tree docs*: 
> [tutorial/tutorial.thrift|http://git-wip-us.apache.org/repos/asf?p=thrift.git;a=blob;f=tutorial/tutorial.thrift;hb=HEAD];



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Updated] (THRIFT-4643) Update links to repository on project website

2018-09-28 Thread James E. King III (JIRA)


 [ 
https://issues.apache.org/jira/browse/THRIFT-4643?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James E. King III updated THRIFT-4643:
--
Issue Type: Documentation  (was: Task)

> Update links to repository on project website
> -
>
> Key: THRIFT-4643
> URL: https://issues.apache.org/jira/browse/THRIFT-4643
> Project: Thrift
>  Issue Type: Documentation
>  Components: Website
>Reporter: David Jung
>Assignee: James E. King III
>Priority: Minor
>
> The project website at [https://thrift.apache.org|https://thrift.apache.org/] 
> indicates that the source Git repository is located at 
> [https://git-wip-us.apache.org/repos/asf/thrift.git] and links to it in 
> several placed.  However, clicking those links or attempting to clone from 
> them just give a 'not found' error.
> Please update the links. 
> The GitHub unofficial repository is mentioned once at the bottom, but new 
> developers have no idea what that contains in relation to the official repo.
> Thanks.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Resolved] (THRIFT-4643) Update links to repository on project website

2018-09-28 Thread James E. King III (JIRA)


 [ 
https://issues.apache.org/jira/browse/THRIFT-4643?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

James E. King III resolved THRIFT-4643.
---
Resolution: Fixed
  Assignee: James E. King III

Done - thanks.

> Update links to repository on project website
> -
>
> Key: THRIFT-4643
> URL: https://issues.apache.org/jira/browse/THRIFT-4643
> Project: Thrift
>  Issue Type: Task
>  Components: Website
>Reporter: David Jung
>Assignee: James E. King III
>Priority: Minor
>
> The project website at [https://thrift.apache.org|https://thrift.apache.org/] 
> indicates that the source Git repository is located at 
> [https://git-wip-us.apache.org/repos/asf/thrift.git] and links to it in 
> several placed.  However, clicking those links or attempting to clone from 
> them just give a 'not found' error.
> Please update the links. 
> The GitHub unofficial repository is mentioned once at the bottom, but new 
> developers have no idea what that contains in relation to the official repo.
> Thanks.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (THRIFT-4624) Refc binary leak in binary and compact protocols

2018-09-28 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/THRIFT-4624?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16631760#comment-16631760
 ] 

ASF GitHub Bot commented on THRIFT-4624:


jeking3 commented on issue #1585: THRIFT-4624: Fix refc binary leak
URL: https://github.com/apache/thrift/pull/1585#issuecomment-425416206
 
 
   @djnym any thoughts about the comments regarding atom and DOS attacks?


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Refc binary leak in binary and compact protocols
> 
>
> Key: THRIFT-4624
> URL: https://issues.apache.org/jira/browse/THRIFT-4624
> Project: Thrift
>  Issue Type: Improvement
>  Components: Erlang - Library
>Reporter: something
>Priority: Major
>
> Pattern-matching on large (>64B) Erlang binaries merely produces slices of 
> objects on the Refc heap. Therefore Thrift binary and compact protocols 
> should clone all binaries they send to upper levels, otherwise there's a 
> chance that transport-level messages will be never freed.
> Patch is underway.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)


[jira] [Commented] (THRIFT-4382) Replace the use of Perl Indirect Object Syntax calls to new()

2018-09-28 Thread ASF GitHub Bot (JIRA)


[ 
https://issues.apache.org/jira/browse/THRIFT-4382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16631758#comment-16631758
 ] 

ASF GitHub Bot commented on THRIFT-4382:


jeking3 commented on issue #1261: THRIFT-4382: Replace the use of Indirect 
Object Syntax calls to new()
URL: https://github.com/apache/thrift/pull/1261#issuecomment-425415823
 
 
   I rebased on master which passes CI (sometimes with a little help, but it 
passes).


This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Replace the use of Perl Indirect Object Syntax calls to new() 
> --
>
> Key: THRIFT-4382
> URL: https://issues.apache.org/jira/browse/THRIFT-4382
> Project: Thrift
>  Issue Type: Improvement
>  Components: Perl - Compiler
>Reporter: Dean Hamstead
>Priority: Minor
>
> Using Indirect Object Syntax to instantiate objects is not recommended as per 
> https://perldoc.perl.org/perlobj.html#Invoking-Class-Methods



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)