anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: micrometer-metrics/micrometer
Issue: Influx Metric Registry Publish Can Fail Silently

I had a bug in my logic to create timer metrics which passed in 'null' as one of the values of a tag. The next execution of the publish method would then throw a NullPointerException when invoking writeTimer. The exception wasn't handled in the publish method, bubbled back to the Executor which then failed silently and as result all no more metrics were ever sent.

Currently, the publish method implementation inside InfluxMetricRegistry only catches MalformedURLException and IOException ie.
```
        } catch (MalformedURLException e) {
            throw new IllegalArgumentException("Malformed InfluxDB publishing endpoint, see '" + config.prefix() + ".uri'", e);
        } catch (IOException e) {
            logger.warn("failed to send metrics", e);
        }
```

I am unsure of the best solution for this however I believe that the NullPointerException should be handled and the appropriate log message should be displayed. 

Changed files:
implementations/micrometer-registry-influx/src/main/java/io/micrometer/influx/InfluxMeterRegistry.java

diff --git a/implementations/micrometer-registry-influx/src/main/java/io/micrometer/influx/InfluxMeterRegistry.java b/implementations/micrometer-registry-influx/src/main/java/io/micrometer/influx/InfluxMeterRegistry.java
index 0e249361d..afe7db303 100644
--- a/implementations/micrometer-registry-influx/src/main/java/io/micrometer/influx/InfluxMeterRegistry.java
+++ b/implementations/micrometer-registry-influx/src/main/java/io/micrometer/influx/InfluxMeterRegistry.java
@@ -81,7 +81,7 @@ public class InfluxMeterRegistry extends StepMeterRegistry {
                             .lines().collect(joining("\\n")));
                 }
             }
-        } catch (IOException e) {
+        } catch (Throwable e) {
             logger.warn("unable to create database '{}'", config.db(), e);
         } finally {
             quietlyCloseUrlConnection(con);
Repository: crate/crate
Issue: `DECLARE CURSOR` requires superuser privileges 

### CrateDB version

5.1.1

### CrateDB setup information

local / cloud logged in as non-superuser with `ALL` privileges on `cluster` level

### Steps to Reproduce

```sql
BEGIN;
DECLARE this_cursor NO SCROLL CURSOR FOR SELECT * FROM sys.summits;
END;
```

### Expected Result

Cursor is created

### Actual Result

```
UnauthorizedException[User "admin" is not authorized to execute the statement. Superuser permissions are required]
```

Changed files:
server/src/test/java/io/crate/auth/AccessControlMayExecuteTest.java, server/src/main/java/io/crate/auth/AccessControlImpl.java

diff --git a/server/src/main/java/io/crate/auth/AccessControlImpl.java b/server/src/main/java/io/crate/auth/AccessControlImpl.java
index 8a00969d67..4f5a179573 100644
--- a/server/src/main/java/io/crate/auth/AccessControlImpl.java
+++ b/server/src/main/java/io/crate/auth/AccessControlImpl.java
@@ -46,6 +46,7 @@ import io.crate.analyze.AnalyzedCreateTable;
 import io.crate.analyze.AnalyzedCreateTableAs;
 import io.crate.analyze.AnalyzedCreateUser;
 import io.crate.analyze.AnalyzedDeallocate;
+import io.crate.analyze.AnalyzedDeclare;
 import io.crate.analyze.AnalyzedDeleteStatement;
 import io.crate.analyze.AnalyzedDiscard;
 import io.crate.analyze.AnalyzedDropFunction;
@@ -264,6 +265,12 @@ public final class AccessControlImpl implements AccessControl {
             return null;
         }
 
+        @Override
+        public Void visitDeclare(AnalyzedDeclare declare, User user) {
+            declare.query().accept(this, user);
+            return null;
+        }
+
         @Override
         public Void visitSwapTable(AnalyzedSwapTable swapTable, User user) {
             if (!user.hasPrivilege(Privilege.Type.AL, Privilege.Clazz.CLUSTER, null, defaultSchema)) {
diff --git a/server/src/test/java/io/crate/auth/AccessControlMayExecuteTest.java b/server/src/test/java/io/crate/auth/AccessControlMayExecuteTest.java
index db05561b15..878789a202 100644
--- a/server/src/test/java/io/crate/auth/AccessControlMayExecuteTest.java
+++ b/server/src/test/java/io/crate/auth/AccessControlMayExecuteTest.java
@@ -700,4 +700,10 @@ public class AccessControlMayExecuteTest extends CrateDummyClusterServiceUnitTes
         analyze("ANALYZE", user);
         assertAskedForCluster(Privilege.Type.AL);
     }
+
+    @Test
+    public void test_declare_cursor_for_non_super_users() {
+        analyze("DECLARE this_cursor NO SCROLL CURSOR FOR SELECT * FROM sys.summits;", user);
+        assertAskedForTable(Privilege.Type.DQL, "sys.summits");
+    }
 }
Repository: kestra-io/kestra
Issue: Simplify `EachParallel` with `WorkingDirectory` child tasks

### Issue description

This flow works:

```yaml
id: reproducer
namespace: dev

tasks:
  - id: parallel
    type: io.kestra.core.tasks.flows.EachParallel
    value: ["1", "2", "3", "4", "5", "6"]
    tasks:
      - id: seq
        type: io.kestra.core.tasks.flows.Sequential
        tasks:
        - id: pythonScripts
          type: io.kestra.core.tasks.flows.WorkingDirectory
          tasks:
            - id: cloneRepository
              type: io.kestra.plugin.git.Clone
              url: https://github.com/kestra-io/scripts
              branch: main
            - id: python
              type: io.kestra.plugin.scripts.python.Commands
              runner: DOCKER
              docker:
                image: ghcr.io/kestra-io/pydata:latest
              commands:
                - python etl/parametrized.py {{ parents[0].taskrun.value }}
```

however, it seems that it should already work without having to add the `Sequential` task, because `WorkingDirectory` already runs everything sequentially. However, without Sequential, the `taskrun.value` cannot be accessed:

```yaml
id: reproducer
namespace: dev

tasks:
  - id: parallel
    type: io.kestra.core.tasks.flows.EachParallel
    value: ["1", "2", "3", "4", "5", "6"]
    tasks:
      - id: pythonScripts
        type: io.kestra.core.tasks.flows.WorkingDirectory
        tasks:
          - id: cloneRepository
            type: io.kestra.plugin.git.Clone
            url: https://github.com/kestra-io/scripts
            branch: main
          - id: python
            type: io.kestra.plugin.scripts.python.Commands
            runner: DOCKER
            docker:
              image: ghcr.io/kestra-io/pydata:latest
            commands:
              - python etl/parametrized.py {{ taskrun.value }}
```

this gives - `Missing variable: 'value' on 'python etl/parametrized.py {{ taskrun.value }}' at line 1`

cc @loicmathieu 

Changed files:
core/src/main/java/io/kestra/core/tasks/flows/WorkingDirectory.java

diff --git a/core/src/main/java/io/kestra/core/tasks/flows/WorkingDirectory.java b/core/src/main/java/io/kestra/core/tasks/flows/WorkingDirectory.java
index ffbb49d2..77b7a0b2 100644
--- a/core/src/main/java/io/kestra/core/tasks/flows/WorkingDirectory.java
+++ b/core/src/main/java/io/kestra/core/tasks/flows/WorkingDirectory.java
@@ -166,6 +166,7 @@ public class WorkingDirectory extends Sequential {
                 .flowId(parent.getFlowId())
                 .taskId(task.getId())
                 .parentTaskRunId(parent.getId())
+                .value(parent.getValue()) // copy parent value so that it can be used with existing flowable tasks easily
                 .state(new State())
                 .build()
             )
Repository: movingblocks/terasology
Issue: OpenGL Line Width Warning

When hovering over anything that creates a hitbox outline, the following error gets printed out every tick:

`[main] WARN  OpenGL - [api] [deprecated] API_ID_LINE_WIDTH deprecated behavior warning has been generated. Wide lines have been deprecated. glLineWidth set to 2.000000. glLineWidth with width greater than 1.0 will generate GL_INVALID_VALUE error in future versions`

This is due to several `glLineWidth` calls where the parameter is 2 (unsurprisingly). This means the fix is very simply just changing these calls to use 1 instead.

Changed files:
engine/src/main/java/org/terasology/logic/players/LocalPlayerSystem.java, engine/src/main/java/org/terasology/rendering/logic/RegionOutlineRenderer.java, engine/src/main/java/org/terasology/rendering/logic/SkeletonRenderer.java

diff --git a/engine/src/main/java/org/terasology/logic/players/LocalPlayerSystem.java b/engine/src/main/java/org/terasology/logic/players/LocalPlayerSystem.java
index 329a431d8..d2052c7c7 100644
--- a/engine/src/main/java/org/terasology/logic/players/LocalPlayerSystem.java
+++ b/engine/src/main/java/org/terasology/logic/players/LocalPlayerSystem.java
@@ -399,7 +399,7 @@ public void renderOverlay() {
         if (config.getRendering().isRenderPlacingBox()) {
             if (aabb != null) {
                 aabbRenderer.setAABB(aabb);
-                aabbRenderer.render(2f);
+                aabbRenderer.render(1f);
             }
         }
     }
diff --git a/engine/src/main/java/org/terasology/rendering/logic/RegionOutlineRenderer.java b/engine/src/main/java/org/terasology/rendering/logic/RegionOutlineRenderer.java
index fd2233ceb..726acb32e 100644
--- a/engine/src/main/java/org/terasology/rendering/logic/RegionOutlineRenderer.java
+++ b/engine/src/main/java/org/terasology/rendering/logic/RegionOutlineRenderer.java
@@ -96,7 +96,7 @@ public void renderOverlay() {
             return; // skip everything if there is nothing to do to avoid possibly costly draw mode changes
         }
         glDisable(GL_DEPTH_TEST);
-        glLineWidth(2);
+        glLineWidth(1);
         Vector3f cameraPosition = worldRenderer.getActiveCamera().getPosition();
 
         FloatBuffer tempMatrixBuffer44 = BufferUtils.createFloatBuffer(16);
diff --git a/engine/src/main/java/org/terasology/rendering/logic/SkeletonRenderer.java b/engine/src/main/java/org/terasology/rendering/logic/SkeletonRenderer.java
index 1b5812169..3648d92ad 100644
--- a/engine/src/main/java/org/terasology/rendering/logic/SkeletonRenderer.java
+++ b/engine/src/main/java/org/terasology/rendering/logic/SkeletonRenderer.java
@@ -312,7 +312,7 @@ public void renderOverlay() {
             material.setFloat("sunlight", 1.0f, true);
             material.setFloat("blockLight", 1.0f, true);
             material.setMatrix4("projectionMatrix", worldRenderer.getActiveCamera().getProjectionMatrix());
-            glLineWidth(2);
+            glLineWidth(1);
             Vector3f worldPos = new Vector3f();
Repository: movingblocks/terasology
Issue: Terrible things happen when starting a _second_ game without a game restart

### What you were trying to do

Test unrelated things! Which sometimes involve jumping into more than one world.

### What actually happened

Inconsistently would get warped worlds with messed up data, from broken chunks to entirely messed up block data (hills of torches, pure water world, etc)

### How to reproduce

This is the minimal use case I could consistently reproduce real quick

* Step 0: (Unsure if needed: start from a clean game, no saves or config)
* Step 1: Start the game from source, create a new game, pick Core, quick start
* Step 2: Verify all looks well, exit back to the main menu
* Step 3: Create a new game, pick Core, quick start - bad things happen

Similar issues have happened in the past (malformed block ids through some scenario), but I thought they were all long gone. Game state handling between multiple games in one game launch has remained a fragile area, however. Chances are something isn't being reset properly when leaving the first game world.

Changed files:
engine/src/main/java/org/terasology/rendering/nui/widgets/UIText.java

diff --git a/engine/src/main/java/org/terasology/rendering/nui/widgets/UIText.java b/engine/src/main/java/org/terasology/rendering/nui/widgets/UIText.java
index 609681bef..40fc96c2e 100644
--- a/engine/src/main/java/org/terasology/rendering/nui/widgets/UIText.java
+++ b/engine/src/main/java/org/terasology/rendering/nui/widgets/UIText.java
@@ -17,6 +17,7 @@
 
 import com.google.common.base.Preconditions;
 import com.google.common.collect.Lists;
+import com.google.common.collect.ObjectArrays;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.terasology.input.Keyboard;
@@ -677,15 +678,7 @@ public void bindText(Binding<String> binding) {
      * contents of linesOfText or text accordingly.
      */
     public String getText() {
-        String arrayText = "";
-        if(linesOfText.length > 0) {
-            arrayText = String.join("\\n", linesOfText);
-        }
-
-        if(text.get() != "") {
-            return text.get() + "\\n" + arrayText;
-        }
-        return text.get() + arrayText;
+        return String.join("\\n", ObjectArrays.concat(text.get(), linesOfText));
     }
 
     /**
Repository: movingblocks/terasology
Issue: Can't run game with "./gradlew game"

I create local repo on my machine. Follow instructions, but if I try do **./gradlew game** i see this:

**java.lang.RuntimeException: java.util.concurrent.ExecutionException: org.reflections.ReflectionsException: could not create Vfs.Dir from url, no matching UrlType was found [file:/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/ext/libatk-wrapper.so]
either use fromURL(final URL url, final List<UrlType> urlTypes) or use the static setDefaultURLTypes(final List<UrlType> urlTypes) or addDefaultURLTypes(UrlType urlType) with your specialized UrlType.**

Logs file here

[Terasology-init.log](https://github.com/MovingBlocks/Terasology/files/3665893/Terasology-init.log)

And, i think, that's my another problem, but i hope u can help. If I try run any build in my IDEA, i see this:

**Exception in thread "main" java.lang.IllegalArgumentException: input == null!
	at javax.imageio.ImageIO.read(ImageIO.java:1394)
	at org.terasology.splash.overlay.ImageOverlay.<init>(ImageOverlay.java:38)
	at org.terasology.splash.overlay.TriggerImageOverlay.<init>(TriggerImageOverlay.java:30)
	at org.terasology.engine.Terasology.configureSplashScreen(Terasology.java:206)
	at org.terasology.engine.Terasology.main(Terasology.java:125)**


OS - Ubuntu 18.04.3 LTS 

java -version
openjdk version "1.8.0_222"
OpenJDK Runtime Environment (build 1.8.0_222-8u222-b10-1ubuntu1~18.04.1-b10)
OpenJDK 64-Bit Server VM (build 25.222-b10, mixed mode)







Changed files:
engine/src/main/java/org/terasology/reflection/TypeRegistry.java

diff --git a/engine/src/main/java/org/terasology/reflection/TypeRegistry.java b/engine/src/main/java/org/terasology/reflection/TypeRegistry.java
index 78c1d801a..ecd1d42e6 100644
--- a/engine/src/main/java/org/terasology/reflection/TypeRegistry.java
+++ b/engine/src/main/java/org/terasology/reflection/TypeRegistry.java
@@ -110,7 +110,6 @@ private void initializeReflections(ClassLoader classLoader) {
                         .toArray(ClassLoader[]::new)
                 ))
                 .filterInputsBy(TypeRegistry::filterWhitelistedTypes)
-                .useParallelExecutor()
         );
 
     }
Repository: movingblocks/terasology
Issue: Trees in JoshariasSurvival are broken, yet same worldgen in plain Core is fine. BiomesAPI quirk?

Also happens if you use the Shattered Planes worldgen. Trees just have trunk pieces, no leaf blocks.

Happened relatively recently, the closest guess I have is that it happened with the BiomesAPI thing where we also lost the hue on leaf/grass blocks temporarily until a better redo later?

Changed files:
modules/Core/src/main/java/org/terasology/core/world/generator/rasterizers/TreeRasterizer.java

diff --git a/modules/Core/src/main/java/org/terasology/core/world/generator/rasterizers/TreeRasterizer.java b/modules/Core/src/main/java/org/terasology/core/world/generator/rasterizers/TreeRasterizer.java
index a445fd679..5b6654325 100644
--- a/modules/Core/src/main/java/org/terasology/core/world/generator/rasterizers/TreeRasterizer.java
+++ b/modules/Core/src/main/java/org/terasology/core/world/generator/rasterizers/TreeRasterizer.java
@@ -43,6 +43,15 @@ public class TreeRasterizer implements WorldRasterizer {
     @Override
     public void initialize() {
         blockManager = CoreRegistry.get(BlockManager.class);
+        //TODO: Remove these lines when lazy block registration is fixed
+        //Currently they are required to ensure that the blocks are all registered before worldgen
+        blockManager.getBlock("CoreBlocks:OakTrunk");
+        blockManager.getBlock("CoreBlocks:PineTrunk");
+        blockManager.getBlock("CoreBlocks:BirchTrunk");
+        blockManager.getBlock("CoreBlocks:GreenLeaf");
+        blockManager.getBlock("CoreBlocks:DarkLeaf");
+        blockManager.getBlock("CoreBlocks:RedLeaf");
+        blockManager.getBlock("CoreBlocks:Cactus");
     }
 
     @Override
Repository: movingblocks/terasology
Issue: Error Dialog cannot be closed

# What you were trying to do
Close the error dialog coming up on starting a game whilst having dependency issues underneath.

### What actually happened
The "Ok" button is not clickable. It's also not greyed out or anything, but if I click on it, simply nothing happens.

### How to reproduce
* Create and save a game and exit Terasology (e.g. LaS)
* Enforce a dependency issue for some module used in the game (e.g. adapt dependency version of LaS dependency)
* Try to load the game (should result in an error dialog popping up)
* Try to click the "Ok" button


Changed files:
engine/src/main/java/org/terasology/input/InputSystem.java

diff --git a/engine/src/main/java/org/terasology/input/InputSystem.java b/engine/src/main/java/org/terasology/input/InputSystem.java
index 4a25ee0cd..4436af65f 100644
--- a/engine/src/main/java/org/terasology/input/InputSystem.java
+++ b/engine/src/main/java/org/terasology/input/InputSystem.java
@@ -155,8 +155,8 @@ private void updateInputEntities() {
                 || inputEntities.length != 2
                 || inputEntities[0] == null
                 || inputEntities[1] == null
-                || !inputEntities[0].equals(localPlayer.getClientEntity())
-                || !inputEntities[1].equals(localPlayer.getCharacterEntity())) {
+                || inputEntities[0] != localPlayer.getClientEntity()
+                || inputEntities[1] != localPlayer.getCharacterEntity()) {
             inputEntities = new EntityRef[]{localPlayer.getClientEntity(), localPlayer.getCharacterEntity()};
         }
     }
Repository: movingblocks/terasology
Issue: Unplugging joystick leads to crash

### What you were trying to do
* I tried unplugging my joystick by pulling the cord

### What actually happened

* My joystick got unplugged as planned
* Terasology crashed in a way not planned at all

### How to reproduce

* Step 1: Use a joystick
* Step 2: Pull the cord
* Step 3: No profit

### Log details and game version

https://pastebin.com/vKT69jL3

### Computer details

* In the logfile. More info on request. 


Changed files:
engine/src/main/java/org/terasology/input/lwjgl/JInputControllerDevice.java

diff --git a/engine/src/main/java/org/terasology/input/lwjgl/JInputControllerDevice.java b/engine/src/main/java/org/terasology/input/lwjgl/JInputControllerDevice.java
index 83c40910d..5d147734c 100644
--- a/engine/src/main/java/org/terasology/input/lwjgl/JInputControllerDevice.java
+++ b/engine/src/main/java/org/terasology/input/lwjgl/JInputControllerDevice.java
@@ -46,6 +46,7 @@
 import java.util.Map;
 import java.util.Queue;
 import java.util.Set;
+import java.util.concurrent.CopyOnWriteArrayList;
 
 /**
  * Retrieves information on connected controllers through JInput.
@@ -72,7 +73,8 @@ public class JInputControllerDevice implements ControllerDevice {
             .build();
 
     private ControllerConfig config;
-    private final List<Controller> controllers = new ArrayList<>();
+    /* MUST be a CopyOnWriteArrayList! Or else you just get crashes when unplugging controllers. */
+    private final List<Controller> controllers = new CopyOnWriteArrayList<>();
 
     public JInputControllerDevice(ControllerConfig config) {
         this.config = config;
Repository: movingblocks/terasology
Issue: Server connection test updates actively selected server not the origin server

### What you were trying to do

Look at servers accurately on the Join Game screen showing multiple servers

### What actually happened

Clicked a bad server (offline) first by accident, then selected a working server. When the failed ping test came back from the bad server it showed the result (being unable to connect to the server) on the good server, despite the other stats showing online and all is well.

Some threaded check holding that call probably needs to pick its update target better. Maybe at present it just updates the field regardless of the selected server, when perhaps it should be a call-back with the specific server queried? And if that isn't visible /selected then don't show it. 

### How to reproduce

* Make sure there's both a working and not-working server in the join game list
* Select the broken server (should start a server query that'll time out)
* Quickly select a working server and wait a second or two, the connection to the good server will show that it "failed"

Changed files:
engine/src/main/java/org/terasology/rendering/nui/layers/mainMenu/JoinGameScreen.java

diff --git a/engine/src/main/java/org/terasology/rendering/nui/layers/mainMenu/JoinGameScreen.java b/engine/src/main/java/org/terasology/rendering/nui/layers/mainMenu/JoinGameScreen.java
index 8948a88be..ab0562a63 100644
--- a/engine/src/main/java/org/terasology/rendering/nui/layers/mainMenu/JoinGameScreen.java
+++ b/engine/src/main/java/org/terasology/rendering/nui/layers/mainMenu/JoinGameScreen.java
@@ -473,6 +473,7 @@ private String getModulesText(Future<ServerInfoMessage> info) {
     private void refreshPing() {
         String address = visibleList.getSelection().getAddress();
         int port = visibleList.getSelection().getPort();
+        String name = visibleList.getSelection().getName();
         UILabel ping = find("ping", UILabel.class);
         ping.setText("Requested");
 
@@ -486,6 +487,8 @@ private void refreshPing() {
                 }
             } catch (IOException e) {
                 String text = translationSystem.translate("${engine:menu#connection-failed}");
+                // Check if selection name is same as earlier when response is received before updating ping field
+                if (name.equals(visibleList.getSelection().getName()))
                 GameThread.asynch(() -> ping.setText(FontColor.getColored(text, Color.RED)));
             }
         });
Repository: movingblocks/terasology
Issue: Breaking blocks in SampleBuilderGameplay doesn't work right

### What you were trying to do

Test Alpha 8 - SampleBuilderGameplay world

* Left click should remove a block without any drops and "select" that block type
* Right click should place a block of whatever selected type

### What actually happened

Right click is fine. But Left click fails to remove a block and instead a physics-cube pops out and flies off to the side, one per click.

Probably some change to how block drops are handled in the engine caused this?

### How to reproduce

* Run the game and pick BuilderSampleGameplay plus its world
* Try to break any block (left click)
* See the block not disappear, yet a new physics-enabled cube pops out and bounces around

High priority issue since it effectively breaks the BSG template.

Changed files:
engine/src/main/java/org/terasology/world/block/entity/BlockEntitySystem.java

diff --git a/engine/src/main/java/org/terasology/world/block/entity/BlockEntitySystem.java b/engine/src/main/java/org/terasology/world/block/entity/BlockEntitySystem.java
index 6e137b721..f77d0abd6 100644
--- a/engine/src/main/java/org/terasology/world/block/entity/BlockEntitySystem.java
+++ b/engine/src/main/java/org/terasology/world/block/entity/BlockEntitySystem.java
@@ -159,8 +159,11 @@ private void commonDestroyed(DoDestroyEvent event, EntityRef entity, Block block
             // dust particle effect
             if (entity.hasComponent(LocationComponent.class) && block.isDebrisOnDestroy()) {
                 EntityBuilder dustBuilder = entityManager.newBuilder("core:dustEffect");
-                dustBuilder.getComponent(LocationComponent.class).setWorldPosition(entity.getComponent(LocationComponent.class).getWorldPosition());
-                dustBuilder.build();
+                // TODO: particle system stuff should be split out better - this is effectively a stealth dependency on Core from the engine
+                if (dustBuilder.hasComponent(LocationComponent.class)) {
+                    dustBuilder.getComponent(LocationComponent.class).setWorldPosition(entity.getComponent(LocationComponent.class).getWorldPosition());
+                    dustBuilder.build();
+                }
             }
 
             // sound to play for destroyed block
Repository: immutables/immutables
Issue: -Werror compiler warning for unchecked casts for java.util.Optional

Issue #723 still occurs for java.util.Optional with using the -Werror compiler option.

Changed files:
value-processor/src/org/immutables/value/processor/meta/ValueAttribute.java

diff --git a/value-processor/src/org/immutables/value/processor/meta/ValueAttribute.java b/value-processor/src/org/immutables/value/processor/meta/ValueAttribute.java
index e061a57d..6eeaab53 100644
--- a/value-processor/src/org/immutables/value/processor/meta/ValueAttribute.java
+++ b/value-processor/src/org/immutables/value/processor/meta/ValueAttribute.java
@@ -1050,7 +1050,6 @@ public final class ValueAttribute extends TypeIntrospectionBase implements HasSt
 
   public boolean isSafeUncheckedCovariantCast() {
     return isOptionalType()
-        && !isJdkOptional()
         && !getConsumedElementType().equals(getWrappedElementType());
   }