Skip to content

Commit 391d6dd

Browse files
committed
Apply explicit visibility on missing classes
1 parent 5b9b66e commit 391d6dd

30 files changed

+144
-136
lines changed

android/libraries/rib-compiler-test/src/main/kotlin/com/uber/rib/compiler/Constants.kt

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616
package com.uber.rib.compiler
1717

1818
/** Constant values used by the annotation processor. */
19-
open class Constants {
20-
companion object {
21-
const val INTERACTOR_TEST_CREATOR_PREFIX = "Test"
22-
const val INTERACTOR_TEST_CREATOR_SUFFIX = "Interactor"
23-
const val INTERACTOR_TEST_CREATOR_METHOD_NAME = "create"
19+
public open class Constants {
20+
public companion object {
21+
public const val INTERACTOR_TEST_CREATOR_PREFIX: String = "Test"
22+
public const val INTERACTOR_TEST_CREATOR_SUFFIX: String = "Interactor"
23+
public const val INTERACTOR_TEST_CREATOR_METHOD_NAME: String = "create"
2424
}
2525
}

android/libraries/rib-compiler-test/src/main/kotlin/com/uber/rib/compiler/InteractorTestGenerator.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import javax.lang.model.element.Modifier
3333
* @Scope
3434
* @Retention(SOURCE) public @interface LoggedInScope { } </code>
3535
*/
36-
open class InteractorTestGenerator(
36+
public open class InteractorTestGenerator(
3737
processingEnvironment: ProcessingEnvironment,
3838
errorReporter: ErrorReporter,
3939
) : Generator<InteractorAnnotatedClass>(processingEnvironment, errorReporter) {

android/libraries/rib-compiler-test/src/main/kotlin/com/uber/rib/compiler/RibTestProcessor.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import javax.annotation.processing.Processor
2323

2424
/** Process the annotations for all added annotation processor pipelines. */
2525
@AutoService(Processor::class)
26-
open class RibTestProcessor : RibProcessor() {
26+
public open class RibTestProcessor : RibProcessor() {
2727
private var interactorTestGenerator: InteractorTestGenerator? = null
2828

2929
@Synchronized

android/libraries/rib-workflow-test/src/main/kotlin/com/uber/rib/workflow/core/StepTester.kt

+2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
@file:Suppress("invisible_reference", "invisible_member")
17+
1618
package com.uber.rib.workflow.core
1719

1820
import com.google.common.base.Optional

android/tooling/rib-intellij-plugin/src/main/kotlin/com/uber/intellij/plugin/android/rib/AndroidDeviceRepository.kt

+6-6
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import org.jetbrains.android.sdk.AndroidSdkUtils
2626

2727
/** IntelliJ Project component responsible for exposing connected Android devices. */
2828
@Service(PROJECT)
29-
class AndroidDeviceRepository(val project: Project) :
29+
public class AndroidDeviceRepository(public val project: Project) :
3030
AndroidDebugBridge.IDeviceChangeListener, Disposable {
3131

3232
private val devices: ArrayList<IDevice> = arrayListOf()
@@ -60,15 +60,15 @@ class AndroidDeviceRepository(val project: Project) :
6060
}
6161

6262
@Synchronized
63-
fun addListener(listener: Listener) {
63+
public fun addListener(listener: Listener) {
6464
listeners.add(listener)
6565
if (devices.size > 0) {
6666
listener.onAvailableDevicesChanged(devices)
6767
}
6868
}
6969

7070
@Synchronized
71-
fun removeListener(listener: Listener) {
71+
public fun removeListener(listener: Listener) {
7272
if (listeners.contains(listener)) {
7373
listeners.remove(listener)
7474
}
@@ -79,7 +79,7 @@ class AndroidDeviceRepository(val project: Project) :
7979
listeners.forEach { it.onAvailableDevicesChanged(devices) }
8080
}
8181

82-
fun isBridgeConnected(): Boolean {
82+
public fun isBridgeConnected(): Boolean {
8383
val debugBridge = AndroidDebugBridge.getBridge()
8484
return debugBridge != null && with(debugBridge) { isConnected && hasInitialDeviceList() }
8585
}
@@ -89,8 +89,8 @@ class AndroidDeviceRepository(val project: Project) :
8989
devices.clear()
9090
}
9191

92-
interface Listener {
92+
public interface Listener {
9393

94-
fun onAvailableDevicesChanged(devices: List<IDevice>)
94+
public fun onAvailableDevicesChanged(devices: List<IDevice>)
9595
}
9696
}

android/tooling/rib-intellij-plugin/src/main/kotlin/com/uber/intellij/plugin/android/rib/AttachRibProjectServiceActivity.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import com.intellij.openapi.components.service
1919
import com.intellij.openapi.project.Project
2020
import com.intellij.openapi.startup.StartupActivity
2121

22-
class AttachRibProjectServiceActivity : StartupActivity.Background {
22+
public class AttachRibProjectServiceActivity : StartupActivity.Background {
2323
override fun runActivity(project: Project) {
2424
project.service<RibProjectService>().attach()
2525
}

android/tooling/rib-intellij-plugin/src/main/kotlin/com/uber/intellij/plugin/android/rib/CommandLineUtils.kt

+6-6
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import java.nio.charset.Charset
2626
import java.util.LinkedList
2727

2828
/** Some command line utilities. */
29-
object CommandLineUtils {
29+
public object CommandLineUtils {
3030

3131
/**
3232
* Executes `which` for a command.
@@ -38,7 +38,7 @@ object CommandLineUtils {
3838
* @throws ExecutionException
3939
* @throws IOException
4040
*/
41-
fun which(project: Project, command: String): String {
41+
public fun which(project: Project, command: String): String {
4242
return executeWithLineOutput(project, "which", command).output()[0]
4343
}
4444

@@ -53,7 +53,7 @@ object CommandLineUtils {
5353
* @throws ExecutionException
5454
* @throws IOException
5555
*/
56-
fun executeWithLineOutput(
56+
public fun executeWithLineOutput(
5757
project: Project,
5858
command: String,
5959
vararg params: String,
@@ -93,15 +93,15 @@ object CommandLineUtils {
9393
}
9494

9595
/** Holder for process output and error stream. */
96-
class ProcessOutput(private val output: List<String>, private val error: List<String>) {
96+
public class ProcessOutput(private val output: List<String>, private val error: List<String>) {
9797

9898
/** Returns the process std output */
99-
fun output(): List<String> {
99+
public fun output(): List<String> {
100100
return output
101101
}
102102

103103
/** Returns the process error output */
104-
fun error(): List<String> {
104+
public fun error(): List<String> {
105105
return error
106106
}
107107
}

android/tooling/rib-intellij-plugin/src/main/kotlin/com/uber/intellij/plugin/android/rib/RibHierarchyBrowser.kt

+10-10
Original file line numberDiff line numberDiff line change
@@ -54,22 +54,22 @@ import javax.swing.tree.DefaultMutableTreeNode
5454

5555
/** UI component used to render tree of Ribs. */
5656
@SuppressWarnings("TooManyFunctions")
57-
class RibHierarchyBrowser(
57+
public class RibHierarchyBrowser(
5858
project: Project,
5959
initialModel: Model,
6060
private val rootElement: PsiElement,
6161
private val selectionListener: Listener?,
6262
) : HierarchyBrowserBase(project, rootElement) {
6363

64-
companion object {
64+
public companion object {
6565
/** Go to previous Rib label */
66-
const val LABEL_GO_PREVIOUS_RIB: String = "Go to previous Scope."
66+
public const val LABEL_GO_PREVIOUS_RIB: String = "Go to previous Scope."
6767

6868
/** Go to next Rib label */
69-
const val LABEL_GO_NEXT_RIB: String = "Go to next Scope"
69+
public const val LABEL_GO_NEXT_RIB: String = "Go to next Scope"
7070

7171
/** Type of the Rib hierarchy */
72-
const val TYPE_HIERARCHY_TYPE: String = "Ribs"
72+
public const val TYPE_HIERARCHY_TYPE: String = "Ribs"
7373

7474
private const val ENABLE_LOCATE_MODE: String = "Enable selecting RIB on device"
7575

@@ -78,7 +78,7 @@ class RibHierarchyBrowser(
7878
}
7979

8080
/** Enum used to represent the status of the component */
81-
enum class Status {
81+
public enum class Status {
8282
UNINITIALIZED,
8383
INITIALIZING,
8484
INITIALIZED,
@@ -92,7 +92,7 @@ class RibHierarchyBrowser(
9292
* @param selectedRibId the RIB ID of the RIB selected by user (if any)
9393
* @param selectedViewId the view ID of the view selected by user (if any)
9494
*/
95-
data class Model(
95+
public data class Model(
9696
val host: RibHost,
9797
val selectedRibId: String = "",
9898
val selectedViewId: String = "",
@@ -214,7 +214,7 @@ class RibHierarchyBrowser(
214214
}
215215

216216
/** Request to update hierarchy with provided model */
217-
fun onModelUpdated(model: Model) {
217+
public fun onModelUpdated(model: Model) {
218218
this.status = Status.INITIALIZED
219219
this.model = model
220220
this.refreshComplete = false
@@ -299,9 +299,9 @@ class RibHierarchyBrowser(
299299
* Interface used to notify that an new element was selected in {@ScopeHierarchyBrowser}
300300
* component.
301301
*/
302-
interface Listener {
302+
public interface Listener {
303303

304304
/** Callback indicating the selected Rib has changed. */
305-
fun onSelectedRibChanged(id: UUID)
305+
public fun onSelectedRibChanged(id: UUID)
306306
}
307307
}

android/tooling/rib-intellij-plugin/src/main/kotlin/com/uber/intellij/plugin/android/rib/RibHierarchyPanel.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,14 @@ import javax.swing.JSplitPane
3838
import javax.swing.JSplitPane.RIGHT
3939

4040
/** UI Component representing the panel including rib hierarchy. */
41-
class RibHierarchyPanel(val project: Project, private val initialModel: Model) :
41+
public class RibHierarchyPanel(public val project: Project, private val initialModel: Model) :
4242
JPanel(),
4343
RibProjectService.Listener,
4444
ActionListener,
4545
RibHierarchyBrowser.Listener,
4646
RibViewBrowser.Listener {
4747

48-
companion object {
48+
public companion object {
4949
private val EMPTY_RIB_VIEW: RibView = RibView("", "", "", "", emptyList())
5050
private val EMPTY_RIB_NODE: RibNode = RibNode("", "", emptyList(), EMPTY_RIB_VIEW)
5151
private val EMPTY_VIEW_MODEL: ViewModel =
@@ -113,13 +113,13 @@ class RibHierarchyPanel(val project: Project, private val initialModel: Model) :
113113
}
114114

115115
/** Requests to update the list of devices. */
116-
fun onAvailableDevicesChanged(devices: List<IDevice>) {
116+
public fun onAvailableDevicesChanged(devices: List<IDevice>) {
117117
comboBoxModel.removeAllElements()
118118
devices.forEach { comboBoxModel.addElement(it) }
119119
}
120120

121121
/** Requests to update the selected device. */
122-
fun onSelectedDeviceChanged(selectedDevice: IDevice?) {
122+
public fun onSelectedDeviceChanged(selectedDevice: IDevice?) {
123123
comboBoxModel.selectedItem = selectedDevice
124124
}
125125

android/tooling/rib-intellij-plugin/src/main/kotlin/com/uber/intellij/plugin/android/rib/RibHierarchyUtils.kt

+15-15
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ import java.util.UUID
5656

5757
/** Utility class used by the Rib hierarchy browser component. */
5858
@SuppressWarnings("TooManyFunctions")
59-
class RibHierarchyUtils {
59+
public class RibHierarchyUtils {
6060

6161
private constructor()
6262

63-
companion object {
63+
public companion object {
6464

6565
/** Constant used to represent empty UUID */
66-
val EMPTY_UUID: UUID = UUID(0, 0)
66+
public val EMPTY_UUID: UUID = UUID(0, 0)
6767

6868
/** Time for balloon to fade out */
6969
private const val BALLOON_FADE_OUT_TIME: Long = 3000
@@ -72,7 +72,7 @@ class RibHierarchyUtils {
7272
private const val LAYOUT_FOLDER_NAME: String = "layout"
7373

7474
/** Build root element, used when class is not available. */
75-
fun buildRootElement(project: Project): PsiClass {
75+
public fun buildRootElement(project: Project): PsiClass {
7676
val psiClass: PsiClass? =
7777
JavaPsiFacade.getInstance(project)
7878
.findClass(Object::class.java.name, GlobalSearchScope.allScope(project))
@@ -81,32 +81,32 @@ class RibHierarchyUtils {
8181
}
8282

8383
/** Return the psiClass corresponding to the given class name. */
84-
fun getPsiClass(project: Project, name: String): PsiClass {
84+
public fun getPsiClass(project: Project, name: String): PsiClass {
8585
val psiClass: PsiClass? =
8686
JavaPsiFacade.getInstance(project).findClass(name, GlobalSearchScope.allScope(project))
8787
return psiClass ?: buildRootElement(project)
8888
}
8989

9090
/** Check if the element supplied is a root element. */
91-
fun isRootElement(element: PsiElement?): Boolean {
91+
public fun isRootElement(element: PsiElement?): Boolean {
9292
return element is PsiClass && element.qualifiedName == Object::class.java.name
9393
}
9494

9595
/** Format fully qualified class name. */
96-
fun formatQualifiedName(qualifiedName: String): String {
96+
public fun formatQualifiedName(qualifiedName: String): String {
9797
val index: Int = qualifiedName.lastIndexOf(".")
9898
return if (index > 0) qualifiedName.substring(0, index) else qualifiedName
9999
}
100100

101101
/** Format fully qualified class name. */
102-
fun formatSimpleName(qualifiedName: String): String {
102+
public fun formatSimpleName(qualifiedName: String): String {
103103
val index: Int = qualifiedName.lastIndexOf(".")
104104
return if (index > 0) qualifiedName.substring(index + 1) else qualifiedName
105105
}
106106

107107
/** Find node with the given ID in node hierarchy */
108108
@SuppressWarnings("ReturnCount")
109-
fun findRibNodeRecursive(ribNode: RibNode?, id: UUID): RibNode? {
109+
public fun findRibNodeRecursive(ribNode: RibNode?, id: UUID): RibNode? {
110110
if (ribNode == null) {
111111
return null
112112
}
@@ -124,7 +124,7 @@ class RibHierarchyUtils {
124124

125125
/** Find view with the given ID in view hierarchy */
126126
@SuppressWarnings("ReturnCount")
127-
fun findRibViewRecursive(ribView: RibView?, id: UUID): RibView? {
127+
public fun findRibViewRecursive(ribView: RibView?, id: UUID): RibView? {
128128
if (ribView == null) {
129129
return null
130130
}
@@ -141,7 +141,7 @@ class RibHierarchyUtils {
141141
}
142142

143143
/** Get a view tag value suffix */
144-
fun getTagValueSuffix(value: String?): String? {
144+
public fun getTagValueSuffix(value: String?): String? {
145145
if (value == null) {
146146
return null
147147
}
@@ -151,21 +151,21 @@ class RibHierarchyUtils {
151151

152152
/** Get virtual file from path */
153153
@SuppressWarnings("MagicNumber")
154-
fun getVirtualFile(filePath: String): VirtualFile? {
154+
public fun getVirtualFile(filePath: String): VirtualFile? {
155155
val actualPath: Path = Paths.get(filePath)
156156
val pathFile: File = actualPath.toFile()
157157
return LocalFileSystem.getInstance().findFileByIoFile(pathFile)
158158
}
159159

160160
/** Returns whether virtual file belongs to project and appears to be a layout file */
161-
fun isProjectLayoutFile(project: Project, file: VirtualFile): Boolean {
161+
public fun isProjectLayoutFile(project: Project, file: VirtualFile): Boolean {
162162
return ProjectRootManager.getInstance(project).fileIndex.isInContent(file) &&
163163
file.fileType is XmlFileType &&
164164
file.path.contains("/$LAYOUT_FOLDER_NAME/")
165165
}
166166

167167
/** Display popup balloon. */
168-
fun displayPopup(
168+
public fun displayPopup(
169169
message: String,
170170
location: RelativePoint,
171171
type: MessageType = MessageType.WARNING,
@@ -178,7 +178,7 @@ class RibHierarchyUtils {
178178
}
179179

180180
/** Display notification bubble. */
181-
fun log(message: String) {
181+
public fun log(message: String) {
182182
Notifications.Bus.notify(Notification("Rib", "Rib", message, NotificationType.INFORMATION))
183183
}
184184
}

0 commit comments

Comments
 (0)