Author: bpoussin Date: 2012-06-08 12:17:55 +0200 (Fri, 08 Jun 2012) New Revision: 1485 Url: http://nuiton.org/repositories/revision/wikitty/1485 Log: Anomalie #2131: Error in findTreeNode client method when Node depth + depth asked > Integer.MAX_VALUE Modified: trunk/wikitty-solr/src/main/java/org/nuiton/wikitty/storage/solr/WikittySearchEngineSolr.java Modified: trunk/wikitty-solr/src/main/java/org/nuiton/wikitty/storage/solr/WikittySearchEngineSolr.java =================================================================== --- trunk/wikitty-solr/src/main/java/org/nuiton/wikitty/storage/solr/WikittySearchEngineSolr.java 2012-06-02 03:31:35 UTC (rev 1484) +++ trunk/wikitty-solr/src/main/java/org/nuiton/wikitty/storage/solr/WikittySearchEngineSolr.java 2012-06-08 10:17:55 UTC (rev 1485) @@ -353,7 +353,7 @@ addTreeIndexField(solrResource, null, attachmentInTree); } catch (Exception eee) { - throw new WikittyException("Can't store wikitty", eee); + throw new WikittyException("Can't store wikitty " + wikitties, eee); } timeLog.log(startTime, "store", String.format( "nb %s in force mode %s", wikitties.size(), force)); @@ -819,7 +819,7 @@ * * @param transaction wikitty transaction * @param wikittyId l'objet root du resultat - * @param depth profondeur souhaite pour la recherche des fils + * @param depth profondeur souhaite pour la recherche des fils, ou -1 pour tous * @param count vrai si l'on souhaite avoir le nombre d'attachment associe * au noeud retourne * @param filter filtre utilise pour compter le nombre d'attachment @@ -841,7 +841,12 @@ .and().eq(TREENODE_PARENTS, wikittyId); if (depth >= 0) { Integer d = SolrUtil.getIntFieldValue(doc, TREENODE_DEPTH); - treeSearch = treeSearch.bw(TREENODE_DEPTH, d, d + depth); + depth = d + depth; + if (depth < 0) { + // debordement, on fixe la valeur a MAX_VALUE + depth = Integer.MAX_VALUE; + } + treeSearch = treeSearch.bw(TREENODE_DEPTH, d, depth); } WikittyQuery treeQuery = treeSearch.getQuery();