skip checkstyle: MissingSwitchDefault
961075
@Override
	protected int decode(ByteBuffer b, char[] chars, int pos, int len, MutableBoolean interrupt, int min) {
		if (b == null) {
			// end
			if (state == 0)
				return -1;
			chars[pos] = (char)val;
			state = 0;
			return 1;
		}
		int nb = 0;
		while ((state == 7 || b.hasRemaining()) && nb < len && (nb < min || interrupt == null || !interrupt.get())) {
			int a = state == 7 ? 0 : b.get() & 0xFF;
			switch (state) {
			case 0:
				if (a < 0x80) {
					// 0aaa aaaa
					chars[pos + (nb++)] = (char)a;
				} else if ((a & 0xE0) == 0xC0) {
					// 110a aaaa 10bb bbbb
					val = (a & 0x1F) << 6;
					state = 1;
				} else if ((a & 0xF0) == 0xE0) {
					// 1110 aaaa 10bb bbbb 10cc cccc
					val = (a & 0x0F) << 12;
					state = 2;
				} else if ((a & 0xF8) == 0xF0) {
					// 1111 0aaa 10bb bbbb 10cc cccc 10dd dddd
					val = (a & 0x07) << 12;
					state = 4;
				} else {
					chars[pos + (nb++)] = invalidChar;
				}
				break;
			case 1:
				// second byte of 110a aaaa 10bb bbbb
				if ((a & 0xC0) == 0x80) {
					chars[pos + (nb++)] = (char)(val | (a & 0x3F));
				} else {
					chars[pos + (nb++)] = invalidChar;
				}
				state = 0;
				break;
			case 2:
				// second byte of 1110 aaaa 10bb bbbb 10cc cccc
				if ((a & 0xC0) == 0x80) {
					val |= (a & 0x3F) << 6;
					state = 3;
				} else {
					chars[pos + (nb++)] = invalidChar;
					state = 0;
				}
				break;
			case 3:
				// third byte of 1110 aaaa 10bb bbbb 10cc cccc
				if ((a & 0xC0) == 0x80) {
					chars[pos + (nb++)] = (char)(val | (a & 0x3F));
				} else {
					chars[pos + (nb++)] = invalidChar;
				}
				state = 0;
				break;
			case 4:
				// second byte of 1111 0aaa 10bb bbbb 10cc cccc 10dd dddd
				if ((a & 0xC0) == 0x80) {
					val |= (a & 0x3F) << 6;
					state = 5;
				} else {
					chars[pos + (nb++)] = invalidChar;
					state = 0;
				}
				break;
			case 5:
				// third byte of 1111 0aaa 10bb bbbb 10cc cccc 10dd dddd
				if ((a & 0xC0) == 0x80) {
					val |= (a & 0x3F);
					state = 6;
				} else {
					chars[pos + (nb++)] = invalidChar;
					state = 0;
				}
				break;
			case 6:
				// fourth byte of 1111 0aaa 10bb bbbb 10cc cccc 10dd dddd
				if ((a & 0xC0) == 0x80) {
					// UTF-8:   [1111 0uuu] [10uu zzzz] [10yy yyyy] [10xx xxxx]*
					// Unicode: [1101 10ww] [wwzz zzyy] (high surrogate)
					//          [1101 11yy] [yyxx xxxx] (low surrogate)
					//          * uuuuu = wwww + 1
					int uuuuu = (val & 0x7C00) >> 10;
					// TODO if > 0x10 invalid Surrogate
					int wwww = uuuuu - 1;
					chars[pos + (nb++)] = (char)(0xD800 | (wwww << 6) | ((val & 0x3C0) >> 4) | ((val & 0x30) >> 4));
					val = (0xDC00 | ((val & 0xF) << 6) | (a & 0x3F));
					state = 7;
				} else {
					chars[pos + (nb++)] = invalidChar;
					state = 0;
				}
				break;
			case 7:
				chars[pos + (nb++)] = (char)val;
				state = 0;
				break;
			}
		}
		return nb;
	}
357060
function fixShortcut(name) {
	if(isMac) {
		name = name.replace("Ctrl", "Cmd");
	} else {
		name = name.replace("Cmd", "Ctrl");
	}
	return name;
}
623321
def _setDefaults(configObj={}):
    

    paramDict={"build":True,
              "single":True,
              "stepsize":10,
              "in_units":"cps",
              "wt_scl":1.,
              "pixfrac":1.,
              "kernel":"square",
              "fillval":999.,
              "maskval": None,
              "rot":0.,
              "scale":1.,
              "xsh":0.,
              "ysh":0.,
              "blotnx":2048,
              "blotny":2048,
              "outnx":4096,
              "outny":4096,
              "data":None,
              "driz_separate":True,
              "driz_combine":False}

    if(len(configObj) !=0):
        for key in configObj.keys():
            paramDict[key]=configObj[key]

    return paramDict
1121468
private function _checkSwitchDefaultOrder() {
		if ($this->_isActive('switchDefaultOrder')) {
			if ($this->statementStack->getCurrentStackItem()->switchHasDefault) {
				// The default flag is already set, it means that a previous case case a default
				$this->_writeError('switchDefaultOrder', $this->_getMessage('SWITCH_DEFAULT_ORDER'));
			}
		}
	}
768025
public void uncheck() {
        getDispatcher().beforeUncheck(this);
        
        RemoteWebElement e = (RemoteWebElement) getElement();
        while (e.isSelected()) {
            e.click();
        }
        if (Config.getBoolConfigProperty(ConfigProperty.ENABLE_GUI_LOGGING)) {
            logUIAction(UIActions.UNCHECKED);
        }
        
        getDispatcher().afterUncheck(this);
    }
1186271
public void switchOptimalSuiteForAvgPushdown () {
        m_displayColumns = m_avgPushdownDisplayColumns;
        m_aggResultColumns = m_avgPushdownAggResultColumns;
        m_groupByColumns = m_avgPushdownGroupByColumns;
        m_distinctGroupByColumns = m_avgPushdownDistinctGroupByColumns;
        m_orderColumns = m_avgPushdownOrderColumns;
        m_projectSchema = m_avgPushdownProjectSchema;
        m_distinctProjectSchema = m_avgPushdownFinalProjectSchema;
        m_hasComplexAgg = true;
        m_having = m_avgPushdownHaving;
    }
414340
def DefaultSelector(sock):
    ""
    global _DEFAULT_SELECTOR
    if _DEFAULT_SELECTOR is None:
        if has_selector('poll'):
            _DEFAULT_SELECTOR = PollSelector
        elif hasattr(select, 'select'):
            _DEFAULT_SELECTOR = SelectSelector
        else:
            raise RedisError('Platform does not support any selectors')
    return _DEFAULT_SELECTOR(sock)
490373
def _skip_remove(self):
        
        if "--checklist" not in self.extra:
            self.msg.template(78)
            print("| Insert packages to exception remove:")
            self.msg.template(78)
            try:
                self.skip = raw_input(" > ").split()
            except EOFError:
                print("")
                raise SystemExit()
        for s in self.skip:
            if s in self.removed:
                self.removed.remove(s)
201698
private function _checkSwitchNeedDefault() {
		if ($this->_isActive('switchNeedDefault')) {
			if (!$this->statementStack->getCurrentStackItem()->switchHasDefault) {
				// Direct call to reporter to include a custom line number.
				$this->_writeError('switchNeedDefault', $this->_getMessage('SWITCH_DEFAULT'), $this->_switchStartLine, $this->_config->getTestLevel('switchNeedDefault'));
			}
		}
	}
1286205
def switch(self, idx, u):
        """"""
        self.u[self.uid[idx]] = u
        self.rebuild = True
        self.system.dae.factorize = True
        logger.debug('<Line> Status switch to {} on idx {}.'.format(u, idx))
185408
function ( e ) {

        e.preventDefault();

        this.s[4].borderColor = this.colors.select;
        this.s[4].color = this.colors.select;

    }
242238
function isShiftKeyOnly(event) {
  return (
    !event.altKey &&
      !(event.metaKey || event.ctrlKey) &&
      event.shiftKey);
}
1194190
private Properties initChecksumProps(Map<String, Set<String>> useOldChecksums) {
        Properties checksumProps = new Properties();
        for (Set<String> set : useOldChecksums.values()) {
            for (String s : set) {
                checksumProps.put(s, "");
            }
        }
        return checksumProps;
    }
1146491
public void resetToDefaults()
    {
        gatekeeper.signIn();
        try
        {
            for (Iterator<Entry<String, ChangeStack<String>>> iter = properties.entrySet()
                                                                               .iterator(); iter.hasNext();)
            {
                Entry<String, ChangeStack<String>> entry = iter.next();

                String defaultValue = getDefaultValue(entry.getKey());
                if (defaultValue == null)
                {
                    iter.remove();
                    continue;
                }

                entry.getValue().push(defaultValue);
            }
        }
        finally
        {
            gatekeeper.signOut();
        }
    }
295314
function (applySwitchMargins) {
            var value;
            var binding = this._binding;
            if (!binding) {
                return;
            }

            value = binding.inside[binding.to];
            if (value == null) {
                value = 0;
            }
            if (value < 0) {
                value = 0;
            }
            if (value > 1) {
                value = 1;
            }
            if (this._isSwitch && applySwitchMargins) {
                if (value >= this._switchThreshold) {
                    value = 1;
                } else {
                    value = 0;
                }
            }
            this._value = value;
            this._storeValue();
        }
400779
function(e) {
        if (this.enableKeys) {
            var kc = Event.getCharCode(e);

            switch (kc) {
                case 0x25: // left
                case 0x26: // up
                case 0x27: // right
                case 0x28: // down
                case 0x24: // home
                case 0x23: // end
                    Event.preventDefault(e);
                    break;
                default:
            }
        }
    }
317054
private void skip(boolean stopAtImport, boolean stopAtMemberDecl, boolean stopAtIdentifier, boolean stopAtStatement) {
         while (true) {
             switch (token.kind) {
                case SEMI:
                    nextToken();
                    return;
                case PUBLIC:
                case FINAL:
                case ABSTRACT:
                case MONKEYS_AT:
                case EOF:
                case CLASS:
                case INTERFACE:
                case ENUM:
                    return;
                case IMPORT:
                    if (stopAtImport)
                        return;
                    break;
                case LBRACE:
                case RBRACE:
                case PRIVATE:
                case PROTECTED:
                case STATIC:
                case TRANSIENT:
                case NATIVE:
                case VOLATILE:
                case SYNCHRONIZED:
                case STRICTFP:
                case LT:
                case BYTE:
                case SHORT:
                case CHAR:
                case INT:
                case LONG:
                case FLOAT:
                case DOUBLE:
                case BOOLEAN:
                case VOID:
                    if (stopAtMemberDecl)
                        return;
                    break;
                case UNDERSCORE:
                case IDENTIFIER:
                   if (stopAtIdentifier)
                        return;
                    break;
                case CASE:
                case DEFAULT:
                case IF:
                case FOR:
                case WHILE:
                case DO:
                case TRY:
                case SWITCH:
                case RETURN:
                case THROW:
                case BREAK:
                case CONTINUE:
                case ELSE:
                case FINALLY:
                case CATCH:
                    if (stopAtStatement)
                        return;
                    break;
            }
            nextToken();
        }
    }