Author: akazakov
Date: 2007-10-16 08:44:08 -0400 (Tue, 16 Oct 2007)
New Revision: 4222
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/RedHatHtmlContentAssistProcessor.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-1078 Removed unnecessary NullPointerException
Modified:
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/RedHatHtmlContentAssistProcessor.java
===================================================================
---
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/RedHatHtmlContentAssistProcessor.java 2007-10-16
12:28:25 UTC (rev 4221)
+++
trunk/jst/plugins/org.jboss.tools.jst.jsp/src/org/jboss/tools/jst/jsp/contentassist/RedHatHtmlContentAssistProcessor.java 2007-10-16
12:44:08 UTC (rev 4222)
@@ -398,23 +398,25 @@
} catch(Exception e) {
JspEditorPlugin.getPluginLog().logError(e);
}
- for (Iterator iter = kbProposals.iterator(); iter.hasNext();) {
- KbProposal kbProposal = (KbProposal) iter.next();
- if(ignoreProposal(kbProposal)) {
- continue;
+ if(kbProposals!=null) {
+ for (Iterator iter = kbProposals.iterator(); iter.hasNext();) {
+ KbProposal kbProposal = (KbProposal) iter.next();
+ if(ignoreProposal(kbProposal)) {
+ continue;
+ }
+ String proposedInfo = kbProposal.getContextInfo();
+ String kbReplacementString = kbProposal.getReplacementString();
+ String replacementString = kbReplacementString + ">";
+ String displayString = kbProposal.getLabel();
+ boolean autoContentAssistant = replacementString.indexOf('\"')>-1
&& replacementString.indexOf("=")>-1;
+ int cursorAdjustment = replacementString.length();
+ if(!kbReplacementString.endsWith("/")) {
+ replacementString = replacementString + "</" + displayString +
">";
+ }
+ Image image =
XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC);
+ RedHatCustomCompletionProposal proposal = new
RedHatCustomCompletionProposal(autoContentAssistant, replacementString,
contentAssistRequest.getReplacementBeginPosition(),
contentAssistRequest.getReplacementLength(), cursorAdjustment, image, displayString, null,
proposedInfo, XMLRelevanceConstants.R_TAG_NAME);
+ contentAssistRequest.addProposal(proposal);
}
- String proposedInfo = kbProposal.getContextInfo();
- String kbReplacementString = kbProposal.getReplacementString();
- String replacementString = kbReplacementString + ">";
- String displayString = kbProposal.getLabel();
- boolean autoContentAssistant = replacementString.indexOf('\"')>-1
&& replacementString.indexOf("=")>-1;
- int cursorAdjustment = replacementString.length();
- if(!kbReplacementString.endsWith("/")) {
- replacementString = replacementString + "</" + displayString +
">";
- }
- Image image =
XMLEditorPluginImageHelper.getInstance().getImage(XMLEditorPluginImages.IMG_OBJ_TAG_GENERIC);
- RedHatCustomCompletionProposal proposal = new
RedHatCustomCompletionProposal(autoContentAssistant, replacementString,
contentAssistRequest.getReplacementBeginPosition(),
contentAssistRequest.getReplacementLength(), cursorAdjustment, image, displayString, null,
proposedInfo, XMLRelevanceConstants.R_TAG_NAME);
- contentAssistRequest.addProposal(proposal);
}
super.addTagNameProposals(contentAssistRequest, childPosition);
}
@@ -471,7 +473,7 @@
public void addTaglib(String uri, String prefix) {
}
-
+
public void removeTaglib(String uri, String prefix) {
}
@@ -539,4 +541,4 @@
jspActiveCAP = new JSPActiveContentAssistProcessor();
jspActiveCAP.init();
}
-}
+}
\ No newline at end of file