我在eclipse中做了一些新的警告设置.有了这些新设置,我面临一个奇怪的警告.阅读后我知道它是什么,但找不到删除它的方法.
这是我的示例代码问题
public class Test {
private String testString;
public void performAction() {
new Thread( new Runnable() {
@Override
public void run() {
testString = "initialize"; // **
}
});
}
}
Run Code Online (Sandbox Code Playgroud)
带**的行在eclipse中给我一个警告
Read access to enclosing field Test.testString is emulated by a synthetic accessor method.
Increasing its visibility will improve your performance.
Run Code Online (Sandbox Code Playgroud)
问题是,我不想更改访问修饰符testString.另外,不想为它创建一个getter.
应该做些什么改变?
More descriptive example
public class Synthetic
{
private JButton testButton;
public Synthetic()
{
testButton = new JButton("Run");
testButton.addActionListener(new ActionListener() {
public …Run Code Online (Sandbox Code Playgroud) 存在用于在Android上绘制PDF文件的库吗?
我找到了PDFBox,这是一个JSE库,想知道它是否可以用来在Android上绘制PDF.
我知道Android将标准字节码转换为Dalvik Bytecodes,但它如何将类似BufferedImage的类转换为框架可以将PDF文件转换为?
即使对于付费图书馆,任何建议都是有帮助的.
是否可以为插入其中的所有行创建一个具有默认TTL的表,或者在进行插入/更新时是否必须始终记住设置TTL?
无法在文档中看到任何内容:
http://www.datastax.com/documentation/cql/3.0/cql/cql_reference/create_table_r.html
我正在使用MVC4并且需要将这样的请求路由到控制器:
[myapp]/data/fileinfo.xml
这是我配置的路线:
routes.MapRoute(
name: "Data",
url: "Data/{file}",
defaults: new { controller = "Data", action = "fileinfo"}
);
Run Code Online (Sandbox Code Playgroud)
现在,如果URL不包含.xml扩展名,这可以正常工作并将请求路由到我的DataController,但是一旦使用扩展名,IIS就会尝试提供静态文件(而不是路由到我的控制器)和I得到404错误.
我已经在线阅读了大量有关此问题的问题/答案,而且我尝试过的每个解决方案都失败了.
例如,我RouteExistingFiles = true在配置我的RouteCollection时尝试使用,我已经<modules runAllManagedModulesForAllRequests="true" />在web.config中添加了,但无济于事.
如果有人知道我应该尝试什么或者我可能会缺少什么,那将非常感激.我正在使用asp.Net 4.5,VS 2012和IIS 8.0.
Log4j2还使用关闭挂钩来结束它的服务.但是我当然希望在我的应用程序的整个生命周期中记录 - 包括关闭.使用Log4j这没问题.现在似乎不可能.记录关闭,而我的应用程序仍在处理它.有人对我有什么希望吗?
最好的问候马丁
我在使用hibernate 4.1.0映射的postgresql 9.3中使用数组类型时遇到了一个特定的问题.这种类型允许我拥有非常强大的数据模型,而无需构建大量的表和连接.
为了映射使用此特定类型存储的字段,我使用了UserType
无论如何,它适用于纯hibernate(hql),但我还需要将sql本机查询发送到我的数据库.当我这样做时,尽管尝试了很多次,但我还没有找到任何办法.
我尝试了很多基于此的语法
String[] values = {"value1", "value2"};
String queryString = "SELECT * FROM instances WHERE values && :values";
Query query = this.getSession().createSQLQuery(queryString).addEntity(Instance.class);
query.setParameterList("values", values);
query.list();
Run Code Online (Sandbox Code Playgroud)
我得到的运算符不存在:text [] &&字符变化
它应该在jdbc中给出以下语法:['value1','value2']并且它似乎给'value1'...
我试过很多语法
我需要发送本机查询,因为我使用Materialized View来提高性能.
我的SQL查询在postgresql控制台中有效.所以这是一个特定于hibernate的问题.
在办公室,我支持代理.互联网接入受到限制.
所以我在家里执行了一个gradle同步,并将C:\ Users\username.gradle中的文件夹".gradle"从我的家用PC复制到我办公室PC上的同一位置.
现在在我的办公室电脑上,我将Android Studio中的gradle设置为"脱机工作",但是每当我尝试执行gradle同步时,我都会收到错误说明
Error: Could not download google-services.jar (com.google.gms:google-services:3.0.0): No cached version available for offline mode
Run Code Online (Sandbox Code Playgroud)
但是,在挖掘".gradle"文件夹时,我能够找到google-service.jar文件
C:\Users\username\.gradle\caches\modules-2\files-2.1\com.google.gms\google-services\3.0.0\32b833222c886ecfb37d79b1a05ce1eddb702db1
Run Code Online (Sandbox Code Playgroud)
我不知道该怎么办.请帮忙.
android intellij-idea gradle android-studio android-gradle-plugin
我正在尝试将我的数据库从MySQL迁移到Cassasndra.我面临的问题是其中一个列类型定义为Enum(枚举('GP','NGP','PGP','PAGP')).Cassandra不支持Enum数据类型(但它支持集合).有没有办法在Cassandra中实现Enum数据类型,因此应该从一组值中限制列的值?我正在使用Apache Cassandra 2.0.7版.
我有一个使用json.jar库的简单java项目.gradle.build文件内容是:
apply plugin: 'java'
jar {
manifest {
attributes(
'Class-Path': configurations.compile.collect { it.getName() }.join(' '),
'Main-Class': 'main.java.Main'
)
}
}
dependencies {
compile 'org.json:json:20160212'
}
Run Code Online (Sandbox Code Playgroud)
问题是,当我想将json添加到我的类路径并使用它时,会发生此错误
* Where:
Build file '/home/tina-admin/Documents/myJavaProjects/LongMan/build.gradle' line: 11
* What went wrong:
A problem occurred evaluating root project 'LongMan'.
> Cannot change dependencies of configuration ':compile' after it has been resolved.
Run Code Online (Sandbox Code Playgroud)
我该怎么解决这个问题?
我正在尝试使用Sqlite数据库创建一个spring-boot应用程序.
我在pom中添加了sqlite-jdbc和sqlite-dialect依赖项.
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.example</groupId>
<artifactId>spring-boot-app</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.2.RELEASE</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.16.1</version>
</dependency>
<dependency>
<groupId>org.hibernate.dialect</groupId>
<artifactId>sqlite-dialect</artifactId>
<version>0.1.0</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project>
Run Code Online (Sandbox Code Playgroud)
和我的apllication.properties文件是:
spring.datasource.url = jdbc:sqlite:test.db
spring.datasource.driver-class-name = org.sqlite.JDBC
spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.SQLiteDialect
spring.datasource.username =
spring.datasource.password =
spring.jpa.hibernate.ddl-auto=update
Run Code Online (Sandbox Code Playgroud)
但是我在启动应用程序时遇到异常:
23:42:39.358 [main] INFO o.a.c.c.StandardService - Stopping service Tomcat
23:42:39.390 [main] WARN o.s.b.SpringApplication …Run Code Online (Sandbox Code Playgroud) java ×5
android ×2
cassandra ×2
gradle ×2
arrays ×1
asp.net-mvc ×1
cql3 ×1
eclipse ×1
enums ×1
hibernate ×1
iis ×1
log4j2 ×1
logging ×1
pdf ×1
pdfbox ×1
pdfrenderer ×1
performance ×1
postgresql ×1
renderer ×1
spring ×1
spring-boot ×1
sqlite ×1
static ×1
ttl ×1