mirror of
https://github.com/querydsl/querydsl.git
synced 2026-06-13 21:01:01 +08:00
Merge pull request #782 from querydsl/i778
Replace ImmutableMap with HashMap
This commit is contained in:
commit
7b8ec400a6
@ -13,13 +13,12 @@
|
||||
*/
|
||||
package com.mysema.query.types;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.ImmutableMap;
|
||||
import com.google.common.collect.Maps;
|
||||
|
||||
/**
|
||||
* QMap represents a projection of type Map
|
||||
@ -104,11 +103,11 @@ public class QMap extends ExpressionBase<Map<Expression<?>,?>> implements Factor
|
||||
@Override
|
||||
@Nullable
|
||||
public Map<Expression<?>, ?> newInstance(Object... args) {
|
||||
ImmutableMap.Builder<Expression<?>,Object> builder = ImmutableMap.builder();
|
||||
Map<Expression<?>, Object> map = Maps.newHashMap();
|
||||
for (int i = 0; i < args.length; i++) {
|
||||
builder.put(this.args.get(i), args[i]);
|
||||
map.put(this.args.get(i), args[i]);
|
||||
}
|
||||
return builder.build();
|
||||
return map;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -13,13 +13,12 @@
|
||||
*/
|
||||
package com.mysema.query.types;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import com.mysema.query.types.path.StringPath;
|
||||
import org.junit.Test;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
|
||||
public class QMapTest {
|
||||
|
||||
@ -81,4 +80,10 @@ public class QMapTest {
|
||||
assertEquals(expr.newInstance("str1", "str2").hashCode(), expr.newInstance("str1", "str2").hashCode());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void Null_Value() {
|
||||
QMap expr = new QMap(str1, str2);
|
||||
assertNotNull(expr.newInstance("str1", null));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,70 +0,0 @@
|
||||
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
|
||||
<id>full-deps</id>
|
||||
<formats>
|
||||
<format>zip</format>
|
||||
</formats>
|
||||
<files>
|
||||
<file>
|
||||
<source>../querydsl-root/LICENSE.txt</source>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
</file>
|
||||
</files>
|
||||
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>target</directory>
|
||||
<includes>
|
||||
<include>*.jar</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>*-tests.jar</exclude>
|
||||
<exclude>*-one-jar.jar</exclude>
|
||||
<exclude>*-sources.jar</exclude>
|
||||
</excludes>
|
||||
<outputDirectory>/lib/all</outputDirectory>
|
||||
</fileSet>
|
||||
|
||||
<fileSet>
|
||||
<directory>target</directory>
|
||||
<includes>
|
||||
<include>*-one-jar.jar</include>
|
||||
</includes>
|
||||
<outputDirectory>/lib/apt</outputDirectory>
|
||||
</fileSet>
|
||||
|
||||
<fileSet>
|
||||
<directory>target</directory>
|
||||
<includes>
|
||||
<include>*-sources.jar</include>
|
||||
</includes>
|
||||
<outputDirectory>/src</outputDirectory>
|
||||
</fileSet>
|
||||
|
||||
<fileSet>
|
||||
<directory>../querydsl-core/target</directory>
|
||||
<includes>
|
||||
<include>*-sources.jar</include>
|
||||
</includes>
|
||||
<excludes>
|
||||
<exclude>*-test-sources.jar</exclude>
|
||||
</excludes>
|
||||
<outputDirectory>/src</outputDirectory>
|
||||
</fileSet>
|
||||
|
||||
</fileSets>
|
||||
|
||||
<dependencySets>
|
||||
<dependencySet>
|
||||
<scope>compile</scope>
|
||||
<outputDirectory>lib/all</outputDirectory>
|
||||
</dependencySet>
|
||||
<!--
|
||||
<dependencySet>
|
||||
<scope>provided</scope>
|
||||
<outputDirectory>lib/all</outputDirectory>
|
||||
</dependencySet>
|
||||
-->
|
||||
</dependencySets>
|
||||
</assembly>
|
||||
Loading…
Reference in New Issue
Block a user