Skip to content

Commit

Permalink
chore: upgrade guava to 30.1 from 23.0 (#4557)
Browse files Browse the repository at this point in the history
  • Loading branch information
keturn authored Mar 5, 2021
1 parent 0a6cee9 commit b63fa50
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 60 deletions.
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.rendering.nui.layers.mainMenu.savedGames;

import com.google.common.base.Charsets;
Expand Down Expand Up @@ -78,7 +65,6 @@ public static void init()

final File file = new File(GameProviderTest.class.getClassLoader().getResource(GAME_MANIFEST_JSON).getFile());
try {
//noinspection UnstableApiUsage
MANIFEST_EXAMPLE = com.google.common.io.Files.asCharSource(file, Charsets.UTF_8).read();
} catch (IOException e) {
fail("Could not load input file");
Expand Down
2 changes: 1 addition & 1 deletion engine/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ configurations {
// Primary dependencies definition
dependencies {
// Storage and networking
api group: 'com.google.guava', name: 'guava', version: '23.0'
api group: 'com.google.guava', name: 'guava', version: '30.1-jre'
api group: 'com.google.code.gson', name: 'gson', version: '2.8.6'
api group: 'net.sf.trove4j', name: 'trove4j', version: '3.0.3'
implementation group: 'io.netty', name: 'netty-all', version: '4.1.53.Final'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ private static void registerComponents(ComponentLibrary library, ModuleEnvironme
for (Class<? extends Component> componentType : environment.getSubtypesOf(Component.class)) {
if (componentType.getAnnotation(DoNotAutoRegister.class) == null) {
String componentName = MetadataUtil.getComponentClassName(componentType);
//noinspection UnstableApiUsage
Name componentModuleName = verifyNotNull(environment.getModuleProviding(componentType), "Could not find module for %s %s", componentName, componentType);
library.register(new ResourceUrn(componentModuleName.toString(), componentName), componentType);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,6 @@ private static void registerComponents(ComponentLibrary library, ModuleEnvironme
for (Class<? extends Component> componentType : environment.getSubtypesOf(Component.class)) {
if (componentType.getAnnotation(DoNotAutoRegister.class) == null) {
String componentName = MetadataUtil.getComponentClassName(componentType);
//noinspection UnstableApiUsage
Name componentModuleName = verifyNotNull(environment.getModuleProviding(componentType), "Could not find module for %s %s", componentName, componentType);
library.register(new ResourceUrn(componentModuleName.toString(), componentName), componentType);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ public void addPrefab(Prefab prefab) {
if (prefab != null) {
for (Component component : prefab.iterateComponents()) {
Component componentCopy = entityManager.getComponentLibrary().copy(component);
//noinspection UnstableApiUsage
addComponent(verifyNotNull(componentCopy, "Component %s not registered (in prefab %s)", component, prefab));
}
addComponent(new EntityInfoComponent(prefab, prefab.isPersisted(), prefab.isAlwaysRelevant()));
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.entitySystem.event.internal;

import com.esotericsoftware.reflectasm.MethodAccess;
Expand Down Expand Up @@ -117,7 +104,7 @@ public void process() {
public void registerEvent(SimpleUri uri, Class<? extends Event> eventType) {
eventIdMap.put(uri, eventType);
logger.debug("Registering event {}", eventType.getSimpleName());
for (Class parent : ReflectionUtils.getAllSuperTypes(eventType, Predicates.assignableFrom(Event.class))) {
for (Class parent : ReflectionUtils.getAllSuperTypes(eventType, Predicates.subtypeOf(Event.class))) {
if (!AbstractConsumableEvent.class.equals(parent) && !Event.class.equals(parent)) {
childEvents.put(parent, eventType);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,7 @@
/*
* 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.recording;

import org.terasology.assets.ResourceUrn;
import org.terasology.engine.paths.PathManager;
import org.terasology.entitySystem.entity.internal.EngineEntityManager;
import org.terasology.entitySystem.event.internal.EventReceiver;
import org.terasology.entitySystem.event.internal.EventSystem;
import com.esotericsoftware.reflectasm.MethodAccess;
import com.google.common.base.Objects;
import com.google.common.base.Predicates;
Expand All @@ -35,15 +17,20 @@
import org.reflections.ReflectionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.terasology.assets.ResourceUrn;
import org.terasology.engine.SimpleUri;
import org.terasology.engine.paths.PathManager;
import org.terasology.entitySystem.Component;
import org.terasology.entitySystem.entity.EntityRef;
import org.terasology.entitySystem.entity.internal.EngineEntityManager;
import org.terasology.entitySystem.event.AbstractConsumableEvent;
import org.terasology.entitySystem.event.ConsumableEvent;
import org.terasology.entitySystem.event.Event;
import org.terasology.entitySystem.event.EventPriority;
import org.terasology.entitySystem.event.ReceiveEvent;
import org.terasology.entitySystem.event.PendingEvent;
import org.terasology.entitySystem.event.ReceiveEvent;
import org.terasology.entitySystem.event.internal.EventReceiver;
import org.terasology.entitySystem.event.internal.EventSystem;
import org.terasology.entitySystem.metadata.EventLibrary;
import org.terasology.entitySystem.metadata.EventMetadata;
import org.terasology.entitySystem.systems.ComponentSystem;
Expand Down Expand Up @@ -284,7 +271,7 @@ private EntityRef getEntityRef(RecordedEvent recordedEvent) {
public void registerEvent(SimpleUri uri, Class<? extends Event> eventType) {
eventIdMap.put(uri, eventType);
logger.debug("Registering event {}", eventType.getSimpleName());
for (Class parent : ReflectionUtils.getAllSuperTypes(eventType, Predicates.assignableFrom(Event.class))) {
for (Class parent : ReflectionUtils.getAllSuperTypes(eventType, Predicates.subtypeOf(Event.class))) {
if (!AbstractConsumableEvent.class.equals(parent) && !Event.class.equals(parent)) {
childEvents.put(parent, eventType);
}
Expand Down
4 changes: 2 additions & 2 deletions facades/TeraEd/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 The Terasology Foundation
// Copyright 2021 The Terasology Foundation
// SPDX-License-Identifier: Apache-2.0

// The Editor facade is responsible for the (shader) editor - a plain Java application runnable on PCs
Expand Down Expand Up @@ -40,7 +40,7 @@ dependencies {
}
implementation "org.lwjgl:lwjgl-jawt"

implementation(group: 'com.google.guava', name: 'guava', version: '23.0')
implementation(group: 'com.google.guava', name: 'guava', version: '30.1-jre')

implementation(project(":subsystems:DiscordRPC"))
implementation(project(":subsystems:TypeHandlerLibrary"))
Expand Down

0 comments on commit b63fa50

Please sign in to comment.