remove tracked files/folders from git

Posted on by Kim

Eg. remove target from git. Don't remove target just add it to .gitignore and run:


git rm -r --cached .
git add .
git commit -m ".gitignore fix"

findbugs

Posted on by Kim

Used with : @SuppressFBWarnings("EQ_OTHER_NO_OBJECT")

http://findbugs.sourceforge.net/bugDescriptions.html#UUF_UNUSED_FIELD





XML to JAVA with @XmlType instead of @XmlRootElement

Posted on by Kim

import javax.xml.bind.JAXBContext;
import javax.xml.bind.Unmarshaller;

...

private AssessResponse loadOpaResponseFromXmlFile(String file) throws Exception {
    JAXBContext jaxbContext = JAXBContext.newInstance(AssessResponse.class);
    InputStream is = getClass().getResourceAsStream(file);
    Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
    return unmarshaller.unmarshal(new StreamSource(is), AssessResponse.class).getValue();
}

----------------------

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AssessResponse", propOrder = {
    "versionInfo",
    "events",
    "globalInstance"})
public class AssessResponse
    implements Serializable
{

...

----------------------
<assess-response xmlns="http://oracle.com/determinations/server/12.2.1/rulebase/assess/types">
    <global-instance>
        <entity id="month" inferred="false">
            <instance id="xxx">

...