text:
using namespace std;

int main() {
  string bigNews("I saw Elvis in a UFO. ");
  cout << bigNews << endl;
  // How much data have we actually got?
  cout << "Size = " << bigNews.size() << endl;
  // How much can we store without reallocating?
  cout << "Capacity = " << bigNews.capacity() << endl;
  // Insert this string in bigNews immediately
  // before bigNews[1]:
  bigNews.insert(1, " thought I");
  cout << bigNews << endl;
  cout << "Size = " << bigNews.size() << endl;
  cout << "Capacity = " << bigNews.capacity() << endl;
  // Make sure that there will be this much space
  bigNews.reserve(500);
  // Add this to the end of the string:
  bigNews.append("I've been working too hard.");
  cout << bigNews << endl;
  cout << "Size = " << bigNews.size() << endl;
  cout << "Capacity = " << bigNews.capacity() << endl;
} ///:~

redpajama_set_name: RedPajamaGithub


text:
/*
 |--------------------------------------------------------------------------
 | Browser-sync config file
 |--------------------------------------------------------------------------
 |
 | For up-to-date information about the options:
 |   http://www.browsersync.io/docs/options/
 |
 | There are more options than you see here, these are just the ones that are
 | set internally. See the website for more info.
 |
 |
 */

const historyApiFallback = require('connect-history-api-fallback');

module.exports = {
  'ui': {
    'port': 3001,
  },
  'files': false,
  'watchEvents': [
    'change',
  ],
  'watch': true,
  'ignore': [],
  'single': false,
  'watchOptions': {
    'ignoreInitial': true,
  },
  'server': 'dist',
  'proxy': false,
  'port': 3000,
  middleware: [historyApiFallback()],
  'serveStatic': [],
  'ghostMode': {
    'clicks': true,
    'scroll': true,
    'location': true,
    'forms': {
      'submit': true,
      'inputs': true,
      'toggles': true,
    },
  },
  'logLevel': 'info',
  'logPrefix': 'Browsersync',
  'logConnections': false,
  'logFileChanges': true,
  'logSnippet': true,
  rewriteRules: [],
  'open': false,
  'browser': 'default',
  'cors': false,
  'xip': false,
  'hostnameSuffix': false,
  'reloadOnRestart': false,
  'notify': true,
  'scrollProportionally': true,
  'scrollThrottle': 0,
  'scrollRestoreTechnique': 'window.name',
  'scrollElements': [],
  'scrollElementMapping': [],
  'reloadDelay': 0,
  'reloadDebounce': 500,
  'reloadThrottle': 0,
  'plugins': [],
  'injectChanges': true,
  'startPath': null,
  'minify': false,
  'host': null,
  'localOnly': false,
  'codeSync': true,
  'timestamps': true,
  'clientEvents': [
    'scroll',
    'scroll:element',
    'input:text',
    'input:toggles',
    'form:submit',
    'form:reset',
    'click',
  ],
  'socket': {
    'socketIoOptions': {
      'log': false,
    },
    'socketIoClientConfig': {
      'reconnectionAttempts': 50,
    },
    'path': '/browser-sync/socket.io',
    'clientPath': '/browser-sync',
    'namespace': '/browser-sync',
    'clients': {
      'heartbeatTimeout': 5000,
    },
  },
  'tagNames': {
    'less': 'link',
    'scss': 'link',
    'css': 'link',
    'jpg': 'img',
    'jpeg': 'img',
    'png': 'img',
    'svg': 'img',
    'gif': 'img',
    'js': 'script',
  },
  'injectNotification': false,
};


text:
#include <tommath_private.h>
#ifdef BN_MP_INIT_MULTI_C

/* LibTomMath, multiple-precision integer library -- Tom St Denis
 *
 * LibTomMath is a library that provides multiple-precision
 * integer arithmetic as well as number theoretic functionality.
 *
 * The library was designed directly after the MPI library by
 * Michael Fromberger but has been written from scratch with
 * additional optimizations in place.
 *
 * The library is free for all purposes without any express
 * guarantee it works.
 *
 * Tom St Denis, tstdenis82@gmail.com, http://libtom.org
 */
 #include <stdarg.h>

int mp_init_multi(mp_int *mp, ...) {
    mp_err  res      = MP_OKAY; /* Assume ok until proven otherwise */
    int     n        = 0;       /* Number of ok inits */
    mp_int  *cur_arg = mp;
    va_list args;

    va_start(args, mp);        /* init args to next argument from caller */
    while (cur_arg != NULL) {
        if (mp_init(cur_arg) != MP_OKAY) {
            /* Oops - error! Back-track and mp_clear what we already
               succeeded in init-ing, then return error.
             */
            va_list clean_args;

            /* end the current list */
            va_end(args);

            /* now start cleaning up */
            cur_arg = mp;
            va_start(clean_args, mp);
            while (n-- != 0) {
                mp_clear(cur_arg);
                cur_arg = va_arg(clean_args, mp_int *);
            }
            va_end(clean_args);
            res = MP_MEM;
            break;
        }
        n++;
        cur_arg = va_arg(args, mp_int *);
    }
    va_end(args);
    return res;                /* Assumed ok, if error flagged above. */
}
#endif

/* $Source$ */
/* $Revision$ */
/* $Date$ */


text:
package br.com.objectos.code;

import javax.lang.model.element.TypeElement;
import javax.lang.model.type.TypeMirror;

/**
 * @author marcio.endo@objectos.com.br (Marcio Endo)
 */
class TypeInfoTypeMirror extends TypeInfoTypeElement {

  private final TypeMirror type;

  private TypeInfoTypeMirror(ProcessingEnvironmentWrapper processingEnv, TypeMirror type) {
    super(processingEnv, (TypeElement) processingEnv.asElement(type));
    this.type = type;
  }

  public static TypeInfo wrap(ProcessingEnvironmentWrapper processingEnv, TypeMirror type) {
    return new TypeInfoTypeMirror(processingEnv, type);
  }

  @Override
  TypeParameterInfoMap newTypeParameterInfoMap() {
    return processingEnv().getTypeParameterInfoMapOf(type);
  }

}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Danish Fungi (Copenhagen) 218 (1913)

#### Original name
Leptosphaeria occulta Lind, 1913

### Remarks
null


text:
package org.dkpro.jotl;

/**
 * Set of constants for synset link types used by OpenThesaurus.
 */
public final class OTSynsetLinkType {

	/** Hypernymy links (i.e., synsets with a broader meaning). */
	public static final int HYPERNYMY = 1;

	/** Associative links (i.e., synsets with a related meaning). */
	public static final int ASSOCIATION = 2;

}


text:
var $ = require('./_');
if(require('./_descriptors') && /./g.flags != 'g')$.setDesc(RegExp.prototype, 'flags', {
  configurable: true,
  get: require('./_flags')
});


text:
package com.github.sandor_balazs.nosql_java.domain;

import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.io.Serializable;
import java.util.Objects;

/**
 * A Status.
 */

@Document(collection = "status")
public class Status implements Serializable {

    @Id
    private String id;

    @Field("name")
    private String name;

    @Field("app_order")
    private Integer appOrder;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getAppOrder() {
        return appOrder;
    }

    public void setAppOrder(Integer appOrder) {
        this.appOrder = appOrder;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        Status status = (Status) o;
        return Objects.equals(id, status.id);
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(id);
    }

    @Override
    public String toString() {
        return "Status{" +
            "id=" + id +
            ", name='" + name + "'" +
            ", appOrder='" + appOrder + "'" +
            '}';
    }
}


text:
.. _java-app-plugin:

Java Application Archetype
##########################

Application packaging focuses on how your application is launched (via a ``bash`` or ``bat`` script), how dependencies
are managed and how configuration and other auxiliary files are included in the final distributable. The
*JavaAppPackaging* archetype provides a default application structure and executable scripts to launch your application.

Additionally there is :ref:`java-server-plugin` which provides platform-specific functionality for installing your
application in server environments. You can customize specific debian and rpm packaging for a variety of platforms and
init service loaders including Upstart, System V and SystemD.

Features
========

The `JavaAppPackaging` archetype contains the following features.

* Default application mappings (no fat jar)
* Executable bash/bat script

Usage
=====

Enable the ``JavaAppPackaging`` plugin in your ``build.sbt`` with

.. code-block:: scala

  enablePlugins(JavaAppPackaging)

This archetype will use the ``mainClass`` setting of sbt (automatically discovers your main class) to generate
``bat`` and ``bin`` scripts for your project. In case you have multiple main classes you can point to a specific
class with the following setting:

.. code-block:: scala

   mainClass in Compile := Some("foo.bar.Main")

To create a staging version of your package call

.. code-block:: bash

  sbt stage

The universal layout produced in your ``target/universal/stage`` folder looks like the following:

.. code-block:: none

   bin/
     <app_name>       <- BASH script
     <app_name>.bat   <- cmd.exe script
   lib/
      <Your project and dependent jar files here.>

You can add additional files to the project by placing things in ``src/windows``, ``src/universal`` or ``src/linux`` as
needed. To see if your application runs:

.. code-block:: bash

  cd target/universal/stage
  ./bin/<app-name>

This plugin also enables all supported **packaging formats** as well. Currently **all formats** are supported by the
java app archetype! For example you can build *zips*, *deb* or *docker* by just enabling ``JavaAppPackaging``.

.. code-block:: bash

  sbt
  # create a zip file
  > universal:packageBin
  # create a deb file
  > debian:packageBin
  # publish a docker image to your local registry
  > docker:publishLocal

Settings & Tasks
================

This is a non extensive list of important settings and tasks this plugin provides. All settings
have sensible defaults.

  ``makeBashScript``
    Creates or discovers the bash script used by this project.

  ``makeBatScript``
    Creates or discovers the bat script used by this project.

  ``bashScriptTemplateLocation``
    The location of the bash script template.

  ``batScriptTemplateLocation``
    The location of the bat script template.

  ``bashScriptExtraDefines``
    A list of extra definitions that should be written to the bash file template.

  ``batScriptExtraDefines``
    A list of extra definitions that should be written to the bat file template.

Start script options
====================

The start script provides a few standard options you can pass:

  ``-h | -help``
    Prints script usage

  ``-v | -verbose``
    Prints out more information

  ``-no-version-check``
    Don't run the java version check

  ``-jvm-debug <port>``
    Turn on JVM debugging, open at the given port

  ``-main``
    Define a custom main class

To configure the JVM these options are available

  ``JAVA_OPTS``
    environment variable, if unset uses "$java_opts"

  ``-Dkey=val``
    pass -Dkey=val directly to the java runtime

  ``-J-X``
    pass option -X directly to the java runtime (-J is stripped).
    E.g. ``-J-Xmx1024``

In order to pass **application arguments** you need to separate the jvm arguments from the
application arguments with ``--``. For example

.. code-block:: bash

    ./bin/my-app -Dconfig.resource=prod.conf -- -appParam1 -appParam2

Customize
=========

.. toctree::

   customize


text:
from django.db import models
from django.utils.translation import ugettext_lazy as _

from leonardo.module.web.models import Widget

LOGIN_TYPE_CHOICES = (
    (1, _("Admin")),
    (2, _("Public")),
)

class UserLoginWidget(Widget):
    type = models.PositiveIntegerField(verbose_name=_(
        "type"), choices=LOGIN_TYPE_CHOICES, default=2)

    class Meta:
        abstract = True
        verbose_name = _("user login")
        verbose_name_plural = _("user logins")


text:
package com.amazonaws.services.identitymanagement.model;

import java.io.Serializable;

/**
 *

 * Contains the response to a successful GetSAMLProvider request.
 *

 */
public class GetSAMLProviderResult implements Serializable, Cloneable {

    /**
     * The XML metadata document that includes information about an identity
     * provider.
     *

     * Constraints:

     * Length: 1000 - 10000000

     */
    private String sAMLMetadataDocument;

    /**
     * The date and time when the SAML provider was created.
     */
    private java.util.Date createDate;

    /**
     * The expiration date and time for the SAML provider.
     */
    private java.util.Date validUntil;

    /**
     * The XML metadata document that includes information about an identity
     * provider.
     *

     * Constraints:

     * Length: 1000 - 10000000

     *
     * @return The XML metadata document that includes information about an identity
     *         provider.
     */
    public String getSAMLMetadataDocument() {
        return sAMLMetadataDocument;
    }

    /**
     * The XML metadata document that includes information about an identity
     * provider.
     *

     * Constraints:

     * Length: 1000 - 10000000

     *
     * @param sAMLMetadataDocument The XML metadata document that includes information about an identity
     *         provider.
     */
    public void setSAMLMetadataDocument(String sAMLMetadataDocument) {
        this.sAMLMetadataDocument = sAMLMetadataDocument;
    }

    /**
     * The XML metadata document that includes information about an identity
     * provider.
     *

     * Returns a reference to this object so that method calls can be chained together.
     *

     * Constraints:

     * Length: 1000 - 10000000

     *
     * @param sAMLMetadataDocument The XML metadata document that includes information about an identity
     *         provider.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public GetSAMLProviderResult withSAMLMetadataDocument(String sAMLMetadataDocument) {
        this.sAMLMetadataDocument = sAMLMetadataDocument;
        return this;
    }

    /**
     * The date and time when the SAML provider was created.
     *
     * @return The date and time when the SAML provider was created.
     */
    public java.util.Date getCreateDate() {
        return createDate;
    }

    /**
     * The date and time when the SAML provider was created.
     *
     * @param createDate The date and time when the SAML provider was created.
     */
    public void setCreateDate(java.util.Date createDate) {
        this.createDate = createDate;
    }

    /**
     * The date and time when the SAML provider was created.
     *

     * Returns a reference to this object so that method calls can be chained together.
     *
     * @param createDate The date and time when the SAML provider was created.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public GetSAMLProviderResult withCreateDate(java.util.Date createDate) {
        this.createDate = createDate;
        return this;
    }

    /**
     * The expiration date and time for the SAML provider.
     *
     * @return The expiration date and time for the SAML provider.
     */
    public java.util.Date getValidUntil() {
        return validUntil;
    }

    /**
     * The expiration date and time for the SAML provider.
     *
     * @param validUntil The expiration date and time for the SAML provider.
     */
    public void setValidUntil(java.util.Date validUntil) {
        this.validUntil = validUntil;
    }

    /**
     * The expiration date and time for the SAML provider.
     *

     * Returns a reference to this object so that method calls can be chained together.
     *
     * @param validUntil The expiration date and time for the SAML provider.
     *
     * @return A reference to this updated object so that method calls can be chained
     *         together.
     */
    public GetSAMLProviderResult withValidUntil(java.util.Date validUntil) {
        this.validUntil = validUntil;
        return this;
    }

    /**
     * Returns a string representation of this object; useful for testing and
     * debugging.
     *
     * @return A string representation of this object.
     *
     * @see java.lang.Object#toString()
     */
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        if (getSAMLMetadataDocument() != null) sb.append("SAMLMetadataDocument: " + getSAMLMetadataDocument() + ",");
        if (getCreateDate() != null) sb.append("CreateDate: " + getCreateDate() + ",");
        if (getValidUntil() != null) sb.append("ValidUntil: " + getValidUntil() );
        sb.append("}");
        return sb.toString();
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;

        hashCode = prime * hashCode + ((getSAMLMetadataDocument() == null) ? 0 : getSAMLMetadataDocument().hashCode());
        hashCode = prime * hashCode + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode());
        hashCode = prime * hashCode + ((getValidUntil() == null) ? 0 : getValidUntil().hashCode());
        return hashCode;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) return true;
        if (obj == null) return false;

        if (obj instanceof GetSAMLProviderResult == false) return false;
        GetSAMLProviderResult other = (GetSAMLProviderResult)obj;

        if (other.getSAMLMetadataDocument() == null ^ this.getSAMLMetadataDocument() == null) return false;
        if (other.getSAMLMetadataDocument() != null && other.getSAMLMetadataDocument().equals(this.getSAMLMetadataDocument()) == false) return false;
        if (other.getCreateDate() == null ^ this.getCreateDate() == null) return false;
        if (other.getCreateDate() != null && other.getCreateDate().equals(this.getCreateDate()) == false) return false;
        if (other.getValidUntil() == null ^ this.getValidUntil() == null) return false;
        if (other.getValidUntil() != null && other.getValidUntil().equals(this.getValidUntil()) == false) return false;
        return true;
    }

    @Override
    public GetSAMLProviderResult clone() {
        try {
            return (GetSAMLProviderResult) super.clone();

        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException(
                    "Got a CloneNotSupportedException from Object.clone() "
                    + "even though we're Cloneable!",
                    e);
        }

    }

}


text:
package net.uniform.html.validators;

import java.util.Arrays;
import java.util.HashSet;
import net.uniform.api.Element;
import net.uniform.html.elements.EmptyElement;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import org.junit.Test;

/**
 *
 * @author Eduardo Ramos
 */
public class InSetValidatorTest {

    @Test
    public void test() {
        Element element = new EmptyElement("test");

        InSetValidator validator = new InSetValidator();
        validator = new InSetValidator(null);
        element.addValidator(validator);

        assertTrue(element.isValid());//No value, not required

        element.setValue("466ad4bc13");

        assertFalse(element.isValid());

        validator.addValidValue(element.getFirstValue());

        assertTrue(element.isValid());

        validator.removeValidValue(element.getFirstValue());

        assertFalse(element.isValid());

        validator.addValidValue("1");
        validator.addValidValue("2");
        validator.addValidValue("3");

        assertEquals(validator.getValuesSet(), new HashSet<>(Arrays.asList("1", "2", "3")));
        validator.setValidValues(null);
        validator.setValidValues(new HashSet<>(Arrays.asList("1", "2", "3")));

        element.setValue("1");
        assertTrue(element.isValid());
        element.setValue("2");
        assertTrue(element.isValid());
        element.setValue("3");
        assertTrue(element.isValid());
        element.setValue("4");
        assertFalse(element.isValid());

        element.setValue("1");
        validator.clearValidValues();
        assertFalse(element.isValid());

        validator.getValuesSet().add("1");//Test that this does not affect the internals of the validator
        assertFalse(element.isValid());

        element.removeValidator(validator);
        validator = new InSetValidator(new HashSet<>(Arrays.asList("1")));
        element.addValidator(validator);
        assertTrue(element.isValid());
    }
}


text:
using System;
using ReactiveUI;
using Splat;

namespace ReactUiSample.ViewModels
{
    public interface IMainViewModel : IRoutableViewModel
    {
        IReactiveCommand HelloWorld { get; }
    }

    public class MainViewModel : ReactiveObject, IMainViewModel
    {
        public string UrlPathSegment => "main";

        string _welcome;
        public string Welcome
        {
            get { return _welcome; }
            set { this.RaiseAndSetIfChanged(ref _welcome, value); }
        }

        public IScreen HostScreen { get; protected set; }

        public ReactiveCommand<object> HelloWorld { get; protected set; }
        IReactiveCommand IMainViewModel.HelloWorld => HelloWorld;

        readonly ReactiveList<object> _tabs = new ReactiveList<object>();
        public IReadOnlyReactiveList<object> Tabs
        {
            get { return _tabs; }
        }

        public MainViewModel(IScreen screen)
        {
            HostScreen = screen;

            Welcome = "Welcome";
            //this.WhenAnyValue(x => x.Welcome);

            HelloWorld = ReactiveCommand.Create();
            HelloWorld.Subscribe(param => UserError.Throw(new UserError("It works!!!")));

            LoadTabs();
        }

        private void LoadTabs()
        {
            var tabs = Locator.Current.GetServices<ITabViewModel>();

            _tabs.AddRange(tabs);
        }
    }
}


text:
//
//  ZJScrollSegmentView.h
//  ZJScrollPageView
//
//  Created by jasnig on 16/5/6.
//  Copyright © 2016年 ZeroJ. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "ZJSegmentStyle.h"
//#import "ZJScrollPageViewDelegate.h"

@class ZJSegmentStyle;
@class ZJTitleView;

typedef void(^TitleBtnOnClickBlock)(ZJTitleView *titleView, NSInteger index);
typedef void(^ExtraBtnOnClick)(UIButton *extraBtn);

@interface ZJScrollSegmentView : UIView
// test
@property NSUInteger section;
@property (nonatomic, weak) UITableView *tableView;

// 所有的标题
@property (strong, nonatomic) NSArray *titles;
// 所有标题的设置
@property (strong, nonatomic) ZJSegmentStyle *segmentStyle;
@property (copy, nonatomic) ExtraBtnOnClick extraBtnOnClick;
//@property (weak, nonatomic) id<ZJScrollPageViewDelegate> delegate;
@property (strong, nonatomic) UIImage *backgroundImage;

//- (instancetype)initWithFrame:(CGRect )frame segmentStyle:(ZJSegmentStyle *)segmentStyle delegate:(id<ZJScrollPageViewDelegate>)delegate titles:(NSArray *)titles titleDidClick:(TitleBtnOnClickBlock)titleDidClick;
- (instancetype)initWithFrame:(CGRect )frame segmentStyle:(ZJSegmentStyle *)segmentStyle titles:(NSArray *)titles titleDidClick:(TitleBtnOnClickBlock)titleDidClick;

/** 切换下标的时候根据progress同步设置UI*/
- (void)adjustUIWithProgress:(CGFloat)progress oldIndex:(NSInteger)oldIndex currentIndex:(NSInteger)currentIndex;
/** 让选中的标题居中*/
- (void)adjustTitleOffSetToCurrentIndex:(NSInteger)currentIndex;
/** 设置选中的下标*/
- (void)setSelectedIndex:(NSInteger)index animated:(BOOL)animated;
/** 重新刷新标题的内容*/
- (void)reloadTitlesWithNewTitles:(NSArray *)titles;
@end


text:
#import <Foundation/NSString_unicodePtr.h>
#import <Foundation/NSRaise.h>
#import <Foundation/NSStringHashing.h>
#import <Foundation/NSRaiseException.h>

@implementation NSString_unicodePtr

NSString *NSString_unicodePtrNewNoCopy(NSZone *zone,const unichar *unicode,NSUInteger length,BOOL freeWhenDone) {
   NSString_unicodePtr *string;

   string=NSAllocateObject([NSString_unicodePtr class],0,zone);

   string->_length=length;
   string->_freeWhenDone=freeWhenDone;
   string->_unicode=unicode;

   return string;
}

NSString *NSString_unicodePtrNew(NSZone *zone,const unichar *unicode,NSUInteger length) {
   unichar *copy=NSZoneMalloc(NULL,length*sizeof(unichar));
   int      i;

   for(i=0;i<length;i++)
    copy[i]=unicode[i];

   return NSString_unicodePtrNewNoCopy(zone,copy,length,YES);
}

-(void)dealloc {
   if(_freeWhenDone)
   NSZoneFree(NSZoneFromPointer((void *)_unicode),(void *)_unicode);
   NSDeallocateObject(self);
   return;
   [super dealloc];
}

-(NSUInteger)length {
   return _length;
}

-(unichar)characterAtIndex:(NSUInteger)location {
   if(location>=_length){
    NSRaiseException(NSRangeException,self,_cmd,@"index %d beyond length %d",
     location,[self length]);
   }

   return _unicode[location];
}

-(void)getCharacters:(unichar *)buffer {
   int i;

   for(i=0;i<_length;i++)
    buffer[i]=_unicode[i];
}

-(void)getCharacters:(unichar *)buffer range:(NSRange)range {
   NSInteger i,len=range.length,loc=range.location;

   if(NSMaxRange(range)>_length){
    NSRaiseException(NSRangeException,self,_cmd,@"range %@ beyond length %d",
     NSStringFromRange(range),[self length]);
   }

   for(i=0;i<len;i++)
    buffer[i]=_unicode[loc+i];
}

-(NSUInteger)hash {
   return NSStringHashUnicode(_unicode,MIN(_length,NSHashStringLength));
}

@end


text:
/**
 * Cineast RESTful API
 * Cineast is vitrivr\'s content-based multimedia retrieval engine. This is it\'s RESTful API.
 *
 * The version of the OpenAPI document: v1
 * Contact: contact@vitrivr.org
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */
import { QueryConfig } from './queryConfig';

export interface TemporalQueryConfig {
    queryId?: string;
    hints?: Set<TemporalQueryConfig.HintsEnum>;
    timeDistances?: Array<number>;
    maxLength?: number;
    computeTemporalObjects?: boolean;
    relevantSegmentIds?: Set<string>;
    distance?: TemporalQueryConfig.DistanceEnum;
    distanceWeights?: Array<number>;
    norm?: number;
    resultsPerModule?: number;
    maxResults?: number;
    correspondenceFunctionIfEmpty?: QueryConfig;
    distanceIfEmpty?: QueryConfig;
    correspondenceFunction?: object;
    distanceWeightsIfEmpty?: QueryConfig;
    normIfEmpty?: QueryConfig;
    rawResultsPerModule?: number;
}
export namespace TemporalQueryConfig {
    export type HintsEnum = 'exact' | 'inexact' | 'lsh' | 'ecp' | 'mi' | 'pq' | 'sh' | 'va' | 'vaf' | 'vav' | 'sequential' | 'empirical';
    export const HintsEnum = {
        Exact: 'exact' as HintsEnum,
        Inexact: 'inexact' as HintsEnum,
        Lsh: 'lsh' as HintsEnum,
        Ecp: 'ecp' as HintsEnum,
        Mi: 'mi' as HintsEnum,
        Pq: 'pq' as HintsEnum,
        Sh: 'sh' as HintsEnum,
        Va: 'va' as HintsEnum,
        Vaf: 'vaf' as HintsEnum,
        Vav: 'vav' as HintsEnum,
        Sequential: 'sequential' as HintsEnum,
        Empirical: 'empirical' as HintsEnum
    };
    export type DistanceEnum = 'chisquared' | 'correlation' | 'cosine' | 'hamming' | 'jaccard' | 'kullbackleibler' | 'chebyshev' | 'euclidean' | 'squaredeuclidean' | 'manhattan' | 'minkowski' | 'spannorm' | 'haversine';
    export const DistanceEnum = {
        Chisquared: 'chisquared' as DistanceEnum,
        Correlation: 'correlation' as DistanceEnum,
        Cosine: 'cosine' as DistanceEnum,
        Hamming: 'hamming' as DistanceEnum,
        Jaccard: 'jaccard' as DistanceEnum,
        Kullbackleibler: 'kullbackleibler' as DistanceEnum,
        Chebyshev: 'chebyshev' as DistanceEnum,
        Euclidean: 'euclidean' as DistanceEnum,
        Squaredeuclidean: 'squaredeuclidean' as DistanceEnum,
        Manhattan: 'manhattan' as DistanceEnum,
        Minkowski: 'minkowski' as DistanceEnum,
        Spannorm: 'spannorm' as DistanceEnum,
        Haversine: 'haversine' as DistanceEnum
    };
}


text:
<?php

namespace ElegantPHP\Tests\Controlllers;

use ElegantPHP\Controllers\BaseController;

class BaseControllerTest extends \PHPUnit_Framework_TestCase
{
    /**
     * Standard base path is
     **/
    public function testLoadView()
    {
        $controller = new BaseController();
        $this->assertEquals("BaseController", $controller->getApp());
        $this->assertEquals("ElegantPHP\\Controllers\\BaseController", $controller->getApp(true));

        $controller = new ControllerExampleTest();
        $this->assertEquals("ControllerExampleTest", $controller->getApp());

        $controller->setBasePath(realpath('.'));
        $this->assertEquals(realpath('.') . DIRECTORY_SEPARATOR . 'view' . DIRECTORY_SEPARATOR . 'ControllerExampleTest' . DIRECTORY_SEPARATOR . 'index.php', $controller->getViewPath('index'));

    }
}


text:
typedef enum {
	PT_INIT_SUCCESS,
	PT_INIT_GLFW_FAILURE
} pt_init_result_t;

pt_init_result_t pt_app_initialize ();
void pt_app_main_loop (void);

#endif // __APP_H_


text:
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.

package com.intellij.codeInspection.dataFlow;

import com.intellij.codeInsight.*;
import com.intellij.codeInsight.intention.AddAnnotationPsiFix;
import com.intellij.codeInsight.intention.impl.BaseIntentionAction;
import com.intellij.codeInspection.*;
import com.intellij.codeInspection.dataFlow.NullabilityProblemKind.NullabilityProblem;
import com.intellij.codeInspection.dataFlow.fix.*;
import com.intellij.codeInspection.dataFlow.instructions.InstanceofInstruction;
import com.intellij.codeInspection.dataFlow.instructions.Instruction;
import com.intellij.codeInspection.dataFlow.types.DfConstantType;
import com.intellij.codeInspection.dataFlow.types.DfType;
import com.intellij.codeInspection.dataFlow.types.DfTypes;
import com.intellij.codeInspection.dataFlow.value.DfaValue;
import com.intellij.codeInspection.nullable.NullableStuffInspectionBase;
import com.intellij.java.analysis.JavaAnalysisBundle;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.TextRange;
import com.intellij.openapi.util.WriteExternalException;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.openapi.util.text.StringUtil;
import com.intellij.psi.*;
import com.intellij.psi.impl.PsiImplUtil;
import com.intellij.psi.tree.IElementType;
import com.intellij.psi.util.*;
import com.intellij.util.*;
import com.intellij.util.containers.ContainerUtil;
import com.siyeh.ig.bugs.EqualsWithItselfInspection;
import com.siyeh.ig.fixes.EqualsToEqualityFix;
import com.siyeh.ig.psiutils.*;
import one.util.streamex.StreamEx;
import org.jdom.Element;
import org.jetbrains.annotations.*;

import javax.annotation.Nonnull;
import javax.swing.*;
import java.util.*;
import java.util.function.Consumer;

import static com.intellij.util.ObjectUtils.tryCast;

public abstract class DataFlowInspectionBase extends AbstractBaseJavaLocalInspectionTool
{
	static final Logger LOG = Logger.getInstance(DataFlowInspectionBase.class);
	@NonNls
	private static final String SHORT_NAME = "ConstantConditions";
	public boolean SUGGEST_NULLABLE_ANNOTATIONS;
	public boolean DONT_REPORT_TRUE_ASSERT_STATEMENTS;
	public boolean TREAT_UNKNOWN_MEMBERS_AS_NULLABLE;
	public boolean IGNORE_ASSERT_STATEMENTS;
	public boolean REPORT_CONSTANT_REFERENCE_VALUES = true;
	public boolean REPORT_NULLS_PASSED_TO_NOT_NULL_PARAMETER = true;
	public boolean REPORT_NULLABLE_METHODS_RETURNING_NOT_NULL = true;
	public boolean REPORT_UNSOUND_WARNINGS = true;

	@Override
	public JComponent createOptionsPanel()
	{
		throw new RuntimeException("no UI in headless mode");
	}

	@Override
	public void writeSettings(@Nonnull Element node) throws WriteExternalException
	{
		node.addContent(new Element("option").setAttribute("name", "SUGGEST_NULLABLE_ANNOTATIONS").setAttribute("value", String.valueOf(SUGGEST_NULLABLE_ANNOTATIONS)));
		node.addContent(new Element("option").setAttribute("name", "DONT_REPORT_TRUE_ASSERT_STATEMENTS").setAttribute("value", String.valueOf(DONT_REPORT_TRUE_ASSERT_STATEMENTS)));
		if(IGNORE_ASSERT_STATEMENTS)
		{
			node.addContent(new Element("option").setAttribute("name", "IGNORE_ASSERT_STATEMENTS").setAttribute("value", "true"));
		}
		if(!REPORT_CONSTANT_REFERENCE_VALUES)
		{
			node.addContent(new Element("option").setAttribute("name", "REPORT_CONSTANT_REFERENCE_VALUES").setAttribute("value", "false"));
		}
		if(TREAT_UNKNOWN_MEMBERS_AS_NULLABLE)
		{
			node.addContent(new Element("option").setAttribute("name", "TREAT_UNKNOWN_MEMBERS_AS_NULLABLE").setAttribute("value", "true"));
		}
		if(!REPORT_NULLS_PASSED_TO_NOT_NULL_PARAMETER)
		{
			node.addContent(new Element("option").setAttribute("name", "REPORT_NULLS_PASSED_TO_NOT_NULL_PARAMETER").setAttribute("value", "false"));
		}
		if(!REPORT_NULLABLE_METHODS_RETURNING_NOT_NULL)
		{
			node.addContent(new Element("option").setAttribute("name", "REPORT_NULLABLE_METHODS_RETURNING_NOT_NULL").setAttribute("value", "false"));
		}
		if(!REPORT_UNSOUND_WARNINGS)
		{
			node.addContent(new Element("option").setAttribute("name", "REPORT_UNSOUND_WARNINGS").setAttribute("value", "false"));
		}
	}

	@Override
	public
	@Nonnull
	PsiElementVisitor buildVisitor(@Nonnull ProblemsHolder holder, boolean isOnTheFly)
	{
		return new JavaElementVisitor()
		{
			@Override
			public void visitClass(PsiClass aClass)
			{
				if(aClass instanceof PsiTypeParameter)
				{
					return;
				}
				if(PsiUtil.isLocalOrAnonymousClass(aClass) && !(aClass instanceof PsiEnumConstantInitializer))
				{
					return;
				}

				final DataFlowRunner runner = new DataFlowRunner(holder.getProject(), aClass, TREAT_UNKNOWN_MEMBERS_AS_NULLABLE,
						ThreeState.fromBoolean(IGNORE_ASSERT_STATEMENTS));
				DataFlowInstructionVisitor visitor =
						analyzeDfaWithNestedClosures(aClass, holder, runner, Collections.singletonList(runner.createMemoryState()));
				List<DfaMemoryState> states = visitor.getEndOfInitializerStates();
				boolean physical = aClass.isPhysical();
				for(PsiMethod method : aClass.getConstructors())
				{
					if(physical && !method.isPhysical())
					{
						// Constructor could be provided by, e.g. Lombok plugin: ignore it, we won't report any problems inside anyway
						continue;
					}
					List<DfaMemoryState> initialStates;
					PsiMethodCallExpression call = JavaPsiConstructorUtil.findThisOrSuperCallInConstructor(method);
					if(JavaPsiConstructorUtil.isChainedConstructorCall(call) || (call == null && DfaUtil.hasImplicitImpureSuperCall(aClass, method)))
					{
						initialStates = Collections.singletonList(runner.createMemoryState());
					}
					else
					{
						initialStates = StreamEx.of(states).map(DfaMemoryState::createCopy).toList();
					}
					analyzeMethod(method, runner, initialStates);
				}
			}

			@Override
			public void visitMethod(PsiMethod method)
			{
				if(method.isConstructor())
				{
					return;
				}
				final DataFlowRunner runner = new DataFlowRunner(
						holder.getProject(), method.getBody(), TREAT_UNKNOWN_MEMBERS_AS_NULLABLE, ThreeState.fromBoolean(IGNORE_ASSERT_STATEMENTS));
				analyzeMethod(method, runner, Collections.singletonList(runner.createMemoryState()));
			}

			private void analyzeMethod(PsiMethod method, DataFlowRunner runner, List<DfaMemoryState> initialStates)
			{
				PsiCodeBlock scope = method.getBody();
				if(scope == null)
				{
					return;
				}
				PsiClass containingClass = PsiTreeUtil.getParentOfType(method, PsiClass.class);
				if(containingClass != null && PsiUtil.isLocalOrAnonymousClass(containingClass) && !(containingClass instanceof PsiEnumConstantInitializer))
				{
					return;
				}

				analyzeDfaWithNestedClosures(scope, holder, runner, initialStates);
				analyzeNullLiteralMethodArguments(method, holder);
			}

			@Override
			public void visitMethodReferenceExpression(PsiMethodReferenceExpression expression)
			{
				super.visitMethodReferenceExpression(expression);
				if(!REPORT_UNSOUND_WARNINGS)
				{
					return;
				}
				final PsiElement resolve = expression.resolve();
				if(resolve instanceof PsiMethod)
				{
					final PsiType methodReturnType = ((PsiMethod) resolve).getReturnType();
					if(TypeConversionUtil.isPrimitiveWrapper(methodReturnType) && NullableNotNullManager.isNullable((PsiMethod) resolve))
					{
						final PsiType returnType = LambdaUtil.getFunctionalInterfaceReturnType(expression);
						if(TypeConversionUtil.isPrimitiveAndNotNull(returnType))
						{
							holder.registerProblem(expression, JavaAnalysisBundle.message("dataflow.message.unboxing.method.reference"));
						}
					}
				}
			}

			@Override
			public void visitIfStatement(PsiIfStatement statement)
			{
				PsiExpression condition = PsiUtil.skipParenthesizedExprDown(statement.getCondition());
				if(BoolUtils.isBooleanLiteral(condition))
				{
					LocalQuickFix fix = createSimplifyBooleanExpressionFix(condition, condition.textMatches(PsiKeyword.TRUE));
					holder.registerProblem(condition, JavaAnalysisBundle
							.message("dataflow.message.constant.no.ref", condition.textMatches(PsiKeyword.TRUE) ? 1 : 0), fix);
				}
			}

			@Override
			public void visitWhileStatement(PsiWhileStatement statement)
			{
				checkLoopCondition(statement.getCondition());
			}

			@Override
			public void visitDoWhileStatement(PsiDoWhileStatement statement)
			{
				checkLoopCondition(statement.getCondition());
			}

			@Override
			public void visitForStatement(PsiForStatement statement)
			{
				checkLoopCondition(statement.getCondition());
			}

			private void checkLoopCondition(PsiExpression condition)
			{
				condition = PsiUtil.skipParenthesizedExprDown(condition);
				if(condition != null && condition.textMatches(PsiKeyword.FALSE))
				{
					holder.registerProblem(condition, JavaAnalysisBundle.message("dataflow.message.constant.no.ref", 0), createSimplifyBooleanExpressionFix(condition, false));
				}
			}
		};
	}

	protected LocalQuickFix createNavigateToNullParameterUsagesFix(PsiParameter parameter)
	{
		return null;
	}

	private void analyzeNullLiteralMethodArguments(PsiMethod method, ProblemsHolder holder)
	{
		if(REPORT_NULLS_PASSED_TO_NOT_NULL_PARAMETER && holder.isOnTheFly())
		{
			for(PsiParameter parameter : NullParameterConstraintChecker.checkMethodParameters(method))
			{
				PsiIdentifier name = parameter.getNameIdentifier();
				if(name != null)
				{
					holder.registerProblem(name, JavaAnalysisBundle.message("dataflow.method.fails.with.null.argument"),
							ProblemHighlightType.GENERIC_ERROR_OR_WARNING, createNavigateToNullParameterUsagesFix(parameter));
				}
			}
		}
	}

	private DataFlowInstructionVisitor analyzeDfaWithNestedClosures(PsiElement scope,
																	ProblemsHolder holder,
																	DataFlowRunner dfaRunner,
																	Collection<? extends DfaMemoryState> initialStates)
	{
		final DataFlowInstructionVisitor visitor = new DataFlowInstructionVisitor();
		final RunnerResult rc = dfaRunner.analyzeMethod(scope, visitor, initialStates);
		if(rc == RunnerResult.OK)
		{
			if(dfaRunner.wasForciblyMerged() &&
					(ApplicationManager.getApplication().isUnitTestMode() || Registry.is("ide.dfa.report.imprecise", false)))
			{
				reportAnalysisQualityProblem(holder, scope, "dataflow.not.precise");
			}
			createDescription(dfaRunner, holder, visitor, scope);
			dfaRunner.forNestedClosures((closure, states) -> analyzeDfaWithNestedClosures(closure, holder, dfaRunner, states));
		}
		else if(rc == RunnerResult.TOO_COMPLEX)
		{
			reportAnalysisQualityProblem(holder, scope, "dataflow.too.complex");
		}
		return visitor;
	}

	private static void reportAnalysisQualityProblem(ProblemsHolder holder, PsiElement scope, @PropertyKey(resourceBundle = JavaAnalysisBundle.BUNDLE) String problemKey)
	{
		PsiIdentifier name = null;
		String message = null;
		if(scope.getParent() instanceof PsiMethod)
		{
			name = ((PsiMethod) scope.getParent()).getNameIdentifier();
			message = JavaAnalysisBundle.message(problemKey, "Method <code>#ref</code>");
		}
		else if(scope instanceof PsiClass)
		{
			name = ((PsiClass) scope).getNameIdentifier();
			message = JavaAnalysisBundle.message(problemKey, "Class initializer");
		}
		if(name != null)
		{ // Might be null for synthetic methods like JSP page.
			holder.registerProblem(name, message, ProblemHighlightType.WEAK_WARNING);
		}
	}

	protected
	@Nonnull
	List<LocalQuickFix> createCastFixes(PsiTypeCastExpression castExpression,
										PsiType realType,
										boolean onTheFly,
										boolean alwaysFails)
	{
		return Collections.emptyList();
	}

	protected
	@Nonnull
	List<LocalQuickFix> createNPEFixes(PsiExpression qualifier, PsiExpression expression, boolean onTheFly)
	{
		return Collections.emptyList();
	}

	protected List<LocalQuickFix> createMethodReferenceNPEFixes(PsiMethodReferenceExpression methodRef, boolean onTheFly)
	{
		return Collections.emptyList();
	}

	protected
	@javax.annotation.Nullable
	LocalQuickFix createUnwrapSwitchLabelFix()
	{
		return null;
	}

	protected
	@javax.annotation.Nullable
	LocalQuickFix createIntroduceVariableFix()
	{
		return null;
	}

	protected LocalQuickFix createRemoveAssignmentFix(PsiAssignmentExpression assignment)
	{
		return null;
	}

	protected LocalQuickFix createReplaceWithTrivialLambdaFix(Object value)
	{
		return null;
	}

	private void createDescription(DataFlowRunner runner,
								   ProblemsHolder holder,
								   final DataFlowInstructionVisitor visitor,
								   PsiElement scope)
	{
		ProblemReporter reporter = new ProblemReporter(holder, scope);

		Map<PsiExpression, ConstantResult> constantExpressions = visitor.getConstantExpressions();
		reportFailingCasts(reporter, visitor, constantExpressions);
		reportUnreachableSwitchBranches(visitor.getSwitchLabelsReachability(), holder);

		reportAlwaysFailingCalls(reporter, visitor);

		List<NullabilityProblem<?>> problems = NullabilityProblemKind.postprocessNullabilityProblems(visitor.problems().toList());
		reportNullabilityProblems(reporter, problems, constantExpressions);
		reportNullableReturns(reporter, problems, constantExpressions, scope);

		reportOptionalOfNullableImprovements(reporter, visitor.getOfNullableCalls());

		reportRedundantInstanceOf(runner, visitor, reporter);

		reportConstants(reporter, visitor);

		reportMethodReferenceProblems(holder, visitor);

		reportArrayAccessProblems(holder, visitor);

		reportArrayStoreProblems(holder, visitor);

		if(REPORT_NULLABLE_METHODS_RETURNING_NOT_NULL && visitor.isAlwaysReturnsNotNull(runner.getInstructions()))
		{
			reportAlwaysReturnsNotNull(holder, scope);
		}

		reportMutabilityViolations(holder, visitor.getMutabilityViolations(true),
				JavaAnalysisBundle.message("dataflow.message.immutable.modified"));
		reportMutabilityViolations(holder, visitor.getMutabilityViolations(false),
				JavaAnalysisBundle.message("dataflow.message.immutable.passed"));

		reportDuplicateAssignments(reporter, visitor);
		reportPointlessSameArguments(reporter, visitor);
	}

	private static void reportRedundantInstanceOf(DataFlowRunner runner,
												  DataFlowInstructionVisitor visitor,
												  ProblemReporter reporter)
	{
		for(Instruction instruction : runner.getInstructions())
		{
			if(instruction instanceof InstanceofInstruction)
			{
				InstanceofInstruction instanceOf = (InstanceofInstruction) instruction;
				if(visitor.isInstanceofRedundant(instanceOf))
				{
					PsiExpression expression = instanceOf.getExpression();
					if(expression != null &&
							(!JavaPsiPatternUtil.getExposedPatternVariables(expression).isEmpty() || shouldBeSuppressed(expression)))
					{
						continue;
					}
					reporter.registerProblem(expression,
							JavaAnalysisBundle.message("dataflow.message.redundant.instanceof"),
							new RedundantInstanceofFix());
				}
			}
		}
	}

	private void reportUnreachableSwitchBranches(Map<PsiExpression, ThreeState> labelReachability, ProblemsHolder holder)
	{
		Set<PsiSwitchBlock> coveredSwitches = new HashSet<>();

		for(Map.Entry<PsiExpression, ThreeState> entry : labelReachability.entrySet())
		{
			if(entry.getValue() != ThreeState.YES)
			{
				continue;
			}
			PsiExpression label = entry.getKey();
			PsiSwitchLabelStatementBase labelStatement = Objects.requireNonNull(PsiImplUtil.getSwitchLabel(label));
			PsiSwitchBlock statement = labelStatement.getEnclosingSwitchBlock();
			if(statement == null || !canRemoveUnreachableBranches(labelStatement, statement))
			{
				continue;
			}
			if(!StreamEx.iterate(labelStatement, Objects::nonNull, l -> PsiTreeUtil.getPrevSiblingOfType(l, PsiSwitchLabelStatementBase.class))
					.skip(1).map(PsiSwitchLabelStatementBase::getCaseValues)
					.nonNull().flatArray(PsiExpressionList::getExpressions)
					.append(StreamEx.iterate(label, Objects::nonNull, l -> PsiTreeUtil.getPrevSiblingOfType(l, PsiExpression.class)).skip(1))
					.allMatch(l -> labelReachability.get(l) == ThreeState.NO))
			{
				continue;
			}
			coveredSwitches.add(statement);
			holder.registerProblem(label, JavaAnalysisBundle.message("dataflow.message.only.switch.label"),
					createUnwrapSwitchLabelFix());
		}
		for(Map.Entry<PsiExpression, ThreeState> entry : labelReachability.entrySet())
		{
			if(entry.getValue() != ThreeState.NO)
			{
				continue;
			}
			PsiExpression label = entry.getKey();
			PsiSwitchLabelStatementBase labelStatement = Objects.requireNonNull(PsiImplUtil.getSwitchLabel(label));
			if(!coveredSwitches.contains(labelStatement.getEnclosingSwitchBlock()))
			{
				holder.registerProblem(label, JavaAnalysisBundle.message("dataflow.message.unreachable.switch.label"),
						new DeleteSwitchLabelFix(label));
			}
		}
	}

	private static boolean canRemoveUnreachableBranches(PsiSwitchLabelStatementBase labelStatement, PsiSwitchBlock statement)
	{
		if(Objects.requireNonNull(labelStatement.getCaseValues()).getExpressionCount() != 1)
		{
			return true;
		}
		List<PsiSwitchLabelStatementBase> allBranches =
				PsiTreeUtil.getChildrenOfTypeAsList(statement.getBody(), PsiSwitchLabelStatementBase.class);
		if(statement instanceof PsiSwitchStatement)
		{
			// Cannot do anything if we have already single branch and we cannot restore flow due to non-terminal breaks
			return allBranches.size() != 1 || BreakConverter.from(statement) != null;
		}
		// Expression switch: if we cannot unwrap existing branch and the other one is default case, we cannot kill it either
		return (allBranches.size() <= 2 &&
				!allBranches.stream().allMatch(branch -> branch == labelStatement || branch.isDefaultCase())) ||
				(labelStatement instanceof PsiSwitchLabeledRuleStatement &&
						((PsiSwitchLabeledRuleStatement) labelStatement).getBody() instanceof PsiExpressionStatement);
	}

	private void reportConstants(ProblemReporter reporter, DataFlowInstructionVisitor visitor)
	{
		visitor.getConstantExpressionChunks().forEach((chunk, result) -> {
			if(result == ConstantResult.UNKNOWN)
			{
				return;
			}
			PsiExpression expression = chunk.myExpression;
			if(chunk.myRange != null)
			{
				if(result.value() instanceof Boolean)
				{
					// report rare cases like a == b == c where "a == b" part is constant
					String message = JavaAnalysisBundle.message("dataflow.message.constant.condition",
							((Boolean) result.value()).booleanValue() ? 1 : 0);
					reporter.registerProblem(expression, chunk.myRange, message);
					// do not add to reported anchors if only part of expression was reported
				}
				return;
			}
			if(isCondition(expression))
			{
				if(result.value() instanceof Boolean)
				{
					reportConstantBoolean(reporter, expression, (Boolean) result.value());
				}
			}
			else
			{
				reportConstantReferenceValue(reporter, expression, result);
			}
		});
	}

	private static boolean isCondition(@Nonnull PsiExpression expression)
	{
		PsiType type = expression.getType();
		if(type == null || !PsiType.BOOLEAN.isAssignableFrom(type))
		{
			return false;
		}
		if(!(expression instanceof PsiMethodCallExpression) && !(expression instanceof PsiReferenceExpression))
		{
			return true;
		}
		PsiElement parent = PsiUtil.skipParenthesizedExprUp(expression.getParent());
		if(parent instanceof PsiStatement)
		{
			return !(parent instanceof PsiReturnStatement);
		}
		if(parent instanceof PsiPolyadicExpression)
		{
			IElementType tokenType = ((PsiPolyadicExpression) parent).getOperationTokenType();
			return tokenType.equals(JavaTokenType.ANDAND) || tokenType.equals(JavaTokenType.OROR) ||
					tokenType.equals(JavaTokenType.AND) || tokenType.equals(JavaTokenType.OR);
		}
		if(parent instanceof PsiConditionalExpression)
		{
			return PsiTreeUtil.isAncestor(((PsiConditionalExpression) parent).getCondition(), expression, false);
		}
		return PsiUtil.isAccessedForWriting(expression);
	}

	private void reportConstantReferenceValue(ProblemReporter reporter, PsiExpression ref, ConstantResult constant)
	{
		if(!REPORT_CONSTANT_REFERENCE_VALUES && ref instanceof PsiReferenceExpression)
		{
			return;
		}
		if(shouldBeSuppressed(ref) || constant == ConstantResult.UNKNOWN)
		{
			return;
		}
		List<LocalQuickFix> fixes = new SmartList<>();
		String presentableName = constant.toString();
		if(Integer.valueOf(0).equals(constant.value()) && !shouldReportZero(ref))
		{
			return;
		}
		if(constant.value() instanceof Boolean)
		{
			fixes.add(createSimplifyBooleanExpressionFix(ref, (Boolean) constant.value()));
		}
		else
		{
			fixes.add(new ReplaceWithConstantValueFix(presentableName, presentableName));
		}
		Object value = constant.value();
		boolean isAssertion = isAssertionEffectively(ref, constant);
		if(isAssertion && DONT_REPORT_TRUE_ASSERT_STATEMENTS)
		{
			return;
		}
		if(value instanceof Boolean)
		{
			ContainerUtil.addIfNotNull(fixes, createReplaceWithNullCheckFix(ref, (Boolean) value));
		}
		if(reporter.isOnTheFly())
		{
			if(ref instanceof PsiReferenceExpression)
			{
				fixes.add(new SetInspectionOptionFix(this, "REPORT_CONSTANT_REFERENCE_VALUES",
						JavaAnalysisBundle.message("inspection.data.flow.turn.off.constant.references.quickfix"),
						false));
			}
			if(isAssertion)
			{
				fixes.add(new SetInspectionOptionFix(this, "DONT_REPORT_TRUE_ASSERT_STATEMENTS",
						JavaAnalysisBundle.message("inspection.data.flow.turn.off.true.asserts.quickfix"), true));
			}
		}
		if(reporter.isOnTheFly())
		{
			ContainerUtil.addIfNotNull(fixes, createExplainFix(ref, new TrackingRunner.ValueDfaProblemType(value)));
		}

		ProblemHighlightType type;
		String message;
		if(ref instanceof PsiMethodCallExpression || ref instanceof PsiPolyadicExpression)
		{
			type = ProblemHighlightType.GENERIC_ERROR_OR_WARNING;
			message = JavaAnalysisBundle.message("dataflow.message.constant.expression", presentableName);
		}
		else
		{
			type = ProblemHighlightType.WEAK_WARNING;
			message = JavaAnalysisBundle.message("dataflow.message.constant.value", presentableName);
		}
		reporter.registerProblem(ref, message, type, fixes.toArray(LocalQuickFix.EMPTY_ARRAY));
	}

	private static boolean shouldReportZero(PsiExpression ref)
	{
		if(ref instanceof PsiPolyadicExpression)
		{
			if(PsiUtil.isConstantExpression(ref))
			{
				return false;
			}
			PsiPolyadicExpression polyadic = (PsiPolyadicExpression) ref;
			IElementType tokenType = polyadic.getOperationTokenType();
			if(tokenType.equals(JavaTokenType.ASTERISK))
			{
				PsiMethod method = PsiTreeUtil.getParentOfType(ref, PsiMethod.class, true, PsiLambdaExpression.class, PsiClass.class);
				if(MethodUtils.isHashCode(method))
				{
					// Standard hashCode template generates int result = 0; result = result * 31 + ...;
					// so annoying warnings might be produced there
					return false;
				}
			}
		}
		else if(ref instanceof PsiMethodCallExpression)
		{
			PsiMethodCallExpression call = (PsiMethodCallExpression) ref;
			PsiExpression qualifier = call.getMethodExpression().getQualifierExpression();
			if(PsiUtil.isConstantExpression(qualifier) &&
					ContainerUtil.and(call.getArgumentList().getExpressions(), PsiUtil::isConstantExpression))
			{
				return false;
			}
		}
		else
		{
			return false;
		}
		PsiElement parent = PsiUtil.skipParenthesizedExprUp(ref.getParent());
		PsiBinaryExpression binOp = tryCast(parent, PsiBinaryExpression.class);
		if(binOp != null && ComparisonUtils.isEqualityComparison(binOp) &&
				(ExpressionUtils.isZero(binOp.getLOperand()) || ExpressionUtils.isZero(binOp.getROperand())))
		{
			return false;
		}
		return true;
	}

	private static void reportPointlessSameArguments(ProblemReporter reporter, DataFlowInstructionVisitor visitor)
	{
		visitor.pointlessSameArguments().forKeyValue((expr, eq) -> {
			PsiElement name = expr.getReferenceNameElement();
			if(name != null)
			{
				PsiExpression[] expressions = PsiExpression.EMPTY_ARRAY;
				if(expr.getParent() instanceof PsiMethodCallExpression)
				{
					expressions = ((PsiMethodCallExpression) expr.getParent()).getArgumentList().getExpressions();
					if(expressions.length == 2 && PsiUtil.isConstantExpression(expressions[0]) && PsiUtil.isConstantExpression(expressions[1]) &&
							!EquivalenceChecker.getCanonicalPsiEquivalence().expressionsAreEquivalent(expressions[0], expressions[1]))
					{
						return;
					}
				}
				if(eq.firstArgEqualToResult)
				{
					String message = eq.argsEqual ? JavaAnalysisBundle.message("dataflow.message.pointless.same.arguments") :
							JavaAnalysisBundle.message("dataflow.message.pointless.same.argument.and.result", 1);
					LocalQuickFix fix = expressions.length == 2 ? new ReplaceWithArgumentFix(expressions[0], 0) : null;
					reporter.registerProblem(name, message, fix);
				}
				else if(eq.argsEqual)
				{
					reporter.registerProblem(name, JavaAnalysisBundle.message("dataflow.message.pointless.same.arguments"));
				}
				else if(eq.secondArgEqualToResult)
				{
					LocalQuickFix fix = expressions.length == 2 ? new ReplaceWithArgumentFix(expressions[1], 1) : null;
					reporter.registerProblem(name, JavaAnalysisBundle.message("dataflow.message.pointless.same.argument.and.result", 2), fix);
				}
			}
		});
	}

	private void reportDuplicateAssignments(ProblemReporter reporter, DataFlowInstructionVisitor visitor)
	{
		visitor.sameValueAssignments().forEach(expr -> {
			expr = PsiUtil.skipParenthesizedExprDown(expr);
			if(expr == null)
			{
				return;
			}
			PsiAssignmentExpression assignment = PsiTreeUtil.getParentOfType(expr, PsiAssignmentExpression.class);
			PsiElement context = PsiTreeUtil.getParentOfType(expr, PsiForStatement.class, PsiClassInitializer.class);
			if(context instanceof PsiForStatement && PsiTreeUtil.isAncestor(((PsiForStatement) context).getInitialization(), expr, true))
			{
				return;
			}
			if(context instanceof PsiClassInitializer && expr instanceof PsiReferenceExpression)
			{
				if(assignment != null)
				{
					Object constValue = ExpressionUtils.computeConstantExpression(assignment.getRExpression());
					if(constValue == PsiTypesUtil.getDefaultValue(expr.getType()))
					{
						PsiReferenceExpression ref = (PsiReferenceExpression) expr;
						PsiElement target = ref.resolve();
						if(target instanceof PsiField &&
								(((PsiField) target).hasModifierProperty(PsiModifier.STATIC) || ExpressionUtil.isEffectivelyUnqualified(ref)) &&
								((PsiField) target).getContainingClass() == ((PsiClassInitializer) context).getContainingClass())
						{
							return;
						}
					}
				}
			}
			String message = assignment != null && !assignment.getOperationTokenType().equals(JavaTokenType.EQ)
					? JavaAnalysisBundle.message("dataflow.message.redundant.update")
					: JavaAnalysisBundle.message("dataflow.message.redundant.assignment");
			reporter.registerProblem(expr, message, createRemoveAssignmentFix(assignment));
		});
	}

	private void reportMutabilityViolations(ProblemsHolder holder, Set<PsiElement> violations, String message)
	{
		for(PsiElement violation : violations)
		{
			holder.registerProblem(violation, message, createMutabilityViolationFix(violation, holder.isOnTheFly()));
		}
	}

	protected LocalQuickFix createMutabilityViolationFix(PsiElement violation, boolean onTheFly)
	{
		return null;
	}

	protected void reportNullabilityProblems(ProblemReporter reporter,
											 List<NullabilityProblem<?>> problems,
											 Map<PsiExpression, ConstantResult> expressions)
	{
		for(NullabilityProblem<?> problem : problems)
		{
			PsiExpression expression = problem.getDereferencedExpression();
			if(!REPORT_UNSOUND_WARNINGS)
			{
				if(expression == null)
				{
					continue;
				}
				PsiExpression unwrapped = PsiUtil.skipParenthesizedExprDown(expression);
				if(!ExpressionUtils.isNullLiteral(unwrapped) && expressions.get(expression) != ConstantResult.NULL)
				{
					continue;
				}
			}
			NullabilityProblemKind.innerClassNPE.ifMyProblem(problem, newExpression -> {
				List<LocalQuickFix> fixes = createNPEFixes(newExpression.getQualifier(), newExpression, reporter.isOnTheFly());
				reporter
						.registerProblem(getElementToHighlight(newExpression), problem.getMessage(expressions), fixes.toArray(LocalQuickFix.EMPTY_ARRAY));
			});
			NullabilityProblemKind.callMethodRefNPE.ifMyProblem(problem, methodRef ->
					reporter.registerProblem(methodRef, JavaAnalysisBundle.message("dataflow.message.npe.methodref.invocation"),
							createMethodReferenceNPEFixes(methodRef, reporter.isOnTheFly()).toArray(LocalQuickFix.EMPTY_ARRAY)));
			NullabilityProblemKind.callNPE.ifMyProblem(problem, call -> reportCallMayProduceNpe(reporter, problem.getMessage(expressions), call));
			NullabilityProblemKind.passingToNotNullParameter.ifMyProblem(problem, expr -> {
				List<LocalQuickFix> fixes = createNPEFixes(expression, expression, reporter.isOnTheFly());
				reporter.registerProblem(expression, problem.getMessage(expressions), fixes.toArray(LocalQuickFix.EMPTY_ARRAY));
			});
			NullabilityProblemKind.passingToNotNullMethodRefParameter.ifMyProblem(problem, methodRef -> {
				LocalQuickFix[] fixes = createMethodReferenceNPEFixes(methodRef, reporter.isOnTheFly()).toArray(LocalQuickFix.EMPTY_ARRAY);
				reporter.registerProblem(methodRef, JavaAnalysisBundle.message("dataflow.message.passing.nullable.argument.methodref"), fixes);
			});
			NullabilityProblemKind.unboxingMethodRefParameter.ifMyProblem(problem, methodRef -> {
				LocalQuickFix[] fixes = createMethodReferenceNPEFixes(methodRef, reporter.isOnTheFly()).toArray(LocalQuickFix.EMPTY_ARRAY);
				reporter.registerProblem(methodRef, JavaAnalysisBundle.message("dataflow.message.unboxing.nullable.argument.methodref"), fixes);
			});
			NullabilityProblemKind.arrayAccessNPE.ifMyProblem(problem, arrayAccess -> {
				LocalQuickFix[] fixes =
						createNPEFixes(arrayAccess.getArrayExpression(), arrayAccess, reporter.isOnTheFly()).toArray(LocalQuickFix.EMPTY_ARRAY);
				reporter.registerProblem(arrayAccess, problem.getMessage(expressions), fixes);
			});
			NullabilityProblemKind.fieldAccessNPE.ifMyProblem(problem, element -> {
				PsiElement parent = element.getParent();
				PsiExpression fieldAccess = parent instanceof PsiReferenceExpression ? (PsiExpression) parent : element;
				LocalQuickFix[] fix = createNPEFixes(element, fieldAccess, reporter.isOnTheFly()).toArray(LocalQuickFix.EMPTY_ARRAY);
				reporter.registerProblem(element, problem.getMessage(expressions), fix);
			});
			NullabilityProblemKind.unboxingNullable.ifMyProblem(problem, element -> {
				PsiExpression anchor = expression;
				if(anchor instanceof PsiTypeCastExpression && anchor.getType() instanceof PsiPrimitiveType)
				{
					anchor = Objects.requireNonNull(((PsiTypeCastExpression) anchor).getOperand());
				}
				reporter.registerProblem(anchor, problem.getMessage(expressions));
			});
			NullabilityProblemKind.nullableFunctionReturn.ifMyProblem(
					problem, expr -> reporter.registerProblem(expression == null ? expr : expression, problem.getMessage(expressions)));
			Consumer<PsiExpression> reportNullability = expr -> reportNullabilityProblem(reporter, problem, expression, expressions);
			NullabilityProblemKind.assigningToNotNull.ifMyProblem(problem, reportNullability);
			NullabilityProblemKind.storingToNotNullArray.ifMyProblem(problem, reportNullability);
			if(SUGGEST_NULLABLE_ANNOTATIONS)
			{
				NullabilityProblemKind.passingToNonAnnotatedMethodRefParameter.ifMyProblem(
						problem, methodRef -> reporter.registerProblem(methodRef, problem.getMessage(expressions)));
				NullabilityProblemKind.passingToNonAnnotatedParameter.ifMyProblem(
						problem, top -> reportNullableArgumentsPassedToNonAnnotated(reporter, problem.getMessage(expressions), expression, top));
				NullabilityProblemKind.assigningToNonAnnotatedField.ifMyProblem(
						problem, top -> reportNullableAssignedToNonAnnotatedField(reporter, top, expression, problem.getMessage(expressions)));
			}
		}
	}

	private void reportNullabilityProblem(ProblemReporter reporter,
										  NullabilityProblem<?> problem,
										  PsiExpression expr,
										  Map<PsiExpression, ConstantResult> expressions)
	{
		LocalQuickFix[] fixes = createNPEFixes(expr, expr, reporter.isOnTheFly()).toArray(LocalQuickFix.EMPTY_ARRAY);
		reporter.registerProblem(expr, problem.getMessage(expressions), fixes);
	}

	private static void reportArrayAccessProblems(ProblemsHolder holder, DataFlowInstructionVisitor visitor)
	{
		visitor.outOfBoundsArrayAccesses().forEach(access -> {
			PsiExpression indexExpression = access.getIndexExpression();
			if(indexExpression != null)
			{
				holder.registerProblem(indexExpression, JavaAnalysisBundle.message("dataflow.message.array.index.out.of.bounds"));
			}
		});
	}

	private static void reportArrayStoreProblems(ProblemsHolder holder, DataFlowInstructionVisitor visitor)
	{
		visitor.getArrayStoreProblems().forEach(
				(assignment, types) -> holder.registerProblem(assignment.getOperationSign(), JavaAnalysisBundle
						.message("dataflow.message.arraystore", types.getFirst().getCanonicalText(), types.getSecond().getCanonicalText())));
	}

	private void reportMethodReferenceProblems(ProblemsHolder holder, DataFlowInstructionVisitor visitor)
	{
		visitor.getMethodReferenceResults().forEach((methodRef, result) -> {
			if(result != ConstantResult.UNKNOWN)
			{
				Object value = result.value();
				holder.registerProblem(methodRef, JavaAnalysisBundle.message("dataflow.message.constant.method.reference", value),
						createReplaceWithTrivialLambdaFix(value));
			}
		});
	}

	private void reportAlwaysReturnsNotNull(ProblemsHolder holder, PsiElement scope)
	{
		if(!(scope.getParent() instanceof PsiMethod))
		{
			return;
		}

		PsiMethod method = (PsiMethod) scope.getParent();
		if(PsiUtil.canBeOverridden(method))
		{
			return;
		}

		NullabilityAnnotationInfo info = NullableNotNullManager.getInstance(scope.getProject()).findOwnNullabilityInfo(method);
		if(info == null || info.getNullability() != Nullability.NULLABLE)
		{
			return;
		}

		PsiAnnotation annotation = info.getAnnotation();
		if(!annotation.isPhysical() || alsoAppliesToInternalSubType(annotation, method))
		{
			return;
		}

		PsiJavaCodeReferenceElement annoName = annotation.getNameReferenceElement();
		assert annoName != null;
		String msg = JavaAnalysisBundle
				.message("dataflow.message.return.notnull.from.nullable", NullableStuffInspectionBase.getPresentableAnnoName(annotation), method.getName());
		LocalQuickFix[] fixes = {AddAnnotationPsiFix.createAddNotNullFix(method)};
		if(holder.isOnTheFly())
		{
			fixes = ArrayUtil.append(fixes, new SetInspectionOptionFix(this, "REPORT_NULLABLE_METHODS_RETURNING_NOT_NULL",
					JavaAnalysisBundle
							.message(
									"inspection.data.flow.turn.off.nullable.returning.notnull.quickfix"),
					false));
		}
		holder.registerProblem(annoName, msg, fixes);
	}

	private static boolean alsoAppliesToInternalSubType(PsiAnnotation annotation, PsiMethod method)
	{
		return AnnotationTargetUtil.isTypeAnnotation(annotation) && method.getReturnType() instanceof PsiArrayType;
	}

	private void reportAlwaysFailingCalls(ProblemReporter reporter, DataFlowInstructionVisitor visitor)
	{
		visitor.alwaysFailingCalls().remove(TestUtils::isExceptionExpected).forEach(call -> {
			String message = getContractMessage(JavaMethodContractUtil.getMethodCallContracts(call));
			LocalQuickFix causeFix = reporter.isOnTheFly() ? createExplainFix(call, new TrackingRunner.FailingCallDfaProblemType()) : null;
			reporter.registerProblem(getElementToHighlight(call), message, causeFix);
		});
	}

	private static
	@Nonnull
	String getContractMessage(List<? extends MethodContract> contracts)
	{
		if(contracts.stream().allMatch(mc -> mc.getConditions().stream().allMatch(ContractValue::isBoundCheckingCondition)))
		{
			return JavaAnalysisBundle.message("dataflow.message.contract.fail.index");
		}
		return JavaAnalysisBundle.message("dataflow.message.contract.fail");
	}

	private static
	@Nonnull
	PsiElement getElementToHighlight(@Nonnull PsiCall call)
	{
		PsiJavaCodeReferenceElement ref;
		if(call instanceof PsiNewExpression)
		{
			ref = ((PsiNewExpression) call).getClassReference();
		}
		else if(call instanceof PsiMethodCallExpression)
		{
			ref = ((PsiMethodCallExpression) call).getMethodExpression();
		}
		else
		{
			return call;
		}
		if(ref != null)
		{
			PsiElement name = ref.getReferenceNameElement();
			return name != null ? name : ref;
		}
		return call;
	}

	private static void reportOptionalOfNullableImprovements(ProblemReporter reporter, Map<PsiElement, ThreeState> nullArgs)
	{
		nullArgs.forEach((anchor, alwaysPresent) -> {
			if(alwaysPresent == ThreeState.UNSURE)
			{
				return;
			}
			if(alwaysPresent.toBoolean())
			{
				reporter.registerProblem(anchor, JavaAnalysisBundle.message("dataflow.message.passing.non.null.argument.to.optional"),
						DfaOptionalSupport.createReplaceOptionalOfNullableWithOfFix(anchor));
			}
			else
			{
				reporter.registerProblem(anchor, JavaAnalysisBundle.message("dataflow.message.passing.null.argument.to.optional"),
						DfaOptionalSupport.createReplaceOptionalOfNullableWithEmptyFix(anchor));
			}
		});
	}

	private void reportNullableArgumentsPassedToNonAnnotated(ProblemReporter reporter,
															 String message,
															 PsiExpression expression,
															 PsiExpression top)
	{
		PsiParameter parameter = MethodCallUtils.getParameterForArgument(top);
		if(parameter != null && BaseIntentionAction.canModify(parameter) && AnnotationUtil.isAnnotatingApplicable(parameter))
		{
			List<LocalQuickFix> fixes = createNPEFixes(expression, top, reporter.isOnTheFly());
			fixes.add(AddAnnotationPsiFix.createAddNullableFix(parameter));
			reporter.registerProblem(expression, message, fixes.toArray(LocalQuickFix.EMPTY_ARRAY));
		}
	}

	private void reportNullableAssignedToNonAnnotatedField(ProblemReporter reporter,
														   PsiExpression top,
														   PsiExpression expression,
														   String message)
	{
		PsiField field = getAssignedField(top);
		if(field != null)
		{
			List<LocalQuickFix> fixes = createNPEFixes(expression, top, reporter.isOnTheFly());
			fixes.add(AddAnnotationPsiFix.createAddNullableFix(field));
			reporter.registerProblem(expression, message, fixes.toArray(LocalQuickFix.EMPTY_ARRAY));
		}
	}

	private static
	@javax.annotation.Nullable
	PsiField getAssignedField(PsiElement assignedValue)
	{
		PsiElement parent = PsiUtil.skipParenthesizedExprUp(assignedValue.getParent());
		if(parent instanceof PsiAssignmentExpression)
		{
			PsiExpression lExpression = ((PsiAssignmentExpression) parent).getLExpression();
			PsiElement target = lExpression instanceof PsiReferenceExpression ? ((PsiReferenceExpression) lExpression).resolve() : null;
			return tryCast(target, PsiField.class);
		}
		return null;
	}

	private void reportCallMayProduceNpe(ProblemReporter reporter, String message, PsiMethodCallExpression callExpression)
	{
		PsiReferenceExpression methodExpression = callExpression.getMethodExpression();
		List<LocalQuickFix> fixes = createNPEFixes(methodExpression.getQualifierExpression(), callExpression, reporter.isOnTheFly());
		ContainerUtil.addIfNotNull(fixes, ReplaceWithObjectsEqualsFix.createFix(callExpression, methodExpression));

		PsiElement toHighlight = getElementToHighlight(callExpression);
		reporter.registerProblem(toHighlight, message, fixes.toArray(LocalQuickFix.EMPTY_ARRAY));
	}

	private void reportFailingCasts(@Nonnull ProblemReporter reporter,
									@Nonnull DataFlowInstructionVisitor visitor,
									@Nonnull Map<PsiExpression, ConstantResult> constantExpressions)
	{
		visitor.getFailingCastExpressions().forKeyValue((typeCast, info) -> {
			boolean alwaysFails = info.getFirst();
			PsiType realType = info.getSecond();
			if(!REPORT_UNSOUND_WARNINGS && !alwaysFails)
			{
				return;
			}
			PsiExpression operand = typeCast.getOperand();
			PsiTypeElement castType = typeCast.getCastType();
			ConstantResult result = constantExpressions.get(PsiUtil.skipParenthesizedExprDown(operand));
			// Skip reporting if cast operand is always null: null can be cast to anything
			if(result == ConstantResult.NULL || ExpressionUtils.isNullLiteral(operand))
			{
				return;
			}
			assert castType != null;
			assert operand != null;
			List<LocalQuickFix> fixes = new ArrayList<>(createCastFixes(typeCast, realType, reporter.isOnTheFly(), alwaysFails));
			if(reporter.isOnTheFly())
			{
				fixes.add(createExplainFix(typeCast, new TrackingRunner.CastDfaProblemType()));
			}
			String text = PsiExpressionTrimRenderer.render(operand);
			String message = alwaysFails ?
					JavaAnalysisBundle.message("dataflow.message.cce.always", text) :
					JavaAnalysisBundle.message("dataflow.message.cce", text);
			reporter.registerProblem(castType, message, fixes.toArray(LocalQuickFix.EMPTY_ARRAY));
		});
	}

	private void reportConstantBoolean(ProblemReporter reporter, PsiElement psiAnchor, boolean evaluatesToTrue)
	{
		while(psiAnchor instanceof PsiParenthesizedExpression)
		{
			psiAnchor = ((PsiParenthesizedExpression) psiAnchor).getExpression();
		}
		if(psiAnchor == null || shouldBeSuppressed(psiAnchor))
		{
			return;
		}
		boolean isAssertion = isAssertionEffectively(psiAnchor, evaluatesToTrue);
		if(DONT_REPORT_TRUE_ASSERT_STATEMENTS && isAssertion)
		{
			return;
		}

		PsiElement parent = PsiUtil.skipParenthesizedExprUp(psiAnchor.getParent());
		if(parent instanceof PsiAssignmentExpression &&
				PsiTreeUtil.isAncestor(((PsiAssignmentExpression) parent).getLExpression(), psiAnchor, false))
		{
			reporter.registerProblem(
					psiAnchor,
					JavaAnalysisBundle.message("dataflow.message.pointless.assignment.expression", Boolean.toString(evaluatesToTrue)),
					createConditionalAssignmentFixes(evaluatesToTrue, (PsiAssignmentExpression) parent, reporter.isOnTheFly())
			);
			return;
		}

		List<LocalQuickFix> fixes = new ArrayList<>();
		if(!isCoveredBySurroundingFix(psiAnchor, evaluatesToTrue))
		{
			ContainerUtil.addIfNotNull(fixes, createSimplifyBooleanExpressionFix(psiAnchor, evaluatesToTrue));
			if(isAssertion && reporter.isOnTheFly())
			{
				fixes.add(new SetInspectionOptionFix(this, "DONT_REPORT_TRUE_ASSERT_STATEMENTS",
						JavaAnalysisBundle.message("inspection.data.flow.turn.off.true.asserts.quickfix"), true));
			}
			ContainerUtil.addIfNotNull(fixes, createReplaceWithNullCheckFix(psiAnchor, evaluatesToTrue));
		}
		if(reporter.isOnTheFly() && psiAnchor instanceof PsiExpression)
		{
			ContainerUtil.addIfNotNull(fixes, createExplainFix(
					(PsiExpression) psiAnchor, new TrackingRunner.ValueDfaProblemType(evaluatesToTrue)));
		}
		String message = JavaAnalysisBundle.message(isAtRHSOfBooleanAnd(psiAnchor) ?
				"dataflow.message.constant.condition.when.reached" :
				"dataflow.message.constant.condition", evaluatesToTrue ? 1 : 0);
		reporter.registerProblem(psiAnchor, message, fixes.toArray(LocalQuickFix.EMPTY_ARRAY));
	}

	protected
	@javax.annotation.Nullable
	LocalQuickFix createExplainFix(PsiExpression anchor, TrackingRunner.DfaProblemType problemType)
	{
		return null;
	}

	private static boolean isCoveredBySurroundingFix(PsiElement anchor, boolean evaluatesToTrue)
	{
		PsiElement parent = PsiUtil.skipParenthesizedExprUp(anchor.getParent());
		if(parent instanceof PsiPolyadicExpression)
		{
			IElementType tokenType = ((PsiPolyadicExpression) parent).getOperationTokenType();
			return tokenType.equals(JavaTokenType.ANDAND) && !evaluatesToTrue ||
					tokenType.equals(JavaTokenType.OROR) && evaluatesToTrue;
		}
		return parent instanceof PsiExpression && BoolUtils.isNegation((PsiExpression) parent);
	}

	@Contract("null -> false")
	private static boolean shouldBeSuppressed(PsiElement anchor)
	{
		if(!(anchor instanceof PsiExpression))
		{
			return false;
		}
		// Don't report System.out.println(b = false) or doSomething((Type)null)
		if(anchor instanceof PsiAssignmentExpression || anchor instanceof PsiTypeCastExpression)
		{
			return true;
		}
		// For conditional the root cause (constant condition or both branches constant) should be already reported for branches
		if(anchor instanceof PsiConditionalExpression)
		{
			return true;
		}
		PsiExpression expression = (PsiExpression) anchor;
		if(expression instanceof PsiReferenceExpression)
		{
			PsiReferenceExpression ref = (PsiReferenceExpression) expression;
			if("TRUE".equals(ref.getReferenceName()) || "FALSE".equals(ref.getReferenceName()))
			{
				PsiElement target = ref.resolve();
				if(target instanceof PsiField)
				{
					PsiClass containingClass = ((PsiField) target).getContainingClass();
					if(containingClass != null && CommonClassNames.JAVA_LANG_BOOLEAN.equals(containingClass.getQualifiedName()))
					{
						return true;
					}
				}
			}
		}
		if(expression instanceof PsiInstanceOfExpression)
		{
			PsiType type = ((PsiInstanceOfExpression) expression).getOperand().getType();
			if(type == null || !TypeConstraints.instanceOf(type).isResolved())
			{
				return true;
			}
		}
		PsiElement parent = PsiUtil.skipParenthesizedExprUp(expression.getParent());
		// Don't report "x" in "x == null" as will be anyways reported as "always true"
		if(parent instanceof PsiBinaryExpression && ExpressionUtils.getValueComparedWithNull((PsiBinaryExpression) parent) != null)
		{
			return true;
		}
		// Dereference of null will be covered by other warning
		if(ExpressionUtils.isVoidContext(expression) || isDereferenceContext(expression))
		{
			return true;
		}
		// We assume all Void variables as null because you cannot instantiate it without dirty hacks
		// However reporting them as "always null" looks redundant (dereferences or comparisons will be reported though).
		if(TypeUtils.typeEquals(CommonClassNames.JAVA_LANG_VOID, expression.getType()))
		{
			return true;
		}
		if(isFlagCheck(anchor))
		{
			return true;
		}
		boolean condition = isCondition(expression);
		if(!condition && expression instanceof PsiReferenceExpression)
		{
			PsiVariable variable = tryCast(((PsiReferenceExpression) expression).resolve(), PsiVariable.class);
			if(variable instanceof PsiField &&
					variable.hasModifierProperty(PsiModifier.STATIC) &&
					ExpressionUtils.isNullLiteral(variable.getInitializer()))
			{
				return true;
			}
			return variable instanceof PsiLocalVariable && variable.hasModifierProperty(PsiModifier.FINAL) &&
					PsiUtil.isCompileTimeConstant(variable);
		}
		if(!condition && expression instanceof PsiMethodCallExpression)
		{
			List<? extends MethodContract> contracts = JavaMethodContractUtil.getMethodCallContracts((PsiCallExpression) expression);
			ContractReturnValue value = JavaMethodContractUtil.getNonFailingReturnValue(contracts);
			if(value != null)
			{
				return true;
			}
			if(!(parent instanceof PsiAssignmentExpression) && !(parent instanceof PsiVariable) &&
					!(parent instanceof PsiReturnStatement))
			{
				PsiMethod method = ((PsiMethodCallExpression) expression).resolveMethod();
				if(method == null || !JavaMethodContractUtil.isPure(method))
				{
					return true;
				}
			}
		}
		while(expression != null && BoolUtils.isNegation(expression))
		{
			expression = BoolUtils.getNegated(expression);
		}
		PsiMethodCallExpression call = tryCast(expression, PsiMethodCallExpression.class);
		// Reported by "Equals with itself" inspection; avoid double reporting
		return call != null && EqualsWithItselfInspection.isEqualsWithItself(call);
	}

	private static boolean isDereferenceContext(PsiExpression ref)
	{
		PsiElement parent = PsiUtil.skipParenthesizedExprUp(ref.getParent());
		return parent instanceof PsiReferenceExpression || parent instanceof PsiArrayAccessExpression
				|| parent instanceof PsiSwitchStatement || parent instanceof PsiSynchronizedStatement;
	}

	private static LocalQuickFix createReplaceWithNullCheckFix(PsiElement psiAnchor, boolean evaluatesToTrue)
	{
		if(evaluatesToTrue)
		{
			return null;
		}
		if(!(psiAnchor instanceof PsiMethodCallExpression))
		{
			return null;
		}
		final PsiMethodCallExpression methodCallExpression = (PsiMethodCallExpression) psiAnchor;
		if(!MethodCallUtils.isEqualsCall(methodCallExpression))
		{
			return null;
		}
		PsiExpression arg = ArrayUtil.getFirstElement(methodCallExpression.getArgumentList().getExpressions());
		if(!ExpressionUtils.isNullLiteral(arg))
		{
			return null;
		}
		PsiElement parent = PsiUtil.skipParenthesizedExprUp(psiAnchor.getParent());
		return EqualsToEqualityFix.buildFix(methodCallExpression, parent instanceof PsiExpression && BoolUtils.isNegation((PsiExpression) parent));
	}

	protected LocalQuickFix[] createConditionalAssignmentFixes(boolean evaluatesToTrue, PsiAssignmentExpression parent, final boolean onTheFly)
	{
		return LocalQuickFix.EMPTY_ARRAY;
	}

	private static
	@javax.annotation.Nullable
	PsiMethod getScopeMethod(PsiElement block)
	{
		PsiElement parent = block.getParent();
		if(parent instanceof PsiMethod)
		{
			return (PsiMethod) parent;
		}
		if(parent instanceof PsiLambdaExpression)
		{
			return LambdaUtil.getFunctionalInterfaceMethod(((PsiLambdaExpression) parent).getFunctionalInterfaceType());
		}
		return null;
	}

	private void reportNullableReturns(ProblemReporter reporter,
									   List<NullabilityProblem<?>> problems,
									   Map<PsiExpression, ConstantResult> expressions,
									   @Nonnull PsiElement block)
	{
		final PsiMethod method = getScopeMethod(block);
		if(method == null)
		{
			return;
		}
		NullableNotNullManager manager = NullableNotNullManager.getInstance(method.getProject());
		NullabilityAnnotationInfo info = manager.findEffectiveNullabilityInfo(method);
		if(info == null)
		{
			info = DfaPsiUtil.getTypeNullabilityInfo(PsiTypesUtil.getMethodReturnType(block));
		}
		PsiAnnotation anno = info == null ? null : info.getAnnotation();
		Nullability nullability = info == null ? Nullability.UNKNOWN : info.getNullability();
		if(nullability == Nullability.NULLABLE)
		{
			if(!AnnotationUtil.isInferredAnnotation(anno))
			{
				return;
			}
			if(DfaPsiUtil.getTypeNullability(method.getReturnType()) == Nullability.NULLABLE)
			{
				return;
			}
		}

		if(nullability != Nullability.NOT_NULL && (!SUGGEST_NULLABLE_ANNOTATIONS || block.getParent() instanceof PsiLambdaExpression))
		{
			return;
		}

		PsiType returnType = method.getReturnType();
		// no warnings in void lambdas, where the expression is not returned anyway
		if(block instanceof PsiExpression && block.getParent() instanceof PsiLambdaExpression && PsiType.VOID.equals(returnType))
		{
			return;
		}

		// no warnings for Void methods, where only null can be possibly returned
		if(returnType == null || returnType.equalsToText(CommonClassNames.JAVA_LANG_VOID))
		{
			return;
		}

		for(NullabilityProblem<PsiExpression> problem : StreamEx.of(problems).map(NullabilityProblemKind.nullableReturn::asMyProblem).nonNull())
		{
			final PsiExpression anchor = problem.getAnchor();
			PsiExpression expr = problem.getDereferencedExpression();

			boolean exactlyNull = isNullLiteralExpression(expr) || expressions.get(expr) == ConstantResult.NULL;
			if(!REPORT_UNSOUND_WARNINGS && !exactlyNull)
			{
				continue;
			}
			if(nullability == Nullability.NOT_NULL)
			{
				String presentable = NullableStuffInspectionBase.getPresentableAnnoName(anno);
				final String text = exactlyNull
						? JavaAnalysisBundle.message("dataflow.message.return.null.from.notnull", presentable)
						: JavaAnalysisBundle.message("dataflow.message.return.nullable.from.notnull", presentable);
				reporter.registerProblem(expr, text, createNPEFixes(expr, expr, reporter.isOnTheFly()).toArray(LocalQuickFix.EMPTY_ARRAY));
			}
			else if(AnnotationUtil.isAnnotatingApplicable(anchor))
			{
				final String defaultNullable = manager.getDefaultNullable();
				final String presentableNullable = StringUtil.getShortName(defaultNullable);
				final String text = exactlyNull
						? JavaAnalysisBundle.message("dataflow.message.return.null.from.notnullable", presentableNullable)
						: JavaAnalysisBundle.message("dataflow.message.return.nullable.from.notnullable", presentableNullable);
				PsiMethod surroundingMethod = PsiTreeUtil.getParentOfType(anchor, PsiMethod.class, true, PsiLambdaExpression.class);
				final LocalQuickFix fix = surroundingMethod == null ? null :
						new AddAnnotationPsiFix(defaultNullable, surroundingMethod,
								ArrayUtil.toStringArray(manager.getNotNulls()));
				reporter.registerProblem(expr, text, fix);
			}
		}
	}

	private static boolean isAssertionEffectively(@Nonnull PsiElement anchor, ConstantResult result)
	{
		Object value = result.value();
		if(value instanceof Boolean)
		{
			return isAssertionEffectively(anchor, (Boolean) value);
		}
		if(value != null)
		{
			return false;
		}
		return isAssertCallArgument(anchor, ContractValue.nullValue());
	}

	private static boolean isAssertionEffectively(@Nonnull PsiElement anchor, boolean evaluatesToTrue)
	{
		PsiElement parent;
		while(true)
		{
			parent = anchor.getParent();
			if(parent instanceof PsiExpression && BoolUtils.isNegation((PsiExpression) parent))
			{
				evaluatesToTrue = !evaluatesToTrue;
				anchor = parent;
				continue;
			}
			if(parent instanceof PsiParenthesizedExpression)
			{
				anchor = parent;
				continue;
			}
			if(parent instanceof PsiPolyadicExpression)
			{
				IElementType tokenType = ((PsiPolyadicExpression) parent).getOperationTokenType();
				if(tokenType.equals(JavaTokenType.ANDAND) || tokenType.equals(JavaTokenType.OROR))
				{
					// always true operand makes always true OR-chain and does not affect the result of AND-chain
					// Note that in `assert unknownExpression && trueExpression;` the trueExpression should not be reported
					// because this assert is essentially the shortened `assert unknownExpression; assert trueExpression;`
					// which is not reported.
					boolean causesShortCircuit = (tokenType.equals(JavaTokenType.OROR) == evaluatesToTrue) &&
							ArrayUtil.getLastElement(((PsiPolyadicExpression) parent).getOperands()) != anchor;
					if(!causesShortCircuit)
					{
						// We still report `assert trueExpression || unknownExpression`, because here `unknownExpression` is never checked
						// which is probably not intended.
						anchor = parent;
						continue;
					}
				}
			}
			break;
		}
		if(parent instanceof PsiAssertStatement)
		{
			return evaluatesToTrue;
		}
		if(parent instanceof PsiIfStatement && anchor == ((PsiIfStatement) parent).getCondition())
		{
			PsiStatement thenBranch = ControlFlowUtils.stripBraces(((PsiIfStatement) parent).getThenBranch());
			if(thenBranch instanceof PsiThrowStatement)
			{
				return !evaluatesToTrue;
			}
		}
		return isAssertCallArgument(anchor, ContractValue.booleanValue(evaluatesToTrue));
	}

	private static boolean isAssertCallArgument(@Nonnull PsiElement anchor, @Nonnull ContractValue wantedConstraint)
	{
		PsiElement parent = PsiUtil.skipParenthesizedExprUp(anchor.getParent());
		if(parent instanceof PsiExpressionList)
		{
			int index = ArrayUtil.indexOf(((PsiExpressionList) parent).getExpressions(), anchor);
			if(index >= 0)
			{
				PsiMethodCallExpression call = tryCast(parent.getParent(), PsiMethodCallExpression.class);
				if(call != null)
				{
					MethodContract contract = ContainerUtil.getOnlyItem(JavaMethodContractUtil.getMethodCallContracts(call));
					if(contract != null && contract.getReturnValue().isFail())
					{
						ContractValue condition = ContainerUtil.getOnlyItem(contract.getConditions());
						if(condition != null)
						{
							return condition.getArgumentComparedTo(wantedConstraint, false).orElse(-1) == index;
						}
					}
				}
			}
		}
		return false;
	}

	private static boolean isAtRHSOfBooleanAnd(PsiElement expr)
	{
		PsiElement cur = expr;

		while(cur != null && !(cur instanceof PsiMember))
		{
			PsiElement parent = cur.getParent();

			if(parent instanceof PsiBinaryExpression && cur == ((PsiBinaryExpression) parent).getROperand())
			{
				return true;
			}

			cur = parent;
		}

		return false;
	}

	private static boolean isFlagCheck(PsiElement element)
	{
		PsiElement scope = PsiTreeUtil.getParentOfType(element, PsiStatement.class, PsiVariable.class);
		PsiExpression topExpression = scope instanceof PsiIfStatement ? ((PsiIfStatement) scope).getCondition() :
				scope instanceof PsiVariable ? ((PsiVariable) scope).getInitializer() :
						null;
		if(!PsiTreeUtil.isAncestor(topExpression, element, false))
		{
			return false;
		}

		return StreamEx.<PsiElement>ofTree(topExpression, e -> StreamEx.of(e.getChildren()))
				.anyMatch(DataFlowInspectionBase::isCompileTimeFlagCheck);
	}

	private static boolean isCompileTimeFlagCheck(PsiElement element)
	{
		if(element instanceof PsiBinaryExpression)
		{
			PsiBinaryExpression binOp = (PsiBinaryExpression) element;
			if(ComparisonUtils.isComparisonOperation(binOp.getOperationTokenType()))
			{
				PsiExpression comparedWith = null;
				if(ExpressionUtils.isLiteral(binOp.getROperand()))
				{
					comparedWith = binOp.getLOperand();
				}
				else if(ExpressionUtils.isLiteral(binOp.getLOperand()))
				{
					comparedWith = binOp.getROperand();
				}
				comparedWith = PsiUtil.skipParenthesizedExprDown(comparedWith);
				if(isConstantOfType(comparedWith, PsiType.INT, PsiType.LONG))
				{
					// like "if(DEBUG_LEVEL > 2)"
					return true;
				}
				if(comparedWith instanceof PsiBinaryExpression)
				{
					PsiBinaryExpression subOp = (PsiBinaryExpression) comparedWith;
					if(subOp.getOperationTokenType().equals(JavaTokenType.AND))
					{
						PsiExpression left = PsiUtil.skipParenthesizedExprDown(subOp.getLOperand());
						PsiExpression right = PsiUtil.skipParenthesizedExprDown(subOp.getROperand());
						if(isConstantOfType(left, PsiType.INT, PsiType.LONG) ||
								isConstantOfType(right, PsiType.INT, PsiType.LONG))
						{
							// like "if((FLAGS & SOME_FLAG) != 0)"
							return true;
						}
					}
				}
			}
		}
		// like "if(DEBUG)"
		return isConstantOfType(element, PsiType.BOOLEAN);
	}

	private static boolean isConstantOfType(PsiElement element, PsiPrimitiveType... types)
	{
		PsiElement resolved = element instanceof PsiReferenceExpression ? ((PsiReferenceExpression) element).resolve() : null;
		if(!(resolved instanceof PsiField))
		{
			return false;
		}
		PsiVariable field = (PsiVariable) resolved;
		return field.hasModifierProperty(PsiModifier.STATIC) && PsiUtil.isCompileTimeConstant(field) &&
				ArrayUtil.contains(field.getType(), types);
	}

	private static boolean isNullLiteralExpression(PsiElement expr)
	{
		return expr instanceof PsiExpression && ExpressionUtils.isNullLiteral((PsiExpression) expr);
	}

	private
	@javax.annotation.Nullable
	LocalQuickFix createSimplifyBooleanExpressionFix(PsiElement element, final boolean value)
	{
		LocalQuickFixOnPsiElement fix = createSimplifyBooleanFix(element, value);
		if(fix == null)
		{
			return null;
		}
		final String text = fix.getText();
		return new LocalQuickFix()
		{
			@Override
			public
			@Nonnull
			String getName()
			{
				return text;
			}

			@Override
			public void applyFix(@Nonnull Project project, @Nonnull ProblemDescriptor descriptor)
			{
				final PsiElement psiElement = descriptor.getPsiElement();
				if(psiElement == null)
				{
					return;
				}
				final LocalQuickFixOnPsiElement fix = createSimplifyBooleanFix(psiElement, value);
				if(fix == null)
				{
					return;
				}
				try
				{
					LOG.assertTrue(psiElement.isValid());
					fix.applyFix();
				}
				catch(IncorrectOperationException e)
				{
					LOG.error(e);
				}
			}

			@Override
			public
			@Nonnull
			String getFamilyName()
			{
				return JavaAnalysisBundle.message("inspection.data.flow.simplify.boolean.expression.quickfix");
			}
		};
	}

	protected static
	@Nonnull
	LocalQuickFix createSimplifyToAssignmentFix()
	{
		return new SimplifyToAssignmentFix();
	}

	protected LocalQuickFixOnPsiElement createSimplifyBooleanFix(PsiElement element, boolean value)
	{
		return null;
	}

	@Override
	public
	@Nonnull
	String getGroupDisplayName()
	{
		return InspectionsBundle.message("group.names.probable.bugs");
	}

	@Override
	public
	@Nonnull
	String getShortName()
	{
		return SHORT_NAME;
	}

	protected enum ConstantResult
	{
		TRUE,
		FALSE,
		NULL,
		ZERO,
		UNKNOWN;

		@Override
		public
		@Nonnull
		String toString()
		{
			return this == ZERO ? "0" : StringUtil.toLowerCase(name());
		}

		public Object value()
		{
			switch(this)
			{
				case TRUE:
					return Boolean.TRUE;
				case FALSE:
					return Boolean.FALSE;
				case ZERO:
					return 0;
				case NULL:
					return null;
				default:
					throw new UnsupportedOperationException();
			}
		}

		static
		@Nonnull
		ConstantResult fromDfType(@Nonnull DfType dfType)
		{
			if(dfType == DfTypes.NULL)
			{
				return NULL;
			}
			if(dfType == DfTypes.TRUE)
			{
				return TRUE;
			}
			if(dfType == DfTypes.FALSE)
			{
				return FALSE;
			}
			if(DfConstantType.isConst(dfType, 0) || DfConstantType.isConst(dfType, 0L))
			{
				return ZERO;
			}
			return UNKNOWN;
		}

		static
		@Nonnull
		ConstantResult mergeValue(@javax.annotation.Nullable ConstantResult state, @Nonnull DfaMemoryState memState, @javax.annotation.Nullable DfaValue value)
		{
			if(state == UNKNOWN || value == null)
			{
				return UNKNOWN;
			}
			ConstantResult nextState = fromDfType(memState.getUnboxedDfType(value));
			return state == null || state == nextState ? nextState : UNKNOWN;
		}
	}

	/**
	 * {@link ProblemsHolder} wrapper to avoid reporting two problems on the same anchor
	 */
	protected static class ProblemReporter
	{
		private final Set<PsiElement> myReportedAnchors = new HashSet<>();
		private final ProblemsHolder myHolder;
		private final PsiElement myScope;

		ProblemReporter(ProblemsHolder holder, PsiElement scope)
		{
			myHolder = holder;
			myScope = scope;
		}

		public void registerProblem(PsiElement element, String message, LocalQuickFix... fixes)
		{
			if(register(element))
			{
				myHolder.registerProblem(element, message, fixes);
			}
		}

		void registerProblem(PsiElement element, String message, ProblemHighlightType type, LocalQuickFix... fixes)
		{
			if(register(element))
			{
				myHolder.registerProblem(element, message, type, fixes);
			}
		}

		void registerProblem(PsiElement element, TextRange range, String message, LocalQuickFix... fixes)
		{
			if(range == null)
			{
				registerProblem(element, message, fixes);
			}
			else
			{
				myHolder.registerProblem(element, range, message, fixes);
			}
		}

		private boolean register(PsiElement element)
		{
			// Suppress reporting for inlined simple methods
			if(!PsiTreeUtil.isAncestor(myScope, element, false))
			{
				return false;
			}
			if(myScope instanceof PsiClass)
			{
				PsiMember member = PsiTreeUtil.getParentOfType(element, PsiMember.class);
				if(member instanceof PsiMethod && !((PsiMethod) member).isConstructor())
				{
					return false;
				}
			}
			if(!myReportedAnchors.add(element))
			{
				return false;
			}
			if(element instanceof PsiParenthesizedExpression)
			{
				PsiExpression deparenthesized = PsiUtil.skipParenthesizedExprDown((PsiExpression) element);
				if(deparenthesized != null)
				{
					myReportedAnchors.add(deparenthesized);
				}
			}
			return true;
		}

		boolean isOnTheFly()
		{
			return myHolder.isOnTheFly();
		}
	}
}


text:
Quick and dirty (possibly batch) processing of .markdown.erb files.

## Installation

Add this line to your application's Gemfile:

    gem 'batch_it'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install batch_it

## Usage

```ruby
require 'batch_it'
require 'ostruct'

puts BatchIt.new(DATA.read).result([OpenStruct.new(title: "One"), OpenStruct.new(title: "Two")])
__END__
<%= title %>
=
```

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request


text:
var render = require('fsj-render')
var debounce = require('debounce')
var util = require('util')

var add_satu_mare_images = require('./satu-mare')
var add_graph_matrix = require('./graph-matrix')
var text = require('./html-bundle.json')

window.onload = function() {
  var ee = render(main, nav, text)

  go(ee)

  setCurrentNode(document.getElementById(ee.current))

  ee.on('data', function(data) {
    setCurrentNode(document.getElementById(ee.current))
  })

  window.addEventListener('hashchange', function() {
    go(ee)
  })

  ;[].forEach.call(navSection.querySelectorAll('a'), function(el) {
    var data = key_to_title(el.firstChild.innerHTML || el.innerHTML)

    el.innerHTML = util.format(
        '%s %s</title>'
      , data.date
      , data.title
    )

  })
}

function go(ee) {
  if(window.location.hash === '#!/navigation') {
      nav.style.display = 'block'
      main.innerHTML = ''
  } else {
      nav.style.display = 'none'
  }

  if(!window.location.hash.length) {
    ee.write('/README.md')
  }
  add_satu_mare_images()
  add_graph_matrix()
}

function setCurrentNode(data) {
  if(!data) {
    return
  }

  [].forEach.call(navSection.querySelectorAll('a'), function(el) {
    if(el.parentElement) el.parentElement.classList.remove('current')
  })

  if(data.parentElement) data.parentElement.classList.add('current')
}

function key_to_title(key) {
  var PARSE = /(\d{4}-\d{2}-\d{1,2})-(.*?)\.md$/
  var res = PARSE.exec(key)

  if(!res || !res[1] || !res[2]) {
    return {date: '', title: key}
  }

  return {date: res[1], title: res[2].replace(/-/g, ' ')}
}


text:
package org.search.nibrs.stagingdata.repository.segment;

import java.util.List;

import javax.transaction.Transactional;

import org.search.nibrs.stagingdata.model.search.IncidentPointer;
import org.search.nibrs.stagingdata.model.search.IncidentSearchRequest;

@Transactional
public interface AdministrativeSegmentRepositoryCustom{
	List<IncidentPointer> findAllByCriteria(IncidentSearchRequest incidentSearchRequest);
	long countAllByCriteria(IncidentSearchRequest incidentSearchRequest);
	int updateSubmissionId(Integer adminstrativeSegmentId, Integer submissionId);
	Integer deleteByIds(List<Integer> administrativeSegmentIds);
}


text:
@class NSMutableDictionary, NSString;

@interface BRLocalizedStringManager : BRSingleton
{
    NSString *_currentLanguage;
    NSMutableDictionary *_stringFileCache;
}

+ (id)_backRowFramework;
+ (id)accessibilityLocalizedStringForKey:(id)arg1;
+ (id)appliance:(id)arg1 localizedStringForKey:(id)arg2 inFile:(id)arg3;
+ (id)applicationLocalizedStringForKey:(id)arg1 inFile:(id)arg2;
+ (id)backRowLocalizedStringForKey:(id)arg1 inFile:(id)arg2;
+ (id)localizedLanguageForCode:(id)arg1;
+ (id)localizedStringForKey:(id)arg1 inFile:(id)arg2 fromBundle:(id)arg3;
+ (id)pathForResource:(id)arg1 ofType:(id)arg2 forBundle:(id)arg3;
+ (void)setSingleton:(id)arg1;
+ (id)singleton;
- (id)_currentLanguageNameForBundle:(id)arg1;
- (id)_hashKeyForStringKey:(id)arg1 inFile:(id)arg2 fromBundlePath:(id)arg3;
- (void)_languageChanged:(id)arg1;
- (void)dealloc;
- (id)init;

@end


text:
class _ServiceInfo:

    @property
    def name(self):
        return self._name

    @property
    def env(self):
        return self._env

    @property
    def url(self):
        return self._url

    @url.setter
    def url(self, url):
        self._url = url

    def __init__(self, name, env, url):
        self._name = name
        self._env = env
        self._url = url

_SERVICE_INFO_LIST_V13 = [
    # ad insight service
    _ServiceInfo(
        "adinsight",
        "production",
        "https://adinsight.api.bingads.microsoft.com/Api/Advertiser/AdInsight/V13/AdInsightService.svc?singleWsdl"
    ),
    _ServiceInfo(
        "adinsight",
        "sandbox",
        "https://adinsight.api.sandbox.bingads.microsoft.com/Api/Advertiser/AdInsight/V13/AdInsightService.svc?singleWsdl"
    ),

    # bulk service
    _ServiceInfo(
        "bulk",
        "production",
        "https://bulk.api.bingads.microsoft.com/Api/Advertiser/CampaignManagement/v13/BulkService.svc?singleWsdl"
    ),
    _ServiceInfo(
        "bulk",
        "sandbox",
        "https://bulk.api.sandbox.bingads.microsoft.com/Api/Advertiser/CampaignManagement/v13/BulkService.svc?singleWsdl"
    ),

    # campaign management
    _ServiceInfo(
        "campaignmanagement",
        "production",
        "https://campaign.api.bingads.microsoft.com/Api/Advertiser/CampaignManagement/v13/CampaignManagementService.svc?singleWsdl"
    ),
    _ServiceInfo(
        "campaignmanagement",
        "sandbox",
        "https://campaign.api.sandbox.bingads.microsoft.com/Api/Advertiser/CampaignManagement/v13/CampaignManagementService.svc?singleWsdl"
    ),

    # customer billing
    _ServiceInfo(
        "customerbilling",
        "production",
        "https://clientcenter.api.bingads.microsoft.com/Api/Billing/v13/CustomerBillingService.svc?singleWsdl"
    ),
    _ServiceInfo(
        "customerbilling",
        "sandbox",
        "https://clientcenter.api.sandbox.bingads.microsoft.com/Api/Billing/v13/CustomerBillingService.svc?singleWsdl"
    ),

    # customer management
    _ServiceInfo(
        "customermanagement",
        "production",
        "https://clientcenter.api.bingads.microsoft.com/Api/CustomerManagement/v13/CustomerManagementService.svc?singleWsdl"
    ),
    _ServiceInfo(
        "customermanagement",
        "sandbox",
        "https://clientcenter.api.sandbox.bingads.microsoft.com/Api/CustomerManagement/v13/CustomerManagementService.svc?singleWsdl"
    ),

    # reporting
    _ServiceInfo(
        "reporting",
        "production",
        "https://reporting.api.bingads.microsoft.com/Api/Advertiser/Reporting/v13/ReportingService.svc?singleWsdl"
    ),
    _ServiceInfo(
        "reporting",
        "sandbox",
        "https://reporting.api.sandbox.bingads.microsoft.com/Api/Advertiser/Reporting/v13/ReportingService.svc?singleWsdl"
    ),
]

SERVICE_INFO_DICT_V13 = {}

for service_info in _SERVICE_INFO_LIST_V13:
    SERVICE_INFO_DICT_V13[(service_info.name, service_info.env)] = service_info

SERVICE_INFO_DICT = {13: SERVICE_INFO_DICT_V13}