Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 107320
Collapse All | Expand All

(-)src/org/eclipse/wst/sse/core/internal/FileBufferModelManager.java (-24 / +29 lines)
Lines 366-372 Link Here
366
		}
366
		}
367
367
368
		String id = null;
368
		String id = null;
369
		IPath path = file.getLocation();
369
		IPath path = file.getFullPath();
370
		if (path != null) {
370
		if (path != null) {
371
			/*
371
			/*
372
			 * The ID of models must be the same as the normalized paths
372
			 * The ID of models must be the same as the normalized paths
Lines 533-563 Link Here
533
			if (Logger.DEBUG_FILEBUFFERMODELMANAGEMENT) {
533
			if (Logger.DEBUG_FILEBUFFERMODELMANAGEMENT) {
534
				Logger.log(Logger.INFO, "FileBufferModelManager connecting to IFile " + file.getLocation()); //$NON-NLS-1$
534
				Logger.log(Logger.INFO, "FileBufferModelManager connecting to IFile " + file.getLocation()); //$NON-NLS-1$
535
			}
535
			}
536
			bufferManager.connect(file.getLocation(), getProgressMonitor());
536
			// see TextFileDocumentProvider#createFileInfo about why we use IFile#getFullPath
537
			ITextFileBuffer buffer = bufferManager.getTextFileBuffer(file.getLocation());
537
			// here, not IFile#getLocation.
538
			if (buffer != null) {
538
			IPath location= file.getFullPath();
539
				DocumentInfo info = (DocumentInfo) fDocumentMap.get(buffer.getDocument());
539
			if (location != null) {
540
				if (info != null) {
540
				bufferManager.connect(location, getProgressMonitor());
541
				ITextFileBuffer buffer = bufferManager.getTextFileBuffer(location);
542
				if (buffer != null) {
543
					DocumentInfo info = (DocumentInfo) fDocumentMap.get(buffer.getDocument());
544
					if (info != null) {
545
						/*
546
						 * Note: "info" being null at this point is a slight
547
						 * error.
548
						 * 
549
						 * The connect call from above (or at some time earlier in
550
						 * the session) would have notified the FileBufferMapper
551
						 * of the creation of the corresponding text buffer and
552
						 * created the DocumentInfo object for
553
						 * IStructuredDocuments.
554
						 */
555
						info.selfConnected = true;
556
					}
541
					/*
557
					/*
542
					 * Note: "info" being null at this point is a slight
558
					 * Check the document type. Although returning null for
543
					 * error.
559
					 * unknown documents would be fair, try to get a model if the
544
					 * 
560
					 * document is at least a valid type.
545
					 * The connect call from above (or at some time earlier in
546
					 * the session) would have notified the FileBufferMapper
547
					 * of the creation of the corresponding text buffer and
548
					 * created the DocumentInfo object for
549
					 * IStructuredDocuments.
550
					 */
561
					 */
551
					info.selfConnected = true;
562
					IDocument bufferDocument = buffer.getDocument();
552
				}
563
					if (bufferDocument instanceof IStructuredDocument) {
553
				/*
564
						model = getModel((IStructuredDocument) bufferDocument);
554
				 * Check the document type. Although returning null for
565
					}
555
				 * unknown documents would be fair, try to get a model if the
556
				 * document is at least a valid type.
557
				 */
558
				IDocument bufferDocument = buffer.getDocument();
559
				if (bufferDocument instanceof IStructuredDocument) {
560
					model = getModel((IStructuredDocument) bufferDocument);
561
				}
566
				}
562
			}
567
			}
563
		}
568
		}

Return to bug 107320