anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: magefree/mage
Issue: Elvish House Party uses system-local time zone to determine current hour, which may not be the same between clients

The solution *should* be simple enough - specify a time zone when calling `.now()`. UTC is uncontroversial.[citation needed]

```java
class CurrentHourCount implements DynamicValue {

    @Override
    public int calculate(Game game, Ability sourceAbility, Effect effect) {
        int hour = LocalTime.now(ZoneId.of("UTC")).getHour();
        // convert 24-hour value to 12-hour
        if (hour > 12) {
            hour -= 12;
        }
        if (hour == 0) {
            hour = 12;
        }
        return hour;
    }

    @Override
    public DynamicValue copy() {
        return new CurrentHourCount();
    }

    @Override
    public String getMessage() {
        return "current hour, using the twelve-hour system";
    }
}
```

Changed files:
Mage.Sets/src/mage/cards/e/ElvishHouseParty.java

diff --git a/Mage.Sets/src/mage/cards/e/ElvishHouseParty.java b/Mage.Sets/src/mage/cards/e/ElvishHouseParty.java
index 95d6f79e7d..fc1dd34f33 100644
--- a/Mage.Sets/src/mage/cards/e/ElvishHouseParty.java
+++ b/Mage.Sets/src/mage/cards/e/ElvishHouseParty.java
@@ -2,6 +2,7 @@
 package mage.cards.e;
 
 import java.time.LocalTime;
+import java.time.ZoneId;
 import java.util.UUID;
 import mage.MageInt;
 import mage.abilities.Ability;
@@ -50,7 +51,7 @@ class CurrentHourCount implements DynamicValue {
 
     @Override
     public int calculate(Game game, Ability sourceAbility, Effect effect) {
-        int hour = LocalTime.now().getHour();
+        int hour = LocalTime.now(ZoneId.of("UTC")).getHour();
         // convert 24-hour value to 12-hour
         if (hour > 12) {
             hour -= 12;
Repository: magefree/mage
Issue: Orcish Spy's ability reveals cards in incorrect order

The point of using Orcish Spy is to have an inferior but repeatable effect for anticipating your draws, however there is no way to tell which card is on which library spot from the revealed cards. The order appears to be random.

Changed files:
Mage/src/main/java/mage/players/Library.java

diff --git a/Mage/src/main/java/mage/players/Library.java b/Mage/src/main/java/mage/players/Library.java
index e08aab6741..01c6e90f06 100644
--- a/Mage/src/main/java/mage/players/Library.java
+++ b/Mage/src/main/java/mage/players/Library.java
@@ -168,7 +168,7 @@ public class Library implements Serializable {
     }
 
     public Set<Card> getTopCards(Game game, int amount) {
-        Set<Card> cards = new HashSet<>();
+        Set<Card> cards = new LinkedHashSet<>();
         Iterator<UUID> it = library.iterator();
         int count = 0;
         while (it.hasNext() && count < amount) {