Skip to content

Commit

Permalink
[ARQ-2230] Resolve incorrectly placed left curly bracket
Browse files Browse the repository at this point in the history
  • Loading branch information
petrberan committed Mar 7, 2024
1 parent 50c2d01 commit ec818b9
Show file tree
Hide file tree
Showing 31 changed files with 53 additions and 119 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,7 @@ else if (c == '}' && state == IN_BRACKET) {
// No content
if (start + 2 == i) {
buffer.append("${}"); // REVIEW: Correct?
} else // Collect the system property
{
} else { // Collect the system property
String value;

String key = string.substring(start + 2, i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ public java.lang.Class<?> loadClass(String name, boolean resolve) throws ClassNo
c = super.findClass(name);
}
}
if (c != null) // class found locally
{
if (c != null) { // class found locally
return c;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,7 @@ private static Collection<Method> filterBridgeMethods(Method... declaredMethods)
/**
* Single instance to get the TCCL
*/
private enum GetTcclAction implements PrivilegedAction<ClassLoader>

{
private enum GetTcclAction implements PrivilegedAction<ClassLoader> {
INSTANCE;

public ClassLoader run() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,7 @@ private static Collection<Method> filterBridgeMethods(Method... declaredMethods)
/**
* Single instance to get the TCCL
*/
private enum GetTcclAction implements PrivilegedAction<ClassLoader>

{
private enum GetTcclAction implements PrivilegedAction<ClassLoader> {
INSTANCE;

public ClassLoader run() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,7 @@ private static Collection<Method> filterBridgeMethods(Method... declaredMethods)
/**
* Single instance to get the TCCL
*/
private enum GetTcclAction implements PrivilegedAction<ClassLoader>

{
private enum GetTcclAction implements PrivilegedAction<ClassLoader> {
INSTANCE;

public ClassLoader run() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,7 @@ private static Collection<Method> filterBridgeMethods(Method... declaredMethods)
/**
* Single instance to get the TCCL
*/
private enum GetTcclAction implements PrivilegedAction<ClassLoader>

{
private enum GetTcclAction implements PrivilegedAction<ClassLoader> {
INSTANCE;

public ClassLoader run() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ public class ArchiveDeploymentToolingExporter {

public void export(@Observes BeforeDeploy event) throws Exception {
String deploymentOutputFolder = System.getProperty(ARQUILLIAN_TOOLING_DEPLOYMENT_FOLDER);
if (deploymentOutputFolder == null) // tooling not activated, nothing to do
{
if (deploymentOutputFolder == null) { // tooling not activated, nothing to do
return;
}
Archive<?> deployment = event.getDeployment().getTestableArchive(); // deployment not in context?, nothing to do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,7 @@ private static Collection<Method> filterBridgeMethods(Method... declaredMethods)
/**
* Single instance to get the TCCL
*/
private enum GetTcclAction implements PrivilegedAction<ClassLoader>

{
private enum GetTcclAction implements PrivilegedAction<ClassLoader> {
INSTANCE;

public ClassLoader run() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,7 @@ void fireException(Throwable event) {
runtimeLogger.debug(event, true);
try {
List<ObserverMethod> observers = resolveObservers(event.getClass());
if (observers.size() == 0) // no one is handling this Exception, throw it out.
{
if (observers.size() == 0) { // no one is handling this Exception, throw it out.
UncheckedThrow.throwUnchecked(event);
}
for (int i = 0; i < observers.size(); i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,14 +324,12 @@ private static Collection<Method> filterBridgeMethods(Method... declaredMethods)
/**
* Single instance to get the TCCL
*/
private enum GetTcclAction implements PrivilegedAction<ClassLoader>

{
private enum GetTcclAction implements PrivilegedAction<ClassLoader> {
INSTANCE;

public ClassLoader run() {
return Thread.currentThread().getContextClassLoader();
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -329,14 +329,12 @@ private static Collection<Method> filterBridgeMethods(Method... declaredMethods)
/**
* Single instance to get the TCCL
*/
private enum GetTcclAction implements PrivilegedAction<ClassLoader>

{
private enum GetTcclAction implements PrivilegedAction<ClassLoader> {
INSTANCE;

public ClassLoader run() {
return Thread.currentThread().getContextClassLoader();
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -324,14 +324,12 @@ private static Collection<Method> filterBridgeMethods(Method... declaredMethods)
/**
* Single instance to get the TCCL
*/
private enum GetTcclAction implements PrivilegedAction<ClassLoader>

{
private enum GetTcclAction implements PrivilegedAction<ClassLoader> {
INSTANCE;

public ClassLoader run() {
return Thread.currentThread().getContextClassLoader();
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,7 @@ private void setAdaptor(TestRunnerAdaptor adaptor) throws Exception {
method.invoke(null, adaptor);
}

public enum Cycle

{
public enum Cycle {
BEFORE_CLASS_RULE, BEFORE_RULE, BEFORE_CLASS, BEFORE, TEST, AFTER, AFTER_CLASS, AFTER_RULE, AFTER_CLASS_RULE;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,14 +347,12 @@ private static Collection<Method> filterBridgeMethods(Method... declaredMethods)
/**
* Single instance to get the TCCL
*/
private enum GetTcclAction implements PrivilegedAction<ClassLoader>

{
private enum GetTcclAction implements PrivilegedAction<ClassLoader> {
INSTANCE;

public ClassLoader run() {
return Thread.currentThread().getContextClassLoader();
}

}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,35 @@

import static org.jboss.arquillian.junit.JUnitTestBaseClass.wasCalled;

public class ClassWithArquillianClassAndMethodRule
{
public class ClassWithArquillianClassAndMethodRule {
@ClassRule
public static ArquillianTestClass arquillianTestClass = new ArquillianTestClass();

@Rule
public ArquillianTest arquillianTest = new ArquillianTest();

@BeforeClass
public static void beforeClass() throws Throwable
{
public static void beforeClass() throws Throwable {
wasCalled(Cycle.BEFORE_CLASS);
}

@AfterClass
public static void afterClass() throws Throwable
{
public static void afterClass() throws Throwable {
wasCalled(Cycle.AFTER_CLASS);
}

@Before
public void before() throws Throwable
{
public void before() throws Throwable {
wasCalled(Cycle.BEFORE);
}

@After
public void after() throws Throwable
{
public void after() throws Throwable {
wasCalled(Cycle.AFTER);
}

@Test
public void shouldBeInvoked() throws Throwable
{
public void shouldBeInvoked() throws Throwable {
wasCalled(Cycle.TEST);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,41 +11,35 @@

import static org.jboss.arquillian.junit.JUnitTestBaseClass.wasCalled;

public class ClassWithArquillianClassAndMethodRuleWithExpectedException
{
public class ClassWithArquillianClassAndMethodRuleWithExpectedException {
@ClassRule
public static ArquillianTestClass arquillianTestClass = new ArquillianTestClass();

@Rule
public ArquillianTest arquillianTest = new ArquillianTest();

@BeforeClass
public static void beforeClass() throws Throwable
{
public static void beforeClass() throws Throwable {
wasCalled(Cycle.BEFORE_CLASS);
}

@AfterClass
public static void afterClass() throws Throwable
{
public static void afterClass() throws Throwable {
wasCalled(Cycle.AFTER_CLASS);
}

@Before
public void before() throws Throwable
{
public void before() throws Throwable {
wasCalled(Cycle.BEFORE);
}

@After
public void after() throws Throwable
{
public void after() throws Throwable {
wasCalled(Cycle.AFTER);
}

@Test(expected = IllegalArgumentException.class)
public void shouldBeInvoked() throws Throwable
{
public void shouldBeInvoked() throws Throwable {
wasCalled(Cycle.TEST);
throw new IllegalArgumentException();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
public class ClassWithArquillianRunner {

@BeforeClass
public static void beforeClass() throws Throwable
{
public static void beforeClass() throws Throwable {
wasCalled(Cycle.BEFORE_CLASS);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,35 +27,29 @@
import static org.jboss.arquillian.junit.JUnitTestBaseClass.wasCalled;

@RunWith(Arquillian.class)
public class ClassWithArquillianRunnerWithExpectedException
{
public class ClassWithArquillianRunnerWithExpectedException {
@BeforeClass
public static void beforeClass() throws Throwable
{
public static void beforeClass() throws Throwable {
wasCalled(Cycle.BEFORE_CLASS);
}

@AfterClass
public static void afterClass() throws Throwable
{
public static void afterClass() throws Throwable {
wasCalled(Cycle.AFTER_CLASS);
}

@Before
public void before() throws Throwable
{
public void before() throws Throwable {
wasCalled(Cycle.BEFORE);
}

@After
public void after() throws Throwable
{
public void after() throws Throwable {
wasCalled(Cycle.AFTER);
}

@Test(expected = IllegalArgumentException.class)
public void shouldBeInvoked() throws Throwable
{
public void shouldBeInvoked() throws Throwable {
wasCalled(Cycle.TEST);
throw new IllegalArgumentException();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,9 @@
* @version $Revision: $
*/
@RunWith(MockitoJUnitRunner.class)
public class InitializationExceptionTestCase extends JUnitTestBaseClass
{
public class InitializationExceptionTestCase extends JUnitTestBaseClass {
@Test
public void shouldKeepInitializationExceptionBetweenTestCases() throws Exception
{
public void shouldKeepInitializationExceptionBetweenTestCases() throws Exception {
String exceptionMessage = "TEST_EXCEPTION_BEFORE_SUITE_FAILING";
TestRunnerAdaptor adaptor = mock(TestRunnerAdaptor.class);
doThrow(new Exception(exceptionMessage)).when(adaptor).beforeSuite();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ private void setAdaptor(TestRunnerAdaptor adaptor) throws Exception {
method.invoke(null, adaptor);
}

public enum Cycle

{
public enum Cycle {
BEFORE_CLASS_RULE, BEFORE_RULE, BEFORE_CLASS, BEFORE, TEST, AFTER, AFTER_CLASS, AFTER_RULE, AFTER_CLASS_RULE;

public static Cycle[] basics() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,7 @@ private void setAdaptor(TestRunnerAdaptor adaptor) throws Exception {
method.invoke(null, adaptor);
}

public enum Cycle

{
public enum Cycle {
BEFORE_CLASS, BEFORE, TEST, AFTER, AFTER_CLASS
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,7 @@ private static Collection<Method> filterBridgeMethods(Method... declaredMethods)
/**
* Single instance to get the TCCL
*/
private enum GetTcclAction implements PrivilegedAction<ClassLoader>

{
private enum GetTcclAction implements PrivilegedAction<ClassLoader> {
INSTANCE;

public ClassLoader run() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -324,14 +324,12 @@ private static Collection<Method> filterBridgeMethods(Method... declaredMethods)
/**
* Single instance to get the TCCL
*/
private enum GetTcclAction implements PrivilegedAction<ClassLoader>

{
private enum GetTcclAction implements PrivilegedAction<ClassLoader> {
INSTANCE;

public ClassLoader run() {
return Thread.currentThread().getContextClassLoader();
}

}
}
}
Loading

0 comments on commit ec818b9

Please sign in to comment.