Skip to content

Commit fd99477

Browse files
author
Nemo Oudeis
committed
codestyle: clean up excessive blank lines, add trailing blank line EOF
1 parent b1ca319 commit fd99477

File tree

7 files changed

+3
-65
lines changed

7 files changed

+3
-65
lines changed

rekotlin-router/src/main/java/org/rekotlinrouter/NavigationAction.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,13 @@ package org.rekotlinrouter
22

33
import org.rekotlin.Action
44

5-
65
class SetRouteAction(var route: Route,
76
var animated: Boolean = true,
87
action: StandardAction? = null): StandardActionConvertible {
98

109
companion object {
1110
const val type = "RE_KOTLIN_ROUTER_SET_ROUTE"
1211
}
13-
1412

1513
init {
1614
// TODO: Convert the below to ArrayList
@@ -30,9 +28,6 @@ class SetRouteAction(var route: Route,
3028
payload = payloadMap,
3129
isTypedAction = true)
3230
}
33-
34-
35-
3631
}
3732

3833
class SetRouteSpecificData ( val route: Route, val data: Any): Action

rekotlin-router/src/main/java/org/rekotlinrouter/NavigationReducer.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ package org.rekotlinrouter
22

33
import org.rekotlin.Action
44

5-
6-
75
/**
86
The Navigation Reducer handles the state slice concerned with storing the current navigation
97
information. Note, that this reducer is **not** a *top-level* reducer, you need to use it within
@@ -63,4 +61,4 @@ class NavigationReducer {
6361
}
6462

6563
}
66-
}
64+
}
Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
package org.rekotlinrouter
22

3-
4-
53
class FullRoute(route: Route) {
64
val routeString: String
75

86
init {
97
this.routeString = route.joinToString(separator = "/")
108
}
11-
129
}
1310

1411
data class NavigationState(var route: Route = arrayListOf() ,
1512
var routeSpecificState: HashMap<String,Any> = HashMap() ,
1613
var changeRouteAnimated: Boolean = true) {
1714

18-
1915
fun <T> getRouteSpecificState(givenRoutes: Route): T? {
2016
val fullroute = FullRoute(givenRoutes)
2117
val routeString = fullroute.routeString
@@ -24,8 +20,6 @@ data class NavigationState(var route: Route = arrayListOf() ,
2420
}
2521
}
2622

27-
28-
2923
interface HasNavigationState {
3024
var navigationState: NavigationState
31-
}
25+
}

rekotlin-router/src/main/java/org/rekotlinrouter/Router.kt

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,11 @@ class Router<routerStateType: StateType> (var store: Store<routerStateType>,
2020
rootRoutable: Routable,
2121
stateTransform: (Subscription<routerStateType>) -> Subscription<NavigationState>): StoreSubscriber<NavigationState> {
2222

23-
2423
var lastNavigationState = NavigationState()
2524
// TODO: Collections.synchronizedList vs CopyOnWriteArrayList
2625
// var routables: List<Routable> = Collections.synchronizedList(arrayListOf<Routable>())
2726
var routables: ArrayList<Routable> = arrayListOf()
2827

29-
3028
init {
3129
this.routables.add(rootRoutable)
3230
this.store.subscribe(this,stateTransform)
@@ -44,9 +42,6 @@ class Router<routerStateType: StateType> (var store: Store<routerStateType>,
4442
}
4543
}
4644

47-
48-
49-
5045
private fun routingSerailActionHandler(routingAction: RoutingAction, state: NavigationState) {
5146

5247
synchronized(lock = routables){
@@ -59,8 +54,6 @@ class Router<routerStateType: StateType> (var store: Store<routerStateType>,
5954
animated = state.changeRouteAnimated) {}
6055
this.routables.removeAt(routingAction.responsibleRoutableIndex+1)
6156
}
62-
63-
6457
}
6558

6659
is push -> {
@@ -81,12 +74,9 @@ class Router<routerStateType: StateType> (var store: Store<routerStateType>,
8174
to = routingAction.newSegment,
8275
animated = state.changeRouteAnimated){}
8376
}
84-
8577
}
86-
8778
}
8879
}
89-
9080
}
9181

9282
// Route Transformation Logic
@@ -187,10 +177,7 @@ class Router<routerStateType: StateType> (var store: Store<routerStateType>,
187177

188178
return routingActions
189179
}
190-
191-
192180
}
193-
194181
}
195182

196183

rekotlin-router/src/test/java/org/rekotlinrouter/AndroidMockUtil.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,4 @@ object AndroidMockUtil {
5959
}
6060

6161
private val mainThread = Executors.newSingleThreadScheduledExecutor()
62-
6362
}
64-

rekotlin-router/src/test/java/org/rekotlinrouter/ReKotlinRouterIntegerationTests.kt

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ import org.rekotlin.StateType
1818
import org.rekotlin.Store
1919
import java.util.concurrent.TimeUnit
2020

21-
2221
class FakeAppState: StateType {
2322
var navigationState = NavigationState()
2423
}
@@ -31,7 +30,6 @@ fun appReducer(action: Action, state: FakeAppState?): FakeAppState {
3130

3231
class MockRoutable: Routable {
3332

34-
3533
var callsToPushRouteSegment: Array<Pair< RouteElementIdentifier,Boolean>> = emptyArray()
3634
var callsToPopRouteSegment: Array<Pair< RouteElementIdentifier,Boolean>> = emptyArray()
3735
var callsToChangeRouteSegment: Array<Triple< RouteElementIdentifier,RouteElementIdentifier,Boolean>> = emptyArray()
@@ -51,12 +49,8 @@ class MockRoutable: Routable {
5149
completionHandler()
5250
return MockRoutable()
5351
}
54-
55-
5652
}
5753

58-
59-
6054
//@PrepareForTest(Looper::class)
6155
//@RunWith(PowerMockRunner::class)
6256
class ReKotlinRouterIntegerationTests {
@@ -67,17 +61,13 @@ class ReKotlinRouterIntegerationTests {
6761

6862
var store: Store<FakeAppState> = Store(reducer=::appReducer,state=FakeAppState())
6963

70-
7164
@Before
7265
@PrepareForTest(Looper::class,Handler::class,Router::class)
7366
fun initTest() {
7467
store = Store(reducer=::appReducer,state=FakeAppState())
7568
AndroidMockUtil.mockMainThreadHandler()
7669
}
7770

78-
79-
80-
8171
@Test
8272
// @DisplayName("does not request the main activity when no route is provided")
8373
fun test_no_request_main_activity_when_no_route_provided(){
@@ -170,10 +160,8 @@ class ReKotlinRouterIntegerationTests {
170160
}
171161
}
172162
}
173-
174163
}
175164

176-
177165
@Test
178166
//@Display("calls push on the root for a route with two elements")
179167
fun test_push_on_root_with_2_elements(){
@@ -232,8 +220,6 @@ class ReKotlinRouterIntegerationTests {
232220
}
233221
}
234222

235-
236-
237223
// Then
238224

239225
await().atMost(5, TimeUnit.SECONDS).untilAsserted {
@@ -260,11 +246,9 @@ class ReKotlinRouterIntegerationTests {
260246
}
261247
}
262248
}
263-
264249
}
265250
}
266251

267-
268252
@PrepareForTest(Looper::class,Handler::class)
269253
@RunWith(PowerMockRunner::class)
270254
class RoutingSpecificDataTest{
@@ -299,12 +283,8 @@ class ReKotlinRouterIntegerationTests {
299283
}
300284
}
301285
}
302-
303-
304-
305286
}
306287

307-
308288
@PrepareForTest(Looper::class,Handler::class,Router::class)
309289
@RunWith(PowerMockRunner::class)
310290
class RoutingAnimationTest{
@@ -347,10 +327,8 @@ class ReKotlinRouterIntegerationTests {
347327
assertThat(mockRoutable.callsToPushRouteSegment.last().second).isTrue()
348328
}
349329
}}
350-
351330
}
352331

353-
354332
@Test // @DisplayName("when dispatching an unanimated route change")
355333
fun test_dipatching_animated_route_change_with_animate_as_false(){
356334
//Given
@@ -368,7 +346,6 @@ class ReKotlinRouterIntegerationTests {
368346
assertThat(mockRoutable.callsToPushRouteSegment.last().second).isFalse()
369347
}
370348
}}
371-
372349
}
373350

374351
@Test // @DisplayName("when dispatching an default route change")
@@ -388,15 +365,7 @@ class ReKotlinRouterIntegerationTests {
388365
assertThat(mockRoutable.callsToPushRouteSegment.last().second).isTrue()
389366
}
390367
}}
391-
392368
}
393-
394369
}
395-
396370
}
397-
398-
399-
400371
}
401-
402-

rekotlin-router/src/test/java/org/rekotlinrouter/ReKotlinRouterUnitTests.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,13 @@ package org.rekotlinrouter
44
import org.assertj.core.api.Assertions.assertThat
55
import org.junit.Test
66

7-
87
internal class ReKotlinRouterUnitTests {
98

109
val mainActivityIdentifier = "MainActivity"
1110
val counterActivityIdentifier = "CounterActivity"
1211
val statsActivityIdentifier = "StatsActivity"
1312
val infoActivityIdentifier = "InfoActivity"
1413

15-
1614
@Test
1715
//@DisplayName("calculates transitions from an empty route to a multi segment route")
1816
fun test_transition_from_empty_to_multi_segment_route(){
@@ -45,7 +43,6 @@ internal class ReKotlinRouterUnitTests {
4543
assertThat(routingActions.count()).isEqualTo(2)
4644
}
4745

48-
4946
@Test
5047
// @DisplayName("generates a Change action on the last common subroute")
5148
fun test_change_action_on_last_common_subroute(){
@@ -277,4 +274,4 @@ internal class ReKotlinRouterUnitTests {
277274
assertThat(action2Correct).isTrue()
278275
assertThat(routingActions.count()).isEqualTo(2)
279276
}
280-
}
277+
}

0 commit comments

Comments
 (0)