Search Results

Search found 260 results on 11 pages for 'javadoc'.

Page 6/11 | < Previous Page | 2 3 4 5 6 7 8 9 10 11  | Next Page >

  • Using com.sun.net.httpserver.HttpServer for comet/cometd

    - by Paul
    Hi Wayne :) I want to use HttpServer, which you mentioned, and I think is cool to do comet/cometd. I am wondering how tough it is to do it so that I can take the waiting connections off the thread and into some waiting queue. Also, am I correct in that it looks like it is using nio? Also, is there any better examples? I always get caught up in the terminology that the javadoc uses... Thanks :)

    Read the article

  • SQL Server JDBC Exception

    - by user267581
    When using ANT to build my Java application I keep getting this error. I have tried multiple times to use SQLJDBC.JAR and SQLJDBC4.JAR but continually receive this error message. I am completely stumpped why this error is received even after upgrading to sqljdbc4.jar. [javadoc] java.lang.UnsupportedOperationException: Java Runtime Environment (JRE) version 1.6 is not supported by this driver. Use the sqljdbc4.jar class library, which provides support for JDBC 4.0.

    Read the article

  • HttpOnly cookies on google app engine java

    - by Spines
    Anyone know how I can use httponly cookies for sessions and cookies on the app engine? In the javadoc for the Cookie class, http://java.sun.com/javaee/6/docs/api/javax/servlet/http/Cookie.html#setHttpOnly(boolean) , there is a setHttpOnly method. I get a compiler error when trying to use it when developing for app engine though. The method was introduced in the Servlet 3.0 spec, so its pretty new.

    Read the article

  • FindBugs: "may fail to close stream" - is this valid in case of InputStream?

    - by thSoft
    In my Java code, I start a new process, then obtain its input stream to read it: BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); FindBugs reports an error here: may fail to close stream Pattern id: OS_OPEN_STREAM, type: OS, category: BAD_PRACTICE Must I close the InputStream of another process? And what's more, according to its Javadoc, InputStream#close() does nothing. So is this a false positive, or should I really close the input stream of the process when I'm done?

    Read the article

  • Naming convention when casually referring to methods in Java

    - by polygenelubricants
    Is there a Java convention to refer to methods, static and otherwise, any specific one or the whole overload, etc? e.g. String.valueOf - referring to all overloads of static valueOf String.valueOf(char) - specific overload, formal parameter name omittable? String.split - looks like a static method, but actually an instance method Maybe aString.split is the convention? String#split - I've seen this HTML anchor form too, which I guess is javadoc-influenced Is there an authoritative recommendation on how to clearly refer to these things?

    Read the article

  • Why Joda DateTimeFormatter cannot parse timezone names ('z')

    - by dimitrisli
    From DateTimeFormatter javadoc: Zone names: Time zone names ('z') cannot be parsed. Therefore timezone parsing like: System.out.println(new SimpleDateFormat("EEE MMM dd HH:mm:ss z yyyy").parse("Fri Nov 11 12:13:14 JST 2010")); cannot be done in Joda: DateTimeFormatter dtf = DateTimeFormat.forPattern("EEE MMM dd HH:mm:ss z yyyy"); System.out.println(dtf.parseDateTime("Fri Nov 11 12:13:14 JST 2010")); //Exception in thread "main" java.lang.IllegalArgumentException: Invalid format: "Fri Nov 11 12:13:14 JST 2010" is malformed at "JST 2010" //at org.joda.time.format.DateTimeFormatter.parseDateTime(DateTimeFormatter.java:673)

    Read the article

  • Is SecureRandom thread safe?

    - by Yishai
    Is SecureRandom thread safe? That is, after initializing it, can access to the next random number be relied on to be thread safe? Examining the source code seems to show that it is, and this bug report seems to indicate that its lack of documentation as thread safe is a javadoc issue. Has anyone confirmed that it is in fact thread safe?

    Read the article

  • MSDN: How can I see what inherits/implements a class/interface?

    - by d03boy
    One thing I really, really miss from Javadoc is the ability to see which classes inherit the class you're looking at. So if you are looking at an abstract class (such as List) then you would be able to see all classes that inherit/implement the class/interface you're looking at. Is this available in the MSDN and I'm just missing it or is this really a missing feature?

    Read the article

  • In Java What is the guaranteed way to get a FileLock from FileChannel while accessing a RandomAcces

    - by narasimha.bhat
    I am trying to use FileLock lock(long position, long size,boolean shared) in FileChannel object As per the javadoc it can throw OverlappingFileLockException. When I create a test program with 2 threads lock method seems to be waiting to acquire the lock (both exclusive and non exclusive) But when the number threads increases in the acutal scenario over lapping file lock exception is thrown and processing slows down due the block at File lock table. What is the best way to acquire lock avoiding the OverlappingFileLockException ?

    Read the article

  • Servlets stats using wsadmin

    - by Nicholas Key
    Is there a way to probe the stats of servlets using wsadmin according to this MBean interface? http://publib.boulder.ibm.com/infocenter/wasinfo/v7r0/topic/com.ibm.websphere.javadoc.doc/web/mbeanDocs/index.html For example, the names of the servlets, the URIs, etc

    Read the article

  • JUnit Custom Rules

    - by Jon
    JUnit 4.7 introduced the concept of custom rules: http://www.infoq.com/news/2009/07/junit-4.7-rules There are a number of built in JUnit rules including TemporaryFolder which helps by clearing up folders after a test has been run: @Rule public TemporaryFolder tempFolder = new TemporaryFolder(); There's a full list of built in rules here: http://kentbeck.github.com/junit/javadoc/latest/org/junit/rules/package-summary.html I'm interested in finding out what custom rules are in place where you work or what useful custom rules you currently use?

    Read the article

  • Java Deflater strategies - DEFAULT_STRATEGY, FILTERED and HUFFMAN_ONLY

    - by Keyur
    I'm trying to find a balance between performance and degree of compression when gzipping a Java webapp response. In looking at the Deflater class, I can set a level and a strategy. The levels are self explanatory - BEST_SPEED to BEST_COMPRESSION. I'm not sure regarding the strategies - DEFAULT_STRATEGY, FILTERED and HUFFMAN_ONLY I can make some sense from the Javadoc but I was wondering if someone had used a specific strategy in their apps and if you saw any difference in terms of performance / degree of compression. Thanks, Keyur

    Read the article

  • Java - Collections.sort() performance

    - by msr
    Hello, Im using Collections.sort() to sort a LinkedList whose elements implements Comparable interface, so they are sorted in a natural order. In the javadoc documentation its said this method uses mergesort algorithm wich has n*log(n) performance. My question is if there is a more efficient algorithm to sort my LinkedList? The size of that list could be very high and sort will be also very frequent. Thanks!

    Read the article

  • readObject() vs. readResolve() to restore transient fields

    - by Joonas Pulakka
    According to Serializable javadoc, readResolve() is intended for replacing an object read from the stream. But is it OK to use it for restoring transient fields, like so: private Object readResolve() { transientField = something; return this; } as opposed to using readObject(): private void readObject(ObjectInputStream s) { s.defaultReadObject(); transientField = something; } Is there any reason to choose one over other, when used to just restore transient fields?

    Read the article

  • How is Java Process.getOutputStream() Implemented?

    - by Amit Kumar
    I know the answer depends on the particular JVM, but I would like to understand how it is usually implemented? Is it in terms of popen (posix)? In terms of efficiency do I need to keep something in mind (other than using a Buffered stream as suggested by the javadoc). I would be interested to know if there is a general reference about implementations of JVMs which answers such questions.

    Read the article

  • Java NIO (Netty): Exceptionhandling in Downstream Hanlders/Chain

    - by Tom
    Hello Experts, could someone please explain to me, how in netty "Downstream Exceptions" are handeled? According to the javadoc there are no Downstream exceptions: http://docs.jboss.org/netty/3.1/api/org/jboss/netty/channel/ExceptionEvent.html Given the case that in one of my downstream handlers an exception occures OR in the I/0 Thread itself, where can these errors be catched and handeled? thank you very much tom

    Read the article

  • How do I add a library in Eclipse?

    - by jul
    hi, I downloaded the Gson library from http://code.google.com/p/google-gson/. The archive contains the following jar files: google-gson-1.3/gson-1.3-javadoc.jar google-gson-1.3/gson-1.3.jar google-gson-1.3/gson-1.3-sources.jar How do I set my Eclipse to be able to use the package in my projects? Where do I put the documentation? Thanks jul

    Read the article

  • Difference in DocumentBuilder.parse when using JRE 1.5 and JDK 1.6

    - by dhiller
    Recently at last we have switched our projects to Java 1.6. When executing the tests I found out that using 1.6 a SAXParseException is not thrown which has been thrown using 1.5. Below is my test code to demonstrate the problem. import java.io.StringReader; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.transform.stream.StreamSource; import javax.xml.validation.SchemaFactory; import org.junit.Test; import org.xml.sax.InputSource; import org.xml.sax.SAXParseException; /** * Test class to demonstrate the difference between JDK 1.5 to JDK 1.6. * * Seen on Linux: * * <pre> * #java version "1.6.0_18" * Java(TM) SE Runtime Environment (build 1.6.0_18-b07) * Java HotSpot(TM) Server VM (build 16.0-b13, mixed mode) * </pre> * * Seen on OSX: * * <pre> * java version "1.6.0_17" * Java(TM) SE Runtime Environment (build 1.6.0_17-b04-248-10M3025) * Java HotSpot(TM) 64-Bit Server VM (build 14.3-b01-101, mixed mode) * </pre> * * @author dhiller (creator) * @author $Author$ (last editor) * @version $Revision$ * @since 12.03.2010 11:32:31 */ public class TestXMLValidation { /** * Tests the schema validation of an XML against a simple schema. * * @throws Exception * Falls ein Fehler auftritt * @throws junit.framework.AssertionFailedError * Falls eine Unit-Test-Pruefung fehlschlaegt */ @Test(expected = SAXParseException.class) public void testValidate() throws Exception { final StreamSource schema = new StreamSource( new StringReader( "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" + "<xs:schema xmlns:xs=\"http://www.w3.org/2001/XMLSchema\" " + "elementFormDefault=\"qualified\" xmlns:xsd=\"undefined\">" + "<xs:element name=\"Test\"/>" + "</xs:schema>" ) ); final String xml = "<Test42/>"; final DocumentBuilderFactory newFactory = DocumentBuilderFactory.newInstance(); newFactory.setSchema( SchemaFactory.newInstance( "http://www.w3.org/2001/XMLSchema" ).newSchema( schema ) ); final DocumentBuilder documentBuilder = newFactory.newDocumentBuilder(); documentBuilder.parse( new InputSource( new StringReader( xml ) ) ); } } When using a JVM 1.5 the test passes, on 1.6 it fails with "Expected exception SAXParseException". The Javadoc of the DocumentBuilderFactory.setSchema(Schema) Method says: When errors are found by the validator, the parser is responsible to report them to the user-specified ErrorHandler (or if the error handler is not set, ignore them or throw them), just like any other errors found by the parser itself. In other words, if the user-specified ErrorHandler is set, it must receive those errors, and if not, they must be treated according to the implementation specific default error handling rules. The Javadoc of the DocumentBuilder.parse(InputSource) method says: BTW: I tried setting an error handler via setErrorHandler, but there still is no exception. Now my question: What has changed to 1.6 that prevents the schema validation to throw a SAXParseException? Is it related to the schema or to the xml that I tried to parse?

    Read the article

  • Java NetBeans Comments Class Diagram Helper

    - by ikurtz
    i am starting to learn Java using Netbeans 6.8 IDE. i am wondering if there is a utility in NetBeans similar to VS2008 that facilitates commenting code and later display these comments in class diagrams? thanks. EDIT: i found the Javadoc feature. it is some help but not that great.

    Read the article

  • AtomicInteger lazySet and set

    - by Yan Cheng CHEOK
    May I know what is the difference among lazySet and set method for AtomicInteger. javadoc doesn't talk much about lazySet : Eventually sets to the given value. It seems that AtomicInteger will not immediately be set to the desired value, but it will be scheduled to be set in some time. But, what is the practical use of this method? Any example?

    Read the article

  • TeamCity build number independent artifacts

    - by Stanislav Shevchenko
    Hello, My TeamCity's nightly build produces more than 130Mb java doc as Build Configuration artifact. I have to share these artifact for other teams(developers), but javadoc every time has another one URL(I know that it's possible to get it like .lastFinished), and get's new place on Build Machine. Is it possible on each build replace old artifact with new one because I don't need need previous versions? And have independent from build version URL for accessing.

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11  | Next Page >