어제 밤, ... Pls는 도움이 ...이 함수가 반환 java.lang.NullPointerException이j2me 함수 java.lang.nullpointerexception - 이것의 무엇이 잘못 되었습니까?
public void parseWebXML(String xd){
int i, j, k = 0;
String tagn, check = "";
int spos, epos;
byte[] len = xd.getBytes();
tags = new String[len.length*3/4];
int nextpos = 0;
for(i=0;i<len.length*3/4;i++){
spos = xd.indexOf("<", nextpos);
epos = xd.indexOf(">", spos);
tagn = xd.substring(spos, epos);
if(i == 0 || i == 1 || i == 2){
if(tagn.indexOf("/") == -1){
tags[k] = "<"+tagn+">";
k +=1;
}else{
continue;
}
}else{
if(tagn.indexOf("/") == -1){
for(j=0;j<tags.length;j++){
if(tags[i].equals(tags[j])){
check = "found";
}else{
check = "notfound";
}
}
if(check.equals("notfound")){
tags[i] = "<"+tagn+">";
k+=1;
}else{
continue;
}
}else{
continue;
}
}
nextpos = epos + 1;
}
}
을 내가 XML 데이터가 포함 된 문자열에서 모든 태그를 가져 오기 위해이 기능을 쓴하지만 어떤이의 올바르지 않습니다 그 각각의 셀을 디버거 모드에서
TRACE: <at java.lang.NullPointerException: 0>, Exception caught in Display class
java.lang.NullPointerException: 0
- httpcon.parseWebXML(), bci=170
당신의 대답은 다른 funtion에서 일련의 문제를 발견하는데 도움이되었습니다 ... 현재 하나 ... 버그가 다릅니다. – Krishna