String userMode = getStringProperty("mode"); if(userMode != null)
if(mode == null) throw new NullPointerException("Mode must be non-null");        if(getProperty("tabSize") .equals(mode.getProperty("tabSize"))) unsetProperty("tabSize");  if(getProperty("indentSize") .equals(mode.getProperty("indentSize"))) unsetProperty("indentSize");  if(getProperty("maxLineLen") .equals(mode.getProperty("maxLineLen"))) unsetProperty("maxLineLen");   Mode oldMode = this.mode;  this.mode = mode;   putProperty("tabSize",getProperty("tabSize")); putProperty("indentSize",getProperty("indentSize")); putProperty("maxLineLen",getProperty("maxLineLen"));   propertiesChanged();   if(oldMode != null && !getFlag(TEMPORARY))
	public void setMode()	{		String userMode = getStringProperty("mode");		if(userMode != null)		{			Mode m = jEdit.getMode(userMode);			if(m != null)			{				setMode(m);				return;			}		}		String nogzName = name.substring(0,name.length() -			(name.endsWith(".gz") ? 3 : 0));		Mode[] modes = jEdit.getModes();		String firstLine = getLineText(0);		for(int i = 0; i < modes.length; i++)		{			if(modes[i].accept(nogzName,firstLine))			{				setMode(modes[i]);				return;			}		}		Mode defaultMode = jEdit.getMode(jEdit.getProperty("buffer.defaultMode"));		if(defaultMode == null)			defaultMode = jEdit.getMode("text");		setMode(defaultMode);	} //}}}