Example usage for org.apache.commons.lang ArrayUtils EMPTY_STRING_ARRAY

List of usage examples for org.apache.commons.lang ArrayUtils EMPTY_STRING_ARRAY

Introduction

In this page you can find the example usage for org.apache.commons.lang ArrayUtils EMPTY_STRING_ARRAY.

Prototype

String[] EMPTY_STRING_ARRAY

To view the source code for org.apache.commons.lang ArrayUtils EMPTY_STRING_ARRAY.

Click Source Link

Document

An empty immutable String array.

Usage

From source file:org.openhab.tools.analysis.checkstyle.test.ParameterizedRegexpHeaderCheckTest.java

private void verifyJavaFileNoErrors(String name) throws Exception {
    verifyJavaFile(name, ArrayUtils.EMPTY_STRING_ARRAY);
}

From source file:org.openhab.tools.analysis.checkstyle.test.PomXmlCheckTest.java

@Test
public void testMasterPom() throws Exception {
    String testFileAbsolutePath = getPath(POM_XML_CHECK_TEST_DIRECTORY_NAME + "/pom.xml");
    verify(createChecker(config), testFileAbsolutePath, ArrayUtils.EMPTY_STRING_ARRAY);
}

From source file:org.openmicroscopy.shoola.util.ui.search.SearchComponent.java

/** Fires a property change to search. */
void search() {/*from  www.  j a  v  a 2s  .c  o  m*/

    List<Integer> scope = uiDelegate.getScope();
    SearchContext ctx;

    if (scope.contains(SearchContext.ID)) {
        // create search context with search by ID only
        ctx = new SearchContext(uiDelegate.getSome(), ArrayUtils.EMPTY_STRING_ARRAY,
                ArrayUtils.EMPTY_STRING_ARRAY, Collections.singletonList(SearchContext.ID));
    } else {
        // Terms cannot be null
        String[] some = uiDelegate.getSome();
        String[] must = uiDelegate.getMust();
        String[] none = uiDelegate.getNone();
        ctx = new SearchContext(some, must, none, scope);

        int index = uiDelegate.getSelectedDate();
        Timestamp start, end;

        switch (index) {
        case SearchContext.RANGE:
            start = uiDelegate.getFromDate();
            end = uiDelegate.getToDate();
            if (start != null && end != null && start.after(end))
                ctx.setTime(end, start);
            else
                ctx.setTime(start, end);
            break;
        default:
            ctx.setTime(index);
        }
        ctx.setOwnerSearchContext(uiDelegate.getOwnerSearchContext());
        ctx.setAnnotatorSearchContext(uiDelegate.getAnnotatorSearchContext());
        ctx.setOwners(uiDelegate.getOwners());
        ctx.setGroups(uiDelegate.getSelectedGroups());
        ctx.setAnnotators(uiDelegate.getAnnotators());
        ctx.setCaseSensitive(uiDelegate.isCaseSensitive());
        ctx.setAttachmentType(uiDelegate.getAttachment());
        ctx.setTimeType(uiDelegate.getTimeIndex());
        ctx.setExcludedOwners(uiDelegate.getExcludedOwners());
        ctx.setExcludedAnnotators(uiDelegate.getExcludedAnnotators());
        ctx.setGroups(uiDelegate.getSelectedGroups());
    }

    ctx.setType(uiDelegate.getType());
    ctx.setGroups(uiDelegate.getSelectedGroups());

    firePropertyChange(SEARCH_PROPERTY, null, ctx);
}

From source file:org.pentaho.di.trans.steps.jobexecutor.JobExecutorTest.java

@Before
public void setUp() throws Exception {
    executor = StepMockUtil.getStep(JobExecutor.class, JobExecutorMeta.class, "TransExecutorUnitTest");
    executor = spy(executor);//  ww w  .  ja  v  a  2  s  . c om
    executor.setInputRowMeta(mock(RowMetaInterface.class));

    doNothing().when(executor).discardLogLines(any(JobExecutorData.class));

    meta = new JobExecutorMeta();
    data = new JobExecutorData();
    Job job = mock(Job.class);
    doReturn(job).when(executor).createJob(any(Repository.class), any(JobMeta.class),
            any(LoggingObjectInterface.class));
    doReturn(ArrayUtils.EMPTY_STRING_ARRAY).when(job).listParameters();

    data.groupBuffer = new ArrayList<>();
    data.groupSize = -1;
    data.groupTime = -1;
    data.groupField = null;
}

From source file:org.pentaho.di.trans.steps.multimerge.MultiMergeJoinMeta.java

@Override
public String getXML() {
    StringBuilder retval = new StringBuilder();

    String[] inputStepsNames = inputSteps != null ? inputSteps : ArrayUtils.EMPTY_STRING_ARRAY;
    retval.append("    ").append(XMLHandler.addTagValue("join_type", getJoinType()));
    for (int i = 0; i < inputStepsNames.length; i++) {
        retval.append("    ").append(XMLHandler.addTagValue("step" + i, inputStepsNames[i]));
    }//from  w w  w  .j av a 2  s . c o  m

    retval.append("    ").append(XMLHandler.addTagValue("number_input", inputStepsNames.length));
    retval.append("    ").append(XMLHandler.openTag("keys")).append(Const.CR);
    for (int i = 0; i < keyFields.length; i++) {
        retval.append("      ").append(XMLHandler.addTagValue("key", keyFields[i]));
    }
    retval.append("    ").append(XMLHandler.closeTag("keys")).append(Const.CR);

    return retval.toString();
}

From source file:org.pentaho.di.trans.steps.multimerge.MultiMergeJoinMeta.java

@Override
public void saveRep(Repository rep, IMetaStore metaStore, ObjectId id_transformation, ObjectId id_step)
        throws KettleException {
    try {/*from  www  . j a v  a  2s  .c om*/
        for (int i = 0; i < keyFields.length; i++) {
            rep.saveStepAttribute(id_transformation, id_step, i, "keys", keyFields[i]);
        }

        String[] inputStepsNames = inputSteps != null ? inputSteps : ArrayUtils.EMPTY_STRING_ARRAY;
        rep.saveStepAttribute(id_transformation, id_step, "number_input", inputStepsNames.length);
        for (int i = 0; i < inputStepsNames.length; i++) {
            rep.saveStepAttribute(id_transformation, id_step, "step" + i, inputStepsNames[i]);
        }
        //      The following was the old way of persisting this step to the repository. This was inconsistent with
        //      how getXML works, and also fails the load/save tester
        //      List<StreamInterface> infoStreams = getStepIOMeta().getInfoStreams();
        //      rep.saveStepAttribute( id_transformation, id_step, "number_input", infoStreams.size() );
        //      for ( int i = 0; i < infoStreams.size(); i++ ) {
        //        rep.saveStepAttribute( id_transformation, id_step, "step" + i, infoStreams.get( i ).getStepname() );
        //      }
        // inputSteps[i]
        rep.saveStepAttribute(id_transformation, id_step, "join_type", getJoinType());
    } catch (Exception e) {
        throw new KettleException(
                BaseMessages.getString(PKG, "MultiMergeJoinMeta.Exception.UnableToSaveStepInfo") + id_step, e);
    }
}

From source file:org.qedeq.base.io.Path.java

/**
 * Remove ".." and "." directories out of path if possible.
 *
 * @param   dirNames    Directories that build up the path.
 * @return  Directories that build up the same path.
 *//*from  ww  w.  jav  a2s  .  c o m*/
private String[] removeRelativeDirs(final String[] dirNames) {
    List d = new ArrayList();
    for (int i = 0; i < dirNames.length; i++) {
        d.add(dirNames[i]);
    }
    for (int i = 0; i < d.size();) {
        if (i > 0 && "..".equals(d.get(i)) && !"".equals(d.get(i - 1)) && !"..".equals(d.get(i - 1))) {
            d.remove(i - 1);
            d.remove(i - 1);
            i--;
        } else if (".".equals(d.get(i))) {
            d.remove(i);
        } else {
            i++;
        }
    }
    return (String[]) d.toArray(ArrayUtils.EMPTY_STRING_ARRAY);
}

From source file:org.qedeq.base.utility.StringUtility.java

/**
 * Split String by given delimiter.//from   www. j  a va  2s . c  om
 * "a:b:c" is converted to "a", "b", "c".
 * "a:b:c:" is converted to "a", "b", "c", "".
 *
 * @param   text        Text to split.
 * @param   delimiter   Split at these points.
 * @return  Split text.
 */
public static String[] split(final String text, final String delimiter) {
    final List list = new ArrayList();
    int start = 0;
    int found = -delimiter.length();
    while (-1 < (found = text.indexOf(delimiter, start))) {
        list.add(text.substring(start, found));
        start = found + delimiter.length();
    }
    list.add(text.substring(start));
    return (String[]) list.toArray(ArrayUtils.EMPTY_STRING_ARRAY);
}

From source file:org.qedeq.kernel.bo.log.DefaultModuleEventListenerTest.java

protected void setUp() throws Exception {
    super.setUp();
    out = new ByteArrayOutputStream();
    listener = new DefaultModuleEventListener(new PrintStream(out));
    qedeq = new QedeqBo() {

        public boolean isSupportedLanguage(String language) {
            return false;
        }/*from  w  w w .ja  v a  2  s .c o  m*/

        public boolean isLoaded() {
            return false;
        }

        public boolean isWellFormed() {
            return false;
        }

        public boolean isFullyFormallyProved() {
            return false;
        }

        public boolean hasWarnings() {
            return false;
        }

        public boolean hasLoadedRequiredModules() {
            return false;
        }

        public boolean hasErrors() {
            return false;
        }

        public boolean hasBasicFailures() {
            return false;
        }

        public SourceFileExceptionList getWarnings() {
            return new SourceFileExceptionList();
        }

        public String getUrl() {
            return "dummy";
        }

        public String[] getSupportedLanguages() {
            return ArrayUtils.EMPTY_STRING_ARRAY;
        }

        public String getStateDescription() {
            return LoadingState.STATE_LOADING_INTO_MEMORY.getText();
        }

        public String getRuleVersion() {
            return "1.00.00";
        }

        public ModuleReferenceList getRequiredModules() {
            return new KernelModuleReferenceList();
        }

        public Qedeq getQedeq() {
            return null;
        }

        public String getOriginalLanguage() {
            return "en";
        }

        public String getName() {
            return "dummy";
        }

        public ModuleAddress getModuleAddress() {
            return new DefaultModuleAddress();
        }

        public WellFormedState getWellFormedState() {
            return WellFormedState.STATE_UNCHECKED;
        }

        public LoadingState getLoadingState() {
            return LoadingState.STATE_LOADING_INTO_MEMORY;
        }

        public int getLoadingCompleteness() {
            return 0;
        }

        public SourceFileExceptionList getErrors() {
            return new SourceFileExceptionList();
        }

        public DependencyState getDependencyState() {
            return DependencyState.STATE_UNDEFINED;
        }

        public FormallyProvedState getFormallyProvedState() {
            return FormallyProvedState.STATE_UNCHECKED;
        }

        public AbstractState getCurrentState() {
            return LoadingState.STATE_LOADING_INTO_MEMORY;
        }

        public AbstractState getLastSuccessfulState() {
            return LoadingState.STATE_UNDEFINED;
        }

        public Service getCurrentlyRunningService() {
            return null;
        }

        public LoadingImportsState getLoadingImportsState() {
            return null;
        }

        public boolean hasLoadedImports() {
            return false;
        }
    };

}

From source file:org.qedeq.kernel.bo.log.ModuleEventListenerLogTest.java

protected void setUp() throws Exception {
    super.setUp();
    out = new ByteArrayOutputStream();
    listenerBasis = new LogListenerImpl(new PrintStream(out));
    QedeqLog.getInstance().addLog(listenerBasis);
    listener = new ModuleEventListenerLog();
    qedeq = new QedeqBo() {

        public boolean isSupportedLanguage(String language) {
            return false;
        }/*w  w w . j a v a  2  s . c  om*/

        public boolean isLoaded() {
            return false;
        }

        public boolean isWellFormed() {
            return false;
        }

        public boolean isFullyFormallyProved() {
            return false;
        }

        public boolean hasWarnings() {
            return false;
        }

        public boolean hasLoadedRequiredModules() {
            return false;
        }

        public boolean hasErrors() {
            return false;
        }

        public boolean hasBasicFailures() {
            return false;
        }

        public SourceFileExceptionList getWarnings() {
            return new SourceFileExceptionList();
        }

        public String getUrl() {
            return "dummy";
        }

        public String[] getSupportedLanguages() {
            return ArrayUtils.EMPTY_STRING_ARRAY;
        }

        public String getStateDescription() {
            return LoadingState.STATE_LOADING_INTO_MEMORY.getText();
        }

        public String getRuleVersion() {
            return "1.00.00";
        }

        public ModuleReferenceList getRequiredModules() {
            return new KernelModuleReferenceList();
        }

        public Qedeq getQedeq() {
            return null;
        }

        public String getOriginalLanguage() {
            return "en";
        }

        public String getName() {
            return "dummy";
        }

        public ModuleAddress getModuleAddress() {
            return new DefaultModuleAddress();
        }

        public WellFormedState getWellFormedState() {
            return WellFormedState.STATE_UNCHECKED;
        }

        public LoadingState getLoadingState() {
            return LoadingState.STATE_LOADING_INTO_MEMORY;
        }

        public int getLoadingCompleteness() {
            return 0;
        }

        public SourceFileExceptionList getErrors() {
            return new SourceFileExceptionList();
        }

        public DependencyState getDependencyState() {
            return DependencyState.STATE_UNDEFINED;
        }

        public FormallyProvedState getFormallyProvedState() {
            return FormallyProvedState.STATE_UNCHECKED;
        }

        public AbstractState getCurrentState() {
            return LoadingState.STATE_LOADING_INTO_MEMORY;
        }

        public AbstractState getLastSuccessfulState() {
            return LoadingState.STATE_UNDEFINED;
        }

        public Service getCurrentlyRunningService() {
            return null;
        }

        public LoadingImportsState getLoadingImportsState() {
            return LoadingImportsState.STATE_UNDEFINED;
        }

        public boolean hasLoadedImports() {
            return false;
        }

    };
}