Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix various typos in code #26650

Merged
merged 1 commit into from Jul 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/src/main/asciidoc/mailer-reference.adoc
Expand Up @@ -370,9 +370,9 @@ quarkus.mailer.trust-store.type=JKS # the type of trust store if it can't be ded

Quarkus mailer supports JKS, PKCS#12 and PEM trust stores.
For PEM, you can configure multiple files.
For JKS and PCKS#12, you can configure the password if any.
For JKS and PKCS#12, you can configure the password if any.

`quarkus.mailer.trust-store.type` is optional and allows configuring the type of trust store (among `JKS`, `PEM` and `PCKS`).
`quarkus.mailer.trust-store.type` is optional and allows configuring the type of trust store (among `JKS`, `PEM` and `PKCS`).
When not set, Quarkus tries to deduce the type from the file name.

NOTE: You can also configure `quarkus.mailer.trust-all=true` to bypass the verification.
Expand Down
Expand Up @@ -35,7 +35,7 @@ public MockHttpEventServer() {
}

@Override
protected void defaultHanderSetup() {
protected void defaultHandlerSetup() {
router.route().handler(this::handleHttpRequests);
}

Expand Down
Expand Up @@ -41,7 +41,7 @@ public MockRestEventServer() {
}

@Override
protected void defaultHanderSetup() {
protected void defaultHandlerSetup() {
router.route().handler(this::handleHttpRequests);
}

Expand Down
Expand Up @@ -104,10 +104,10 @@ public void setupRoutes() {
router.route(INVOCATION + ":requestId" + AmazonLambdaApi.API_PATH_REQUEUE).handler(this::handleRequeue);
router.route(INVOCATION + ":requestId" + AmazonLambdaApi.API_PATH_RESPONSE).handler(this::handleResponse);
router.route(INVOCATION + ":requestId" + AmazonLambdaApi.API_PATH_ERROR).handler(this::handleError);
defaultHanderSetup();
defaultHandlerSetup();
}

protected void defaultHanderSetup() {
protected void defaultHandlerSetup() {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note for myself: we will need a note in the migration guide for this one.

router.post().handler(this::postEvent);
}

Expand Down
Expand Up @@ -109,9 +109,9 @@ private Method discoverHandlerMethod(Class<? extends RequestHandler<?, ?>> handl
return method;
}

public void chooseHandlerClass(List<Class<? extends RequestHandler<?, ?>>> unamedHandlerClasses,
public void chooseHandlerClass(List<Class<? extends RequestHandler<?, ?>>> unnamedHandlerClasses,
Map<String, Class<? extends RequestHandler<?, ?>>> namedHandlerClasses,
List<Class<? extends RequestStreamHandler>> unamedStreamHandlerClasses,
List<Class<? extends RequestStreamHandler>> unnamedStreamHandlerClasses,
Map<String, Class<? extends RequestStreamHandler>> namedStreamHandlerClasses,
BeanContainer container) {

Expand All @@ -127,7 +127,7 @@ public void chooseHandlerClass(List<Class<? extends RequestHandler<?, ?>>> uname
throw new RuntimeException(errorMessage);
}
} else {
int unnamedTotal = unamedHandlerClasses.size() + unamedStreamHandlerClasses.size();
int unnamedTotal = unnamedHandlerClasses.size() + unnamedStreamHandlerClasses.size();
int namedTotal = namedHandlerClasses.size() + namedStreamHandlerClasses.size();

if (unnamedTotal > 1 || namedTotal > 1 || (unnamedTotal > 0 && namedTotal > 0)) {
Expand All @@ -140,12 +140,12 @@ public void chooseHandlerClass(List<Class<? extends RequestHandler<?, ?>>> uname
+ RequestHandler.class.getName() + " or, " + RequestStreamHandler.class.getName() + " implementation";
throw new RuntimeException(errorMessage);
} else if ((unnamedTotal + namedTotal) == 1) {
if (!unamedHandlerClasses.isEmpty()) {
handlerClass = unamedHandlerClasses.get(0);
if (!unnamedHandlerClasses.isEmpty()) {
handlerClass = unnamedHandlerClasses.get(0);
} else if (!namedHandlerClasses.isEmpty()) {
handlerClass = namedHandlerClasses.values().iterator().next();
} else if (!unamedStreamHandlerClasses.isEmpty()) {
handlerStreamClass = unamedStreamHandlerClasses.get(0);
} else if (!unnamedStreamHandlerClasses.isEmpty()) {
handlerStreamClass = unnamedStreamHandlerClasses.get(0);
} else if (!namedStreamHandlerClasses.isEmpty()) {
handlerStreamClass = namedStreamHandlerClasses.values().iterator().next();
}
Expand Down
Expand Up @@ -859,7 +859,7 @@ public void registerField(FieldInfo fieldInfo) {
}

configurator.creator(mc -> {
ResultHandle injetionPointType = Types.getTypeHandle(mc, injectionPoint.getType());
ResultHandle injectionPointType = Types.getTypeHandle(mc, injectionPoint.getType());

// List<T> or List<InstanceHandle<T>
ResultHandle requiredType;
Expand Down Expand Up @@ -890,7 +890,7 @@ public void registerField(FieldInfo fieldInfo) {
: mc.loadNull());

ResultHandle ret = mc.invokeStaticMethod(instancesMethod, targetBean,
injetionPointType, requiredType, requiredQualifiers, mc.getMethodParam(0),
injectionPointType, requiredType, requiredQualifiers, mc.getMethodParam(0),
injectionPointAnnotations,
javaMember, mc.load(injectionPoint.getPosition()));
mc.returnValue(ret);
Expand Down
Expand Up @@ -81,7 +81,7 @@ public class InterceptedStaticMethodsProcessor {
static final MethodDescriptor INTERCEPTED_STATIC_METHODS_AROUND_INVOKE = MethodDescriptor
.ofMethod(InterceptedStaticMethods.class, "aroundInvoke", Object.class, String.class, Object[].class);

private static final String ORGINAL_METHOD_COPY_SUFFIX = "_orig";
private static final String ORIGINAL_METHOD_COPY_SUFFIX = "_orig";
private static final String INITIALIZER_CLASS_SUFFIX = "_InterceptorInitializer";

@BuildStep
Expand Down Expand Up @@ -178,12 +178,12 @@ void processInterceptedStaticMethods(BeanArchiveIndexBuildItem beanArchiveIndex,
for (Entry<DotName, List<InterceptedStaticMethodBuildItem>> entry : interceptedStaticMethodsMap.entrySet()) {

String packageName = DotNames.internalPackageNameWithTrailingSlash(entry.getKey());
String intializerName = packageName.replace("/", ".") + entry.getKey().withoutPackagePrefix()
String initializerName = packageName.replace("/", ".") + entry.getKey().withoutPackagePrefix()
+ INITIALIZER_CLASS_SUFFIX;
initializers.put(entry.getKey(), intializerName);
initializers.put(entry.getKey(), initializerName);

ClassCreator initializer = ClassCreator.builder().classOutput(classOutput)
.className(intializerName).setFinal(true).build();
.className(initializerName).setFinal(true).build();

List<String> initMethods = new ArrayList<>();
for (InterceptedStaticMethodBuildItem interceptedStaticMethod : entry.getValue()) {
Expand Down Expand Up @@ -212,7 +212,7 @@ void processInterceptedStaticMethods(BeanArchiveIndexBuildItem beanArchiveIndex,

// Generate a global initializer that calls all other initializers
ClassCreator globalInitializer = ClassCreator.builder().classOutput(classOutput)
.className(InterceptedStaticMethodsRecorder.INTIALIZER_CLASS_NAME.replace('.', '/')).setFinal(true).build();
.className(InterceptedStaticMethodsRecorder.INITIALIZER_CLASS_NAME.replace('.', '/')).setFinal(true).build();

MethodCreator staticInit = globalInitializer.getMethodCreator("<clinit>", void.class)
.setModifiers(ACC_STATIC);
Expand Down Expand Up @@ -352,10 +352,10 @@ private ResultHandle createBindingLiteral(IndexView index, BytecodeCreator init,
private ResultHandle createInterceptorInvocation(InterceptorInfo interceptor, BytecodeCreator init,
ResultHandle creationalContext) {
ResultHandle interceptorBean = getInterceptorBean(interceptor, init);
ResultHandle interceptorInstane = createInterceptor(interceptorBean, init, creationalContext);
ResultHandle interceptorInstance = createInterceptor(interceptorBean, init, creationalContext);
return init.invokeStaticMethod(
MethodDescriptors.INTERCEPTOR_INVOCATION_AROUND_INVOKE,
interceptorBean, interceptorInstane);
interceptorBean, interceptorInstance);
}

private ResultHandle getInterceptorBean(InterceptorInfo interceptor, BytecodeCreator creator) {
Expand Down Expand Up @@ -401,7 +401,7 @@ private ResultHandle createForwardingFunction(MethodCreator init, ClassInfo targ
}
}
ResultHandle ret = funcBytecode.invokeStaticMethod(
MethodDescriptor.ofMethod(target.name().toString(), method.name() + ORGINAL_METHOD_COPY_SUFFIX,
MethodDescriptor.ofMethod(target.name().toString(), method.name() + ORIGINAL_METHOD_COPY_SUFFIX,
method.returnType().name().toString(),
params),
paramHandles);
Expand Down Expand Up @@ -447,7 +447,7 @@ public MethodVisitor visitMethod(int access, String name, String descriptor, Str
InterceptedStaticMethodBuildItem method = findMatchingMethod(access, name, descriptor);
if (method != null) {
MethodVisitor copy = super.visitMethod(access,
name + ORGINAL_METHOD_COPY_SUFFIX,
name + ORIGINAL_METHOD_COPY_SUFFIX,
descriptor,
signature,
exceptions);
Expand Down
Expand Up @@ -36,7 +36,7 @@ public void validateConfigProperties(Set<ConfigValidationMetadata> properties) {
cl = ConfigRecorder.class.getClassLoader();
}
Set<String> problems = new HashSet<>();
List<Throwable> suppresed = new ArrayList<>();
List<Throwable> suppressed = new ArrayList<>();
StringBuilder msg = new StringBuilder();

for (ConfigValidationMetadata property : properties) {
Expand All @@ -62,13 +62,13 @@ public void validateConfigProperties(Set<ConfigValidationMetadata> properties) {
msg.append("Failed to load config value of type ").append(effectivePropertyType).append(" for: ")
.append(property.getName());
problems.add(property.getName());
suppresed.add(e);
suppressed.add(e);
}
}
if (!problems.isEmpty()) {
DeploymentException deploymentException = new DeploymentException(
new ConfigurationException(msg.toString(), problems));
for (Throwable i : suppresed) {
for (Throwable i : suppressed) {
deploymentException.addSuppressed(i);
}
throw deploymentException;
Expand Down
Expand Up @@ -5,15 +5,15 @@
@Recorder
public class InterceptedStaticMethodsRecorder {

public static final String INTIALIZER_CLASS_NAME = "io.quarkus.arc.runtime.InterceptedStaticMethodsInitializer";
public static final String INITIALIZER_CLASS_NAME = "io.quarkus.arc.runtime.InterceptedStaticMethodsInitializer";

public void callInitializer() {
ClassLoader cl = Thread.currentThread().getContextClassLoader();
if (cl == null) {
cl = InterceptedStaticMethodsRecorder.class.getClassLoader();
}
try {
Class.forName(INTIALIZER_CLASS_NAME, true, cl);
Class.forName(INITIALIZER_CLASS_NAME, true, cl);
} catch (ClassNotFoundException e) {
throw new IllegalStateException(e);
}
Expand Down
Expand Up @@ -82,7 +82,7 @@ public void buildFromJar(ContainerImageConfig containerImageConfig, BuildpackCon
return;
}

log.info("Starting (local) container image build for jar using builpack.");
log.info("Starting (local) container image build for jar using buildpack.");
String targetImageName = runBuildpackBuild(buildpackConfig, containerImage, containerImageConfig, pushRequest,
outputTarget, false /* isNative */);

Expand Down
Expand Up @@ -42,7 +42,7 @@ public String getNativeBinaryDirectory() {
return nativeBinaryDirectory;
}

public String getFixedNativeNinaryName() {
public String getFixedNativeBinaryName() {
return this.fixedNativeBinaryName;
}

Expand Down
Expand Up @@ -22,7 +22,7 @@ public class OpenshiftConfig {
public static final String DEFAULT_NATIVE_DOCKERFILE = "src/main/docker/Dockerfile.native";

public static final String FALLBACK_JAR_DIRECTORY = "/deployments/";
public static final String FALLBAC_NATIVE_BINARY_DIRECTORY = "/home/quarkus/";
public static final String FALLBACK_NATIVE_BINARY_DIRECTORY = "/home/quarkus/";

public static String getDefaultJvmImage(CompiledJavaVersionBuildItem.JavaVersion version) {
switch (version.isJava17OrHigher()) {
Expand Down
Expand Up @@ -196,7 +196,7 @@ public void openshiftRequirementsNative(OpenshiftConfig openshiftConfig,
// 2. detected via OpenshiftBaseNativeImage
// 3. fallback value
String nativeBinaryDirectory = config.nativeBinaryDirectory
.orElse(baseImage.map(i -> i.getNativeBinaryDirectory()).orElse(config.FALLBAC_NATIVE_BINARY_DIRECTORY));
.orElse(baseImage.map(i -> i.getNativeBinaryDirectory()).orElse(config.FALLBACK_NATIVE_BINARY_DIRECTORY));
String pathToNativeBinary = concatUnixPaths(nativeBinaryDirectory, nativeBinaryFileName);

baseImage.ifPresent(b -> {
Expand Down Expand Up @@ -485,14 +485,14 @@ private static void openshiftBuild(OpenShiftClient client, BuildConfig buildConf
}
}

public static Predicate<HasMetadata> distictByResourceKey() {
public static Predicate<HasMetadata> distinctByResourceKey() {
Map<Object, Boolean> seen = new ConcurrentHashMap<>();
return t -> seen.putIfAbsent(t.getApiVersion() + "/" + t.getKind() + ":" + t.getMetadata().getName(),
Boolean.TRUE) == null;
}

private static Collection<HasMetadata> distinct(Collection<HasMetadata> resources) {
return resources.stream().filter(distictByResourceKey()).collect(Collectors.toList());
return resources.stream().filter(distinctByResourceKey()).collect(Collectors.toList());
}

private static List<Build> buildsOf(OpenShiftClient client, BuildConfig config) {
Expand Down
Expand Up @@ -35,7 +35,7 @@ public String getImage() {
return image;
}

public String getFixedNativeNinaryName() {
public String getFixedNativeBinaryName() {
return this.fixedNativeBinaryName;
}

Expand Down
Expand Up @@ -21,7 +21,7 @@ public class S2iConfig {
public static final String DEFAULT_NATIVE_DOCKERFILE = "src/main/docker/Dockerfile.native";

public static final String FALLBACK_JAR_DIRECTORY = "/deployments/";
public static final String FALLBAC_NATIVE_BINARY_DIRECTORY = "/home/quarkus/";
public static final String FALLBACK_NATIVE_BINARY_DIRECTORY = "/home/quarkus/";

public static String getDefaultJvmImage(CompiledJavaVersionBuildItem.JavaVersion version) {
switch (version.isJava17OrHigher()) {
Expand Down
Expand Up @@ -35,7 +35,7 @@ public String getImage() {
return image;
}

public String getFixedNativeNinaryName() {
public String getFixedNativeBinaryName() {
return this.fixedNativeBinaryName;
}

Expand Down
Expand Up @@ -387,14 +387,14 @@ private static void waitForBuildComplete(OpenShiftClient client, S2iConfig s2iCo
});
}

public static Predicate<HasMetadata> distictByResourceKey() {
public static Predicate<HasMetadata> distinctByResourceKey() {
Map<Object, Boolean> seen = new ConcurrentHashMap<>();
return t -> seen.putIfAbsent(t.getApiVersion() + "/" + t.getKind() + ":" + t.getMetadata().getName(),
Boolean.TRUE) == null;
}

private static Collection<HasMetadata> distinct(Collection<HasMetadata> resources) {
return resources.stream().filter(distictByResourceKey()).collect(Collectors.toList());
return resources.stream().filter(distinctByResourceKey()).collect(Collectors.toList());
}

private static List<Build> buildsOf(OpenShiftClient client, BuildConfig config) {
Expand Down
Expand Up @@ -151,7 +151,7 @@ public void testNoTrigger() {
.then().statusCode(200);
}

static final String tolowercaseEvent = "{ \"id\" : \"1234\", " +
static final String toLowercaseEvent = "{ \"id\" : \"1234\", " +
" \"specversion\": \"1.0\", " +
" \"source\": \"test\", " +
" \"type\": \"tolower\", " +
Expand All @@ -162,7 +162,7 @@ public void testNoTrigger() {
@Test
public void testStructuredMapping() {
RestAssured.given().contentType("application/cloudevents+json")
.body(tolowercaseEvent)
.body(toLowercaseEvent)
.post("/")
.then().statusCode(200)
.defaultParser(Parser.JSON)
Expand Down
Expand Up @@ -139,7 +139,7 @@ public void testNoTrigger() {
.then().statusCode(404);
}

static final String tolowercaseEvent = "{ \"id\" : \"1234\", " +
static final String toLowercaseEvent = "{ \"id\" : \"1234\", " +
" \"specversion\": \"1.0\", " +
" \"source\": \"test\", " +
" \"type\": \"tolower\", " +
Expand All @@ -150,7 +150,7 @@ public void testNoTrigger() {
@Test
public void testStructuredMapping() {
RestAssured.given().contentType("application/cloudevents+json")
.body(tolowercaseEvent)
.body(toLowercaseEvent)
.post("/")
.then().statusCode(200)
.defaultParser(Parser.JSON)
Expand Down
Expand Up @@ -235,9 +235,9 @@ private List<Predicate<CloudEvent>> filter(String functionName, CloudEventMappin
List<Predicate<CloudEvent>> filters = new ArrayList<>();
for (EventAttribute attribute : mapping.attributes()) {
Objects.requireNonNull(attribute.name(),
"Attribute name of the EventAttribure on function " + functionName + " is required");
"Attribute name of the EventAttribute on function " + functionName + " is required");
Objects.requireNonNull(attribute.value(),
"Attribute name of the EventAttribure on function " + functionName + " is required");
"Attribute name of the EventAttribute on function " + functionName + " is required");

filters.add(new CEAttributeLiteralEqualsFilter(attribute.name(), attribute.value()));

Expand Down
Expand Up @@ -291,7 +291,7 @@ public void validateInjectedServiceInterfaces(CombinedIndexBuildItem index,
FieldInfo field = injectAnnotation.target().asField();
if (serviceInterfaces.contains(field.type().name()) && field.annotations().size() == 1) {
// e.g. @Inject Greeter
throw new IllegalStateException("A gRPC service injection is missing the @GrcpClient qualifier: "
throw new IllegalStateException("A gRPC service injection is missing the @GrpcClient qualifier: "
+ field.declaringClass().name() + "#" + field.name());
}
} else if (injectAnnotation.target().kind() == Kind.METHOD) {
Expand All @@ -310,7 +310,7 @@ public void validateInjectedServiceInterfaces(CombinedIndexBuildItem index,
}
}
if (annotations.size() > 1) {
throw new IllegalStateException("A gRPC service injection is missing the @GrcpClient qualifier: "
throw new IllegalStateException("A gRPC service injection is missing the @GrpcClient qualifier: "
+ method.declaringClass().name() + "#" + method.name() + "()");
}
}
Expand Down
Expand Up @@ -20,7 +20,7 @@
import io.quarkus.grpc.server.services.HelloService;
import io.quarkus.test.QuarkusUnitTest;

public class MutipleStubsInjectionTest {
public class MultipleStubsInjectionTest {

@RegisterExtension
static final QuarkusUnitTest config = new QuarkusUnitTest().setArchiveProducer(
Expand Down