Java.

    Date: 09/04/07 (Code WTF)    Keywords: no keywords

    Плакал. Есть такое замечательное произведение индийского искусства:

    public class Score
    {

    File file, file1, file2, file3, file4, file5, file6, file7, file8, file9, file10, file11, file12, file13, file14, file15;

    //get|set методы для каждого поля!
    ....
    }

    Ну и соответственно это вызывается:
    Class[] classArray = new Class[1];
    classArray[0] = File.class;
    Object[] objArray = new Object[1];
    for (int i = 0; ... ; i++)
    {
          objArray[0] = /*some File from array*/;
    try
    {
        method = score.getClass().getMethod("setFile" + i, classArray);
        method.invoke(score, objArray);
    } catch (NoSuchMethodException e)
    {
    log.debug("Unable to find such method", e);
    } catch (IllegalAccessException e)
    {
    log.debug("Illegal access error", e);
    } catch (InvocationTargetException e)
    {
    log.debug("Wrong invocation target", e);
    }
    }

    Source: http://community.livejournal.com/code_wtf/99433.html

« Password encryption || вот такой у нас... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home