Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Add java namespace to meta.thrift #1422

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add java namespace to meta.thrift #1422

wants to merge 1 commit into from

Conversation

groz
Copy link

@groz groz commented May 3, 2018

Problem

The classes generated for this file in Java by thrift compiler are currently put in default package, making them unusable from any other Java package.

This also means that any other thrift files that include this one, but declare a java namespace will have their thrift compilation successful, error will only be surfaced by Java compiler when those thrift files are used in Java project making chain of updates very costly.

One example of a workaround is in separate copy of this file in Java tchannel library.

Backwards compatibility concerns

I don't expect this diff breaking anything because the generated files could only be referenced from default package and that is not a widely spread practice in Java to begin with.
However, repos that commit generated files in the artifacts will have a lot of their code regenerated.

## Problem

The classes generated for this file in Java by thrift compiler are currently put in default package, making them unusable from any other Java package.

This also means that any other thrift files that `include` this one, but declare a `java namespace` will have their thrift compilation successful, error will only be surfaced by Java compiler when those thrift files are used in Java project making chain of updates very costly.

One example of a workaround is in [separate copy of this file](https://github.com/uber/tchannel-java/blob/771a42174896f6f6ca7fbb6e37a2c227cda3f3b5/tchannel-core/src/main/thrift/meta.thrift) in Java tchannel library.

## Backwards compatibility concerns

I don't expect this diff breaking anything because the generated files could only be referenced from default package and that is not a widely spread practice in Java to begin with. 
However, repos that commit generated files in the artifacts will have a lot of their code regenerated.
@CLAassistant
Copy link

CLAassistant commented May 3, 2018

CLA assistant check
All committers have signed the CLA.

@prashantv prashantv requested a review from kriskowal May 17, 2018 05:45
Copy link
Contributor

@kriskowal kriskowal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resigning from review.

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

Successfully merging this pull request may close these issues.

3 participants