[ 
https://issues.apache.org/jira/browse/JUDDI-970?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16177430#comment-16177430
 ] 

ASF subversion and git services commented on JUDDI-970:
-------------------------------------------------------

Commit a967991ae7641ba89caf4e4c7d81fe89e9e78c1e in juddi's branch 
refs/heads/master from [~spyhunter99]
[ https://git-wip-us.apache.org/repos/asf?p=juddi.git;h=a967991 ]

JUDDI-970 resolved logic issue for subscription chunk validation


> Code smell that ignores InvalidValueException
> ---------------------------------------------
>
>                 Key: JUDDI-970
>                 URL: https://issues.apache.org/jira/browse/JUDDI-970
>             Project: jUDDI
>          Issue Type: Bug
>            Reporter: JC
>            Assignee: Alex O'Ree
>            Priority: Trivial
>             Fix For: 3.3.5
>
>
> I've found a condition that is always false so InvalidValueException will not 
> be thrown in all cases. (from recent github snapshot)
> Path:juddi-core/src/main/java/org/apache/juddi/api/impl/UDDISubscriptionImpl.java
> {code:java}
> 192                         if (body.getChunkToken() != null && 
> body.getChunkToken().length() > 0) {
>  193                                 SubscriptionChunkToken chunkToken = 
> em.find(SubscriptionChunkToken.class, body.getChunkToken());
>  194 
>  195                                 if (chunkToken == null)
>  196                                         throw new 
> InvalidValueException(new 
> ErrorMessage("errors.getsubscriptionresult.InvalidChunkToken", 
> body.getChunkToken()));
>  197                                 if 
> (!chunkToken.getSubscriptionKey().equals(chunkToken.getSubscriptionKey()))
>  198                                         throw new 
> InvalidValueException(new 
> ErrorMessage("errors.getsubscriptionresult.NonMatchingChunkToken", 
> body.getChunkToken()));
>  199                                 if (chunkToken.getStartPoint() != null 
> && chunkToken.getStartPoint().getTime() != startPointDate.getTime())
>  200                                         throw new 
> InvalidValueException(new 
> ErrorMessage("errors.getsubscriptionresult.NonMatchingChunkToken", 
> body.getChunkToken()));
>  201                                 if (chunkToken.getEndPoint() != null && 
> chunkToken.getEndPoint().getTime() != endPointDate.getTime())
>  202                                         throw new 
> InvalidValueException(new 
> ErrorMessage("errors.getsubscriptionresult.NonMatchingChunkToken", 
> body.getChunkToken()));
>  203                                 if 
> (chunkToken.getExpiresAfter().before(new Date()))
>  204                                         throw new 
> InvalidValueException(new 
> ErrorMessage("errors.getsubscriptionresult.ExpiredChunkToken", 
> body.getChunkToken()));
>  205 
>  206                                 chunkData = chunkToken.getData();
>  207                                 // We've got the data from the chunk 
> token, now it is no longer needed (once it's called, it's used up)
>  208                                 em.remove(chunkToken);
>  209                         }
> {code}
> Line 197 has that condition. This might be a trivial issue but wanted to 
> report just in case. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to