Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
fmbenhassine committed Oct 2, 2018
1 parent df2e778 commit 249fa26
Show file tree
Hide file tree
Showing 64 changed files with 170 additions and 129 deletions.
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2007 the original author or authors.
* Copyright 2006-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -17,11 +17,12 @@
package org.springframework.batch.core;

/**
* Enumeration representing the status of a an Execution.
* Enumeration representing the status of an Execution.
*
* @author Lucas Ward
* @author Dave Syer
* @author Michael Minella
* @author Mahmoud Ben Hassine
*/
public enum BatchStatus {

Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2013 the original author or authors.
* Copyright 2006-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -19,11 +19,12 @@

/**
* Listener interface for the lifecycle of a chunk. A chunk
* can be through of as a collection of items that will be
* can be thought of as a collection of items that will be
* committed together.
*
* @author Lucas Ward
* @author Michael Minella
* @author Mahmoud Ben Hassine
*
*/
public interface ChunkListener extends StepListener {
Expand All @@ -49,7 +50,7 @@ public interface ChunkListener extends StepListener {
* after transaction rollback. While the rollback will have occurred,
* transactional resources might still be active and accessible. Due to
* this, data access code within this callback will still "participate" in
* the original transaction unless it declares that it run in its own
* the original transaction unless it declares that it runs in its own
* transaction. Hence: <em> Use PROPAGATION_REQUIRES_NEW for any
* transactional operation that is called from here.</em>
*
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2013 the original author or authors.
* Copyright 2006-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -23,7 +23,7 @@
* JobInstance can be restarted multiple times in case of execution failure and
* it's lifecycle ends with first successful execution.
*
* Trying to execute an existing JobIntance that has already completed
* Trying to execute an existing JobInstance that has already completed
* successfully will result in error. Error will be raised also for an attempt
* to restart a failed JobInstance if the Job is not restartable.
*
Expand All @@ -36,6 +36,7 @@
* @author Dave Syer
* @author Robert Kasanicky
* @author Michael Minella
* @author Mahmoud Ben Hassine
*
*/
@SuppressWarnings("serial")
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2013 the original author or authors.
* Copyright 2006-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -40,6 +40,7 @@
* @author Lucas Ward
* @author Michael Minella
* @author Glenn Renfro
* @author Mahmoud Ben Hassine
* @since 1.0
* @see JobParameters
* @see JobParameter
Expand Down Expand Up @@ -201,7 +202,7 @@ public JobParametersBuilder addDouble(String key, Double parameter, boolean iden

/**
* Conversion method that takes the current state of this builder and
* returns it as a JobruntimeParameters object.
* returns it as a JobParameters object.
*
* @return a valid {@link JobParameters} object.
*/
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2014 the original author or authors.
* Copyright 2014-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -16,11 +16,12 @@
package org.springframework.batch.core.configuration;

/**
* Represents an error has occured in the configuration of base batch
* Represents an error has occurred in the configuration of base batch
* infrastructure (creation of a {@link org.springframework.batch.core.repository.JobRepository}
* for example.
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 2.2.6
*/
public class BatchConfigurationException extends RuntimeException {
Expand Down
Expand Up @@ -70,7 +70,7 @@ public DefaultJobParametersValidator(String[] requiredKeys, String[] optionalKey
@Override
public void afterPropertiesSet() throws IllegalStateException {
for (String key : requiredKeys) {
Assert.state(!optionalKeys.contains(key), "Optional keys canot be required: " + key);
Assert.state(!optionalKeys.contains(key), "Optional keys cannot be required: " + key);
}
}

Expand Down
Expand Up @@ -39,7 +39,7 @@ public class ItemProcessListenerAdapter<T,S> implements ItemProcessListener<T, S
* @param delegate to be called within the batch lifecycle
*/
public ItemProcessListenerAdapter(javax.batch.api.chunk.listener.ItemProcessListener delegate) {
Assert.notNull(delegate, "An ItemProcessListener is requred");
Assert.notNull(delegate, "An ItemProcessListener is required");
this.delegate = delegate;
}

Expand Down
Expand Up @@ -50,7 +50,7 @@
public class JsrJobParametersConverter implements JobParametersConverter, InitializingBean {

public static final String JOB_RUN_ID = "jsr_batch_run_id";
public DataFieldMaxValueIncrementer incremeter;
public DataFieldMaxValueIncrementer incrementer;
public String tablePrefix = AbstractJdbcBatchMetadataDao.DEFAULT_TABLE_PREFIX;
public DataSource dataSource;

Expand All @@ -77,7 +77,7 @@ public void setTablePrefix(String tablePrefix) {
public void afterPropertiesSet() throws Exception {
DataFieldMaxValueIncrementerFactory factory = new DefaultDataFieldMaxValueIncrementerFactory(dataSource);

this.incremeter = factory.getIncrementer(DatabaseType.fromMetaData(dataSource).name(), tablePrefix + "JOB_SEQ");
this.incrementer = factory.getIncrementer(DatabaseType.fromMetaData(dataSource).name(), tablePrefix + "JOB_SEQ");
}

/* (non-Javadoc)
Expand All @@ -102,7 +102,7 @@ public JobParameters getJobParameters(@Nullable Properties properties) {
}

if(!runIdFound) {
builder.addLong(JOB_RUN_ID, incremeter.nextLongValue());
builder.addLong(JOB_RUN_ID, incrementer.nextLongValue());
}

return builder.toJobParameters();
Expand All @@ -127,7 +127,7 @@ public Properties getProperties(@Nullable JobParameters params) {
}

if(!runIdFound) {
properties.setProperty(JOB_RUN_ID, String.valueOf(incremeter.nextLongValue()));
properties.setProperty(JOB_RUN_ID, String.valueOf(incrementer.nextLongValue()));
}

return properties;
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2014 the original author or authors.
* Copyright 2013-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -51,6 +51,7 @@
* </p>
*
* @author Chris Schaefer
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class JsrBeanDefinitionDocumentReader extends DefaultBeanDefinitionDocumentReader {
Expand All @@ -64,7 +65,7 @@ public class JsrBeanDefinitionDocumentReader extends DefaultBeanDefinitionDocume
private static final String JOB_PARAMETERS_KEY_NAME = "jobParameters";
private static final String JOB_PARAMETERS_BEAN_DEFINITION_NAME = "jsr_jobParameters";
private static final Log LOG = LogFactory.getLog(JsrBeanDefinitionDocumentReader.class);
private static final Pattern PROPERTY_KEY_SEPERATOR = Pattern.compile("'([^']*?)'");
private static final Pattern PROPERTY_KEY_SEPARATOR = Pattern.compile("'([^']*?)'");
private static final Pattern OPERATOR_PATTERN = Pattern.compile("(#\\{(job(Properties|Parameters))[^}]+\\})");

private BeanDefinitionRegistry beanDefinitionRegistry;
Expand Down Expand Up @@ -114,9 +115,9 @@ private Properties initJobParameters() {
Properties jobParameters = new Properties();

if (getBeanDefinitionRegistry().containsBeanDefinition(JOB_PARAMETERS_BEAN_DEFINITION_NAME)) {
BeanDefinition beanDefintion = getBeanDefinitionRegistry().getBeanDefinition(JOB_PARAMETERS_BEAN_DEFINITION_NAME);
BeanDefinition beanDefinition = getBeanDefinitionRegistry().getBeanDefinition(JOB_PARAMETERS_BEAN_DEFINITION_NAME);

Properties properties = (Properties) beanDefintion.getConstructorArgumentValues()
Properties properties = (Properties) beanDefinition.getConstructorArgumentValues()
.getGenericArgumentValue(Properties.class)
.getValue();

Expand Down Expand Up @@ -185,7 +186,7 @@ private String resolveValue(String value) {
Matcher jobParameterMatcher = OPERATOR_PATTERN.matcher(value);

while (jobParameterMatcher.find()) {
Matcher jobParameterKeyMatcher = PROPERTY_KEY_SEPERATOR.matcher(jobParameterMatcher.group(1));
Matcher jobParameterKeyMatcher = PROPERTY_KEY_SEPARATOR.matcher(jobParameterMatcher.group(1));

if (jobParameterKeyMatcher.find()) {
String propertyType = jobParameterMatcher.group(2);
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2014 the original author or authors.
* Copyright 2013-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -35,6 +35,7 @@
* Parser for the &lt;partition&gt; element as defined by JSR-352.
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class PartitionParser {
Expand Down Expand Up @@ -63,7 +64,7 @@ public class PartitionParser {

/**
* @param stepName the name of the step that is being partitioned
* @param allowStartIfComplete boolean to establish the allowStartIfComplete property for parition properties.
* @param allowStartIfComplete boolean to establish the allowStartIfComplete property for partition properties.
*/
public PartitionParser(String stepName, boolean allowStartIfComplete) {
this.name = stepName;
Expand All @@ -82,7 +83,7 @@ public void parse(Element element, AbstractBeanDefinition bd, ParserContext pars
properties.addPropertyValue("jobRepository", new RuntimeBeanReference("jobRepository"));
properties.addPropertyValue("allowStartIfComplete", allowStartIfComplete);

paserMapperElement(element, parserContext, properties);
parseMapperElement(element, parserContext, properties);
parsePartitionPlan(element, parserContext, stepName, properties);
parseAnalyzerElement(element, parserContext, properties);
parseReducerElement(element, parserContext, factoryBeanProperties);
Expand Down Expand Up @@ -136,7 +137,7 @@ private void parseAnalyzerElement(Element element,
}
}

private void paserMapperElement(Element element,
private void parseMapperElement(Element element,
ParserContext parserContext, MutablePropertyValues properties) {
Element mapperElement = DomUtils.getChildElementByTagName(element, MAPPER_ELEMENT);

Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2014 the original author or authors.
* Copyright 2013-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -37,6 +37,7 @@
* @author Michael Minella
* @author Glenn Renfro
* @author Chris Schaefer
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class StepParser extends AbstractSingleBeanDefinitionParser {
Expand Down Expand Up @@ -67,11 +68,11 @@ protected Collection<BeanDefinition> parse(Element element, ParserContext parser
}

String allowStartIfComplete = element.getAttribute(ALLOW_START_IF_COMPLETE_ATTRIBUTE);
boolean allowStartIfCompletValue = false;
boolean allowStartIfCompleteValue = false;
if(StringUtils.hasText(allowStartIfComplete)) {
bd.getPropertyValues().addPropertyValue("allowStartIfComplete",
allowStartIfComplete);
allowStartIfCompletValue = Boolean.valueOf(allowStartIfComplete);
allowStartIfCompleteValue = Boolean.valueOf(allowStartIfComplete);
}

new ListenerParser(JsrStepListenerFactoryBean.class, "listeners").parseListeners(element, parserContext, bd, stepName);
Expand All @@ -92,7 +93,7 @@ protected Collection<BeanDefinition> parse(Element element, ParserContext parser
} else if(name.equals(CHUNK_ELEMENT)) {
new ChunkParser().parse(nestedElement, bd, parserContext, stepName);
} else if(name.equals(PARTITION_ELEMENT)) {
new PartitionParser(stepName, allowStartIfCompletValue).parse(nestedElement, bd, parserContext, stepName);
new PartitionParser(stepName, allowStartIfCompleteValue).parse(nestedElement, bd, parserContext, stepName);
}
}
}
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2014 the original author or authors.
* Copyright 2013-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -33,6 +33,7 @@
* the PartitionCollector will be placed.
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class PartitionCollectorAdapter implements ChunkListener {
Expand Down Expand Up @@ -69,7 +70,7 @@ public void afterChunk(ChunkContext context) {
}
}
} catch (Throwable e) {
throw new BatchRuntimeException("An error occured while collecting data from the PartionCollector", e);
throw new BatchRuntimeException("An error occurred while collecting data from the PartitionCollector", e);
} finally {
if(lock.isHeldByCurrentThread()) {
lock.unlock();
Expand All @@ -89,7 +90,7 @@ public void afterChunkError(ChunkContext context) {
}
}
} catch (Throwable e) {
throw new BatchRuntimeException("An error occured while collecting data from the PartionCollector", e);
throw new BatchRuntimeException("An error occurred while collecting data from the PartitionCollector", e);
} finally {
if(lock.isHeldByCurrentThread()) {
lock.unlock();
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2013 the original author or authors.
* Copyright 2013-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -32,14 +32,15 @@
* of a {@link TaskletStep}.
*
* @author Michael Minella
* @author Mahmoud Ben Hassine
* @since 3.0
*/
public class JsrBatchletStepBuilder extends TaskletStepBuilder {

private BatchPropertyContext batchPropertyContext;

/**
* @param context used to resolve lazy binded properties
* @param context used to resolve lazy bound properties
*/
public void setBatchPropertyContext(BatchPropertyContext context) {
this.batchPropertyContext = context;
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2014 the original author or authors.
* Copyright 2006-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -56,6 +56,7 @@
* @author Dave Syer
* @author Will Schipp
* @author Michael Minella
* @author Mahmoud Ben Hassine
*
* @since 1.0
*
Expand All @@ -78,7 +79,9 @@ public class SimpleJobLauncher implements JobLauncher, InitializingBean {
* @param job the job to be run.
* @param jobParameters the {@link JobParameters} for this particular
* execution.
* @return JobExecutionAlreadyRunningException if the JobInstance already
* @return the {@link JobExecution} if it returns synchronously. If the
* implementation is asynchronous, the status might well be unknown.
* @throws JobExecutionAlreadyRunningException if the JobInstance already
* exists and has an execution already running.
* @throws JobRestartException if the execution would be a re-start, but a
* re-start is either not allowed or not needed.
Expand Down
Expand Up @@ -231,11 +231,11 @@ public void updateJobExecution(JobExecution jobExecution) {

// Avoid concurrent modifications...
if (count == 0) {
int curentVersion = getJdbcTemplate().queryForObject(getQuery(CURRENT_VERSION_JOB_EXECUTION), Integer.class,
int currentVersion = getJdbcTemplate().queryForObject(getQuery(CURRENT_VERSION_JOB_EXECUTION), Integer.class,
new Object[] { jobExecution.getId() });
throw new OptimisticLockingFailureException("Attempt to update job execution id="
+ jobExecution.getId() + " with wrong version (" + jobExecution.getVersion()
+ "), where current version is " + curentVersion);
+ "), where current version is " + currentVersion);
}

jobExecution.incrementVersion();
Expand Down

0 comments on commit 249fa26

Please sign in to comment.