Skip to content

Commit f351973

Browse files
bedaHovorkaclaude
andcommitted
Organize technical debt: map code comments to goals and issues
Reviewed all TODO, FIXME, EXTENSION comments in Kotlin codebase and categorized them for better tracking and prioritization. Comments now reference either long-term goals from LONG_TERM_GOALS.md or GitHub issues in the Backlog milestone. Changes: - Updated 11 code comments to reference specific goals (2, 4, 5, 15) or issues (#56-62) - Created 6 GitHub issues for untracked technical debt (#57-62) - Translated Czech comment in Train.kt about bidirectional operation - Cleaned up unclear or outdated comment in MyResourceBoundle.kt All changes are documentation-only with no functional impact. Issues created: #57 - Array2DMap NavigableMap support #58 - Array2DMap modifiable EntrySet #59 - HashMapGraph collection views performance #60 - Track length validation (Goals 3, 4) #61 - XML saveContext implementation (Goal 5) #62 - Bidirectional train operation (Goals 3, 15) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 2f8f202 commit f351973

8 files changed

Lines changed: 18 additions & 13 deletions

File tree

src/main/kotlin/cz/vutbr/fit/interlockSim/MyResourceBoundle.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class MyResourceBoundle private constructor() : ListResourceBundle() {
2929
}
3030

3131
override fun getContents(): Array<Array<Any>>? {
32-
// TODO Auto-generated method stub
32+
// Returns null as resources are loaded via getFile() and getSchema() methods instead
3333
return null
3434
}
3535

src/main/kotlin/cz/vutbr/fit/interlockSim/context/DefaultContext.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ abstract class DefaultContext :
788788
worker.terminate()
789789
}
790790
mainProcess?.terminate()
791-
System.exit(1) // EXTENSION pryc
791+
System.exit(1) // TODO: Remove System.exit - see GitHub issue #56
792792
}
793793

794794
/**

src/main/kotlin/cz/vutbr/fit/interlockSim/sim/InOutWorker.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ class InOutWorker(
4141
private val pathFree: Condition =
4242
object : Condition {
4343
override fun test(): Boolean {
44-
// EXTENSION az bude Interlocking: co kdyz cesta vubec neexistuje
44+
// GOAL 2 & GOAL 4: Path finding and interlocking validation
45+
// When automatic pathfinding is implemented (Goal 2), handle case where no valid path exists
46+
// Related to interlocking validation (Goal 4) - see LONG_TERM_GOALS.md
4547
// Local variable for smart cast since next is mutable property
4648
val nextLocal = next
4749
path = if (nextLocal != null) context.pathToNextSemaphore(inOut, nextLocal) else null

src/main/kotlin/cz/vutbr/fit/interlockSim/sim/Interlocking.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ import cz.vutbr.fit.interlockSim.context.SimulationContext
1717
abstract class Interlocking(
1818
protected val context: SimulationContext
1919
) : LoopProcess() {
20-
// EXTENSION hledani cest, Dikstruv algoritmus, move to control
20+
// GOAL 2: Automatic Path Finding with Dijkstra algorithm
21+
// Future: Implement automatic route calculation from entry to exit
22+
// Priority: Critical | Estimate: 3 months | See LONG_TERM_GOALS.md Goal 2
2123
// abstract fun setupWay(from: OrientedPathSeparator, to: OrientedPathSeparator)
2224
}

src/main/kotlin/cz/vutbr/fit/interlockSim/sim/Train.kt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,10 @@ class Train :
7373
}
7474
}.setFrequency(1.0)
7575

76-
// EXTENSION musi bud aspon umet prohodit zacatek a konec
77-
// nebo je udalosti oba dva zrusit a dalsi udalosti obnovit, s tim ze vlak stoji na miste
78-
// tj. "odpojeni" a "pripojeni" lokomotivy
76+
// GitHub #62: Support bidirectional train operation (reverse direction)
77+
// Allow train engineer to move to opposite end and drive in reverse direction.
78+
// This is a simulation simplification of locomotive coupling/uncoupling operations.
79+
// Implementation: Either swap start/end positions OR cancel/restore events with train stationary.
7980

8081
private abstract inner class Site : Process() { // lepsi nazev?
8182
private val position: Variable = Variable(0.0)
@@ -188,7 +189,7 @@ class Train :
188189
}
189190
val path: Path? = context.pathToNextSemaphore(separator, next!!)
190191

191-
// EXTENSION stanice
192+
// GOAL 15: Station stops for tutorial scenarios - see LONG_TERM_GOALS.md
192193

193194
if (semaphore.getSignal() == RailSemaphore.Signal.STOP) {
194195
requireSimulation(getVelocity() >= 0) { "Velocity must be non-negative when approaching semaphore" }

src/main/kotlin/cz/vutbr/fit/interlockSim/util/Array2DMap.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import java.util.TreeSet
2323
* @param <V> type of values
2424
*
2525
*/
26-
class Array2DMap<V> : AbstractMap<Point, V>() /* EXTENSION implements NavigableMap<Point, V> */ {
26+
class Array2DMap<V> : AbstractMap<Point, V>() /* Future: implements NavigableMap<Point, V> - see issue #57 */ {
2727
private inner class Entry(
2828
override val key: Point
2929
) : MutableMap.MutableEntry<Point, V> {
@@ -194,7 +194,7 @@ class Array2DMap<V> : AbstractMap<Point, V>() /* EXTENSION implements NavigableM
194194
fun getRow(y: Int): List<V> {
195195
val list = array.get(y)
196196

197-
// EXTENSION zatim unmodifieable
197+
// TODO: Make modifiable EntrySet - see issue #58
198198
@Suppress("UNCHECKED_CAST")
199199
val result: java.util.List<V> =
200200
if (list == null) {

src/main/kotlin/cz/vutbr/fit/interlockSim/util/HashMapGraph.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ class HashMapGraph<N, E, X> :
159159
*/
160160
override fun nodeSet(): Set<N> {
161161
if (nodeCollection == null) nodeCollection = NodeCollection()
162-
// EXTENSION pohled ne copii
162+
// TODO: Return unmodifiable view instead of copy - see issue #59
163163
val set = HashSet<N>(nodeCollection)
164164
// for (Doubleton<N> c: map.keySet()) {
165165
// set.addAll(c);

src/main/kotlin/cz/vutbr/fit/interlockSim/xml/XMLContextFactory.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ import javax.xml.validation.Validator
5959
class XMLContextFactory :
6060
EditingContextFactory,
6161
SimulationContextFactory {
62-
// EXTENSION co kdyz je delka koleje mezi InOuty mensi nez delka vlaku
62+
// TODO: Validate track length >= train length - see issue #60 (relates to Goals 3 & 4)
6363

6464
private inner class XMLContext(
6565
cols: Int,
@@ -329,7 +329,7 @@ class XMLContextFactory :
329329
context: Context,
330330
stream: OutputStream
331331
): Boolean {
332-
// TODO Auto-generated method stub
332+
// TODO: Implement XML serialization - see issue #61 (relates to Goal 5)
333333
return false
334334
}
335335

0 commit comments

Comments
 (0)