Skip to content

Commit

Permalink
spelling: Replace witch with which
Browse files Browse the repository at this point in the history
  • Loading branch information
t2gran committed Nov 30, 2023
1 parent 15c87b4 commit 379a591
Show file tree
Hide file tree
Showing 34 changed files with 40 additions and 40 deletions.
2 changes: 1 addition & 1 deletion ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ examples. The Transit model is more complex than the VehiclePosition model.
a use-case or set of features. It may have an api with request/response classes. These are
usually stateless; Hence the `Use Case Service` does normally not have a model. The implementing
class has the same name as the interface with prefix `Default`.
- `Domain Model` A model witch encapsulate a business area. In the drawing two examples are shown,
- `Domain Model` A model which encapsulate a business area. In the drawing two examples are shown,
the `transit` and `vhicleposition` domain model. The transit model is more complex so the
implementation have a separate `Service` and `Repository`. Almost all http endpoints are ,
read-only so the `Service` can focus on serving the http API endpoints, while the repository
Expand Down
2 changes: 1 addition & 1 deletion CODE_CONVENTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ be `org.opentripplanner.<domain>.<component>.<sub-component>`.
| Package | Description |
| ------------------------------- |----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `o.o.<domain>` | At the top level we should divide OTP into "domain"s like `apis`, `framework`, `transit`, `street`, `astar`, `raptor`, `feeds`, `updaters`, and `application`. |
| `component` and `sub-component` | A group of packages/classes witch naturally belong together, think aggregate as in Domain Driven Design. |
| `component` and `sub-component` | A group of packages/classes which naturally belong together, think aggregate as in Domain Driven Design. |
| `component.api` | Used for components to define the programing interface for the component. If present, (see Raptor) all outside dependencies to the component should be through the `api`. |
| `component.model` | Used to create a model of a Entites, ValueObjects, ++. If exposed outside the component you should include an entry point like `xyz.model.XyzModel` and/or a Service (in api or component root package). |
| `component.service` | Implementation of the service like `DefaultTransitService`, may also contain use-case specific code. Note, the Service interface goes into the component root or `api`, not in the service package. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

/**
* This thread pool factory should be used to create all threads handling "user" requests in OTP.
* It is used to instrument new threads witch enable log information propagation and error handling,
* It is used to instrument new threads which enable log information propagation and error handling,
* like thread interruption. By "user" we mean users of the query APIs like GTFS GraphQL API,
* Transmodel GraphQL API and other http endpoints.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static String escapeInTable(String text) {
return text.replace("|", "¦");
}

/** Return whitespace witch can be used to indent inside a table cell. */
/** Return whitespace which can be used to indent inside a table cell. */
public static String indentInTable(int level) {
return level <= 0 ? "" : NBSP.repeat(3 * level);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public static TableBuilder of() {
}

/**
* Static method witch format a given table as valid Markdown table like:
* Static method which format a given table as valid Markdown table like:
* <pre>
* | A | B |
* |---|---|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public TableBuilder withAlights(Collection<Table.Align> aligns) {
}

/**
* Return the width needed for each column. The witch is calculated by taking
* Return the width needed for each column. The which is calculated by taking
* the maximum of the {@code minWidth}, header width and the maximum width for all
* cells in the column.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ public static Duration duration(String duration) {
}

/**
* This is used to parse a string witch may be a number {@code NNNN}(number of seconds) or a
* This is used to parse a string which may be a number {@code NNNN}(number of seconds) or a
* duration with format {@code NhNmNs}, where {@code N} is a decimal number and
* {@code h} is hours, {@code m} minutes and {@code s} seconds.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ public static String msToString(long milliseconds) {
* busy-wait again.
* <p>
* This method does a "busy" wait - it is not affected by a thread interrupt like
* {@link Thread#sleep(long)}; Hence do not interfere with timeout logic witch uses the interrupt
* {@link Thread#sleep(long)}; Hence do not interfere with timeout logic which uses the interrupt
* flag.
* <p>
* THIS CODE IS NOT MEANT FOR PRODUCTION!
Expand All @@ -226,7 +226,7 @@ public static long busyWaitOnce(int waitMs) {
* number.
* <p>
* This method does a "busy" wait - it is not affected by a thread interrupt like
* {@link Thread#sleep(long)}; Hence do not interfere with timeout logic witch uses the interrupt
* {@link Thread#sleep(long)}; Hence do not interfere with timeout logic which uses the interrupt
* flag.
* <p>
* THIS CODE IS NOT MEANT FOR PRODUCTION!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import org.opentripplanner.transit.service.TransitModel;

/**
* Configure all modules witch is not simple enough to be injected.
* Configure all modules which is not simple enough to be injected.
*/
@Module
public class GraphBuilderModules {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ public void setLegs(List<Leg> legs) {
* accessible the itinerary is as a whole. This is not a very scientific method but just a rough
* guidance that expresses certainty or uncertainty about the accessibility.
* <p>
* An alternative to this is to use the `generalized-cost` and use that to indicate witch itineraries is the
* An alternative to this is to use the `generalized-cost` and use that to indicate which itineraries is the
* best/most friendly with respect to making the journey in a wheelchair. The `generalized-cost` include, not
* only a penalty for unknown and inaccessible boardings, but also a penalty for undesired uphill and downhill
* street traversal.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@
*/
public interface TransferPoint {
/**
* Utility method witch can be used in APIs to get the trip, if it exists, from a transfer point.
* Utility method which can be used in APIs to get the trip, if it exists, from a transfer point.
*/
@Nullable
static Trip getTrip(TransferPoint point) {
return point.isTripTransferPoint() ? point.asTripTransferPoint().getTrip() : null;
}

/**
* Utility method witch can be used in APIs to get the route, if it exists, from a transfer
* Utility method which can be used in APIs to get the route, if it exists, from a transfer
* point.
*/
@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ E computeIfAbsent(TransferPoint point, Supplier<E> creator) {
}

/**
* List all elements witch matches any of the transfer points added to the map.
* List all elements which matches any of the transfer points added to the map.
*/
List<E> get(Trip trip, StopLocation stop, int stopPointInPattern) {
return Stream
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public Optional<String> getTagOpt(String network) {

/**
* Get tag and convert it to an integer. If the tag exist, but can not be parsed into a number,
* then the error handler is called with the value witch failed to parse.
* then the error handler is called with the value which failed to parse.
*/
public OptionalInt getTagAsInt(String tag, Consumer<String> errorHandler) {
String value = getTag(tag);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import org.opentripplanner.raptor.rangeraptor.transit.TripTimesSearch;

/**
* A debug logger witch can be plugged into Raptor to do debug logging to standard error. This is
* A debug logger which can be plugged into Raptor to do debug logging to standard error. This is
* used by the REST API, SpeedTest and in module tests.
* <p>
* See the Raptor design doc for a general description of the logging functionality.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public McRangeRaptorConfig(

/**
* The PassThroughPointsService is injected into the transit-calculator, so it needs to be
* created before the context(witch create the calculator).So, to be able to do this, this
* created before the context(which create the calculator).So, to be able to do this, this
* factory is static, and the service is passed back in when this config is instantiated.
*/
public static PassThroughPointsService passThroughPointsService(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ private static AggregatedResults create(
);

for (RaptorAccessEgress it : list) {
// Prevent transfer(walking) and the egress witch start with walking
// Prevent transfer(walking) and the egress which start with walking
if (!(it.stopReachedOnBoard() || stopReachedByTransit)) {
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public Access<T> fictiveAccess(int round, RaptorAccessEgress accessPath, int arr

/**
* Return a fictive Transfer stop arrival view. The arrival does not exist in the state, but is
* linked with the previous arrival witch is a "real" arrival present in the state. This enables
* linked with the previous arrival which is a "real" arrival present in the state. This enables
* path generation.
*/
public Transfer<T> fictiveTransfer(
Expand All @@ -76,7 +76,7 @@ public Transfer<T> fictiveTransfer(

/**
* Return a fictive Transit stop arrival view. The arrival does not exist in the state, but is
* linked with the previous arrival witch is a "real" arrival present in the state. This enables
* linked with the previous arrival which is a "real" arrival present in the state. This enables
* path generation.
*/
public Transit<T> fictiveTransit(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ public Collection<RaptorAccessEgress> listAll() {
}

/**
* List all stops with an egress path witch start by walking. These egress paths can only be used
* List all stops with an egress path which start by walking. These egress paths can only be used
* if arriving at the stop by transit.
*/
public int[] egressesWitchStartByWalking() {
return filterPathsAndGetStops(RaptorAccessEgress::stopReachedByWalking);
}

/**
* List all stops with an egress path witch start on-board a "transit" ride. These
* List all stops with an egress path which start on-board a "transit" ride. These
* egress paths can be used when arriving at the stop with both transfer or transit.
*/
public int[] egressesWitchStartByARide() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import java.lang.annotation.Target;

/**
* This interface is used to tag methods witch return flyweight objects. The implementation may
* This interface is used to tag methods which return flyweight objects. The implementation may
* choose not to implement the return type as a flyweight object, but the Raptor implementation
* is guaranteed to treat them as such - enabling the optimization.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ default int boardStopIndex() {
/**
* This is a helper method for the Raptor implementation to be able to board or execute
* a alternativeBoardingFallback method depending on the event. This logic should ideally
* be put inside raptor, but due to performance(creating lambda instances, witch for some
* be put inside raptor, but due to performance(creating lambda instances, which for some
* reason is not inlined) this need to be here.
* <p>
* @param boardCallback perform boarding if the event in none empty (or some other special
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ private AccessEgresses fetchAccessEgresses() {

if (OTPFeature.ParallelRouting.isOn()) {
try {
// TODO: This is not using {@link OtpRequestThreadFactory} witch mean we do not get
// TODO: This is not using {@link OtpRequestThreadFactory} which mean we do not get
// log-trace-parameters-propagation and graceful timeout handling here.
CompletableFuture
.allOf(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public ConstrainedTransfersForPatterns generateTransfers() {

for (ConstrainedTransfer tx : constrainedTransfers) {
var c = tx.getTransferConstraint();
// Only add transfers witch have an effect on the Raptor routing here.
// Only add transfers which have an effect on the Raptor routing here.
// Some transfers only have the priority set, and that is used in optimized-
// transfers, but not in Raptor.
if (!c.includeInRaptorRouting()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* This interface add two methods the the {@link RaptorTimeTable} to optimize the terip search
* inside the transit model. They were previously in Raptor, but the trip Search is moded outside
* of Raptor; We have keep these methods in an interface to be able to reuse the complex TripSearch
* in tests, witch do not use the transit model {@link TripSchedule}; Hence also the generic type
* in tests, which do not use the transit model {@link TripSchedule}; Hence also the generic type
* on this interface.
*/
public interface TripSearchTimetable<T extends RaptorTripSchedule> extends RaptorTimeTable<T> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public TimeSlopeSafetyTriangle(double time, double slope, double safety) {
}

/**
* Creates a special builder, witch used together with the
* Creates a special builder, which used together with the
* {@link Builder#buildOrDefault(TimeSlopeSafetyTriangle)} can return a new instance or the
* default value if no values are set. This is useful in the APIs where we want to fall back to
* the default {@link TimeSlopeSafetyTriangle}, if no values are set. If only one or two values
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
* </ol>
* <p>
* This class is not THREAD-SAFE, each HTTP request gets its own copy, but if there are multiple
* threads witch accesses this context within the HTTP Request, then the caller is responsible
* threads which accesses this context within the HTTP Request, then the caller is responsible
* for the synchronization. Only request scoped components need to be synchronized - they are
* potentially lazy initialized.
*/
Expand Down Expand Up @@ -107,7 +107,7 @@ public interface OtpServerRequestContext {
TileRendererManager tileRendererManager();

/**
* Callback witch is injected into the {@code DirectStreetRouter}, used to visualize the
* Callback which is injected into the {@code DirectStreetRouter}, used to visualize the
* search.
*/
@HttpRequestScoped
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static String kebabCase(String input) {
}

/**
* Used to create a list of all values with description of each value witch can be included
* Used to create a list of all values with description of each value which can be included
* in documentation. The list will look like this:
* ```
* - `on` Turn on.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import org.opentripplanner.framework.error.OtpError;

/**
* This class is used to throw a data validation exception. It holds an error witch can be
* This class is used to throw a data validation exception. It holds an error which can be
* inserted into build issue store, into the updater logs or returned to the APIs. The framework
* to catch and handle this is NOT IN PLACE, see
* <a href="https://github.com/opentripplanner/OpenTripPlanner/issues/5070">Error code design #5070</a>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
* <p>
* It's very similar to the Either or Validation type found in functional programming languages.
*
* @deprecated This not possible to use inside a constructor - can only return one thing. Witch,
* @deprecated This not possible to use inside a constructor - can only return one thing. Which,
* then makes encapsulation harder and leaves the door open to forget. Also, having to create
* error codes, mapping and handling code for hundreds of different possible validation error
* types make changes harder, and cleanup impossible. This is a nice way to design APIs, but
* faced with hundreds or even thousands of different validation error types and the same
* amount of code branches this breaks.
* <p>
* I will use the {@link DataValidationException} for now, but we need to make an error
* handling strategy witch take all use-cases and goals into account, also pragmatic goals
* handling strategy which take all use-cases and goals into account, also pragmatic goals
* like maintainability. The {@link DataValidationException} is not a solution, but it
* at least it allows me to omit returning all possible error on every method ...
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ public interface TransitBuilder<E extends TransitObject<E, B>, B extends Transit
* Build a new object based on the values set in the builder. This method is NOT context aware -
* any context is not updated. Use the {@link TransitEntityBuilder#save()} method instead to
* build an object and store it in the context. This method is useful if you need to build an
* object witch should be request scoped or used in a test.
* object which should be request scoped or used in a test.
* <p>
* For value objects are stored as "part of" an entity, but OTP tries to reuse objects using the
* {@code Deduplicator}. This method may or may not be context aware, using a deduplicator to
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* - The RTP is accessed frequently during the Raptor search, and we want it to be as small as
* possible to load/access it in the cache and CPU for performance reasons.
* - Also, we deduplicate these so a RTP can be reused by more than one TP.
* - This also provide explicit documentation on witch fields are used during a search and which
* - This also provide explicit documentation on which fields are used during a search and which
* are not.
*/
public class RoutingTripPattern implements DefaultTripPattern, Serializable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public interface ArchComponent {
/**
* ArchUnit cached set of classes in OTP. It takes a bit of time to build the set of
* classes, so it is nice to avoid this for every test. ArchUnit also support JUnit5
* with a @ArchTest annotation witch cache and inject the classes, but the test become
* with a @ArchTest annotation which cache and inject the classes, but the test become
* slightly more complex by using it and chasing it here works fine.
*/
JavaClasses OTP_CLASSES = new ClassFileImporter()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* FEATURE UNDER TEST
* <p>
* Raptor should be able to route Access arriving on-board and egress departing on-board connecting
* to transit by transfers. Access and egress witch arrive/depart at/from the same stops by
* to transit by transfers. Access and egress which arrive/depart at/from the same stops by
* walking should not be possible.
*/
public class F05_OnBoardAccessEgressAndTransfersTest implements RaptorTestConstants {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ RouteRequest toRouteRequest() {
request.setTo(input.toPlace());

// Filter the results inside the SpeedTest, not in the itineraries filter,
// when ignoring street results. This will use the default witch is 50.
// when ignoring street results. This will use the default which is 50.
if (!config.ignoreStreetResults) {
request.setNumItineraries(opts.numOfItineraries());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* This class contains the results for a given test case. A set of results
* for each {@link SpeedTestProfile} is kept. A default set is also available,
* witch can be used if there is not set for a given profile.
* which can be used if there is not set for a given profile.
*/
public class ExpectedResults {

Expand Down

0 comments on commit 379a591

Please sign in to comment.