blob_id stringlengths 40 40 | directory_id stringlengths 40 40 | path stringlengths 7 410 | content_id stringlengths 40 40 | detected_licenses listlengths 0 51 | license_type stringclasses 2 values | repo_name stringlengths 5 132 | snapshot_id stringlengths 40 40 | revision_id stringlengths 40 40 | branch_name stringlengths 4 80 | visit_date timestamp[us] | revision_date timestamp[us] | committer_date timestamp[us] | github_id int64 5.85k 684M ⌀ | star_events_count int64 0 209k | fork_events_count int64 0 110k | gha_license_id stringclasses 22 values | gha_event_created_at timestamp[us] | gha_created_at timestamp[us] | gha_language stringclasses 132 values | src_encoding stringclasses 34 values | language stringclasses 1 value | is_vendor bool 1 class | is_generated bool 2 classes | length_bytes int64 3 9.45M | extension stringclasses 28 values | content stringlengths 3 9.45M | authors listlengths 1 1 | author_id stringlengths 0 352 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c48b114f22df49d8c669408ecc48dd4a621042a2 | 652b4ad49067cd27813cc6834e8e0927a15f0c57 | /src/main/java/util/EmployeeRepoImpl.java | 2a98e147553cc58af3092b8323a53c0d7cd19641 | [] | no_license | shailendrakumaryadav1/bday-email-service | 059b9c35143222b204713c9cbdd1dce5e5cff5e4 | 4a92fb230b36898fa1fb6850d1be8fd6af7d81a8 | refs/heads/master | 2021-09-04T15:13:10.306353 | 2018-01-19T17:55:42 | 2018-01-19T17:55:42 | 114,218,736 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 944 | java | package util;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.time.LocalDate;
import java.util.List;
import models.Employee;
/**
* Created by SKY on 12/14/2017.
*/
public class EmployeeRepoImpl implements EmployeeRepo {
private final File employeesFile;
private final EmployeeReader employeeReader;
public EmployeeRepoImpl(File employeesFile, EmployeeReader employeeReader) {
this.employeesFile = employeesFile;
this.employeeReader = employeeReader;
}
@Override
public List<Employee> findEmployeesWhoAreBornOn(LocalDate date) {
List<Employee> employees = null;
try {
InputStream employeesInputStream = new FileInputStream(employeesFile);
employees = employeeReader.getEmployeesByDOB(employeesInputStream, date);
} catch (IOException e) {
System.out.println("Failed to read all employees records from file");
}
return employees;
}
}
| [
"shailendra@healint.com"
] | shailendra@healint.com |
13d2a53adc04095e15800fc6fcb2135a35b5af07 | 31fc4ecab54687c9986665a0aa2ea6fc82ce7631 | /src/day35_Static/staticPractice2.java | bc10946e50f3c648fe64ed86941734476ccfa889 | [] | no_license | ogulle/Java_CyberTek | 9f14bd46de2c1595dde5998285a5c1e2f63a4312 | 79af18f79e89ce61236df96cbbea7085783a06c0 | refs/heads/master | 2022-11-16T05:17:31.368623 | 2020-07-06T15:25:20 | 2020-07-06T15:25:20 | 258,610,336 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 369 | java | package day35_Static;
public class staticPractice2 {
String brand;
String Model;
static boolean hasWheels = true;
public void printBrand(){
System.out.println(brand);
}
public void printModel(){
System.out.println(Model);
}
public static void main(String[] args) {
System.out.println(hasWheels);
}
}
| [
"oigulle@gmail.com"
] | oigulle@gmail.com |
1ea41c2f81ff61bef4a50943539b978214cf8bff | 3fa568022ccea01506bf79f22970c8b192e1262d | /pmarlen-logic/src/main/java/com/pmarlen/model/controller/FacturaClienteJpaController.java | a9c776c4883d0679b81bcd52ba5d0a6d7533c5ef | [] | no_license | RainerJava/PerfumeriaMarlenERP | d9fc659930e419daa245624655cf91435b2b9968 | bc5dacfa76427bc21bfecbabfeafc52d56309b49 | refs/heads/master | 2020-07-02T09:05:13.063526 | 2012-07-17T03:41:40 | 2012-07-17T03:41:40 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 13,177 | java | package com.pmarlen.model.controller;
import org.springframework.stereotype.Repository;
import org.springframework.beans.factory.annotation.Autowired;
import com.pmarlen.model.beans.FacturaCliente;
import com.pmarlen.model.controller.exceptions.IllegalOrphanException;
import com.pmarlen.model.controller.exceptions.NonexistentEntityException;
import com.pmarlen.model.controller.exceptions.PreexistingEntityException;
import java.util.List;
import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
import javax.persistence.Query;
import javax.persistence.EntityNotFoundException;
import com.pmarlen.model.beans.PedidoVenta;
import com.pmarlen.model.beans.EstadoDeCuentaClientes;
import java.util.ArrayList;
import java.util.Collection;
/**
* FacturaClienteJpaController
*/
@Repository("facturaClienteJpaController")
public class FacturaClienteJpaController {
private EntityManagerFactory emf = null;
@Autowired
public void setEntityManagerFactory(EntityManagerFactory emf) {
this.emf = emf;
}
public EntityManager getEntityManager() {
return emf.createEntityManager();
}
public void create(FacturaCliente facturaCliente) throws PreexistingEntityException, Exception {
if (facturaCliente.getEstadoDeCuentaClientesCollection() == null) {
facturaCliente.setEstadoDeCuentaClientesCollection(new ArrayList<EstadoDeCuentaClientes>());
}
EntityManager em = null;
try {
em = getEntityManager();
em.getTransaction().begin();
PedidoVenta pedidoVenta = facturaCliente.getPedidoVenta();
if (pedidoVenta != null) {
pedidoVenta = em.getReference(pedidoVenta.getClass(), pedidoVenta.getId());
facturaCliente.setPedidoVenta(pedidoVenta);
}
Collection<EstadoDeCuentaClientes> attachedEstadoDeCuentaClientesCollection = new ArrayList<EstadoDeCuentaClientes>();
for (EstadoDeCuentaClientes estadoDeCuentaClientesCollectionEstadoDeCuentaClientesToAttach : facturaCliente.getEstadoDeCuentaClientesCollection()) {
estadoDeCuentaClientesCollectionEstadoDeCuentaClientesToAttach = em.getReference(estadoDeCuentaClientesCollectionEstadoDeCuentaClientesToAttach.getClass(), estadoDeCuentaClientesCollectionEstadoDeCuentaClientesToAttach.getId());
attachedEstadoDeCuentaClientesCollection.add(estadoDeCuentaClientesCollectionEstadoDeCuentaClientesToAttach);
}
facturaCliente.setEstadoDeCuentaClientesCollection(attachedEstadoDeCuentaClientesCollection);
em.persist(facturaCliente);
if (pedidoVenta != null) {
pedidoVenta.getFacturaClienteCollection().add(facturaCliente);
pedidoVenta = em.merge(pedidoVenta);
}
for (EstadoDeCuentaClientes estadoDeCuentaClientesCollectionEstadoDeCuentaClientes : facturaCliente.getEstadoDeCuentaClientesCollection()) {
FacturaCliente oldFacturaClienteOfEstadoDeCuentaClientesCollectionEstadoDeCuentaClientes = estadoDeCuentaClientesCollectionEstadoDeCuentaClientes.getFacturaCliente();
estadoDeCuentaClientesCollectionEstadoDeCuentaClientes.setFacturaCliente(facturaCliente);
estadoDeCuentaClientesCollectionEstadoDeCuentaClientes = em.merge(estadoDeCuentaClientesCollectionEstadoDeCuentaClientes);
if (oldFacturaClienteOfEstadoDeCuentaClientesCollectionEstadoDeCuentaClientes != null) {
oldFacturaClienteOfEstadoDeCuentaClientesCollectionEstadoDeCuentaClientes.getEstadoDeCuentaClientesCollection().remove(estadoDeCuentaClientesCollectionEstadoDeCuentaClientes);
oldFacturaClienteOfEstadoDeCuentaClientesCollectionEstadoDeCuentaClientes = em.merge(oldFacturaClienteOfEstadoDeCuentaClientesCollectionEstadoDeCuentaClientes);
}
}
em.getTransaction().commit();
} catch (Exception ex) {
if (findFacturaCliente(facturaCliente.getId()) != null) {
throw new PreexistingEntityException("FacturaCliente " + facturaCliente + " already exists.", ex);
}
throw ex;
} finally {
if (em != null) {
em.close();
}
}
}
public void edit(FacturaCliente facturaCliente) throws IllegalOrphanException, NonexistentEntityException, Exception {
EntityManager em = null;
try {
em = getEntityManager();
em.getTransaction().begin();
FacturaCliente persistentFacturaCliente = em.find(FacturaCliente.class, facturaCliente.getId());
PedidoVenta pedidoVentaOld = persistentFacturaCliente.getPedidoVenta();
PedidoVenta pedidoVentaNew = facturaCliente.getPedidoVenta();
Collection<EstadoDeCuentaClientes> estadoDeCuentaClientesCollectionOld = persistentFacturaCliente.getEstadoDeCuentaClientesCollection();
Collection<EstadoDeCuentaClientes> estadoDeCuentaClientesCollectionNew = facturaCliente.getEstadoDeCuentaClientesCollection();
List<String> illegalOrphanMessages = null;
for (EstadoDeCuentaClientes estadoDeCuentaClientesCollectionOldEstadoDeCuentaClientes : estadoDeCuentaClientesCollectionOld) {
if (!estadoDeCuentaClientesCollectionNew.contains(estadoDeCuentaClientesCollectionOldEstadoDeCuentaClientes)) {
if (illegalOrphanMessages == null) {
illegalOrphanMessages = new ArrayList<String>();
}
illegalOrphanMessages.add("You must retain EstadoDeCuentaClientes " + estadoDeCuentaClientesCollectionOldEstadoDeCuentaClientes + " since its facturaCliente field is not nullable.");
}
}
if (illegalOrphanMessages != null) {
throw new IllegalOrphanException(illegalOrphanMessages);
}
if (pedidoVentaNew != null) {
pedidoVentaNew = em.getReference(pedidoVentaNew.getClass(), pedidoVentaNew.getId());
facturaCliente.setPedidoVenta(pedidoVentaNew);
}
Collection<EstadoDeCuentaClientes> attachedEstadoDeCuentaClientesCollectionNew = new ArrayList<EstadoDeCuentaClientes>();
for (EstadoDeCuentaClientes estadoDeCuentaClientesCollectionNewEstadoDeCuentaClientesToAttach : estadoDeCuentaClientesCollectionNew) {
estadoDeCuentaClientesCollectionNewEstadoDeCuentaClientesToAttach = em.getReference(estadoDeCuentaClientesCollectionNewEstadoDeCuentaClientesToAttach.getClass(), estadoDeCuentaClientesCollectionNewEstadoDeCuentaClientesToAttach.getId());
attachedEstadoDeCuentaClientesCollectionNew.add(estadoDeCuentaClientesCollectionNewEstadoDeCuentaClientesToAttach);
}
estadoDeCuentaClientesCollectionNew = attachedEstadoDeCuentaClientesCollectionNew;
facturaCliente.setEstadoDeCuentaClientesCollection(estadoDeCuentaClientesCollectionNew);
facturaCliente = em.merge(facturaCliente);
if (pedidoVentaOld != null && !pedidoVentaOld.equals(pedidoVentaNew)) {
pedidoVentaOld.getFacturaClienteCollection().remove(facturaCliente);
pedidoVentaOld = em.merge(pedidoVentaOld);
}
if (pedidoVentaNew != null && !pedidoVentaNew.equals(pedidoVentaOld)) {
pedidoVentaNew.getFacturaClienteCollection().add(facturaCliente);
pedidoVentaNew = em.merge(pedidoVentaNew);
}
for (EstadoDeCuentaClientes estadoDeCuentaClientesCollectionNewEstadoDeCuentaClientes : estadoDeCuentaClientesCollectionNew) {
if (!estadoDeCuentaClientesCollectionOld.contains(estadoDeCuentaClientesCollectionNewEstadoDeCuentaClientes)) {
FacturaCliente oldFacturaClienteOfEstadoDeCuentaClientesCollectionNewEstadoDeCuentaClientes = estadoDeCuentaClientesCollectionNewEstadoDeCuentaClientes.getFacturaCliente();
estadoDeCuentaClientesCollectionNewEstadoDeCuentaClientes.setFacturaCliente(facturaCliente);
estadoDeCuentaClientesCollectionNewEstadoDeCuentaClientes = em.merge(estadoDeCuentaClientesCollectionNewEstadoDeCuentaClientes);
if (oldFacturaClienteOfEstadoDeCuentaClientesCollectionNewEstadoDeCuentaClientes != null && !oldFacturaClienteOfEstadoDeCuentaClientesCollectionNewEstadoDeCuentaClientes.equals(facturaCliente)) {
oldFacturaClienteOfEstadoDeCuentaClientesCollectionNewEstadoDeCuentaClientes.getEstadoDeCuentaClientesCollection().remove(estadoDeCuentaClientesCollectionNewEstadoDeCuentaClientes);
oldFacturaClienteOfEstadoDeCuentaClientesCollectionNewEstadoDeCuentaClientes = em.merge(oldFacturaClienteOfEstadoDeCuentaClientesCollectionNewEstadoDeCuentaClientes);
}
}
}
em.getTransaction().commit();
} catch (Exception ex) {
String msg = ex.getLocalizedMessage();
if (msg == null || msg.length() == 0) {
Integer id = facturaCliente.getId();
if (findFacturaCliente(id) == null) {
throw new NonexistentEntityException("The facturaCliente with id " + id + " no longer exists.");
}
}
throw ex;
} finally {
if (em != null) {
em.close();
}
}
}
public void destroy(Integer id) throws IllegalOrphanException, NonexistentEntityException {
EntityManager em = null;
try {
em = getEntityManager();
em.getTransaction().begin();
FacturaCliente facturaCliente;
try {
facturaCliente = em.getReference(FacturaCliente.class, id);
facturaCliente.getId();
} catch (EntityNotFoundException enfe) {
throw new NonexistentEntityException("The facturaCliente with id " + id + " no longer exists.", enfe);
}
List<String> illegalOrphanMessages = null;
Collection<EstadoDeCuentaClientes> estadoDeCuentaClientesCollectionOrphanCheck = facturaCliente.getEstadoDeCuentaClientesCollection();
for (EstadoDeCuentaClientes estadoDeCuentaClientesCollectionOrphanCheckEstadoDeCuentaClientes : estadoDeCuentaClientesCollectionOrphanCheck) {
if (illegalOrphanMessages == null) {
illegalOrphanMessages = new ArrayList<String>();
}
illegalOrphanMessages.add("This FacturaCliente (" + facturaCliente + ") cannot be destroyed since the EstadoDeCuentaClientes " + estadoDeCuentaClientesCollectionOrphanCheckEstadoDeCuentaClientes + " in its estadoDeCuentaClientesCollection field has a non-nullable facturaCliente field.");
}
if (illegalOrphanMessages != null) {
throw new IllegalOrphanException(illegalOrphanMessages);
}
PedidoVenta pedidoVenta = facturaCliente.getPedidoVenta();
if (pedidoVenta != null) {
pedidoVenta.getFacturaClienteCollection().remove(facturaCliente);
pedidoVenta = em.merge(pedidoVenta);
}
em.remove(facturaCliente);
em.getTransaction().commit();
} finally {
if (em != null) {
em.close();
}
}
}
public List<FacturaCliente> findFacturaClienteEntities() {
return findFacturaClienteEntities(true, -1, -1);
}
public List<FacturaCliente> findFacturaClienteEntities(int maxResults, int firstResult) {
return findFacturaClienteEntities(false, maxResults, firstResult);
}
private List<FacturaCliente> findFacturaClienteEntities(boolean all, int maxResults, int firstResult) {
EntityManager em = getEntityManager();
try {
Query q = em.createQuery("select object(o) from FacturaCliente as o");
if (!all) {
q.setMaxResults(maxResults);
q.setFirstResult(firstResult);
}
return q.getResultList();
} finally {
em.close();
}
}
public FacturaCliente findFacturaCliente(Integer id) {
EntityManager em = getEntityManager();
try {
return em.find(FacturaCliente.class, id);
} finally {
em.close();
}
}
public int getFacturaClienteCount() {
EntityManager em = getEntityManager();
try {
Query q = em.createQuery("select count(o) from FacturaCliente as o");
return ((Long) q.getSingleResult()).intValue();
} finally {
em.close();
}
}
}
| [
"alfred@aldebaran"
] | alfred@aldebaran |
261b445872e09c73a536b264fc34625523fa9245 | 32327616977813f087b8f61b513fb628b0a9cd7b | /testsuite/src/main/java/com/blazebit/security/test/EjbAwareThrowableProcessingInterceptor.java | 09b79ddb3570147c998046542436b30fb7225d2a | [
"Apache-2.0",
"LicenseRef-scancode-unknown-license-reference"
] | permissive | Blazebit/blaze-security | 83c8002da274b8b5e00883da68261bc5a7a355ed | 07e3a58a9837923e6ee32e7f1644f17dc2013c8a | refs/heads/master | 2023-09-01T01:00:16.351718 | 2014-07-12T11:07:14 | 2014-07-12T11:07:14 | 10,057,642 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,163 | java | /**
*
*/
package com.blazebit.security.test;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import javax.ejb.EJBException;
import com.blazebit.exception.ExceptionUtils;
import com.googlecode.catchexception.throwable.internal.ThrowableProcessingInterceptor;
/**
* @author Christian Beikov <c.beikov@curecomp.com>
* @company curecomp
* @date 05.12.2013
*/
public class EjbAwareThrowableProcessingInterceptor<E extends Throwable> extends ThrowableProcessingInterceptor<E> {
@SuppressWarnings("unchecked")
private static final Class<? extends Throwable>[] UNWRAPS = (Class<? extends Throwable>[]) new Class<?>[]{InvocationTargetException.class, EJBException.class};
/**
* @param target
* @param clazz
* @param assertThrowable
*/
public EjbAwareThrowableProcessingInterceptor(Object target, Class<E> clazz) {
super(target, clazz, true);
}
@Override
protected Object afterInvocationThrowsThrowable(Throwable e, Method method) throws Error, Throwable {
return super.afterInvocationThrowsThrowable(ExceptionUtils.unwrap(e, UNWRAPS), method);
}
}
| [
"christian.beikov@gmail.com"
] | christian.beikov@gmail.com |
f89c32d896b1708b42f75131bd7022a44b59598b | faa59a36ca507f0d6e5cafb12e36abec113e51f5 | /gtas-parent/gtas-commons/src/main/java/gov/gtas/model/udr/json/util/JsonValidationUtils.java | 24ababf35372d2b55201d3ed4f6b983e1ca59cc3 | [] | no_license | optlin/GTAS | abb5b9d87a05a41c021abfe0ecffb34c593127a2 | 3c09eb686b9ed5ab0bb534821a2523458028344f | refs/heads/master | 2021-01-23T02:29:43.658360 | 2017-03-15T21:43:33 | 2017-03-15T21:43:33 | 85,999,592 | 1 | 0 | null | 2017-03-23T21:31:22 | 2017-03-23T21:31:22 | null | UTF-8 | Java | false | false | 2,546 | java | /*
* All GTAS code is Copyright 2016, Unisys Corporation.
*
* Please see LICENSE.txt for details.
*/
package gov.gtas.model.udr.json.util;
import gov.gtas.constant.RuleErrorConstants;
import gov.gtas.error.CommonServiceException;
import gov.gtas.model.udr.json.MetaData;
import gov.gtas.util.DateCalendarUtils;
import java.util.Calendar;
import java.util.Date;
import org.apache.commons.lang3.StringUtils;
/**
* Validation utilities for the UDR JSON.
*/
public class JsonValidationUtils {
public static void validateMetaData(final MetaData metaData, final boolean checkStartDate){
if (metaData == null) {
throw new CommonServiceException(
RuleErrorConstants.NO_META_ERROR_CODE,
RuleErrorConstants.NO_META_ERROR_MESSAGE);
}
final String title = metaData.getTitle();
if (StringUtils.isEmpty(title)) {
throw new CommonServiceException(
RuleErrorConstants.NO_TITLE_ERROR_CODE,
RuleErrorConstants.NO_TITLE_ERROR_MESSAGE);
}
final Date startDate = metaData.getStartDate();
final Date endDate = metaData.getEndDate();
validateDates(startDate, endDate, checkStartDate);
}
/**
* Checks the start aand end dates of the UDR meta data for validity.
* @param startDate the start date.
* @param endDate the end date.
* @param checkStartDate if true checks that the start date is greater than or equal to today.
*/
private static void validateDates(final Date startDate, final Date endDate, final boolean checkStartDate){
Date now = new Date();
if (startDate == null) {
throw new CommonServiceException(
RuleErrorConstants.INVALID_START_DATE_ERROR_CODE,
RuleErrorConstants.INVALID_START_DATE_ERROR_MESSAGE);
}
if(checkStartDate && DateCalendarUtils.dateRoundedGreater(now, startDate, Calendar.DATE)){
throw new CommonServiceException(
RuleErrorConstants.PAST_START_DATE_ERROR_CODE,
RuleErrorConstants.PAST_START_DATE_ERROR_MESSAGE);
}
if(DateCalendarUtils.dateRoundedLess(endDate, startDate, Calendar.DATE)){
throw new CommonServiceException(
RuleErrorConstants.END_LESS_START_DATE_ERROR_CODE,
RuleErrorConstants.END_LESS_START_DATE_ERROR_MESSAGE);
}
}
}
| [
"mikecope@gmail.com"
] | mikecope@gmail.com |
2c0a2e48a1ebb0635ed268e9e4047579a3ff9af6 | a10a6f502c8f626ab1e90c3bdfc541931d8ebb9b | /moduleCore/z_lib_user/src/main/java/com/example/z_lib_user/UserMainFragment.java | 763373b4c4ebb556ac453f4c6f85779cf008aed9 | [] | no_license | 1067899750/ElementDemo | 46bc0bb6986a81381acf0cf824abb67f0b25fe9b | 50b4e6f957eef21be2ccf56f87f797ee4c8e9406 | refs/heads/master | 2022-06-14T10:04:56.861855 | 2022-06-10T07:57:07 | 2022-06-10T07:57:07 | 195,958,649 | 1 | 0 | null | 2019-07-19T08:50:50 | 2019-07-09T07:44:34 | Java | UTF-8 | Java | false | false | 1,837 | java | package com.example.z_lib_user;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import com.alibaba.android.arouter.facade.annotation.Route;
import com.example.z_lib_base.arouter.ARouterUtils;
import com.example.z_lib_common.base.BaseFragment;
import com.example.z_lib_user.activity.UserMainActivity;
/**
*
* @description
* @author puyantao
* @date 2019/9/25 15:26
*/
@Route(path = ARouterUtils.USER_MAIN_FRAGMENT)
public class UserMainFragment extends BaseFragment {
private Button userBtn;
public UserMainFragment() {
// Required empty public constructor
}
public static UserMainFragment newInstance() {
UserMainFragment fragment = new UserMainFragment();
Bundle args = new Bundle();
fragment.setArguments(args);
return fragment;
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if (getArguments() != null) {
}
}
@Override
protected int setLayoutId() {
return R.layout.user_fragment_user_main;
}
@Override
protected void initViews(View view) {
userBtn = view.findViewById(R.id.user_btn);
}
@Override
protected void initData() {
userBtn.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
UserMainActivity.startUserMainActivity(getActivity());
}
});
}
@Override
public void onHiddenChanged(boolean hidden) {
super.onHiddenChanged(hidden);
}
@Override
public void onAttach(Context context) {
super.onAttach(context);
}
@Override
public void onDetach() {
super.onDetach();
}
}
| [
"puyantao123759"
] | puyantao123759 |
2635a10d37487a43226f37530d961f63497d6c10 | 1975a3cf5cf46a0f9ff8f5787e4811725b89e330 | /pharmacy/src/main/java/mrsisa12/pharmacy/service/PromotionService.java | 430744a20857bf9373dbe53f0512b6caaab076aa | [] | no_license | PetrovDina/MRS_ISA_PHARMACY | 0a506e4b5781623bd0e2eb38063da8557f37899b | 74853090aac37fc3aa178bebabbd09eca7ab9be7 | refs/heads/main | 2023-06-02T14:32:58.877106 | 2021-06-15T21:59:08 | 2021-06-15T21:59:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,272 | java | package mrsisa12.pharmacy.service;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import mrsisa12.pharmacy.model.Promotion;
import mrsisa12.pharmacy.repository.PromotionRepository;
@Service
public class PromotionService {
@Autowired
private PromotionRepository promotionRepository;
public Promotion findOne(Long id) {
return promotionRepository.findById(id).orElse(null);
}
public List<Promotion> findAll() {
return promotionRepository.findAll();
}
public Page<Promotion> findAll(Pageable page) {
return promotionRepository.findAll(page);
}
public Promotion save(Promotion promotion) {
return promotionRepository.save(promotion);
}
@Transactional(readOnly = false)
public void deletePromotion(Promotion promotion) {
promotionRepository.delete(promotion);
}
public List<Promotion> findAllWithPromotionItems() {
return promotionRepository.findAllWithPromotionItems();
}
public Promotion findOneWithPromotionItems(Long id) {
return promotionRepository.findOneWithPromotionItems(id);
}
}
| [
"58345648+BoJaN77799@users.noreply.github.com"
] | 58345648+BoJaN77799@users.noreply.github.com |
e2449072c434430d40f24dde0a82907ee829259c | 5e702336f060f7b7d341957ba5c2c497ac086435 | /spring-boot-starter/src/main/java/org/fisco/bcos/bean/RecordData.java | c8d530a996e1f50fe02b0d6e1af1456027782a00 | [] | no_license | nnnwu/openCredit | 7e4a936b42ee4df59decebeb10aaa2d75b0bf14c | 3f38b3d57eb5e2a1db64c8687186be2ce64bdde2 | refs/heads/master | 2020-07-21T06:54:32.025180 | 2019-08-06T18:40:04 | 2019-08-06T18:40:04 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,541 | java | package org.fisco.bcos.bean;
import org.fisco.bcos.solidity.Record;
import org.fisco.bcos.web3j.tuples.generated.Tuple8;
import java.math.BigInteger;
public class RecordData {
String applicant; // the organize want the data
String uploader; // the organize upload the data
BigInteger id; // index
BigInteger creditDataId; // the id of credit data
BigInteger time;
Boolean isSent; // whether the original data has been sent from the uploader
BigInteger score; // the score of this record
Boolean isScored; // whether the uploader has scored
public RecordData() {
}
public RecordData(String applicant, String owner, BigInteger id, BigInteger creditDataId, BigInteger time, Boolean isSent, BigInteger score, Boolean isScored) {
this.applicant = applicant;
this.uploader = owner;
this.id = id;
this.creditDataId = creditDataId;
this.time = time;
this.isSent = isSent;
this.score = score;
this.isScored = isScored;
}
public RecordData(Record.AddRecordSuccessEventResponse reponse) {
this.applicant = reponse._applicant;
this.uploader = reponse._uploader;
this.id = reponse._id;
this.creditDataId = reponse._creditDataId;
this.time = reponse._time;
this.isSent = false;
this.score = new BigInteger("0");
this.isScored = false;
}
public RecordData(Tuple8<String, String, BigInteger, BigInteger, BigInteger, Boolean, BigInteger, Boolean> result) {
this.applicant = result.getValue1();
this.uploader = result.getValue2();
this.id = result.getValue3();
this.creditDataId = result.getValue4();
this.time = result.getValue5();
this.isSent = result.getValue6();
this.score = result.getValue7();
this.isScored = result.getValue8();
}
public String getApplicant() {
return applicant;
}
public void setApplicant(String applicant) {
this.applicant = applicant;
}
public String getUploader() {
return uploader;
}
public void setUploader(String uploader) {
this.uploader = uploader;
}
public BigInteger getId() {
return id;
}
public void setId(BigInteger id) {
this.id = id;
}
public BigInteger getCreditDataId() {
return creditDataId;
}
public void setCreditDataId(BigInteger creditDataId) {
this.creditDataId = creditDataId;
}
public BigInteger getTime() {
return time;
}
public void setTime(BigInteger time) {
this.time = time;
}
public Boolean getSent() {
return isSent;
}
public void setSent(Boolean sent) {
isSent = sent;
}
public BigInteger getScore() {
return score;
}
public void setScore(BigInteger score) {
this.score = score;
}
public Boolean getScored() {
return isScored;
}
public void setScored(Boolean scored) {
isScored = scored;
}
@Override
public String toString() {
return "RecordData{" +
"applicant='" + applicant + '\'' +
", uploader='" + uploader + '\'' +
", id=" + id +
", creditDataId=" + creditDataId +
", time=" + time +
", isSent=" + isSent +
", score=" + score +
", isScored=" + isScored +
'}';
}
}
| [
"youngwilliam.zheng@gmail.com"
] | youngwilliam.zheng@gmail.com |
4efd9122091749fadf8848a81e4b69aaa2a7681f | 7046948047de2be85e2071d438c9b2fa4d47c99e | /work/First/src/QuickUnionUF.java | ee71793ffd523a1eb9aece8c9a9887fe42d8c059 | [] | no_license | alexf2/PrincetonAlgo1 | 0733d8ad62912a071676b9f55c8f6fb91271da31 | 6a64b095cf27234996f96abf00be0de535cf4fbc | refs/heads/master | 2021-05-07T13:53:00.928892 | 2018-01-16T22:53:07 | 2018-01-16T22:53:07 | 109,714,564 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 3,328 | java | import InputUtil.*;
public class QuickUnionUF implements IUf {
private int[] parent; // parent[i] = parent of i
private int count; // number of components
/**
* Initializes an empty union-find data structure with <tt>N</tt> sites
* <tt>0</tt> through <tt>N-1</tt>. Each site is initially in its own
* component.
*
* @param N the number of sites
* @throws IllegalArgumentException if <tt>N < 0</tt>
*/
public QuickUnionUF(int N) {
parent = new int[N];
count = N;
for (int i = 0; i < N; i++) {
parent[i] = i;
}
}
/**
* Returns the number of components.
*
* @return the number of components (between <tt>1</tt> and <tt>N</tt>)
*/
public int count() {
return count;
}
/**
* Returns the component identifier for the component containing site <tt>p</tt>.
*
* @param p the integer representing one object
* @return the component identifier for the component containing site <tt>p</tt>
* @throws IndexOutOfBoundsException unless <tt>0 ≤ p < N</tt>
*/
public int find(int p) {
validate(p);
while (p != parent[p])
p = parent[p];
return p;
}
// validate that p is a valid index
private void validate(int p) {
int N = parent.length;
if (p < 0 || p >= N) {
throw new IndexOutOfBoundsException("index " + p + " is not between 0 and " + (N-1));
}
}
/**
* Returns true if the the two sites are in the same component.
*
* @param p the integer representing one site
* @param q the integer representing the other site
* @return <tt>true</tt> if the two sites <tt>p</tt> and <tt>q</tt> are in the same component;
* <tt>false</tt> otherwise
* @throws IndexOutOfBoundsException unless
* both <tt>0 ≤ p < N</tt> and <tt>0 ≤ q < N</tt>
*/
public boolean connected(int p, int q) {
return find(p) == find(q);
}
/**
* Merges the component containing site <tt>p</tt> with the
* the component containing site <tt>q</tt>.
*
* @param p the integer representing one site
* @param q the integer representing the other site
* @throws IndexOutOfBoundsException unless
* both <tt>0 ≤ p < N</tt> and <tt>0 ≤ q < N</tt>
*/
public void union(int p, int q) {
int rootP = find(p);
int rootQ = find(q);
if (rootP == rootQ) return;
parent[rootP] = rootQ;
count--;
}
/**
* Reads in a sequence of pairs of integers (between 0 and N-1) from standard input,
* where each integer represents some object;
* if the sites are in different components, merge the two components
* and print the pair to standard output.
*/
public static void main(String[] args) {
int N = StdIn.readInt();
QuickUnionUF uf = new QuickUnionUF(N);
while (!StdIn.isEmpty()) {
int p = StdIn.readInt();
int q = StdIn.readInt();
if (uf.connected(p, q)) continue;
uf.union(p, q);
StdOut.println(p + " " + q);
}
StdOut.println(uf.count() + " components");
}
}
| [
"Aleksey-Fedorov@mailfrom.ru"
] | Aleksey-Fedorov@mailfrom.ru |
ab63dff0ee2ad1d54ba67c301dd8b97dd718eb9a | bb2cadf4fbb33574c6d1f67b63ace1aef39af094 | /Tut_gwt/src/com/abhinav/example/client/ItemSuggestCallback.java | ead0a7ca752674b4c2663a9a93057e8524c00032 | [] | no_license | abhinavnigam96/Shares | 27c5a110d39a9de0aadaff90db10e1b4b4aef236 | 5001cdcc878265fb4af9e2afd06329921aa39d6b | refs/heads/master | 2020-03-22T23:10:34.019868 | 2018-12-26T03:03:37 | 2018-12-26T03:07:27 | 140,793,379 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 765 | java | package com.abhinav.example.client;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.SuggestOracle.Callback;
import com.google.gwt.user.client.ui.SuggestOracle.Request;
import com.google.gwt.user.client.ui.SuggestOracle.Response;
public class ItemSuggestCallback implements AsyncCallback<Response> {
private Request _request;
private Callback _callBack;
public ItemSuggestCallback(Request request, Callback callBack) {
super();
this._request = request;
this._callBack = callBack;
}
@Override
public void onFailure(Throwable caught) {
_callBack.onSuggestionsReady(_request, new Response());
}
@Override
public void onSuccess(Response result) {
_callBack.onSuggestionsReady(_request, result);
}
}
| [
"charu.a.pandey@accenture.com"
] | charu.a.pandey@accenture.com |
60e708e59798bc4ecbb2b7d260fd745ad0873213 | f220b599bd6807d5d877a0e1906ebb368b141a50 | /src/main/java/es/ubu/lsi/ubumonitor/controllers/ubulogs/logtypes/UserTour.java | 9de5357a9e7ff5063cffaf984a9ed0364fec1ea9 | [
"MIT"
] | permissive | xjx1001/UBUMonitor | 7c3fd96c75dd3f205cb01ee0c99849e9ae546290 | 0a66363f20566cfd6dc4e317a701f3f1bf32d442 | refs/heads/master | 2021-07-11T14:43:03.015269 | 2021-03-21T21:58:14 | 2021-03-21T21:58:14 | 238,764,358 | 0 | 2 | MIT | 2020-06-29T16:39:09 | 2020-02-06T19:12:11 | Java | UTF-8 | Java | false | false | 1,052 | java | package es.ubu.lsi.ubumonitor.controllers.ubulogs.logtypes;
import java.util.List;
import es.ubu.lsi.ubumonitor.model.LogLine;
/**
*
* The user with id '' has viewed the tour with id '' at step index '' (id '') on the page with URL ''.
* The user with id '' has ended the tour with id '' at step index '' (id '') on the page with URL ''.
* The user with id '' has started the tour with id '' on the page with URL ''.
*
* @author Yi Peng Ji
*
*/
public class UserTour extends ReferencesLog {
/**
* Instacia única de la clase UserTour.
*/
private static UserTour instance;
/**
* Constructor privado de la clase singleton.
*/
private UserTour() {
}
/**
* Devuelve la instancia única de UserTour.
* @return instancia singleton
*/
public static UserTour getInstance() {
if (instance == null) {
instance = new UserTour();
}
return instance;
}
/**
* {@inheritDoc}
*/
@Override
public void setLogReferencesAttributes(LogLine log, List<Integer> ids) {
setUserById(log, ids.get(0));
//tour id
}
}
| [
"yipeng996@gmail.com"
] | yipeng996@gmail.com |
fd5e12ea67c83b56193f3816d71f0e765f92b069 | bd03a652bb215b7e785380c870f8064b7a13bbc3 | /HaneYonetim/src/main/java/com/AyhanOzer/HaneYonetim/dataAccess/abstracts/TypeOfIncomeDao.java | 503ccf16638119f73c1f80af26086cad4500f536 | [] | no_license | ayhan168585/Hrms | 35d3104e62bf20492633c157a8c6fecc590154cc | 34a232d707229ce68d16ceb9cfc03e69e2d1b466 | refs/heads/master | 2023-05-25T10:03:12.791718 | 2021-06-02T15:18:05 | 2021-06-12T20:54:26 | 374,704,125 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 269 | java | package com.AyhanOzer.HaneYonetim.dataAccess.abstracts;
import org.springframework.data.jpa.repository.JpaRepository;
import com.AyhanOzer.HaneYonetim.entities.concretes.TypeOfIncome;
public interface TypeOfIncomeDao extends JpaRepository<TypeOfIncome, Integer>{
}
| [
"ayhan168585@hotmail.com"
] | ayhan168585@hotmail.com |
76be2fd646c4c8d43c18a69cc8f25f89f94cfdc0 | 655e6e62765cb4ecccfb9f033b0cb445f1db8933 | /tests/gen/pl/lukok/ACheckers/tests/BuildConfig.java | df77b1a5d3a990b21fe558dc2925510e4a0c7637 | [] | no_license | lukokt/ACheckers | c664104cd7a307babfc593f828edbb4c693cd760 | deea211eaf67abacfe1f2e96d3b5c72875283f0a | refs/heads/master | 2021-01-20T01:03:35.787405 | 2014-01-11T19:10:28 | 2014-01-11T19:10:28 | 15,826,518 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 266 | java | /*___Generated_by_IDEA___*/
package pl.lukok.ACheckers.tests;
/* This stub is only used by the IDE. It is NOT the BuildConfig class actually packed into the APK */
public final class BuildConfig {
public final static boolean DEBUG = Boolean.parseBoolean(null);
} | [
"lukasz.oktaba@gmail.com"
] | lukasz.oktaba@gmail.com |
bfa4364ad64db34072d1eb35e6deeb26a12ead69 | 34b9e07759f74da99763a2617e5ae1b9c88957c8 | /server/src/main/java/info/xiaomo/server/back/BackMessagePool.java | d0e0cbf658a72837a78bf916e6559a077edd820f | [
"Apache-2.0"
] | permissive | yj173055792/GameServer | c6c0925dda4f3b10a55ec56e678e104df7d81ae4 | 1d3fdb0db0cf882422ae18997d95e44f3a31dd59 | refs/heads/master | 2021-01-20T13:03:29.839398 | 2017-08-24T12:40:25 | 2017-08-24T12:40:25 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,429 | java | package info.xiaomo.server.back;
import info.xiaomo.gameCore.protocol.Message;
import info.xiaomo.gameCore.protocol.MessagePool;
import info.xiaomo.server.protocol.message.gm.ReqCloseServerMessage;
import java.util.HashMap;
import java.util.Map;
/**
* 把今天最好的表现当作明天最新的起点..~
* いま 最高の表現 として 明日最新の始発..~
* Today the best performance as tomorrow newest starter!
* Created by IntelliJ IDEA.
* <p>
* author: xiaomo
* github: https://github.com/xiaomoinfo
* email : xiaomo@xiaomo.info
* QQ : 83387856
* Date : 2017/7/11 16:00
* desc :
* Copyright(©) 2017 by xiaomo.
*/
public class BackMessagePool implements MessagePool {
// 消息类字典
private final Map<Integer, Class<? extends Message>> messages = new HashMap<>();
public BackMessagePool() {
register(new ReqCloseServerMessage().getId(),ReqCloseServerMessage.class);
}
@Override
public Message getMessage(int messageId) {
Class<?> clazz = messages.get(messageId);
if (clazz != null) {
try {
return (Message) clazz.newInstance();
} catch (Exception e) {
return null;
}
}
return null;
}
@Override
public void register(int messageId, Class<? extends Message> messageClazz) {
messages.put(messageId, messageClazz);
}
}
| [
"xiaomo@xiaomo.info"
] | xiaomo@xiaomo.info |
945be85ac8fb854fcb8a324dbfbce816e6bf45ff | 350184750d4e7afa18afe2a13608e68b8a3ef2f2 | /flow-engine/src/main/java/com/global/adk/flow/delegate/AbstractInvokeDelegate.java | 5d5342d1a5080d760100c7ef9b03b6fd96f3e00d | [] | no_license | smallchen28/application-developer-kit | dbdef1fb6b4135a59f4b7a9ccf995d5314180dbe | f1e27c4d8adc28693bbb76f8c10eca725cb0c823 | refs/heads/master | 2021-04-08T00:43:09.395874 | 2018-05-09T07:24:18 | 2018-05-09T07:24:18 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 489 | java | /**
* www.yiji.com Inc.
* Copyright (c) 2011 All Rights Reserved.
*/
package com.global.adk.flow.delegate;
/**
* @author hasulee
* @version 1.0.0
* @email ligen@yiji.com
* @history hasuelee创建于15-3-26 下午3:06<br>
* @see
* @since 1.0.0
*/
public abstract class AbstractInvokeDelegate implements InvokeDelegate {
private Object target;
public AbstractInvokeDelegate(Object target) {
this.target = target;
}
public Object getTarget() {
return target;
}
}
| [
"1052299159@qq.com"
] | 1052299159@qq.com |
c394f216eb255ff3973482712af77636122dd4c2 | 911e3206a2f1bc5357d4b3a263a86fbb52633a30 | /src/main/java/mokitotest2/TestRunner.java | eb4013fda5956bc5c1ab3db50722e88a6c705353 | [] | no_license | gfengster/mockito-tutorial | 629dcd38dda558ed3be62f9009be1a02ca1e2813 | 6dd742485ff13d9010dfc1630291069a47a61afb | refs/heads/master | 2021-01-09T09:46:13.051520 | 2020-02-25T21:41:04 | 2020-02-25T21:41:04 | 242,255,613 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 460 | java | package mokitotest2;
import org.junit.runner.JUnitCore;
import org.junit.runner.Result;
import org.junit.runner.notification.Failure;
public class TestRunner {
public static void main(String[] args) {
Result result = JUnitCore.runClasses(MathApplicationTester.class);
for (Failure failure : result.getFailures()) {
System.out.println(failure.toString());
}
System.out.println(result.wasSuccessful());
}
} | [
"abc@gmail.com"
] | abc@gmail.com |
e5663942c6418cbbe623ec8883c9dbdea282ad01 | a98ffc74773bbb26aa4669e800a9de06564bf69b | /learn-java/src/Advanced/DataStructures/EnumerationTest.java | 2125a646856b2c5a794c8380386b52b334ff1641 | [] | no_license | carolinasitorus/java-basic-concept | 3decd386566a5a8b138590eee52dfd777cf77666 | f24647b20465b58929aa91578e2dec448a7c090f | refs/heads/master | 2020-03-26T07:51:14.655152 | 2018-08-31T06:36:55 | 2018-08-31T06:36:55 | 144,674,397 | 0 | 0 | null | 2018-08-31T06:36:56 | 2018-08-14T05:50:16 | Java | UTF-8 | Java | false | false | 248 | java | package Advanced.DataStructures;
import java.util.Enumeration;
import java.util.Vector;
public class EnumerationTest {
public static void main(String args[]){
Enumeration days;
Vector dayNames = new Vector();
}
}
| [
"if413061@gmail.com"
] | if413061@gmail.com |
dd3da0b66130eb862c300139054af970e0263d5c | 37992a7083efea148c66381a2e7c988f59de712b | /cppk/app/src/main/java/ru/ppr/cppk/settings/SetControlDetailActivity.java | 92e807ff2ece79a24074fa3f4749f0615d04439a | [] | no_license | RVC3/PTK | 5ab897d6abee1f7f7be3ba49c893b97e719085e9 | 1052b2bfa8f565c96a85d5c5928ed6c938a20543 | refs/heads/master | 2022-12-22T22:11:40.231298 | 2020-07-01T09:45:38 | 2020-07-01T09:45:38 | 259,278,530 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,498 | java | package ru.ppr.cppk.settings;
import android.app.Fragment;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TextView;
import ru.ppr.cppk.R;
import ru.ppr.cppk.di.Dagger;
import ru.ppr.cppk.entity.settings.PrivateSettings;
import ru.ppr.cppk.settings.AdditionalSettingsFragments.SellAndControlFragment;
import ru.ppr.cppk.systembar.SystemBarActivity;
/**
* Activity для окна настроек категории поезда контроля или маршрута трансфера
*/
public class SetControlDetailActivity extends SystemBarActivity {
private TextView title;
private PrivateSettings privateSettings;
public static Intent getNewIntent(Context context) {
return new Intent(context, SetControlDetailActivity.class);
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_set_control_detail);
privateSettings = Dagger.appComponent().privateSettings();
title = (TextView) findViewById(R.id.title);
title.setText(privateSettings.isTransferControlMode() ? R.string.settings_control_detail_transfer_route : R.string.settings_control_detail_train_category);
Fragment sellAndControlFragment = SellAndControlFragment.newInstance(false, true);
getFragmentManager().beginTransaction().add(R.id.container, sellAndControlFragment).commit();
}
}
| [
"kopanevartem@mail.ru"
] | kopanevartem@mail.ru |
ab2aa4470dc878e2f527be51c4fd2d50ffb70fb3 | 86effaae3678eaf8f8e5e1a27754f89332f6a656 | /singleton/src/test/java/kmitl/esd/exercise1/singleton/CompanyManagerTest.java | ad350217ff0aafde4176233c4a7c9928ad80fcdb | [] | no_license | thanutpheeraphan/kmitl-esd-exercise1-61090036-Bey | 10e5f6e94a8688ab200b069b03bb4af4a8900c17 | a8c9fac6e7472e0988a7bd3703cc6d7281d383af | refs/heads/master | 2023-02-25T01:17:53.275274 | 2021-01-28T09:11:07 | 2021-01-28T09:11:07 | 333,704,449 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 235 | java | package kmitl.esd.exercise1.singleton;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class CompanyManagerTest {
@Test
void doSthInstance() {
}
@Test
void doSth() {
}
} | [
"thanut@wongnai.com"
] | thanut@wongnai.com |
2328270bd5c0cdfac89de7c3519e63112b5b6305 | eee53bdafa96be034c5a959cf0b01a4041d5c937 | /app/src/main/java/com/smubator/adwitter/Promoter/activity/AccountSettingActivity.java | 06b46f79442ac1f75bff1d712903b630b47dba0c | [] | no_license | AppDevelopers11/Adwitter | c79d70c1b4932093bb59000f7f58bfee967473c1 | 2554ff8e77a59f85a4b5eb282d53f3e1cbd76449 | refs/heads/master | 2021-05-06T11:17:21.119207 | 2017-12-14T15:09:36 | 2017-12-14T15:09:36 | 114,252,834 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,393 | java | package com.smubator.adwitter.Promoter.activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.Spinner;
import android.widget.TextView;
import android.widget.Toast;
import com.android.volley.Request;
import com.android.volley.Response;
import com.android.volley.error.VolleyError;
import com.android.volley.request.StringRequest;
import com.smubator.adwitter.CustomFonts.MyCustomTextView;
import com.smubator.adwitter.Models.TopicTargetingModel;
import com.smubator.adwitter.R;
import com.smubator.adwitter.Utils.Utils;
import com.smubator.adwitter.volly.DwitterApplication;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
public class AccountSettingActivity extends AppCompatActivity implements View.OnClickListener {
private RelativeLayout rlArrow;
private ImageView ivArrowRight;
private MyCustomTextView title;
private RelativeLayout rlSelectLocation, rlTopicTargetting;
private TextView tvTopicTarget, tvLocation;
private Spinner spAge, spGender, spLanguage;
private StringRequest stringRequest;
private String country_name, state_name, city_name;
private String age, gender, language;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_account_setting);
initViews();
initListeners();
spinner();
}
private void initListeners() {
ivArrowRight.setOnClickListener(this);
rlArrow.setOnClickListener(this);
rlSelectLocation.setOnClickListener(this);
rlTopicTargetting.setOnClickListener(this);
}
private void initViews() {
rlArrow = findViewById(R.id.rlArrow);
rlSelectLocation = findViewById(R.id.rlSelectLocation);
ivArrowRight = findViewById(R.id.ivArrowRight);
tvLocation = findViewById(R.id.tvLocation);
title = findViewById(R.id.title);
title.setText(getResources().getString(R.string.accountsettings));
spAge = findViewById(R.id.spAge);
rlTopicTargetting = findViewById(R.id.rlTopicTargetting);
spGender = findViewById(R.id.spGender);
spLanguage = findViewById(R.id.spLanguage);
}
@Override
public void onBackPressed() {
super.onBackPressed();
overridePendingTransition(0, 0);
}
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.ivArrowRight:
DwitterApplication.getInstance().saveString("country_name", country_name);
DwitterApplication.getInstance().saveString("state_name", state_name);
DwitterApplication.getInstance().saveString("city_name", city_name);
DwitterApplication.getInstance().saveString("age", age);
DwitterApplication.getInstance().saveString("gender", gender);
DwitterApplication.getInstance().saveString("language", language);
Intent i = new Intent(AccountSettingActivity.this, PromoterSchedulingActivity.class);
i.addFlags(Intent.FLAG_ACTIVITY_NO_ANIMATION);
startActivity(i);
break;
case R.id.rlArrow:
onBackPressed();
break;
case R.id.rlSelectLocation:
Intent selectLocation = new Intent(AccountSettingActivity.this, SelectLocationActivity.class);
startActivityForResult(selectLocation, 1);
break;
case R.id.rlTopicTargetting:
// Toast.makeText(this, "ad", Toast.LENGTH_SHORT).show();
topicTargetting();
DwitterApplication.getInstance().addToRequestQueue(stringRequest, "tag_string_req");
break;
}
}
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (data != null) {
if (requestCode == 1) {
country_name = data.getStringExtra("country_name");
state_name = data.getStringExtra("state_name");
city_name = data.getStringExtra("city_name");
if (country_name.equalsIgnoreCase("") && city_name.equalsIgnoreCase("")) {
tvLocation.setText("");
} else {
tvLocation.setText(country_name + "/" + city_name);
}
}
}
Log.i("", "");
}
public void spinner() {
ArrayAdapter<CharSequence> adapterAge = ArrayAdapter.createFromResource(this,
R.array.spAge, android.R.layout.simple_spinner_item);
adapterAge.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spAge.setAdapter(adapterAge);
spAge.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
Object o = parent.getSelectedItem();
age = String.valueOf(o);
}
public void onNothingSelected(AdapterView<?> parent) {
// Another interface callback
}
});
ArrayAdapter<CharSequence> adapterGender = ArrayAdapter.createFromResource(this,
R.array.spGender, android.R.layout.simple_spinner_item);
adapterGender.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spGender.setAdapter(adapterGender);
spGender.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
Object o = parent.getSelectedItem();
gender = String.valueOf(o);
}
public void onNothingSelected(AdapterView<?> parent) {
// Another interface callback
}
});
ArrayAdapter<CharSequence> adapterLanguage = ArrayAdapter.createFromResource(this,
R.array.spLanguage, android.R.layout.simple_spinner_item);
adapterLanguage.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spLanguage.setAdapter(adapterLanguage);
spLanguage.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> parent, View view, int pos, long id) {
Object o = parent.getSelectedItem();
language = String.valueOf(o);
}
public void onNothingSelected(AdapterView<?> parent) {
// Another interface callback
}
});
}
public void topicTargetting() {
// final StringRequest strReq = new StringRequest(Request.Method.POST, url, new Response.Listener<String>() {
stringRequest = new StringRequest(Request.Method.POST, Utils.BASE_URL, new Response.Listener<String>() {
@Override
public void onResponse(String response) {
try {
// Intent i = new Intent(AccountSettingActivity.this, IntroductionActivity.class);
// startActivity(i);
ArrayList<TopicTargetingModel> ttModel = new ArrayList<>();
// String s="\uFEFF\uFEFF{\"category\":[{\"id\":\"4\",\"name\":\"home\"},{\"id\":\"3\",\"name\":\"foods\"},{\"id\":\"2\",\"name\":\"beauty\"},{\"id\":\"1\",\"name\":\"baking & finance\"}]}"
response = response.replace("\uFEFF", "");
JSONArray jsonArray = new JSONArray(response);
for (int i = 0; i <= jsonArray.length(); i++) {
JSONObject obj = jsonArray.getJSONObject(i);
TopicTargetingModel topicTargetingModel = new TopicTargetingModel();
topicTargetingModel.setId(obj.optInt("id"));
topicTargetingModel.setName(obj.optString("name"));
ttModel.add(topicTargetingModel);
}
} catch (JSONException e) {
e.printStackTrace();
}
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Toast.makeText(AccountSettingActivity.this, "error", Toast.LENGTH_SHORT).show();
}
}) {
protected Map<String, String> getParams() {
Map<String, String> MyData = new HashMap<String, String>();
MyData.put("action", Utils.TopicTargetting); //Add the data you'd like to send to the server.
return MyData;
}
};
}
}
| [
"coder.app04@gmail.com"
] | coder.app04@gmail.com |
fcc4f47b739c2411cf644056c0d89c0f960bc25a | b6d8de40417600ab0d0f56bf0532d25c8ab32244 | /SimpleAlgo/src/algo1212/WordCount.java | f4b0568cd9f3a16a2f7db5f9a1b576c5f28a900e | [] | no_license | Hoan1993/DailyAlgo | 54cc201299f95ee4e4ee2102924110295597abc2 | a46c5eb1857dc462cd792133371fe39fdc10728d | refs/heads/master | 2021-02-04T16:42:56.766440 | 2020-03-29T11:46:00 | 2020-03-29T11:46:00 | 243,687,746 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 77 | java | package algo1212;
public class WordCount {
String words;
int counts;
}
| [
"sist@DESKTOP-3J6RDRE"
] | sist@DESKTOP-3J6RDRE |
3515a08867aa3d6b7a53303c76ffb5394ca6a4d1 | 35cf7562a84e1e46cd620b74a6873b22d10b3919 | /src/testNG_Topics/ExcelDataRead.java | 237da87907063192c8bc8a4a6dd9947927a8c575 | [] | no_license | PrathapReddy456/TestNG | 370f252f0e952d94898871e6388657bd15f14220 | 3267ba952c041a08a01a78900e6e532ba3563d29 | refs/heads/master | 2020-03-20T18:41:48.360518 | 2018-07-04T00:57:01 | 2018-07-04T00:57:01 | 137,600,352 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,035 | java | package testNG_Topics;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Parameters;
import org.testng.annotations.Test;
import utilities.Utilies;
import utilities2.DataFromExcel;
public class ExcelDataRead {
WebDriver driver;
@Parameters({ "Browser", "url1", "url2" })
@BeforeMethod
public void setup(String Browser, String url1, String url3) {
if (Browser.equals("Chrome")) {
System.setProperty("webdriver.chrome.driver", "E:\\chromedriver.exe");
driver = new ChromeDriver();
} else if (Browser.equals("Firefox")) {
System.setProperty("webdriver.gecko.driver", "E:\\geckodriver.exe");
driver = new FirefoxDriver();
}
driver.manage().window().maximize();
driver.manage().deleteAllCookies();
driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);
driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
driver.get(url1);
driver.navigate().to(url3);
}
@Test(dataProvider = "testdata")
public void register(String firstName, String lastName, String emailaddress, String password) {
driver.findElement(By.xpath("//*[@id='firstname']")).clear();
driver.findElement(By.xpath("//*[@id='firstname']")).sendKeys(firstName);
driver.findElement(By.xpath("//*[@id=\"lastname\"]")).sendKeys(lastName);
driver.findElement(By.xpath("//*[@id=\"email\"]")).sendKeys(emailaddress);
driver.findElement(By.xpath("//*[@id=\"PASSWORD\"]")).sendKeys(password);
}
@AfterMethod
public void closes() {
driver.close();
}
@DataProvider
public Iterator<Object[]> testdata() {
ArrayList<Object[]> data2 = DataFromExcel.getdata(); // Arraylist Store the values
return data2.iterator(); // Iterator pick the values one by one from arraylist
}
}
| [
"prathap456qa@gmail.com"
] | prathap456qa@gmail.com |
39f992e7a696bec4557b5bedceb2a2239c08fbb9 | 4b5c9f61d6f73b58cc764c0534d34bbcdb327416 | /src/main/java/com/goode/imgcompress/reduce/util/Util.java | 811150cd678657fe5e732d766b2cea2fb79bc69c | [] | no_license | goode17/ImageCompress_Jni | c356d3787a055a8030a4674645ca59640f2d1084 | e4c293e3bd2d83c6a419b3a41e7d9fa28ebd7469 | refs/heads/master | 2020-06-02T19:15:01.120801 | 2019-06-11T02:38:21 | 2019-06-11T02:38:21 | 191,278,851 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 11,981 | java | package com.goode.imgcompress.reduce.util;
import android.annotation.TargetApi;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Build;
import android.os.Looper;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.text.TextUtils;
import com.goode.imgcompress.reduce.compress.CompressOptions;
import com.goode.imgcompress.reduce.data.ImageFormat;
import java.io.File;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Queue;
/**
* A collection of assorted utility classes.
*/
public final class Util {
private static final int HASH_MULTIPLIER = 31;
private static final int HASH_ACCUMULATOR = 17;
private static final char[] HEX_CHAR_ARRAY = "0123456789abcdef".toCharArray();
// 32 bytes from sha-256 -> 64 hex chars.
private static final char[] SHA_256_CHARS = new char[64];
private Util() {
// Utility class.
}
/**
* Returns the hex string of the given byte array representing a SHA256 hash.
*/
@NonNull
public static String sha256BytesToHex(@NonNull byte[] bytes) {
synchronized (SHA_256_CHARS) {
return bytesToHex(bytes, SHA_256_CHARS);
}
}
// Taken from:
// http://stackoverflow.com/questions/9655181/convert-from-byte-array-to-hex-string-in-java
// /9655275#9655275
@SuppressWarnings("PMD.UseVarargs")
@NonNull
private static String bytesToHex(@NonNull byte[] bytes, @NonNull char[] hexChars) {
int v;
for (int j = 0; j < bytes.length; j++) {
v = bytes[j] & 0xFF;
hexChars[j * 2] = HEX_CHAR_ARRAY[v >>> 4];
hexChars[j * 2 + 1] = HEX_CHAR_ARRAY[v & 0x0F];
}
return new String(hexChars);
}
/**
* Convert the string into MD5 format
*
* @param string
*/
public static String md5(@NonNull String string) {
if (TextUtils.isEmpty(string)) {
throw new IllegalArgumentException("error,string is empty");
}
MessageDigest md5 = null;
try {
md5 = MessageDigest.getInstance("MD5");
byte[] bytes = md5.digest(string.getBytes());
String result = "";
for (byte b : bytes) {
String temp = Integer.toHexString(b & 0xff);
if (temp.length() == 1) {
temp = "0" + temp;
}
result += temp;
}
return result;
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
return "";
}
/**
* Returns the allocated byte size of the given bitmap.
*
* @see #getBitmapByteSize(Bitmap)
* @deprecated Use {@link #getBitmapByteSize(Bitmap)} instead. Scheduled to be
* removed in Glide 4.0.
*/
@Deprecated
public static int getSize(@NonNull Bitmap bitmap) {
return getBitmapByteSize(bitmap);
}
/**
* Returns the in memory size of the given {@link Bitmap} in bytes.
*/
@TargetApi(Build.VERSION_CODES.KITKAT)
public static int getBitmapByteSize(@NonNull Bitmap bitmap) {
// The return value of getAllocationByteCount silently changes for recycled bitmaps from the
// internal buffer size to row bytes * height. To avoid random inconsistencies in caches, we
// instead assert here.
if (bitmap.isRecycled()) {
throw new IllegalStateException("Cannot obtain size for recycled Bitmap: " + bitmap
+ "[" + bitmap.getWidth() + "x" + bitmap.getHeight() + "] " + bitmap.getConfig());
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
// Workaround for KitKat initial release NPE in Bitmap, fixed in MR1. See issue #148.
try {
return bitmap.getAllocationByteCount();
} catch (@SuppressWarnings("PMD.AvoidCatchingNPE") NullPointerException e) {
// Do nothing.
}
}
return bitmap.getHeight() * bitmap.getRowBytes();
}
/**
* Returns the in memory size of {@link Bitmap} with the given width, height, and
* {@link Bitmap.Config}.
*/
public static int getBitmapByteSize(int width, int height, @Nullable Bitmap.Config config) {
return width * height * getBytesPerPixel(config);
}
private static int getBytesPerPixel(@Nullable Bitmap.Config config) {
// A bitmap by decoding a GIF has null "config" in certain environments.
if (config == null) {
config = Bitmap.Config.ARGB_8888;
}
int bytesPerPixel;
switch (config) {
case ALPHA_8:
bytesPerPixel = 1;
break;
case RGB_565:
case ARGB_4444:
bytesPerPixel = 2;
break;
case RGBA_F16:
bytesPerPixel = 8;
break;
case ARGB_8888:
default:
bytesPerPixel = 4;
break;
}
return bytesPerPixel;
}
/**
* Throws an {@link IllegalArgumentException} if called on a thread other than the main
* thread.
*/
public static void assertMainThread() {
if (!isOnMainThread()) {
throw new IllegalArgumentException("You must call this method on the main thread");
}
}
/**
* Throws an {@link IllegalArgumentException} if called on the main thread.
*/
public static void assertBackgroundThread() {
if (!isOnBackgroundThread()) {
throw new IllegalArgumentException("You must call this method on a background thread");
}
}
/**
* Returns {@code true} if called on the main thread, {@code false} otherwise.
*/
public static boolean isOnMainThread() {
return Looper.myLooper() == Looper.getMainLooper();
}
/**
* Returns {@code true} if called on a background thread, {@code false} otherwise.
*/
public static boolean isOnBackgroundThread() {
return !isOnMainThread();
}
/**
* Creates a {@link Queue} of the given size using Glide's preferred implementation.
*/
@NonNull
public static <T> Queue<T> createQueue(int size) {
return new ArrayDeque<>(size);
}
/**
* Returns a copy of the given list that is safe to iterate over and perform actions that may
* modify the original list.
* <p>
* <p>See #303, #375, #322, #2262.
*/
@NonNull
@SuppressWarnings("UseBulkOperation")
public static <T> List<T> getSnapshot(@NonNull Collection<T> other) {
// toArray creates a new ArrayList internally and does not guarantee that the values it contains
// are non-null. Collections.addAll in ArrayList uses toArray internally and therefore also
// doesn't guarantee that entries are non-null. WeakHashMap's iterator does avoid returning null
// and is therefore safe to use. See #322, #2262.
List<T> result = new ArrayList<>(other.size());
for (T item : other) {
if (item != null) {
result.add(item);
}
}
return result;
}
/**
* Null-safe equivalent of {@code a.equals(b)}.
*
* @see java.util.Objects#equals
*/
public static boolean bothNullOrEqual(@Nullable Object a, @Nullable Object b) {
return a == null ? b == null : a.equals(b);
}
public static int hashCode(int value) {
return hashCode(value, HASH_ACCUMULATOR);
}
public static int hashCode(int value, int accumulator) {
return accumulator * HASH_MULTIPLIER + value;
}
public static int hashCode(float value) {
return hashCode(value, HASH_ACCUMULATOR);
}
public static int hashCode(float value, int accumulator) {
return hashCode(Float.floatToIntBits(value), accumulator);
}
public static int hashCode(@Nullable Object object, int accumulator) {
return hashCode(object == null ? 0 : object.hashCode(), accumulator);
}
public static int hashCode(boolean value, int accumulator) {
return hashCode(value ? 1 : 0, accumulator);
}
public static int hashCode(boolean value) {
return hashCode(value, HASH_ACCUMULATOR);
}
public static boolean isPicFile(String filePath) {
String suffix = filePath.substring(filePath.lastIndexOf(".") + 1);
if (suffix.equalsIgnoreCase(ImageFormat.JPEG.getType())
|| suffix.equalsIgnoreCase(ImageFormat.JPG.getType())
|| suffix.equalsIgnoreCase(ImageFormat.PNG.getType())
|| suffix.equalsIgnoreCase(ImageFormat.WEBP.getType())) {
return true;
} else {
return false;
}
}
/**
* 根据尺寸或大小获取inSampleSize
*
* @param srcPath 源图路径
* @param compressOptions 压缩选项
* @return inSampleSize
*/
public static int getInSampleSizeByWHorLength(@NonNull String srcPath, @NonNull CompressOptions compressOptions) {
if (TextUtils.isEmpty(srcPath)) {
throw new IllegalArgumentException("The src path is empty.");
}
BitmapFactory.Options newOpts = new BitmapFactory.Options();
newOpts.inJustDecodeBounds = true;
BitmapFactory.decodeFile(srcPath, newOpts);
int ww = newOpts.outWidth;
int hh = newOpts.outHeight;
int inSampleSize1 = calculateSampleSize(ww, hh, compressOptions.getDefaultWidthHeight());
int inSampleSize2 = calculateSampleSize(new File(srcPath).length(), compressOptions.getMaxLength());
return inSampleSize1 > inSampleSize2 ? inSampleSize1 : inSampleSize2;
}
/**
* 根据图片尺寸计算
*
* @param width 源图宽
* @param height 源图高
* @param wh 目标图片宽高
* @return inSampleSize
*/
private static int calculateSampleSize(int width, int height, int[] wh) {
if (width < 0) {
throw new IllegalArgumentException("the width num must be >0");
}
if (height < 0) {
throw new IllegalArgumentException("the height num must be >0");
}
int defaultWidth = wh[0];
int defaultHeight = wh[1];
int inSampleSize = 1;
// 根据图片尺寸按宽或高计算缩放比
if (width > height && width > defaultWidth) {
inSampleSize = width / defaultWidth;
} else if (width < height && height > defaultHeight) {
inSampleSize = height / defaultHeight;
}
inSampleSize = inSampleSize > 0 ? inSampleSize : 1;
return inSampleSize;
}
/**
* 根据目标图片大小计算
*
* @param srcFileLength
* @param destFileLength
* @return inSampleSize
*/
private static int calculateSampleSize(long srcFileLength, long destFileLength) {
if (srcFileLength < 0) {
throw new IllegalArgumentException("the length of srcFile must be >0");
}
if (destFileLength < 0) {
throw new IllegalArgumentException("the length of destFile must be >0");
}
int inSampleSize;
inSampleSize = (int) (Math.ceil(Math.sqrt(srcFileLength / destFileLength)));
inSampleSize = inSampleSize > 0 ? inSampleSize : 1;
return inSampleSize;
}
}
| [
"lifengyu@lefull.cn"
] | lifengyu@lefull.cn |
c52008a28797b124dc2b4a44ab021a85f0fe3d57 | 0bdc38cf07f424f6d14a801a2de90ac919e17a9c | /src/main/java/org/bond/ghost/controller/AlbumController.java | ddc63e976bee1250365397c103ae62d15be71423 | [] | no_license | ceclar123/ghost | 9bcd75bbac5dc4e0dc48ac62f6472a1e8ef9fe25 | c63c9c34db2cdc02fd9ba13c8f3e24fede4c2809 | refs/heads/master | 2016-08-04T08:49:57.725159 | 2014-11-21T13:19:08 | 2014-11-21T13:20:16 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 9,826 | java | package org.bond.ghost.controller;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.log4j.Logger;
import org.bond.ghost.utility.ImageZipUtil;
import org.bond.ghost.viewmodel.ShowImageModel;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.InvalidResultSetAccessException;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.PreparedStatementCreator;
import org.springframework.jdbc.support.GeneratedKeyHolder;
import org.springframework.jdbc.support.KeyHolder;
import org.springframework.jdbc.support.rowset.SqlRowSet;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.view.RedirectView;
@Controller
public class AlbumController {
@Autowired
private JdbcTemplate jdbcTemplate;
@RequestMapping(value = "/album/showAlbum")
public ModelAndView showAlbum(HttpSession session) {
ModelAndView mav = new ModelAndView();
if (session.getAttribute("userid") == null) {
mav.setViewName("/user/toLogin");
} else {
String userid = session.getAttribute("userid").toString();
String sSql = "SELECT g_album.ID,g_album.NAME,g_album.DESC FROM g_album WHERE g_album.userid=?";
List<Map<String, Object>> list = jdbcTemplate.queryForList(sSql, userid);
mav.setViewName("/album/showAlbum");
mav.addObject("list", list);
}
return mav;
}
@RequestMapping(value = "/album/showImage/{id}")
public ModelAndView showImage(@PathVariable("id") String id, HttpServletRequest request, HttpServletResponse response) throws Exception {
JSONObject obj = null;
JSONArray array = new JSONArray();
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
String sSql = "SELECT ID,AID,FILENAME,FILEPATH FROM g_picture WHERE AID=?";
SqlRowSet set = jdbcTemplate.queryForRowSet(sSql, id);
while (set.next()) {
obj = new JSONObject();
obj.put("image", basePath + "album/printImage/" + set.getString("ID"));
obj.put("title", "");
obj.put("thumb", "");
obj.put("url", "");
array.put(obj);
}
ModelAndView mav = new ModelAndView();
mav.addObject("data", array.toString());
mav.setViewName("/album/showImage");
return mav;
// ModelAndView mav = new ModelAndView(new RedirectView(basePath +
// "album/showImage"));
// mav.addObject("data", array.toString());
// return mav;
// RequestDispatcher rd =
// request.getRequestDispatcher("/album/showImage");
// request.setAttribute("data", array.toString());
// rd.forward(request, response);
// return null;
}
@RequestMapping(value = "/album/toAdd")
public ModelAndView toAddAlbum() {
ModelAndView mav = new ModelAndView();
mav.setViewName("/album/albumEdit");
return mav;
}
@RequestMapping(value = "/album/toEdit/{id}")
public ModelAndView toEditAlbum(@PathVariable("id") String id) {
ModelAndView mav = new ModelAndView();
mav.setViewName("/album/albumEdit");
mav.addObject("albumid", id);
return mav;
}
@RequestMapping(value = "/album/toUpload/{id}")
public ModelAndView toUploadImage(@PathVariable("id") String id) {
ModelAndView mav = new ModelAndView();
// mav.setViewName("/album/uploadImage");
// mav.setViewName("/album/uploadTest");
mav.setViewName("/album/uploadFile");
mav.addObject("albumid", id);
return mav;
}
@RequestMapping(value = "/album/save")
public ModelAndView saveAlbum(HttpSession session, HttpServletRequest request, HttpServletResponse response) {
ModelAndView mav = new ModelAndView();
if (session.getAttribute("userid") == null) {
try {
// mav.setViewName("/user/toLogin");
String path = request.getContextPath();
String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
response.sendRedirect(basePath + "user/toLogin");
return null;
} catch (Exception ex) {
mav.setViewName("/album/editFail");
Logger.getLogger(AlbumController.class).error(ex.getMessage());
}
} else {
try {
final String id = request.getParameter("id");
final String userid = session.getAttribute("userid").toString();
final String name = request.getParameter("name");
final String desc = request.getParameter("desc");
final String sSql_i = "insert into g_album(USERID,A_NAME,A_DESC) values(?,?,?)";
final String sSql_u = "update g_album set A_NAME=?,A_DESC=? where ID=?";
if (id.length() == 0 || id.equals("0")) {
KeyHolder keyHolder = new GeneratedKeyHolder();
int rows = jdbcTemplate.update(new PreparedStatementCreator() {
public PreparedStatement createPreparedStatement(Connection con) throws SQLException {
// 返回自增值
PreparedStatement ps = con.prepareStatement(sSql_i, Statement.RETURN_GENERATED_KEYS);
ps.setLong(1, Long.parseLong(userid));
ps.setString(2, name);
ps.setString(3, desc);
return ps;
}
}, keyHolder);
mav.addObject("albumid", keyHolder.getKey().intValue());
} else {
int rows = jdbcTemplate.update(sSql_u, name, desc, id);
mav.addObject("albumid", id);
}
mav.setViewName("/album/editSuccess");
} catch (Exception ex) {
mav.addObject("errmsg", ex.getMessage());
mav.setViewName("/album/editFail");
Logger.getLogger(AlbumController.class).error(ex.getMessage());
}
}
return mav;
}
@RequestMapping(value = "/album/printImage/{id}")
public void printImage(@PathVariable("id") String id, HttpServletRequest request, HttpServletResponse response) {
FileInputStream fis = null;
response.setContentType("image/jpg");
try {
String path = request.getServletContext().getInitParameter("UploadPath");
String sSql = "SELECT ID,AID,FILENAME,FILEPATH FROM g_picture WHERE ID=?";
SqlRowSet set = jdbcTemplate.queryForRowSet(sSql, id);
if (set.next()) {
OutputStream out = response.getOutputStream();
File file = new File(path + "/" + set.getString("FILEPATH"));
fis = new FileInputStream(file);
byte[] b = new byte[fis.available()];
fis.read(b);
out.write(b);
out.flush();
}
} catch (Exception ex) {
ex.printStackTrace();
Logger.getLogger(AlbumController.class).error(ex.getMessage());
} finally {
if (fis != null) {
try {
fis.close();
} catch (Exception ex) {
ex.printStackTrace();
Logger.getLogger(AlbumController.class).error(ex.getMessage());
}
}
}
}
@RequestMapping(value = "/album/upload")
public ModelAndView uploadImage(HttpServletRequest request, HttpServletResponse response) {
String albumid = request.getParameter("albumid");
String path = request.getServletContext().getInitParameter("UploadPath");
CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver(request.getServletContext());
// 判断request是否有文件上传
if (multipartResolver.isMultipart(request)) {
MultipartHttpServletRequest multiRequest = (MultipartHttpServletRequest) request;
Iterator<String> iter = multiRequest.getFileNames();
SimpleDateFormat format = new SimpleDateFormat("yyyy_MM_dd_HH_mm_ss_SSS");
while (iter.hasNext()) {
MultipartFile file = multiRequest.getFile(iter.next());
if (file != null && file.getSize() > 0) {
// 原始文件名
String filePath = file.getOriginalFilename();
// 索引到最后一个反斜杠
int start = filePath.lastIndexOf("\\");
// 截取 上传文件的 字符串名字,加1是 去掉反斜杠,
String filename = filePath.substring(start + 1);
// 后缀名
start = filename.indexOf('.');
String suffixName = filename.substring(start + 1);
// 日起格式化
java.util.Date time = Calendar.getInstance().getTime();
// 相对路径
String newFileName = format.format(time) + "." + suffixName;
String relaPath = albumid + "/" + newFileName;
try {
ImageZipUtil.resize(file.getInputStream(), path + "/" + relaPath, 1600, 1064, 0.8f);
String sSql = "insert into g_picture(AID,FILENAME,FILEPATH) values(?,?,?)";
int rows = jdbcTemplate.update(sSql, albumid, newFileName, relaPath);
} catch (Exception ex) {
ex.printStackTrace();
Logger.getLogger(AlbumController.class).error(ex.getMessage());
}
}
}
}
ModelAndView mav = new ModelAndView();
mav.setViewName("/album/showImage");
return mav;
}
}
| [
"ceclar123@yeah.net"
] | ceclar123@yeah.net |
fa38823f532498e98931620a226ddb73e3f35c1b | 1bc4fdb18fb32be2485e19a19b23cd5f1f5d7c4d | /src/main/java/io/changsoft/customers/config/FeignConfiguration.java | a6bb11fd3f6ed2ef59d9493c23c66b9d2de81811 | [] | no_license | chang-ngeno/customers-one-on-one | e7b7bdce6619c9a7b128d41fbb2c41be8a96c677 | d7f1383053a76c3587575cadb8ebd817301c82e3 | refs/heads/main | 2023-05-14T12:21:53.125314 | 2021-06-04T00:47:27 | 2021-06-04T00:47:27 | 373,680,243 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 681 | java | package io.changsoft.customers.config;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.cloud.openfeign.FeignClientsConfiguration;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;
@Configuration
@EnableFeignClients(basePackages = "io.changsoft.customers")
@Import(FeignClientsConfiguration.class)
public class FeignConfiguration {
/**
* Set the Feign specific log level to log client REST requests.
*/
@Bean
feign.Logger.Level feignLoggerLevel() {
return feign.Logger.Level.BASIC;
}
}
| [
"jhipster-bot@jhipster.tech"
] | jhipster-bot@jhipster.tech |
ebdefdbd06db2b59ddef4863f7236cfe63b46de7 | f087b7f3e9abe0c5ce95965cb8081dce9dadcffb | /app/src/main/java/com/gofar/anodais/Model/User.java | 4958627c2bf9b6618535fbbe52e62c8167c5e462 | [] | no_license | GofarP/CoffeeAddict | f680cc6b61cdd05858c6de4c79f876d5d1f37dc3 | b39d06d2f46d760aea7ae46bd6f47fd7be83a54d | refs/heads/main | 2023-05-06T15:11:57.947203 | 2021-06-03T01:45:09 | 2021-06-03T01:45:09 | 353,567,387 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 922 | java | package com.gofar.anodais.Model;
public class User {
private String id_user, username,email,notelp;
public User(String id_user, String username,String email, String notelp) {
this.id_user = id_user;
this.username = username;
this.email=email;
this.notelp=notelp;
}
public User() {
}
public String getId_user() {
return id_user;
}
public void setId_user(String id_user) {
this.id_user = id_user;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getNotelp() {
return notelp;
}
public void setNotelp(String notelp) {
this.notelp = notelp;
}
}
| [
"gofarperdana83@gmail.com"
] | gofarperdana83@gmail.com |
d92fd053037eddf527d100bccf71d981add74e76 | 95c50b78876091443634e58e28024c73e44699b4 | /src/com/javarush/test/level17/lesson04/task01/Solution.java | df07ae58aa0769195971f2860b16a4d08c9f7166 | [] | no_license | Marat8432/JavaRushHomeWork | 1fdf2d4beacbe8b3421305a764d09deb522a736c | 666532b3e7837f2e55e6b6456b9b333b5bc13182 | refs/heads/master | 2021-01-17T18:07:23.968435 | 2016-10-16T20:53:03 | 2016-10-16T20:53:03 | 71,076,489 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,463 | java | package com.javarush.test.level17.lesson04.task01;
import java.util.ArrayList;
import java.util.List;
/* Синхронизированные заметки
1. Класс Note будет использоваться нитями. Поэтому сделай так, чтобы обращения к листу notes блокировали мютекс notes, не this
2. Все System.out.println не должны быть заблокированы (синхронизированы), т.е. не должны находиться в блоке synchronized
*/
public class Solution {
public static class Note {
public final List<String> notes = new ArrayList<String>();
public void addNote(int index, String note) {
System.out.println("Сейчас будет добавлена заметка [" + note + "] На позицию " + index);
synchronized (notes) {
notes.add(index, note);
}
System.out.println("Уже добавлена заметка [" + note + "]");
}
public void removeNote(int index) {
System.out.println("Сейчас будет удалена заметка с позиции " + index);
synchronized (notes) {
String note = notes.remove(index);
System.out.println("Уже удалена заметка [" + note + "] с позиции " + index);
}
}
}
}
| [
"8432hm@gmail.com"
] | 8432hm@gmail.com |
bd4e84aa1f8927866ea94c938003df7f0db8607c | 1626631d76a5b001d1145f863ac69163aadc566f | /src/main/java/com/bank/project/demo/repository/ConfirmationTokenRepository.java | db44a34696b6c97184c28be593e5f76ea24c62f5 | [] | no_license | DarrenMannuela/BankProject_OOP | 26f2cbd9ce3a6326401d5be374a86f6de53aa840 | 0712e97a1a187544b65b3297c7748ad7ffb87393 | refs/heads/master | 2023-05-30T22:07:56.019636 | 2021-06-21T04:29:43 | 2021-06-21T04:29:43 | 378,805,454 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,342 | java | package com.bank.project.demo.repository;
import com.bank.project.demo.entity.ConfirmationToken;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import javax.transaction.Transactional;
import java.time.LocalDateTime;
import java.util.Optional;
//A specified annotation of the @Component annotation that allows the capability to encapsulating storage, retrieval,
// and search behaviour which emulates a collection of objects
@Repository
//The interface extends to JpaRepository to access the full API of CrudRepository and PagingAndSortingRepository.
public interface ConfirmationTokenRepository extends JpaRepository<ConfirmationToken, Long>
{
//Method to find token
Optional<ConfirmationToken> findByToken(String token);
//The @Transactional, @Modifying and @Query allows the methods to be called during runtime and update the data of the token entity
@Transactional
@Modifying
@Query("UPDATE ConfirmationToken c " +
"SET c.confirmedAt = ?2 " +
"WHERE c.token = ?1")
//Updates the data of the ConfirmedAt of a token entity within the database
void updateConfirmedAt(String token, LocalDateTime now);
}
| [
"70499659+DarrenMannuela@users.noreply.github.com"
] | 70499659+DarrenMannuela@users.noreply.github.com |
e7121ef0bda4929ca94ff45a83c5790f310e8208 | 37ff5b3747557b584ff8285ac66a58c96672e5cf | /src/java/com/third/autoloan/beans/LogBean.java | ebdfab6fc46ea39b37ddc7e01e88792c0220cd1d | [] | no_license | dengjunwen/carloan | d5ab9f3cfaf1a4c837b08bcf6d870c2392ec1afc | a3d07166796eaa6c8c8a93779d95f24d71c60837 | refs/heads/master | 2021-04-15T04:09:11.869050 | 2018-01-15T07:53:52 | 2018-01-15T07:53:52 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,154 | java | package com.third.autoloan.beans;
import java.io.Serializable;
import java.util.Date;
//日志类
public class LogBean implements Serializable {
/**
*
*/
private static final long serialVersionUID = -3397421640685680387L;
private long id;
private Date loginDate;//用户登陆时间
private String userName;//登陆用户名
private Date exitDate;//用户退出时间
public LogBean() {
super();
// TODO Auto-generated constructor stub
}
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public Date getLoginDate() {
return loginDate;
}
public void setLoginDate(Date loginDate) {
this.loginDate = loginDate;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public Date getExitDate() {
return exitDate;
}
public void setExitDate(Date exitDate) {
this.exitDate = exitDate;
}
@Override
public String toString() {
return "LogBean [id=" + id + ", loginDate=" + loginDate + ", userName=" + userName + ", exitDate=" + exitDate
+ "]";
}
}
| [
"scyshou@live.com"
] | scyshou@live.com |
f9932ad663f3c25be2b86aba3a9560a40103a56c | 90d097b1a291d0e3c83397c636197b1777063ac0 | /src/main/java/com/IMeeting/entity/Depart.java | e01a4d166fa7cdbf422fe0c7eaa533053467b7a2 | [] | no_license | Gjw11/IMeeting-server | 32db45189aff7b5d5b275b2499d4cc24c71a5af1 | 75a85156441ee0d2d337bd9129641eb408b45a9d | refs/heads/master | 2022-07-04T20:02:32.239665 | 2019-05-21T12:18:17 | 2019-05-21T12:18:17 | 249,191,707 | 0 | 0 | null | 2022-06-17T02:59:59 | 2020-03-22T13:41:49 | Java | UTF-8 | Java | false | false | 707 | java | package com.IMeeting.entity;
import javax.persistence.*;
/**
* Created by gjw on 2018/11/18.
*/
@Entity
@Table(name = "u_depart")
public class Depart {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String name;
private Integer tenantId;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Integer getTenantId() {
return tenantId;
}
public void setTenantId(Integer tenantId) {
this.tenantId = tenantId;
}
}
| [
"358641273@qq.com"
] | 358641273@qq.com |
c1502b478b9b77f4f6486f3d7fa566a99512fead | 3fe33e937c16bca3e354ac8ca479b5c31e734a46 | /app/src/main/java/akkela/voca/SpeakOut.java | 84c531f883bc35af99f918bbfa08f18635479a9f | [] | no_license | AkKeLa/Voca | 83273a882d869358397f81493c2311b56b20e872 | 69204aa63a3d48f1923ebb22e61c30707f0a5c1f | refs/heads/master | 2020-04-08T02:02:14.891333 | 2015-01-17T14:51:35 | 2015-01-17T14:51:35 | 29,394,142 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,331 | java | package akkela.voca;
import android.content.Intent;
import android.support.v7.app.ActionBarActivity;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;
public class SpeakOut extends ActionBarActivity {
int id;
ArrayList arrAsk=new ArrayList();
ArrayList arrAnsw=new ArrayList();
InputStream input;
Intent intent;
String modTitle;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_speak_out);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_speak_out, menu);
return true;
}
@Override
public boolean onOptionsItemSelected(MenuItem item) {
int id = item.getItemId();
switch (id){
case R.id.menu_DriveUp:
intent = new Intent(this, DriveUp.class);
startActivity(intent);
break;
case R.id.menu_SpeakOut:
intent = new Intent(this, SpeakOut.class);
startActivity(intent);
break;
case R.id.menu_exit:
Intent i = new Intent(Intent.ACTION_MAIN);
i.addCategory(Intent.CATEGORY_HOME);
startActivity(i);
break;
}
return super.onOptionsItemSelected(item);
}
public void onBtnClick(View view){
switch (view.getId()){
case R.id.Speakout6:
input = getResources().openRawResource(R.raw.speakout6);
modTitle="Speakоut 6.";
startTest();
break;
case R.id.Speakout9:
input = getResources().openRawResource(R.raw.speakout9);
modTitle="Speakоut 9.";
startTest();
break;
case R.id.Speakout10:
input = getResources().openRawResource(R.raw.speakout10);
modTitle="Speakоut 10.";
startTest();
break;
case R.id.Speakout1:
input = getResources().openRawResource(R.raw.speakout1);
modTitle="Speakоut 1.";
startTest();
break;
case R.id.Speakout2:
input = getResources().openRawResource(R.raw.speakout2);
modTitle="Speakоut 2.";
startTest();
break;
case R.id.Speakout3:
input = getResources().openRawResource(R.raw.speakout3);
modTitle="Speakоut 3.";
startTest();
break;
case R.id.Speakout4:
input = getResources().openRawResource(R.raw.speakout4);
modTitle="Speakоut 4.";
startTest();
break;
case R.id.Speakout5:
input = getResources().openRawResource(R.raw.speakout5);
modTitle="Speakоut 5.";
startTest();
break;
case R.id.Speakout7:
input = getResources().openRawResource(R.raw.speakout7);
modTitle="Speakоut 7.";
startTest();
break;
}
}
public void startTest(){
Scanner scanner = new Scanner(input).useDelimiter("\\A");
String string = scanner.hasNext() ? scanner.next() : null;
scanner.close();
ArrayList<String> arrline = new ArrayList<String>(Arrays.asList(string.split("[\r\n]+")));
Collections.shuffle(arrline);
if (arrline.size()>0){
String split[];
for (int i=0; i<arrline.size();i++){
split=arrline.get(i).split(":");
if(split.length==2){
arrAsk.add(split[0]);
arrAnsw.add(split[1]);
}
}
}
intent = new Intent(this, test.class);
intent.putExtra("ask",arrAsk);
intent.putExtra("answ",arrAnsw);
intent.putExtra("modTitle",modTitle);
startActivity(intent);
}
}
| [
"ehajrow@gmail.com"
] | ehajrow@gmail.com |
78b58bb0d85595f01fccf60ed12c0d2d53e64574 | 0fa6047ea37f3bf407b6a9876674e0504f448f66 | /workspace/school/src/com/school/step13/ThreadMain.java | 26c5625150d432c9f61e8139feaf7164c1ec8f72 | [] | no_license | durtchrt/basic_study | ed4a29394b3013133b5cbb540905810e4bc37c66 | 30fd855eb997aa489812b0b5283addc685ead672 | refs/heads/master | 2021-01-21T15:31:07.344413 | 2015-06-13T08:36:39 | 2015-06-13T08:36:39 | 95,392,085 | 0 | 0 | null | 2017-06-25T23:47:47 | 2017-06-25T23:47:47 | null | UTF-8 | Java | false | false | 270 | java | package com.school.step13;
public class ThreadMain {
public static void main(String[] args) {
Thread mp3Thread = new Thread(new Mp3Runnable());
Thread timeThread = new Thread(new TimeRunnable());
mp3Thread.start();
timeThread.start();
mp3Thread.run();
}
}
| [
"boojongmin@gmail.com"
] | boojongmin@gmail.com |
b3c1616600a1d1d50ba3fb99baf53c6edba77344 | bfc7a4cda00a0b89d4b984c83976770b0523f7f5 | /OA/JavaSource/com/icss/oa/filetransfer/handler/AttachHelper.java | accd309901af7c5b8a73d95cbaf986957ee21894 | [] | no_license | liveqmock/oa | 100c4a554c99cabe0c3f9af7a1ab5629dcb697a6 | 0dfbb239210d4187e46a933661a031dba2711459 | refs/heads/master | 2021-01-18T05:02:00.704337 | 2015-03-03T06:47:30 | 2015-03-03T06:47:30 | 35,557,095 | 0 | 1 | null | 2015-05-13T15:26:06 | 2015-05-13T15:26:06 | null | UTF-8 | Java | false | false | 817 | java | /*
* Created on 2004-5-10
*
* To change the template for this generated file go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
package com.icss.oa.filetransfer.handler;
import com.icss.oa.util.CommUtil;
/**
* @author Administrator
*
* To change the template for this generated type comment go to
* Window>Preferences>Java>Code Generation>Code and Comments
*/
public class AttachHelper {
public static String getFileSize(long size) {
StringBuffer filesize = new StringBuffer();
if (size == 0) {
filesize.append("0.0 MB");
} else if (size < 10240) {
filesize.append("< 0.01 MB");
} else {
filesize.append(CommUtil.getDivision(size, 1024 * 1024, 2));
filesize.append(" MB");
}
return filesize.toString();
}
}
| [
"peijn1026@gmail.com"
] | peijn1026@gmail.com |
266d2916e83bff16cc2bc6cbc52dc7c2825d3cfc | a0a8d544d109fbcb7a70ba8f1340fd73f1672ca8 | /trading/src/main/java/com/fluent/framework/persistence/InChroniclePersisterService.java | ecae286cdb49557e656738eca2cd271e93e42a5c | [] | no_license | CoderFromCasterlyRock/FluentFramework | ca6e4a8cc0f3bc835d0819e8d4cf516090869b11 | 2faa3e744d03065ea2e72f32c2338ca3245f297f | refs/heads/master | 2021-01-21T21:47:26.131843 | 2016-03-21T03:24:50 | 2016-03-21T03:24:50 | 26,199,000 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,399 | java | package com.fluent.framework.persistence;
import net.openhft.chronicle.*;
import net.openhft.chronicle.ChronicleQueueBuilder.IndexedChronicleQueueBuilder;
import net.openhft.chronicle.tools.*;
import org.slf4j.*;
import uk.co.real_logic.agrona.concurrent.*;
import java.io.*;
import java.util.*;
import com.fluent.framework.collection.*;
import com.fluent.framework.core.*;
import com.fluent.framework.events.in.*;
import static com.fluent.framework.util.FluentToolkit.*;
import static com.fluent.framework.util.FluentUtil.*;
//@formatter:off
public final class InChroniclePersisterService implements Runnable, FluentInListener, PersisterService<FluentInEvent>{
private volatile boolean keepDispatching;
private final int eventCount;
private final int queueSize;
private final String basePath;
private final Chronicle chronicle;
private final ExcerptAppender excerpt;
private final FluentSingleThreadExecutor service;
private final OneToOneConcurrentArrayQueue<FluentInEvent> eventQueue;
private final static int DEFAULT_SIZE = MILLION;
private final static String NAME = InChroniclePersisterService.class
.getSimpleName( );
private final static Logger LOGGER = LoggerFactory.getLogger( NAME );
// AlgoConfigManager cfgManager
public InChroniclePersisterService( FluentConfigManager cfgManager ) throws FluentException{
this( DEFAULT_SIZE, "" );
}
public InChroniclePersisterService( int eventCount, String basePath ) throws FluentException{
this( eventCount, eventCount, basePath );
}
public InChroniclePersisterService( int eventCount, int queueSize, String basePath ) throws FluentException{
this.eventCount = eventCount;
this.queueSize = nextPowerOfTwo( queueSize );
this.basePath = basePath;
this.chronicle = createChronicle( eventCount, basePath );
this.excerpt = createAppender( );
this.eventQueue = new OneToOneConcurrentArrayQueue<>( eventCount );
this.service = new FluentSingleThreadExecutor( new FluentThreadFactory( "Persister" ) );
}
@Override
public final String name( ) {
return NAME;
}
@Override
public final boolean isSupported( FluentInType type ) {
return (FluentInType.WARM_UP_EVENT != type);
}
public final int getEventCount( ) {
return eventCount;
}
public final int getQueueSize( ) {
return queueSize;
}
public final ExcerptAppender createAppender( ) throws FluentException {
try{
return chronicle.createAppender( );
}catch( IOException e ){
throw new FluentException( e );
}
}
private final void prime( ) {
for( int i = ZERO; i < (eventCount); i++ ){
eventQueue.offer( IN_WARMUP_EVENT );
eventQueue.poll( );
}
ChronicleTools.warmup( );
eventQueue.clear( );
}
@Override
public final void start( ) {
keepDispatching = true;
prime( );
service.start( );
service.execute( this );
LOGGER.info( "Started In-Persister for [{}] events.{}", eventCount, NEWLINE );
}
@Override
public final boolean inUpdate( FluentInEvent event ) {
return eventQueue.offer( event );
}
protected static Chronicle createChronicle( int eventCount, String basePath ) {
Chronicle chronicle = null;
try{
chronicle = IndexedChronicleQueueBuilder.indexed( basePath )
// .dataBlockSize(128)
// .indexBlockSize(128)
.build( );
}catch( Exception e ){
throw new IllegalStateException( "Failed to create Chronicle at " + basePath, e );
}
return chronicle;
}
@Override
public final void run( ) {
while( keepDispatching ){
process( );
}
}
protected final void process( ) {
try{
FluentInEvent event = eventQueue.poll( );
if( event == null ){
FluentBackoffStrategy.apply( ONE );
return;
}
persist( event );
}catch( Exception e ){
LOGGER.warn( "Failed to persist event.", e );
}
}
// TODO: Replace it with the upper bound of object size we expect to save in bytes
protected final boolean persist( FluentInEvent event ) {
boolean successful = false;
try{
excerpt.startExcerpt( 500 );
excerpt.writeObject( event );
excerpt.finish( );
successful = true;
}catch( Exception e ){
LOGGER.warn( "FAILED to journal event [{}].", event, e );
}
return successful;
}
@Override
public final List<FluentInEvent> retrieveAll( ) {
ExcerptTailer reader = null;
List<FluentInEvent> list = new ArrayList<>( eventCount );
try{
reader = chronicle.createTailer( );
while( reader.nextIndex( ) ){
FluentInEvent event = (FluentInEvent) reader.readObject( );
list.add( event );
reader.finish( );
}
LOGGER.info( "Retrieved [{}] events from the Journal [{}].", list.size( ), basePath );
}catch( Exception e ){
LOGGER.warn( "FAILED to retrieve events from the Journal [{}].", basePath, e );
}finally{
if( reader != null )
reader.close( );
}
return list;
}
@Override
public final void stop( ) {
try{
keepDispatching = false;
excerpt.close( );
chronicle.close( );
service.shutdown( );
LOGGER.info( "Successfully stopped chronicle." );
}catch( Exception e ){
LOGGER.warn( "FAILED to stop chroncile.", e );
}
}
}
| [
"vic.singh31@gmail.com"
] | vic.singh31@gmail.com |
46f76432d842e96d0090dd38bd2b877ac38f5b86 | 2d0c06fa893edd46f58bd8d35f45aad60fffce3e | /StudySpacesApp/src/com/pennstudyspaces/api/ApiRequest.java | e932c60dbef0289147bcf66a77cebd42e61a31df | [
"Apache-2.0"
] | permissive | DanGe42/StudySpaces | f2dd9be23aa7532a20f6d207daccf2d58fd31dcb | 8c40e6fe2f63e890abb3f94cf870c5b382c38596 | refs/heads/master | 2021-01-22T06:53:50.928397 | 2012-07-13T06:40:00 | 2012-07-13T06:40:00 | 3,417,936 | 1 | 1 | null | null | null | null | UTF-8 | Java | false | false | 183 | java | package com.pennstudyspaces.api;
public interface ApiRequest {
public static final String API_URL = "http://www.pennstudyspaces.com/api?";
public String createRequest();
}
| [
"dange@seas.upenn.edu"
] | dange@seas.upenn.edu |
fe3ee3135953ecd9e1f3ca6837e44e76cf37cf88 | 29ae79da83d862f515119beb894bf1472a02fa07 | /hrms/src/main/java/com/kodlamaio/hrms/entities/concretes/CandidateUserCVSchool.java | 0c0c1c24748933f0ca747f786f1529e85192a4a2 | [] | no_license | csametsahin/hrms | 84acd3def790fb1a9181f62659a975ec552437fc | 90e4d40e070ed0153ee356505ecc123e5d8171c8 | refs/heads/master | 2023-05-14T16:47:37.371573 | 2021-06-02T16:52:10 | 2021-06-02T16:52:10 | 371,324,018 | 3 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,267 | java | package com.kodlamaio.hrms.entities.concretes;
import java.time.LocalDate;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
@Table(name="cv_school")
@Entity
@JsonIgnoreProperties({"hibernateLazyInitializer" ,"handler","userCv" })
public class CandidateUserCVSchool {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name="cv_school_id")
private int id;
@Column(name="school_name")
private String schoolName;
@Column(name="department_name")
private String departmentName;
@Column(name="start_year")
private LocalDate startYear;
@Column(name="end_year" , columnDefinition = "varchar(255) default 'Devam Ediyor'")
private LocalDate endYear;
@OneToMany(mappedBy = "school", cascade = CascadeType.ALL)
private List<CandidateUserCV> userCv;
}
| [
"USER@DESKTOP-6A30JS1"
] | USER@DESKTOP-6A30JS1 |
4f461ea12e44526536c90e54c4a3cc007a6e18fd | af4efbed1c626a219287b7e908ab1eb33d13dcf5 | /src/main/java/uk/ac/ebi/pride/toolsuite/mzgraph/psm/noise/ASANoiseFilter.java | 0ad09b6e372d1f814b44819c0b7d7f88a8dd9499 | [
"Apache-2.0"
] | permissive | PRIDE-Toolsuite/inspector-mzgraph-browser | 216e639817459242097681ff5473902f2225cb3c | 92fa61c1648ff0e7f97e6a26ec4aa8ba3bcf1178 | refs/heads/master | 2021-01-22T07:11:11.384811 | 2016-12-13T15:44:32 | 2016-12-13T15:44:32 | 23,567,641 | 3 | 1 | null | 2016-02-02T19:36:36 | 2014-09-02T06:29:51 | Java | UTF-8 | Java | false | false | 8,219 | java | package uk.ac.ebi.pride.toolsuite.mzgraph.psm.noise;
import uk.ac.ebi.pride.utilities.iongen.model.Peak;
import uk.ac.ebi.pride.utilities.iongen.model.PeakSet;
import uk.ac.ebi.pride.toolsuite.mzgraph.chart.graph.MzGraphConstants;
import uk.ac.ebi.pride.toolsuite.mzgraph.gui.data.ExperimentalFragmentedIonsTableModel;
import uk.ac.ebi.pride.toolsuite.mzgraph.psm.NoiseFilter;
import java.util.Arrays;
/**
* Get from pride-asa-pipeline project.
* https://code.google.com/p/pride-asa-pipeline/
*
* Creator: Qingwei-XU
* Date: 02/11/12
*/
public class ASANoiseFilter implements NoiseFilter {
private double calcSum(double[] values) {
if (values == null) {
throw new IllegalArgumentException("Can not calculate sum of null!");
}
double sum = 0D;
for (double d : values) {
sum += d;
}
return sum;
}
private double calculateMean(double[] values) {
if (values == null) {
throw new IllegalArgumentException("Can not calculate mean of null!");
}
return (calcSum(values) / values.length);
}
private double calcVariance(double[] values, double mean) {
double squares = 0D;
for (double value : values) {
squares += Math.pow((value - mean), 2);
}
return squares / (double) values.length;
}
private double calculateMedian(double[] values) {
if (values == null || values.length == 0) {
throw new IllegalArgumentException("Can not calculate median of null or empty array!");
}
// if there is only one value, then it automatically is the median
if (values.length == 1) {
return values[0];
}
double result; // the median we are going to calculate
Arrays.sort(values);
int middle = values.length / 2; // determine the middle of the list
if (values.length % 2 == 0) { // even number of elements (middle is between two values)
// build the average between the two values next to the middle
result = (values[middle] + values[middle - 1]) / 2d;
} else { // uneven number of elements (middle is one value of the list)
result = values[middle];
}
return result;
}
private double min(double[] doubles) {
if (doubles == null || doubles.length == 0) {
throw new NullPointerException("array is null!");
}
double min = doubles[0];
for (int i = 1; i < doubles.length; i++) {
min = Math.min(min, doubles[i]);
}
return min;
}
private double max(double[] doubles) {
if (doubles == null || doubles.length == 0) {
throw new NullPointerException("array is null!");
}
double max = doubles[0];
for (int i = 1; i < doubles.length; i++) {
max = Math.max(max, doubles[i]);
}
return max;
}
/**
* There are different 3 spectrum scenarios this noise threshold finder considers:
* 1. a spectrum with few signal peaks compared to the noisepeaks
* 2. a spectrum consisting out of signal peaks only
* 3. a spectrum consisting out of noise peaks only
*
* @param signalValues the double array of signal values
* @return the double threshold value
*/
private double findNoiseThreshold(double[] signalValues) {
double noiseThreshold;
//calculate mean and standard deviation
double mean = calculateMean(signalValues);
double standardDeviation = Math.sqrt(calcVariance(signalValues, mean));
//first use a winsonrisation approach (with the preset configuration) to find
//the noise treshold for the privided signal values.
double[] winsorisedValues = winsorise(signalValues);
double winsorisedMedian = calculateMedian(winsorisedValues);
double winsorisedMean = calculateMean(winsorisedValues);
double winsorisedStandardDeviation = Math.sqrt(calcVariance(winsorisedValues, winsorisedMean));
//check if the winsorised mean to mean ratio exceeds a given threshold
double meanRatio = ((winsorisedMean - 0.0) < 0.001) ? 0.0 : winsorisedMean / mean;
// double standardDeviationRatio = ((winsorisedStandardDeviation - 0.0) < 0.001) ? 0.0 : winsorisedStandardDeviation / standardDeviation;
if (meanRatio < MzGraphConstants.ASA_MEAN_RATIO_THRESHOLD) {
//scenario 1, the winsorisation has significantly decreased the mean
//calculate the noise threshold for the spectrum (based on the winsorisation result)
noiseThreshold = winsorisedMedian + MzGraphConstants.ASA_OUTLIER_LIMIT * winsorisedStandardDeviation;
} //scenario 2 or 3
//to make a distinction between the only signal or only noise spectrum, check the peak density
else {
double minimumValue = min(signalValues);
double maximumValue = max(signalValues);
//peak density: number of peaks / dalton
double density = signalValues.length / (maximumValue - minimumValue);
if (density < MzGraphConstants.ASA_DENSITY_THRESHOLD) {
//scenario 2
noiseThreshold = Math.max(mean - (1.5 * standardDeviation), 0.0);
} else {
//scenario 3
noiseThreshold = mean + 1.5 * standardDeviation;
}
}
return noiseThreshold;
}
private double[] winsorise(double[] signalValues) {
double median = calculateMedian(signalValues);
double currMAD = calcIntensityMAD(signalValues, median);
double prevMAD = 3d * currMAD; //initial start value
double[] correctedIntensities = new double[signalValues.length];
while (((prevMAD - currMAD) / prevMAD) >= MzGraphConstants.ASA_CONVERGENCE_CRITERIUM) {
correctedIntensities = reduceOutliers(signalValues, median + (MzGraphConstants.ASA_WINSORISATION_CONSTANT * currMAD));
prevMAD = currMAD;
currMAD = calcIntensityMAD(correctedIntensities, median);
}
return correctedIntensities;
}
private double calcIntensityMAD(double[] values, double median) {
double[] diffs = new double[values.length];
int cnt = 0;
for (double p : values) {
diffs[cnt++] = (Math.abs(p - median));
}
return calculateMedian(diffs);
}
private double[] reduceOutliers(double[] intensities, double maxIntensityLimit) {
double[] correctedIntensities = new double[intensities.length];
//sets all the values above the limit (outliers) to the limit
//and therefore effectively eliminating outliers
for (int i = 0; i < intensities.length; i++) {
if (intensities[i] <= maxIntensityLimit) {
correctedIntensities[i] = intensities[i];
} else {
correctedIntensities[i] = maxIntensityLimit;
}
}
return correctedIntensities;
}
@Override
public PeakSet filterNoise(PeakSet peaks, ExperimentalFragmentedIonsTableModel tableModel) {
if (peaks == null) {
return null;
}
if (peaks.size() == 0) {
return peaks;
}
double experimentalPrecursorMass = tableModel.getPrecursorIon().getMassOverCharge();
double threshold = findNoiseThreshold(peaks.getIntensityArray());
PeakSet result = new PeakSet();
double intensity;
double mz;
double lower = experimentalPrecursorMass - MzGraphConstants.ASA_PRECURSOR_MASS_WINDOW;
double upper = experimentalPrecursorMass + MzGraphConstants.ASA_PRECURSOR_MASS_WINDOW;
for (Peak peak : peaks) {
//add the peak to the peak list if the peak intensity > threshold
// and if the MZ ratio is not in 18D range of experimental precursor mass
intensity = peak.getIntensity();
mz = peak.getMz();
if (intensity >= threshold && !(lower < mz && mz < upper)) {
result.add(peak);
}
}
return result;
}
}
| [
"ypriverol@gmail.com"
] | ypriverol@gmail.com |
8c6d8496aa60625e866ad8758ee5939da662fe76 | 1202747e1519244e502975d2f7d574ac7f5f19e6 | /src/main/java/com/ktsco/models/csr/DepositModel.java | 34f25bbc1077cf6b61c174718b290bfbe505197a | [] | no_license | shokriyan/ktsco | 31f1b6167945bf647c2bf4acfb0129f150081b59 | c1281e0ac063b46c7bd1f331ad2216e4f999044e | refs/heads/master | 2022-07-15T21:13:07.677106 | 2020-05-24T23:09:33 | 2020-05-24T23:09:33 | 194,761,276 | 0 | 0 | null | 2021-12-14T21:26:27 | 2019-07-02T00:41:16 | Java | UTF-8 | Java | false | false | 2,026 | java | package com.ktsco.models.csr;
import java.text.DecimalFormat;
import javafx.beans.property.SimpleIntegerProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.scene.control.CheckBox;
public class DepositModel {
private static DecimalFormat decimalFormat = new DecimalFormat("###,###.###");
private SimpleIntegerProperty receiveID;
private SimpleIntegerProperty billID;
private SimpleStringProperty currency;
private SimpleStringProperty amount;
private CheckBox select;
public DepositModel (int receiveID, int billID, String currency, double amount) {
this.receiveID = new SimpleIntegerProperty(receiveID);
this.billID = new SimpleIntegerProperty(billID);
this.currency = new SimpleStringProperty(currency);
this.amount = new SimpleStringProperty(String.valueOf(decimalFormat.format(amount)));
this.select = new CheckBox();
}
public SimpleIntegerProperty receiveIDProperty() {
return this.receiveID;
}
public int getReceiveID() {
return this.receiveIDProperty().get();
}
public void setReceiveID(final int receiveID) {
this.receiveIDProperty().set(receiveID);
}
public SimpleIntegerProperty billIDProperty() {
return this.billID;
}
public int getBillID() {
return this.billIDProperty().get();
}
public void setBillID(final int billID) {
this.billIDProperty().set(billID);
}
public SimpleStringProperty currencyProperty() {
return this.currency;
}
public String getCurrency() {
return this.currencyProperty().get();
}
public void setCurrency(final String currency) {
this.currencyProperty().set(currency);
}
public SimpleStringProperty amountProperty() {
return this.amount;
}
public String getAmount() {
return this.amountProperty().get().replace(",", "");
}
public void setAmount(final double amount) {
this.amountProperty().set(String.valueOf(decimalFormat.format(amount)));
}
public CheckBox getSelect() {
return select;
}
public void setSelect(CheckBox select) {
this.select = select;
}
}
| [
"shokriyan@Mohammads-MacBook-Pro.local"
] | shokriyan@Mohammads-MacBook-Pro.local |
af2dcb7cfd2e30782a370c996c972e79634dc318 | e2a227496f4aa897a9b7c2c5fcfef7dc2dfafc8d | /ConditionalStatementsAdvanced/src/WorkingHours.java | 9411035a4af7a560440d2dee3bb40e647699102d | [] | no_license | rkosakov/PB-Java | 659ed3d60bb3e56339f5aa718ac1ecc7fe505141 | 63e100f76064d66cc42499b2cdeba1cfab5541e2 | refs/heads/main | 2023-03-27T02:25:33.697837 | 2021-03-30T12:43:57 | 2021-03-30T12:43:57 | 352,997,575 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 483 | java | import java.util.Scanner;
public class WorkingHours {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int hour = Integer.parseInt(scan.nextLine());
String day = scan.nextLine();
if (day.equals("Sunday")){
System.out.println("closed");
} else if (hour >= 10 && hour <= 18 ) {
System.out.println("open");
} else {
System.out.println("closed");
}
}
}
| [
"rosen.kosakov@outlook.com"
] | rosen.kosakov@outlook.com |
162a31cc1cc7569392eb44ff93cc40e8224f76de | 4e9f55726330c262c2d9e36975ab981e722ec32a | /app/src/main/java/in/semicolonindia/parentcrm/beans/SyllabusNames.java | aabd2c94dc8155448327f848e3b79de54b47660a | [] | no_license | ranjansingh1991/ParentCRM | 77cbc4ccf1c199a1419b771611307774f2b375aa | 7f3304484b9b92c4db9b848acedcb7b2abdf7d04 | refs/heads/master | 2020-04-28T00:39:58.453073 | 2019-03-10T13:04:51 | 2019-03-10T13:04:51 | 174,824,306 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,574 | java | package in.semicolonindia.parentcrm.beans;
/**
* Created by Rupesh on 06-08-2017.
*/
@SuppressWarnings("ALL")
public class SyllabusNames {
private String sTitle;
private String sSubject;
private String sUploader;
private String sDate;
private String sFile;
private String sDesp;
public SyllabusNames(String sTitle, String subject_name, String uploader_type, String year,
String file_name, String description) {
this.sTitle = sTitle;
this.sSubject = subject_name;
this.sUploader = uploader_type;
this.sDate = year;
this.sFile = file_name;
this.sDesp = description;
}
public SyllabusNames(String title) {
}
public String getTitle() {
return sTitle;
}
public void setTitle(String sTitle) {
this.sTitle = sTitle;
}
public String getSubject() {
return sSubject;
}
public void setSubject(String sSubject) {
this.sSubject = sSubject;
}
public String getUploader() {
return sUploader;
}
public void setUploader(String sClass) {
this.sUploader = sClass;
}
public String getDate() {
return sDate;
}
public void setDate(String sDate) {
this.sDate = sDate;
}
public String getFile() {
return sFile;
}
public void setFile(String sFile) {
this.sFile = sFile;
}
public String getDesp() {
return sDesp;
}
public void setDesp(String sDesp) {
this.sDesp = sDesp;
}
} | [
"ranjansingh1991"
] | ranjansingh1991 |
0d84df84ab9e34d714593f4bf6178fc7a5fc1844 | 9768c03271577f1b515253cd39e25dd62c0303e8 | /FSCMS/src/main/java/fscms/mods/push/service/PushService.java | 7c7e7fd977c49f07270c9ac31d397eb7ef5f9d49 | [] | no_license | sstrov/bike2020 | 4fd07e2683473b3c6d827eb34aa8ac9f590447df | f09b3c42f51ecd21b1f536636661106d99202d00 | refs/heads/master | 2022-11-29T02:18:47.216792 | 2020-08-11T11:01:50 | 2020-08-11T11:01:50 | 286,677,681 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 814 | java | package fscms.mods.push.service;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import fscms.mods.push.vo.PushSearchVO;
import fscms.mods.push.vo.PushVO;
public interface PushService {
int selectTCount(PushSearchVO searchVO) throws Exception;
List<PushVO> selectPageList(PushSearchVO searchVO) throws Exception;
PushVO selectObj(PushVO pushVO) throws Exception;
void insertInfo(HttpServletRequest request, PushVO vo, String uniqueId, String mngrId) throws Exception;
void updateInfo(HttpServletRequest request, String bfData, PushVO vo, String uniqueId, String mngrId) throws Exception;
void deleteInfo(HttpServletRequest request, String bfData, PushVO item, String mngrId) throws Exception;
int selectMaxPushSn(PushVO pushVO) throws Exception;
}
| [
"me@DESKTOP-CTNRMB6"
] | me@DESKTOP-CTNRMB6 |
061e662ddbc8e410d46b3f8caa1755f489087775 | 3d4ac816aa4a0d30f06dddafe7422ac3df81d7b1 | /mscx-shop-pojo/src/main/java/com/liferunner/dto/IndexProductDTO.java | f5a3d5771ecc005d24c5bad867c9dbb392e73f1c | [] | no_license | lyc88/expensive-shop | 7062b1b7558e53a16ae94cb5add60699b7938173 | b8e374e85145196bf3bd6bd5a99e521d3d12755b | refs/heads/master | 2020-09-18T19:25:10.896694 | 2019-11-26T09:01:49 | 2019-11-26T09:01:49 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 518 | java | package com.liferunner.dto;
import lombok.Data;
import lombok.ToString;
import java.util.List;
/**
* IndexProductDTO for : 首页推荐商品
*
* @author <a href="mailto:magicianisaac@gmail.com">Isaac.Zhang | 若初</a>
* @since 2019/11/15
*/
@Data
@ToString
public class IndexProductDTO {
private Integer rootCategoryId;
private String rootCategoryName;
private String slogan;
private String categoryImage;
private String bgColor;
private List<IndexProductItemDTO> productItemList;
}
| [
"zhangpan0614@126.com"
] | zhangpan0614@126.com |
0df93f14f14f9c1a76560668fc145169edd62973 | 6f73a0d38addee468dd21aba1d5d53963be84825 | /common/src/main/java/org/mifos/framework/persistence/SqlExecutor.java | bc54b49fe40986d6d4c8ce9a5c0e6254b23aed14 | [
"LicenseRef-scancode-unknown-license-reference",
"Apache-2.0"
] | permissive | mifos/1.4.x | 0f157f74220e8e65cc13c4252bf597c80aade1fb | 0540a4b398407b9415feca1f84b6533126d96511 | refs/heads/master | 2020-12-25T19:26:15.934566 | 2010-05-11T23:34:08 | 2010-05-11T23:34:08 | 2,946,607 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,716 | java | /*
* Copyright (c) 2005-2009 Grameen Foundation USA
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
* implied. See the License for the specific language governing
* permissions and limitations under the License.
*
* See also http://www.apache.org/licenses/LICENSE-2.0.html for an
* explanation of the license and how it is applied.
*/
package org.mifos.framework.persistence;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
import java.nio.charset.CharsetDecoder;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
/**
* Utility methods for running SQL from files
*/
@SuppressWarnings( { "PMD.CyclomaticComplexity", "PMD.AssignmentInOperand", "PMD.AppendCharacterWithChar",
"PMD.AvoidThrowingRawExceptionTypes", "PMD.DoNotThrowExceptionInFinally" })
public class SqlExecutor {
@edu.umd.cs.findbugs.annotations.SuppressWarnings(value = { "OBL_UNSATISFIED_OBLIGATION",
"SQL_NONCONSTANT_STRING_PASSED_TO_EXECUTE" }, justification = "The resource is closed and the string cannot be static.")
@SuppressWarnings("PMD.CloseResource")
// Rationale: It's closed.
public static void execute(InputStream stream, Connection conn) throws SQLException {
String[] sqls = readFile(stream);
boolean wasAutoCommit = conn.getAutoCommit();
// Entring: Set auto commit false if auto commit was true
if (wasAutoCommit) {
conn.setAutoCommit(false);
}
Statement statement = conn.createStatement();
for (String sql : sqls) {
statement.addBatch(sql);
}
statement.executeBatch();
statement.close();
// Leaving: Set auto commit true if auto commit was true
if (wasAutoCommit) {
conn.commit();
conn.setAutoCommit(true);
}
}
/**
* Closes the stream when done.
*
* @return individual statements
* */
@SuppressWarnings( { "PMD.CyclomaticComplexity", "PMD.AssignmentInOperand", "PMD.AppendCharacterWithChar",
"PMD.AvoidThrowingRawExceptionTypes", "PMD.DoNotThrowExceptionInFinally" })
// Rationale: If the Apache Ant team thinks it's OK, we do too. Perhaps bad
// reasoning, but inshallah.
public static String[] readFile(InputStream stream) {
// mostly ripped from
// http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/SQLExec.java
try {
ArrayList<String> statements = new ArrayList<String>();
Charset utf8 = Charset.forName("UTF-8");
CharsetDecoder decoder = utf8.newDecoder();
BufferedReader in = new BufferedReader(new InputStreamReader(stream, decoder));
StringBuffer sql = new StringBuffer();
String line;
while ((line = in.readLine()) != null) {
if (line.startsWith("//") || line.startsWith("--")) {
continue;
}
line = line.trim();
if ("".equals(line)) {
continue;
}
sql.append("\n");
sql.append(line);
// SQL defines "--" as a comment to EOL
// and in Oracle it may contain a hint
// so we cannot just remove it, instead we must end it
if (line.indexOf("--") >= 0) {
sql.append("\n");
}
if (sql.length() > 0 && sql.charAt(sql.length() - 1) == ';') {
statements.add(sql.substring(0, sql.length() - 1));
sql.setLength(0);
}
}
// Catch any statements not followed by ;
if (sql.length() > 0) {
statements.add(sql.toString());
}
return statements.toArray(new String[statements.size()]);
} catch (IOException e) {
throw new RuntimeException(e);
} finally {
try {
stream.close();
} catch (IOException e) {
throw new RuntimeException(e);
}
}
}
}
| [
"meonkeys@a8845c50-7012-0410-95d3-8e1449b9b1e4"
] | meonkeys@a8845c50-7012-0410-95d3-8e1449b9b1e4 |
7cc14a5e80ff512f4c93299b60c8556e7caf13ab | 3ef55e152decb43bdd90e3de821ffea1a2ec8f75 | /large/module2006_internal/src/java/module2006_internal/a/Foo0.java | 0a3e37e3fc20def35fd89569d6b0b77e9f642282 | [
"BSD-3-Clause"
] | permissive | salesforce/bazel-ls-demo-project | 5cc6ef749d65d6626080f3a94239b6a509ef145a | 948ed278f87338edd7e40af68b8690ae4f73ebf0 | refs/heads/master | 2023-06-24T08:06:06.084651 | 2023-03-14T11:54:29 | 2023-03-14T11:54:29 | 241,489,944 | 0 | 5 | BSD-3-Clause | 2023-03-27T11:28:14 | 2020-02-18T23:30:47 | Java | UTF-8 | Java | false | false | 1,288 | java | package module2006_internal.a;
import javax.management.*;
import javax.naming.directory.*;
import javax.net.ssl.*;
/**
* Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut
* labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum.
* Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.
*
* @see java.util.logging.Filter
* @see java.util.zip.Deflater
* @see javax.annotation.processing.Completion
*/
@SuppressWarnings("all")
public abstract class Foo0<E> implements module2006_internal.a.IFoo0<E> {
javax.lang.model.AnnotatedConstruct f0 = null;
javax.management.Attribute f1 = null;
javax.naming.directory.DirContext f2 = null;
public E element;
public static Foo0 instance;
public static Foo0 getInstance() {
return instance;
}
public static <T> T create(java.util.List<T> input) {
return null;
}
public String getName() {
return element.toString();
}
public void setName(String string) {
return;
}
public E get() {
return element;
}
public void set(Object element) {
this.element = (E)element;
}
public E call() throws Exception {
return (E)getInstance().call();
}
}
| [
"gwagenknecht@salesforce.com"
] | gwagenknecht@salesforce.com |
c052272396932c5e4f248280e1bd81f097136f0e | 78fe25ca9f0a49179da596adc4d8fc3ffc504440 | /쌍용JavaSW_class/jdbc/day0310/UseInsertProcedure.java | f3a1c7d2d14c41a46bbc0beb5b57bde123b9b6e4 | [] | no_license | Juliana0324/JulianaJang | 28998dc357ffaa60bde3c5d9e235fa683701c8be | 8b3a4e937a3f4846d8ef5f7273dd1b4e11694692 | refs/heads/master | 2022-12-22T01:04:12.416104 | 2022-05-25T08:17:01 | 2022-05-25T08:17:01 | 249,957,654 | 2 | 1 | null | 2022-12-16T01:07:05 | 2020-03-25T11:14:38 | JavaScript | UHC | Java | false | false | 1,651 | java | package day0310;
import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Types;
import java.util.List;
import kr.co.sist.dao.DbConnection;
/**insert 쿼리를 가지고 있는 프로시져의 사용
* @author user
*
*/
public class UseInsertProcedure {
public ResultVO useInsertProcedure(ProcedureVO pVO) throws SQLException{
ResultVO rVO = null;
Connection conn = null;
CallableStatement cstmt =null;
DbConnection dc = DbConnection.getInstance();
try {
conn=dc.getConn();
cstmt= conn.prepareCall("{call insert_test_proc(?,?,?,?,?,?)}");
cstmt.setInt(1, pVO.getNum());
cstmt.setString(2, pVO.getName());
cstmt.setString(3, pVO.getEmail());
cstmt.setInt(4, pVO.getAge());
//outPara
cstmt.registerOutParameter(5, Types.NUMERIC);
cstmt.registerOutParameter(6, Types.VARCHAR);
cstmt.execute();
//6. out parameter에 저장된 값 얻기
rVO=new ResultVO();
rVO.setRowCnt(cstmt.getInt(5));
rVO.setErrMsg(cstmt.getString(6));
}finally {
dc.close(null, cstmt, conn);
}
return rVO;
}
public static void main(String[] args) {
UseInsertProcedure uip= new UseInsertProcedure();
ProcedureVO pVO = new ProcedureVO();
pVO.setNum(6);
pVO.setName("김진영");
pVO.setEmail("kim@test.com");
pVO.setAge(23);
try {
ResultVO rVO=uip.useInsertProcedure(pVO);
switch(rVO.getRowCnt()) {
case 1 : System.out.println(pVO.getName()+ " 추가되었습니다."); break;
default: System.out.println(rVO.getErrMsg());
}
} catch (SQLException e) {
e.printStackTrace();
}
}
}
| [
"chiang030204@gmail.com"
] | chiang030204@gmail.com |
5bc0e8f8f1f4a7f72ca936074de11fc3dde5bdb6 | 9bb5c8ae2c8ec8e2fd38d43ef07c8772edb706e9 | /app/src/main/java/com/soft/apk008/aw.java | b558cce527228dcd7ca7d45eaade218840fea15f | [] | no_license | yucz/008xposed | 0be57784b681b4495db224b9c509bcf5f6b08d38 | 3777608796054e389e30c9b543a2a1ac888f0a68 | refs/heads/master | 2021-05-11T14:32:57.902655 | 2017-09-29T16:57:34 | 2017-09-29T16:57:34 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 869 | java | package com.soft.apk008;
import com.lishu.c.a;
final class aw
extends Thread
{
aw(LoadActivity paramLoadActivity) {}
public final void run()
{
try
{
Thread.sleep(500L);
LoadActivity localLoadActivity = this.a;
if (LoadActivity.a())
{
a.b(this.a, "连接服务器失败,请重新,如果还不行,请联系客服或者到官网下载新版本 【" + LoadActivity.c(this.a) + "】");
return;
}
}
catch (InterruptedException localInterruptedException)
{
for (;;)
{
localInterruptedException.printStackTrace();
}
this.a.runOnUiThread(new ax(this));
}
}
}
/* Location: D:\AndroidKiller_v1.3.1\projects\008\ProjectSrc\smali\
* Qualified Name: com.soft.apk008.aw
* JD-Core Version: 0.7.0.1
*/ | [
"3450559631@qq.com"
] | 3450559631@qq.com |
575569ae1f373753d2d8db3d478ab40d48821870 | 9851b2552acf94e99f55e478587fcce154626ecd | /src/com/justin/twitch/web/api/TwitchChatAPI.java | 9de6844e895f2c050387dce54a1b94ebcf3e9758 | [] | no_license | cerealkiller1918/Twitch-Bot | cc7798cba5c3ee649cd52cc64ce982b75a50b1d4 | 64fc4e08fb9348d75c230cf87e1f43c15b16561b | refs/heads/master | 2020-04-06T07:11:33.548016 | 2016-07-25T05:54:43 | 2016-07-25T05:54:43 | 63,498,570 | 1 | 0 | null | 2016-07-25T05:52:15 | 2016-07-16T19:12:14 | Java | UTF-8 | Java | false | false | 3,813 | java | package com.justin.twitch.web.api;
import com.justin.webInterface.WebInterface;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import java.util.ArrayList;
public class TwitchChatAPI {
private String url = "https://tmi.twitch.tv/group/user/cerealkiller1918/chatters";
public long getChatterCount() {
try {
WebInterface web = new WebInterface();
JSONParser parser = new JSONParser();
Object obj = parser.parse(web.getHTTPS(url));
JSONObject jsonObject = (JSONObject) obj;
return (Long) jsonObject.get("chatter_count");
} catch (Exception e) {
e.printStackTrace();
return 0;
}
}
public String[] getViewsList() {
try {
WebInterface web = new WebInterface();
JSONParser parser = new JSONParser();
JSONObject jsonObject = (JSONObject) parser.parse(web.getHTTPS(url));
JSONObject inter = (JSONObject) jsonObject.get("chatters");
JSONArray jsonArray = (JSONArray) inter.get("viewers");
String[] strings = new String[jsonArray.size()];
for (int index = 0; index < jsonArray.size(); index++) {
strings[index] = (String) jsonArray.get(index);
}
return strings;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public String[] getModeratorsList() {
try {
WebInterface web = new WebInterface();
JSONParser parser = new JSONParser();
JSONObject jsonObject = (JSONObject) parser.parse(web.getHTTPS(url));
JSONObject inter = (JSONObject) jsonObject.get("chatters");
JSONArray jsonArray = (JSONArray) inter.get("moderators");
String[] strings = new String[jsonArray.size()];
for (int index = 0; index < jsonArray.size(); index++) {
strings[index] = (String) jsonArray.get(index);
}
return strings;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
public String[] getAllChatters() {
try {
WebInterface web = new WebInterface();
JSONParser parser = new JSONParser();
JSONObject jsonObject = (JSONObject) parser.parse(web.getHTTPS(url));
JSONObject inter = (JSONObject) jsonObject.get("chatters");
JSONArray moderatorsArray = (JSONArray) inter.get("moderators");
JSONArray staffArray = (JSONArray) inter.get("staff");
JSONArray adminArray = (JSONArray) inter.get("admins");
JSONArray global_modsArray = (JSONArray) inter.get("global_mods");
JSONArray viewersArray = (JSONArray) inter.get("viewers");
ArrayList<String> arrayList = new ArrayList<String>();
arrayList.addAll(convertJsonArrayToArrayList(moderatorsArray));
arrayList.addAll(convertJsonArrayToArrayList(staffArray));
arrayList.addAll(convertJsonArrayToArrayList(adminArray));
arrayList.addAll(convertJsonArrayToArrayList(global_modsArray));
arrayList.addAll(convertJsonArrayToArrayList(viewersArray));
String[] list = new String[arrayList.size()];
list = arrayList.toArray(list);
return list;
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
private ArrayList<String> convertJsonArrayToArrayList(JSONArray json) {
ArrayList<String> list = new ArrayList<String>();
for (int i = 0; i < json.size(); i++) {
list.add((String) json.get(i));
}
return list;
}
}
| [
"Justin_Frasier@me.com"
] | Justin_Frasier@me.com |
069c8e1714e5fa1c0b369eff8795974e8ce7e59b | fcb80b1e3b1501652ca03f03b7611ec05f79d4f1 | /test-junit5/src/test/java/io/micronaut/test/junit5/MathServiceTest.java | e84d8180975bff1228a9fb423cc6cb0fa278255e | [
"Apache-2.0"
] | permissive | rmpestano/micronaut-test | 39b2095773112377144fe741f274f671f26b3f8c | 27db5a7c6ba3c06eb04586cfbe8651b84bf674e9 | refs/heads/master | 2022-04-19T21:09:03.163392 | 2020-04-17T14:41:21 | 2020-04-17T17:40:16 | 256,528,111 | 0 | 0 | Apache-2.0 | 2020-04-17T14:38:38 | 2020-04-17T14:38:37 | null | UTF-8 | Java | false | false | 640 | java | package io.micronaut.test.junit5;
import io.micronaut.test.annotation.MicronautTest;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;
import javax.inject.Inject;
@MicronautTest // <1>
class MathServiceTest {
@Inject
MathService mathService; // <2>
@ParameterizedTest
@CsvSource({"2,8", "3,12"})
void testComputeNumToSquare(Integer num, Integer square) {
final Integer result = mathService.compute(num); // <3>
Assertions.assertEquals(
square,
result
);
}
}
| [
"graeme.rocher@gmail.com"
] | graeme.rocher@gmail.com |
cdd19b734eec27330e44d55386d1b630bea195c4 | 952789d549bf98b84ffc02cb895f38c95b85e12c | /V_2.x/Server/trunk/SpagoBIProject/src/it/eng/spagobi/services/security/stub/SecurityServiceSoapBindingImpl.java | c78c0592afdfc9cb1171ee614a1f782d67d79612 | [] | no_license | emtee40/testingazuan | de6342378258fcd4e7cbb3133bb7eed0ebfebeee | f3bd91014e1b43f2538194a5eb4e92081d2ac3ae | refs/heads/master | 2020-03-26T08:42:50.873491 | 2015-01-09T16:17:08 | 2015-01-09T16:17:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,183 | java | /**
* SecurityServiceSoapBindingImpl.java
*
* This file was auto-generated from WSDL
* by the Apache Axis 1.4 Apr 22, 2006 (06:55:48 PDT) WSDL2Java emitter.
*/
package it.eng.spagobi.services.security.stub;
import it.eng.spagobi.services.security.service.SecurityServiceImpl;
public class SecurityServiceSoapBindingImpl implements it.eng.spagobi.services.security.stub.SecurityService{
public it.eng.spagobi.services.security.bo.SpagoBIUserProfile getUserProfile(java.lang.String in0, java.lang.String in1) throws java.rmi.RemoteException {
SecurityServiceImpl impl=new SecurityServiceImpl();
return impl.getUserProfile(in0,in1);
}
public boolean isAuthorized(java.lang.String in0, java.lang.String in1, java.lang.String in2, java.lang.String in3) throws java.rmi.RemoteException {
SecurityServiceImpl impl=new SecurityServiceImpl();
return impl.isAuthorized(in0,in1,in2,in3);
}
public boolean checkAuthorization(java.lang.String in0, java.lang.String in1, java.lang.String in2) throws java.rmi.RemoteException {
SecurityServiceImpl impl=new SecurityServiceImpl();
return impl.checkAuthorization(in0,in1,in2);
}
}
| [
"zerbetto@99afaf0d-6903-0410-885a-c66a8bbb5f81"
] | zerbetto@99afaf0d-6903-0410-885a-c66a8bbb5f81 |
61533efe6e6c6afcf43dd1562f3b15eb02a84fd1 | be311fd73b957e602c9c68945d72e448ebf881d1 | /app/src/main/java/com/tomasforsman/qwizly/model/QwizlyClickCallback.java | 608a91be9371ba114f24da44e404beed3157955d | [] | no_license | mrtomwolf/Qwizly2 | 83db4393ad6a89adc4d7c3f9ea2b6f25d6ba4d5a | 7c317d133707103d6af78caa6e98f0854e25661f | refs/heads/master | 2021-05-03T15:03:15.819919 | 2018-02-06T14:16:15 | 2018-02-06T14:16:15 | 120,468,025 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 160 | java | package com.tomasforsman.qwizly.model;
import com.tomasforsman.qwizly.model.Result;
public interface QwizlyClickCallback {
void onClick(Result result);
}
| [
"tomas@it-designer.com"
] | tomas@it-designer.com |
97aa5d1800c0e04de00b9bd28e54471bac02e4cd | 07d104539f8689e522c3549beed827d25a59dddc | /src/main/java/com/example/Actorep/dao/ActiviteRepository.java | 42289ee0c3f1644effb8a5a57c806c0e8aa4a99f | [] | no_license | ezmr/Actorep | 7ae5deec155b72fc18892360f200c57852475e41 | 32573334546cb90b2260d8c72627a145a5a4bad3 | refs/heads/main | 2023-04-19T02:44:22.635260 | 2021-05-10T02:35:36 | 2021-05-10T02:35:36 | 365,896,251 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 405 | java | package com.example.Actorep.dao;
import com.example.Actorep.entities.Activite;
import java.util.List;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface ActiviteRepository extends JpaRepository<Activite,Integer> {
public List<Activite> findAllByLibelleActiviteContains (String libelleActivite); //AJB
}
| [
"83933532+ezmr@users.noreply.github.com"
] | 83933532+ezmr@users.noreply.github.com |
18bc5ac157750685ce4a7224cab4c9c4a60a1314 | 16ba856a03f92e19aaea5e68cd643161a22376dd | /app/src/main/java/com/cyf/lezu/utils/PermissionSetting.java | 13c13d4bea92576a2c84b09a7285755366f4aacd | [] | no_license | hyundaihs/LeZu | 827823a069c913d61560b00a0161fd26689d211f | eb5f39288fe9da5762b4104b287d9acef84bad2c | refs/heads/master | 2020-03-20T01:28:36.249062 | 2019-11-16T05:16:53 | 2019-11-16T05:16:53 | 115,963,009 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,427 | java | /*
* Copyright © Yan Zhenjie
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.cyf.lezu.utils;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.text.TextUtils;
import com.cyf.lezu.R;
import com.yanzhenjie.permission.AndPermission;
import com.yanzhenjie.permission.Permission;
import com.yanzhenjie.permission.SettingService;
import java.util.List;
/**
* LeZu
* Created by 蔡雨峰 on 2018/1/1.
*/
public final class PermissionSetting {
private final Context mContext;
public PermissionSetting(Context context) {
this.mContext = context;
}
public void showSetting(final List<String> permissions, final DialogInterface.OnClickListener onClickListener) {
List<String> permissionNames = Permission.transformText(mContext, permissions);
String message = mContext.getString(R.string.message_permission_always_failed, TextUtils.join("\n", permissionNames));
final SettingService settingService = AndPermission.permissionSetting(mContext);
new AlertDialog.Builder(mContext)
.setCancelable(false)
.setTitle(R.string.title_dialog)
.setMessage(message)
.setPositiveButton(R.string.setting, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
settingService.execute();
}
})
.setNegativeButton(R.string.no, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
settingService.cancel();
onClickListener.onClick(dialog, which);
}
})
.show();
}
} | [
"413780928@qq.com"
] | 413780928@qq.com |
79628c2bfa45d3f54f05eda8573a91e752f4d11b | e433070e1205619bb158c63be8310a00b694478a | /src/controllers/Combat.java | 4cdb3ca8f1eafd453488100dd75cccbf6a630b60 | [
"BSD-2-Clause"
] | permissive | wono/LoS | 540c8e1c27b310749bb7e97641ffe6c6010031e6 | 1f7dcea5c2b0d46f74bf5a299685089ed9c12278 | refs/heads/master | 2021-01-01T17:16:18.483214 | 2014-08-28T00:28:34 | 2014-08-28T00:28:34 | 20,609,945 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 457 | java | package controllers;
import java.util.List;
import libraries.WConsume;
import controllers.Control;
import hero.Hero;
import maps.Room;
import monsters.Monster;
/**
* @author Wonho Lim
*/
public class Combat {
public static void INIT ( Room r )
{
List<Skill> sL = Hero.GET().getSkillSet();
WConsume.ONLY_IF(
UInput.GET_KEY(
);
r.getMonster().die();
r.setMonster(null);
}
}
| [
"wono@live.com"
] | wono@live.com |
acf40099461a6f89e293df5d3b9190b9e08f81c3 | e6b2ddb313a2a6a40e20a75a7edaa94e9686e796 | /Book-springboot/src/main/java/com/yzk/book/model/User.java | 00416e47e3d34df9561e75e91abca6cdd86d48f7 | [] | no_license | jccccr/springboot-booksystem | 0a2d30f5c027d1972b3cc734530c1d52b6ecf4df | 19df8050f69bd4f82d3777da778337ba2932a6c3 | refs/heads/main | 2023-03-20T06:57:34.101735 | 2021-03-02T12:48:05 | 2021-03-02T12:48:05 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,652 | java | package com.yzk.book.model;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@Entity
public class User {
@Id
@GeneratedValue
private int id;
private String username;
private String name;
private String password;
private String role;
private char gender;
private int age;
public User(int id, String username, String name, String password, String role, char gender, int age) {
super();
this.id = id;
this.username = username;
this.name = name;
this.password = password;
this.role = role;
this.gender = gender;
this.age = age;
}
public User() {
super();
// TODO Auto-generated constructor stub
}
@Override
public String toString() {
return "User [id=" + id + ", username=" + username + ", name=" + name + ", password=" + password + ", role="
+ role + ", gender=" + gender + ", age=" + age + "]";
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public String getRole() {
return role;
}
public void setRole(String role) {
this.role = role;
}
public char getGender() {
return gender;
}
public void setGender(char gender) {
this.gender = gender;
}
public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}
}
| [
"2356911358@qq.com"
] | 2356911358@qq.com |
583e2be73a54c43224d540eb5a7ab0b3cb9f1acd | 0ecf12016f2f97c06b7a99186f547b4bd9ee17e5 | /BITS-CCDI-CORE/src/main/java/com/bits/ms/ccdi/api/core/io/Message.java | 2eac5998cf180beb3f8ba8dbab68614425151a72 | [] | no_license | arunraj2017/CCDI | 0d5cda1978123a63d782b49c0a20832a51d874b7 | 58d48d83bd579a7bfdf2ba363c30dc5ba386b3a6 | refs/heads/master | 2021-06-30T13:59:15.397114 | 2017-09-17T16:42:14 | 2017-09-17T16:42:14 | 103,843,570 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 720 | java | /*
* Application: E3
*
* -------------------------------
* Copyright (c) WellPoint, Inc
* -------------------------------
* This software is the confidential and proprietary information of WellPoint, Inc. ("Confidential Information").
* You shall not disclose such confidential information, and shall use it only in accordance with the terms of the
* license agreement you entered into with WellPoint.
*/
package com.bits.ms.ccdi.api.core.io;
import java.io.Serializable;
/**
* The Message interface is the root interface of all messages flowing through
* the Spring integraion layer.
*
* @author AB69987
* @version 1.0
*
*/
public interface Message extends Serializable {
}
| [
"arunraj.nexus5@gmail.com"
] | arunraj.nexus5@gmail.com |
1f19e37b3eda8653d91cd63f2f8e63f63d8edfad | 8f9c0b4c898162411309f056fd2e377078d45998 | /src/main/java/com/example/demo/DemoApplication.java | 7537d023c07cfde202b4d3f7d82085a384e98e81 | [] | no_license | nemezisSherokee/testjavaappec2 | d7670374faa7246865ff58c4331f0e1e08790557 | 72c0d7f0712c60d514d25612504de7a00d5eae76 | refs/heads/master | 2023-01-19T03:44:19.859923 | 2020-11-20T18:22:10 | 2020-11-20T18:22:10 | 314,580,591 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 668 | java | package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
@SpringBootApplication
@RestController
public class DemoApplication {
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
}
@GetMapping("/hello")
public String sayHello(@RequestParam(value = "myName", defaultValue = "World") String name) {
return String.format("Hello %s!", name);
}
}
| [
"kamdoum_ngadjui@siemens.com"
] | kamdoum_ngadjui@siemens.com |
d48e5c7499d740a1e5fd3b06be7fce38d528e2d2 | 35972adfc08227ad096a4649393ec3260a090498 | /Java_exe_2018/src/kr/co/infopub/chap044/NumberAn44.java | e357488e15c6634104f53fb7fcf26c39925e5520 | [] | no_license | s-jinipark/test_prog | 97dafbaf4dc4961f1a357a6cfc7b97161b6100ac | 36de9fe9a593056031cf417e44b87cd0ae214897 | refs/heads/master | 2022-12-25T05:06:11.533039 | 2020-06-21T15:17:41 | 2020-06-21T15:17:41 | 139,150,010 | 0 | 0 | null | 2022-12-16T03:49:23 | 2018-06-29T13:00:40 | Java | UHC | Java | false | false | 1,085 | java | package kr.co.infopub.chap044;
import kr.co.infopub.chap043.ScannerInput;
public class NumberAn44 {
public static void main(String[] args) {
int toNum=10;
try{
toNum=ScannerInput.readInt();
}catch(Exception e){
System.out.println("예외: 타입확인 요망"+e);
System.exit(1);//프로그램 끝
}
int sum=sumAn(toNum,1,2,true);
System.out.println("sum = "+sum);
int sum2=sumAn(toNum,1,2,false);
System.out.println("sum = "+sum2);
}
public static int numAn(int start, int n, int d){
return (start+n*d);
}
public static int posiNega(int start, int n, int d){
int oper=(n%2)==0?-1:1;
return oper*numAn(start,n,d);
}
public static int posiNega(int start, int n, int d, boolean isEvenNega){
int oper=isEvenNega?1:-1;
return oper*posiNega(start,n,d);
}
public static int sumAn(int n,int start, int d,boolean isEvenNega){
int sum=0;
for( int i=0; i<n;i++){
System.out.print("["+posiNega(start,i,d,isEvenNega)+"] ");
sum+=posiNega(start,i,d,isEvenNega);
}
return sum;
}
}
| [
"33948283+s-jinipark@users.noreply.github.com"
] | 33948283+s-jinipark@users.noreply.github.com |
e85bf33741986ae32a8c970c270a476fa1a53470 | 87df5a3313c0b830e9de83867482511d3e8cb790 | /src/main/java/advanced/java/design/patterns/issue27/creational/abstractfactory/v2/UFOEnemyShipBuilding.java | 94801957aea61177b637fa1d33fb176039baae68 | [] | no_license | TCJ23/TommyEdu | 56bab8b87325ec420f83c40c91b15af3bf9da972 | bce422ecb0173722a9faf677a9794c429176d92a | refs/heads/master | 2020-03-21T13:25:24.655136 | 2018-09-14T08:27:34 | 2018-09-14T08:27:34 | 138,604,735 | 0 | 0 | null | 2018-09-11T06:57:39 | 2018-06-25T14:17:10 | Java | UTF-8 | Java | false | false | 1,321 | java | package advanced.java.design.patterns.issue27.creational.abstractfactory.v2;
// This is the only class that needs to change, if you
// want to determine which enemy ships you want to
// provide as an option to build
public class UFOEnemyShipBuilding extends EnemyShipBuilding {
protected EnemyShip makeEnemyShip(String typeOfShip) {
EnemyShip theEnemyShip = null;
// If UFO was sent grab use the factory that knows
// what types of weapons and engines a regular UFO
// needs. The EnemyShip object is returned & given a name
if (typeOfShip.equals("UFO")) {
EnemyShipFactory shipPartsFactory = new UFOEnemyShipFactory();
theEnemyShip = new UFOEnemyShip(shipPartsFactory);
theEnemyShip.setName("UFO Grunt Ship");
} else
// If UFO BOSS was sent grab use the factory that knows
// what types of weapons and engines a Boss UFO
// needs. The EnemyShip object is returned & given a name
if (typeOfShip.equals("UFO BOSS")) {
EnemyShipFactory shipPartsFactory = new UFOBossEnemyShipFactory();
theEnemyShip = new UFOBossEnemyShip(shipPartsFactory);
theEnemyShip.setName("UFO Boss Ship");
}
return theEnemyShip;
}
} | [
"tcj2012@gmail.com"
] | tcj2012@gmail.com |
f37cf7127b8183f9d62e28cc4857bf64b3f43862 | 7732fe79822cf1b7953abb92a1a241a40f98cd82 | /src/DBHandler.java | b955b14f0fad672be96cb33a5164ec4741cdd40f | [] | no_license | kennimose/TableView | d4e70339555c97ff64fbf3880940952f429706a8 | b1841cb00607406f14b065757c7a97783d2a040f | refs/heads/master | 2021-01-19T14:55:57.449742 | 2015-09-07T08:24:40 | 2015-09-07T08:24:40 | 42,040,662 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,612 | java | import com.mysql.jdbc.Connection;
import com.mysql.jdbc.Statement;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
public class DBHandler {
Connection myConn;
private ArrayList<Person> p;
public DBHandler() {
try {
myConn = (Connection) DriverManager.getConnection("jdbc:mysql://localhost:8889/intellijTest", "root", "root");
} catch (SQLException e) {
e.printStackTrace();
}
}
public ArrayList<Person> getPerson() {
PersonReadFromDatabase();
return (p);
}
private void PersonReadFromDatabase() {
p = new ArrayList<Person>();
try {
Statement myStatement = (Statement) myConn.createStatement();
ResultSet myRs = ((java.sql.Statement) myStatement).executeQuery
("SELECT `id`, `firstnameCol`, `lastnameCol`, `emailCol`, `ratingCol` FROM Person_Table;");
while(myRs.next()) {
p.add(new Person(myRs.getInt("id"), myRs.getString("firstnameCol"), myRs.getString("lastnameCol"),
myRs.getString("emailCol"), myRs.getDouble("ratingCol")));
}
} catch (SQLException e){e.printStackTrace();}
}
public void writeToDB(String textFName, String textLName, String textEmail, Double rValue) {
try {
Statement myStatement = (Statement) myConn.createStatement();
myStatement.executeUpdate("INSERT INTO Person_Table" + "(firstnameCol, lastnameCol, emailCol, ratingCol)"
+ "VALUES ('" + textFName + "', '" + textLName + "', '" + textEmail + "', '" + rValue + "')" + ";");
} catch (SQLException e){e.printStackTrace();}
}
public void deleteFromDB(int id) {
p = new ArrayList<Person>();
try {
Statement myStatement = (Statement) myConn.createStatement();
String query = "DELETE FROM Person_Table WHERE id = " + id;
myStatement.executeUpdate(query);
} catch (SQLException e) {e.printStackTrace();}
}
public void updateDBHandler(Person p) {
try {
Statement myStatement = (Statement) myConn.createStatement();
String query = "UPDATE Person_Table SET firstnameCol='"+p.getFirstName()+"', lastnameCol = '"+p.getLastName()+
"', emailCol = '"+p.getEmail()+"'," + " ratingCol = '"+p.getRating()+ "' " + "WHERE id = "+p.getId();
myStatement.executeUpdate(query);
} catch (SQLException e) {e.printStackTrace();}
}
}
| [
"Kenni_cola@hotmail.com"
] | Kenni_cola@hotmail.com |
27c4a2c368daa1614fcdb03e6875859d2fa474c6 | f51b4bcf26c2105babfc13c22173e090ac5d43c3 | /src/main/java/com/ehyf/ewashing/service/ShoppingCartService.java | ebacbd306ce11496806fa2ff0cf31fffd7ce21e6 | [] | no_license | Bliztwings/Bliztwings_HouTai | 87fed233ef6aad5cab06851463aaf0cf13f71aef | 1dd8c46adf7cdb73b93aa94dae7701832babb0e4 | refs/heads/master | 2020-04-12T04:12:26.365931 | 2018-12-24T03:00:22 | 2018-12-24T03:00:22 | 162,288,414 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 336 | java | package com.ehyf.ewashing.service;
import com.ehyf.ewashing.entity.ShoppingCart;
import com.ehyf.ewashing.dao.ShoppingCartDao;
import org.springframework.stereotype.Service;
/**
*
* ShoppingCartService Service服务接口类
*
**/
@Service
public class ShoppingCartService extends BaseService<ShoppingCartDao,ShoppingCart> {
} | [
"chyuen5@outlook.com"
] | chyuen5@outlook.com |
4b4c4dfa3f852db647dd97bebea088f1dbc887f9 | 95091380a1271516ef5758768a15e1345de75ef1 | /src/org/omg/IOP/CodecPackage/TypeMismatch.java | a9370e293dcfe78243d25d354ea8b5b5490c8aa0 | [] | no_license | auun/jdk-source-learning | 575c52b5b2fddb2451eea7b26356513d3e6adf0e | 0a48a0ce87d08835bd9c93c0e957a3f3e354ef1c | refs/heads/master | 2020-07-20T21:55:15.886061 | 2019-09-06T06:06:56 | 2019-09-06T06:06:56 | 206,714,837 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 593 | java | package org.omg.IOP.CodecPackage;
/**
* org/omg/IOP/CodecPackage/TypeMismatch.java .
* Generated by the IDL-to-Java compiler (portable), version "3.2"
* from /build/java8-openjdk/src/jdk8u-jdk8u222-b05/corba/src/share/classes/org/omg/PortableInterceptor/IOP.idl
* Tuesday, June 18, 2019 10:26:12 AM CEST
*/
public final class TypeMismatch extends org.omg.CORBA.UserException
{
public TypeMismatch ()
{
super(TypeMismatchHelper.id());
} // ctor
public TypeMismatch (String $reason)
{
super(TypeMismatchHelper.id() + " " + $reason);
} // ctor
} // class TypeMismatch
| [
"guanglaihe@gmail.com"
] | guanglaihe@gmail.com |
dc9b79a7a3bfd15830b35b85c43966b1cdf27e67 | dbb4e32ab3fd59a5699f8569fae85f3ad37908be | /travel-grade-system/travel_grade_system_pojo/src/main/java/com/leo/enums/TravelOtherEnum.java | 0c5b266552c42b5ce4df63c82f4fb44570058b4f | [] | no_license | Parker-Alex/travel-grade | 1472137d3982d91e31800f88f6905ebb63fb2dad | 5f2e863b9541ddeff26c55e0b55fb1fa8d005e8d | refs/heads/master | 2022-06-23T13:34:57.231422 | 2019-05-24T11:53:03 | 2019-05-24T11:53:03 | 171,577,202 | 0 | 2 | null | 2022-06-21T00:56:31 | 2019-02-20T01:15:44 | JavaScript | UTF-8 | Java | false | false | 1,321 | java | package com.leo.enums;
import java.util.ArrayList;
import java.util.List;
/**
* @ClassName TravelOtherEnum
* @Description TODO
* @Author li.jiawei
* @Date 2019/4/22 15:16
* @Version 1.0
*/
public enum TravelOtherEnum {
FRUITS(0, "水果"),
TRAFFIC(1, "交通"),
WEATHER(2, "天气"),
CATE(3, "美食"),
STAY(4, "住宿");
private int code;
private String type;
TravelOtherEnum(int code, String type) {
this.code = code;
this.type = type;
}
public static int getMyCode(String type) {
for (TravelOtherEnum otherEnum : values()) {
if (otherEnum.getType().equals(type)) {
otherEnum.getCode();
}
}
return 0;
}
public static String getMyType(int code) {
for (TravelOtherEnum otherEnum : values()) {
if (otherEnum.getCode() == code) {
otherEnum.getType();
}
}
return null;
}
public static List<String> getAllType() {
List<String> types = new ArrayList<>();
for (TravelOtherEnum otherEnum : values()) {
types.add(otherEnum.getType());
}
return types;
}
public int getCode() {
return code;
}
public String getType() {
return type;
}}
| [
"37580149+Parker-Alex@users.noreply.github.com"
] | 37580149+Parker-Alex@users.noreply.github.com |
ec8686ab343945d409aecb4416e57d5a3a48db15 | f0c27fc8192159b8c041014fbc3f2d1aab5773ec | /src/com/book/thinkinginjava/basic/Adventure.java | a7c2a6277ddfd1d9a2be883a5ee45c966fb4b9c0 | [] | no_license | Binvy/learnJava | 432424a73b464fc8d175b3d45cd926903a022b08 | f69f3ff9775211a94286d895e167bf9b095140f5 | refs/heads/master | 2021-05-10T19:26:25.153500 | 2019-04-11T01:23:47 | 2019-04-11T01:23:47 | 118,154,342 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,307 | java | package com.book.thinkinginjava.basic;
/**
* @comments:
* @author: binvy
* @Date: 2018/3/2
*/
public class Adventure {
public static void ft(CanFight obj) {
obj.fight();
}
public static void fta(ActionCharacter obj) {
obj.fight();
}
public static void fy(CanFly obj) {
obj.fly();
}
public static void s(CanSwim obj) {
obj.swim();
}
public static void r(CanRun obj) {
obj.run();
}
public static void main(String[] args) {
Superman superman = new Superman();
ft(superman);
fta(superman);
fy(superman);
s(superman);
r(superman);
}
}
interface CanFight {
void fight();
}
interface CanFly {
void fly();
}
interface CanSwim {
void swim();
}
interface CanRun {
void run();
}
class ActionCharacter {
public void fight(){
System.out.println("ActionCharacter.fight()");
}
}
class Superman extends ActionCharacter implements CanFight, CanFly, CanRun, CanSwim {
@Override
public void fly() {
System.out.println("Superman.fly()");
}
@Override
public void swim() {
System.out.println("Superman.swim()");
}
@Override
public void run() {
System.out.println("Superman.run()");
}
}
| [
"hbw4425625@163.com"
] | hbw4425625@163.com |
c815c21640913d732ba81552289e5a951c0760a7 | d8f355b480d822b3a7cacc3c60208e2484201052 | /src/commonPackage/collection/customRealization/CustomArrayListTester.java | 35c0ed402325f1ba0b01ade193ff6af86b7260f7 | [] | no_license | AntonNPE/common | cc451800d6111b95120559baeebb161d0edf8d40 | ea07338c86366b283d788526f023aaaa36df3414 | refs/heads/master | 2021-05-03T18:14:40.159122 | 2017-04-11T20:40:34 | 2017-04-11T20:40:34 | 71,696,652 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 444 | java | package commonPackage.collection.customRealization;
public class CustomArrayListTester {
public static void main(String[] args) {
CustomArrayList list = new CustomArrayList();
for (int i = 0; i < 100; i ++){
list.add(i,i);
}
System.out.println(list.size());
for (int i = 0; i < 10; i ++ ){
list.remove(33);
}
System.out.println(list.size());
}
}
| [
"cubsplanet@gmail.com"
] | cubsplanet@gmail.com |
028fe7890f39b1ddad78886fd91cb7be152ece95 | 705e611bdebbc8695679763bc5ccd181d29af46f | /src/main/java/ejercicio4/BDUtil2.java | 39e735adeb215beaf7b146b853f7087c5a7c4a6a | [] | no_license | jordiugarte/QACode | 3752796301c230f559516f2b528dec52c68cbd41 | 34a90bb104e809d0e9221502335fdec155342c19 | refs/heads/master | 2023-03-21T08:26:45.203097 | 2021-03-03T03:28:43 | 2021-03-03T03:28:43 | 340,067,092 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 151 | java | package ejercicio4;
public class BDUtil2 {
public static boolean updateSaldo(int ci, int newSaldo){
// todo
return false;
}
}
| [
"jordi933@gmail.com"
] | jordi933@gmail.com |
2e2d05f39e92f869079928fe5c01d8ac9142290e | 3a0a51add2930bb96b8b6ea2cd76a4fe47cda032 | /experiments/subjects/jfreechart/src/test/java/org/jfree/chart/renderer/xy/HighLowRendererTest.java | 57685ad6355a0cd26a5937628d153b4a20907ff5 | [
"MIT",
"GPL-3.0-only",
"LGPL-3.0-only",
"LGPL-2.0-or-later",
"LGPL-2.1-or-later",
"LGPL-2.1-only"
] | permissive | soneyahossain/hcc-gap-recommender | d313efb6b44ade04ef02e668ee06d29ae2fbb002 | b2c79532d5246c8b52e2234f99dc62a26b3f364b | refs/heads/main | 2023-04-14T08:11:22.986933 | 2023-01-27T00:01:09 | 2023-01-27T00:01:09 | 589,493,747 | 5 | 1 | MIT | 2023-03-16T15:41:47 | 2023-01-16T08:53:46 | Java | UTF-8 | Java | false | false | 6,036 | java | /* ===========================================================
* JFreeChart : a free chart library for the Java(tm) platform
* ===========================================================
*
* (C) Copyright 2000-2016, by Object Refinery Limited and Contributors.
*
* Project Info: http://www.jfree.org/jfreechart/index.html
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or
* (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
* USA.
*
* [Oracle and Java are registered trademarks of Oracle and/or its affiliates.
* Other names may be trademarks of their respective owners.]
*
* ------------------------
* HighLowRendererTest.java
* ------------------------
* (C) Copyright 2003-2016, by Object Refinery Limited and Contributors.
*
* Original Author: David Gilbert (for Object Refinery Limited);
* Contributor(s): -;
*
* Changes
* -------
* 25-Mar-2003 : Version 1 (DG);
* 22-Oct-2003 : Added hashCode test (DG);
* 01-Nov-2005 : Added tests for new fields (DG);
* 17-Aug-2006 : Added testFindRangeBounds() method (DG);
* 22-Apr-2008 : Added testPublicCloneable (DG);
* 29-Apr-2008 : Extended testEquals() for new field (DG);
*
*/
package org.jfree.chart.renderer.xy;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNull;
import java.awt.Color;
import java.util.Date;
import org.jfree.chart.TestUtils;
import org.jfree.chart.util.PublicCloneable;
import org.jfree.data.Range;
import org.jfree.data.xy.DefaultOHLCDataset;
import org.jfree.data.xy.OHLCDataItem;
import org.jfree.data.xy.OHLCDataset;
import org.junit.Test;
/**
* Tests for the {@link HighLowRenderer} class.
*/
public class HighLowRendererTest {
/**
* Check that the equals() method distinguishes all fields.
*/
@Test
public void testEquals() {
HighLowRenderer r1 = new HighLowRenderer();
HighLowRenderer r2 = new HighLowRenderer();
assertEquals(r1, r2);
// drawOpenTicks
r1.setDrawOpenTicks(false);
assertFalse(r1.equals(r2));
r2.setDrawOpenTicks(false);
assertTrue(r1.equals(r2));
// drawCloseTicks
r1.setDrawCloseTicks(false);
assertFalse(r1.equals(r2));
r2.setDrawCloseTicks(false);
assertTrue(r1.equals(r2));
// openTickPaint
r1.setOpenTickPaint(Color.RED);
assertFalse(r1.equals(r2));
r2.setOpenTickPaint(Color.RED);
assertTrue(r1.equals(r2));
// closeTickPaint
r1.setCloseTickPaint(Color.BLUE);
assertFalse(r1.equals(r2));
r2.setCloseTickPaint(Color.BLUE);
assertTrue(r1.equals(r2));
// tickLength
r1.setTickLength(99.9);
assertFalse(r1.equals(r2));
r2.setTickLength(99.9);
assertTrue(r1.equals(r2));
}
/**
* Two objects that are equal are required to return the same hashCode.
*/
@Test
public void testHashcode() {
HighLowRenderer r1 = new HighLowRenderer();
HighLowRenderer r2 = new HighLowRenderer();
assertTrue(r1.equals(r2));
int h1 = r1.hashCode();
int h2 = r2.hashCode();
assertEquals(h1, h2);
}
/**
* Confirm that cloning works.
*/
@Test
public void testCloning() throws CloneNotSupportedException {
HighLowRenderer r1 = new HighLowRenderer();
r1.setCloseTickPaint(Color.green);
HighLowRenderer r2 = (HighLowRenderer) r1.clone();
assertTrue(r1 != r2);
assertTrue(r1.getClass() == r2.getClass());
assertTrue(r1.equals(r2));
}
/**
* Verify that this class implements {@link PublicCloneable}.
*/
@Test
public void testPublicCloneable() {
HighLowRenderer r1 = new HighLowRenderer();
assertTrue(r1 instanceof PublicCloneable);
}
/**
* Serialize an instance, restore it, and check for equality.
*/
@Test
public void testSerialization() {
HighLowRenderer r1 = new HighLowRenderer();
r1.setCloseTickPaint(Color.green);
HighLowRenderer r2 = (HighLowRenderer) TestUtils.serialised(r1);
assertEquals(r1, r2);
}
/**
* Some checks for the findRangeBounds() method.
*/
@Test
public void testFindRangeBounds() {
HighLowRenderer renderer = new HighLowRenderer();
OHLCDataItem item1 = new OHLCDataItem(new Date(1L), 2.0, 4.0, 1.0, 3.0,
100);
OHLCDataset dataset = new DefaultOHLCDataset("S1",
new OHLCDataItem[] {item1});
Range range = renderer.findRangeBounds(dataset);
assertEquals(new Range(1.0, 4.0), range);
OHLCDataItem item2 = new OHLCDataItem(new Date(1L), -1.0, 3.0, -1.0,
3.0, 100);
dataset = new DefaultOHLCDataset("S1", new OHLCDataItem[] {item1,
item2});
range = renderer.findRangeBounds(dataset);
assertEquals(new Range(-1.0, 4.0), range);
// try an empty dataset - should return a null range
dataset = new DefaultOHLCDataset("S1", new OHLCDataItem[] {});
range = renderer.findRangeBounds(dataset);
assertNull(range);
// try a null dataset - should return a null range
range = renderer.findRangeBounds(null);
assertNull(range);
}
}
| [
"an7s@virginia.edu"
] | an7s@virginia.edu |
8b6f229372a6af35c07e9f4a70b15f4e018d26f9 | 4f2f8f4ec7542618c610b05d8e838c021c193da4 | /Week_05/ioc-annotation/src/main/java/com/ddf/bean/TestBean.java | ea922cc8fa1292fc7a365d6bc5c5f00c683f05e8 | [] | no_license | cjDDF/JAVA-000 | 1b9a27017d72d661e2826a392e6f82626fe9176d | 51d8ff9ffb9fff1578196c844b5894d876e6f9eb | refs/heads/main | 2023-02-01T18:57:55.897170 | 2020-12-18T15:12:19 | 2020-12-18T15:12:19 | 303,260,254 | 0 | 0 | null | 2020-10-12T02:46:32 | 2020-10-12T02:46:31 | null | UTF-8 | Java | false | false | 118 | java | package com.ddf.bean;
/**
* 通过配置类的带@Bean的方法注入
* @author ddf
*/
public class TestBean {
}
| [
"1575658489@qq.com"
] | 1575658489@qq.com |
beccbec2ffc5cf5566fb5291368886b6187c787a | 82a133c652e896d7d1c7523f00885475c0e6b7d4 | /src/com/samaritan/util/Base64DataFieldPossessor.java | 506f5e5fcbd40e8a7382dc2f77ee8b2b56296b9a | [] | no_license | Luqman10/Commons-server-v1.0.0 | de9562d5e26b62f845f971d11fd5bbe8f799d2c1 | 9d523ddd03152c7972bc035653e94d712ac0bcca | refs/heads/master | 2023-01-03T05:46:49.870572 | 2020-10-28T17:47:15 | 2020-10-28T17:47:15 | 310,196,465 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 559 | java | package com.samaritan.util;
/**
* This a functional interface that declares a method (setDataFieldWithBase64()).
* Classes that have data fields that need to be assigned with the Base64 representation of
* a binary data should implement this interface.
*/
public interface Base64DataFieldPossessor{
/**
* Set data field(s) that need to be assigned with the Base64 representation of binary data. The implementer of this
* method is free to set multiple data fields with Base64 representations.
*/
void setDataFieldWithBase64() ;
}
| [
"labdul_qadir@st.ug.edu.gh"
] | labdul_qadir@st.ug.edu.gh |
508cb2263a25450f974b61eee6fb97643d503988 | 5070f3269ce4e3a69f9a82366cf2d02f3bd6fb4d | /src/com/wizardapp/model/UserScholarshipResult.java | ee78faac341ee63b06b96c02b287be3a905fb171 | [] | no_license | anuradhaSingh/hg-android | 796ca43e5d923f495f92c5f218d4accba4418232 | 2af1a41814d4c800ee48190e06ca45dd8e738d5b | refs/heads/master | 2016-08-12T04:27:08.753472 | 2016-04-02T17:55:58 | 2016-04-02T17:55:58 | 48,610,357 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,062 | java | package com.wizardapp.model;
import java.io.Serializable;
/**
* The persistent class for the user_scholarship_result database table.
*
*/
public class UserScholarshipResult implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
private boolean awardStatus;
private long createdAt;
public long getCreatedAt() {
return createdAt;
}
public void setCreatedAt(long createdAt) {
this.createdAt = createdAt;
}
public double getPercentage() {
return percentage;
}
public void setPercentage(double percentage) {
this.percentage = percentage;
}
public long getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(long updatedAt) {
this.updatedAt = updatedAt;
}
private int currectQuestion;
private double percentage;
private int rank;
private int unanswered;
private long updatedAt;
private boolean winStatus;
private int wrongQuestion;
private UserDetail userDetail;
//bi-directional many-to-one association to Scholarship
private Scholarship scholarship;
public UserScholarshipResult() {
}
public Long getId() {
return this.id;
}
public void setId(Long id) {
this.id = id;
}
public int getCurrectQuestion() {
return this.currectQuestion;
}
public void setCurrectQuestion(int currectQuestion) {
this.currectQuestion = currectQuestion;
}
public int getRank() {
return this.rank;
}
public void setRank(int rank) {
this.rank = rank;
}
public int getUnanswered() {
return this.unanswered;
}
public void setUnanswered(int unanswered) {
this.unanswered = unanswered;
}
public int getWrongQuestion() {
return this.wrongQuestion;
}
public void setWrongQuestion(int wrongQuestion) {
this.wrongQuestion = wrongQuestion;
}
public boolean isAwardStatus() {
return awardStatus;
}
public void setAwardStatus(boolean awardStatus) {
this.awardStatus = awardStatus;
}
public boolean isWinStatus() {
return winStatus;
}
public void setWinStatus(boolean winStatus) {
this.winStatus = winStatus;
}
} | [
"anuradha.ga1@gmail.com"
] | anuradha.ga1@gmail.com |
5cd6db1de657025094700455a03375136e01f242 | 41e595bde458e2cb2218b4c46706685e8aa227f6 | /machine-screen/src/main/java/com/aqiang/machine/screen/Config.java | 584c54bbfc1ddc89dd6ca2f245b75f7104ca8976 | [] | no_license | aqianglee/machine | b40a243658c9712722e7950e526615d1a44a7460 | 5c7966cf30b680f2d8ffb45b9bffe4d99fd13b12 | refs/heads/master | 2021-01-12T08:38:41.654059 | 2017-05-24T15:25:04 | 2017-05-24T15:25:04 | 76,645,210 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 259 | java | package com.aqiang.machine.screen;
public interface Config {
public static final int MONITOR_WIDTH = 1000;
public static final int MONITOR_HEIGHT = 640;
public static final int SCREEN_WIDTH = 800;
public static final int SCREEN_HEIGHT = 600;
}
| [
"kyo@kyo-PC.localdomain"
] | kyo@kyo-PC.localdomain |
a7d01722fc30d99ec982a3e94b3245531de33d73 | e91b8a88ad978674240347a0c87125e9fe74346a | /fundalara/src/dao/entrenamiento/DaoIndicadorActividadEscala.java | 1fc0fa41ac4e10891ae54e8beabb64ce4401b918 | [] | no_license | AndreynaPalinsky/fundalara | e1867387da4c6ae8b91ebedc2c504d57ce032bda | dcd776f97e98fd7117b792361aeef36e6c90e6da | refs/heads/master | 2021-01-21T01:06:03.957757 | 2011-12-09T17:17:35 | 2011-12-09T17:17:35 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 132 | java | package dao.entrenamiento;
import dao.general.GenericDAO;
public class DaoIndicadorActividadEscala extends GenericDAO {
}
| [
"labsi@localhost"
] | labsi@localhost |
68018a4623881417aeb7f82895d014a83b5a0de9 | cc5ccae68bae6185efbb8f0434054e445d43cdc2 | /src/main/java/bd/feed/test/service/FeedServiceImpl.java | caed705bdc4de34dc1a4b02758cdfa90a41ff527 | [] | no_license | yasminebsd/News-aggregator-backend | e4068aa1bb5446a74cbec0b55771c655178e0119 | 1c2210f3f89d641cf4de64b6e0b83da735b5aed1 | refs/heads/master | 2020-03-23T13:19:56.490615 | 2018-12-11T21:16:29 | 2018-12-11T21:16:29 | 141,612,184 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 8,368 | java | package bd.feed.test.service;
import bd.feed.test.model.Feed;
import bd.feed.test.model.FeedFlux;
import com.rometools.rome.feed.synd.SyndContent;
import com.rometools.rome.feed.synd.SyndEnclosure;
import com.rometools.rome.feed.synd.SyndEntry;
import com.rometools.rome.feed.synd.SyndFeed;
import com.rometools.rome.io.FeedException;
import com.rometools.rome.io.SyndFeedInput;
import com.rometools.rome.io.XmlReader;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.math.BigDecimal;
import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.jsoup.Jsoup;
import twitter4j.*;
import twitter4j.conf.ConfigurationBuilder;
@Service
public class FeedServiceImpl implements FeedService {
@Autowired
FeedFluxService feedFluxService;
@Autowired
LevenshteinDistance levenshteinDistance;
@Override
public List<Feed> getFeedsByKeyword(String keyword) {
List<FeedFlux> feedFluxList = feedFluxService.getByType("rss");
List<Feed> feedList = new ArrayList<>();
for (int i = 0; i < feedFluxList.size(); i++) {
try {
URL feedSource = new URL(feedFluxList.get(i).getUrl_feed());
SyndFeedInput input = new SyndFeedInput();
SyndFeed feed = input.build(new XmlReader(feedSource));
List entries = feed.getEntries();
Iterator it = entries.iterator();
while (it.hasNext()) {
SyndEntry entry = (SyndEntry) it.next();
String[] arr = entry.getTitle().split(" ");
for (int j = 0; j < arr.length; j++) {
System.out.print(arr[j]);
System.out.println(" " + levenshteinDistance.calculatePercentage(arr[j], keyword) + "%");
if (levenshteinDistance.calculatePercentage(arr[j], keyword).compareTo(new BigDecimal(50)) > 0) {
Feed f = new Feed();
f.setTitle(entry.getTitle());
System.out.println(entry.getTitle());
SyndContent description = entry.getDescription();
f.setDescription(description.getValue());
System.out.println(description.getValue());
Matcher matcher = Pattern.compile("<img src=\"([^\"]+)").matcher(entry.getContents().toString());
while (matcher.find()) {
System.out.println("img url: " + matcher.group(1));
f.setImage_src(matcher.group(1).toString());
}
if (f.getImage_src() == null) {
SyndEnclosure img = entry.getEnclosures().get(0);
f.setImage_src(img.getUrl());
}
f.setLink(entry.getLink());
feedList.add(f);
System.out.println();
}
}
}
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (FeedException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (NullPointerException e) {
return new ArrayList<>();
}
}
return feedList;
}
@Override
public List<Feed> getFeedsByKeywordJsoup(String searchTerm) throws IOException {
List<FeedFlux> feedFluxList = feedFluxService.getByType("jsoup");
List<Feed> feedList = new ArrayList<>();
for (int i = 0; i < feedFluxList.size(); i++) {
try {
org.jsoup.nodes.Document document = Jsoup.connect(feedFluxList.get(i).getUrl_feed()).get();
Elements blocks = document.getElementsByClass("post-block");
for (org.jsoup.nodes.Element block : blocks) {
org.jsoup.nodes.Element title = block.getElementsByClass("post-block__title__link").first();
String[] array = title.text().split(" ");
for (int j = 0; j < array.length; j++) {
System.out.print(array[j]);
System.out.println(" " + levenshteinDistance.calculatePercentage(array[j], searchTerm) + "%");
if (levenshteinDistance.calculatePercentage(array[j], searchTerm).compareTo(new BigDecimal(50)) > 0) {
Feed f = new Feed();
f.setTitle(title.text());
f.setDescription(block.getElementsByClass("post-block__content").first().text());
f.setLink(title.attr("href"));
org.jsoup.nodes.Element figure = block.getElementsByClass("post-block__media").first();
Element a = figure.getElementsByTag("img").first();
f.setImage_src(a.attr("src"));
feedList.add(f);
}
}
}
} catch (Exception e) {
e.printStackTrace();
return new ArrayList<>();
}
}
return feedList;
}
@Override
public List<Feed> twitterExtract(String searchTerm) throws TwitterException {
List<Feed> feedList = new ArrayList<>();
ConfigurationBuilder cb = new ConfigurationBuilder();
cb.setDebugEnabled(true)
.setOAuthConsumerKey("GEsWEKBYZVYjAeTDoca4RX6WZ")
.setOAuthConsumerSecret("JFcvaRZ13oIDTVLSMrO9S0P0A8KoheK1xJevfWq8YSQsUK77UE")
.setOAuthAccessToken("1017786110079094784-PbnnRpeWLPmLBnmk2nTyfJr5Cj7rzj")
.setOAuthAccessTokenSecret("iFlIkw6LBrT0rrTIJpu7DG339bmi4uXiM7wdEWZHI4D7U");
TwitterFactory tf = new TwitterFactory(cb.build());
twitter4j.Twitter twitter = tf.getInstance();
/*List<Status> status = twitter.getHomeTimeline();*/
Query query = new Query("#"+searchTerm);
QueryResult result = twitter.search(query);
/*for (Status st : status) */
for(Status status: result.getTweets()){
String language = status.getLang();
if(language.compareTo("en") == 0){
Feed f = new Feed();
f.setTitle(status.getText());
f.setDescription(status.getLang());
f.setImage_src("http://www.imt-atlantique.fr/lexians/wp-content/uploads/2016/05/twitter.jpg");
f.setLink("https://twitter.com/" + status.getUser().getScreenName()
+ "/status/" + status.getId());
System.out.println("@" + status.getUser().getScreenName() + " - " + status.getText());
feedList.add(f);
/*String[] tab = st.getText().split(" ");
for (int j = 0; j < tab.length; j++) {
System.out.print(tab[j]);
System.out.println(" " + levenshteinDistance.calculatePercentage(tab[j], searchTerm) + "%");
if (levenshteinDistance.calculatePercentage(tab[j], searchTerm).compareTo(new BigDecimal(50)) > 0) {
Feed f = new Feed();
f.setTitle(st.getText());
f.setDescription(" ");
f.setLink("https://twitter.com/" + st.getUser().getScreenName()
+ "/status/" + st.getId());
feedList.add(f);
System.out.println(st.getUser().getName() + "---------" + st.getText());
String url = "https://twitter.com/" + st.getUser().getScreenName()
+ "/status/" + st.getId();
System.out.println(url);
}
}*/
}
}
return feedList;
}
}
| [
"yasmine.boussaid@yahoo.com"
] | yasmine.boussaid@yahoo.com |
976f203fd27d4f38240c54a0f93d08d63b61ad6a | cfb825674708802ea06bd19302cf6db06f2f2b73 | /src/chess/pieces/Rei.java | 2323b7478aabba9d56d6dc918b0c5fcdda0fc451 | [] | no_license | msampaio22/projeto-xadrez-java | aa47f1771d824fed432f1cf1d5740bf3c8e7597f | 1cd5a1f9f585fe7f4e3bb609a0c9fc36e4b05c5b | refs/heads/master | 2022-12-11T00:16:35.718771 | 2020-08-28T05:43:25 | 2020-08-28T05:43:25 | 290,938,251 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 257 | java | package chess.pieces;
import boardgame.Board;
import chess.ChessPiece;
import chess.Color;
public class Rei extends ChessPiece {
public Rei(Board board, Color color) {
super(board, color);
}
@Override
public String toString() {
return "R";
}
}
| [
"mateus.labjt@gmail.com"
] | mateus.labjt@gmail.com |
a50a78ee2aee508f250a88ce819b25c59ca68047 | 605b512131df5b4d83c7066c4af1ba97169d5b7e | /src/main/java/com/mage/crm/service/SaleChanceService.java | 6ab3bcf823f673723cbca48ed04e50cb43966b6f | [] | no_license | BurningHots/mage_crm | 288370e74b8372d3a3714dc587412f285a1b4b5d | e1250c96531acafb714511f8a81d285a353ce802 | refs/heads/master | 2022-12-21T20:35:36.873558 | 2019-11-04T07:50:16 | 2019-11-04T07:50:16 | 219,430,898 | 0 | 0 | null | 2022-12-16T09:45:33 | 2019-11-04T06:18:37 | HTML | UTF-8 | Java | false | false | 3,136 | java | package com.mage.crm.service;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.mage.crm.dao.SaleChanceDao;
import com.mage.crm.query.SaleChanceQuery;
import com.mage.crm.util.AssertUtil;
import com.mage.crm.vo.SaleChance;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class SaleChanceService {
@Resource
private SaleChanceDao saleChanceDao;
/**
* 条件查询并分页显示
* @param saleChanceQuery
* @return
*/
public Map<String, Object> querySaleChancesByParams(SaleChanceQuery saleChanceQuery) {
// 分页获取page和rows
PageHelper.startPage(saleChanceQuery.getPage(),saleChanceQuery.getRows());
List<SaleChance> saleChanceList = saleChanceDao.querySaleChancesByParams(saleChanceQuery);
PageInfo<SaleChance> saleChancePageInfo = new PageInfo<>(saleChanceList);
List<SaleChance> list = saleChancePageInfo.getList();
Map<String, Object> map = new HashMap<>();
map.put("rows",list);
map.put("total",saleChancePageInfo.getTotal());
return map;
}
/**
* 添加saleChance数据
* @param saleChance
*/
public void addSaleChance(SaleChance saleChance) {
// 参数验证
checkParams(saleChance);
// 设置默认参数
saleChance.setIsValid(1);
saleChance.setDevResult(0);
// 调用dao层方法
AssertUtil.isTrue(saleChanceDao.addSaleChance(saleChance)<1,"营销机会记录添加失败");
}
/**
* 修改营机会记录
* @param saleChance
*/
public void updateSaleChance(SaleChance saleChance) {
// 参数非空验证
checkParams(saleChance);
// 调用dao层方法
AssertUtil.isTrue(saleChanceDao.updateSaleChance(saleChance)<1,"营销机会记录修改失败");
}
public void deleteSaleChance(Integer[] id) {
//参数非空验证
AssertUtil.isTrue(id.length<1,"请至少选择一条删除记录");
// 调用dao层方法
AssertUtil.isTrue(saleChanceDao.deleteSaleChance(id)<id.length,"删除营销机会记录失败");
}
/**
* 删除营销机会记录
* @param saleChance
* @return
*/
private SaleChance checkParams(SaleChance saleChance) {
AssertUtil.isTrue(StringUtils.isBlank(saleChance.getLinkMan()),"联系人不能为空");
AssertUtil.isTrue(StringUtils.isBlank(saleChance.getLinkPhone()),"联系电话不能为空");
AssertUtil.isTrue(StringUtils.isBlank(saleChance.getCgjl()),"成功几率不能为空");
// 判断是否分配并设置参数
if (StringUtils.isBlank(saleChance.getAssignMan())){
saleChance.setState(0);
}else {
saleChance.setState(1);
}
return saleChance;
}
public SaleChance querySaleChancesById(Integer id) {
return saleChanceDao.querySaleChancesById(id);
}
}
| [
"2965900113@qq.com"
] | 2965900113@qq.com |
fc59a96dc2b1341e7626652c088a7e6e1b5ab26d | 4536078b4070fc3143086ff48f088e2bc4b4c681 | /v1.0.4/decompiled/com/microsoft/identity/common/internal/broker/MicrosoftAuthServiceConnection.java | fcc40ac7279da5e317a5a9a83dc17e2f88d9dcc5 | [] | no_license | olealgoritme/smittestopp_src | 485b81422752c3d1e7980fbc9301f4f0e0030d16 | 52080d5b7613cb9279bc6cda5b469a5c84e34f6a | refs/heads/master | 2023-05-27T21:25:17.564334 | 2023-05-02T14:24:31 | 2023-05-02T14:24:31 | 262,846,147 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,507 | java | package com.microsoft.identity.common.internal.broker;
import android.content.ComponentName;
import android.content.ServiceConnection;
import android.os.IBinder;
import com.microsoft.identity.client.IMicrosoftAuthService;
import com.microsoft.identity.client.IMicrosoftAuthService.Stub;
import com.microsoft.identity.common.internal.logging.Logger;
public class MicrosoftAuthServiceConnection
implements ServiceConnection
{
public static final String TAG = MicrosoftAuthServiceConnection.class.getSimpleName();
public IMicrosoftAuthService mMicrosoftAuthService;
public MicrosoftAuthServiceFuture mMicrosoftAuthServiceFuture;
public MicrosoftAuthServiceConnection(MicrosoftAuthServiceFuture paramMicrosoftAuthServiceFuture)
{
mMicrosoftAuthServiceFuture = paramMicrosoftAuthServiceFuture;
}
public void onServiceConnected(ComponentName paramComponentName, IBinder paramIBinder)
{
Logger.info(TAG, "MicrosoftAuthService is connected.");
paramComponentName = IMicrosoftAuthService.Stub.asInterface(paramIBinder);
mMicrosoftAuthService = paramComponentName;
mMicrosoftAuthServiceFuture.setMicrosoftAuthService(paramComponentName);
}
public void onServiceDisconnected(ComponentName paramComponentName)
{
Logger.info(TAG, "MicrosoftAuthService is disconnected.");
}
}
/* Location:
* Qualified Name: base.com.microsoft.identity.common.internal.broker.MicrosoftAuthServiceConnection
* Java Class Version: 6 (50.0)
* JD-Core Version: 0.7.1
*/ | [
"olealgoritme@gmail.com"
] | olealgoritme@gmail.com |
c1ef4e50f429bdfe8474f08c245cf0d22cf7e48c | 71785e03d1c5116f05b79252a8c01e5c6be125e4 | /e-commerce-notebook/src/main/java/com/sp/gov/fatec/les/lucasdonizeti/ecommercenotebook/log/LogVendaAcao.java | 645acb2f209a2efe092961d72a9a1e43cb57ddb9 | [] | no_license | LucasDonizeti/e-commerce-notebook | 95ac4aaa5a5a5b2a873f1f4a4148ee453276b5cb | cba9e6fe65bb4a5d300293f3eb831359c36bb61d | refs/heads/main | 2023-07-03T22:04:02.931285 | 2021-08-10T20:08:33 | 2021-08-10T20:08:33 | 338,612,188 | 1 | 0 | null | 2021-04-02T20:26:47 | 2021-02-13T16:05:09 | HTML | UTF-8 | Java | false | false | 318 | java | package com.sp.gov.fatec.les.lucasdonizeti.ecommercenotebook.log;
import lombok.Getter;
/**
* author LucasDonizeti
*/
@Getter
public enum LogVendaAcao {
VENDA("Venda"),
DEVOLUCAO("Devolução");
private String descricao;
LogVendaAcao(String descricao){
this.descricao=descricao;
}
}
| [
"lucasdonizete11@gmail.com"
] | lucasdonizete11@gmail.com |
cd814d0a57683cd367f5d69f51c30b0e75b24b5d | edfb435ee89eec4875d6405e2de7afac3b2bc648 | /tags/selenium-2.16.0/java/client/test/com/thoughtworks/selenium/corebased/TestWait.java | 858f11b75019aca35b70baee066512877310f16c | [
"Apache-2.0"
] | permissive | Escobita/selenium | 6c1c78fcf0fb71604e7b07a3259517048e584037 | f4173df37a79ab6dd6ae3f1489ae0cd6cc7db6f1 | refs/heads/master | 2021-01-23T21:01:17.948880 | 2012-12-06T22:47:50 | 2012-12-06T22:47:50 | 8,271,631 | 1 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,380 | java | package com.thoughtworks.selenium.corebased;
import com.thoughtworks.selenium.InternalSelenseTestBase;
import org.junit.Test;
public class TestWait extends InternalSelenseTestBase {
@Test
public void testWait() throws Exception {
// Link click
selenium.open("../tests/html/test_reload_onchange_page.html");
selenium.click("theLink");
selenium.waitForPageToLoad("30000");
// Page should reload
verifyEquals(selenium.getTitle(), "Slow Loading Page");
selenium.open("../tests/html/test_reload_onchange_page.html");
selenium.select("theSelect", "Second Option");
selenium.waitForPageToLoad("30000");
// Page should reload
verifyEquals(selenium.getTitle(), "Slow Loading Page");
// Textbox with onblur
selenium.open("../tests/html/test_reload_onchange_page.html");
selenium.type("theTextbox", "new value");
selenium.fireEvent("theTextbox", "blur");
selenium.waitForPageToLoad("30000");
verifyEquals(selenium.getTitle(), "Slow Loading Page");
// Submit button
selenium.open("../tests/html/test_reload_onchange_page.html");
selenium.click("theSubmit");
selenium.waitForPageToLoad("30000");
verifyEquals(selenium.getTitle(), "Slow Loading Page");
selenium.click("slowPage_reload");
selenium.waitForPageToLoad("30000");
verifyEquals(selenium.getTitle(), "Slow Loading Page");
}
}
| [
"simon.m.stewart@07704840-8298-11de-bf8c-fd130f914ac9"
] | simon.m.stewart@07704840-8298-11de-bf8c-fd130f914ac9 |
f16da83cba62df7d273190aa4b927470b320be53 | c885ef92397be9d54b87741f01557f61d3f794f3 | /results/JacksonDatabind-103/com.fasterxml.jackson.databind.util.ClassUtil/BBC-F0-opt-70/tests/13/com/fasterxml/jackson/databind/util/ClassUtil_ESTest.java | 895777bdf73087d23fa24e7f2c55a25c8a893d63 | [
"CC-BY-4.0",
"MIT"
] | permissive | pderakhshanfar/EMSE-BBC-experiment | f60ac5f7664dd9a85f755a00a57ec12c7551e8c6 | fea1a92c2e7ba7080b8529e2052259c9b697bbda | refs/heads/main | 2022-11-25T00:39:58.983828 | 2022-04-12T16:04:26 | 2022-04-12T16:04:26 | 309,335,889 | 0 | 1 | null | 2021-11-05T11:18:43 | 2020-11-02T10:30:38 | null | UTF-8 | Java | false | false | 98,391 | java | /*
* This file was automatically generated by EvoSuite
* Fri Oct 22 00:21:22 GMT 2021
*/
package com.fasterxml.jackson.databind.util;
import org.junit.Test;
import static org.junit.Assert.*;
import static org.evosuite.shaded.org.mockito.Mockito.*;
import static org.evosuite.runtime.EvoAssertions.*;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonLocation;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;
import com.fasterxml.jackson.core.ObjectCodec;
import com.fasterxml.jackson.core.io.IOContext;
import com.fasterxml.jackson.core.json.ReaderBasedJsonParser;
import com.fasterxml.jackson.core.json.UTF8JsonGenerator;
import com.fasterxml.jackson.core.json.UTF8StreamJsonParser;
import com.fasterxml.jackson.core.sym.ByteQuadsCanonicalizer;
import com.fasterxml.jackson.core.sym.CharsToNameCanonicalizer;
import com.fasterxml.jackson.core.util.BufferRecycler;
import com.fasterxml.jackson.core.util.ByteArrayBuilder;
import com.fasterxml.jackson.core.util.JsonGeneratorDelegate;
import com.fasterxml.jackson.databind.BeanProperty;
import com.fasterxml.jackson.databind.DeserializationContext;
import com.fasterxml.jackson.databind.JavaType;
import com.fasterxml.jackson.databind.JsonDeserializer;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.Module;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectReader;
import com.fasterxml.jackson.databind.PropertyMetadata;
import com.fasterxml.jackson.databind.PropertyName;
import com.fasterxml.jackson.databind.SerializerProvider;
import com.fasterxml.jackson.databind.annotation.NoClass;
import com.fasterxml.jackson.databind.cfg.DeserializerFactoryConfig;
import com.fasterxml.jackson.databind.deser.BeanDeserializerFactory;
import com.fasterxml.jackson.databind.deser.DefaultDeserializationContext;
import com.fasterxml.jackson.databind.ext.CoreXMLDeserializers;
import com.fasterxml.jackson.databind.introspect.AnnotatedConstructor;
import com.fasterxml.jackson.databind.introspect.AnnotationMap;
import com.fasterxml.jackson.databind.introspect.TypeResolutionContext;
import com.fasterxml.jackson.databind.node.ArrayNode;
import com.fasterxml.jackson.databind.node.JsonNodeFactory;
import com.fasterxml.jackson.databind.node.TextNode;
import com.fasterxml.jackson.databind.ser.DefaultSerializerProvider;
import com.fasterxml.jackson.databind.type.ArrayType;
import com.fasterxml.jackson.databind.type.CollectionType;
import com.fasterxml.jackson.databind.type.MapLikeType;
import com.fasterxml.jackson.databind.type.MapType;
import com.fasterxml.jackson.databind.type.PlaceholderForType;
import com.fasterxml.jackson.databind.type.ReferenceType;
import com.fasterxml.jackson.databind.type.ResolvedRecursiveType;
import com.fasterxml.jackson.databind.type.SimpleType;
import com.fasterxml.jackson.databind.type.TypeBindings;
import com.fasterxml.jackson.databind.type.TypeFactory;
import com.fasterxml.jackson.databind.util.AccessPattern;
import com.fasterxml.jackson.databind.util.ClassUtil;
import com.fasterxml.jackson.databind.util.Named;
import java.io.BufferedOutputStream;
import java.io.ByteArrayOutputStream;
import java.io.Closeable;
import java.io.DataOutput;
import java.io.FileDescriptor;
import java.io.IOException;
import java.io.InputStream;
import java.io.LineNumberReader;
import java.io.OutputStream;
import java.io.PipedInputStream;
import java.io.PipedOutputStream;
import java.io.PipedReader;
import java.lang.annotation.Annotation;
import java.lang.reflect.AccessibleObject;
import java.lang.reflect.Constructor;
import java.lang.reflect.Field;
import java.lang.reflect.Member;
import java.lang.reflect.Method;
import java.lang.reflect.Type;
import java.sql.BatchUpdateException;
import java.sql.ClientInfoStatus;
import java.sql.DataTruncation;
import java.sql.SQLClientInfoException;
import java.sql.SQLDataException;
import java.sql.SQLException;
import java.sql.SQLFeatureNotSupportedException;
import java.sql.SQLIntegrityConstraintViolationException;
import java.sql.SQLInvalidAuthorizationSpecException;
import java.sql.SQLRecoverableException;
import java.sql.SQLTimeoutException;
import java.sql.SQLTransactionRollbackException;
import java.sql.SQLTransientConnectionException;
import java.sql.SQLTransientException;
import java.util.EnumMap;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import org.evosuite.runtime.EvoRunner;
import org.evosuite.runtime.EvoRunnerParameters;
import org.evosuite.runtime.ViolatedAssumptionAnswer;
import org.evosuite.runtime.mock.java.io.MockFileReader;
import org.evosuite.runtime.mock.java.io.MockIOException;
import org.evosuite.runtime.mock.java.io.MockPrintStream;
import org.evosuite.runtime.mock.java.lang.MockError;
import org.evosuite.runtime.mock.java.lang.MockRuntimeException;
import org.evosuite.runtime.testdata.FileSystemHandling;
import org.junit.runner.RunWith;
@RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true)
public class ClassUtil_ESTest extends ClassUtil_ESTest_scaffolding {
@Test(timeout = 4000)
public void test000() throws Throwable {
PlaceholderForType placeholderForType0 = new PlaceholderForType(35);
PlaceholderForType placeholderForType1 = new PlaceholderForType((-7));
PlaceholderForType placeholderForType2 = ClassUtil.nonNull(placeholderForType1, placeholderForType0);
assertNotSame(placeholderForType2, placeholderForType0);
}
@Test(timeout = 4000)
public void test001() throws Throwable {
Integer integer0 = Integer.getInteger("org.hibernate.proxy.com.fasterxml.jackson.databind.type.ArrayType", (-3326));
Integer integer1 = ClassUtil.nonNull((Integer) null, integer0);
assertEquals((-3326), (int)integer1);
}
@Test(timeout = 4000)
public void test002() throws Throwable {
Class<Void> class0 = Void.class;
Constructor<Void> constructor0 = ClassUtil.findConstructor(class0, true);
ClassUtil.Ctor classUtil_Ctor0 = new ClassUtil.Ctor(constructor0);
classUtil_Ctor0.getParamCount();
int int0 = classUtil_Ctor0.getParamCount();
assertEquals(0, int0);
assertTrue(constructor0.isAccessible());
}
@Test(timeout = 4000)
public void test003() throws Throwable {
PlaceholderForType placeholderForType0 = new PlaceholderForType((-4));
Class<PlaceholderForType> class0 = PlaceholderForType.class;
ClassUtil.verifyMustOverride(class0, placeholderForType0, (String) null);
assertEquals(0, placeholderForType0.containedTypeCount());
}
@Test(timeout = 4000)
public void test004() throws Throwable {
Class<Module> class0 = Module.class;
try {
ClassUtil.createInstance(class0, false);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Failed to instantiate class com.fasterxml.jackson.databind.Module, problem: null
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test005() throws Throwable {
JsonFactory jsonFactory0 = new JsonFactory();
BufferRecycler bufferRecycler0 = jsonFactory0._getBufferRecycler();
IOContext iOContext0 = new IOContext(bufferRecycler0, jsonFactory0, false);
UTF8JsonGenerator uTF8JsonGenerator0 = new UTF8JsonGenerator(iOContext0, 68, (ObjectCodec) null, (OutputStream) null);
FileDescriptor fileDescriptor0 = new FileDescriptor();
MockFileReader mockFileReader0 = new MockFileReader(fileDescriptor0);
LineNumberReader lineNumberReader0 = new LineNumberReader(mockFileReader0);
SQLException sQLException0 = new SQLException("JSON", "Vs!<M n=G&", (Throwable) null);
// Undeclared exception!
try {
ClassUtil.closeOnFailAndThrowAsIOE((JsonGenerator) uTF8JsonGenerator0, (Closeable) lineNumberReader0, (Exception) sQLException0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// java.sql.SQLException: JSON
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test006() throws Throwable {
MockRuntimeException mockRuntimeException0 = new MockRuntimeException("");
BufferRecycler bufferRecycler0 = new BufferRecycler();
IOContext iOContext0 = new IOContext(bufferRecycler0, "", true);
UTF8JsonGenerator uTF8JsonGenerator0 = new UTF8JsonGenerator(iOContext0, 3, (ObjectCodec) null, (OutputStream) null);
uTF8JsonGenerator0.writeString("");
// Undeclared exception!
try {
ClassUtil.closeOnFailAndThrowAsIOE((JsonGenerator) uTF8JsonGenerator0, (Closeable) uTF8JsonGenerator0, (Exception) mockRuntimeException0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
}
}
@Test(timeout = 4000)
public void test007() throws Throwable {
Class<Void> class0 = Void.class;
Constructor<Void> constructor0 = ClassUtil.findConstructor(class0, true);
ClassUtil.Ctor classUtil_Ctor0 = new ClassUtil.Ctor(constructor0);
ClassUtil.checkAndFixAccess((Member) classUtil_Ctor0._ctor);
assertTrue(constructor0.isAccessible());
}
@Test(timeout = 4000)
public void test008() throws Throwable {
SQLTransactionRollbackException sQLTransactionRollbackException0 = new SQLTransactionRollbackException();
Throwable throwable0 = ClassUtil.throwRootCauseIfIOE(sQLTransactionRollbackException0);
assertSame(sQLTransactionRollbackException0, throwable0);
}
@Test(timeout = 4000)
public void test009() throws Throwable {
DataTruncation dataTruncation0 = new DataTruncation(76, true, true, 76, 76);
DataTruncation dataTruncation1 = (DataTruncation)ClassUtil.throwIfRTE(dataTruncation0);
assertEquals("01004", dataTruncation1.getSQLState());
}
@Test(timeout = 4000)
public void test010() throws Throwable {
Throwable throwable0 = ClassUtil.throwIfIOE((Throwable) null);
assertNull(throwable0);
}
@Test(timeout = 4000)
public void test011() throws Throwable {
SQLTransientException sQLTransientException0 = new SQLTransientException("Lf-i^V$jIFz%TQO~l", "Lf-i^V$jIFz%TQO~l", (-658), (Throwable) null);
Throwable throwable0 = ClassUtil.throwIfError(sQLTransientException0);
assertSame(sQLTransientException0, throwable0);
}
@Test(timeout = 4000)
public void test012() throws Throwable {
TypeFactory typeFactory0 = TypeFactory.defaultInstance();
Class<HashMap> class0 = HashMap.class;
Class<Module> class1 = Module.class;
MapType mapType0 = typeFactory0.constructMapType(class0, class0, class1);
ArrayType arrayType0 = ArrayType.construct((JavaType) mapType0, (TypeBindings) null);
Class<?> class2 = ClassUtil.rawClass(arrayType0);
assertFalse(class2.isEnum());
}
@Test(timeout = 4000)
public void test013() throws Throwable {
String string0 = ClassUtil.nonNullString("``");
assertEquals("``", string0);
}
@Test(timeout = 4000)
public void test014() throws Throwable {
Class<Boolean> class0 = Boolean.class;
String string0 = ClassUtil.getPackageName(class0);
assertEquals("java.lang", string0);
}
@Test(timeout = 4000)
public void test015() throws Throwable {
Class<SimpleType> class0 = SimpleType.class;
Class class1 = (Class)ClassUtil.getGenericSuperclass(class0);
assertEquals(1025, class1.getModifiers());
}
@Test(timeout = 4000)
public void test016() throws Throwable {
Class<Long> class0 = Long.TYPE;
Type[] typeArray0 = ClassUtil.getGenericInterfaces(class0);
assertEquals(0, typeArray0.length);
}
@Test(timeout = 4000)
public void test017() throws Throwable {
Class<IOException> class0 = IOException.class;
Method[] methodArray0 = ClassUtil.getDeclaredMethods(class0);
assertEquals(0, methodArray0.length);
}
@Test(timeout = 4000)
public void test018() throws Throwable {
Class<Long> class0 = Long.TYPE;
Field[] fieldArray0 = ClassUtil.getDeclaredFields(class0);
assertEquals(0, fieldArray0.length);
}
@Test(timeout = 4000)
public void test019() throws Throwable {
Class<Integer> class0 = Integer.class;
ClassUtil.Ctor[] classUtil_CtorArray0 = ClassUtil.getConstructors(class0);
assertEquals(2, classUtil_CtorArray0.length);
}
@Test(timeout = 4000)
public void test020() throws Throwable {
Class<NoClass> class0 = NoClass.class;
Method[] methodArray0 = ClassUtil.getClassMethods(class0);
assertEquals(2, methodArray0.length);
}
@Test(timeout = 4000)
public void test021() throws Throwable {
Class<PlaceholderForType> class0 = PlaceholderForType.class;
List<Class<?>> list0 = ClassUtil.findSuperTypes(class0, class0);
List<Class<?>> list1 = ClassUtil.findSuperTypes(class0, class0, list0);
assertSame(list0, list1);
}
@Test(timeout = 4000)
public void test022() throws Throwable {
Class<Integer> class0 = Integer.TYPE;
Class<String> class1 = String.class;
List<Class<?>> list0 = ClassUtil.findRawSuperTypes(class0, class1, false);
assertTrue(list0.isEmpty());
}
@Test(timeout = 4000)
public void test023() throws Throwable {
Enum<ClientInfoStatus> enum0 = (Enum<ClientInfoStatus>) mock(Enum.class, new ViolatedAssumptionAnswer());
Class<? extends Enum<?>> class0 = ClassUtil.findEnumType(enum0);
assertEquals(1, class0.getModifiers());
}
@Test(timeout = 4000)
public void test024() throws Throwable {
Class<Annotation> class0 = Annotation.class;
Class<? extends Enum<?>> class1 = ClassUtil.findEnumType(class0);
assertNull(class1);
}
@Test(timeout = 4000)
public void test025() throws Throwable {
Class<Character> class0 = Character.class;
Constructor<Character> constructor0 = ClassUtil.findConstructor(class0, false);
assertNull(constructor0);
}
@Test(timeout = 4000)
public void test026() throws Throwable {
Class<AccessPattern> class0 = AccessPattern.class;
EnumSet<AccessPattern> enumSet0 = EnumSet.noneOf(class0);
Class<?> class1 = ClassUtil.classOf(enumSet0);
assertFalse(class1.isInterface());
}
@Test(timeout = 4000)
public void test027() throws Throwable {
// Undeclared exception!
try {
ClassUtil.wrapperType((Class<?>) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test028() throws Throwable {
Class<ReferenceType> class0 = ReferenceType.class;
// Undeclared exception!
try {
ClassUtil.verifyMustOverride(class0, (Object) null, "7?(U3 +Zc?o&Kq%eF?{");
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test029() throws Throwable {
MockRuntimeException mockRuntimeException0 = new MockRuntimeException("");
// Undeclared exception!
try {
ClassUtil.unwrapAndThrowAsIAE((Throwable) mockRuntimeException0, "");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
}
}
@Test(timeout = 4000)
public void test030() throws Throwable {
SQLRecoverableException sQLRecoverableException0 = new SQLRecoverableException((String) null);
// Undeclared exception!
try {
ClassUtil.unwrapAndThrowAsIAE((Throwable) sQLRecoverableException0, "q,e");
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// q,e
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test031() throws Throwable {
MockError mockError0 = new MockError((Throwable) null);
// Undeclared exception!
try {
ClassUtil.unwrapAndThrowAsIAE((Throwable) mockError0, "#Bu4^Hb*J{C1KM{Q,*G");
fail("Expecting exception: Error");
} catch(Error e) {
}
}
@Test(timeout = 4000)
public void test032() throws Throwable {
SQLDataException sQLDataException0 = new SQLDataException();
SQLInvalidAuthorizationSpecException sQLInvalidAuthorizationSpecException0 = new SQLInvalidAuthorizationSpecException("'J", "ARRAY", 479, sQLDataException0);
sQLDataException0.initCause(sQLInvalidAuthorizationSpecException0);
// Undeclared exception!
ClassUtil.unwrapAndThrowAsIAE((Throwable) sQLDataException0);
}
@Test(timeout = 4000)
public void test033() throws Throwable {
MockRuntimeException mockRuntimeException0 = new MockRuntimeException("");
// Undeclared exception!
try {
ClassUtil.unwrapAndThrowAsIAE((Throwable) mockRuntimeException0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
}
}
@Test(timeout = 4000)
public void test034() throws Throwable {
// Undeclared exception!
try {
ClassUtil.unwrapAndThrowAsIAE((Throwable) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test035() throws Throwable {
int[] intArray0 = new int[5];
MockError mockError0 = new MockError();
BatchUpdateException batchUpdateException0 = new BatchUpdateException("net.sf.cglib.proxy.java.lang.reflect.AccessibleObject", "; failed to set access: ", (-3), intArray0, mockError0);
SQLInvalidAuthorizationSpecException sQLInvalidAuthorizationSpecException0 = new SQLInvalidAuthorizationSpecException("org.hibernate.proxy.java.lang.annotation.Annotation", "^U", batchUpdateException0);
SQLFeatureNotSupportedException sQLFeatureNotSupportedException0 = new SQLFeatureNotSupportedException("org.hibernate.proxy.java.lang.annotation.Annotation", "org.hibernate.proxy.java.lang.annotation.Annotation", sQLInvalidAuthorizationSpecException0);
DataTruncation dataTruncation0 = new DataTruncation((-3), true, true, (-3), (-3), sQLFeatureNotSupportedException0);
// Undeclared exception!
try {
ClassUtil.unwrapAndThrowAsIAE((Throwable) dataTruncation0);
fail("Expecting exception: Error");
} catch(Error e) {
}
}
@Test(timeout = 4000)
public void test036() throws Throwable {
SQLException sQLException0 = new SQLException("Z`y=Uc", "Z`y=Uc");
JsonMappingException.Reference jsonMappingException_Reference0 = new JsonMappingException.Reference(sQLException0, 1536);
JsonMappingException jsonMappingException0 = JsonMappingException.wrapWithPath((Throwable) sQLException0, jsonMappingException_Reference0);
sQLException0.initCause(jsonMappingException0);
// Undeclared exception!
ClassUtil.throwRootCauseIfIOE(sQLException0);
}
@Test(timeout = 4000)
public void test037() throws Throwable {
// Undeclared exception!
try {
ClassUtil.throwRootCauseIfIOE((Throwable) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test038() throws Throwable {
DeserializerFactoryConfig deserializerFactoryConfig0 = new DeserializerFactoryConfig();
BeanDeserializerFactory beanDeserializerFactory0 = new BeanDeserializerFactory(deserializerFactoryConfig0);
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
Class<Boolean> class0 = Boolean.class;
JsonMappingException jsonMappingException0 = defaultDeserializationContext_Impl0.weirdStringException((String) null, class0, "com.fasterxml.jackson.databind.util.ClassUtil");
try {
ClassUtil.throwRootCauseIfIOE(jsonMappingException0);
fail("Expecting exception: IOException");
} catch(IOException e) {
//
// Cannot deserialize value of type `java.lang.Boolean` from String [N/A]: com.fasterxml.jackson.databind.util.ClassUtil
//
verifyException("com.fasterxml.jackson.databind.exc.InvalidFormatException", e);
}
}
@Test(timeout = 4000)
public void test039() throws Throwable {
Class<CollectionType> class0 = CollectionType.class;
DeserializerFactoryConfig deserializerFactoryConfig0 = new DeserializerFactoryConfig();
BeanDeserializerFactory beanDeserializerFactory0 = new BeanDeserializerFactory(deserializerFactoryConfig0);
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
ObjectMapper objectMapper0 = new ObjectMapper();
ArrayNode arrayNode0 = objectMapper0.createArrayNode();
JsonParser jsonParser0 = arrayNode0.traverse((ObjectCodec) objectMapper0);
JsonToken jsonToken0 = JsonToken.NOT_AVAILABLE;
JsonMappingException jsonMappingException0 = defaultDeserializationContext_Impl0.wrongTokenException(jsonParser0, class0, jsonToken0, "Pj.{8:WKj}/k<");
try {
ClassUtil.throwRootCauseIfIOE(jsonMappingException0);
fail("Expecting exception: IOException");
} catch(IOException e) {
//
// Unexpected token (null), expected NOT_AVAILABLE: Pj.{8:WKj}/k<
// at [Source: UNKNOWN; line: -1, column: -1]
//
verifyException("com.fasterxml.jackson.databind.exc.MismatchedInputException", e);
}
}
@Test(timeout = 4000)
public void test040() throws Throwable {
HashMap<String, ClientInfoStatus> hashMap0 = new HashMap<String, ClientInfoStatus>();
ByteArrayOutputStream byteArrayOutputStream0 = new ByteArrayOutputStream();
JsonLocation jsonLocation0 = JsonLocation.NA;
JsonMappingException jsonMappingException0 = new JsonMappingException(byteArrayOutputStream0, "", jsonLocation0);
SQLTimeoutException sQLTimeoutException0 = new SQLTimeoutException("local/anonymous", jsonMappingException0);
SQLRecoverableException sQLRecoverableException0 = new SQLRecoverableException(sQLTimeoutException0);
SQLClientInfoException sQLClientInfoException0 = new SQLClientInfoException(hashMap0, sQLRecoverableException0);
try {
ClassUtil.throwRootCauseIfIOE(sQLClientInfoException0);
fail("Expecting exception: IOException");
} catch(IOException e) {
}
}
@Test(timeout = 4000)
public void test041() throws Throwable {
SQLTransientException sQLTransientException0 = new SQLTransientException(".{J7B6~", ".{J7B6~");
MockIOException mockIOException0 = new MockIOException("; failed to set access: ", sQLTransientException0);
try {
ClassUtil.throwIfIOE(mockIOException0);
fail("Expecting exception: IOException");
} catch(IOException e) {
}
}
@Test(timeout = 4000)
public void test042() throws Throwable {
JsonFactory jsonFactory0 = new JsonFactory();
ObjectMapper objectMapper0 = new ObjectMapper(jsonFactory0);
DeserializationContext deserializationContext0 = objectMapper0.getDeserializationContext();
BufferRecycler bufferRecycler0 = new BufferRecycler();
IOContext iOContext0 = new IOContext(bufferRecycler0, objectMapper0, true);
PipedReader pipedReader0 = new PipedReader();
CharsToNameCanonicalizer charsToNameCanonicalizer0 = CharsToNameCanonicalizer.createRoot();
ReaderBasedJsonParser readerBasedJsonParser0 = new ReaderBasedJsonParser(iOContext0, (-170), pipedReader0, objectMapper0, charsToNameCanonicalizer0);
Class<Character> class0 = Character.class;
JsonToken jsonToken0 = JsonToken.END_OBJECT;
JsonMappingException jsonMappingException0 = deserializationContext0.wrongTokenException((JsonParser) readerBasedJsonParser0, (Class<?>) class0, jsonToken0, "JSON");
try {
ClassUtil.throwAsMappingException(deserializationContext0, (IOException) jsonMappingException0);
fail("Expecting exception: IOException");
} catch(IOException e) {
//
// Unexpected token (null), expected END_OBJECT: JSON
// at [Source: (com.fasterxml.jackson.databind.ObjectMapper); line: 1, column: 0]
//
verifyException("com.fasterxml.jackson.databind.exc.MismatchedInputException", e);
}
}
@Test(timeout = 4000)
public void test043() throws Throwable {
BeanDeserializerFactory beanDeserializerFactory0 = BeanDeserializerFactory.instance;
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
MockIOException mockIOException0 = new MockIOException();
try {
ClassUtil.throwAsMappingException((DeserializationContext) defaultDeserializationContext_Impl0, (IOException) mockIOException0);
fail("Expecting exception: IOException");
} catch(IOException e) {
//
// N/A
//
verifyException("com.fasterxml.jackson.databind.JsonMappingException", e);
}
}
@Test(timeout = 4000)
public void test044() throws Throwable {
MockRuntimeException mockRuntimeException0 = new MockRuntimeException("");
// Undeclared exception!
try {
ClassUtil.throwAsIAE((Throwable) mockRuntimeException0, "java.lang.annotatio");
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
}
}
@Test(timeout = 4000)
public void test045() throws Throwable {
SQLRecoverableException sQLRecoverableException0 = new SQLRecoverableException("write a boolean value");
MockError mockError0 = new MockError((String) null, sQLRecoverableException0);
// Undeclared exception!
try {
ClassUtil.throwAsIAE((Throwable) mockError0, "write a boolean value");
fail("Expecting exception: Error");
} catch(Error e) {
}
}
@Test(timeout = 4000)
public void test046() throws Throwable {
// Undeclared exception!
try {
ClassUtil.throwAsIAE((Throwable) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test047() throws Throwable {
SQLTransactionRollbackException sQLTransactionRollbackException0 = new SQLTransactionRollbackException();
// Undeclared exception!
try {
ClassUtil.throwAsIAE((Throwable) sQLTransactionRollbackException0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test048() throws Throwable {
SQLDataException sQLDataException0 = new SQLDataException("KrMz", "F7j\"TFTa1t&o|6`35", 180);
MockError mockError0 = new MockError("F7j\"TFTa1t&o|6`35", sQLDataException0);
// Undeclared exception!
try {
ClassUtil.throwAsIAE((Throwable) mockError0);
fail("Expecting exception: Error");
} catch(Error e) {
}
}
@Test(timeout = 4000)
public void test049() throws Throwable {
// Undeclared exception!
try {
ClassUtil.primitiveType((Class<?>) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test050() throws Throwable {
Class<AccessibleObject> class0 = AccessibleObject.class;
TypeFactory typeFactory0 = TypeFactory.defaultInstance();
JavaType[] javaTypeArray0 = new JavaType[0];
TypeBindings typeBindings0 = TypeBindings.create(class0, javaTypeArray0);
TypeResolutionContext.Basic typeResolutionContext_Basic0 = new TypeResolutionContext.Basic(typeFactory0, typeBindings0);
Class<InputStream> class1 = InputStream.class;
Constructor<InputStream> constructor0 = ClassUtil.findConstructor(class1, true);
AnnotationMap annotationMap0 = new AnnotationMap();
AnnotationMap[] annotationMapArray0 = new AnnotationMap[0];
AnnotatedConstructor annotatedConstructor0 = new AnnotatedConstructor(typeResolutionContext_Basic0, constructor0, annotationMap0, annotationMapArray0);
PropertyMetadata propertyMetadata0 = PropertyMetadata.STD_REQUIRED;
BeanProperty.Std beanProperty_Std0 = new BeanProperty.Std((PropertyName) null, (JavaType) null, (PropertyName) null, annotatedConstructor0, propertyMetadata0);
// Undeclared exception!
try {
ClassUtil.nameOf((Named) beanProperty_Std0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.BeanProperty$Std", e);
}
}
@Test(timeout = 4000)
public void test051() throws Throwable {
// Undeclared exception!
try {
ClassUtil.isProxyType((Class<?>) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test052() throws Throwable {
// Undeclared exception!
try {
ClassUtil.isObjectOrPrimitive((Class<?>) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test053() throws Throwable {
// Undeclared exception!
try {
ClassUtil.isNonStaticInnerClass((Class<?>) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.evosuite.runtime.Reflection", e);
}
}
@Test(timeout = 4000)
public void test054() throws Throwable {
// Undeclared exception!
try {
ClassUtil.isJacksonStdImpl((Class<?>) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test055() throws Throwable {
// Undeclared exception!
try {
ClassUtil.isConcrete((Member) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test056() throws Throwable {
// Undeclared exception!
try {
ClassUtil.isConcrete((Class<?>) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test057() throws Throwable {
// Undeclared exception!
try {
ClassUtil.isCollectionMapOrArray((Class<?>) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test058() throws Throwable {
// Undeclared exception!
try {
ClassUtil.hasGetterSignature((Method) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test059() throws Throwable {
// Undeclared exception!
try {
ClassUtil.hasEnclosingMethod((Class<?>) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test060() throws Throwable {
SQLTransientException sQLTransientException0 = new SQLTransientException("net.sf.cglib.proxy.java.lang.Character", "net.sf.cglib.proxy.java.lang.Character");
SQLTransactionRollbackException sQLTransactionRollbackException0 = new SQLTransactionRollbackException(sQLTransientException0);
sQLTransientException0.initCause(sQLTransactionRollbackException0);
SQLTimeoutException sQLTimeoutException0 = new SQLTimeoutException("net.sf.cglib.proxy.java.lang.Character", "net.sf.cglib.proxy.java.lang.Character", 1, sQLTransientException0);
// Undeclared exception!
ClassUtil.getRootCause(sQLTimeoutException0);
}
@Test(timeout = 4000)
public void test061() throws Throwable {
// Undeclared exception!
try {
ClassUtil.getRootCause((Throwable) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test062() throws Throwable {
// Undeclared exception!
try {
ClassUtil.getPackageName((Class<?>) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test063() throws Throwable {
// Undeclared exception!
try {
ClassUtil.getOuterClass((Class<?>) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test064() throws Throwable {
// Undeclared exception!
try {
ClassUtil.getGenericSuperclass((Class<?>) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test065() throws Throwable {
// Undeclared exception!
try {
ClassUtil.getGenericInterfaces((Class<?>) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test066() throws Throwable {
// Undeclared exception!
try {
ClassUtil.getEnclosingClass((Class<?>) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test067() throws Throwable {
// Undeclared exception!
try {
ClassUtil.getDeclaringClass((Class<?>) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test068() throws Throwable {
// Undeclared exception!
try {
ClassUtil.getDeclaredMethods((Class<?>) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.evosuite.runtime.util.ReflectionUtils", e);
}
}
@Test(timeout = 4000)
public void test069() throws Throwable {
// Undeclared exception!
try {
ClassUtil.getDeclaredFields((Class<?>) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.evosuite.runtime.util.ReflectionUtils", e);
}
}
@Test(timeout = 4000)
public void test070() throws Throwable {
// Undeclared exception!
try {
ClassUtil.getConstructors((Class<?>) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test071() throws Throwable {
// Undeclared exception!
try {
ClassUtil.getClassMethods((Class<?>) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("org.evosuite.runtime.util.ReflectionUtils", e);
}
}
@Test(timeout = 4000)
public void test072() throws Throwable {
Class<IOException> class0 = IOException.class;
Class<Boolean> class1 = Boolean.class;
List<Class<?>> list0 = ClassUtil.findRawSuperTypes(class1, class1, false);
Class<Double> class2 = Double.class;
// Undeclared exception!
try {
ClassUtil.findSuperTypes(class0, class2, list0);
fail("Expecting exception: UnsupportedOperationException");
} catch(UnsupportedOperationException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("java.util.AbstractList", e);
}
}
@Test(timeout = 4000)
public void test073() throws Throwable {
// Undeclared exception!
try {
ClassUtil.findEnumType((EnumSet<?>) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test074() throws Throwable {
// Undeclared exception!
try {
ClassUtil.findEnumType((EnumMap<?, ?>) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test075() throws Throwable {
// Undeclared exception!
try {
ClassUtil.findEnumType((Enum<?>) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test076() throws Throwable {
// Undeclared exception!
try {
ClassUtil.findEnumType((Class<?>) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test077() throws Throwable {
// Undeclared exception!
try {
ClassUtil.findConstructor((Class<RuntimeException>) null, false);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test078() throws Throwable {
// Undeclared exception!
try {
ClassUtil.findClassAnnotations((Class<?>) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test079() throws Throwable {
// Undeclared exception!
try {
ClassUtil.defaultValue((Class<?>) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test080() throws Throwable {
// Undeclared exception!
try {
ClassUtil.createInstance((Class<AccessibleObject>) null, true);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test081() throws Throwable {
SQLIntegrityConstraintViolationException sQLIntegrityConstraintViolationException0 = new SQLIntegrityConstraintViolationException("ZERO_LENGTH_ENUM_ARRAY", "java.lang.Object");
BufferRecycler bufferRecycler0 = new BufferRecycler();
IOContext iOContext0 = new IOContext(bufferRecycler0, bufferRecycler0, true);
JsonFactory jsonFactory0 = new JsonFactory();
ObjectMapper objectMapper0 = new ObjectMapper(jsonFactory0);
MockPrintStream mockPrintStream0 = new MockPrintStream("\"vals\"");
UTF8JsonGenerator uTF8JsonGenerator0 = new UTF8JsonGenerator(iOContext0, 3, objectMapper0, mockPrintStream0);
// Undeclared exception!
try {
ClassUtil.closeOnFailAndThrowAsIOE((JsonGenerator) uTF8JsonGenerator0, (Exception) sQLIntegrityConstraintViolationException0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// java.sql.SQLIntegrityConstraintViolationException: ZERO_LENGTH_ENUM_ARRAY
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test082() throws Throwable {
BeanDeserializerFactory beanDeserializerFactory0 = BeanDeserializerFactory.instance;
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
Class<AccessibleObject> class0 = AccessibleObject.class;
JsonMappingException jsonMappingException0 = defaultDeserializationContext_Impl0.weirdKeyException(class0, "elementTy e", "c'3\"lB]TV");
// Undeclared exception!
try {
ClassUtil.closeOnFailAndThrowAsIOE((JsonGenerator) null, (Exception) jsonMappingException0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test083() throws Throwable {
Class<Object> class0 = Object.class;
BufferRecycler bufferRecycler0 = new BufferRecycler();
IOContext iOContext0 = new IOContext(bufferRecycler0, (Object) null, true);
JsonFactory jsonFactory0 = new JsonFactory();
DefaultSerializerProvider.Impl defaultSerializerProvider_Impl0 = new DefaultSerializerProvider.Impl();
ObjectMapper objectMapper0 = new ObjectMapper(jsonFactory0, defaultSerializerProvider_Impl0, (DefaultDeserializationContext) null);
byte[] byteArray0 = new byte[5];
UTF8JsonGenerator uTF8JsonGenerator0 = new UTF8JsonGenerator(iOContext0, 0, objectMapper0, (OutputStream) null, byteArray0, (-1638), false);
DeserializerFactoryConfig deserializerFactoryConfig0 = new DeserializerFactoryConfig();
BeanDeserializerFactory beanDeserializerFactory0 = new BeanDeserializerFactory(deserializerFactoryConfig0);
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
JsonMappingException jsonMappingException0 = defaultDeserializationContext_Impl0.weirdKeyException(class0, "JSON", "fV1\"vF5rUV%!M0e$Qc");
try {
ClassUtil.closeOnFailAndThrowAsIOE((JsonGenerator) uTF8JsonGenerator0, (Exception) jsonMappingException0);
fail("Expecting exception: IOException");
} catch(IOException e) {
//
// Cannot deserialize Map key of type `java.lang.Object` from String \"JSON\": fV1\"vF5rUV%!M0e$Qc
//
verifyException("com.fasterxml.jackson.databind.exc.InvalidFormatException", e);
}
}
@Test(timeout = 4000)
public void test084() throws Throwable {
Class<Error> class0 = Error.class;
BufferRecycler bufferRecycler0 = new BufferRecycler();
IOContext iOContext0 = new IOContext(bufferRecycler0, class0, true);
ObjectMapper objectMapper0 = new ObjectMapper();
byte[] byteArray0 = new byte[7];
UTF8JsonGenerator uTF8JsonGenerator0 = new UTF8JsonGenerator(iOContext0, 8, objectMapper0, (OutputStream) null, byteArray0, 0, true);
SQLTransactionRollbackException sQLTransactionRollbackException0 = new SQLTransactionRollbackException();
JsonMappingException jsonMappingException0 = JsonMappingException.from((JsonGenerator) uTF8JsonGenerator0, (String) null, (Throwable) sQLTransactionRollbackException0);
try {
ClassUtil.closeOnFailAndThrowAsIOE((JsonGenerator) uTF8JsonGenerator0, (Exception) jsonMappingException0);
fail("Expecting exception: IOException");
} catch(IOException e) {
//
// N/A
//
verifyException("com.fasterxml.jackson.databind.JsonMappingException", e);
}
}
@Test(timeout = 4000)
public void test085() throws Throwable {
BufferRecycler bufferRecycler0 = new BufferRecycler();
IOContext iOContext0 = new IOContext(bufferRecycler0, bufferRecycler0.BYTE_WRITE_CONCAT_BUFFER, false);
ObjectMapper objectMapper0 = new ObjectMapper();
MockPrintStream mockPrintStream0 = new MockPrintStream("<VC M]");
UTF8JsonGenerator uTF8JsonGenerator0 = new UTF8JsonGenerator(iOContext0, 3071, objectMapper0, mockPrintStream0);
MockIOException mockIOException0 = new MockIOException("java.lang.Boolean");
try {
ClassUtil.closeOnFailAndThrowAsIOE((JsonGenerator) uTF8JsonGenerator0, (Closeable) uTF8JsonGenerator0, (Exception) mockIOException0);
fail("Expecting exception: IOException");
} catch(IOException e) {
}
}
@Test(timeout = 4000)
public void test086() throws Throwable {
Class<AccessibleObject> class0 = AccessibleObject.class;
BufferRecycler bufferRecycler0 = new BufferRecycler();
IOContext iOContext0 = new IOContext(bufferRecycler0, bufferRecycler0, false);
UTF8JsonGenerator uTF8JsonGenerator0 = new UTF8JsonGenerator(iOContext0, (-2441), (ObjectCodec) null, (OutputStream) null);
BeanDeserializerFactory beanDeserializerFactory0 = BeanDeserializerFactory.instance;
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
JsonMappingException jsonMappingException0 = defaultDeserializationContext_Impl0.weirdNativeValueException((Object) null, class0);
try {
ClassUtil.closeOnFailAndThrowAsIOE((JsonGenerator) uTF8JsonGenerator0, (Closeable) uTF8JsonGenerator0, (Exception) jsonMappingException0);
fail("Expecting exception: IOException");
} catch(IOException e) {
//
// Cannot deserialize value of type `java.lang.reflect.AccessibleObject` from native value (`JsonToken.VALUE_EMBEDDED_OBJECT`) of type [null]: incompatible types
//
verifyException("com.fasterxml.jackson.databind.exc.InvalidFormatException", e);
}
}
@Test(timeout = 4000)
public void test087() throws Throwable {
BufferRecycler bufferRecycler0 = new BufferRecycler();
IOContext iOContext0 = new IOContext(bufferRecycler0, (Object) null, false);
ObjectMapper objectMapper0 = new ObjectMapper();
JsonNodeFactory jsonNodeFactory0 = JsonNodeFactory.withExactBigDecimals(false);
ObjectReader objectReader0 = objectMapper0.reader(jsonNodeFactory0);
ByteArrayBuilder byteArrayBuilder0 = new ByteArrayBuilder();
UTF8JsonGenerator uTF8JsonGenerator0 = new UTF8JsonGenerator(iOContext0, (-192), objectReader0, byteArrayBuilder0);
SerializerProvider serializerProvider0 = objectMapper0.getSerializerProvider();
JsonMappingException jsonMappingException0 = JsonMappingException.from(serializerProvider0, "java.lang.Object", (Throwable) null);
try {
ClassUtil.closeOnFailAndThrowAsIOE((JsonGenerator) uTF8JsonGenerator0, (Closeable) byteArrayBuilder0, (Exception) jsonMappingException0);
fail("Expecting exception: IOException");
} catch(IOException e) {
//
// java.lang.Object
//
verifyException("com.fasterxml.jackson.databind.JsonMappingException", e);
}
}
@Test(timeout = 4000)
public void test088() throws Throwable {
// Undeclared exception!
try {
ClassUtil.checkAndFixAccess((Member) null, false);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test089() throws Throwable {
// Undeclared exception!
try {
ClassUtil.canBeABeanType((Class<?>) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test090() throws Throwable {
Class<MapLikeType> class0 = MapLikeType.class;
Class<?> class1 = ClassUtil.getEnclosingClass(class0);
assertNull(class1);
}
@Test(timeout = 4000)
public void test091() throws Throwable {
Class<Integer> class0 = Integer.class;
boolean boolean0 = ClassUtil.hasEnclosingMethod(class0);
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test092() throws Throwable {
Class<Character> class0 = Character.TYPE;
boolean boolean0 = ClassUtil.isJacksonStdImpl(class0);
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test093() throws Throwable {
Class<Byte> class0 = Byte.class;
CoreXMLDeserializers.Std coreXMLDeserializers_Std0 = new CoreXMLDeserializers.Std(class0, 173);
AccessPattern accessPattern0 = coreXMLDeserializers_Std0.getNullAccessPattern();
Class<? extends Enum<?>> class1 = ClassUtil.findEnumType((Enum<?>) accessPattern0);
assertEquals(16385, class1.getModifiers());
}
@Test(timeout = 4000)
public void test094() throws Throwable {
String string0 = ClassUtil.backticked("");
assertEquals("``", string0);
}
@Test(timeout = 4000)
public void test095() throws Throwable {
Class<String> class0 = String.class;
Constructor<String> constructor0 = ClassUtil.findConstructor(class0, false);
assertFalse(constructor0.isAccessible());
}
@Test(timeout = 4000)
public void test096() throws Throwable {
SQLTransientConnectionException sQLTransientConnectionException0 = new SQLTransientConnectionException("net.sf.cglib.proxy.com.fasterxml.jackson.databind.JsonMappingException", "Failed to instantiate class ", (-67));
SQLFeatureNotSupportedException sQLFeatureNotSupportedException0 = new SQLFeatureNotSupportedException(sQLTransientConnectionException0);
SQLTransientConnectionException sQLTransientConnectionException1 = (SQLTransientConnectionException)ClassUtil.getRootCause(sQLFeatureNotSupportedException0);
assertEquals((-67), sQLTransientConnectionException1.getErrorCode());
}
@Test(timeout = 4000)
public void test097() throws Throwable {
BufferRecycler bufferRecycler0 = new BufferRecycler();
IOContext iOContext0 = new IOContext(bufferRecycler0, (Object) null, false);
ObjectMapper objectMapper0 = new ObjectMapper();
JsonNodeFactory jsonNodeFactory0 = JsonNodeFactory.withExactBigDecimals(false);
ObjectReader objectReader0 = objectMapper0.reader(jsonNodeFactory0);
ByteArrayBuilder byteArrayBuilder0 = new ByteArrayBuilder();
UTF8JsonGenerator uTF8JsonGenerator0 = new UTF8JsonGenerator(iOContext0, 1, objectReader0, byteArrayBuilder0);
JsonMappingException jsonMappingException0 = new JsonMappingException(uTF8JsonGenerator0, "annotation", (Throwable) null);
try {
ClassUtil.throwIfIOE(jsonMappingException0);
fail("Expecting exception: IOException");
} catch(IOException e) {
}
}
@Test(timeout = 4000)
public void test098() throws Throwable {
MockRuntimeException mockRuntimeException0 = new MockRuntimeException("");
SQLIntegrityConstraintViolationException sQLIntegrityConstraintViolationException0 = new SQLIntegrityConstraintViolationException(mockRuntimeException0);
Throwable throwable0 = ClassUtil.throwIfIOE(sQLIntegrityConstraintViolationException0);
assertEquals("java.sql.SQLIntegrityConstraintViolationException: org.evosuite.runtime.mock.java.lang.MockThrowable: ", throwable0.toString());
}
@Test(timeout = 4000)
public void test099() throws Throwable {
MockRuntimeException mockRuntimeException0 = new MockRuntimeException("kGzp1a}{(5K+QV4 ");
// Undeclared exception!
try {
ClassUtil.throwIfRTE(mockRuntimeException0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
}
}
@Test(timeout = 4000)
public void test100() throws Throwable {
Throwable throwable0 = ClassUtil.throwIfRTE((Throwable) null);
assertNull(throwable0);
}
@Test(timeout = 4000)
public void test101() throws Throwable {
Throwable throwable0 = ClassUtil.throwIfError((Throwable) null);
assertNull(throwable0);
}
@Test(timeout = 4000)
public void test102() throws Throwable {
Class<Object> class0 = Object.class;
boolean boolean0 = ClassUtil.isObjectOrPrimitive(class0);
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test103() throws Throwable {
Class<Double> class0 = Double.class;
boolean boolean0 = ClassUtil.isObjectOrPrimitive(class0);
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test104() throws Throwable {
Class<Long> class0 = Long.TYPE;
boolean boolean0 = ClassUtil.isObjectOrPrimitive(class0);
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test105() throws Throwable {
TypeFactory typeFactory0 = TypeFactory.defaultInstance();
Class<ReferenceType> class0 = ReferenceType.class;
ArrayType arrayType0 = typeFactory0.constructArrayType(class0);
Class<Error> class1 = Error.class;
List<JavaType> list0 = ClassUtil.findSuperTypes((JavaType) arrayType0, (Class<?>) class1, false);
assertEquals(0, list0.size());
}
@Test(timeout = 4000)
public void test106() throws Throwable {
Class<Object> class0 = Object.class;
Method[] methodArray0 = ClassUtil.getDeclaredMethods(class0);
assertEquals(12, methodArray0.length);
}
@Test(timeout = 4000)
public void test107() throws Throwable {
Class<ArrayType> class0 = ArrayType.class;
Type[] typeArray0 = ClassUtil.getGenericInterfaces(class0);
assertEquals(1, typeArray0.length);
}
@Test(timeout = 4000)
public void test108() throws Throwable {
BufferedOutputStream bufferedOutputStream0 = new BufferedOutputStream((OutputStream) null);
Double double0 = new Double(Double.POSITIVE_INFINITY);
JsonLocation jsonLocation0 = new JsonLocation(double0, 0L, (-638502591), (-1658));
JsonMappingException jsonMappingException0 = new JsonMappingException(bufferedOutputStream0, (String) null, jsonLocation0);
SQLRecoverableException sQLRecoverableException0 = new SQLRecoverableException("`java.lang.annotation.Annotation`", jsonMappingException0);
// Undeclared exception!
try {
ClassUtil.throwAsIAE((Throwable) sQLRecoverableException0, "`java.lang.annotation.Annotation`");
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// `java.lang.annotation.Annotation`
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test109() throws Throwable {
Class<Annotation> class0 = Annotation.class;
Type type0 = ClassUtil.getGenericSuperclass(class0);
assertNull(type0);
}
@Test(timeout = 4000)
public void test110() throws Throwable {
Class<AccessibleObject> class0 = AccessibleObject.class;
Constructor<AccessibleObject> constructor0 = ClassUtil.findConstructor(class0, true);
ClassUtil.Ctor classUtil_Ctor0 = new ClassUtil.Ctor(constructor0);
classUtil_Ctor0.getParameterAnnotations();
Annotation[][] annotationArray0 = classUtil_Ctor0.getParameterAnnotations();
assertTrue(constructor0.isAccessible());
assertNotNull(annotationArray0);
}
@Test(timeout = 4000)
public void test111() throws Throwable {
Class<AccessibleObject> class0 = AccessibleObject.class;
Constructor<AccessibleObject> constructor0 = ClassUtil.findConstructor(class0, true);
ClassUtil.Ctor classUtil_Ctor0 = new ClassUtil.Ctor(constructor0);
classUtil_Ctor0.getDeclaredAnnotations();
Annotation[] annotationArray0 = classUtil_Ctor0.getDeclaredAnnotations();
assertTrue(constructor0.isAccessible());
assertNotNull(annotationArray0);
}
@Test(timeout = 4000)
public void test112() throws Throwable {
Class<Object> class0 = Object.class;
Class<?> class1 = ClassUtil.getEnclosingClass(class0);
assertNull(class1);
}
@Test(timeout = 4000)
public void test113() throws Throwable {
Class<Object> class0 = Object.class;
Class<?> class1 = ClassUtil.getDeclaringClass(class0);
assertNull(class1);
}
@Test(timeout = 4000)
public void test114() throws Throwable {
Class<Double> class0 = Double.class;
Class<?> class1 = ClassUtil.getDeclaringClass(class0);
assertNull(class1);
}
@Test(timeout = 4000)
public void test115() throws Throwable {
Class<Float> class0 = Float.TYPE;
ClassUtil.Ctor[] classUtil_CtorArray0 = ClassUtil.getConstructors(class0);
assertEquals(0, classUtil_CtorArray0.length);
}
@Test(timeout = 4000)
public void test116() throws Throwable {
Class<Annotation> class0 = Annotation.class;
ClassUtil.Ctor[] classUtil_CtorArray0 = ClassUtil.getConstructors(class0);
assertEquals(0, classUtil_CtorArray0.length);
}
@Test(timeout = 4000)
public void test117() throws Throwable {
Class<Object> class0 = Object.class;
boolean boolean0 = ClassUtil.hasEnclosingMethod(class0);
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test118() throws Throwable {
Class<Integer> class0 = Integer.TYPE;
String string0 = ClassUtil.getPackageName(class0);
assertNull(string0);
}
@Test(timeout = 4000)
public void test119() throws Throwable {
boolean boolean0 = ClassUtil.isJacksonStdImpl((Object) "");
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test120() throws Throwable {
boolean boolean0 = ClassUtil.isJacksonStdImpl((Object) null);
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test121() throws Throwable {
Class<JsonDeserializer> class0 = JsonDeserializer.class;
Class<? extends Enum<?>> class1 = ClassUtil.findEnumType(class0);
assertEquals("class java.lang.Object", class1.toString());
}
@Test(timeout = 4000)
public void test122() throws Throwable {
Class<AccessPattern> class0 = AccessPattern.class;
Class<? extends Enum<?>> class1 = ClassUtil.findEnumType(class0);
assertTrue(class1.isEnum());
}
@Test(timeout = 4000)
public void test123() throws Throwable {
Class<AccessPattern> class0 = AccessPattern.class;
EnumMap<AccessPattern, Integer> enumMap0 = new EnumMap<AccessPattern, Integer>(class0);
AccessPattern accessPattern0 = AccessPattern.DYNAMIC;
Integer integer0 = new Integer(332);
enumMap0.put(accessPattern0, integer0);
Class<? extends Enum<?>> class1 = ClassUtil.findEnumType(enumMap0);
assertEquals("class com.fasterxml.jackson.databind.util.AccessPattern", class1.toString());
}
@Test(timeout = 4000)
public void test124() throws Throwable {
Class<AccessPattern> class0 = AccessPattern.class;
EnumMap<AccessPattern, Integer> enumMap0 = new EnumMap<AccessPattern, Integer>(class0);
Class<? extends Enum<?>> class1 = ClassUtil.findEnumType(enumMap0);
assertFalse(class1.isInterface());
}
@Test(timeout = 4000)
public void test125() throws Throwable {
AccessPattern accessPattern0 = AccessPattern.ALWAYS_NULL;
EnumSet<AccessPattern> enumSet0 = EnumSet.of(accessPattern0, accessPattern0, accessPattern0);
Class<? extends Enum<?>> class0 = ClassUtil.findEnumType(enumSet0);
Class<AccessPattern> class1 = AccessPattern.class;
Class<Float> class2 = Float.class;
SimpleType simpleType0 = SimpleType.constructUnsafe(class0);
TypeBindings typeBindings0 = TypeBindings.createIfNeeded((Class<?>) class2, (JavaType) simpleType0);
JavaType[] javaTypeArray0 = new JavaType[0];
MapType mapType0 = MapType.construct((Class<?>) class1, typeBindings0, (JavaType) simpleType0, javaTypeArray0, (JavaType) simpleType0, (JavaType) simpleType0);
ReferenceType referenceType0 = ReferenceType.upgradeFrom(mapType0, simpleType0);
ClassUtil.rawClass(referenceType0);
assertTrue(simpleType0.isFinal());
assertEquals(16385, class0.getModifiers());
}
@Test(timeout = 4000)
public void test126() throws Throwable {
Class<Error> class0 = Error.class;
Constructor<Error> constructor0 = ClassUtil.findConstructor(class0, true);
ClassUtil.checkAndFixAccess((Member) constructor0, false);
assertTrue(constructor0.isAccessible());
}
@Test(timeout = 4000)
public void test127() throws Throwable {
Class<Void> class0 = Void.class;
Constructor<Void> constructor0 = ClassUtil.findConstructor(class0, true);
ClassUtil.Ctor classUtil_Ctor0 = new ClassUtil.Ctor(constructor0);
ClassUtil.checkAndFixAccess((Member) classUtil_Ctor0._ctor, false);
assertTrue(constructor0.isAccessible());
}
@Test(timeout = 4000)
public void test128() throws Throwable {
Class<Character> class0 = Character.class;
Class<?> class1 = ClassUtil.primitiveType(class0);
assertEquals("char", class1.toString());
assertNotNull(class1);
}
@Test(timeout = 4000)
public void test129() throws Throwable {
Class<Short> class0 = Short.class;
Class<?> class1 = ClassUtil.primitiveType(class0);
assertEquals("short", class1.toString());
assertNotNull(class1);
}
@Test(timeout = 4000)
public void test130() throws Throwable {
Class<Byte> class0 = Byte.class;
Class<?> class1 = ClassUtil.primitiveType(class0);
assertNotNull(class1);
assertEquals("byte", class1.toString());
}
@Test(timeout = 4000)
public void test131() throws Throwable {
Class<Float> class0 = Float.class;
Class<?> class1 = ClassUtil.primitiveType(class0);
assertNotNull(class1);
assertEquals("float", class1.toString());
}
@Test(timeout = 4000)
public void test132() throws Throwable {
Class<Double> class0 = Double.class;
Class<?> class1 = ClassUtil.primitiveType(class0);
assertEquals("double", class1.toString());
assertNotNull(class1);
}
@Test(timeout = 4000)
public void test133() throws Throwable {
Class<MapLikeType> class0 = MapLikeType.class;
Class<?> class1 = ClassUtil.primitiveType(class0);
assertNull(class1);
}
@Test(timeout = 4000)
public void test134() throws Throwable {
Class<Integer> class0 = Integer.class;
Class<?> class1 = ClassUtil.primitiveType(class0);
assertNotNull(class1);
assertEquals("int", class1.toString());
}
@Test(timeout = 4000)
public void test135() throws Throwable {
Class<Character> class0 = Character.TYPE;
Class<?> class1 = ClassUtil.primitiveType(class0);
assertFalse(class1.isSynthetic());
}
@Test(timeout = 4000)
public void test136() throws Throwable {
Class<Character> class0 = Character.TYPE;
Class<?> class1 = ClassUtil.wrapperType(class0);
assertEquals("class java.lang.Character", class1.toString());
}
@Test(timeout = 4000)
public void test137() throws Throwable {
Class<Float> class0 = Float.TYPE;
Class<?> class1 = ClassUtil.wrapperType(class0);
assertFalse(class1.isInterface());
}
@Test(timeout = 4000)
public void test138() throws Throwable {
Class<Double> class0 = Double.TYPE;
Class<?> class1 = ClassUtil.wrapperType(class0);
assertFalse(class1.isPrimitive());
}
@Test(timeout = 4000)
public void test139() throws Throwable {
Class<Boolean> class0 = Boolean.TYPE;
Class<?> class1 = ClassUtil.wrapperType(class0);
assertEquals("class java.lang.Boolean", class1.toString());
}
@Test(timeout = 4000)
public void test140() throws Throwable {
Class<JsonMappingException> class0 = JsonMappingException.class;
// Undeclared exception!
try {
ClassUtil.wrapperType(class0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Class com.fasterxml.jackson.databind.JsonMappingException is not a primitive type
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test141() throws Throwable {
Class<Integer> class0 = Integer.TYPE;
Class<?> class1 = ClassUtil.wrapperType(class0);
assertFalse(class1.isArray());
}
@Test(timeout = 4000)
public void test142() throws Throwable {
Class<Long> class0 = Long.TYPE;
Class<?> class1 = ClassUtil.wrapperType(class0);
assertEquals("class java.lang.Long", class1.toString());
}
@Test(timeout = 4000)
public void test143() throws Throwable {
Class<Character> class0 = Character.TYPE;
Object object0 = ClassUtil.defaultValue(class0);
assertEquals('\u0000', object0);
}
@Test(timeout = 4000)
public void test144() throws Throwable {
Class<Short> class0 = Short.TYPE;
Object object0 = ClassUtil.defaultValue(class0);
assertEquals((short)0, object0);
}
@Test(timeout = 4000)
public void test145() throws Throwable {
Class<Byte> class0 = Byte.TYPE;
Object object0 = ClassUtil.defaultValue(class0);
assertEquals((byte)0, object0);
}
@Test(timeout = 4000)
public void test146() throws Throwable {
Class<ArrayType> class0 = ArrayType.class;
// Undeclared exception!
try {
ClassUtil.defaultValue(class0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Class com.fasterxml.jackson.databind.type.ArrayType is not a primitive type
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test147() throws Throwable {
Class<Double> class0 = Double.TYPE;
Object object0 = ClassUtil.defaultValue(class0);
assertEquals(0.0, object0);
}
@Test(timeout = 4000)
public void test148() throws Throwable {
Class<Boolean> class0 = Boolean.TYPE;
Object object0 = ClassUtil.defaultValue(class0);
assertEquals(false, object0);
}
@Test(timeout = 4000)
public void test149() throws Throwable {
Class<Long> class0 = Long.TYPE;
Object object0 = ClassUtil.defaultValue(class0);
assertEquals(0L, object0);
}
@Test(timeout = 4000)
public void test150() throws Throwable {
Class<Integer> class0 = Integer.TYPE;
Object object0 = ClassUtil.defaultValue(class0);
assertEquals(0, object0);
}
@Test(timeout = 4000)
public void test151() throws Throwable {
Class<Float> class0 = Float.TYPE;
Object object0 = ClassUtil.defaultValue(class0);
assertEquals(0.0F, object0);
}
@Test(timeout = 4000)
public void test152() throws Throwable {
String string0 = ClassUtil.backticked((String) null);
assertEquals("[null]", string0);
}
@Test(timeout = 4000)
public void test153() throws Throwable {
String string0 = ClassUtil.nameOf((Named) null);
assertEquals("[null]", string0);
}
@Test(timeout = 4000)
public void test154() throws Throwable {
Class<Boolean> class0 = Boolean.class;
Class<?> class1 = ClassUtil.primitiveType(class0);
String string0 = ClassUtil.nameOf(class1);
assertEquals("`boolean`", string0);
}
@Test(timeout = 4000)
public void test155() throws Throwable {
String string0 = ClassUtil.nameOf((Class<?>) null);
assertEquals("[null]", string0);
}
@Test(timeout = 4000)
public void test156() throws Throwable {
Double double0 = new Double(0.0);
String string0 = ClassUtil.classNameOf(double0);
assertEquals("`java.lang.Double`", string0);
}
@Test(timeout = 4000)
public void test157() throws Throwable {
Object object0 = new Object();
String string0 = ClassUtil.getClassDescription(object0);
assertEquals("`java.lang.Object`", string0);
}
@Test(timeout = 4000)
public void test158() throws Throwable {
String string0 = ClassUtil.getClassDescription((Object) null);
assertEquals("unknown", string0);
}
@Test(timeout = 4000)
public void test159() throws Throwable {
Class<SimpleType> class0 = SimpleType.class;
String string0 = ClassUtil.getClassDescription(class0);
assertEquals("`com.fasterxml.jackson.databind.type.SimpleType`", string0);
}
@Test(timeout = 4000)
public void test160() throws Throwable {
String string0 = ClassUtil.quotedOr((Object) null, (String) null);
assertNull(string0);
}
@Test(timeout = 4000)
public void test161() throws Throwable {
Class<Long> class0 = Long.class;
String string0 = ClassUtil.quotedOr(class0, "vals");
assertEquals("\"class java.lang.Long\"", string0);
}
@Test(timeout = 4000)
public void test162() throws Throwable {
String string0 = ClassUtil.nonNullString((String) null);
assertEquals("", string0);
}
@Test(timeout = 4000)
public void test163() throws Throwable {
String string0 = ClassUtil.nullOrToString((Object) null);
assertNull(string0);
}
@Test(timeout = 4000)
public void test164() throws Throwable {
Object object0 = new Object();
String string0 = ClassUtil.nullOrToString(object0);
assertNotNull(string0);
}
@Test(timeout = 4000)
public void test165() throws Throwable {
PlaceholderForType placeholderForType0 = ClassUtil.nonNull((PlaceholderForType) null, (PlaceholderForType) null);
assertNull(placeholderForType0);
}
@Test(timeout = 4000)
public void test166() throws Throwable {
Class<?> class0 = ClassUtil.rawClass((JavaType) null);
assertNull(class0);
}
@Test(timeout = 4000)
public void test167() throws Throwable {
Class<Annotation> class0 = Annotation.class;
TypeBindings typeBindings0 = TypeBindings.emptyBindings();
ResolvedRecursiveType resolvedRecursiveType0 = new ResolvedRecursiveType(class0, typeBindings0);
Class<?> class1 = ClassUtil.rawClass(resolvedRecursiveType0);
assertFalse(class1.isEnum());
}
@Test(timeout = 4000)
public void test168() throws Throwable {
Class<?> class0 = ClassUtil.classOf((Object) null);
assertNull(class0);
}
@Test(timeout = 4000)
public void test169() throws Throwable {
AccessPattern accessPattern0 = AccessPattern.ALWAYS_NULL;
Class<?> class0 = ClassUtil.classOf(accessPattern0);
assertFalse(class0.isSynthetic());
}
@Test(timeout = 4000)
public void test170() throws Throwable {
Class<NoClass> class0 = NoClass.class;
try {
ClassUtil.findConstructor(class0, false);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Default constructor for com.fasterxml.jackson.databind.annotation.NoClass is not accessible (non-public?): not allowed to try modify access via Reflection: cannot instantiate type
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test171() throws Throwable {
Class<String> class0 = String.class;
String string0 = ClassUtil.createInstance(class0, false);
assertEquals("", string0);
}
@Test(timeout = 4000)
public void test172() throws Throwable {
Class<PlaceholderForType> class0 = PlaceholderForType.class;
try {
ClassUtil.createInstance(class0, false);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// Class com.fasterxml.jackson.databind.type.PlaceholderForType has no default (no arg) constructor
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test173() throws Throwable {
JsonGeneratorDelegate jsonGeneratorDelegate0 = new JsonGeneratorDelegate((JsonGenerator) null, false);
SQLTransactionRollbackException sQLTransactionRollbackException0 = new SQLTransactionRollbackException("=@nXIf1w|A?Ccji;h");
// Undeclared exception!
try {
ClassUtil.closeOnFailAndThrowAsIOE((JsonGenerator) jsonGeneratorDelegate0, (Closeable) jsonGeneratorDelegate0, (Exception) sQLTransactionRollbackException0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.core.util.JsonGeneratorDelegate", e);
}
}
@Test(timeout = 4000)
public void test174() throws Throwable {
BeanDeserializerFactory beanDeserializerFactory0 = BeanDeserializerFactory.instance;
DefaultDeserializationContext.Impl defaultDeserializationContext_Impl0 = new DefaultDeserializationContext.Impl(beanDeserializerFactory0);
Long long0 = Long.valueOf(0L);
Class<String> class0 = String.class;
JsonMappingException jsonMappingException0 = defaultDeserializationContext_Impl0.weirdNumberException(long0, class0, "net.sf.cglib.proxy.com.fasterxml.jackson.databind.util.AccessPattern");
try {
ClassUtil.throwAsMappingException((DeserializationContext) defaultDeserializationContext_Impl0, (IOException) jsonMappingException0);
fail("Expecting exception: IOException");
} catch(IOException e) {
//
// Cannot deserialize value of type `java.lang.String` from number 0: net.sf.cglib.proxy.com.fasterxml.jackson.databind.util.AccessPattern
//
verifyException("com.fasterxml.jackson.databind.exc.InvalidFormatException", e);
}
}
@Test(timeout = 4000)
public void test175() throws Throwable {
MockIOException mockIOException0 = new MockIOException();
// Undeclared exception!
try {
ClassUtil.throwAsMappingException((DeserializationContext) null, (IOException) mockIOException0);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.JsonMappingException", e);
}
}
@Test(timeout = 4000)
public void test176() throws Throwable {
SQLFeatureNotSupportedException sQLFeatureNotSupportedException0 = new SQLFeatureNotSupportedException();
SQLTransientException sQLTransientException0 = new SQLTransientException("&mq\ns}2C<a8*nlp", "&mq\ns}2C<a8*nlp", 1094, sQLFeatureNotSupportedException0);
sQLFeatureNotSupportedException0.initCause(sQLTransientException0);
// Undeclared exception!
ClassUtil.unwrapAndThrowAsIAE((Throwable) sQLFeatureNotSupportedException0, ";4f`");
}
@Test(timeout = 4000)
public void test177() throws Throwable {
SQLTimeoutException sQLTimeoutException0 = new SQLTimeoutException();
// Undeclared exception!
try {
ClassUtil.closeOnFailAndThrowAsIOE((JsonGenerator) null, (Closeable) null, (Exception) sQLTimeoutException0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
//
// java.sql.SQLTimeoutException
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test178() throws Throwable {
MockError mockError0 = new MockError("[null]");
// Undeclared exception!
try {
ClassUtil.throwIfError(mockError0);
fail("Expecting exception: Error");
} catch(Error e) {
}
}
@Test(timeout = 4000)
public void test179() throws Throwable {
Class<Long> class0 = Long.class;
JsonFactory jsonFactory0 = new JsonFactory();
ObjectMapper objectMapper0 = new ObjectMapper(jsonFactory0);
JavaType javaType0 = TypeFactory.unknownType();
ObjectReader objectReader0 = objectMapper0.readerFor(javaType0);
TypeFactory typeFactory0 = objectReader0.getTypeFactory();
Class<Byte> class1 = Byte.class;
ArrayType arrayType0 = typeFactory0.constructArrayType(class1);
// Undeclared exception!
try {
ClassUtil.verifyMustOverride(class0, arrayType0, "org.hibernate.proxy.");
fail("Expecting exception: IllegalStateException");
} catch(IllegalStateException e) {
//
// Sub-class com.fasterxml.jackson.databind.type.ArrayType (of class java.lang.Long) must override method 'org.hibernate.proxy.'
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test180() throws Throwable {
FileSystemHandling fileSystemHandling0 = new FileSystemHandling();
Class<String> class0 = String.class;
boolean boolean0 = ClassUtil.hasClass(fileSystemHandling0, class0);
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test181() throws Throwable {
SQLClientInfoException sQLClientInfoException0 = new SQLClientInfoException();
JsonMappingException jsonMappingException0 = JsonMappingException.wrapWithPath((Throwable) sQLClientInfoException0, (JsonMappingException.Reference) null);
Class<JsonMappingException> class0 = JsonMappingException.class;
boolean boolean0 = ClassUtil.hasClass(jsonMappingException0, class0);
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test182() throws Throwable {
Class<Character> class0 = Character.class;
boolean boolean0 = ClassUtil.hasClass((Object) null, class0);
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test183() throws Throwable {
Class<Long> class0 = Long.class;
Class<?> class1 = ClassUtil.primitiveType(class0);
assertNotNull(class1);
ClassUtil.findClassAnnotations(class1);
assertEquals("long", class1.toString());
}
@Test(timeout = 4000)
public void test184() throws Throwable {
BufferRecycler bufferRecycler0 = new BufferRecycler();
IOContext iOContext0 = new IOContext(bufferRecycler0, (Object) null, false);
ObjectMapper objectMapper0 = new ObjectMapper();
JsonNodeFactory jsonNodeFactory0 = JsonNodeFactory.withExactBigDecimals(false);
ObjectReader objectReader0 = objectMapper0.reader(jsonNodeFactory0);
ByteArrayBuilder byteArrayBuilder0 = new ByteArrayBuilder();
PipedOutputStream pipedOutputStream0 = new PipedOutputStream();
PipedInputStream pipedInputStream0 = new PipedInputStream(pipedOutputStream0);
UTF8StreamJsonParser uTF8StreamJsonParser0 = new UTF8StreamJsonParser(iOContext0, (-5101), pipedInputStream0, objectMapper0, (ByteQuadsCanonicalizer) null, byteArrayBuilder0.NO_BYTES, (-518), 3769, false);
Class<ResolvedRecursiveType> class0 = ResolvedRecursiveType.class;
// Undeclared exception!
try {
objectReader0.readValue((JsonParser) uTF8StreamJsonParser0, class0);
fail("Expecting exception: ArrayIndexOutOfBoundsException");
} catch(ArrayIndexOutOfBoundsException e) {
//
// -518
//
verifyException("com.fasterxml.jackson.core.json.UTF8StreamJsonParser", e);
}
}
@Test(timeout = 4000)
public void test185() throws Throwable {
Class<Double> class0 = Double.class;
boolean boolean0 = ClassUtil.isNonStaticInnerClass(class0);
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test186() throws Throwable {
ObjectMapper objectMapper0 = new ObjectMapper();
JsonInclude.Include jsonInclude_Include0 = JsonInclude.Include.ALWAYS;
ObjectReader objectReader0 = objectMapper0.readerForUpdating(jsonInclude_Include0);
assertNotNull(objectReader0);
}
@Test(timeout = 4000)
public void test187() throws Throwable {
Class<NoClass> class0 = NoClass.class;
boolean boolean0 = ClassUtil.isBogusClass(class0);
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test188() throws Throwable {
Class<Void> class0 = Void.TYPE;
boolean boolean0 = ClassUtil.isBogusClass(class0);
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test189() throws Throwable {
Class<Double> class0 = Double.class;
boolean boolean0 = ClassUtil.isBogusClass(class0);
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test190() throws Throwable {
Class<Void> class0 = Void.class;
boolean boolean0 = ClassUtil.isBogusClass(class0);
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test191() throws Throwable {
Class<List> class0 = List.class;
boolean boolean0 = ClassUtil.isCollectionMapOrArray(class0);
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test192() throws Throwable {
Class<SimpleType> class0 = SimpleType.class;
boolean boolean0 = ClassUtil.isCollectionMapOrArray(class0);
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test193() throws Throwable {
Class<RuntimeException> class0 = RuntimeException.class;
Constructor<RuntimeException> constructor0 = ClassUtil.findConstructor(class0, true);
boolean boolean0 = ClassUtil.isConcrete((Member) constructor0);
assertTrue(boolean0);
assertTrue(constructor0.isAccessible());
}
@Test(timeout = 4000)
public void test194() throws Throwable {
Class<MapLikeType> class0 = MapLikeType.class;
boolean boolean0 = ClassUtil.isConcrete(class0);
assertTrue(boolean0);
}
@Test(timeout = 4000)
public void test195() throws Throwable {
Class<Boolean> class0 = Boolean.TYPE;
boolean boolean0 = ClassUtil.isConcrete(class0);
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test196() throws Throwable {
Class<Long> class0 = Long.TYPE;
boolean boolean0 = ClassUtil.isProxyType(class0);
assertFalse(boolean0);
}
@Test(timeout = 4000)
public void test197() throws Throwable {
Class<CollectionType> class0 = CollectionType.class;
Class<?> class1 = ClassUtil.getOuterClass(class0);
assertNull(class1);
}
@Test(timeout = 4000)
public void test198() throws Throwable {
Class<Integer> class0 = Integer.class;
String string0 = ClassUtil.isLocalType(class0, false);
assertNull(string0);
}
@Test(timeout = 4000)
public void test199() throws Throwable {
Class<Boolean> class0 = Boolean.TYPE;
String string0 = ClassUtil.canBeABeanType(class0);
assertNotNull(string0);
assertEquals("primitive", string0);
}
@Test(timeout = 4000)
public void test200() throws Throwable {
Class<AccessPattern> class0 = AccessPattern.class;
String string0 = ClassUtil.canBeABeanType(class0);
assertNotNull(string0);
assertEquals("enum", string0);
}
@Test(timeout = 4000)
public void test201() throws Throwable {
Class<Object> class0 = Object.class;
String string0 = ClassUtil.canBeABeanType(class0);
assertNull(string0);
}
@Test(timeout = 4000)
public void test202() throws Throwable {
Class<TextNode> class0 = TextNode.class;
Class<ArrayType> class1 = ArrayType.class;
List<Class<?>> list0 = ClassUtil.findRawSuperTypes(class0, class1, true);
assertEquals(8, list0.size());
}
@Test(timeout = 4000)
public void test203() throws Throwable {
Class<Integer> class0 = Integer.class;
Class<String> class1 = String.class;
List<Class<?>> list0 = ClassUtil.findRawSuperTypes(class0, class1, true);
List<Class<?>> list1 = ClassUtil.findSuperTypes(class0, class0, list0);
assertEquals(4, list1.size());
}
@Test(timeout = 4000)
public void test204() throws Throwable {
Class<ArrayType> class0 = ArrayType.class;
SimpleType simpleType0 = SimpleType.constructUnsafe(class0);
JavaType[] javaTypeArray0 = new JavaType[4];
TypeFactory typeFactory0 = TypeFactory.defaultInstance();
Class<HashMap> class1 = HashMap.class;
Class<Boolean> class2 = Boolean.class;
MapType mapType0 = typeFactory0.constructMapType(class1, class2, class0);
JavaType[] javaTypeArray1 = new JavaType[6];
javaTypeArray1[1] = (JavaType) simpleType0;
CollectionType collectionType0 = CollectionType.construct((Class<?>) class0, (TypeBindings) null, (JavaType) mapType0, javaTypeArray1, javaTypeArray1[1]);
ReferenceType referenceType0 = ReferenceType.construct((Class<?>) class0, (TypeBindings) null, (JavaType) collectionType0, javaTypeArray0, (JavaType) mapType0);
List<JavaType> list0 = ClassUtil.findSuperTypes((JavaType) referenceType0, (Class<?>) class1, false);
assertEquals(2, list0.size());
}
@Test(timeout = 4000)
public void test205() throws Throwable {
Class<String> class0 = String.class;
Class<Object> class1 = Object.class;
List<Class<?>> list0 = ClassUtil.findSuperClasses(class0, class1, true);
assertEquals(1, list0.size());
}
@Test(timeout = 4000)
public void test206() throws Throwable {
Class<TextNode> class0 = TextNode.class;
Class<AccessPattern> class1 = AccessPattern.class;
List<Class<?>> list0 = ClassUtil.findSuperClasses(class1, class0, false);
assertEquals(2, list0.size());
}
@Test(timeout = 4000)
public void test207() throws Throwable {
Class<IOException> class0 = IOException.class;
List<Class<?>> list0 = ClassUtil.findSuperClasses(class0, class0, false);
assertEquals(0, list0.size());
}
@Test(timeout = 4000)
public void test208() throws Throwable {
Class<IOException> class0 = IOException.class;
List<Class<?>> list0 = ClassUtil.findSuperClasses((Class<?>) null, class0, false);
assertTrue(list0.isEmpty());
}
@Test(timeout = 4000)
public void test209() throws Throwable {
Class<Object> class0 = Object.class;
Class<Byte> class1 = Byte.class;
List<Class<?>> list0 = ClassUtil.findRawSuperTypes(class0, class1, false);
assertTrue(list0.isEmpty());
}
@Test(timeout = 4000)
public void test210() throws Throwable {
Class<MapLikeType> class0 = MapLikeType.class;
List<Class<?>> list0 = ClassUtil.findRawSuperTypes((Class<?>) null, class0, false);
assertTrue(list0.isEmpty());
}
@Test(timeout = 4000)
public void test211() throws Throwable {
Class<Integer> class0 = Integer.class;
SimpleType simpleType0 = SimpleType.constructUnsafe(class0);
ReferenceType referenceType0 = ReferenceType.upgradeFrom(simpleType0, simpleType0);
List<JavaType> list0 = ClassUtil.findSuperTypes((JavaType) referenceType0, (Class<?>) class0, false);
assertEquals(0, list0.size());
}
@Test(timeout = 4000)
public void test212() throws Throwable {
Class<ArrayType> class0 = ArrayType.class;
List<JavaType> list0 = ClassUtil.findSuperTypes((JavaType) null, class0, true);
assertTrue(list0.isEmpty());
}
@Test(timeout = 4000)
public void test213() throws Throwable {
Class<IOException> class0 = IOException.class;
Constructor<IOException> constructor0 = ClassUtil.findConstructor(class0, true);
assertNotNull(constructor0);
ClassUtil.Ctor classUtil_Ctor0 = new ClassUtil.Ctor(constructor0);
classUtil_Ctor0.getDeclaringClass();
assertTrue(constructor0.isAccessible());
}
@Test(timeout = 4000)
public void test214() throws Throwable {
Class<RuntimeException> class0 = RuntimeException.class;
Constructor<RuntimeException> constructor0 = ClassUtil.findConstructor(class0, true);
ClassUtil.Ctor classUtil_Ctor0 = new ClassUtil.Ctor(constructor0);
Constructor<?> constructor1 = classUtil_Ctor0.getConstructor();
assertTrue(constructor1.isAccessible());
assertNotNull(constructor1);
}
@Test(timeout = 4000)
public void test215() throws Throwable {
SQLDataException sQLDataException0 = new SQLDataException();
// Undeclared exception!
try {
ClassUtil.unwrapAndThrowAsIAE((Throwable) sQLDataException0);
fail("Expecting exception: IllegalArgumentException");
} catch(IllegalArgumentException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test216() throws Throwable {
MockIOException mockIOException0 = new MockIOException();
try {
ClassUtil.throwRootCauseIfIOE(mockIOException0);
fail("Expecting exception: IOException");
} catch(IOException e) {
}
}
@Test(timeout = 4000)
public void test217() throws Throwable {
// Undeclared exception!
try {
ClassUtil.unwrapAndThrowAsIAE((Throwable) null, (String) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
}
}
@Test(timeout = 4000)
public void test218() throws Throwable {
Class<Boolean> class0 = Boolean.class;
Class<IOException> class1 = IOException.class;
List<Class<?>> list0 = ClassUtil.findSuperTypes(class0, class1);
assertEquals(2, list0.size());
}
@Test(timeout = 4000)
public void test219() throws Throwable {
Iterator<ClientInfoStatus> iterator0 = ClassUtil.emptyIterator();
assertNotNull(iterator0);
}
@Test(timeout = 4000)
public void test220() throws Throwable {
ClassUtil classUtil0 = new ClassUtil();
}
@Test(timeout = 4000)
public void test221() throws Throwable {
JsonFactory jsonFactory0 = new JsonFactory();
JsonGenerator jsonGenerator0 = jsonFactory0.createGenerator((DataOutput) null);
SQLInvalidAuthorizationSpecException sQLInvalidAuthorizationSpecException0 = new SQLInvalidAuthorizationSpecException("JSON", "JSON");
MockIOException mockIOException0 = new MockIOException(sQLInvalidAuthorizationSpecException0);
try {
ClassUtil.closeOnFailAndThrowAsIOE(jsonGenerator0, (Exception) mockIOException0);
fail("Expecting exception: IOException");
} catch(IOException e) {
}
}
@Test(timeout = 4000)
public void test222() throws Throwable {
Class<Long> class0 = Long.TYPE;
Method[] methodArray0 = ClassUtil.getClassMethods(class0);
assertEquals(0, methodArray0.length);
}
@Test(timeout = 4000)
public void test223() throws Throwable {
Class<String> class0 = String.class;
Field[] fieldArray0 = ClassUtil.getDeclaredFields(class0);
assertEquals(5, fieldArray0.length);
}
@Test(timeout = 4000)
public void test224() throws Throwable {
MockRuntimeException mockRuntimeException0 = new MockRuntimeException("M}g~1@s");
// Undeclared exception!
try {
ClassUtil.throwAsIAE((Throwable) mockRuntimeException0);
fail("Expecting exception: RuntimeException");
} catch(RuntimeException e) {
}
}
@Test(timeout = 4000)
public void test225() throws Throwable {
// Undeclared exception!
try {
ClassUtil.checkAndFixAccess((Member) null);
fail("Expecting exception: NullPointerException");
} catch(NullPointerException e) {
//
// no message in exception (getMessage() returned null)
//
verifyException("com.fasterxml.jackson.databind.util.ClassUtil", e);
}
}
@Test(timeout = 4000)
public void test226() throws Throwable {
AccessPattern accessPattern0 = AccessPattern.ALWAYS_NULL;
EnumSet<AccessPattern> enumSet0 = EnumSet.of(accessPattern0, accessPattern0, accessPattern0);
enumSet0.clear();
Class<? extends Enum<?>> class0 = ClassUtil.findEnumType(enumSet0);
assertFalse(class0.isSynthetic());
}
}
| [
"pderakhshanfar@serg2.ewi.tudelft.nl"
] | pderakhshanfar@serg2.ewi.tudelft.nl |
2cf30dff6c3c12e5426189db8341f2c7bd518693 | 728909e551ede7c7ce2de853e79a88a7094048ed | /src/main/java/org/springframework/samples/petclinic/model/Visit.java | 753ac56c26ee51e43a378763f33a95874887c224 | [
"Apache-2.0"
] | permissive | ShadySentry/tb2g-testing-spring | 4f2a38e04ec204a80b8201b2ac11b303ef51a4ef | 882ef6f4b5c58df97620ad1afc45dcb9c10bbff4 | refs/heads/master | 2022-08-03T06:36:43.844031 | 2020-05-26T13:55:32 | 2020-05-26T13:55:32 | 263,828,082 | 0 | 0 | Apache-2.0 | 2020-05-14T05:55:33 | 2020-05-14T05:55:32 | null | UTF-8 | Java | false | false | 2,896 | java | /*
* Copyright 2002-2013 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.samples.petclinic.model;
import org.springframework.format.annotation.DateTimeFormat;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.validation.constraints.NotEmpty;
import java.time.LocalDate;
/**
* Simple JavaBean domain object representing a visit.
*
* @author Ken Krebs
*/
@Entity
@Table(name = "visits")
public class Visit extends BaseEntity {
/**
* Holds value of property date.
*/
@Column(name = "visit_date")
@DateTimeFormat(pattern = "yyyy/MM/dd")
private LocalDate date;
/**
* Holds value of property description.
*/
@NotEmpty
@Column(name = "description")
private String description;
/**
* Holds value of property pet.
*/
@ManyToOne
@JoinColumn(name = "pet_id")
private Pet pet;
/**
* Creates a new instance of Visit for the current date
*/
public Visit() {
this.date = LocalDate.now();
}
/**
* Getter for property date.
*
* @return Value of property date.
*/
public LocalDate getDate() {
return this.date;
}
/**
* Setter for property date.
*
* @param date New value of property date.
*/
public void setDate(LocalDate date) {
this.date = date;
}
/**
* Getter for property description.
*
* @return Value of property description.
*/
public String getDescription() {
return this.description;
}
/**
* Setter for property description.
*
* @param description New value of property description.
*/
public void setDescription(String description) {
this.description = description;
}
/**
* Getter for property pet.
*
* @return Value of property pet.
*/
public Pet getPet() {
return this.pet;
}
/**
* Setter for property pet.
*
* @param pet New value of property pet.
*/
public void setPet(Pet pet) {
this.pet = pet;
}
}
| [
"eurohawk@gmail.com"
] | eurohawk@gmail.com |
6c1409a843c293c0c3f224ffd6cbe3c1d5dc21de | 31e702c3d5afd2093c5b779a084740f253b4ac1a | /app/src/main/java/com/example/vrushank/watchout/GPSTracker.java | decf37245f3b34dcb9ca65f7e5f0b57b82c7eae4 | [] | no_license | vrush03/watchout | d5be1408a584634fae0ddc5ac75f7cdc96c18122 | 47f4ff6f3c9a440779b047b01da7abdbce59421a | refs/heads/master | 2021-01-12T17:37:42.633048 | 2016-10-22T23:41:10 | 2016-10-22T23:41:10 | 71,620,861 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 6,344 | java | package com.example.vrushank.watchout;
import android.app.AlertDialog;
import android.app.Service;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.location.Location;
import android.location.LocationListener;
import android.location.LocationManager;
import android.os.Bundle;
import android.os.IBinder;
import android.provider.Settings;
import android.util.Log;
import static android.content.Context.LOCATION_SERVICE;
/**
* Created by vrushank on 23/10/16.
*/
public class GPSTracker extends Service implements LocationListener {
private final Context mContext;
// Flag for GPS status
boolean isGPSEnabled = false;
// Flag for network status
boolean isNetworkEnabled = false;
// Flag for GPS status
boolean canGetLocation = false;
Location location; // Location
double latitude; // Latitude
double longitude; // Longitude
// The minimum distance to change Updates in meters
private static final long MIN_DISTANCE_CHANGE_FOR_UPDATES = 10; // 10 meters
// The minimum time between updates in milliseconds
private static final long MIN_TIME_BW_UPDATES = 1000 * 60 * 1; // 1 minute
// Declaring a Location Manager
protected LocationManager locationManager;
public GPSTracker(Context context) {
this.mContext = context;
getLocation();
}
public Location getLocation() {
try {
locationManager = (LocationManager) mContext
.getSystemService(LOCATION_SERVICE);
// Getting GPS status
isGPSEnabled = locationManager
.isProviderEnabled(LocationManager.GPS_PROVIDER);
// Getting network status
isNetworkEnabled = locationManager
.isProviderEnabled(LocationManager.NETWORK_PROVIDER);
if (!isGPSEnabled && !isNetworkEnabled) {
// No network provider is enabled
} else {
this.canGetLocation = true;
if (isNetworkEnabled) {
locationManager.requestLocationUpdates(
LocationManager.NETWORK_PROVIDER,
MIN_TIME_BW_UPDATES,
MIN_DISTANCE_CHANGE_FOR_UPDATES, this);
Log.d("Network", "Network");
if (locationManager != null) {
location = locationManager
.getLastKnownLocation(LocationManager.NETWORK_PROVIDER);
if (location != null) {
latitude = location.getLatitude();
longitude = location.getLongitude();
}
}
}
// If GPS enabled, get latitude/longitude using GPS Services
if (isGPSEnabled) {
if (location == null) {
locationManager.requestLocationUpdates(
LocationManager.GPS_PROVIDER,
MIN_TIME_BW_UPDATES,
MIN_DISTANCE_CHANGE_FOR_UPDATES, this);
Log.d("GPS Enabled", "GPS Enabled");
if (locationManager != null) {
location = locationManager
.getLastKnownLocation(LocationManager.GPS_PROVIDER);
if (location != null) {
latitude = location.getLatitude();
longitude = location.getLongitude();
}
}
}
}
}
}
catch (Exception e) {
e.printStackTrace();
}
return location;
}
/**
* Stop using GPS listener
* Calling this function will stop using GPS in your app.
* */
public void stopUsingGPS(){
if(locationManager != null){
locationManager.removeUpdates(GPSTracker.this);
}
}
/**
* Function to get latitude
* */
public double getLatitude(){
if(location != null){
latitude = location.getLatitude();
}
// return latitude
return latitude;
}
/**
* Function to get longitude
* */
public double getLongitude(){
if(location != null){
longitude = location.getLongitude();
}
// return longitude
return longitude;
}
/**
* Function to check GPS/Wi-Fi enabled
* @return boolean
* */
public boolean canGetLocation() {
return this.canGetLocation;
}
/**
* Function to show settings alert dialog.
* On pressing the Settings button it will launch Settings Options.
* */
public void showSettingsAlert(){
AlertDialog.Builder alertDialog = new AlertDialog.Builder(mContext);
// Setting Dialog Title
alertDialog.setTitle("GPS is settings");
// Setting Dialog Message
alertDialog.setMessage("GPS is not enabled. Do you want to go to settings menu?");
// On pressing the Settings button.
alertDialog.setPositiveButton("Settings", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog,int which) {
Intent intent = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);
mContext.startActivity(intent);
}
});
// On pressing the cancel button
alertDialog.setNegativeButton("Cancel", new DialogInterface.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
dialog.cancel();
}
});
// Showing Alert Message
alertDialog.show();
}
@Override
public void onLocationChanged(Location location) {
}
@Override
public void onProviderDisabled(String provider) {
}
@Override
public void onProviderEnabled(String provider) {
}
@Override
public void onStatusChanged(String provider, int status, Bundle extras) {
}
@Override
public IBinder onBind(Intent arg0) {
return null;
}
}
| [
"uvrushank21@gmail.com"
] | uvrushank21@gmail.com |
8ca8338bc8231cfcab2d3f5a3f293374f410e326 | c756b9c3053bfe0259bb8f92158d86ab98da6b53 | /src/tiketbus/PilihKursi.java | 31f022f1e86846bee1ca42f84d29638e5d5aacdd | [] | no_license | tengkunopri/Projek-UAS-Analog_TiketBus | 6f3e40367d8709fab7a8e4bac56df5552869a843 | da0f5c039b0874e50272a690fc723f3e683b3a27 | refs/heads/master | 2022-10-17T21:45:42.915983 | 2020-06-20T14:22:25 | 2020-06-20T14:22:25 | 273,720,937 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 29,169 | java | package tiketbus;
import java.awt.Button;
import java.awt.Color;
import tiketbus.data.Datatiket;
public class PilihKursi extends javax.swing.JFrame {
private int kursi = 0;
public PilihKursi() {
initComponents();
BatalkanKursi();
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
jPanel1 = new javax.swing.JPanel();
jButton1 = new javax.swing.JButton();
bt2 = new javax.swing.JButton();
bt3 = new javax.swing.JButton();
bt4 = new javax.swing.JButton();
bt5 = new javax.swing.JButton();
bt6 = new javax.swing.JButton();
bt7 = new javax.swing.JButton();
bt8 = new javax.swing.JButton();
bt9 = new javax.swing.JButton();
bt10 = new javax.swing.JButton();
bt11 = new javax.swing.JButton();
bt12 = new javax.swing.JButton();
bt13 = new javax.swing.JButton();
bt14 = new javax.swing.JButton();
bt15 = new javax.swing.JButton();
bt16 = new javax.swing.JButton();
bt17 = new javax.swing.JButton();
bt1 = new javax.swing.JButton();
bt18 = new javax.swing.JButton();
bt19 = new javax.swing.JButton();
bt20 = new javax.swing.JButton();
bt21 = new javax.swing.JButton();
btBack = new javax.swing.JButton();
btNext = new javax.swing.JButton();
jSeparator1 = new javax.swing.JSeparator();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(255, 204, 153), 10));
jButton1.setText("Supir");
bt2.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
bt2.setText("02");
bt2.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
bt2MousePressed(evt);
}
});
bt2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
bt2ActionPerformed(evt);
}
});
bt3.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
bt3.setText("03");
bt3.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
bt3MousePressed(evt);
}
});
bt3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
bt3ActionPerformed(evt);
}
});
bt4.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
bt4.setText("04");
bt4.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
bt4MousePressed(evt);
}
});
bt5.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
bt5.setText("05");
bt5.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
bt5MousePressed(evt);
}
});
bt6.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
bt6.setText("06");
bt6.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
bt6MousePressed(evt);
}
});
bt7.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
bt7.setText("07");
bt7.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
bt7MousePressed(evt);
}
});
bt8.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
bt8.setText("08");
bt8.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
bt8MousePressed(evt);
}
});
bt9.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
bt9.setText("09");
bt9.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
bt9MousePressed(evt);
}
});
bt10.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
bt10.setText("10");
bt10.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
bt10MousePressed(evt);
}
});
bt11.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
bt11.setText("11");
bt11.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
bt11MousePressed(evt);
}
});
bt12.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
bt12.setText("12");
bt12.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
bt12MousePressed(evt);
}
});
bt13.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
bt13.setText("13");
bt13.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
bt13MousePressed(evt);
}
});
bt14.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
bt14.setText("14");
bt14.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
bt14MousePressed(evt);
}
});
bt15.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
bt15.setText("15");
bt15.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
bt15MousePressed(evt);
}
});
bt16.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
bt16.setText("16");
bt16.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
bt16MousePressed(evt);
}
});
bt17.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
bt17.setText("17");
bt17.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
bt17MousePressed(evt);
}
});
bt1.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
bt1.setText("01");
bt1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
bt1MousePressed(evt);
}
});
bt1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
bt1ActionPerformed(evt);
}
});
bt18.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
bt18.setText("18");
bt18.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
bt18MousePressed(evt);
}
});
bt19.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
bt19.setText("19");
bt19.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
bt19MousePressed(evt);
}
});
bt20.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
bt20.setText("20");
bt20.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
bt20MousePressed(evt);
}
});
bt21.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
bt21.setText("21");
bt21.addMouseListener(new java.awt.event.MouseAdapter() {
public void mousePressed(java.awt.event.MouseEvent evt) {
bt21MousePressed(evt);
}
});
btBack.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
btBack.setText("Back");
btBack.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btBackActionPerformed(evt);
}
});
btNext.setFont(new java.awt.Font("Tahoma", 0, 18)); // NOI18N
btNext.setText("Next");
btNext.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btNextActionPerformed(evt);
}
});
jSeparator1.setBackground(new java.awt.Color(255, 204, 153));
jSeparator1.setForeground(new java.awt.Color(255, 204, 153));
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
.addGap(64, 64, 64)
.addComponent(bt1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jButton1)
.addGap(86, 86, 86))
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(33, 33, 33)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(bt18, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(bt14, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 61, Short.MAX_VALUE)
.addComponent(bt10, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(bt11, javax.swing.GroupLayout.DEFAULT_SIZE, 65, Short.MAX_VALUE)
.addComponent(bt15, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(bt19, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(bt2, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(bt3, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(bt6, javax.swing.GroupLayout.PREFERRED_SIZE, 61, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(bt7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
.addGap(40, 40, 40)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(bt4, javax.swing.GroupLayout.DEFAULT_SIZE, 59, Short.MAX_VALUE)
.addComponent(bt8, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(bt12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(bt16, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(bt20, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(bt13, javax.swing.GroupLayout.DEFAULT_SIZE, 61, Short.MAX_VALUE)
.addComponent(bt9, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(bt5, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(bt17, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(bt21, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(35, Short.MAX_VALUE))
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(btBack, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btNext, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
.addComponent(jSeparator1, javax.swing.GroupLayout.Alignment.TRAILING)
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addGap(32, 32, 32)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(bt1, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(50, 50, 50)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(bt2, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(bt3, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(bt4, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(bt5, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(bt6, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(bt7, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(bt8, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(bt9, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(bt10, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(bt11, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(bt12, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(bt13, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(bt14, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(bt15, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(bt16, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(bt17, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(bt18, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(bt19, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(bt20, javax.swing.GroupLayout.PREFERRED_SIZE, 45, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(bt21, javax.swing.GroupLayout.PREFERRED_SIZE, 46, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 88, Short.MAX_VALUE)
.addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(btNext, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(btBack, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(17, 17, 17))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap())
);
pack();
}// </editor-fold>//GEN-END:initComponents
private void bt2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt2ActionPerformed
}//GEN-LAST:event_bt2ActionPerformed
private void btBackActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btBackActionPerformed
this.setVisible(false);
prevFrame();
}//GEN-LAST:event_btBackActionPerformed
private void btNextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btNextActionPerformed
Datatiket.NomorKursi = Integer.toString(kursi);
new Booking().setVisible(true);
}//GEN-LAST:event_btNextActionPerformed
private void bt1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt1ActionPerformed
}//GEN-LAST:event_bt1ActionPerformed
private void bt1MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bt1MousePressed
if (kursi != 0){
BatalkanKursi();
}
kursi = 1;
bt1.setBackground(Color.pink);
}//GEN-LAST:event_bt1MousePressed
private void bt2MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bt2MousePressed
if (kursi != 0){
BatalkanKursi();
}
kursi = 2;
bt2.setBackground(Color.pink);
}//GEN-LAST:event_bt2MousePressed
private void bt3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_bt3ActionPerformed
}//GEN-LAST:event_bt3ActionPerformed
private void bt3MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bt3MousePressed
if (kursi != 0){
BatalkanKursi();
}
kursi = 3;
bt3.setBackground(Color.pink);
}//GEN-LAST:event_bt3MousePressed
private void bt4MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bt4MousePressed
if (kursi != 0){
BatalkanKursi();
}
kursi = 4;
bt4.setBackground(Color.pink);
}//GEN-LAST:event_bt4MousePressed
private void bt5MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bt5MousePressed
if (kursi != 0){
BatalkanKursi();
}
kursi = 5;
bt5.setBackground(Color.pink);
}//GEN-LAST:event_bt5MousePressed
private void bt6MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bt6MousePressed
if (kursi != 0){
BatalkanKursi();
}
kursi = 6;
bt6.setBackground(Color.pink);
}//GEN-LAST:event_bt6MousePressed
private void bt7MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bt7MousePressed
if (kursi != 0){
BatalkanKursi();
}
kursi = 7;
bt7.setBackground(Color.pink);
}//GEN-LAST:event_bt7MousePressed
private void bt8MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bt8MousePressed
if (kursi != 0){
BatalkanKursi();
}
kursi = 8;
bt8.setBackground(Color.pink);
}//GEN-LAST:event_bt8MousePressed
private void bt9MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bt9MousePressed
if (kursi != 0){
BatalkanKursi();
}
kursi = 9;
bt9.setBackground(Color.pink);
}//GEN-LAST:event_bt9MousePressed
private void bt10MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bt10MousePressed
if (kursi != 0){
BatalkanKursi();
}
kursi = 10;
bt10.setBackground(Color.pink);
}//GEN-LAST:event_bt10MousePressed
private void bt11MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bt11MousePressed
if (kursi != 0){
BatalkanKursi();
}
kursi = 11;
bt11.setBackground(Color.pink);
}//GEN-LAST:event_bt11MousePressed
private void bt12MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bt12MousePressed
if (kursi != 0){
BatalkanKursi();
}
kursi = 12;
bt12.setBackground(Color.pink);
}//GEN-LAST:event_bt12MousePressed
private void bt13MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bt13MousePressed
if (kursi != 0){
BatalkanKursi();
}
kursi = 13;
bt13.setBackground(Color.pink);
}//GEN-LAST:event_bt13MousePressed
private void bt14MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bt14MousePressed
if (kursi != 0){
BatalkanKursi();
}
kursi = 14;
bt14.setBackground(Color.pink);
}//GEN-LAST:event_bt14MousePressed
private void bt15MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bt15MousePressed
if (kursi != 0){
BatalkanKursi();
}
kursi = 15;
bt15.setBackground(Color.pink);
}//GEN-LAST:event_bt15MousePressed
private void bt16MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bt16MousePressed
if (kursi != 0){
BatalkanKursi();
}
kursi = 16;
bt16.setBackground(Color.pink);
}//GEN-LAST:event_bt16MousePressed
private void bt17MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bt17MousePressed
if (kursi != 0){
BatalkanKursi();
}
kursi = 17;
bt17.setBackground(Color.pink);
}//GEN-LAST:event_bt17MousePressed
private void bt18MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bt18MousePressed
if (kursi != 0){
BatalkanKursi();
}
kursi = 18;
bt18.setBackground(Color.pink);
}//GEN-LAST:event_bt18MousePressed
private void bt19MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bt19MousePressed
if (kursi != 0){
BatalkanKursi();
}
kursi = 19;
bt19.setBackground(Color.pink);
}//GEN-LAST:event_bt19MousePressed
private void bt20MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bt20MousePressed
if (kursi != 0){
BatalkanKursi();
}
kursi = 20;
bt20.setBackground(Color.pink);
}//GEN-LAST:event_bt20MousePressed
private void bt21MousePressed(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_bt21MousePressed
if (kursi != 0){
BatalkanKursi();
}
kursi = 21;
bt13.setBackground(Color.pink);
}//GEN-LAST:event_bt21MousePressed
private void BatalkanKursi() {
bt1.setBackground(Color.GRAY);
bt2.setBackground(Color.GRAY);
bt3.setBackground(Color.GRAY);
bt4.setBackground(Color.GRAY);
bt5.setBackground(Color.GRAY);
bt6.setBackground(Color.GRAY);
bt7.setBackground(Color.GRAY);
bt8.setBackground(Color.GRAY);
bt9.setBackground(Color.GRAY);
bt10.setBackground(Color.GRAY);
bt11.setBackground(Color.GRAY);
bt12.setBackground(Color.GRAY);
bt13.setBackground(Color.GRAY);
bt14.setBackground(Color.GRAY);
bt15.setBackground(Color.GRAY);
bt16.setBackground(Color.GRAY);
bt17.setBackground(Color.GRAY);
bt18.setBackground(Color.GRAY);
bt19.setBackground(Color.GRAY);
bt20.setBackground(Color.GRAY);
bt21.setBackground(Color.GRAY);
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new PilihKursi().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton bt1;
private javax.swing.JButton bt10;
private javax.swing.JButton bt11;
private javax.swing.JButton bt12;
private javax.swing.JButton bt13;
private javax.swing.JButton bt14;
private javax.swing.JButton bt15;
private javax.swing.JButton bt16;
private javax.swing.JButton bt17;
private javax.swing.JButton bt18;
private javax.swing.JButton bt19;
private javax.swing.JButton bt2;
private javax.swing.JButton bt20;
private javax.swing.JButton bt21;
private javax.swing.JButton bt3;
private javax.swing.JButton bt4;
private javax.swing.JButton bt5;
private javax.swing.JButton bt6;
private javax.swing.JButton bt7;
private javax.swing.JButton bt8;
private javax.swing.JButton bt9;
private javax.swing.JButton btBack;
private javax.swing.JButton btNext;
private javax.swing.JButton jButton1;
private javax.swing.JPanel jPanel1;
private javax.swing.JSeparator jSeparator1;
// End of variables declaration//GEN-END:variables
private void prevFrame() {
}
}
| [
"tengkunopri@gmail.com"
] | tengkunopri@gmail.com |
6b76c3c351e8578b6e636931a769680b6a0258b5 | 4df9b40c03f51d3ac60d886a1909e96c06278f88 | /src/apps/PartialTreeList.java | 9cfb5133683d76adcb30c69cfdaed73d2caf15e3 | [] | no_license | zainsiddiqui/Minimum-Spanning-Tree | 8f3d6388d05a59ffea565608d910954f868ad822 | 16a372d88a36e24e9d6989367ba6ec6eb4b061ab | refs/heads/master | 2020-03-30T18:45:43.512258 | 2018-10-04T03:37:09 | 2018-10-04T03:37:09 | 151,513,731 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,291 | java | package apps;
import java.util.Iterator;
import java.util.NoSuchElementException;
import structures.Vertex;
public class PartialTreeList implements Iterable<PartialTree> {
/**
* Inner class - to build the partial tree circular linked list
*
*/
public static class Node {
/**
* Partial tree
*/
public PartialTree tree;
/**
* Next node in linked list
*/
public Node next;
/**
* Initializes this node by setting the tree part to the given tree,
* and setting next part to null
*
* @param tree Partial tree
*/
public Node(PartialTree tree) {
this.tree = tree;
next = null;
}
}
/**
* Pointer to last node of the circular linked list
*/
private Node rear;
/**
* Number of nodes in the CLL
*/
private int size;
/**
* Initializes this list to empty
*/
public PartialTreeList() {
rear = null;
size = 0;
}
/**
* Adds a new tree to the end of the list
*
* @param tree Tree to be added to the end of the list
*/
public void append(PartialTree tree) {
Node ptr = new Node(tree);
if (rear == null) {
ptr.next = ptr;
} else {
ptr.next = rear.next;
rear.next = ptr;
}
rear = ptr;
size++;
}
/**
* Removes the tree that is at the front of the list.
*
* @return The tree that is removed from the front
* @throws NoSuchElementException If the list is empty
*/
public PartialTree remove()
throws NoSuchElementException {
//Using a Circular Linked List with rear node given
//Checking if rear is null, if it is than throw exception
if(rear==null) { throw new NoSuchElementException("ERROR: Tree is Null"); }
//If only one node in CLL, return node's partial tree
//Decrement size by 1
if(size==1 && rear != null) {
PartialTree z = rear.tree;
rear=null;
size--;
return z;
}
//If more than one node, than remove rear.next as that is the front of the CLL
//Decrement size by 1
//Also rear.next should point to rear.next.next
Node tree = rear.next;
rear.next = rear.next.next;
size--;
return tree.tree;
}
/**
* Removes the tree in this list that contains a given vertex.
*
* @param vertex Vertex whose tree is to be removed
* @return The tree that is removed
* @throws NoSuchElementException If there is no matching tree
*/
public PartialTree removeTreeContaining(Vertex vertex)
throws NoSuchElementException {
//Use Circular Linked List again
//1. If size == 0, throw exception
//2. If size == 1, check if vertex is present within current tree, otherwise throw an exception
//3. If size > 1, go through LL and check vertices
if(size==0) { throw new NoSuchElementException("Error: Tree is empty"); }
if(size==1) {
if(containsVertex(rear, vertex)){
PartialTree t;
t=rear.tree;
rear = null;
return t;
}else {
throw new NoSuchElementException("ERROR: Vertex cannot be found");
}
}
// If size is greater than one
//Creating pointer
Node ptr=rear;
//Check if ptr.next tree's vertex contains the vertex passed
while( ptr.next != rear ) {
if(containsVertex(ptr.next, vertex)){
PartialTree temp=ptr.next.tree;
ptr.next=ptr.next.next;
size--;
return temp;
}
ptr=ptr.next;
}
if (containsVertex(ptr.next, vertex)){
PartialTree temp = ptr.next.tree;
ptr.next = ptr.next.next;
rear = ptr;
size--;
return temp;
}
//If all fails...
throw new NoSuchElementException("ERROR: Tree containing vertex cannot be found!!!");
}
private static boolean containsVertex(Node ptr, Vertex v) {
if (ptr.tree.getRoot().equals(v.getRoot())) {
return true;
}else {
return false;
}
}
/**
* Gives the number of trees in this list
*
* @return Number of trees
*/
public int size() {
return size;
}
/**
* Returns an Iterator that can be used to step through the trees in this list.
* The iterator does NOT support remove.
*
* @return Iterator for this list
*/
public Iterator<PartialTree> iterator() {
return new PartialTreeListIterator(this);
}
private class PartialTreeListIterator implements Iterator<PartialTree> {
private PartialTreeList.Node ptr;
private int rest;
public PartialTreeListIterator(PartialTreeList target) {
rest = target.size;
ptr = rest > 0 ? target.rear.next : null;
}
public PartialTree next()
throws NoSuchElementException {
if (rest <= 0) {
throw new NoSuchElementException();
}
PartialTree ret = ptr.tree;
ptr = ptr.next;
rest--;
return ret;
}
public boolean hasNext() {
return rest != 0;
}
public void remove()
throws UnsupportedOperationException {
throw new UnsupportedOperationException();
}
}
}
| [
"zainsid11@gmail.com"
] | zainsid11@gmail.com |
f71c06447b448730df29892b5ca77ccddc3dd2d9 | 4b617ee6c790f4089f9302dd1e03db450503dc2a | /gensrc/concerttours/jalo/GeneratedNotLoremIpsumConstraint.java | 01718bd99c6845cd96b4b27c5c729073b136c814 | [] | no_license | rpalacgi/concerttours | 404ec60001a2cf5aec4a1874c9b9d9d4c944899f | b62ba1a222fb1288946cd60bee15d8867a17b1a5 | refs/heads/master | 2021-09-02T10:07:25.879294 | 2018-01-01T19:00:15 | 2018-01-01T19:00:15 | 115,939,891 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,196 | java | /*
* ----------------------------------------------------------------
* --- WARNING: THIS FILE IS GENERATED AND WILL BE OVERWRITTEN! ---
* --- Generated at Nov 29, 2017 1:11:37 AM ---
* ----------------------------------------------------------------
*/
package concerttours.jalo;
import de.hybris.platform.jalo.Item.AttributeMode;
import de.hybris.platform.validation.jalo.constraints.AttributeConstraint;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
/**
* Generated class for type {@link de.hybris.platform.validation.jalo.constraints.AttributeConstraint NotLoremIpsumConstraint}.
*/
@SuppressWarnings({"deprecation","unused","cast","PMD"})
public abstract class GeneratedNotLoremIpsumConstraint extends AttributeConstraint
{
protected static final Map<String, AttributeMode> DEFAULT_INITIAL_ATTRIBUTES;
static
{
final Map<String, AttributeMode> tmp = new HashMap<String, AttributeMode>(AttributeConstraint.DEFAULT_INITIAL_ATTRIBUTES);
DEFAULT_INITIAL_ATTRIBUTES = Collections.unmodifiableMap(tmp);
}
@Override
protected Map<String, AttributeMode> getDefaultAttributeModes()
{
return DEFAULT_INITIAL_ATTRIBUTES;
}
}
| [
"robbiwan@Robbis-MacBook-Pro.local"
] | robbiwan@Robbis-MacBook-Pro.local |
7ba2160bb5980bae336bfae342864631554f3de9 | 60c6cd605df8ee0a5956262d86f103fe77500442 | /app/src/main/java/com/example/pick/TensorFlowImageClassifier.java | 0fa84d995a4c7d0d13795dd551881c3769a86a06 | [] | no_license | YeomJuhui/Pick | fdea86a9042821f5f467d9293cdb077233903c1f | e0d1e16d408de8230d05b1d8f9e7e48252a61842 | refs/heads/master | 2023-05-07T04:55:58.730277 | 2021-05-28T06:07:59 | 2021-05-28T06:07:59 | 371,595,938 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 7,133 | java | package com.example.pick;
import android.annotation.SuppressLint;
import android.content.res.AssetFileDescriptor;
import android.content.res.AssetManager;
import android.graphics.Bitmap;
import org.tensorflow.lite.Interpreter;
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.PriorityQueue;
/**
* Created by amitshekhar on 17/03/18.
*/
public class TensorFlowImageClassifier implements Classifier {
private static final int MAX_RESULTS = 3;
private static final int BATCH_SIZE = 1;
private static final int PIXEL_SIZE = 3;
private static final float THRESHOLD = 0.1f;
private static final int IMAGE_MEAN = 128;
private static final float IMAGE_STD = 128.0f;
private Interpreter interpreter;
private int inputSize;
private List<String> labelList;
private boolean quant;
private TensorFlowImageClassifier() {
}
static Classifier create(AssetManager assetManager,
String modelPath,
String labelPath,
int inputSize,
boolean quant) throws IOException {
TensorFlowImageClassifier classifier = new TensorFlowImageClassifier();
classifier.interpreter = new Interpreter(classifier.loadModelFile(assetManager, modelPath), new Interpreter.Options());
classifier.labelList = classifier.loadLabelList(assetManager, labelPath);
classifier.inputSize = inputSize;
classifier.quant = quant;
return classifier;
}
@Override
public List<Recognition> recognizeImage(Bitmap bitmap) {
ByteBuffer byteBuffer = convertBitmapToByteBuffer(bitmap);
if(quant){
byte[][] result = new byte[1][labelList.size()];
interpreter.run(byteBuffer, result);
return getSortedResultByte(result);
} else {
float [][] result = new float[1][labelList.size()];
interpreter.run(byteBuffer, result);
return getSortedResultFloat(result);
}
}
@Override
public void close() {
interpreter.close();
interpreter = null;
}
private MappedByteBuffer loadModelFile(AssetManager assetManager, String modelPath) throws IOException {
AssetFileDescriptor fileDescriptor = assetManager.openFd(modelPath);
FileInputStream inputStream = new FileInputStream(fileDescriptor.getFileDescriptor());
FileChannel fileChannel = inputStream.getChannel();
long startOffset = fileDescriptor.getStartOffset();
long declaredLength = fileDescriptor.getDeclaredLength();
return fileChannel.map(FileChannel.MapMode.READ_ONLY, startOffset, declaredLength);
}
private List<String> loadLabelList(AssetManager assetManager, String labelPath) throws IOException {
List<String> labelList = new ArrayList<>();
BufferedReader reader = new BufferedReader(new InputStreamReader(assetManager.open(labelPath)));
String line;
while ((line = reader.readLine()) != null) {
labelList.add(line);
}
reader.close();
return labelList;
}
private ByteBuffer convertBitmapToByteBuffer(Bitmap bitmap) {
ByteBuffer byteBuffer;
if(quant) {
byteBuffer = ByteBuffer.allocateDirect(BATCH_SIZE * inputSize * inputSize * PIXEL_SIZE);
} else {
byteBuffer = ByteBuffer.allocateDirect(4 * BATCH_SIZE * inputSize * inputSize * PIXEL_SIZE);
}
byteBuffer.order(ByteOrder.nativeOrder());
int[] intValues = new int[inputSize * inputSize];
bitmap.getPixels(intValues, 0, bitmap.getWidth(), 0, 0, bitmap.getWidth(), bitmap.getHeight());
int pixel = 0;
for (int i = 0; i < inputSize; ++i) {
for (int j = 0; j < inputSize; ++j) {
final int val = intValues[pixel++];
if(quant){
byteBuffer.put((byte) ((val >> 16) & 0xFF));
byteBuffer.put((byte) ((val >> 8) & 0xFF));
byteBuffer.put((byte) (val & 0xFF));
} else {
byteBuffer.putFloat((((val >> 16) & 0xFF)-IMAGE_MEAN)/IMAGE_STD);
byteBuffer.putFloat((((val >> 8) & 0xFF)-IMAGE_MEAN)/IMAGE_STD);
byteBuffer.putFloat((((val) & 0xFF)-IMAGE_MEAN)/IMAGE_STD);
}
}
}
return byteBuffer;
}
@SuppressLint("DefaultLocale")
private List<Recognition> getSortedResultByte(byte[][] labelProbArray) {
PriorityQueue<Recognition> pq =
new PriorityQueue<>(
MAX_RESULTS,
new Comparator<Recognition>() {
@Override
public int compare(Recognition lhs, Recognition rhs) {
return Float.compare(rhs.getConfidence(), lhs.getConfidence());
}
});
for (int i = 0; i < labelList.size(); ++i) {
float confidence = (labelProbArray[0][i] & 0xff) / 255.0f;
if (confidence > THRESHOLD) {
pq.add(new Recognition("" + i,
labelList.size() > i ? labelList.get(i) : "unknown",
confidence, quant));
}
}
final ArrayList<Recognition> recognitions = new ArrayList<>();
int recognitionsSize = Math.min(pq.size(), MAX_RESULTS);
for (int i = 0; i < recognitionsSize; ++i) {
recognitions.add(pq.poll());
}
return recognitions;
}
@SuppressLint("DefaultLocale")
private List<Recognition> getSortedResultFloat(float[][] labelProbArray) {
PriorityQueue<Recognition> pq =
new PriorityQueue<>(
MAX_RESULTS,
new Comparator<Recognition>() {
@Override
public int compare(Recognition lhs, Recognition rhs) {
return Float.compare(rhs.getConfidence(), lhs.getConfidence());
}
});
for (int i = 0; i < labelList.size(); ++i) {
float confidence = labelProbArray[0][i];
if (confidence > THRESHOLD) {
pq.add(new Recognition("" + i,
labelList.size() > i ? labelList.get(i) : "unknown",
confidence, quant));
}
}
final ArrayList<Recognition> recognitions = new ArrayList<>();
int recognitionsSize = Math.min(pq.size(), MAX_RESULTS);
for (int i = 0; i < recognitionsSize; ++i) {
recognitions.add(pq.poll());
}
return recognitions;
}
}
| [
"wngml99324@gmail.com"
] | wngml99324@gmail.com |
957585e18429259e394a43dcd1bc0ba959d2ffe8 | 23a12a3275603bea81c11cfbde5c1ddad3f3b301 | /src/main/java/com/zcj/bean/Book.java | d0581cc1b31e9e71a3a8fcaf0ed48261452aecf4 | [] | no_license | Rainbowzcj/zcjNetwork | 7c12c0b4422773582ae253fdc2198f0975d72585 | 20582d0ea08944a36070f9dc6bed947dece9fde5 | refs/heads/master | 2021-09-07T22:26:57.213161 | 2018-03-02T06:01:39 | 2018-03-02T06:01:39 | 123,525,368 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,371 | java | package com.zcj.bean;
public class Book {
/** 书名 */
private String name;
/** 评分 */
private Double score;
/** 评价人数 */
private Integer pl;
/** 作者 */
private String author;
/** 出版社 */
private String pubCompany;
/** 出版日期 */
private String pubDate;
/** 价格 */
private String price;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Double getScore() {
return score;
}
public void setScore(Double score) {
this.score = score;
}
public String getAuthor() {
return author;
}
public void setAuthor(String author) {
this.author = author;
}
public Integer getPl() {
return pl;
}
public void setPl(Integer pl) {
this.pl = pl;
}
public String getPubCompany() {
return pubCompany;
}
public void setPubCompany(String pubCompany) {
this.pubCompany = pubCompany;
}
public String getPubDate() {
return pubDate;
}
public void setPubDate(String pubDate) {
this.pubDate = pubDate;
}
public String getPrice() {
return price;
}
public void setPrice(String price) {
this.price = price;
}
@Override
public String toString() {
return "Book [name=" + name + ", score=" + score + ", pl=" + pl + ", author=" + author
+ ", pubCompany=" + pubCompany + ", pubDate=" + pubDate + ", price=" + price + "]";
}
}
| [
"zhengchengjiao@birdsh.com"
] | zhengchengjiao@birdsh.com |
747327b8a82487f445c1a545c9443f5c3ae644c9 | 50e026dc1650aeb6f866d65ebdf4d4ff8582a990 | /src/com/javarush/task/task19/task1916/Solution.java | 5488983b2c18dae63b182b1bcccf7f0b529f24dc | [] | no_license | AskarovMF/JavaCore | 9c40a3f794be1deef744e386ca4a74cda82665eb | ff6e97d948771f229f2a77f5dd462ab172d38da6 | refs/heads/master | 2023-03-27T22:44:06.821685 | 2021-04-04T17:25:07 | 2021-04-04T17:25:07 | 354,604,732 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 2,775 | java | package com.javarush.task.task19.task1916;
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
/*
Отслеживаем изменения
*/
public class Solution {
public static List<LineItem> lines = new ArrayList<LineItem>();
public static void main(String[] args) {
List<String> file1 = new ArrayList<>();
List<String> file2 = new ArrayList<>();
List<String> added = new ArrayList<>();
List<String> removed = new ArrayList<>();
List<String> same = new ArrayList<>();
try (BufferedReader rd = new BufferedReader(new InputStreamReader(System.in))) {
BufferedReader reader1 = new BufferedReader(new FileReader(rd.readLine()));
BufferedReader reader2 = new BufferedReader(new FileReader(rd.readLine()));
while (reader1.ready()) {
file1.add(reader1.readLine());
}
while (reader2.ready()) {
file2.add(reader2.readLine());
}
reader1.close();
reader2.close();
for (String x : file1) {
if (file2.contains(x)) {
same.add(x);
} else removed.add(x);
}
for (String y : file2) {
if (!file1.contains(y)) {
added.add(y);
}
}
int indexAdded = added.size()-1;
int indexRemoved = removed.size()-1;
for (int i = same.size()-1; i >=0; i--) {
lines.add(new LineItem(Type.SAME, same.get(i)));
if (i%2==0){
if (indexAdded>0){
lines.add(new LineItem(Type.ADDED, added.get(indexAdded)));
indexAdded--;
} } else {
if (indexRemoved>0){
lines.add(new LineItem(Type.REMOVED, removed.get(indexRemoved)));
indexRemoved--;
}
}
}
/* for (LineItem x :
lines) {
System.out.println(x.toString());
}*/
} catch (IOException e) {
System.out.println(e.getMessage());
}
}
public static enum Type {
ADDED, //добавлена новая строка
REMOVED, //удалена строка
SAME //без изменений
}
public static class LineItem {
public Type type;
public String line;
public LineItem(Type type, String line) {
this.type = type;
this.line = line;
}
}
}
| [
"80327713+AskarovMF@users.noreply.github.com"
] | 80327713+AskarovMF@users.noreply.github.com |
3eced8cf9a61a182acdea4bcb7195a88bf7e9de2 | 0b27f545cf220f118f43c038543ffdec7a39bb6b | /src/com/capgemini/model/Car.java | e308f58f3c7e4f597ff4688e440869efdef358d9 | [] | no_license | abbaspathan/collection-assignments | 20e58940a94d6670be05bb7a447b4f3bd91688f7 | 09cace57741563ffeb5a8885fd89a44b6a664da4 | refs/heads/master | 2020-04-30T08:54:45.199605 | 2019-03-20T12:41:38 | 2019-03-20T12:41:38 | 176,730,827 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,675 | java | package com.capgemini.model;
import java.util.Objects;
public class Car implements Comparable<Car> {
private String carmake;
private String carmodel;
private long yearOfManunfactering;
private long carPrice;
public Car() {
super();
}
public Car(String carmake, String carmodel, long yearOfManunfactering, long carPrice) {
super();
this.carmake = carmake;
this.carmodel = carmodel;
this.yearOfManunfactering = yearOfManunfactering;
this.carPrice = carPrice;
}
public String getCarmake() {
return carmake;
}
public void setCarmake(String carmake) {
this.carmake = carmake;
}
public String getCarmodel() {
return carmodel;
}
public void setCarmodel(String carmodel) {
this.carmodel = carmodel;
}
public long getYearOfManunfactering() {
return yearOfManunfactering;
}
public void setYearOfManunfactering(long yearOfManunfactering) {
this.yearOfManunfactering = yearOfManunfactering;
}
public long getCarPrice() {
return carPrice;
}
public void setCarPrice(long carPrice) {
this.carPrice = carPrice;
}
@Override
public int hashCode() {
return Objects.hash(carmake, carmodel);
}
@Override
public boolean equals(Object obj) {
if (obj == null)
return false;
if (this == obj)
return true;
if (!(obj instanceof Car))
return false;
Car carobject = (Car) obj;
if (carobject.carmake.equals(this.carmake) && carobject.carmodel.equals(this.carmodel))
return true;
return false;
}
@Override
public int compareTo(Car obj) {
int result=this.carmake.compareTo(obj.carmake);
if(result<0) {
return -1;
}
else if(result>0) {
return 1;
}
else {
return 0;
}
}
}
| [
"abbas.pathan@capgemini.com"
] | abbas.pathan@capgemini.com |
ad3e6f6ee23c6fb3ab1a038fd6f526a45e92ec53 | 90a77b7dc0d1f56bc261ee365516f57160627b48 | /src/main/java/io/github/novacrypto/bip39/SpongyCastlePBKDF2WithHmacSHA512.java | b9112645287083ffa17d6acab934c340f4300c31 | [] | no_license | elastos/Elastos.SDK.Keypair.Java | f3709815361d261293650652a77d164a4ffa7003 | 0d65de6677d2a10174ca4773a0ee10f9107ebec1 | refs/heads/master | 2020-03-31T16:52:46.972915 | 2019-12-14T02:32:15 | 2019-12-14T02:32:15 | 152,396,121 | 0 | 3 | null | null | null | null | UTF-8 | Java | false | false | 1,750 | java | /*
* BIP39 library, a Java implementation of BIP39
* Copyright (C) 2017-2018 Alan Evans, NovaCrypto
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*
* Original source: https://github.com/NovaCrypto/BIP39
* You can contact the authors via github issues.
*/
package io.github.novacrypto.bip39;
import org.spongycastle.crypto.PBEParametersGenerator;
import org.spongycastle.crypto.digests.SHA512Digest;
import org.spongycastle.crypto.generators.PKCS5S2ParametersGenerator;
import org.spongycastle.crypto.params.KeyParameter;
/**
* This implementation is useful for older Java implementations, for example it is suitable for all Android API levels.
*/
public enum SpongyCastlePBKDF2WithHmacSHA512 implements PBKDF2WithHmacSHA512 {
INSTANCE;
@Override
public byte[] hash(char[] chars, byte[] salt) {
PKCS5S2ParametersGenerator generator = new PKCS5S2ParametersGenerator(new SHA512Digest());
generator.init(PBEParametersGenerator.PKCS5PasswordToUTF8Bytes(chars), salt, 2048);
KeyParameter key = (KeyParameter) generator.generateDerivedMacParameters(512);
return key.getKey();
}
} | [
"1406629722@qq.com"
] | 1406629722@qq.com |
a08d40e20155c7fa374c1fae939ec23fa9c5d882 | b226accd54e254f2eb0fdb2f376bbe9adddd688d | /Javaclass/src/Class/Frank/MyWeber.java | 386e1aadc3683cf727e959639bc7321c683966fb | [] | no_license | TayliKuan/HelloJava | 3cc8f00b081cf4c8e965e7a7af91c21a8d6218f9 | 8ae49cec7be3a4b5e87dfad4795785f5b0ab7126 | refs/heads/master | 2020-09-11T12:04:45.534246 | 2020-03-27T16:26:35 | 2020-03-27T16:26:35 | 222,057,981 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 5,031 | java | package Class.Frank;
import static com.teamdev.jxbrowser.engine.RenderingMode.HARDWARE_ACCELERATED;
import com.teamdev.jxbrowser.browser.Browser;
import com.teamdev.jxbrowser.engine.Engine;
import com.teamdev.jxbrowser.engine.EngineOptions;
import com.teamdev.jxbrowser.view.swing.BrowserView;
import java.awt.BorderLayout;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JFrame;
import javax.swing.JTextField;
import javax.swing.SwingUtilities;
import javax.swing.WindowConstants;
public class MyWeber extends javax.swing.JFrame {
/**
* Creates new form MyWeber
*/
public MyWeber() {
initComponents();
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 400, Short.MAX_VALUE)
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGap(0, 300, Short.MAX_VALUE)
);
pack();
}// </editor-fold>
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(MyWeber.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(MyWeber.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(MyWeber.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(MyWeber.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
//</editor-fold>
/* Create and display the form */
System.setProperty("jxbrowser.license.key", "1BNDHFSC1FUSZHD4OD2PB17VGDX5T6BTWYTT6US248ZMY9PVN2CEU9NXIDRMSTXM37QTZ8");
// Creating and running Chromium engine
EngineOptions options =
EngineOptions.newBuilder(HARDWARE_ACCELERATED).build();
Engine engine = Engine.newInstance(options);
Browser browser = engine.newBrowser();
SwingUtilities.invokeLater(() -> {
// Creating Swing component for rendering web content
// loaded in the given Browser instance.
BrowserView view = BrowserView.newInstance(browser);
// Creating and displaying Swing app frame.
JFrame frame = new JFrame("Hello World");
// Close Engine and onClose app window
frame.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
engine.close();
}
});
frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
JTextField addressBar = new JTextField("https://www.google.com");
addressBar.addActionListener(e ->
browser.navigation().loadUrl(addressBar.getText()));
frame.add(addressBar, BorderLayout.NORTH);
frame.add(view, BorderLayout.CENTER);
frame.setSize(800, 500);
frame.setLocationRelativeTo(null);
frame.setVisible(true);
});
// java.awt.EventQueue.invokeLater(new Runnable() {
// public void run() {
// new MyWeber().setVisible(true);
// }
// });
}
// Variables declaration - do not modify
// End of variables declaration
}
| [
"小官@DESKTOP-C0T6559"
] | 小官@DESKTOP-C0T6559 |
98f694a1429064de37732be35bc768d7b04f0d2d | 71458c87e9108f0d449928d3d0c20f847faf8562 | /spring-boot/src/main/java/com/vin/docker/service/NameService.java | c843300c4196b0843ab1c5ea5fab94420e41caef | [] | no_license | nithinkumar1992/Billing | b299124c37c0c507408ae587c95667f4e3fa584a | bcfe2c619535ee8adbb7860c8f844eac71dad4da | refs/heads/master | 2020-12-02T17:35:44.473498 | 2017-07-06T07:21:14 | 2017-07-06T07:21:14 | 96,399,026 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 644 | java | package com.vin.docker.service;
import java.util.Iterator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import com.vin.docker.entity.NameEntity;
/**
*
* @author Vinston Pandiyan
* @since Jun 3, 2017
*/
@Component
public class NameService {
@Autowired
private NameRepository nameRepository;
private String DEFUALT_NAME = "vinston";
public String getHelloMessage() {
Iterator<NameEntity> names = nameRepository.findAll().iterator();
String name = DEFUALT_NAME;
while (names.hasNext()) {
name = names.next().getValue();
}
return "Hello " + name;
}
}
| [
"nithinkumar1992@gmail.com"
] | nithinkumar1992@gmail.com |
0d440e3b9760fe8f58d18f73fcac403d4a15896c | f9c2b69a643d1fe5b5877108206c5d87a8b49377 | /src/Logic/AI.java | 7208fee7b665b0d0621852ba0d18c6d6ca74e0c1 | [
"Apache-2.0"
] | permissive | Poonyapat-S/GomokuAI | e8330ed643304c326895b66c123796a365d8c459 | 5a5f4031a9e54ee9a5c7327c41b9a5e39ed72aa6 | refs/heads/master | 2022-12-23T22:47:17.528251 | 2020-10-05T18:00:08 | 2020-10-05T18:00:08 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,370 | java | package Logic;
import java.util.ArrayList;
public class AI {
private int player_rpr;
private class move_state{
private int score;
private pair<Integer, Integer> move_placed;
public move_state(int sc, pair<Integer, Integer> p, Game game) {
this.score = sc;
this.move_placed = p;
}
}
public AI(int r) {
this.player_rpr = r;
}
public pair<Integer, Integer> findMove() {
return null;
}
private Game tryPlace(pair<Integer, Integer> pos, Game game) {
Game temp = game.clone();
if(temp.isValid(pos)) {
temp.placeTile(pos);
return temp;
}
return null;
}
private ArrayList<pair<Integer, Integer> > getPossibleMoves(Game game) {
int[][] game_stat = game.getStatus();
ArrayList<pair<Integer, Integer> > out = new ArrayList<pair<Integer, Integer> >();
boolean[][] added = new boolean[game.board_x][game.board_y];
for(int x = 0;x < game.board_x;x++) {
for(int y = 0;y < game.board_y;y++) {
added[y][x] = false;
}
}
for(int x = 0;x < game.board_x;x++) {
for(int y = 0;y < game.board_y;y++) {
pair<Integer, Integer> pos = pair.new_pair(x, y);
// System.out.println(x + " " + y + " " + game_stat[y][x]);
if(game_stat[pos.second][pos.first] == -1) continue;
for(pair<Integer, Integer> dir: Directions.allDir) {
for(int i = 1; i < 2;i++) {
int xx = pos.first + i*dir.first;
int yy = pos.second+ i*dir.second;
pair<Integer, Integer> temp = pair.new_pair(xx, yy);
if(game.isValid(temp)) {
// System.out.println(temp.first + " " + temp.second);
if(game_stat[temp.second][temp.first] == -1 && !added[y][x]) {
out.add(new pair<Integer, Integer>(xx, yy));
added[yy][xx] = true;
}
}
}
}
}
}
return out;
}
private int countTiles(pair<Integer, Integer> start, pair<Integer, Integer> dir, Game game, int p) {
int[][] game_stat = game.getStatus();
int cnt = 0;
for(int i = 0;i < 5;i++) {
pair<Integer, Integer> temp = pair.new_pair(start.first + i*dir.first, start.second + i*dir.second);
if(!game.CheckBound(temp)) return 0;
else if(game_stat[temp.second][temp.first] != -1 && game_stat[temp.second][temp.first] != p) return 0;
else if(game_stat[temp.second][temp.first] == p) cnt++;
}
return cnt;
}
private int CalcOffense(int p, Game game) {
int mx_score = 0;
int mx_cnt = 0;
for(int y = 0;y < game.board_y;y++) {
for(int x = 0;x < game.board_x;x++) {
for(pair<Integer, Integer> dir: Directions.allDir) {
mx_cnt = Math.max(mx_cnt, countTiles(new pair<Integer, Integer>(x, y), dir, game, p));
}
}
}
mx_score = mx_cnt;
if(p != this.player_rpr) return -mx_score;
return mx_score;
}
private boolean CheckWin(int p, Game game) {
int mx_cnt = 0;
for(int y = 0;y < game.board_y;y++) {
for(int x = 0;x < game.board_x;x++) {
for(pair<Integer, Integer> dir: Directions.allDir) {
mx_cnt = Math.max(mx_cnt, countTiles(new pair<Integer, Integer>(x, y), dir, game, p));
}
}
}
if(mx_cnt >= 5) return true;
return false;
}
private move_state bestMoves(Game game, int d, pair<Integer, Integer> p, int alpha, int beta) {
boolean win = CheckWin((this.player_rpr+d-1)%2, game);
if(win) {
int sc;
if(d %2 == 1) sc = 5;
else sc = -5;
return new move_state(sc, p, game);
}
else if(d == 5)
return new move_state(CalcOffense((this.player_rpr + d)%2, game), p, game);
else {
ArrayList<pair<Integer, Integer > > allMoves = getPossibleMoves(game);
move_state out = null;
for(pair<Integer, Integer> move: allMoves) {
System.out.println(move.first+" "+ move.second+" "+d);
Game newBoard = tryPlace(move, game);
move_state nextMove = bestMoves(newBoard, d+1, move, alpha, beta);
if(out == null) {
out = nextMove;
out.move_placed = move;
}
if(d%2 == 0) {
alpha = Math.max(alpha, nextMove.score);
if(out.score < nextMove.score) {
out = nextMove;
out.move_placed = move;
}
if(alpha >= beta) break;
}
if(d%2 == 1) {
beta = Math.min(beta, nextMove.score);
if(out.score < nextMove.score) {
out = nextMove;
out.move_placed = move;
}
}
}
return out;
}
}
public pair<Integer, Integer> calculate(Game game){
return bestMoves(game, 2, null, Integer.MIN_VALUE, Integer.MAX_VALUE).move_placed;
}
}
| [
"poonpb@gmail.com"
] | poonpb@gmail.com |
96e9f47e13004e1d431926950ac69591ab49240e | fe6e13b531b1fd78b70f9c3eabff0c2a6172058c | /src/main/java/com/third/api/sdk/framework/support/executor/alias/OrderQueryExecutor.java | 91e298e241e4c704535f7a777504e2201c2053ff | [] | no_license | mrwlei/third-api-sdk-freamwork | 9ee37326ee51a3382672bf7070387f002b35b7a9 | 0b951f13dc7b2ffe03fd10f2f56a46df53503d9e | refs/heads/master | 2022-11-18T17:39:53.062710 | 2020-03-29T13:56:14 | 2020-03-29T13:56:14 | 251,044,967 | 0 | 0 | null | 2022-11-16T10:33:17 | 2020-03-29T13:57:06 | Java | UTF-8 | Java | false | false | 509 | java | package com.third.api.sdk.framework.support.executor.alias;
import com.third.api.sdk.framework.support.executor.S001Executor;
import com.third.api.sdk.framework.support.model.parameter.alias.OrderQueryParameter;
import com.third.api.sdk.framework.support.model.response.alias.OrderQueryResponse;
/**
* @program: third-api-sdk-freamwork
* @description:
* @author: wanglei
* @create: 2020-03-29 21:14
**/
public class OrderQueryExecutor extends S001Executor<OrderQueryParameter, OrderQueryResponse> {
}
| [
"wanglei@9fbank.com.cn"
] | wanglei@9fbank.com.cn |
5f02987f4d4e7a732e7f9b5b99dd97504157daef | 77a92d3e8d3ee5f47645fd3225e7f67e7df902cc | /src/main/java/io/daff/pattern/proxy/impl/ToCPaymentImpl.java | eb98754081639eddaad2c20b7a4b33380d58673e | [
"Apache-2.0"
] | permissive | daffupman/core-spring | 512998186587298f52412d4b13be68e6c8c5d159 | 6fccd4bd229a0a1a8244d13ba40fcbef1a2355b8 | refs/heads/master | 2021-12-03T08:50:12.571979 | 2021-10-14T13:30:03 | 2021-10-14T13:30:03 | 247,422,050 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 267 | java | package io.daff.pattern.proxy.impl;
import io.daff.pattern.proxy.ToCPayment;
/**
* @author daffupman
* @since 2020/6/10
*/
public class ToCPaymentImpl implements ToCPayment {
@Override
public void pay() {
System.out.println("以用户的名义支付");
}
}
| [
"wzjin85@foxmail.com"
] | wzjin85@foxmail.com |
370eb0a340831dc728081fd8ec5dac9e5056bf92 | 06fd08ff3380b236d3c4bf208c1053ecd13fb415 | /src/main/java/com/trd/oecms/annotation/EqualsCurrentUser.java | fe595320cd63bea64b728174a881313b0286cf1d | [] | no_license | ShanHeWanZhao/OECMS | 43b21cb7460733fcd67d31bfe012a450f4edd1b7 | d0381c59df1b8f33c6d7f937ebd189728fd08b12 | refs/heads/master | 2022-07-05T10:25:46.660608 | 2020-05-29T13:20:57 | 2020-05-29T13:20:57 | 251,475,088 | 0 | 0 | null | 2022-06-17T03:04:07 | 2020-03-31T01:58:53 | JavaScript | UTF-8 | Java | false | false | 1,455 | java | package com.trd.oecms.annotation;
import com.trd.oecms.constants.enums.LoginInfoTypeEnum;
import javax.validation.Constraint;
import com.trd.oecms.validator.EqualsCurrentUserValidator;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;
import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;
/**
* 当前用户的验证器
* @author tanruidong
* @date 2020-04-10 11:34
*/
@Target({ METHOD, FIELD, ANNOTATION_TYPE, PARAMETER })
@Retention(RUNTIME)
@Documented
@Constraint(validatedBy = EqualsCurrentUserValidator.class)
public @interface EqualsCurrentUser {
/**
* 检测当前用户的某项信息
* @return
*/
LoginInfoTypeEnum infoType() default LoginInfoTypeEnum.ID;
/**
* 是否要求密码相同
* @return false -> 密码不能相同,修改密码时会用到
*/
boolean requireSamePassword() default true;
String message() default "你不是当前登录的用户!!";
Class<?>[] groups() default { };
Class<? extends Payload>[] payload() default { };
/**
* Defines several {@link EqualsCurrentUser} annotations on the same element.
*
*/
@Target({ METHOD, FIELD, ANNOTATION_TYPE, PARAMETER })
@Retention(RUNTIME)
@Documented
@interface List {
EqualsCurrentUser[] value();
}
}
| [
"tanruidong@lightinthebox.com"
] | tanruidong@lightinthebox.com |
27e5460ea975a85d9d75624b1b0213541cc56591 | e820097c99fb212c1c819945e82bd0370b4f1cf7 | /gwt-sh/src/main/java/com/skynet/spms/manager/logisticsCustomsDeclaration/pickupDeliveryOrder/IPickupDeliveryVanningItemsManager.java | 6bf43ef7b3fc114c0bf955a045195dfda04fb117 | [] | no_license | jayanttupe/springas-train-example | 7b173ca4298ceef543dc9cf8ae5f5ea365431453 | adc2e0f60ddd85d287995f606b372c3d686c3be7 | refs/heads/master | 2021-01-10T10:37:28.615899 | 2011-12-20T07:47:31 | 2011-12-20T07:47:31 | 36,887,613 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,688 | java | package com.skynet.spms.manager.logisticsCustomsDeclaration.pickupDeliveryOrder;
import java.util.List;
import java.util.Map;
import com.skynet.spms.persistence.entity.logisticsCustomsDeclaration.pickupDeliveryOrder.PickupDeliveryVanningItems;
/**
* 提货发货指令明细业务接口
*
* @author taiqichao
* @version
* @Date Jul 12, 2011
*/
public interface IPickupDeliveryVanningItemsManager {
/**
* 添加提货发货指令明细
*
* @param
* @param o
* @return void
*/
public void addPickupDeliveryVanningItems(PickupDeliveryVanningItems o);
/**
* 更新提货发货指令明细
*
* @param
* @param newValues
* @param
* @param itemID
* @param
* @return
* @return PickupDeliveryVanningItems
*/
public PickupDeliveryVanningItems updatePickupDeliveryVanningItems(
Map<String, Object> newValues, String itemID);
/**
* 删除提货发货指令明细
*
* @param
* @param itemID
* @return void
*/
public void deletePickupDeliveryVanningItems(String itemID);
/**
* 分页查询提货发货指令明细
*
* @param
* @param startRow
* @param
* @param endRow
* @param
* @param orderId
* @param
* @return
* @return List<PickupDeliveryVanningItems>
*/
public List<PickupDeliveryVanningItems> queryPickupDeliveryVanningItemsList(
int startRow, int endRow, String orderId);
/**
* 根据指令查询提货发货指令明细
*
* @param
* @param sheetId
* @param
* @return
* @return PickupDeliveryVanningItems
*/
public PickupDeliveryVanningItems getPickupDeliveryVanningItemsById(
String sheetId);
}
| [
"usedtolove@3b6edebd-8678-f8c2-051a-d8e859c3524d"
] | usedtolove@3b6edebd-8678-f8c2-051a-d8e859c3524d |
a25ef8e8f420c98a31bf65d7f43f2c242745eb7d | 84c43e60974ca8f145a0907df3c81dd90ebed2ba | /bigone/src/server/package-info.java | 40f2df403e1d49d19bc35e8fb113ca9639e8a65a | [] | no_license | panzertime/cs240 | 4cfce4bd23d7f0ace0536ee9382090a827ff1ace | 90f7049b863f49692fbd9f722cbcb26b84b56dd0 | refs/heads/master | 2021-03-19T10:17:04.895111 | 2015-11-18T20:22:48 | 2015-11-18T20:22:48 | 29,102,537 | 0 | 1 | null | null | null | null | UTF-8 | Java | false | false | 185 | java | /**
* This package contains classes needed for the operation of the
* server and only the server, including code relating to
* the interface with the database.
*/
package server;
| [
"panzer.time@gmail.com"
] | panzer.time@gmail.com |
84740e65ccd949697a99cce05c37b556d1abe1bf | 26f4db012c9c33a1f9d87cb5a6e37e9897ecc072 | /src/moneycalculator/control/CalculateCommand.java | 857bbedfaf090335814d66db40a486550e58db63 | [] | no_license | bululu/MoneyCalculator | 7a7435ea6006ee3638dd9a0391ae078248efb050 | a85fc84790491c73f87617228dd850fbf9261a24 | refs/heads/master | 2021-01-15T10:19:15.790799 | 2014-01-24T00:16:07 | 2014-01-24T00:16:07 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,029 | java | package moneycalculator.control;
import moneycalculator.model.Money;
import moneycalculator.model.MoneyExchanger;
import moneycalculator.persistence.DBExchangeRateLoader;
import moneycalculator.ui.CurrencyDialog;
import moneycalculator.ui.MoneyDialog;
import moneycalculator.ui.MoneyViewer;
public class CalculateCommand extends Command{
public CalculateCommand(MoneyDialog mDialog, CurrencyDialog cDialog, MoneyViewer viewer) {
this.mDialog = mDialog;
this.cDialog = cDialog;
this.viewer = viewer;
}
private final MoneyDialog mDialog;
private final CurrencyDialog cDialog;
private final MoneyViewer viewer;
@Override
public void execute() {
viewer.show(new Money(calculateAmount(),cDialog.getCurrency()));
}
private double calculateAmount() {
DBExchangeRateLoader ER= new DBExchangeRateLoader();
return MoneyExchanger.Exchange(mDialog.getMoney(), ER.load(mDialog.getMoney().getCurrency(), cDialog.getCurrency())).getAmount();
}
}
| [
"Administrador@ALIENWARE-PC"
] | Administrador@ALIENWARE-PC |
0c0587ae7c5bbbf5b95709353c5d056875df8a96 | c592526f3379b2dddffd5b3d75230d03d11cd23c | /Geometry Dash Project/src/ControlMenu.java | 5c44dfce88e82cdfe13a1563c36a35007579549d | [] | no_license | celisold/GeometryDash | 1d29670aad007f28ec5866d814e617e447138c7b | 25e321135c3666c2cbb513d0258e1f6b07d4b668 | refs/heads/master | 2021-06-03T03:49:49.180318 | 2016-06-10T11:11:16 | 2016-06-16T10:47:58 | null | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 4,671 | java | import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.InputMultiplexer;
import com.badlogic.gdx.scenes.scene2d.Actor;
import com.badlogic.gdx.scenes.scene2d.InputEvent;
import com.badlogic.gdx.scenes.scene2d.Stage;
import com.badlogic.gdx.scenes.scene2d.ui.Skin;
import com.badlogic.gdx.scenes.scene2d.ui.Slider;
import com.badlogic.gdx.scenes.scene2d.ui.TextButton;
import com.badlogic.gdx.scenes.scene2d.ui.TextField;
import com.badlogic.gdx.scenes.scene2d.ui.TextField.TextFieldListener;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener;
import com.badlogic.gdx.scenes.scene2d.utils.ClickListener;
import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener.ChangeEvent;
import ch.hevs.gdx2d.components.audio.SoundSample;
import ch.hevs.gdx2d.components.bitmaps.BitmapImage;
import ch.hevs.gdx2d.components.screen_management.RenderingScreen;
import ch.hevs.gdx2d.lib.GdxGraphics;
import ch.hevs.gdx2d.lib.ScreenManager;
import ch.hevs.gdx2d.lib.utils.Logger;
public class ControlMenu extends RenderingScreen{
Skin skin;
Stage stage;
TextButton soundOnOffButton, backToMenuButton;
Slider fxVolSlider, musicVolSlider;
int stateCounter = 0;
String state;
SoundSample loop;
BitmapImage bckgrnd;
public static void main(String[] args) {
new MenuWindow();
}
public void onInit(){
bckgrnd = new BitmapImage("data/images/CrownNebula.bmp/");
int buttonWidth = 540;
int buttonHeight = 90;
loop = new SoundSample("data/sounds/Space Cube.wav");
stage = new Stage();
InputMultiplexer multiplexer = new InputMultiplexer();
multiplexer.addProcessor(stage);
multiplexer.addProcessor(Gdx.input.getInputProcessor());
Gdx.input.setInputProcessor(multiplexer);
// Load the default skin (which can be configured in the JSON file)
skin = new Skin(Gdx.files.internal("data/ui/uiskin.json"));
soundOnOffButton = new TextButton("Sound Off", skin); // Use the initialized skin
soundOnOffButton.setWidth(buttonWidth);
soundOnOffButton.setHeight(buttonHeight);
backToMenuButton = new TextButton("Back to main menu", skin); // Use the initialized skin
backToMenuButton.setWidth(buttonWidth);
backToMenuButton.setHeight(buttonHeight);
musicVolSlider = new Slider(0, 100, 1, false, skin);
musicVolSlider.setWidth(buttonWidth);
fxVolSlider = new Slider(0, 100, 1, false, skin);
fxVolSlider.setWidth(buttonWidth);
soundOnOffButton.setPosition(Gdx.graphics.getWidth() / 2 - buttonWidth / 2, (int) (Gdx.graphics.getHeight() * .6));
backToMenuButton.setPosition(Gdx.graphics.getWidth() / 2 - buttonWidth / 2, (int) (Gdx.graphics.getHeight() * .7));
musicVolSlider.setPosition(Gdx.graphics.getWidth() / 2 - buttonWidth / 2, (int)(Gdx.graphics.getHeight()/2));
fxVolSlider.setPosition(Gdx.graphics.getWidth() / 2 - buttonWidth / 2, (int)(Gdx.graphics.getHeight()/2) - 50);
/**
* Adds the buttons to the stage
*/
stage.addActor(soundOnOffButton);
stage.addActor(backToMenuButton);
stage.addActor(fxVolSlider);
stage.addActor(musicVolSlider);
/**
* Register listener
*/
soundOnOffButton.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
super.clicked(event, x, y);
if(ControlMenu.this.soundOnOffButton.isChecked()){
state = "On";
}
if(!ControlMenu.this.soundOnOffButton.isChecked())
{
state = "Off";
}
stateCounter++;
ControlMenu.this.soundOnOffButton.setText("Sound " + state);
}
});
backToMenuButton.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
super.clicked(event, x, y);
ScreenHub.s.transitionTo(0, ScreenManager.TransactionType.SMOOTH);
}
});
musicVolSlider.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent e, Actor arg1) {
SoundParam.getinstance().musicLevel = musicVolSlider.getValue()/100;
}
});
fxVolSlider.addListener(new ChangeListener() {
@Override
public void changed(ChangeEvent e, Actor fxVolSlider) {
SoundParam.getinstance().fxLevel = musicVolSlider.getValue()/100;
}
});
loop.loop();
}
public void onGraphicRender(GdxGraphics g) {
g.clear();
g.drawBackground(bckgrnd, 0, 0);
// This is required for having the GUI work properly
stage.act();
stage.draw();
// g.drawStringCentered(getWindowHeight() / 4, "Colin Cina & Martin Juon");
g.drawSchoolLogo();
g.drawFPS();
}
@Override
public void dispose() {
loop.stop();
loop.dispose();
bckgrnd.dispose();
stage.dispose();
super.dispose();
}
}
| [
"colincina2@gmail.com"
] | colincina2@gmail.com |
e5bb943ffbf6a5a4e4647d40b92af9e8e1e7bfa2 | eaea633a2a5b96fb53298ad895b74974aced0162 | /src/org/blender/dna/NodeShaderScript.java | b907747bd5dd7cebe5bde75050482f4538cc3614 | [] | no_license | homacs/org.cakelab.blender.dna | ccd981df698519a4df149698b17878d2dd240f3e | ae684606e1ee221b7b3d43454efb33dda01c70b1 | refs/heads/master | 2023-04-05T14:52:31.962419 | 2023-01-03T13:45:16 | 2023-01-03T13:45:16 | 204,024,485 | 11 | 3 | null | null | null | null | UTF-8 | Java | false | false | 9,478 | java | package org.blender.dna;
import java.io.IOException;
import org.cakelab.blender.io.block.Block;
import org.cakelab.blender.io.block.BlockTable;
import org.cakelab.blender.io.dna.internal.StructDNA;
import org.cakelab.blender.nio.CArrayFacade;
import org.cakelab.blender.nio.CFacade;
import org.cakelab.blender.nio.CMetaData;
import org.cakelab.blender.nio.CPointer;
/**
* Generated facet for DNA struct type 'NodeShaderScript'.
*
* <h3>Class Documentation</h3>
*
*/
@CMetaData(size32=1100, size64=1104)
public class NodeShaderScript extends CFacade {
/**
* This is the sdna index of the struct NodeShaderScript.
* <p>
* It is required when allocating a new block to store data for NodeShaderScript.
* </p>
* @see StructDNA
* @see BlockTable
*/
public static final int __DNA__SDNA_INDEX = 468;
/**
* Field descriptor (offset) for struct member 'mode'.
* <h3>Pointer Arithmetics</h3>
* <p>
* This is how you get a reference on the corresponding field in the struct:
* </p>
* <pre>
* NodeShaderScript nodeshaderscript = ...;
* CPointer<Object> p = nodeshaderscript.__dna__addressof(NodeShaderScript.__DNA__FIELD__mode);
* CPointer<Integer> p_mode = p.cast(new Class[]{Integer.class});
* </pre>
* <h3>Metadata</h3>
* <ul>
* <li>Field: 'mode'</li>
* <li>Signature: 'int'</li>
* <li>Actual Size (32bit/64bit): 4/4</li>
* </ul>
*/
public static final long[] __DNA__FIELD__mode = new long[]{0, 0};
/**
* Field descriptor (offset) for struct member 'flag'.
* <h3>Pointer Arithmetics</h3>
* <p>
* This is how you get a reference on the corresponding field in the struct:
* </p>
* <pre>
* NodeShaderScript nodeshaderscript = ...;
* CPointer<Object> p = nodeshaderscript.__dna__addressof(NodeShaderScript.__DNA__FIELD__flag);
* CPointer<Integer> p_flag = p.cast(new Class[]{Integer.class});
* </pre>
* <h3>Metadata</h3>
* <ul>
* <li>Field: 'flag'</li>
* <li>Signature: 'int'</li>
* <li>Actual Size (32bit/64bit): 4/4</li>
* </ul>
*/
public static final long[] __DNA__FIELD__flag = new long[]{4, 4};
/**
* Field descriptor (offset) for struct member 'filepath'.
* <h3>Field Documentation</h3>
* <h4>Blender Source Code</h4>
* <p> 1024 = FILE_MAX. </p>
* <h3>Pointer Arithmetics</h3>
* <p>
* This is how you get a reference on the corresponding field in the struct:
* </p>
* <pre>
* NodeShaderScript nodeshaderscript = ...;
* CPointer<Object> p = nodeshaderscript.__dna__addressof(NodeShaderScript.__DNA__FIELD__filepath);
* CPointer<CArrayFacade<Byte>> p_filepath = p.cast(new Class[]{CArrayFacade.class, Byte.class});
* </pre>
* <h3>Metadata</h3>
* <ul>
* <li>Field: 'filepath'</li>
* <li>Signature: 'char[1024]'</li>
* <li>Actual Size (32bit/64bit): 1024/1024</li>
* </ul>
*/
public static final long[] __DNA__FIELD__filepath = new long[]{8, 8};
/**
* Field descriptor (offset) for struct member 'bytecode_hash'.
* <h3>Pointer Arithmetics</h3>
* <p>
* This is how you get a reference on the corresponding field in the struct:
* </p>
* <pre>
* NodeShaderScript nodeshaderscript = ...;
* CPointer<Object> p = nodeshaderscript.__dna__addressof(NodeShaderScript.__DNA__FIELD__bytecode_hash);
* CPointer<CArrayFacade<Byte>> p_bytecode_hash = p.cast(new Class[]{CArrayFacade.class, Byte.class});
* </pre>
* <h3>Metadata</h3>
* <ul>
* <li>Field: 'bytecode_hash'</li>
* <li>Signature: 'char[64]'</li>
* <li>Actual Size (32bit/64bit): 64/64</li>
* </ul>
*/
public static final long[] __DNA__FIELD__bytecode_hash = new long[]{1032, 1032};
/**
* Field descriptor (offset) for struct member 'bytecode'.
* <h3>Pointer Arithmetics</h3>
* <p>
* This is how you get a reference on the corresponding field in the struct:
* </p>
* <pre>
* NodeShaderScript nodeshaderscript = ...;
* CPointer<Object> p = nodeshaderscript.__dna__addressof(NodeShaderScript.__DNA__FIELD__bytecode);
* CPointer<CPointer<Byte>> p_bytecode = p.cast(new Class[]{CPointer.class, Byte.class});
* </pre>
* <h3>Metadata</h3>
* <ul>
* <li>Field: 'bytecode'</li>
* <li>Signature: 'char*'</li>
* <li>Actual Size (32bit/64bit): 4/8</li>
* </ul>
*/
public static final long[] __DNA__FIELD__bytecode = new long[]{1096, 1096};
public NodeShaderScript(long __address, Block __block, BlockTable __blockTable) {
super(__address, __block, __blockTable);
}
protected NodeShaderScript(NodeShaderScript that) {
super(that.__io__address, that.__io__block, that.__io__blockTable);
}
/**
* Get method for struct member 'mode'.
* @see #__DNA__FIELD__mode
*/
public int getMode() throws IOException
{
if ((__io__pointersize == 8)) {
return __io__block.readInt(__io__address + 0);
} else {
return __io__block.readInt(__io__address + 0);
}
}
/**
* Set method for struct member 'mode'.
* @see #__DNA__FIELD__mode
*/
public void setMode(int mode) throws IOException
{
if ((__io__pointersize == 8)) {
__io__block.writeInt(__io__address + 0, mode);
} else {
__io__block.writeInt(__io__address + 0, mode);
}
}
/**
* Get method for struct member 'flag'.
* @see #__DNA__FIELD__flag
*/
public int getFlag() throws IOException
{
if ((__io__pointersize == 8)) {
return __io__block.readInt(__io__address + 4);
} else {
return __io__block.readInt(__io__address + 4);
}
}
/**
* Set method for struct member 'flag'.
* @see #__DNA__FIELD__flag
*/
public void setFlag(int flag) throws IOException
{
if ((__io__pointersize == 8)) {
__io__block.writeInt(__io__address + 4, flag);
} else {
__io__block.writeInt(__io__address + 4, flag);
}
}
/**
* Get method for struct member 'filepath'.
* <h3>Field Documentation</h3>
* <h4>Blender Source Code</h4>
* <p> 1024 = FILE_MAX. </p>
* @see #__DNA__FIELD__filepath
*/
public CArrayFacade<Byte> getFilepath() throws IOException
{
Class<?>[] __dna__targetTypes = new Class[]{Byte.class};
int[] __dna__dimensions = new int[]{
1024
};
if ((__io__pointersize == 8)) {
return new CArrayFacade<Byte>(__io__address + 8, __dna__targetTypes, __dna__dimensions, __io__block, __io__blockTable);
} else {
return new CArrayFacade<Byte>(__io__address + 8, __dna__targetTypes, __dna__dimensions, __io__block, __io__blockTable);
}
}
/**
* Set method for struct member 'filepath'.
* <h3>Field Documentation</h3>
* <h4>Blender Source Code</h4>
* <p> 1024 = FILE_MAX. </p>
* @see #__DNA__FIELD__filepath
*/
public void setFilepath(CArrayFacade<Byte> filepath) throws IOException
{
long __dna__offset;
if ((__io__pointersize == 8)) {
__dna__offset = 8;
} else {
__dna__offset = 8;
}
if (__io__equals(filepath, __io__address + __dna__offset)) {
return;
} else if (__io__same__encoding(this, filepath)) {
__io__native__copy(__io__block, __io__address + __dna__offset, filepath);
} else {
__io__generic__copy( getFilepath(), filepath);
}
}
/**
* Get method for struct member 'bytecode_hash'.
* @see #__DNA__FIELD__bytecode_hash
*/
public CArrayFacade<Byte> getBytecode_hash() throws IOException
{
Class<?>[] __dna__targetTypes = new Class[]{Byte.class};
int[] __dna__dimensions = new int[]{
64
};
if ((__io__pointersize == 8)) {
return new CArrayFacade<Byte>(__io__address + 1032, __dna__targetTypes, __dna__dimensions, __io__block, __io__blockTable);
} else {
return new CArrayFacade<Byte>(__io__address + 1032, __dna__targetTypes, __dna__dimensions, __io__block, __io__blockTable);
}
}
/**
* Set method for struct member 'bytecode_hash'.
* @see #__DNA__FIELD__bytecode_hash
*/
public void setBytecode_hash(CArrayFacade<Byte> bytecode_hash) throws IOException
{
long __dna__offset;
if ((__io__pointersize == 8)) {
__dna__offset = 1032;
} else {
__dna__offset = 1032;
}
if (__io__equals(bytecode_hash, __io__address + __dna__offset)) {
return;
} else if (__io__same__encoding(this, bytecode_hash)) {
__io__native__copy(__io__block, __io__address + __dna__offset, bytecode_hash);
} else {
__io__generic__copy( getBytecode_hash(), bytecode_hash);
}
}
/**
* Get method for struct member 'bytecode'.
* @see #__DNA__FIELD__bytecode
*/
public CPointer<Byte> getBytecode() throws IOException
{
long __dna__targetAddress;
if ((__io__pointersize == 8)) {
__dna__targetAddress = __io__block.readLong(__io__address + 1096);
} else {
__dna__targetAddress = __io__block.readLong(__io__address + 1096);
}
Class<?>[] __dna__targetTypes = new Class[]{Byte.class};
return new CPointer<Byte>(__dna__targetAddress, __dna__targetTypes, __io__blockTable.getBlock(__dna__targetAddress, __dna__targetTypes), __io__blockTable);
}
/**
* Set method for struct member 'bytecode'.
* @see #__DNA__FIELD__bytecode
*/
public void setBytecode(CPointer<Byte> bytecode) throws IOException
{
long __address = ((bytecode == null) ? 0 : bytecode.getAddress());
if ((__io__pointersize == 8)) {
__io__block.writeLong(__io__address + 1096, __address);
} else {
__io__block.writeLong(__io__address + 1096, __address);
}
}
/**
* Instantiates a pointer on this instance.
*/
public CPointer<NodeShaderScript> __io__addressof() {
return new CPointer<NodeShaderScript>(__io__address, new Class[]{NodeShaderScript.class}, __io__block, __io__blockTable);
}
}
| [
"homac@strace.org"
] | homac@strace.org |
7d2a07b400ecb0420773547209f4a92de6fde558 | 39b16119673e7e5f39f955cf8074b5c3e7ef91d4 | /app/src/main/java/com/example/foody/PageSave/DiadiemFragment.java | 14b30c113c74ec9115ef3c598e74bfe9351121bb | [] | no_license | vanhai260300/LTDDBAOFireBase | 1ff3c487459aee2748fd4b1757c83e8b391e4ae7 | 17111cc536d19712fba1efdee1666432d63fbf56 | refs/heads/master | 2023-02-08T15:38:44.219440 | 2020-12-20T13:25:49 | 2020-12-20T13:25:49 | 323,077,386 | 0 | 0 | null | null | null | null | UTF-8 | Java | false | false | 1,244 | java | package com.example.foody.PageSave;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.Spinner;
import com.example.foody.PageOrder.Employee;
import com.example.foody.PageOrder.EmployeeDataUtils;
import com.example.foody.R;
public class DiadiemFragment extends Fragment {
public DiadiemFragment() {
// Required empty public constructor
}
Spinner spinner;
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
// Inflate the layout for this fragment
View v = inflater.inflate(R.layout.fragment_diadiem, container, false);
Employeesave[] employees = EmployeeDataUtilssave.getEmployees();
spinner = (Spinner) v.findViewById(R.id.spinner);
ArrayAdapter<Employeesave> LTRadapter = new ArrayAdapter<Employeesave>(this.getActivity(), R.layout.spinner_item, employees);
LTRadapter.setDropDownViewResource(android.R.layout.simple_dropdown_item_1line);
spinner.setAdapter(LTRadapter);
return v;
}
} | [
"your_email@youremail.com"
] | your_email@youremail.com |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.