Mistři v programování na #hovnokod

Java #76

private void setTims( String project )
{
    int endIndex = project.indexOf( "-" );
    boolean isNumber = false;
    if ( endIndex != -1 )
    {
        try
        {
            Integer.parseInt( project.substring( 0, endIndex ) );
            isNumber = true;
        }
        catch ( NumberFormatException e )
        {
            //ignore
        }
    }
    if ( isNumber )
    {
        runtimeContext.put( RuntimeContext.TIMS_NUMBER, project.substring( 0, endIndex ) );
    }
    else
    {
        runtimeContext.put( RuntimeContext.TIMS_NUMBER, project );
    }
}

Anonymous,