java1.4

json library for java 1.4

那年仲夏 提交于 2020-01-30 05:15:36
问题 I'm using JCAPS 5.1.3 and only have Java 1.4 and need to handle with Json data. Unfortunately all libraries I've found use Java 1.5 and above. I just found lots of new implementations in this thread here, but which one works with 1.4. Is there a stable and simple version to use with Java 1.4? 回答1: An alternative is to use Retroweaver to make the jar compatible with Java 1.4: http://retroweaver.sourceforge.net 回答2: You can use my json library. It supports marshalling and unmarshalling to

json library for java 1.4

元气小坏坏 提交于 2020-01-30 05:15:05
问题 I'm using JCAPS 5.1.3 and only have Java 1.4 and need to handle with Json data. Unfortunately all libraries I've found use Java 1.5 and above. I just found lots of new implementations in this thread here, but which one works with 1.4. Is there a stable and simple version to use with Java 1.4? 回答1: An alternative is to use Retroweaver to make the jar compatible with Java 1.4: http://retroweaver.sourceforge.net 回答2: You can use my json library. It supports marshalling and unmarshalling to

alternatives for volatile array

不问归期 提交于 2020-01-13 05:16:07
问题 From other questions, I learned that the elements of a volatile array are not volatile. Only the reference itself is volatile. volatile[] int data; Thread A: data[4] = 457; Thread B: System.out.println(data[4]); Here, Thread B might never see the updated value. Which options/alternatives do I have to achieve the same thing? I would like to avoid having to synchronize the array, since it is hardly ever altered. However, it is being read a lot by some threads. Synchronizing it will very likely

Is Java bytecode compatible with different versions of Java?

痞子三分冷 提交于 2020-01-11 09:48:08
问题 If I compile an application using Java 5 code into bytecode, are the resulting .class files going to be able to run under Java 1.4? If the latter can work and I'm trying to use a Java 5 framework in my Java 1.4 application, is there anything I should watch out for? 回答1: Nope! .class files are forward compatible only. Java 5 introduced new classfile attributes and format changes, to handle Varargs, enums, and generics. Java 4 would just fail when processing these. However, there is the

Does Java 1.4 have generics?

和自甴很熟 提交于 2020-01-05 03:59:11
问题 Looking at some old code in Java 1.4 but I'm unfamiliar with Java. Does Java 1.4 have generics? I've been looking through the code and haven't found any uses of generics, but that doesn't necessarily mean they aren't supported. 回答1: No, that was a 1.5 introduction. (That is, "Java 2 release 1.5". There was the really old version 1.4 that was the farthest the Microsoft JVM got.) 回答2: No. Generics have been introduced with J2SE 5.0 (aka "Java 1.5", aka "Tiger"). Wikipedia has details on all

ActiveMQ CLIENT on Java 1.4

半世苍凉 提交于 2019-12-23 18:24:51
问题 We are using Active MQ in the most current version 5.6.0. Now we have the problem that a new client has to be connected, unfortunately this client is developed with IBM JDK 1.4. Adding ActiveMQ to the application lead to the following error: UNEXPECTED ERROR OCCURRED: org/apache/activemq/ActiveMQConnectionFactory (Unsupported major.minor version 50.0) STACK TRACE: java.lang.UnsupportedClassVersionError: org/apache/activemq/ActiveMQConnectionFactory (Unsupported major.minor version 50.0) We

Java copy section of array

心已入冬 提交于 2019-12-23 06:49:34
问题 Is there a method that will copy a section of an array(not arraylist) and make a new array from it? Example: [1,2,3,4,5] and you create a new array from it: [1,2,3] Are there any one line/methods that will do this? 回答1: Here's a java 1.4 compatible 1.5-liner: int[] array = { 1, 2, 3, 4, 5 }; int size = 3; int[] part = new int[size]; System.arraycopy(array, 0, part, 0, size); You could do this in one line, but you wouldn't have a reference to the result. To make a one-liner, you could refactor

What is the Java 1.4.2 equivalent of Pattern.quote()

核能气质少年 提交于 2019-12-17 20:46:20
问题 What would be a Java 1.4.2 equivalent of Pattern.quote? I was using Pattern.quote() on a URI but now need to make it 1.4.2 compatible. 回答1: Well the source code of Pattern.quote is available and looks like this: public static String quote(String s) { int slashEIndex = s.indexOf("\\E"); if (slashEIndex == -1) return "\\Q" + s + "\\E"; StringBuilder sb = new StringBuilder(s.length() * 2); sb.append("\\Q"); slashEIndex = 0; int current = 0; while ((slashEIndex = s.indexOf("\\E", current)) != -1)

Backport Java 5/6 features to Java 1.4?

你说的曾经没有我的故事 提交于 2019-12-17 18:42:38
问题 We are stuck with Java2SE v1.4 till the end of 2010. That's really nasty, but we can't help it. What options do we have to use some of the new features already now? I can think of several ways like changing the bytecode, e.g. using Retrotranslator or Retroweaver. backport of libraries, e.g. Concurrent Backport, but this does not help for generics. emulation of Java 5 features, e.g. checked Collections, Varargs with helper methods, etc. changing source code by precompilation, stripping all 1.5

Java 1.4 SHA265 Issue?

落爺英雄遲暮 提交于 2019-12-13 07:36:53
问题 I'm currently supporting a legacy e-commerce application that runs on Java 1.4. I understand that 1.4 does not support SSL certificates signed with SHA256, is this correct and will I have issues establishing connections with other sites requesting the use of this certificate? Are there any known workarounds to solve this issue? 回答1: That's not quite right: SHA-256 (and SHA-384, SHA-512) were introduced in 1.4.2 If there is no option to update you could use bouncycastle as your security