/* --- Overridden methods ---
343892
@Override
    protected File cloneRepository(File dest) {
        BaseRepository repo = Repository.clone(RepositoryConfiguration.DEFAULT, dest, getUrl());

        // set branch name
        String branchName = MASTER;;
        String branch = getBranch();
        if (StringUtils.isNotBlank(branch)) {
            branchName = branch;
        }
        String tag = getTag();
        if (StringUtils.isNotBlank(tag)) {
            branchName = tag;
        }
        BranchCommand.on(repo).set(branchName);
        return dest;
    }
1206216
@Override
    protected void checkParameters() {
        super.checkParameters();

        if (outputFile == null) {
            throw new BuildException("output attribute is required", getLocation());
        }

        if (inputFile == null) {
            throw new BuildException("inputFile element is required");
        }

        checkBoolean(notAProblem, "notAProblem");
        checkBoolean(withSource, "withSource");
        checkBoolean(applySuppression, "applySuppression");
        checkBoolean(active, "active");
        checkBoolean(introducedByChange, "introducedByChange");
        checkBoolean(removedByChange, "removedByChange");
        checkBoolean(newCode, "newCode");
        checkBoolean(removedCode, "removedCode");
        checkBoolean(withMessages, "withMessages");
    }
1309450
@Override
	protected String getURIFragmentRootSegment(EObject eObject) {
		if (unloadingContents == null) {
			IParseResult parseResult = getParseResult();
			if (parseResult != null && eObject == parseResult.getRootASTElement()) {
				return "0"; 
			}
		}
		return super.getURIFragmentRootSegment(eObject);
	}
510160
@Override
	public void generateLiveData(TypeSpec.Builder classBuilder, SQLiteModelMethod method) {
		SQLiteDaoDefinition daoDefinition = method.getParent();
		Set<JQLProjection> fieldList = JQLChecker.getInstance().extractProjections(method, method.jql.value, method.getEntity());

		// generate method code
		MethodSpec.Builder methodBuilder = MethodSpec.methodBuilder(method.getName().replaceAll(LIVE_DATA_PREFIX, "")).addAnnotation(Override.class).addModifiers(Modifier.PUBLIC);

		methodBuilder.addJavadoc("<h2>Live data</h2>\n");
		methodBuilder.addJavadoc("<p>This method open a connection internally.</p>\n\n");

		generateCommonPart(method, classBuilder, methodBuilder, fieldList, GenerationType.NO_CONTENT, method.liveDataReturnClass, true, false);

		boolean pagedLiveData = method.isPagedLiveData();

		if (pagedLiveData) {
			SelectType.PAGED_RESULT.generate(classBuilder, method);

			String pageResultName = SelectPaginatedResultHelper.getCurrentPagedResultClass();
			SelectPaginatedResultHelper.createPagedResult(method, pageResultName, methodBuilder);
		}

		ClassName dataSourceClazz = BindDataSourceBuilder.generateDataSourceName(daoDefinition.getParent());
		ClassName daoFactoryClazz = TypeUtility.className(BindDaoFactoryBuilder.generateDaoFactoryName(daoDefinition.getParent()));
		ClassName batchClazz = TypeUtility.mergeTypeNameWithSuffix(dataSourceClazz, ".Batch");

		List<Pair<String, TypeName>> methodParameters = method.getParameters();
		StringBuilder buffer = new StringBuilder();
		String separator = "";

		for (Pair<String, TypeName> item : methodParameters) {
			buffer.append(separator + item.value0);
			separator = ", ";
		}

		ClassName handlerClass = KriptonLiveDataManager.getInstance().getLiveDataHandlerClazz();
		if (pagedLiveData) {
			handlerClass = KriptonLiveDataManager.getInstance().getPagedLiveDataHandlerClazz();

			TypeSpec batchBuilder = TypeSpec.anonymousClassBuilder("").addSuperinterface(ParameterizedTypeName.get(batchClazz, method.getReturnClass()))
					.addMethod(
							MethodSpec.methodBuilder("onExecute").addAnnotation(Override.class).addModifiers(Modifier.PUBLIC).addParameter(ParameterSpec.builder(daoFactoryClazz, "daoFactory").build())
									.returns(method.getReturnClass()).addStatement("return paginatedResult.execute(daoFactory)").build())
					.build();

			// return
			TypeSpec.Builder liveDataBuilderBuilder = TypeSpec.anonymousClassBuilder("paginatedResult")
					.addSuperinterface(ParameterizedTypeName.get(handlerClass, method.getReturnClass())).addMethod(MethodSpec.methodBuilder("compute").addAnnotation(Override.class)
							.addModifiers(Modifier.PROTECTED).returns(method.getReturnClass()).addStatement("return $T.getInstance().executeBatch($L)", dataSourceClazz, batchBuilder).build());
			TypeSpec liveDataBuilder = liveDataBuilderBuilder.build();

			methodBuilder.addStatement("final $T builder=$L", ParameterizedTypeName.get(handlerClass, method.getReturnClass()), liveDataBuilder);
		} else {
			TypeSpec batchBuilder = TypeSpec.anonymousClassBuilder("").addSuperinterface(ParameterizedTypeName.get(batchClazz, method.getReturnClass()))
					.addMethod(MethodSpec.methodBuilder("onExecute").addAnnotation(Override.class).addModifiers(Modifier.PUBLIC)
							.addParameter(ParameterSpec.builder(daoFactoryClazz, "daoFactory").build()).returns(method.getReturnClass())
							.addStatement("return daoFactory.get$L().$L($L)", daoDefinition.getName(), method.getName() + LIVE_DATA_PREFIX, buffer.toString()).build())
					.build();

			TypeSpec.Builder liveDataBuilderBuilder = TypeSpec.anonymousClassBuilder("").addSuperinterface(ParameterizedTypeName.get(handlerClass, method.getReturnClass()))
					.addMethod(MethodSpec.methodBuilder("compute").addAnnotation(Override.class).addModifiers(Modifier.PROTECTED).returns(method.getReturnClass())
							.addStatement("return $T.getInstance().executeBatch($L)", dataSourceClazz, batchBuilder).build());
			TypeSpec liveDataBuilder = liveDataBuilderBuilder.build();

			methodBuilder.addStatement("final $T builder=$L", ParameterizedTypeName.get(handlerClass, method.getReturnClass()), liveDataBuilder);
		}

		methodBuilder.addStatement("registryLiveData(builder)");
		methodBuilder.addStatement("return builder.getLiveData()");

		classBuilder.addMethod(methodBuilder.build());
	}
314312
@Override
    public void run() {
        try {
            for (Map<String, Object> row : dataDecoder) {
                dataEncoder.write(applyFilters(row));
            }

            dataDecoder.close();
            dataEncoder.close();
        } catch (IOException ioe) {
            logger.error("Unable to complete conversion.", ioe);
        }

    }
498688
function() {
    this._super();

    if (!this._options.implicit) {
      this.overrideProperty('<plural>', 'collection');
      this.overrideProperty('<singular>Objects', 'objectsQuery');
      this.addHelper('create<Singular>', 'createObject');
      this.addHelper('add<Singular>', 'addObjects');
      this.addHelper('add<Plural>', 'addObjects');
      this.addHelper('remove<Singular>', 'removeObjects');
      this.addHelper('remove<Plural>', 'removeObjects');
      this.addHelper('clear<Plural>', 'clearObjects');
      this.overrideMethod('init', 'initialize');
      this.overrideMethod('_dependents', 'dependents');
      this.overrideMethod('_reliants', 'reliants');
      this.overrideMethod('_postsave', 'postsave');
    }
  }
353797
@Override
    public Object[] getAttributeValues(String key) {
        if (userAttributes == null) {
            return null;
        }

        final List<Object> values = userAttributes.get(key);
        if (values != null) {
            return values.toArray();
        }

        return null;
    }
458069
@Override
    void findReferencedClassNames(final Set<String> classNameListOut) {
        for (final TypeParameter typeParameter : typeParameters) {
            if (typeParameter != null) {
                typeParameter.findReferencedClassNames(classNameListOut);
            }
        }
        for (final TypeSignature typeSignature : parameterTypeSignatures) {
            if (typeSignature != null) {
                typeSignature.findReferencedClassNames(classNameListOut);
            }
        }
        resultType.findReferencedClassNames(classNameListOut);
        for (final ClassRefOrTypeVariableSignature typeSignature : throwsSignatures) {
            if (typeSignature != null) {
                typeSignature.findReferencedClassNames(classNameListOut);
            }
        }
    }
1266307
@Override
    public void visitCode(Code obj) {
        try {
            userValues = new HashMap<>();
            super.visitCode(obj);
        } finally {
            userValues = null;
        }
    }
274438
private void processPropDefaultValues() {
    getMethodsWithAnnotation(component, PropDefault.class).forEach(method -> {
      PropDefault propValidator = method.getAnnotation(PropDefault.class);

      String exposedMethodName = exposeExistingJavaMethodToJs(method);
      String propertyName = propValidator.value();
      optionsBuilder.addStatement("options.addJavaPropDefaultValue(p.$L, $S)",
          exposedMethodName,
          propertyName);
    });
  }
185326
@Override
    protected void parse() {
        maximumInstances = getInt(PARAM_MAXIMUM_INSTANCES, DEFAULT_MAXIMUM_INSTANCES);
        mergeRelatedIssues = getBoolean(PARAM_MERGE_RELATED_ISSUES, true);
        overridesFilename = getString(PARAM_OVERRIDES_FILENAME, "");
    }
306856
@Override
    void findReferencedClassNames(final Set<String> classNameListOut) {
        if (typeSignature != null) {
            typeSignature.findReferencedClassNames(classNameListOut);
        }
    }
5942
@Override
	public String onColumnName(String columnName) {
		if (onlyBindParameter)
			return null;

		if (currentSchema != null) {
			Set<SQLProperty> props = currentSchema.getPropertyBySimpleName(columnName);
			AssertKripton.assertTrueOrUnknownPropertyInJQLException(props != null && props.size() > 0, currentMethod, columnName);
			return props.iterator().next().columnName;
		} else {
			return null;
		}
	}
257868
public function process()
    {
        parent::process();

        if ($this->value === null) {
            $this->path = array();
        } else {
            $this->path = $this->value;
            $this->value = end($this->path);
        }
    }
1000149
@Override
  public Method getMethod(String methodName, int parameterCount) {
    for (Method method : methods) {
      if (method.getName().equals(methodName) && method.getParameters().size() == parameterCount) {
        return method;
      }
    }
    if (extending != null) {
      return extending.getMethod(methodName, parameterCount);
    }
    return null;
  }
32787
void readOTreeSet(int iSize, ObjectInputStream s, V defaultVal) throws java.io.IOException, ClassNotFoundException {
    buildFromSorted(iSize, null, s, defaultVal);
  }
767330
@Override
   public void onCreate(SQLiteDatabase db) {
      int pointer = context.getResources().getIdentifier(INIT_CREATE_SQL, "string", context.getPackageName());
      if (pointer == 0) {
         Log.e(TAG, "undefined sql id - " + INIT_CREATE_SQL);
      } else {
         String createTabelSql = context.getResources().getString(pointer);
         for (String sql : createTabelSql.split(";")) {
            db.execSQL(sql);
         }
      }
   }