Changeset 28479

Show
Ignore:
Timestamp:
01/04/08 14:06:56 (1 year ago)
Author:
sfermigier
Message:

Forward port.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • org.nuxeo.common/trunk/src/main/java/org/nuxeo/common/utils/ArrayUtils.java

    r19046 r28479  
    5151    public static <T> T[] arrayMerge(T[]... arrays) { 
    5252        int count = 0; 
    53         Class<? extends Object> klass = null; 
     53        Class<?> klass = null; 
    5454        for (T[] array : arrays) { 
    5555            count += array.length; 
  • org.nuxeo.common/trunk/src/main/java/org/nuxeo/common/utils/StringUtils.java

    r28170 r28479  
    240240     */ 
    241241    public static String expandVars(String expression, 
    242             Map<? extends Object, ? extends Object> properties) { 
     242            Map<?, ?> properties) { 
    243243        int p = expression.indexOf("${"); 
    244244        if (p == -1) { 
  • org.nuxeo.common/trunk/src/main/java/org/nuxeo/common/xmap/Path.java

    r28170 r28479  
    2121 
    2222import java.util.ArrayList; 
     23import java.util.List; 
    2324 
    2425/** 
     
    6263 
    6364    private void parse(String path) { 
    64         ArrayList<String> seg = new ArrayList<String>(); 
     65        List<String> seg = new ArrayList<String>(); 
    6566        StringBuilder buf = new StringBuilder(); 
    6667        char[] chars = path.toCharArray(); 
  • org.nuxeo.common/trunk/src/main/java/org/nuxeo/common/xmap/XAnnotatedList.java

    r26228 r28479  
    2323import java.util.ArrayList; 
    2424import java.util.Collection; 
     25import java.util.List; 
    2526 
    2627import org.nuxeo.common.collections.PrimitiveArrays; 
     
    6465    @Override 
    6566    protected Object getValue(Context ctx, Element base) throws Exception { 
    66         ArrayList<Object> values = new ArrayList<Object>(); 
     67        List<Object> values = new ArrayList<Object>(); 
    6768        if (xao != null) { 
    6869            DOMHelper.visitNodes(ctx, this, base, path, elementListVisitor, values); 
  • org.nuxeo.ecm.core/trunk/nuxeo-core-api/src/main/java/org/nuxeo/ecm/core/api/InvalidProxyDocOperation.java

    r24143 r28479  
    3030 
    3131    public InvalidProxyDocOperation() { 
    32         super(); 
    3332    } 
    3433 
  • org.nuxeo.ecm.core/trunk/nuxeo-core-api/src/main/java/org/nuxeo/ecm/core/api/impl/DocumentModelImpl.java

    r28182 r28479  
    146146    private ScopedMap contextData; 
    147147 
     148    @SuppressWarnings({"CollectionDeclaredAsConcreteClass"}) 
    148149    protected HashMap<String, Serializable> prefetch; 
    149150 
  • org.nuxeo.ecm.core/trunk/nuxeo-core-api/src/main/java/org/nuxeo/ecm/core/api/model/impl/ListProperty.java

    r28190 r28479  
    2121 
    2222import java.io.Serializable; 
    23 import java.lang.reflect.Array; 
    2423import java.util.ArrayList; 
    2524import java.util.Arrays; 
     
    3938import org.nuxeo.ecm.core.api.model.ReadOnlyPropertyException; 
    4039import org.nuxeo.ecm.core.schema.types.Field; 
    41 import org.nuxeo.ecm.core.schema.types.JavaTypes; 
    4240import org.nuxeo.ecm.core.schema.types.ListType; 
    4341 
     
    127125    } 
    128126 
    129     public Property get(int i
     127    public Property get(int index
    130128            throws UnsupportedOperationException { 
    131         return children.get(i); 
     129        return children.get(index); 
    132130    } 
    133131 
     
    142140            return null; 
    143141        } 
     142        //noinspection CollectionDeclaredAsConcreteClass 
    144143        ArrayList<Object> list = new ArrayList<Object>(children.size()); 
    145144        for (Property property : children) { 
  • org.nuxeo.ecm.core/trunk/nuxeo-core-api/src/main/java/org/nuxeo/ecm/core/api/repository/Repository.java

    r28346 r28479  
    4747    @XNode("@repositoryUri") 
    4848    private String repositoryUri; 
     49 
    4950    @XNode("@name") 
    5051    private String name; 
     52 
    5153    @XNode("@group") 
    5254    private String group; 
     55 
    5356    @XNode("@label") 
    5457    private String label; 
     58 
    5559    @XNodeMap(value = "property", key = "@name", type = HashMap.class, componentType = String.class) 
    56     private HashMap<String, String> properties; 
     60    private Map<String, String> properties; 
    5761 
    5862    public Repository() { 
    59     } 
    60  
    61     public Repository(String name) { 
    62         this (name, name); 
    6363    } 
    6464 
     
    6767        this.label = label; 
    6868        properties = new HashMap<String, String>(); 
     69    } 
     70 
     71    public Repository(String name) { 
     72        this(name, name); 
    6973    } 
    7074 
     
    9397     * @return the properties. 
    9498     */ 
    95     public HashMap<String, String> getProperties() { 
     99    public Map<String, String> getProperties() { 
    96100        return properties; 
    97101    } 
  • org.nuxeo.ecm.core/trunk/nuxeo-core-api/src/test/java/org/nuxeo/ecm/core/api/security/TestACP.java

    r28346 r28479  
    2121 
    2222import java.util.HashSet; 
     23import java.util.Set; 
    2324 
    2425import junit.framework.TestCase; 
     
    106107 
    107108    public void testPermissionsAPI() { 
    108         ACP acp = new ACPImpl(); 
    109109        ACL acl = new ACLImpl("acl1"); 
    110110 
     
    126126        assertEquals(1, usernames.length); 
    127127 
    128         HashSet<String> perms = new HashSet<String>(3); 
     128        Set<String> perms = new HashSet<String>(3); 
    129129        perms.add(SecurityConstants.BROWSE); 
    130130        perms.add(SecurityConstants.READ); 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-archive-web/src/main/java/org/nuxeo/ecm/platform/archive/web/listener/ejb/ArchiveManagerActionsBean.java

    r28471 r28479  
    151151        archiveRecords = null; 
    152152        selectedArchiveRecord = null; 
    153         setShowCreateForm(false)
     153        showCreateForm = false
    154154        required = true; 
    155155    } 
     
    175175        documentVersions.add(new SelectItem(ver.toString(), ver.toString())); 
    176176 
    177         DocumentModel tempDoc; 
    178177        if (!currentDocument.isProxy()) { 
    179178            for (VersionModel version : currentSession.getVersionsForDocument(currentDocument.getRef())) { 
    180                 tempDoc = currentSession.getDocumentWithVersion( 
     179                DocumentModel tempDoc = currentSession.getDocumentWithVersion( 
    181180                        currentDocument.getRef(), version); 
    182181                if (tempDoc != null) { 
     
    194193 
    195194    public String addArchiveRecord() throws Exception { 
    196         String message = null
    197         String eventId = null
     195        String message
     196        String eventId
    198197        if (selectedArchiveRecord.getId() == 0) { 
    199198            archiveManager.addArchiveRecord(selectedArchiveRecord); 
     
    214213                resourcesAccessor.getMessages().get(message)); 
    215214 
    216         setShowCreateForm(false)
     215        showCreateForm = false
    217216        notifyEvent(eventId, navigationContext.getCurrentDocument(), null, 
    218217                null, null, true); 
     
    242241        selectedArchiveRecord = null; 
    243242        required = true; 
    244         setShowCreateForm(false)
     243        showCreateForm = false
    245244        return "document_archive"; 
    246245    } 
     
    248247    public String editArchiveRecord() throws Exception { 
    249248        selectedArchiveRecord = sel; 
    250         setShowCreateForm(true)
     249        showCreateForm = true
    251250        required = true; 
    252251        commandName1 = "command.edit"; 
    253252        commandName2 = "command.cancel"; 
    254         setEditable(true)
     253        editable = true
    255254        style = "none"; 
    256255        return "document_archive"; 
     
    259258    public String viewArchiveRecord() throws Exception { 
    260259        selectedArchiveRecord = sel; 
    261         setShowCreateForm(true)
     260        showCreateForm = true
    262261        required = true; 
    263262        commandName2 = "command.ok"; 
    264         setEditable(false)
     263        editable = false
    265264        style = "notEditable"; 
    266265        return "document_archive"; 
     
    276275 
    277276    public void toggleCreateForm(ActionEvent event) { 
    278         if (getShowCreateForm()) { 
     277        if (showCreateForm) { 
    279278            showCreateForm = false; 
    280279        } else { 
     
    296295    } 
    297296 
    298     public static void initializeArchiveManager() throws Exception { 
     297    public void initializeArchiveManager() throws Exception { 
    299298        log.debug("Initializing ..."); 
    300299    } 
     
    432431        return docMsgProducer; 
    433432    } 
     433 
    434434} 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-audit-client/src/main/java/org/nuxeo/ecm/platform/audit/ws/ModifiedDocumentDescriptor.java

    r28475 r28479  
    3030public class ModifiedDocumentDescriptor { 
    3131 
    32     private String modified; 
     32    private final String modified; 
    3333 
    34     private String type; 
     34    private final String type; 
    3535 
    36     private String uuid; 
    37  
    38     public ModifiedDocumentDescriptor() { 
    39         super(); 
    40     } 
     36    private final String uuid; 
    4137 
    4238    public ModifiedDocumentDescriptor(Date modified, String type, 
    4339            String uuid) { 
    44         super(); 
    4540        this.modified = modified.toString(); 
    4641        this.type = type; 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-audit-facade/src/main/java/org/nuxeo/ecm/platform/audit/ejb/LogEntryImpl.java

    r21918 r28479  
    6262 
    6363    public  LogEntryImpl() { 
    64        super(); 
    6564    } 
    6665 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-directory-api/src/main/java/org/nuxeo/ecm/directory/DirectoryException.java

    r23037 r28479  
    3232 
    3333    public DirectoryException() { 
    34         super(); 
    3534    } 
    3635 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-directory-ldap/src/main/java/org/nuxeo/ecm/directory/ldap/LDAPFilterMatcher.java

    r26973 r28479  
    117117     * @throws DirectoryException 
    118118     */ 
    119     private boolean simpleMatch(Attributes attributes, SimpleNode simpleElement) 
     119    private static boolean simpleMatch(Attributes attributes, SimpleNode simpleElement) 
    120120            throws DirectoryException { 
    121121        Attribute attribute = attributes.get(simpleElement.getAttribute()); 
     
    125125        } 
    126126        try { 
    127             NamingEnumeration<? extends Object> rawValues = attribute.getAll(); 
     127            NamingEnumeration<?> rawValues = attribute.getAll(); 
    128128            while (rawValues.hasMore()) { 
    129129                String rawValue = rawValues.next().toString(); 
     
    157157                return false; 
    158158            } 
    159             NamingEnumeration<? extends Object> rawValues = attribute.getAll(); 
     159            NamingEnumeration<?> rawValues = attribute.getAll(); 
    160160            while (rawValues.hasMore()) { 
    161161                String rawValue = rawValues.next().toString(); 
     
    221221        } 
    222222    } 
     223 
    223224} 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-directory-ldap/src/main/java/org/nuxeo/ecm/directory/ldap/LDAPReference.java

    r28471 r28479  
    484484                    Attributes sourceAttributes = results.next().getAttributes(); 
    485485 
    486                     NamingEnumeration<? extends Object> ldapUrls = sourceAttributes.get( 
     486                    NamingEnumeration<?> ldapUrls = sourceAttributes.get( 
    487487                            dynamicAttributeId).getAll(); 
    488488                    while (ldapUrls.hasMore()) { 
    489                         LdapURL ldapUrl = new LdapURL( 
    490                                 ldapUrls.next().toString()); 
     489                        LdapURL ldapUrl = new LdapURL(ldapUrls.next().toString()); 
    491490 
    492491                        // check base URL 
     
    567566     * Optim method to spare a LDAP request when the caller is a LDAPSession 
    568567     * object that has already fetched the LDAP Attribute instances. 
    569      * 
     568     * <p> 
    570569     * This method should return the same results as the sister method: 
    571570     * org.nuxeo.ecm.directory.Reference#getTargetIdsForSource(java.lang.String) 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-directory-ldap/src/test/java/org/nuxeo/ecm/directory/ldap/LdapTestServer.java

    r26973 r28479  
    232232        try { 
    233233            initConfiguration(); 
    234             env.putAll((Map<? extends Object, ? extends Object>) cfg.toJndiEnvironment()); 
     234            env.putAll(cfg.toJndiEnvironment()); 
    235235            serverContext = new InitialDirContext(env); 
    236236        } catch (NamingException e) { 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-forms-layout-api/src/main/java/org/nuxeo/ecm/platform/forms/layout/api/impl/LayoutImpl.java

    r25680 r28479  
    3535    private static final long serialVersionUID = -8975637002024432963L; 
    3636 
    37     String id = null
     37    String id
    3838 
    39     String name; 
     39    final String name; 
    4040 
    41     String mode; 
     41    final String mode; 
    4242 
    43     String template; 
     43    final String template; 
    4444 
    4545    LayoutRow[] rows; 
    4646 
    47     int columns; 
     47    final int columns; 
    4848 
    4949    private LayoutImpl(String name, String mode, String template, int columns) { 
    50         super(); 
    5150        this.name = name; 
    5251        this.mode = mode; 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-forms-layout-api/src/main/java/org/nuxeo/ecm/platform/forms/layout/api/impl/LayoutRowImpl.java

    r26037 r28479  
    3434    private static final long serialVersionUID = 1528198770297610864L; 
    3535 
    36     Widget[] widgets; 
     36    final Widget[] widgets; 
    3737 
    3838    public LayoutRowImpl(Widget[] widgets) { 
    39         super(); 
    4039        this.widgets = widgets; 
    4140    } 
    4241 
    4342    public LayoutRowImpl(List<Widget> widgets) { 
    44         super(); 
    4543        this.widgets = widgets.toArray(new Widget[]{}); 
    4644    } 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-forms-layout-api/src/main/java/org/nuxeo/ecm/platform/forms/layout/api/impl/WidgetImpl.java

    r26810 r28479  
    3636    private static final long serialVersionUID = -2954101230598440812L; 
    3737 
    38     String id = null
     38    String id
    3939 
    40     String layoutName; 
     40    final String layoutName; 
    4141 
    42     String name; 
     42    final String name; 
    4343 
    44     String mode; 
     44    final String mode; 
    4545 
    46     String type; 
     46    final String type; 
    4747 
    48     FieldDefinition[] fields; 
     48    final FieldDefinition[] fields; 
     49 
     50    final String helpLabel; 
     51 
     52    final Widget[] subWidgets; 
     53 
     54    final Map<String, Serializable> properties; 
     55 
     56    final boolean required; 
    4957 
    5058    String valueName; 
     
    5260    String label; 
    5361 
    54     String helpLabel; 
    55  
    5662    boolean translated = false; 
    57  
    58     Map<String, Serializable> properties; 
    59  
    60     boolean required; 
    61  
    62     Widget[] subWidgets; 
    6363 
    6464    public WidgetImpl(String layoutName, String name, String mode, String type, 
     
    6767            Map<String, Serializable> properties, boolean required, 
    6868            Widget[] subWidgets) { 
    69         super(); 
    7069        this.layoutName = layoutName; 
    7170        this.name = name; 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-forms-layout-api/src/main/java/org/nuxeo/ecm/platform/forms/layout/api/impl/WidgetTypeImpl.java

    r26037 r28479  
    3333    private static final long serialVersionUID = -6449946287266106594L; 
    3434 
    35     String name; 
     35    final String name; 
    3636 
    37     Class<?> typeClass; 
     37    final Class<?> typeClass; 
    3838 
    39     Map<String, String> properties; 
     39    final Map<String, String> properties; 
    4040 
    4141    public WidgetTypeImpl(String name, Class<?> typeClass, 
    4242            Map<String, String> properties) { 
    43         super(); 
    4443        this.name = name; 
    4544        this.typeClass = typeClass; 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-forms-layout-client/src/main/java/org/nuxeo/ecm/platform/forms/layout/descriptors/FieldDescriptor.java

    r26037 r28479  
    4141 
    4242    public FieldDescriptor() { 
    43         super(); 
    4443    } 
    4544 
    4645    public FieldDescriptor(String schema, String field) { 
    47         super(); 
    4846        this.schema = schema; 
    4947        this.field = field; 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-forms-layout-client/src/main/java/org/nuxeo/ecm/platform/forms/layout/descriptors/LayoutDescriptor.java

    r24688 r28479  
    5555    Map<String, WidgetDefinition> widgets = new HashMap<String, WidgetDefinition>(); 
    5656 
    57     String[][] stringRows = null
     57    String[][] stringRows
    5858 
    59     Integer columns = null
     59    Integer columns
    6060 
    6161    public String getName() { 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-forms-layout-client/src/main/java/org/nuxeo/ecm/platform/forms/layout/descriptors/WidgetDescriptor.java

    r26810 r28479  
    102102        if (props != null && props.containsKey(REQUIRED_PROPERTY_NAME)) { 
    103103            Object value = props.get(REQUIRED_PROPERTY_NAME); 
    104             if (!(value instanceof String)) { 
     104            if (value instanceof String) { 
     105                res = (String) value; 
     106            } else { 
    105107                log.error(String.format( 
    106108                        "Invalid property \"%s\" on widget %s: %s", 
    107109                        REQUIRED_PROPERTY_NAME, value, name)); 
    108             } else { 
    109                 res = (String) value; 
    110110            } 
    111111        } 
     
    133133    } 
    134134 
    135     private Map<String, Serializable> getProperties( 
     135    private static Map<String, Serializable> getProperties( 
    136136            Map<String, PropertiesDescriptor> map, String mode) { 
    137137        if (map == null) { 
  • org.nuxeo.ecm.platform/trunk/nuxeo-platform-imaging-core/src/main/java/org/nuxeo/ecm/platform/imaging/core/MimeUtils.java

    r23399 r28479  
    4040    private static final String MIME_IMAGE_BMP = "image/x-ms-bmp"; 
    4141 
    42     private static Map<String, String> mimeTypes = new HashMap<String, String>(); 
     42    private final static Map<String, String> mimeTypes = new HashMap<String, String>(); 
    4343 
    4444    static { 
     
    5353    } 
    5454 
    55     /** 
    56      * 
    57      */ 
     55    // Utility class 
    5856    private MimeUtils() { 
    5957  &