KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > ui > refactoring > nls > search > Properties


1 /*******************************************************************************
2  * Copyright (c) 2000, 2006 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11 package org.eclipse.jdt.internal.ui.refactoring.nls.search;
12
13 import java.util.Set JavaDoc;
14
15 import org.eclipse.core.runtime.Assert;
16
17
18
19 class Properties extends java.util.Properties JavaDoc {
20     
21     private static final long serialVersionUID= 1L;
22     
23     private Set JavaDoc fDuplicateKeys;
24
25     public Properties() {
26     }
27     
28     public Properties(Set JavaDoc duplicateKeys) {
29         super();
30         Assert.isNotNull(duplicateKeys);
31         fDuplicateKeys= duplicateKeys;
32     }
33     
34     public Properties (Properties properties, Set JavaDoc duplicateKeys) {
35         super(properties);
36         Assert.isNotNull(duplicateKeys);
37         fDuplicateKeys= duplicateKeys;
38     }
39     /*
40      * @see java.util.Map#put(Object, Object)
41      */

42     public Object JavaDoc put(Object JavaDoc arg0, Object JavaDoc arg1) {
43         if (arg0 != null && containsKey(arg0))
44             fDuplicateKeys.add(arg0);
45         return super.put(arg0, arg1);
46     }
47 }
48
Popular Tags