public String resolvePhysicalLocation(String baseLocation, String publicId, String logicalLocation) { // This class should never be called to perform physical resolution! // If it does we should log it as an error Logger.log(Logger.ERROR_DEBUG, "XMLCatalogIDResolver.resolvePhysicalLocation() called unexpectedly"); //$NON-NLS-1$ return logicalLocation; } }
Logger.log(Logger.ERROR, "IWAE0017E Unexpected IO exception occurred creating xml document");//$NON-NLS-1$
/** * Reports an error that occured while scanning - from the SED JFlex skeleton * * @param errorCode the code of the errormessage to display */ private void yy_ScanError(int errorCode) { try { Logger.log(Logger.ERROR, YY_ERROR_MSG[errorCode]); } catch (ArrayIndexOutOfBoundsException e) { Logger.log(Logger.ERROR, YY_ERROR_MSG[YY_UNKNOWN_ERROR]); } // DO NOT EXIT the VM on an error // System.exit(1); }
/** * Reports an error that occured while scanning. * * In a wellformed scanner (no or only correct usage of * yypushback(int) and a match-all fallback rule) this method * will only be called with things that "Can't Possibly Happen". * If this method is called, something is seriously wrong * (e.g. a JFlex bug producing a faulty scanner etc.). * * Usual syntax/scanner level error handling should be done * in error fallback rules. * * @param errorCode the code of the errormessage to display */ private void zzScanError(int errorCode) { String message; try { message = ZZ_ERROR_MSG[errorCode]; } catch (ArrayIndexOutOfBoundsException e) { message = ZZ_ERROR_MSG[ZZ_UNKNOWN_ERROR]; } Logger.log(Logger.ERROR, message); try { throw new Error(message); } catch(Error e) { // BC } }
protected void fireNodeParsed(IStructuredDocumentRegion fCurrentNode) { // never let an Exceptions from foreign code interfere with completion // of parsing. To get an exception here is definitely a program error // somewhere, // we can't afford to interrupt the flow of control. or backwards // typing can result! // // try { if (fCurrentNode != null && fStructuredDocumentRegionHandlers != null) { for (int i = 0; i < fStructuredDocumentRegionHandlers.size(); i++) ((StructuredDocumentRegionHandler) fStructuredDocumentRegionHandlers.get(i)).nodeParsed(fCurrentNode); } } catch (Exception e) { Logger.log(Logger.ERROR, e.getMessage()); } }
/** * @deprecated use batchModeStart and BatchModeEnd instead even if you do * not use batchModelStart/End, you still need to use the * try/finally pattern documented there. */ public void setBatchMode(boolean isBatch) { // This is some extra processing for clients to know they may be using // incorrectly if (isBatch) { if (isBatchChanges) { Logger.log(Logger.INFO_DEBUG, "setBatch was set to true when it was already true. This can be an indication of invalid calling order"); //$NON-NLS-1$ } } if (isBatch) { batchModeStart(); } else { batchModeEnd(); } }
/** * This method will replace the string at offset and length with a new * string. If the string to be replaced is the same as the new string, the * string will not be replaced. */ protected void replace(IStructuredDocument structuredDocument, int offset, int length, String string) { try { String structuredDocumentString = structuredDocument.get(offset, length); if (structuredDocumentString.compareTo(string) != 0) structuredDocument.replaceText(structuredDocument, offset, length, string); } catch (BadLocationException e) { // log for now, unless we find reason not to Logger.log(Logger.INFO, e.getMessage()); } }
if (catalog == null) Logger.log(Logger.ERROR_DEBUG, XMLCoreMessages.Catalog_resolution_null_catalog); return null; Logger.log(Logger.ERROR_DEBUG, XMLCoreMessages.Catalog_resolution_malformed_url); resolved = null; Logger.log(Logger.ERROR_DEBUG, XMLCoreMessages.Catalog_resolution_io_exception); resolved = null; Logger.log(Logger.ERROR_DEBUG, XMLCoreMessages.Catalog_resolution_malformed_url); resolved = null; Logger.log(Logger.ERROR_DEBUG, XMLCoreMessages.Catalog_resolution_io_exception); resolved = null;
private void processNextCatalogElements(IConfigurationElement[] childElementList) { if (catalog == null) return; for (int i = 0; i < childElementList.length; i++) { IConfigurationElement childElement = childElementList[i]; String location = childElement.getAttribute(OASISCatalogConstants.ATTR_CATALOG); // mandatory if (location == null || location.equals("")) //$NON-NLS-1$ { Logger.log(Logger.ERROR, XMLCoreMessages.Catalog_next_catalog_location_uri_not_set); continue; } INextCatalog nextCatalog = new NextCatalog(); String resolvedPath = resolvePath(location); nextCatalog.setCatalogLocation(resolvedPath); String id = childElement.getAttribute(OASISCatalogConstants.ATTR_ID); if (id != null && !id.equals("")) //$NON-NLS-1$ { nextCatalog.setId(id); } catalog.addCatalogElement(nextCatalog); } }
/** * This method is called to parse an annotation file and store the * contents into an annotationMap */ public void parse(AnnotationMap map, AnnotationFileInfo fileInfo) throws Exception { InputStream inputStream = null; try { URL url = Platform.find(Platform.getBundle(fileInfo.getBundleId()), Path.fromOSString(fileInfo.getAnnotationFileLocation())); if (url != null) { inputStream = url.openStream(); parse(map, inputStream, fileInfo); } } catch (Exception e) { Logger.log(Logger.WARNING_DEBUG, e.getMessage(), e); throw (e); } finally { try { if (inputStream != null) { inputStream.close(); } } catch (IOException e) { } } }
private int computeAvailableLineWidth(IStructuredDocument doc, int nodeOffset, int lineWidth) { // compute current available line width int currentAvailableLineWidth = 0; try { int lineOffset = doc.getLineInformationOfOffset(nodeOffset).getOffset(); String text = doc.get(lineOffset, nodeOffset - lineOffset); int usedWidth = getIndentationLength(text); currentAvailableLineWidth = lineWidth - usedWidth; } catch (BadLocationException e) { // log for now, unless we find reason not to Logger.log(Logger.INFO, e.getMessage()); } return currentAvailableLineWidth; }
private String getLineDelimiter(IStructuredDocument doc, int nodeOffset) { int line = doc.getLineOfOffset(nodeOffset); String lineDelimiter = doc.getLineDelimiter(); try { if (line > 0) { lineDelimiter = doc.getLineDelimiter(line - 1); } } catch (BadLocationException e) { // log for now, unless we find reason not to Logger.log(Logger.INFO, e.getMessage()); } // BUG115716: if cannot get line delimiter from current line, just // use default line delimiter if (lineDelimiter == null) lineDelimiter = doc.getLineDelimiter(); return lineDelimiter; }
} catch (BadLocationException e) { Logger.log(Logger.INFO, e.getMessage());
/** * This method will replace the node value with a new string. If the node * value to be replaced is the same as the new string, the node value will * not be replaced. */ protected void replaceNodeValue(IDOMNode node, String string) { IDOMModel structuredModel = node.getModel(); IStructuredDocument structuredDocument = structuredModel.getStructuredDocument(); int offset = node.getStartOffset(); int length = node.getEndOffset() - node.getStartOffset(); try { String structuredDocumentString = structuredDocument.get(offset, length); if (structuredDocumentString.compareTo(string) != 0) replace(structuredDocument, offset, length, string); } catch (BadLocationException e) { // log for now, unless we find reason not to Logger.log(Logger.INFO, e.getMessage()); } }
private String getLineDelimiter(IDOMNode node, IStructuredDocument doc) { int line = doc.getLineOfOffset(node.getStartOffset()); String lineDelimiter = doc.getLineDelimiter(); try { if (line > 0) { lineDelimiter = doc.getLineDelimiter(line - 1); } } catch (BadLocationException e) { // log for now, unless we find reason not to Logger.log(Logger.INFO, e.getMessage()); } // BUG115716: if cannot get line delimiter from current line, just // use default line delimiter if (lineDelimiter == null) lineDelimiter = doc.getLineDelimiter(); return lineDelimiter; }
public void addEntriesFromCatalog(ICatalog catalog) { try { setNotificationEnabled(false); if (catalog != null) { ICatalogElement[] entries = ((Catalog)catalog).getCatalogElements(); for (int i = 0; i < entries.length; i++) { CatalogElement clone = (CatalogElement)((CatalogElement)entries[i]).clone(); addCatalogElement(clone); } } else { Logger.log(Logger.ERROR, "argument was null in Catalog.addEntriesFromCatalog"); //$NON-NLS-1$ } } finally { setNotificationEnabled(true); } internalResolver = null; notifyChanged(); }
Logger.log(Logger.INFO, e.getMessage());