benjamin-bader commented on code in PR #2556:
URL: https://github.com/apache/thrift/pull/2556#discussion_r847903299


##########
compiler/cpp/src/thrift/generate/t_kotlin_generator.cc:
##########
@@ -0,0 +1,2021 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#include <cassert>
+#include <ctime>
+
+#include <cctype>
+#include <fstream>
+#include <iomanip>
+#include <iostream>
+#include <limits>
+#include <sstream>
+#include <string>
+#include <vector>
+
+#include <stdexcept>
+#include <sys/stat.h>
+
+#include "thrift/generate/t_oop_generator.h"
+#include "thrift/platform.h"
+
+using std::map;
+using std::ostream;
+using std::ostringstream;
+using std::set;
+using std::setfill;
+using std::setw;
+using std::string;
+using std::stringstream;
+using std::vector;
+
+static const string endl = "\n"; // avoid ostream << std::endl flushes
+
+static const string java_generated_annotation = "@javax.annotation.Generated";

Review Comment:
   Herein lies danger - JDK9 and above have "repackaged" this annotation.  
Prior to 9, everyone used `javax.annotation.Generated`.  After, the annotation 
is `javax.annotation.processing.Generated`.  If you hardcode one or the other, 
the generated code will be uncompilable by a large portion of Java toolchains.
   
   In Thrifty we went through a bunch of contortions before [dropping support 
for generated annotations 
entirely](https://github.com/microsoft/thrifty/pull/402/files) - Kotlin MPP 
doesn't support them.  I don't think MPP-compatibility is a goal here, but you 
definitely should reconsider whether and how to use this annotation.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to