Skip to content

Commit

Permalink
style: improve code style (#4702)
Browse files Browse the repository at this point in the history
* cleanup imports
* update copyrights
* remove empty JavaDoc
* add missing curly braces
* fix whitespaces
* fix lines longer than 175 characters

Co-authored-by: Josephine Rueckert <jd.rueckert@googlemail.com>
  • Loading branch information
skaldarnar and jdrueckert authored May 24, 2021
1 parent ed2b293 commit 2d0c434
Show file tree
Hide file tree
Showing 1,089 changed files with 2,423 additions and 10,502 deletions.
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
/*
* Copyright 2017 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.engine;

import com.google.common.collect.Maps;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@

/**
* A base class for unit test classes to inherit to run in a Terasology environment - with LWJGL set up and so forth
*
*/
public abstract class TerasologyTestingEnvironment {
private static final Logger logger = LoggerFactory.getLogger(TerasologyTestingEnvironment.class);
Expand All @@ -60,7 +59,7 @@ public abstract class TerasologyTestingEnvironment {
@BeforeAll
public static void setupEnvironment(@TempDir Path tempHome) throws Exception {
PathManager.getInstance().useOverrideHomePath(tempHome);
Bullet.init(true,false);
Bullet.init(true, false);

/*
* Create at least for each class a new headless environment as it is fast and prevents side effects
Expand Down Expand Up @@ -95,12 +94,15 @@ public void setup() throws Exception {
context.put(CharacterStateEventPositionMap.class, characterStateEventPositionMap);
DirectionAndOriginPosRecorderList directionAndOriginPosRecorderList = new DirectionAndOriginPosRecorderList();
context.put(DirectionAndOriginPosRecorderList.class, directionAndOriginPosRecorderList);
RecordAndReplaySerializer recordAndReplaySerializer = new RecordAndReplaySerializer(engineEntityManager, recordedEventStore, recordAndReplayUtils, characterStateEventPositionMap, directionAndOriginPosRecorderList, moduleManager, context.get(TypeRegistry.class));
RecordAndReplaySerializer recordAndReplaySerializer = new RecordAndReplaySerializer(engineEntityManager,
recordedEventStore, recordAndReplayUtils, characterStateEventPositionMap,
directionAndOriginPosRecorderList, moduleManager, context.get(TypeRegistry.class));
context.put(RecordAndReplaySerializer.class, recordAndReplaySerializer);

Path savePath = PathManager.getInstance().getSavePath("world1");
context.put(StorageManager.class, new ReadWriteStorageManager(savePath, moduleManager.getEnvironment(),
engineEntityManager, mockBlockManager, extraDataManager, recordAndReplaySerializer, recordAndReplayUtils, recordAndReplayCurrentStatus));
engineEntityManager, mockBlockManager, extraDataManager, recordAndReplaySerializer,
recordAndReplayUtils, recordAndReplayCurrentStatus));

ComponentSystemManager componentSystemManager = new ComponentSystemManager(context);
context.put(ComponentSystemManager.class, componentSystemManager);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
/*
* Copyright 2017 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.engine;

import org.terasology.gestalt.naming.Name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class TestAutoConfig extends AutoConfig {
);

public final Setting<ImmutableList<Integer>> integerListSetting = setting(
type(new TypeInfo<ImmutableList<Integer>>() {}),
type(new TypeInfo<ImmutableList<Integer>>() { }),
defaultValue(ImmutableList.of())
);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
/*
* Copyright 2013 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0

package org.terasology.engine.testUtil;

Expand All @@ -34,8 +21,6 @@
import java.util.Collections;
import java.util.Map;

/**
*/
public class WorldProviderCoreStub implements WorldProviderCore {

private Map<Vector3ic, Block> blocks = Maps.newHashMap();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
/*
* Copyright 2013 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.engine.world.propagation;

import com.google.common.collect.Maps;
Expand All @@ -26,8 +13,6 @@

import java.util.Map;

/**
*/
public class StubPropagatorWorldView implements PropagatorWorldView {
private TObjectByteMap<Vector3ic> lightData = new TObjectByteHashMap<>();
private Map<Vector3ic, Block> blockData = Maps.newHashMap();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import org.terasology.engine.entitySystem.Component;
import org.terasology.engine.entitySystem.entity.EntityRef;

/**
*/
public class EntityRefComponent implements Component {

public EntityRef entityRef = EntityRef.NULL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import org.terasology.engine.entitySystem.Component;
import org.terasology.engine.world.block.ForceBlockActive;

/**
*/
@ForceBlockActive
public class ForceBlockActiveComponent implements Component {
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import org.joml.Vector3f;
import org.terasology.engine.entitySystem.Component;

/**
*/
public class GetterSetterComponent implements Component {
public transient boolean getterUsed;
public transient boolean setterUsed;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@

import org.terasology.engine.entitySystem.Component;

/**
*/
public final class IntegerComponent implements Component {
public int value;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import org.terasology.engine.entitySystem.Component;
import org.terasology.reflection.MappedContainer;

/**
*/
public class MappedTypeComponent implements Component {

public InnerType val = new InnerType();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import org.terasology.engine.entitySystem.Owns;
import org.terasology.engine.entitySystem.entity.EntityRef;

/**
*/
public class OwnerComponent implements Component {
@Owns
public EntityRef child = EntityRef.NULL;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
import org.terasology.engine.entitySystem.Component;
import org.terasology.engine.world.block.ForceBlockActive;

/**
*/
@ForceBlockActive(retainUnalteredOnBlockChange = true)
public class RetainedOnBlockChangeComponent implements Component {
public int value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
import org.terasology.engine.entitySystem.Component;
import org.terasology.engine.entitySystem.systems.internal.DoNotAutoRegister;

/**
*/
@DoNotAutoRegister
public class UnsupportedTypeComponent implements Component {
public UnsupportedType value;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
/*
* Copyright 2019 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.engine.config.flexible;

import com.google.common.collect.ImmutableList;
Expand Down Expand Up @@ -50,7 +37,7 @@ public void testGetSettingFieldsIn() {
);

assertEquals(
Sets.newHashSet(new TypeInfo<Setting<String>>() {}, new TypeInfo<Setting<ImmutableList<Integer>>>() {}),
Sets.newHashSet(new TypeInfo<Setting<String>>() { }, new TypeInfo<Setting<ImmutableList<Integer>>>() { }),
settingFields.stream().map(Field::getGenericType).map(TypeInfo::of).collect(Collectors.toSet())
);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
/*
* Copyright 2016 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.engine.config.flexible.constraints;

import org.junit.jupiter.api.Nested;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
/*
* Copyright 2015 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.documentation;

import com.google.common.collect.Multimaps;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
/*
* Copyright 2015 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.documentation;

import com.google.common.collect.ArrayListMultimap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
/*
* Copyright 2018 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.documentation.apiScraper;


Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
/*
* Copyright 2018 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.documentation.apiScraper;

import java.io.BufferedWriter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
/*
* Copyright 2018 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.documentation.apiScraper;

import com.google.common.collect.Multimap;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
/*
* Copyright 2018 MovingBlocks
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0
package org.terasology.documentation.apiScraper.util;


Expand Down
Loading

0 comments on commit 2d0c434

Please sign in to comment.