click-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From take...@apache.org
Subject svn commit: r795897 - /incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/
Date Mon, 20 Jul 2009 16:18:08 GMT
Author: takezoe
Date: Mon Jul 20 16:18:08 2009
New Revision: 795897

URL: http://svn.apache.org/viewvc?rev=795897&view=rev
Log:
Fixed warnings.

Modified:
    incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/ClickEditor.java
    incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/ClickXMLTextViewerConfiguration.java
    incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/LineStyleProviderForVelocity.java
    incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/TemplateContentAssistProcessor.java
    incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/TemplateEditorActionContributor.java
    incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/TemplateEditorConfiguration.java
    incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/TemplateObject.java

Modified: incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/ClickEditor.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/ClickEditor.java?rev=795897&r1=795896&r2=795897&view=diff
==============================================================================
--- incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/ClickEditor.java
(original)
+++ incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/ClickEditor.java
Mon Jul 20 16:18:08 2009
@@ -180,6 +180,7 @@
 		setActivePage(0);
 	}
 
+	@SuppressWarnings("unchecked")
 	public Object getAdapter(Class key) {
 		if (key.equals(IContentOutlinePage.class)) {
 			return sourceEditor.getAdapter(IContentOutlinePage.class);

Modified: incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/ClickXMLTextViewerConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/ClickXMLTextViewerConfiguration.java?rev=795897&r1=795896&r2=795897&view=diff
==============================================================================
--- incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/ClickXMLTextViewerConfiguration.java
(original)
+++ incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/ClickXMLTextViewerConfiguration.java
Mon Jul 20 16:18:08 2009
@@ -35,7 +35,7 @@
 public class ClickXMLTextViewerConfiguration extends StructuredTextViewerConfigurationXML
{
 	
 	public IHyperlinkDetector[] getHyperlinkDetectors(ISourceViewer sourceViewer) {
-		List result = new ArrayList(0);
+		List<IHyperlinkDetector> result = new ArrayList<IHyperlinkDetector>(0);
 		result.add(new ClickXMLHyperlinkDetector());
 		
 		IHyperlinkDetector[] superDetectors = super.getHyperlinkDetectors(sourceViewer);
@@ -46,7 +46,7 @@
 			}
 		}
 		
-		return (IHyperlinkDetector[]) result.toArray(new IHyperlinkDetector[0]);
+		return result.toArray(new IHyperlinkDetector[0]);
 	}
 	
 }

Modified: incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/LineStyleProviderForVelocity.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/LineStyleProviderForVelocity.java?rev=795897&r1=795896&r2=795897&view=diff
==============================================================================
--- incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/LineStyleProviderForVelocity.java
(original)
+++ incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/LineStyleProviderForVelocity.java
Mon Jul 20 16:18:08 2009
@@ -41,6 +41,8 @@
  */
 public class LineStyleProviderForVelocity extends LineStyleProviderForHTML {
 
+	@Override
+	@SuppressWarnings("unchecked")
 	public boolean prepareRegions(ITypedRegion currentRegion, int start, int length, Collection
styleRanges) {
         boolean result = super.prepareRegions(currentRegion, start, length, styleRanges);
         

Modified: incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/TemplateContentAssistProcessor.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/TemplateContentAssistProcessor.java?rev=795897&r1=795896&r2=795897&view=diff
==============================================================================
--- incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/TemplateContentAssistProcessor.java
(original)
+++ incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/TemplateContentAssistProcessor.java
Mon Jul 20 16:18:08 2009
@@ -69,7 +69,7 @@
 	private final Pattern PATTERN_SET = Pattern.compile("#set\\s*\\(\\s*\\$(.+?)\\s*=");
 	private final Pattern PATTERN_MACRO = Pattern.compile("#macro\\s*\\(\\s*(.+?)[\\s\\)]");
 	
-	private static final Map defaultObjects = new HashMap();
+	private static final Map<String, String> defaultObjects = new HashMap<String, String>();
 	static {
 		defaultObjects.put("imports", "org.apache.click.util.PageImports");
 		defaultObjects.put("context", "java.lang.String");
@@ -103,7 +103,7 @@
 	/**
 	 * Appends the completion proposal to the <code>result</code>.
 	 */
-	private static void registerProposal(List result, int offset, 
+	private static void registerProposal(List<ICompletionProposal> result, int offset,

 			String matchString, String replaceString, String displayString, Image image){
 		int position = replaceString.length();
 		if(replaceString.endsWith(")") && displayString.indexOf("()") < 0){
@@ -130,7 +130,7 @@
 	public ICompletionProposal[] computeCompletionProposals(ITextViewer textViewer, int offset)
{
 		
 		String matchString = getLastWord(textViewer, offset);
-		List result = new ArrayList();
+		List<ICompletionProposal> result = new ArrayList<ICompletionProposal>();
 		
 		if(!matchString.startsWith("#") && !matchString.startsWith("$")){
 			ICompletionProposal[] proposals = super.computeCompletionProposals(textViewer, offset);
@@ -142,7 +142,7 @@
 		}
 		
 		IType format = null;
-		List preferenceObjects = null;
+		List<VariableModel> preferenceObjects = null;
 		
 		if(this.file != null){
 			// for the format object
@@ -153,8 +153,8 @@
 				}
 			}
 			// other default objects
-			for(Iterator ite = defaultObjects.entrySet().iterator(); ite.hasNext(); ){
-				Map.Entry entry = (Map.Entry)ite.next();
+			for(Iterator<Map.Entry<String, String>> ite = defaultObjects.entrySet().iterator();
ite.hasNext(); ){
+				Map.Entry<String, String> entry = ite.next();
 				if(matchString.startsWith("$" + entry.getKey() + ".") || matchString.startsWith("${"
+ entry.getKey() + ".")){
 					IType type = findType((String)entry.getValue());
 					if(type != null){
@@ -169,7 +169,7 @@
 			if(vars != null && vars.length() > 0){
 				preferenceObjects = VariableModel.deserialize(vars);
 				for(int i=0;i<preferenceObjects.size();i++){
-					VariableModel model = (VariableModel) preferenceObjects.get(i);
+					VariableModel model = preferenceObjects.get(i);
 					if(matchString.startsWith("$" + model.name + ".") || matchString.startsWith("${" + model.name
+ ".")){
 						IType type = findType((String)model.type);
 						if(type != null){
@@ -180,10 +180,10 @@
 			}
 		}
 		
-		Map fields = extractPageFields();
-		for(Iterator ite = fields.entrySet().iterator(); ite.hasNext();){
-			Map.Entry entry = (Map.Entry)ite.next();
-			String name = (String)entry.getKey();
+		Map<String, TemplateObject> fields = extractPageFields();
+		for(Iterator<Map.Entry<String, TemplateObject>> ite = fields.entrySet().iterator();
ite.hasNext();){
+			Map.Entry<String, TemplateObject> entry = ite.next();
+			String name = entry.getKey();
 			if(matchString.startsWith("$" + name + ".") || matchString.startsWith("${" + name + ".")){
 				TemplateObject obj = (TemplateObject)entry.getValue();
 				if(obj.getType()!=null){
@@ -200,9 +200,9 @@
 		}
 		
 		// for page class fields
-		for(Iterator ite = fields.entrySet().iterator(); ite.hasNext();){
-			Map.Entry entry = (Map.Entry)ite.next();
-			String name = (String)entry.getKey();
+		for(Iterator<Map.Entry<String, TemplateObject>> ite = fields.entrySet().iterator();
ite.hasNext();){
+			Map.Entry<String, TemplateObject> entry = ite.next();
+			String name = entry.getKey();
 			TemplateObject obj = (TemplateObject)entry.getValue();
 			registerProposal(result, offset, matchString, 
 				"$" + name, "$" + name + " - " + obj.getTypeName(), IMAGE_FIELD);
@@ -269,7 +269,7 @@
 	/**
 	 * Read macro.vm and add macros to completion proposals.
 	 */
-	private void readMacroVM(List result, int offset, String matchString){
+	private void readMacroVM(List<ICompletionProposal> result, int offset, String matchString){
 		IProject project = this.file.getProject();
 		String folderName = ClickUtils.getWebAppRootFolder(project);
 		IFolder folder = project.getFolder(folderName);
@@ -298,7 +298,7 @@
 	/**
 	 * Returns completion proposals for the java object.
 	 */
-	private ICompletionProposal[] processType(IType type, List result, String matchString, int
offset){
+	private ICompletionProposal[] processType(IType type, List<ICompletionProposal> result,
String matchString, int offset){
 		String prefix = matchString;
 		int index = matchString.lastIndexOf('.');
 		if(index >= 0){
@@ -319,7 +319,7 @@
 				}
 			}
 		}
-		return (ICompletionProposal[])result.toArray(new ICompletionProposal[result.size()]);
+		return result.toArray(new ICompletionProposal[result.size()]);
 	}
 	
 	/**
@@ -364,8 +364,8 @@
 	/**
 	 * Extracts public fields from the page class.
 	 */
-	private Map extractPageFields(){
-		HashMap map = new HashMap();
+	private Map<String, TemplateObject> extractPageFields(){
+		HashMap<String, TemplateObject> map = new HashMap<String, TemplateObject>();
 		if(this.file != null){
 			try {
 				IType type = ClickUtils.getPageClassFromTemplate(this.file);

Modified: incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/TemplateEditorActionContributor.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/TemplateEditorActionContributor.java?rev=795897&r1=795896&r2=795897&view=diff
==============================================================================
--- incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/TemplateEditorActionContributor.java
(original)
+++ incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/TemplateEditorActionContributor.java
Mon Jul 20 16:18:08 2009
@@ -36,8 +36,8 @@
 
 public class TemplateEditorActionContributor extends ActionContributorHTML {
 
-	private List actionIds = new ArrayList();
-	private List actions = new ArrayList();
+	private List<String> actionIds = new ArrayList<String>();
+	private List<IAction> actions = new ArrayList<IAction>();
 
 	public TemplateEditorActionContributor(){
 		actionIds.add(ToggleCommentAction.class.getName());

Modified: incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/TemplateEditorConfiguration.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/TemplateEditorConfiguration.java?rev=795897&r1=795896&r2=795897&view=diff
==============================================================================
--- incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/TemplateEditorConfiguration.java
(original)
+++ incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/TemplateEditorConfiguration.java
Mon Jul 20 16:18:08 2009
@@ -54,7 +54,7 @@
 	 * @see TemplateAutoEditStrategy
 	 */
 	public IAutoEditStrategy[] getAutoEditStrategies(ISourceViewer sourceViewer, String contentType)
{
-		List allStrategies = new ArrayList(0);
+		List<IAutoEditStrategy> allStrategies = new ArrayList<IAutoEditStrategy>(0);
 		
 		IAutoEditStrategy[] superStrategies = super.getAutoEditStrategies(sourceViewer, contentType);
 		for (int i = 0; i < superStrategies.length; i++) {
@@ -63,7 +63,7 @@
 		
 		allStrategies.add(new TemplateAutoEditStrategy());
 
-		return (IAutoEditStrategy[]) allStrategies.toArray(new IAutoEditStrategy[allStrategies.size()]);
+		return allStrategies.toArray(new IAutoEditStrategy[allStrategies.size()]);
 	}
 	
 	/**

Modified: incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/TemplateObject.java
URL: http://svn.apache.org/viewvc/incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/TemplateObject.java?rev=795897&r1=795896&r2=795897&view=diff
==============================================================================
--- incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/TemplateObject.java
(original)
+++ incubator/click/trunk/tools/eclipse/org.apache.click.eclipse/src/org/apache/click/eclipse/ui/editor/TemplateObject.java
Mon Jul 20 16:18:08 2009
@@ -110,13 +110,13 @@
 		if(this.type!=null){
 			try {
 				IMethod[] methods = getAllMethods(type);
-				List result = new ArrayList();
+				List<TemplateObjectMethod> result = new ArrayList<TemplateObjectMethod>();
 				for(int i=0;i<methods.length;i++){
 					if(Flags.isPublic(methods[i].getFlags()) && !methods[i].isConstructor()){
 						result.add(new TemplateObjectMethod(methods[i]));
 					}
 				}
-				return (TemplateObjectMethod[])result.toArray(new TemplateObjectMethod[result.size()]);
+				return result.toArray(new TemplateObjectMethod[result.size()]);
 			} catch (JavaModelException e) {
 			}
 		}
@@ -132,7 +132,7 @@
 		if(this.type!=null){
 			try {
 				IMethod[] methods = getAllMethods(type);
-				List result = new ArrayList();
+				List<TemplateObjectProperty> result = new ArrayList<TemplateObjectProperty>();
 				for(int i=0;i<methods.length;i++){
 					if(Flags.isPublic(methods[i].getFlags()) && methods[i].getParameterTypes().length==0){
 						String name = methods[i].getElementName();
@@ -142,7 +142,7 @@
 						}
 					}
 				}
-				return (TemplateObjectProperty[])result.toArray(new TemplateObjectProperty[result.size()]);
+				return result.toArray(new TemplateObjectProperty[result.size()]);
 			} catch (JavaModelException e) {
 			}
 		}
@@ -155,7 +155,7 @@
 	 * @return the array of both methods and properties
 	 */
 	public TemplateObjectElement[] getChildren(){
-		List result = new ArrayList();
+		List<TemplateObjectElement> result = new ArrayList<TemplateObjectElement>();
 		if(this.type!=null){
 			TemplateObjectMethod[] methods = getMethods();
 			TemplateObjectProperty[] properties = getProperties();
@@ -165,8 +165,8 @@
 			for(int i=0;i<properties.length;i++){
 				result.add(properties[i]);
 			}
-			Collections.sort(result, new Comparator(){
-				public int compare(Object arg0, Object arg1) {
+			Collections.sort(result, new Comparator<TemplateObjectElement>(){
+				public int compare(TemplateObjectElement arg0, TemplateObjectElement arg1) {
 					return arg0.toString().compareTo(arg1.toString());
 				}
 			});
@@ -410,7 +410,7 @@
 	 * @throws JavaModelException
 	 */
 	private static IMethod[] getAllMethods(IType type) throws JavaModelException {
-		ArrayList list = new ArrayList();
+		ArrayList<IMethod> list = new ArrayList<IMethod>();
 		IMethod[] methods = type.getMethods();
 		for(int i=0;i<methods.length;i++){
 			if(!methods[i].isConstructor() && !methods[i].isMainMethod() && Flags.isPublic(methods[i].getFlags())){
@@ -429,7 +429,7 @@
 		return (IMethod[])list.toArray(new IMethod[list.size()]);
 	}
 	
-	private static void extractMethods(IType[] types, List methods) throws JavaModelException
{
+	private static void extractMethods(IType[] types, List<IMethod> methods) throws JavaModelException
{
 		for(int i=0;i<types.length;i++){
 			IMethod[] superMethods = types[i].getMethods();
 			for(int j=0;j<superMethods.length;j++){



Mime
View raw message