question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow protected fields to be used as arguments

See original GitHub issue

For example when we write in our fragment something like this:

@Arg
protected String protectedArg;

We’ll get an error:

Error:(6, 22) error: The @Arg annotated field ‘protectedArg’ in class ClassWithProtectedField has private or protected visibility…

I wonder why protected fields can’t be used as arguments. FragmentBuilder#injectArguments can access them because FragmentBuilder is in the same package as Fragment. I’ve created a test in https://github.com/pamalyshev/fragmentargs/commit/05350b0a472f381648af56647122edf84baa88cc

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sockeqwecommented, Sep 1, 2016

Yes, I will add support for that

0reactions
sockeqwecommented, May 3, 2018

Awesome, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Private and protected properties and methods
To hide an internal interface we use either protected or private properties: Protected fields start with _ . That's a well-known convention, ...
Read more >
Java : Accessor methods vs protected fields - Stack Overflow
When you only define methods to access a field, you are restricted by the methods. You cannot do something that there is not...
Read more >
Why is Clean Code suggesting avoiding protected variables?
You created a public property with protected setter. The protected field should be solved with a protected property with private setter. +1 now....
Read more >
Protected variable in Python - GeeksforGeeks
Protected variables are those data members of a class that can be accessed within the class and the classes derived from that class....
Read more >
VisibilityModifierCheck (checkstyle 10.5.0 API)
Checks whether variable has static final modifiers. Setter to allow final fields to be declared as public. Setter to allow immutable fields to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found