Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package com.sun.bigbrother.Classifier;
 
 
User: nachi Date: Jul 2, 2009 Time: 12:47:02 AM
public class ClassifierFactoryImpl implements ClassifierFactory {
    public Classifier create(String projectNamethrows IOException {
        FisherClassifier fc = load(projectName);
        if (projectName.equals("glassfish"))
            return new ClassifierImpl(fc, 0.5); // TODO: train the threshold, instead of hard  coding it.
        else
            return new ClassifierImpl(fc,-999);
    }
    private FisherClassifier load(String projectNamethrows IOException {
        ObjectInputStream in = null;
        try {
            in = new ObjectInputStream(new FileInputStream(projectName+".ser"));
            return (FisherClassifierin.readObject();
        } catch (ClassNotFoundException e) {
            throw (Error)new NoClassDefFoundError(e.getMessage()).initCause(e);
        } finally {
            if (in != null)
                in.close();
        }
    }
New to GrepCode? Check out our FAQ X