nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: orika-mapper/orika
Pull request #273 (2018-07-10 22:37:17)

 bump version for javassist and easymock 
update javassist to 3.23.1-GA
update easymock to 3.6
add required cast needed for javassist update


Patch:
diff --git a/pom.xml b/pom.xml
index 4b617400..e4c8dcfd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -54,11 +54,11 @@
 
     <properties>
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
-        <javassist.version>3.22.0-GA</javassist.version>
+        <javassist.version>3.23.1-GA</javassist.version>
         <springframework.version>4.3.14.RELEASE</springframework.version>
         <hibernate.version>5.0.12.Final</hibernate.version>
         <junit.version>4.12</junit.version>
-        <easymock.version>3.5.1</easymock.version>
+        <easymock.version>3.6</easymock.version>
         <h2.version>1.4.196</h2.version>
         <slf4j.version>1.7.25</slf4j.version>
         <paranamer.version>2.8</paranamer.version>


Test patch:
diff --git a/tests/src/main/java/ma/glasnost/orika/test/DynamicSuite.java b/tests/src/main/java/ma/glasnost/orika/test/DynamicSuite.java
index 56fbbf2a..24a836ed 100644
--- a/tests/src/main/java/ma/glasnost/orika/test/DynamicSuite.java
+++ b/tests/src/main/java/ma/glasnost/orika/test/DynamicSuite.java
@@ -419,7 +419,7 @@ public class DynamicSuite extends ParentRunner<Runner> {
 								constructor
 										.setBody("{ super($1); this.scenarioName = $2; }");
 								subClass.addConstructor(constructor);
-								proxyClass = subClass.toClass();
+								proxyClass = (Class<? extends Runner>)subClass.toClass();
 
 							}
 						}
Repository: orika-mapper/orika
Pull request #315 (2019-03-16 15:28:57)

Issue314TestCase and override exclude method


Patch:
diff --git a/core/src/main/java/ma/glasnost/orika/metadata/ClassMapBuilderForMaps.java b/core/src/main/java/ma/glasnost/orika/metadata/ClassMapBuilderForMaps.java
index 1d0036fc..045b76ac 100644
--- a/core/src/main/java/ma/glasnost/orika/metadata/ClassMapBuilderForMaps.java
+++ b/core/src/main/java/ma/glasnost/orika/metadata/ClassMapBuilderForMaps.java
@@ -133,6 +133,23 @@ public class ClassMapBuilderForMaps<A, B> extends ClassMapBuilder<A,B> {
         return self();
     }
 
+    /**
+     * Exclude the specified field from bean mapping
+     * 
+     * @param fieldName
+     *            the name of the field/property to exclude
+     * @return this ClassMapBuilder
+     */
+    @Override
+    public ClassMapBuilder<A, B> exclude(String fieldName) {
+    	Type<?> type = isATypeBean() ? getAType() : getBType();
+    	if(getPropertyResolver().existsProperty(type, fieldName)) {
+    		 return fieldMap(fieldName).exclude().add();
+    	}else {
+    		return this;
+    	}
+    }
+    
     /**
      * Gets the parent expression from this nested expression
      * 


Test patch:
diff --git a/tests/src/main/java/ma/glasnost/orika/test/community/Issue314TestCase.java b/tests/src/main/java/ma/glasnost/orika/test/community/Issue314TestCase.java
new file mode 100644
index 00000000..41b4b569
--- /dev/null
+++ b/tests/src/main/java/ma/glasnost/orika/test/community/Issue314TestCase.java
@@ -0,0 +1,56 @@
+package ma.glasnost.orika.test.community;
+
+import static org.junit.Assert.assertNull;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.junit.Test;
+
+import ma.glasnost.orika.impl.DefaultMapperFactory;
+
+/**
+ * ClassMapBuilderForMaps class exclude method Does not work
+ * <p>
+ * 
+ * @see <a href=
+ *      "https://github.com/orika-mapper/orika/issues/314">https://github.com/orika-mapper/orika/issues</a>
+ */
+public class Issue314TestCase {
+
+	@Test
+	public void exclude_classMapBuilderForMaps() {
+
+		DefaultMapperFactory mapperFactory = new DefaultMapperFactory.Builder().build();
+		mapperFactory.classMap(Map.class, B.class).exclude("b").byDefault().register();
+
+		Map<String, Object> map = new HashMap<String, Object>();
+		map.put("a", "a");
+		map.put("b", "b");
+
+		B b = mapperFactory.getMapperFacade().map(map, B.class);
+		assertNull(b.getB());
+	}
+
+	public static class B {
+		private String a;
+		private String b;
+
+		public String getA() {
+			return a;
+		}
+
+		public void setA(String a) {
+			this.a = a;
+		}
+
+		public String getB() {
+			return b;
+		}
+
+		public void setB(String b) {
+			this.b = b;
+		}
+	}
+
+}
Repository: orika-mapper/orika
Pull request #323 (2019-08-06 04:25:36)

Fix issue 322
Fix issue 322


Patch:
diff --git a/core/src/main/java/ma/glasnost/orika/impl/generator/specification/Convert.java b/core/src/main/java/ma/glasnost/orika/impl/generator/specification/Convert.java
index 9722eace..0a07956a 100644
--- a/core/src/main/java/ma/glasnost/orika/impl/generator/specification/Convert.java
+++ b/core/src/main/java/ma/glasnost/orika/impl/generator/specification/Convert.java
@@ -54,7 +54,7 @@ public class Convert extends AbstractSpecification {
             if (destination.type().isPrimitive() && source.type().isPrimitive()) {
                 return format("(%s == %s)", destination, source);
             } else if (destination.type().isPrimitive()) {
-                return format("(%s != null && %s == %s.%sValue())", source, destination, source, source.type().getName());
+                return format("(%s != null && %s == %s.%sValue())", source, destination, source, destination.type().getName());
             } else if (source.type().isPrimitive()) {
                 return format("(%s != null && %s.%sValue() == %s)", destination, destination, destination.type()
                         .getPrimitiveType()


Test patch:
diff --git a/tests/src/main/java/ma/glasnost/orika/test/community/Issue322TestCase.java b/tests/src/main/java/ma/glasnost/orika/test/community/Issue322TestCase.java
new file mode 100644
index 00000000..e02b26c3
--- /dev/null
+++ b/tests/src/main/java/ma/glasnost/orika/test/community/Issue322TestCase.java
@@ -0,0 +1,47 @@
+package ma.glasnost.orika.test.community;
+
+import ma.glasnost.orika.MapperFactory;
+import ma.glasnost.orika.test.MappingUtil;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.junit.Assert.assertEquals;
+
+/**
+ * @see <a href="https://github.com/orika-mapper/orika/issues/322">https://github.com/orika-mapper/orika/issues/322</a>
+ */
+public class Issue322TestCase {
+
+    @Test
+    public void compile_error_when_customized_list_element_mapping_int_to_integer() {
+        PersonList personList = new PersonList();
+        Person person = new Person();
+        person.age = 20;
+        personList.persons.add(person);
+
+        MapperFactory mapperFactory = MappingUtil.getMapperFactory();
+        mapperFactory.classMap(PersonList.class, PersonAgeListDto.class)
+                .field("persons{age}", "personAges{}")
+                .byDefault()
+                .register();
+
+        PersonAgeListDto dest = mapperFactory.getMapperFacade().map(personList, PersonAgeListDto.class);
+
+        assertEquals(1, dest.personAges.size());
+        assertEquals(Integer.valueOf(20), dest.personAges.get(0));
+    }
+
+    public static class Person {
+        public int age;
+    }
+
+    public static class PersonList {
+        public List<Person> persons = new ArrayList<>();
+    }
+
+    public static class PersonAgeListDto {
+        public List<Integer> personAges;
+    }
+}