Converts an {@link AcraReport} to an {@link ErrorOccurrence}.

@param pReport
the report to convert
@return the {@link ErrorOccurrence}
163498
public static ErrorOccurrence toErrorOccurrence(final AcraReport pReport) {

        final ErrorOccurrence error = new ErrorOccurrence();
        error.setReportId(pReport.getId());
        error.setCrashDate(pReport.getUserCrashDate());
        error.setRunFor(new Date(pReport.getUserCrashDate().getTime()
                - pReport.getUserAppStartDate().getTime()));
        error.setAndroidVersion(pReport.getValue(AcraReportHeader.ANDROID_VERSION));
        error.setVersionCode(pReport.getValue(AcraReportHeader.APP_VERSION_CODE));
        error.setVersionName(pReport.getValue(AcraReportHeader.APP_VERSION_NAME));
        final StringBuilder device = new StringBuilder();
        device.append(pReport.getValue(AcraReportHeader.PHONE_MODEL)).append(" / ");
        device.append(pReport.getValue(AcraReportHeader.BRAND)).append(" / ");
        device.append(pReport.getValue(AcraReportHeader.PRODUCT));
        error.setDevice(device.toString());
        return error;
    }
151322
public CrosstabBuilder useMainReportDatasource(boolean preSorted) {
		DJDataSource datasource = new DJDataSource("ds",DJConstants.DATA_SOURCE_ORIGIN_REPORT_DATASOURCE,DJConstants.DATA_SOURCE_TYPE_JRDATASOURCE);
		datasource.setPreSorted(preSorted);
		crosstab.setDatasource(datasource);
		return this;
	}
1193611
void preProcessOperation(StreamSegmentTruncateOperation operation) throws BadOffsetException {
        ensureSegmentId(operation);
        if (operation.getStreamSegmentOffset() < this.startOffset || operation.getStreamSegmentOffset() > this.length) {
            String msg = String.format("Truncation Offset must be at least %d and at most %d, given %d.",
                                       this.startOffset, this.length, operation.getStreamSegmentOffset());
            throw new BadOffsetException(this.name, this.startOffset, operation.getStreamSegmentOffset(), msg);
        }
    }
252395
public static AbstractSerialConnection getCommPort(String commPort) {
        SerialConnection jSerialCommPort = new SerialConnection();
        jSerialCommPort.serialPort = SerialPort.getCommPort(commPort);
        return jSerialCommPort;
    }
1369861
private void addErrorCorrection(StringBuilder adjustedString, int codewordSize, int dataBlocks, int eccBlocks) {

        int x, poly, startWeight;

        /* Split into codewords and calculate Reed-Solomon error correction codes */
        switch (codewordSize) {
            case 6:
                x = 32;
                poly = 0x43;
                startWeight = 0x20;
                break;
            case 8:
                x = 128;
                poly = 0x12d;
                startWeight = 0x80;
                break;
            case 10:
                x = 512;
                poly = 0x409;
                startWeight = 0x200;
                break;
            case 12:
                x = 2048;
                poly = 0x1069;
                startWeight = 0x800;
                break;
            default:
                throw new OkapiException("Unrecognized codeword size: " + codewordSize);
        }

        ReedSolomon rs = new ReedSolomon();
        int[] data = new int[dataBlocks + 3];
        int[] ecc = new int[eccBlocks + 3];

        for (int i = 0; i < dataBlocks; i++) {
            for (int weight = 0; weight < codewordSize; weight++) {
                if (adjustedString.charAt((i * codewordSize) + weight) == '1') {
                    data[i] += (x >> weight);
                }
            }
        }

        rs.init_gf(poly);
        rs.init_code(eccBlocks, 1);
        rs.encode(dataBlocks, data);

        for (int i = 0; i < eccBlocks; i++) {
            ecc[i] = rs.getResult(i);
        }

        for (int i = (eccBlocks - 1); i >= 0; i--) {
            for (int weight = startWeight; weight > 0; weight = weight >> 1) {
                if ((ecc[i] & weight) != 0) {
                    adjustedString.append('1');
                } else {
                    adjustedString.append('0');
                }
            }
        }
    }
698467
@WithBridgeMethods(value = OracleQuery.class, castRequired = true)
    public C connectByNocyclePrior(Predicate cond) {
        return addFlag(Position.BEFORE_ORDER, CONNECT_BY_NOCYCLE_PRIOR, cond);
    }
560068
public static <TResult> Task<TResult> forError(Exception error) {
    bolts.TaskCompletionSource<TResult> tcs = new bolts.TaskCompletionSource<>();
    tcs.setError(error);
    return tcs.getTask();
  }
695538
final void connectionErrorOccurred(final Exception exception, boolean callJCAListener) {

        final String methodName = "connectionErrorOccurred";
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, methodName, new Object[] {exception, Boolean.valueOf(callJCAListener)});
        }

        /*
         * Only send the event if the server isn't shutting down anyway
         */

        if (!SibRaEngineComponent.isServerStopping()) {

            final ConnectionEvent event = new ConnectionEvent(this,
                    ConnectionEvent.CONNECTION_ERROR_OCCURRED, exception);

            // Copy list to protect against concurrent modification by listener
            final List copy;
            synchronized (_eventListeners) {
                copy = new ArrayList(_eventListeners);
            }

            // We will probably want to look into some how figuring out that the listener
            // that we have is the JCA one and not some other one that is registered as we
            // want to call those ones regardless of the flag. Today we only expect JCA listeners
            // to be registered
            if (callJCAListener)
            {
              for (final Iterator iterator = copy.iterator(); iterator.hasNext();) {
                final Object object = iterator.next();
                if (object instanceof ConnectionEventListener) {
                    ((ConnectionEventListener) object)
                            .connectionErrorOccurred(event);
                }
              }
            }

        }

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, methodName);
        }

    }
132981
public static ParseException create(List<ParseError> errors) {
        if (errors.size() == 1) {
            return new ParseException(errors.get(0).getMessage(), errors);
        } else if (errors.size() > 1) {
            return new ParseException(String.format("%d errors occured. First: %s",
                                                    errors.size(),
                                                    errors.get(0).getMessage()), errors);
        } else {
            return new ParseException("An unknown error occured", errors);
        }
    }
309796
@Override
    public void uncaughtException(@Nullable Thread t, @NonNull Throwable e) {

        // If we're not enabled then just pass the Exception on to the defaultExceptionHandler.
        if (!reportExecutor.isEnabled()) {
            reportExecutor.handReportToDefaultExceptionHandler(t, e);
            return;
        }

        try {
            ACRA.log.e(LOG_TAG, "ACRA caught a " + e.getClass().getSimpleName() + " for " + context.getPackageName(), e);
            if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Building report");

            // Generate and send crash report
            new ReportBuilder()
                    .uncaughtExceptionThread(t)
                    .exception(e)
                    .customData(customData)
                    .endApplication()
                    .build(reportExecutor);

        } catch (Exception fatality) {
            // ACRA failed. Prevent any recursive call to ACRA.uncaughtException(), let the native reporter do its job.
            ACRA.log.e(LOG_TAG, "ACRA failed to capture the error - handing off to native error reporter", fatality);
            reportExecutor.handReportToDefaultExceptionHandler(t, e);
        }
    }
344347
public void error(Throwable error, Map<String, Object> custom) {
    error(error, custom, null);
  }
987220
function exceptionWithHostPort(err, syscall, address, port, additional) {
  // TODO(joyeecheung): We have to use the type-checked
  // getSystemErrorName(err) to guard against invalid arguments from users.
  // This can be replaced with [ code ] = errmap.get(err) when this method
  // is no longer exposed to user land.
  if (util === undefined) util = require('util');
  const code = util.getSystemErrorName(err);
  let details = '';
  if (port && port > 0) {
    details = ` ${address}:${port}`;
  } else if (address) {
    details = ` ${address}`;
  }
  if (additional) {
    details += ` - Local (${additional})`;
  }

  // eslint-disable-next-line no-restricted-syntax
  const ex = new Error(`${syscall} ${code}${details}`);
  // TODO(joyeecheung): errno is supposed to err, like in uvException
  ex.code = ex.errno = code;
  ex.syscall = syscall;
  ex.address = address;
  if (port) {
    ex.port = port;
  }

  Error.captureStackTrace(ex, exceptionWithHostPort);
  return ex;
}
623741
public final void mSORT() throws RecognitionException {
		try {
			int _type = SORT;
			int _channel = DEFAULT_TOKEN_CHANNEL;
			// druidG.g:622:6: ( ( 'SORT' ) )
			// druidG.g:622:8: ( 'SORT' )
			{
			// druidG.g:622:8: ( 'SORT' )
			// druidG.g:622:9: 'SORT'
			{
			match("SORT"); 

			}

			}

			state.type = _type;
			state.channel = _channel;
		}
		finally {
			// do for sure before leaving
		}
	}
9333
public static boolean isFromOrSuppressedThrowable(Throwable throwable, Class<? extends Throwable> exceptionClass, boolean checkCause) {
		return convertFromOrSuppressedThrowable(throwable, exceptionClass, checkCause) != null;
	}
184715
public final void ruleQualifiedNameInStaticImport() throws RecognitionException {

        		int stackSize = keepStackSize();
        	
        try {
            // InternalXbase.g:1929:2: ( ( ( ( rule__QualifiedNameInStaticImport__Group__0 ) ) ( ( rule__QualifiedNameInStaticImport__Group__0 )* ) ) )
            // InternalXbase.g:1930:2: ( ( ( rule__QualifiedNameInStaticImport__Group__0 ) ) ( ( rule__QualifiedNameInStaticImport__Group__0 )* ) )
            {
            // InternalXbase.g:1930:2: ( ( ( rule__QualifiedNameInStaticImport__Group__0 ) ) ( ( rule__QualifiedNameInStaticImport__Group__0 )* ) )
            // InternalXbase.g:1931:3: ( ( rule__QualifiedNameInStaticImport__Group__0 ) ) ( ( rule__QualifiedNameInStaticImport__Group__0 )* )
            {
            // InternalXbase.g:1931:3: ( ( rule__QualifiedNameInStaticImport__Group__0 ) )
            // InternalXbase.g:1932:4: ( rule__QualifiedNameInStaticImport__Group__0 )
            {
            if ( state.backtracking==0 ) {
               before(grammarAccess.getQualifiedNameInStaticImportAccess().getGroup()); 
            }
            // InternalXbase.g:1933:4: ( rule__QualifiedNameInStaticImport__Group__0 )
            // InternalXbase.g:1933:5: rule__QualifiedNameInStaticImport__Group__0
            {
            pushFollow(FOLLOW_3);
            rule__QualifiedNameInStaticImport__Group__0();

            state._fsp--;
            if (state.failed) return ;

            }

            if ( state.backtracking==0 ) {
               after(grammarAccess.getQualifiedNameInStaticImportAccess().getGroup()); 
            }

            }

            // InternalXbase.g:1936:3: ( ( rule__QualifiedNameInStaticImport__Group__0 )* )
            // InternalXbase.g:1937:4: ( rule__QualifiedNameInStaticImport__Group__0 )*
            {
            if ( state.backtracking==0 ) {
               before(grammarAccess.getQualifiedNameInStaticImportAccess().getGroup()); 
            }
            // InternalXbase.g:1938:4: ( rule__QualifiedNameInStaticImport__Group__0 )*
            loop1:
            do {
                int alt1=2;
                int LA1_0 = input.LA(1);

                if ( (LA1_0==RULE_ID) ) {
                    int LA1_2 = input.LA(2);

                    if ( (LA1_2==43) ) {
                        alt1=1;
                    }


                }


                switch (alt1) {
            	case 1 :
            	    // InternalXbase.g:1938:5: rule__QualifiedNameInStaticImport__Group__0
            	    {
            	    pushFollow(FOLLOW_3);
            	    rule__QualifiedNameInStaticImport__Group__0();

            	    state._fsp--;
            	    if (state.failed) return ;

            	    }
            	    break;

            	default :
            	    break loop1;
                }
            } while (true);

            if ( state.backtracking==0 ) {
               after(grammarAccess.getQualifiedNameInStaticImportAccess().getGroup()); 
            }

            }


            }


            }

        }
        catch (RecognitionException re) {
            reportError(re);
            recover(input,re);
        }
        finally {

            	restoreStackSize(stackSize);

        }
        return ;
    }
1021571
protected Observable<AsyncN1qlQueryResult> retryPrepareAndExecuteOnce(Throwable error, N1qlQuery query, CouchbaseEnvironment env, long timeout, TimeUnit timeUnit) {
        if (error instanceof QueryExecutionException &&
                shouldRetry(((QueryExecutionException) error).getN1qlError())) {
            queryCache.remove(query.statement().toString());
            return prepareAndExecute(query, env, timeout, timeUnit);
        }
        return Observable.error(error);
    }
1110958
public void propagateAsErrorIfCancelException(final Throwable t) {
    if ((t instanceof OperationCanceledError)) {
      throw ((OperationCanceledError)t);
    }
    final RuntimeException opCanceledException = this.getPlatformOperationCanceledException(t);
    if ((opCanceledException != null)) {
      throw new OperationCanceledError(opCanceledException);
    }
  }