fix for altenativeTemplates by Index

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@499 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
allo 20 years ago
parent 3762acde6e
commit 7665712faa

@ -256,16 +256,13 @@ public final class httpTemplate {
int whichPattern=0; int whichPattern=0;
String patternName=""; String patternName="";
if(pattern.containsKey(prefix + key) && pattern.get(prefix + key) != null){ if(pattern.containsKey(prefix + key) && pattern.get(prefix + key) != null){
String patternId=(String)pattern.get(prefix + key);
try{ try{
Object tmp=pattern.get(prefix + key); //lookup by index OR Name whichPattern=(int)Integer.parseInt(patternId); //index
if(tmp instanceof String){
byName=true;
patternName=(String)tmp;//Name
}else{
whichPattern=(int)Integer.parseInt((String)pattern.get(prefix + key)); //index
}
}catch(NumberFormatException e){ }catch(NumberFormatException e){
whichPattern=0; whichPattern=0;
byName=true;
patternName=patternId;
} }
}else{ }else{
//System.out.println("Pattern \""+new String(prefix + key)+"\" is not set"); //DEBUG //System.out.println("Pattern \""+new String(prefix + key)+"\" is not set"); //DEBUG

Loading…
Cancel
Save