Hi,

> +    public void setDocumentSyntaxId(String documentName, String syntaxId)
> throws Exception
> Missing edit comment.
> > +        xcontext.getWiki().saveDocument(doc, xcontext);
> > +    }
>

Fixed.


> > +    public void setAttachmentContent(String documentName, String
> AttachmentName,
> > +        byte[] attachmentData) throws Exception
> I think you're saving the document twice, since the first line also
> saves the document, so the manual save is not needed.
> > +        doc.saveAttachmentContent(attachment, xcontext);
> > +        xcontext.getWiki().saveDocument(doc,
> > +            String.format("Added attachment [%s].", AttachmentName),
> xcontext);
> > +    }
>

Fixed. But with this change I don't see a way to add an edit comment when
adding a new attachment. But I think this is ok since we are not changing
the document content.


> This should have a short description, too
> > +    /**
> > +     * @param documentName The name of the document.
> > +     * @param right Access right requested.
> > +     * @return True if the current user has the given access right,
> false otherwise.
> > +     */
> > +    private boolean hasRight(String documentName, String right)
>

Fixed.


Although this is a mock used during test, you should still add javadoc
> for them:
>
>    /**
>     * {...@inheritdoc}
>     *
>     * @see DocumentAccessBridge#getDefaultEncoding()
>     */
>
> I know that the other methods were not documented, but whenever you see
> something wrong, you should fix it, and not see it as an excuse for
> doing more bad things.


Fixed :)

Thanks.

- Asiri
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to