我在声纳上收到这个警告:
避免使用像'HashMap'这样的实现类型; 改为使用界面
这是什么意思?
我收到此警告的类如下:
class A {
private HashMap<String, String> map=new HashMap<String, String>();
//getters and setters
}
Run Code Online (Sandbox Code Playgroud)
请,我想要适当的解决方案,以避免在声纳上发出警告.
我有setting.xml
<settings
xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<mirrors>
<mirror>
<id>Nexus.Codehaus Snapshots</id>
<name>Nexus Mirror of Codehaus Snapshots</name>
<url>http://build/nexus/content/repositories/codehaus-snapshots</url>
<mirrorOf>Codehaus Snapshots</mirrorOf>
</mirror>
<mirror>
<id>Nexus</id>
<name>Nexus Public Mirror</name>
<url>http://nexus.other.com/content/groups/public</url>
<mirrorOf>Nexus</mirrorOf>
</mirror>
</mirrors>
<server>
<id>TomcatServer</id>
<username>admin</username>
<password>password</password>
</server>
<profiles>
<profile>
<id>quickBuild</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<maven.test.skip>true</maven.test.skip>
<pmd.skip>true</pmd.skip>
<checkstyle.skip>true</checkstyle.skip>
<findbugs.skip>true</findbugs.skip>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>${java.version}</source>
<target>${java.version}</target>
<debug>true</debug>
<debuglevel>lines,vars,source</debuglevel>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<executions>
<execution>
<id>some</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>findbugs-maven-plugin</artifactId>
<executions>
<execution>
<id>some2</id>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-pmd-plugin</artifactId> …Run Code Online (Sandbox Code Playgroud) 哪些粒度播放服务包含以下类?
com.google.android.gms.common.internal.safeparcel.SafeParcelable
我目前有以下依赖关系,但是在找不到SafeParcelable时出现错误。
play-services-base-8.4.0
play-services-location-8.4.0
play-services-maps-8.4.0
如果很重要,我将Buck用于我的Android项目,并直接从m2repository中包括这些aar。
在早期版本中,它是settings.dbdata/data/com.android.providers.settings/databases
但这似乎只是早期版本的情况,在牛轧糖中它已经移动了。
我总是假设如果声明被声明为假,例如boolean valid = false,则写入!valid将反过来valid变为真.然而,这是一个完全错误的错误观念吗?例如,在下面的代码中;
for (int check=3; check <= primeLimit; check += 2) {
boolean divisorFound=false;
for (int div=3; div<=Math.sqrt(check) && !divisorFound; div += 2) {
if (check%div==0)
divisorFound=true;
}
Run Code Online (Sandbox Code Playgroud)
第二个for循环搜索是否divisorFound为false?因为如果暗示除数是假的,那么它不会只是说:
div<=Math.sqrt(check) && divisorFound;
Run Code Online (Sandbox Code Playgroud)