由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - very weird problem
相关主题
刚刚开始学习java,麻烦帮我看一下我哪里错了行吗?谢谢Wierd issue with Cassandra
问一个 java generic问题SpringMVC可否直接处理doGet?
java 随机数 nextInt(int n)的问题在线等,
BufferedWriter里的write()Ask a simple question about throw exception, bow bow bow
关于char和int的问题Re: 如何从键盘输入获得一个float值?谢谢!
what is your opinion in this case?Stupid IBM JDK
这段程序的输出是什么? 为什么java compilation question
Goodbug能提供一些Spring, Hibernate, Cassandra入门资料吗help on this scope question
相关话题的讨论汇总
话题: mygeneric话题: cc话题: public话题: hcolumn
进入Java版参与讨论
1 (共1页)
c******n
发帖数: 4965
1
the following code is found from Hector Cassandra java API, I couldn't
understand why it compiles fine while I thought the execute() should
declare or catch exceptions, since the testtest() throws exceptions.
(I simplified the code by adding testtest() )
public QueryResult> execute() {
return new QueryResultImpl>(
ExecutingKeyspace.testtest( (java.util.List>) null)
);
}
public static ExecutionResult testtest(java.util.List x)
throws HectorException { throw new HectorException("fff"); //return
(ExecutionResult) null ;
}
but in comparison, the following hacked up code does give compile
error, but I thought these 2 are exactly the same????
import java.io.*;
import java.util.Random;
class MyGeneric {
}

class AA {
public MyGeneric fun(MyGeneric blah) throws IOException
{
if ( new Random().nextInt() > 10 )
System.out.println("OOO");
// throw new IOException("blah");
return (MyGeneric) null;
}

}


class CC {
int m ;
public CC(MyGeneric n) { m=1;}
}

public class BB {
public CC ttt () {

return new CC( new AA().fun( (MyGeneric) null ) );
}
}
g*****g
发帖数: 34805
2
public class HectorException extends RuntimeException {
that explains.

【在 c******n 的大作中提到】
: the following code is found from Hector Cassandra java API, I couldn't
: understand why it compiles fine while I thought the execute() should
: declare or catch exceptions, since the testtest() throws exceptions.
: (I simplified the code by adding testtest() )
: public QueryResult> execute() {
: return new QueryResultImpl>(
: ExecutingKeyspace.testtest( (java.util.List>) null)
: );
: }
: public static ExecutionResult testtest(java.util.List x)

c******n
发帖数: 4965
3
fxxx, forget it,
public class HectorException extends RuntimeException {

【在 c******n 的大作中提到】
: the following code is found from Hector Cassandra java API, I couldn't
: understand why it compiles fine while I thought the execute() should
: declare or catch exceptions, since the testtest() throws exceptions.
: (I simplified the code by adding testtest() )
: public QueryResult> execute() {
: return new QueryResultImpl>(
: ExecutingKeyspace.testtest( (java.util.List>) null)
: );
: }
: public static ExecutionResult testtest(java.util.List x)

c******n
发帖数: 4965
4
thanks, just found it too

【在 g*****g 的大作中提到】
: public class HectorException extends RuntimeException {
: that explains.

c******n
发帖数: 4965
5
you work around Hector/Cassandra stuff too? just curious

【在 g*****g 的大作中提到】
: public class HectorException extends RuntimeException {
: that explains.

g*****g
发帖数: 34805
6
I am working on Cassandra stuff lately.

【在 c******n 的大作中提到】
: you work around Hector/Cassandra stuff too? just curious
c******n
发帖数: 4965
7
btw, do u know anything about Cassandra authentication?
there is some login() API, but I can simply connect/use without passwd
there is some discussion:
http://www.riptano.com/docs/0.6.5/install/auth-config
http://cassandra-user-incubator-apache-
org.3065146.n2.nabble.com/Authentication-td5285013.html#a5285013
I tried but doesn't seem to have any effect

【在 g*****g 的大作中提到】
: I am working on Cassandra stuff lately.
1 (共1页)
进入Java版参与讨论
相关主题
help on this scope question关于char和int的问题
怎么从键盘输入整数或float?what is your opinion in this case?
Urgent help! Java relative file path这段程序的输出是什么? 为什么
是否可以通过Java的程序直接导入网页?Goodbug能提供一些Spring, Hibernate, Cassandra入门资料吗
刚刚开始学习java,麻烦帮我看一下我哪里错了行吗?谢谢Wierd issue with Cassandra
问一个 java generic问题SpringMVC可否直接处理doGet?
java 随机数 nextInt(int n)的问题在线等,
BufferedWriter里的write()Ask a simple question about throw exception, bow bow bow
相关话题的讨论汇总
话题: mygeneric话题: cc话题: public话题: hcolumn