java-7

Using ListView from Scala 2.9.2 with Java 7 gives compile error

谁说我不能喝 提交于 2019-12-06 00:26:19
问题 I'm working on a project that use scala 2.9.2 and java 7. What I'm trying to do is create a GUI using the scala ListView. Here's a small code snippet: private val listView = new ListView[Document](someList) . . . for (selectedDocument <- listView.peer.getSelectedValuesList) { doSomething(selectedDocument) } This gives me the following compile error: error: something is wrong (wrong class file?): class JList with type parameters [E] gets applied to arguments [], phase = namer for

Java - ZUI (Zoomable User Interface)

拈花ヽ惹草 提交于 2019-12-05 22:40:26
I'm currently doing a small personal project that needs to display an extremely large amount of data, and I suddenly thought about implementing a form of zoomable user interface to allow the user to navigate around the large amounts of data. I'm aware of existing projects such as ZVTM and Piccolo2d which I'll probably end up using for the job, however I'm also quite tempted to embark upon writing my own. However, I'm a little unsure as how to start. From what I've been reading, it seems that projects like Piccolo2d were developed due to a lack of 'scene graph' management within Java, and

Java 1.7 applet CacheEntry preventing dynamic updates

爱⌒轻易说出口 提交于 2019-12-05 21:54:11
I am migrating Java 1.6 applets to Java 1.7. One of our applets periodically hits an URL to retrieve a dynamic status value: https://host/myapp/path/to/status And then it updates according to the latest status value. Since upgrading to Java 1.7, my client does not retrieve the latest status value. I see entries like this in the Java console: CacheEntry[https://host/myapp/path/to/status]: updateAvailable=true,lastModified=Wed Dec 31 17:00:00 MST 1969,length=82 It looks like the client has some cached value for that URL and isn't actually retrieving the latest dynamic value from the server. This

Java Drag and drop on OS X reports Move instead of Copy

浪子不回头ぞ 提交于 2019-12-05 20:48:13
Update/status: Bug is reported to Oracle and currently still open/unresolved: https://bugs.openjdk.java.net/browse/JDK-8054325 I've found a strange bug, which only manifests itself on Java 7 and 8 on OS X, not in Java 6, neither on Java 7 Windows. Below is the extracted bug removing as much unneeded code as possible. It leaves us with a small table and a button, where we can drag the cell from the table on top of the button. In our production code we are using a TransferHandler that has COPY_OR_MOVE as source action. We have two targets, one DropTarget accepts as MOVE , the other accepts as

Downgrade open jdk 8 to 7 in ubuntu 14.04

我只是一个虾纸丫 提交于 2019-12-05 18:46:55
I accidentally upgraded the whole system in ubuntu 14.04. I am trying to deploy a war file which requires JDK7. I tried to install JDK7 and use it as default root:floyd~# update-alternatives --config java There is only one alternative in link group java (providing /usr/bin/java): /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java Nothing to configure. but it is not installing as well. It gives following error while trying to install JDK 7. root@floyd:~# apt-get install openjdk-7-jdk Reading package lists... Done Building dependency tree Reading state information... Done Package openjdk-7-jdk is

Who decides what exceptions get suppressed?

a 夏天 提交于 2019-12-05 18:30:02
As i understand it, Java 7's suppressing exceptions feature is an automatic one. In other words, exceptions happening in what used to be a finally block in 6 are automatically suppressed in favor of exception that took place upon resource allocation. So, in this example things may go wrong with a) opening a resource and b) closing a resource or c) possibly both. As i understand it, Java 7 will throw exception that took place upon opening, whom we can ask to give us suppressed exceptions, which took place elsewhere. try (BufferedReader inputReader = Files .newBufferedReader(Paths.get(new URI(

Why do I have “Checksum fail” on every bad SQL request in Oracle when Native Encryption (ASO) is enabled?

两盒软妹~` 提交于 2019-12-05 18:01:33
We recently configured our Oracle database to be in so-called native encryption (Oracle Advanced Security Option). As development goes on, some SQL queries are sometimes badly-written and so an error should be returned by the JDBC driver ( ojdbc7 v12.1.0.2 ). Instead of that, a Checksum Fail IOException is raised. So the problem is that we do not have anymore any syntax or database integrity error at all. The problem is the same in SQL GUI editors, like DBeaver , SQLDeveloper or SQuirrel . It's a known issue in the Oracle JDBC thin driver. If you can use SSL instead of ASO then this problem

Underscores in literals are not supported at this language level

倖福魔咒の 提交于 2019-12-05 17:53:44
I got this error when creating a final double using underscores to make the double more readable. It was declared in a run() method. public void run() { final double nanoSeconds = 1_000_000_000.0 / 60.0; } I'm using IntelliJ IDEA 12. In IntelliJ IDEA you have to change Project language level in project settings to 7.0 level: Yes..you need to change the default language level settings if you are using and IDE. For IntelliJ users it is under File --> Project Structure --> Projects. I found with my project that had modules, I had to do this in the modules settings as well. 来源: https:/

How to fully qualify a class whose package name collides with a local member name?

半腔热情 提交于 2019-12-05 17:49:41
OK, here's a very curious Java 7 language puzzle for the JLS specialists out there. The following piece of code won't compile, neither with javac nor with Eclipse: package com.example; public class X { public static X com = new X(); public void x() { System.out.println(com.example.X.com); // cannot find symbol ^^^^^^^ } } It appears as though the member com completely prevents access to the com.* packages from within X . This isn't thoroughly applied, however. The following works, for instance: public void x() { System.out.println(com.example.X.class); } My question(s): How is this behaviour

JDK-7 SwingWorker deadlocks?

无人久伴 提交于 2019-12-05 15:41:24
I have a small image processing application which does multiple things at once using SwingWorker. However, if I run the following code (oversimplified excerpt), it just hangs on JDK 7 b70 (windows) but works in 6u16. It starts a new worker within another worker and waits for its result (the real app runs multiple sub-workers and waits for all this way). Did I use some wrong patterns here (as mostly there is 3-5 workers in the swingworker-pool, which has limit of 10 I think)? import javax.swing.SwingUtilities; import javax.swing.SwingWorker; public class Swing { static SwingWorker<String, Void>