if(this.mode != null)
Mode oldMode = this.mode; if(oldMode != null)
	public void setMode(Mode mode)	{		/* This protects against stupid people (like me)		 * doing stuff like buffer.setMode(jEdit.getMode(...)); */		if(mode == null)			throw new NullPointerException("Mode must be non-null");		if(this.mode == mode)		{			// this helps out with reloading and so on			tokenizeLines();			return;		}		View[] views = jEdit.getViews();		if(this.mode != null)		{			for(int i = 0; i < views.length; i++)			{				View view = views[i];				if(view.getBuffer() == this)					this.mode.leaveView(view);			}			this.mode.leave(this);		}		this.mode = mode;		mode.enter(this);		setTokenMarker(mode.createTokenMarker());		for(int i = 0; i < views.length; i++)		{			View view = views[i];			if(view.getBuffer() == this)				this.mode.enterView(view);		}		// this is always fired, but there is no need to do it		// for temp. buffers		if(!getFlag(TEMPORARY))			EditBus.send(new BufferUpdate(this,BufferUpdate.MODE_CHANGED));	}