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
514c5a9c4c74e3d26999d82084c0e560803cc70e
b31b2ab93994b59330005d24d2d788e80c4db9dc
/PaintDemo/src/com/example/paintdemo/mywidget/TuYaView.java
5d194d8ce55ae90b5080d0aca87cb10337de55f7
[]
no_license
crazysniper/MyDemoTest
31d04f209a1b546fa32f6dfedb678701377512a1
a75876319949ab8977d56e5059ee3206e7e61457
refs/heads/master
2021-01-21T12:43:43.075653
2015-08-06T15:20:48
2015-08-06T15:20:48
33,294,572
0
0
null
null
null
null
UTF-8
Java
false
false
3,624
java
package com.example.paintdemo.mywidget; import android.annotation.SuppressLint; import android.content.Context; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Canvas; import android.graphics.Color; import android.graphics.Paint; import android.graphics.Paint.Style; import android.os.Handler; import android.os.Message; import android.util.AttributeSet; import android.util.Log; import android.view.MotionEvent; import android.view.View; import com.example.paintdemo.R; import com.example.paintdemo.TuYa; public class TuYaView extends View { private Paint paint = null; private Bitmap originalBitmap = null; private Bitmap new1Bitmap = null; private Bitmap new2Bitmap = null; private float clickX = 0, clickY = 0; private float startX = 0, startY = 0; private boolean isMove = true; private boolean isClear = false; private int color = Color.GREEN; private float strokeWidth = 2.0f; public Handler handler1; private Context context; public TuYaView(Context context, AttributeSet attrs) { super(context, attrs); this.context = context; originalBitmap = BitmapFactory.decodeResource(getResources(), R.drawable.bg).copy(Bitmap.Config.ARGB_8888, true); new1Bitmap = Bitmap.createBitmap(originalBitmap); setDrawingCacheEnabled(true); Log.i("RG", "new1Bitmap--->>>" + new1Bitmap); } public void clear() { isClear = true; new2Bitmap = Bitmap.createBitmap(originalBitmap); invalidate(); } Bitmap saveImage = null; public Bitmap saveImage() { if (saveImage == null) { return null; } return saveImage; } public void setImge() { saveImage = null; } public void setstyle(float strokeWidth) { this.strokeWidth = strokeWidth; } @SuppressLint("DrawAllocation") @Override protected void onDraw(Canvas canvas) { super.onDraw(canvas); canvas.drawBitmap(HandWriting(new1Bitmap), 0, 0, null); handler1 = new Handler() { @Override public void handleMessage(Message msg) { Log.i("RG", "--------------------"); int what = msg.what; if (what == 2) { saveImage = Bitmap.createBitmap(HandWriting(new1Bitmap)); Message msg1 = new Message(); msg1 = Message.obtain(TuYa.hh, 3); TuYa.hh.sendMessage(msg1); } super.handleMessage(msg); } }; } @SuppressLint("HandlerLeak") Handler handler; public Bitmap HandWriting(Bitmap originalBitmap) { handler = new Handler() { @Override public void handleMessage(Message msg) { int what = msg.what; if (what == 1) { startX = clickX; startY = clickY; } super.handleMessage(msg); } }; Canvas canvas = null; if (isClear) { canvas = new Canvas(new2Bitmap); Log.i("RG", "canvas "); } else { canvas = new Canvas(originalBitmap); } paint = new Paint(); paint.setStyle(Style.STROKE); paint.setAntiAlias(true); paint.setColor(color); paint.setStrokeWidth(strokeWidth); Log.i("RG", "startX-->>>>" + startX); Log.i("RG", "startY-->>>>" + startY); if (isMove) { canvas.drawLine(startX, startY, clickX, clickY, paint); } if (isClear) { return new2Bitmap; } return originalBitmap; } @Override public boolean onTouchEvent(MotionEvent event) { Message msg = new Message(); msg = Message.obtain(handler, 1); handler.sendMessage(msg); clickX = event.getX(); clickY = event.getY(); if (event.getAction() == MotionEvent.ACTION_DOWN) { isMove = false; invalidate(); return true; } else if (event.getAction() == MotionEvent.ACTION_MOVE) { isMove = true; invalidate(); return true; } return super.onTouchEvent(event); } }
[ "1163432768@qq.com" ]
1163432768@qq.com
499c9602247a8c7951b7bd55f47552a479aeb4a7
8fff35de65d4d4ecf67bebcc27b92b1fff320dc6
/TeamCode/src/main/java/org/firstinspires/ftc/teamcode/Demo.java
b634667df7f1d6e57550235a90f4050b17be22b5
[ "BSD-3-Clause" ]
permissive
7959/2016-Season
c9c962c2e51ae15e50cb91d7f7b53e0d49a7991d
cdc9649906498049ceeba6c7081068748e107373
refs/heads/master
2020-12-25T10:23:51.229581
2017-02-26T01:00:20
2017-02-26T01:00:20
62,473,465
4
0
null
2016-11-30T13:51:11
2016-07-02T23:24:23
Java
UTF-8
Java
false
false
968
java
package org.firstinspires.ftc.teamcode; import com.qualcomm.robotcore.eventloop.opmode.TeleOp; /** * Created by Robi on 2/23/2017. */ @TeleOp(name = "Judging") public class Demo extends functionlist { double speed = 0; double angle = 0; public void runOpMode() { Map(); MotorSet(); telemetry.addData("Hey you!", "BACK OFF BUCKO I AM CALIBRATING"); telemetry.update(); gy.calibrate(); while (!isStopRequested() && gy.isCalibrating()) ; telemetry.addData("All done", "Thanks"); telemetry.update(); waitForStart(); gy.resetZAxisIntegrator(); while(opModeIsActive()){ straighttime(angle, speed, .1); if(gamepad1.a){ speed = .1; } if(gamepad1.y){ angle = 90; } if(gamepad1.b){ angle = 0; speed = 0; } } } }
[ "robihuq3@gmail.com" ]
robihuq3@gmail.com
e986603d1e67411ba1ef974ec739a7e3fa21a23f
a502c3f96c8020c9812991e3a7e0f462670bd856
/设计模式/code/shangguigu/JDKSRC/src/com/atguigu/jdk/FlyWeight.java
c49e1b7a2f1d093b567268592ad2390d75d03707
[]
no_license
La2ck/learn
9ef2a24e4482256cdf2f89dc345651578c71c1ec
65f451672c7484484b625a4e31c2adb0959dbcb6
refs/heads/master
2023-04-16T23:05:17.685513
2020-02-04T12:36:56
2020-02-04T12:36:56
null
0
0
null
null
null
null
GB18030
Java
false
false
1,155
java
package com.atguigu.jdk; public class FlyWeight { public static void main(String[] args) { //如果 Integer.valueOf(x) x 在 -128 --- 127 直接,就是使用享元模式返回,如果不在 //范围类,则仍然 new //小结: //1. 在valueOf 方法中,先判断值是否在 IntegerCache 中,如果不在,就创建新的Integer(new), 否则,就直接从 缓存池返回 //2. valueOf 方法,就使用到享元模式 //3. 如果使用valueOf 方法得到一个Integer 实例,范围在 -128 - 127 ,执行速度比 new 快 Integer x = Integer.valueOf(127); // 得到 x实例,类型 Integer Integer y = new Integer(127); // 得到 y 实例,类型 Integer Integer z = Integer.valueOf(127);//.. Integer w = new Integer(127); System.out.println(x.equals(y)); // 大小,true System.out.println(x == y ); // false System.out.println(x == z ); // true System.out.println(w == x ); // false System.out.println(w == y ); // false Integer x1 = Integer.valueOf(200); Integer x2 = Integer.valueOf(200); System.out.println("x1==x2 " + (x1 == x2)); // false } }
[ "dll_glb@123.com" ]
dll_glb@123.com
463e2326edbb2046162ca05979f2f2a1043a7ee8
39f2037f209a0f267019d4ea7cb7739c9334324f
/src/test/java/org/neo4j/ogm/domain/entityMapping/UserV13.java
81c25fcfa30ab3984874425716079e8b8d7ff47d
[]
no_license
odd/neo4j-ogm
9d097435271684444503a6967e89d6ed56417659
b26d1c3f6248c3763f8d3baa869eeb0ea6047463
refs/heads/master
2021-01-16T21:26:38.086441
2015-11-12T06:29:20
2015-11-12T06:29:20
46,112,325
1
0
null
2015-11-13T09:22:06
2015-11-13T09:22:06
null
UTF-8
Java
false
false
874
java
/* * Copyright (c) 2002-2015 "Neo Technology," * Network Engine for Objects in Lund AB [http://neotechnology.com] * * This product is licensed to you under the Apache License, Version 2.0 (the "License"). * You may not use this product except in compliance with the License. * * This product may include a number of subcomponents with * separate copyright notices and license terms. Your use of the source * code for these subcomponents is subject to the terms and * conditions of the subcomponent's license, as noted in the LICENSE file. * */ package org.neo4j.ogm.domain.entityMapping; /** * No method or field annotated. * @author Luanne Misquitta */ public class UserV13 extends Entity { private UserV13 knows; public UserV13() { } public UserV13 getKnows() { return knows; } public void setKnows(UserV13 knows) { this.knows = knows; } }
[ "luanne.coutinho@gmail.com" ]
luanne.coutinho@gmail.com
ec34e7e48e9e89d43af47becf64d419adeccc0f7
720340dad26787a400b222740dc813b2e7de40c0
/tags/yc-2.0.0/domain-api/src/main/java/org/yes/cart/domain/entity/CustomerWishList.java
a6286a59e0ed4d61bd33d890eaab9ce4d4f383db
[]
no_license
svn2github/yes-cart
2062601f03c433cbfb8cb9aee8bbb82de9d1e0d5
0687d3b91d687de46369058d37ef54998deae171
refs/heads/master
2021-01-21T11:46:10.756615
2015-01-09T23:25:13
2015-01-09T23:25:13
27,273,015
0
0
null
null
null
null
UTF-8
Java
false
false
2,242
java
/* * Copyright 2009 Igor Azarnyi, Denys Pavlov * * 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.yes.cart.domain.entity; /** * TODO: V2 nice to have scheduler, that perform old wish list items clean up * <p/> * Shopper wish list item. Also reponsible to notification sheduling. * <p/> * User: Igor Azarny iazarny@yahoo.com * Date: 07-May-2011 * Time: 11:12:54 */ public interface CustomerWishList extends Auditable { String SIMPLE_WISH_ITEM = "W"; String REMIND_WHEN_WILL_BE_AVAILABLE = "A"; String REMIND_WHEN_PRICE_CHANGED = "P"; String REMIND_WHEN_WILL_BE_IN_PROMO = "R"; /** * Primary key value. * * @return key value. */ long getCustomerwishlistId(); /** * Set key value * * @param customerwishlistId value to set. */ void setCustomerwishlistId(long customerwishlistId); /** * Product sku * * @return {@link ProductSku} */ ProductSku getSkus(); /** * Set {@link ProductSku} * * @param skus Product Sku */ void setSkus(ProductSku skus); /** * Get customer * * @return {@link Customer} */ Customer getCustomer(); /** * Set customer * * @param customer customer to set */ void setCustomer(Customer customer); /** * Get type of wsih list item. * * @return type of wsih list item */ String getWlType(); /** * Set type of wsih list item * * @param wlType type of wsih list item to set. */ void setWlType(final String wlType); }
[ "denis.v.pavlov@gmail.com@b5e963ab-246d-477c-a38c-82af0a68ca80" ]
denis.v.pavlov@gmail.com@b5e963ab-246d-477c-a38c-82af0a68ca80
3a30ad5f32d70f58eef91c6a9a0f9f725fc40083
341b135bb224b0988a52f9d443e9ef356e00f2e5
/app/src/main/java/com/usinformatics/nytrip/models/ChatModel.java
889c65d3cb04ba16a5b3406438a7312987c0d8bb
[]
no_license
lg-studio/NTA-android
6805e6fc813bc3c51cb09523863ed5695b059f0c
8a89390bd95ce6e758b8eeed23934f31200687a9
refs/heads/master
2021-01-09T06:47:31.397114
2016-01-15T21:03:56
2016-01-15T21:03:56
49,743,246
0
0
null
null
null
null
UTF-8
Java
false
false
1,590
java
package com.usinformatics.nytrip.models; import java.util.Arrays; /** * Created by D1m11n on 14.07.2015. */ public class ChatModel/* implements Parcelable*/ { public QuestionModel [] questions; public long chatDuration; public long chatTimeEnded; public float mark; @Override public String toString() { return "ChatModel{" + "questions=" + Arrays.toString(questions) + ", chatDuration=" + chatDuration + ", chatTimeEnded=" + chatTimeEnded + ", mark=" + mark + '}'; } public ChatModel() { } // public ChatModel(Parcel in) { // Parcelable[] parcelableArray = // in.readParcelableArray(ItemQuestion.class.getClassLoader()); // if (parcelableArray != null) // questions = Arrays.copyOf(parcelableArray, parcelableArray.length, ItemQuestion[].class); // } /* @Override public int describeContents() { return 0; } private void readFromParcel(Parcel in) { questions = in.createTypedArray(ItemQuestion.CREATOR); } @Override public void writeToParcel(Parcel dest, int flags) { dest.writeParcelableArray(questions, flags); } public static final Creator<ChatModel> CREATOR = new Creator<ChatModel>() { @Override public ChatModel createFromParcel(Parcel in) { return new ChatModel(in); } @Override public ChatModel[] newArray(int size) { return new ChatModel[size]; } }; */ }
[ "jan+lg@zl.vc" ]
jan+lg@zl.vc
bfad8cee3fa1a37ed68743f32c801fef9ff2c1b4
46315fd1be3db3433ebfc608caecdf634bc8e1ba
/InformationBook/app/src/main/java/com/ongel/informationbook/adapters/ViewPagerAdapterCountries.java
2699359965cd023ce782c1d8b2aa4b698b3f03e9
[]
no_license
xavierjr85/Android-Applications
67d45bc4c3ff796c0c85bf702c59d191a4f6127c
68976b6d7601c4e351365f9050548d3071ae4958
refs/heads/main
2023-01-23T15:36:10.421850
2020-11-23T10:47:35
2020-11-23T10:47:35
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,291
java
package com.ongel.informationbook.adapters; import androidx.annotation.NonNull; import androidx.fragment.app.Fragment; import androidx.fragment.app.FragmentManager; import androidx.lifecycle.Lifecycle; import androidx.viewpager2.adapter.FragmentStateAdapter; import com.ongel.informationbook.fragments.FragmentFrance; import com.ongel.informationbook.fragments.FragmentItaly; import com.ongel.informationbook.fragments.FragmentUnitedKingdom; public class ViewPagerAdapterCountries extends FragmentStateAdapter { public ViewPagerAdapterCountries(@NonNull FragmentManager fragmentManager, @NonNull Lifecycle lifecycle) { super(fragmentManager, lifecycle); } @NonNull @Override public Fragment createFragment(int position) { Fragment fragment; switch (position) { case 0: fragment = FragmentUnitedKingdom.newInstance(); break; case 1: fragment = FragmentFrance.newInstance(); break; case 2: fragment = FragmentItaly.newInstance(); break; default: return null; } return fragment; } @Override public int getItemCount() { return 3; } }
[ "mehmetong45@gmail.com" ]
mehmetong45@gmail.com
dd01de254e44faa4a724168b4f37ff388634e8a1
92ba03db38f54a5c30fad23fe620f9ef5c1a8654
/src/main/java/org/apache/xmlrpc/server/XmlRpcServerConfig.java
85806e3f6938a68bf18f6f2fb773baf63cfa7734
[ "Apache-2.0" ]
permissive
mrccao/xmlrpc-server
082587f09c16aa56a34f34bf47ad257eb0ac9a6c
2a7588b02e120e580f2c9b0cb3b89214870599f2
refs/heads/master
2020-09-27T22:31:07.459894
2019-12-08T04:40:40
2019-12-08T04:40:40
226,614,391
0
0
null
null
null
null
UTF-8
Java
false
false
1,009
java
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.apache.xmlrpc.server; import org.apache.xmlrpc.XmlRpcConfig; /** Server specific extension of {@link XmlRpcConfig}. */ public interface XmlRpcServerConfig extends XmlRpcConfig { }
[ "caochunhb@163.com" ]
caochunhb@163.com
c2efe789bc952dd004cd4d418b4585f9c111c92e
1dafbb12aeb8967ca43f5223c0ed649629cd8df2
/BasicComponentsApp/app/src/main/java/com/example/basiccomponentsapp/demo.java
cccaeb80a0ee0fd1c375d4ebfd06377933430b41
[]
no_license
nehamarne2700/Android_Studio_Projects
9a4efeb56c5d55755968ee0e1d4ed5599b5eb983
59cdcb767537947cb512917d9cd8d57815f0c99d
refs/heads/master
2023-06-11T23:13:53.849319
2021-07-04T06:53:07
2021-07-04T06:53:07
382,783,623
1
0
null
null
null
null
UTF-8
Java
false
false
219
java
package com.example.basiccomponentsapp; public class demo { public static String name; public static String state; public static String city; public static String gen; public static String year; }
[ "27nehamarne00@gmail.com" ]
27nehamarne00@gmail.com
89b0a7bfda4ef55d9a042ffd5fbe9c1c16e50cb5
763402baa75acab62b021275da8e8d5df6294f69
/src/main/java/com/uta/stcok/ServerGestionStockProduitsApplication.java
21dcb355a6109bf219f1ec0d51fc58e05ade4196
[]
no_license
diakitela/ServerGestionStockProduits
147505e18b0d53a747e593927f2a772252abadc1
d663a2fdca4edf05c6bd4e4e679c2979b2b1ece2
refs/heads/main
2023-03-31T05:21:43.069314
2021-04-08T08:16:02
2021-04-08T08:16:02
355,832,619
0
0
null
null
null
null
UTF-8
Java
false
false
346
java
package com.uta.stcok; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class ServerGestionStockProduitsApplication { public static void main(String[] args) { SpringApplication.run(ServerGestionStockProduitsApplication.class, args); } }
[ "lassacom@gmail.com" ]
lassacom@gmail.com
ed38bf7100ac3dd5046f1e62733a503f5cb61f02
43707ab8fdd019026ee34c36cd89adfe8c3889f1
/app/src/main/java/linc/com/alarmclockforprogrammers/entity/Question.java
a8b567746bfab078fdccb6e29a55cd85cc25167f
[]
no_license
aloon8/AlarmClock-for-programmers
57518afafba8f56644935553cda8caa63647a537
f9dc0e36c71a7b5ea5661edf817d664fb3abafa1
refs/heads/master
2020-07-06T19:54:45.808412
2019-08-13T18:05:14
2019-08-13T18:05:14
null
0
0
null
null
null
null
UTF-8
Java
false
false
3,676
java
package linc.com.alarmclockforprogrammers.entity; import android.arch.persistence.room.ColumnInfo; import android.arch.persistence.room.Entity; import android.arch.persistence.room.Ignore; import android.arch.persistence.room.PrimaryKey; import java.util.List; import static android.arch.persistence.room.ColumnInfo.INTEGER; import static android.arch.persistence.room.ColumnInfo.TEXT; @Entity (tableName = "questions") public class Question { @PrimaryKey @ColumnInfo(name = "_id") private int id; @ColumnInfo(name = "difficult", typeAffinity = INTEGER) private int difficult; @ColumnInfo(name = "true_answer", typeAffinity = INTEGER) private int trueAnswerPosition; @ColumnInfo(name = "language", typeAffinity = TEXT) private String programmingLanguage; @ColumnInfo(name = "pre_question", typeAffinity = TEXT) private String preQuestion; @ColumnInfo(name = "post_question", typeAffinity = TEXT) private String postQuestion; @ColumnInfo(name = "answers", typeAffinity = TEXT) private String jsonAnswers; @ColumnInfo(name = "code_snippet", typeAffinity = TEXT) private String htmlCodeSnippet; @ColumnInfo(name = "completed", typeAffinity = INTEGER) private boolean completed; @Ignore private List<String> answersList; public Question(int id, int difficult, int trueAnswerPosition, String programmingLanguage, String preQuestion, String postQuestion, String jsonAnswers, String htmlCodeSnippet, boolean completed) { this.id = id; this.difficult = difficult; this.trueAnswerPosition = trueAnswerPosition; this.programmingLanguage = programmingLanguage; this.preQuestion = preQuestion; this.postQuestion = postQuestion; this.jsonAnswers = jsonAnswers; this.htmlCodeSnippet = htmlCodeSnippet; this.completed = completed; } public int getId() { return id; } public void setId(int id) { this.id = id; } public int getDifficult() { return difficult; } public void setDifficult(int difficult) { this.difficult = difficult; } public int getTrueAnswerPosition() { return trueAnswerPosition; } public void setTrueAnswerPosition(int trueAnswerPosition) { this.trueAnswerPosition = trueAnswerPosition; } public String getProgrammingLanguage() { return programmingLanguage; } public void setProgrammingLanguage(String programmingLanguage) { this.programmingLanguage = programmingLanguage; } public String getPreQuestion() { return preQuestion; } public void setPreQuestion(String preQuestion) { this.preQuestion = preQuestion; } public String getPostQuestion() { return postQuestion; } public void setPostQuestion(String postQuestion) { this.postQuestion = postQuestion; } public String getJsonAnswers() { return jsonAnswers; } public void setJsonAnswers(String jsonAnswers) { this.jsonAnswers = jsonAnswers; } public String getHtmlCodeSnippet() { return htmlCodeSnippet; } public void setHtmlCodeSnippet(String htmlCodeSnippet) { this.htmlCodeSnippet = htmlCodeSnippet; } public boolean isCompleted() { return completed; } public void setCompleted(boolean completed) { this.completed = completed; } public List<String> getAnswersList() { return answersList; } public void setAnswersList(List<String> answersList) { this.answersList = answersList; } }
[ "andriy.serb1@gmail.com" ]
andriy.serb1@gmail.com
b8054e9adbe0006dc50ed1c79c278e573c2ba24f
83d45b0794c83f79efe99f1396395794a1b2efe1
/src/main/java/com/course/project/hibernateAndJpa/DAO/ICityDal.java
29fe96d7f1584c134f15a4faeafbdfd70a00025a
[]
no_license
fatihkrks/Adding-Restful-Deletion-Update-Writing-Operations
1f2e14233868881e386b23ab5fdbe02100967c70
e9dbf8e349dd691575c8d59607921da8cf1f2c12
refs/heads/master
2022-07-06T06:51:44.544168
2020-04-16T08:54:01
2020-04-16T08:54:01
256,160,821
0
0
null
2022-06-21T03:13:42
2020-04-16T08:53:11
Java
UTF-8
Java
false
false
279
java
package com.course.project.hibernateAndJpa.DAO; import java.util.List; import com.course.project.hibernateAndJpa.Entities.City; public interface ICityDal { List<City> getAll(); void add(City city); void update(City city); void delete(City city); City getById(int id ); }
[ "fatihkrks95@gmail.com" ]
fatihkrks95@gmail.com
057bc6277574f501d5a45462167543810c8de63c
601582228575ca0d5f61b4c211fd37f9e4e2564c
/logisoft_revision1/src/com/gp/cong/logisoft/struts/form/VendorForm.java
9a829fdfd663406bfe3d1c3b978c64c66742d338
[]
no_license
omkarziletech/StrutsCode
3ce7c36877f5934168b0b4830cf0bb25aac6bb3d
c9745c81f4ec0169bf7ca455b8854b162d6eea5b
refs/heads/master
2021-01-11T08:48:58.174554
2016-12-17T10:45:19
2016-12-17T10:45:19
76,713,903
1
1
null
null
null
null
UTF-8
Java
false
false
4,542
java
/* * Generated by MyEclipse Struts * Template path: templates/java/JavaClass.vtl */ package com.gp.cong.logisoft.struts.form; import javax.servlet.http.HttpServletRequest; import org.apache.struts.action.ActionErrors; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionMapping; /** * MyEclipse Struts * Creation date: 09-17-2008 * * XDoclet definition: * @struts.form name="vendorForm" */ public class VendorForm extends ActionForm { private String legalname; private String dba; private String tin; private String wfile; private String apname; private String phone; private String fax; private String email; private String web; private String eamanager; private String credit; private String climit; private String cterms; private String baccount; private String paymethod; private String bankname; private String baddr; private String vacctname; private String vacctno; private String aba; private String swift; private String remail; private String rfax; private String payemail; private String buttonValue; private String deactivate; public String getAba() { return aba; } public void setAba(String aba) { this.aba = aba; } public String getApname() { return apname; } public void setApname(String apname) { this.apname = apname; } public String getBaccount() { return baccount; } public void setBaccount(String baccount) { this.baccount = baccount; } public String getBaddr() { return baddr; } public void setBaddr(String baddr) { this.baddr = baddr; } public String getVacctname() { return vacctname; } public void setVacctname(String vacctname) { this.vacctname = vacctname; } public String getVacctno() { return vacctno; } public void setVacctno(String vacctno) { this.vacctno = vacctno; } public String getClimit() { return climit; } public void setClimit(String climit) { this.climit = climit; } public String getCredit() { return credit; } public void setCredit(String credit) { this.credit = credit; } public String getCterms() { return cterms; } public void setCterms(String cterms) { this.cterms = cterms; } public String getDba() { return dba; } public void setDba(String dba) { this.dba = dba; } public String getEamanager() { return eamanager; } public void setEamanager(String eamanager) { this.eamanager = eamanager; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String getFax() { return fax; } public void setFax(String fax) { this.fax = fax; } public String getLegalname() { return legalname; } public void setLegalname(String legalname) { this.legalname = legalname; } public String getPayemail() { return payemail; } public void setPayemail(String payemail) { this.payemail = payemail; } public String getPaymethod() { return paymethod; } public void setPaymethod(String paymethod) { this.paymethod = paymethod; } public String getBankname() { return bankname; } public void setBankname(String bankname) { this.bankname = bankname; } public String getPhone() { return phone; } public void setPhone(String phone) { this.phone = phone; } public String getRemail() { return remail; } public void setRemail(String remail) { this.remail = remail; } public String getRfax() { return rfax; } public void setRfax(String rfax) { this.rfax = rfax; } public String getSwift() { return swift; } public void setSwift(String swift) { this.swift = swift; } public String getTin() { return tin; } public void setTin(String tin) { this.tin = tin; } public String getWeb() { return web; } public void setWeb(String web) { this.web = web; } public String getWfile() { return wfile; } public void setWfile(String wfile) { this.wfile = wfile; } public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) { // TODO Auto-generated method stub return null; } /** * Method reset * @param mapping * @param request */ public void reset(ActionMapping mapping, HttpServletRequest request) { // TODO Auto-generated method stub } public String getButtonValue() { return buttonValue; } public void setButtonValue(String buttonValue) { this.buttonValue = buttonValue; } public String getDeactivate() { return deactivate; } public void setDeactivate(String deactivate) { this.deactivate = deactivate; } }
[ "omkar@ziletech.com" ]
omkar@ziletech.com
31b2676378a39945db6dcf248ce764ff265c7f2f
fdaa8c6a1bcf9df60a0a08f2472bd4858854f701
/src/main/java/com/example/yachting/domain/yacht/YachtRepository.java
660601933f82ad1316074917f4d82fa54c508725
[]
no_license
dpcode123/yachting-backend
be61820db2ef8411326442647d8b977835eadc5e
ae2109b981b8ff782d6aee54de5baf6eee830a50
refs/heads/main
2023-08-08T08:26:19.886783
2021-09-15T18:54:45
2021-09-15T18:54:45
390,289,460
0
0
null
null
null
null
UTF-8
Java
false
false
706
java
package com.example.yachting.domain.yacht; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.stereotype.Repository; import java.util.Optional; /** * Yacht repository. * @author dp */ @Repository public interface YachtRepository extends JpaRepository<Yacht, Long> { /** * Counts all yachts. * @return total number of yachts */ Long countAllBy(); /** * Get a yacht by id. * @param id * @return yacht wrapped in an Optional */ Optional<Yacht> findById(Long id); /** * Deletes an existing yacht. * @param id * @return number of deleted yachts (0 or 1) */ Long removeById(Long id); }
[ "dp@example.com" ]
dp@example.com
2b553132dba62641447f3ac498fca3d7320f7953
cf60bcdd191dd256d86cc99e96a0b940ee0a475f
/src/practice/inputstream/InputSystem.java
f62b422cd30fe7ef31c2ed931e5885acd647bd2a
[]
no_license
hhxx1994/c-compiler
89e305465065ab3f28d7d2d095871dc4dbd074e0
e0c064743cfe37531f363304f0ba7deb192686f2
refs/heads/master
2022-12-12T19:43:43.614177
2020-09-11T00:00:01
2020-09-11T00:00:01
292,978,858
0
0
null
2020-09-05T01:26:44
2020-09-05T01:26:43
null
UTF-8
Java
false
false
2,805
java
package practice.inputstream; import java.io.UnsupportedEncodingException; public class InputSystem { private Input input = new Input(); public void runStdinExampe() { input.ii_newFile(null); //控制台输入 input.ii_mark_start(); printWord(); input.ii_mark_end(); input.ii_mark_prev(); /* * 执行上面语句后,缓冲区及相关指针情况如下图 * sMark * | * pMark eMark * | | * Start_buf Next Danger End_buf * | | | | * V V V V * +---------------------------------------------------------+---------+ * | typedef| 未读取的区域 | | 浪费的区域| * +-------------------------------------------------------------------- * |<-------------------------BUFSIZE---------------------------------->| * */ input.ii_mark_start(); printWord(); input.ii_mark_end(); /* * 执行上面语句后,缓冲区及相关指针情况如下图 * sMark * | * pMark | eMark * | | | * Start_buf | Next Danger End_buf * | | | | | * V V V V V * +---------------------------------------------------------+---------+ * | typedef|int| 未读取区域 | | 浪费的区域| * +-------------------------------------------------------------------- * |<-------------------------BUFSIZE---------------------------------->| * */ System.out.println("prev word: " + input.ii_ptext());// 打印出 typedef System.out.println("current word: " + input.ii_text()); //打印出int } private void printWord() { byte c; while ((c = input.ii_advance()) != ' ') { byte[] buf = new byte[1]; buf[0] = c; try { String s = new String(buf, "UTF8"); System.out.print(s); } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block e.printStackTrace(); } } System.out.println(""); } public static void main(String[] args) { InputSystem input = new InputSystem(); input.runStdinExampe(); } }
[ "fhb@example.com" ]
fhb@example.com
c2ca5eb9888d1a02e3fe675d360768f707fb1edc
f1ea1b815bafc86fc4dadc42f2f32721b103c6f4
/RPCSD/src/ServidorPedidos/PedidoPaqueteEscucha.java
e2922a85563da3176bd35264ad71efed36ab438f
[]
no_license
PaulGiancarlo/RPC-Java
0d5cba8c88ea063c880a9e0e719fa266c3207bf1
f3b5a2a11ee18e5c236f5d7347e0cd7a6df3c6a9
refs/heads/master
2016-09-05T12:34:03.815588
2014-10-19T18:02:31
2014-10-19T18:02:31
null
0
0
null
null
null
null
UTF-8
Java
false
false
253
java
package ServidorPedidos; import GlobalPedidos.PedidoPaquete; import GlobalPedidos.RespuestaPaquete; /** * @author fabian */ public interface PedidoPaqueteEscucha { RespuestaPaquete pedidoPaqueteEscucha(PedidoPaquete pedidoPaquete); }
[ "paulgiancarlod@gmail.com" ]
paulgiancarlod@gmail.com
7758807facff64868ec4b8a75c9845ae1bf6bfbf
2435ef886043efcaa18eb92e84f9bb8477fb6307
/workspace/EjercicioCompra_Notificaciones/src/main/java/com/example/notificaciones/ConfiguracionJms.java
73d9e6ad0f75e3a646785780f07b0b09c9260944
[]
no_license
victorherrerocazurro/MicroserviciosAccentureOctubre2017
ae6c98ac472814e9b25bee0fb7b4b9a98dcfbce4
98bceb105d7e692c0614dd53a956f2f110ac5d5d
refs/heads/master
2021-05-08T01:57:32.454573
2017-10-25T15:40:41
2017-10-25T15:40:41
107,946,621
0
0
null
null
null
null
UTF-8
Java
false
false
1,541
java
package com.example.notificaciones; import javax.jms.ConnectionFactory; import org.springframework.boot.autoconfigure.jms.DefaultJmsListenerContainerFactoryConfigurer; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.jms.annotation.EnableJms; import org.springframework.jms.config.DefaultJmsListenerContainerFactory; import org.springframework.jms.config.JmsListenerContainerFactory; import org.springframework.jms.support.converter.MappingJackson2MessageConverter; import org.springframework.jms.support.converter.MessageConverter; import org.springframework.jms.support.converter.MessageType; @Configuration @EnableJms public class ConfiguracionJms { @Bean public JmsListenerContainerFactory<?> myFactory(ConnectionFactory connectionFactory, DefaultJmsListenerContainerFactoryConfigurer configurer) { DefaultJmsListenerContainerFactory factory = new DefaultJmsListenerContainerFactory(); // This provides all boot's default to this factory, including the message // converter configurer.configure(factory, connectionFactory); // You could still override some of Boot's default if necessary. return factory; } @Bean // Serialize message content to json using TextMessage public MessageConverter jacksonJmsMessageConverter() { MappingJackson2MessageConverter converter = new MappingJackson2MessageConverter(); converter.setTargetType(MessageType.TEXT); converter.setTypeIdPropertyName("_type"); return converter; } }
[ "victorherrerocazurro@gmail.com" ]
victorherrerocazurro@gmail.com
33cb42f3a9ce8a8a87b568cb98041dd8bd2690a7
610abbcf9f08c4fb6cb0afc75027eee4ffdce50f
/src/thread/threadPool3/Task.java
87db4acc74bfb525405cce75155d9f0531131b79
[]
no_license
warrenrui/RunRun
d7fa5c5430e5ee220193212e06c3f0a07e6a5ff4
494bdf841670aa962df46f8ac8ec5aca224f544a
refs/heads/master
2022-11-19T15:57:24.799698
2021-12-29T16:12:14
2021-12-29T16:12:14
137,385,293
0
0
null
2022-11-16T09:28:28
2018-06-14T16:52:06
JavaScript
UTF-8
Java
false
false
347
java
package thread.threadPool3; public abstract class Task { public enum State { NEW, RUNNING, FINISHED } // 任务状态 private State state = State.NEW; public void setState(State state) { this.state = state; } public State getState() { return state; } public abstract void deal(); }
[ "crazymalao@163.com" ]
crazymalao@163.com
572c9ba3ae3bb2c3be88a29a8b5dc39da58df559
93c32a8726768c5932f612064e30bbb930e46f45
/app/src/main/java/com/lhc/android/gz_guide/activity/GeneralSettingActivity.java
9529647cf6e8e6ef772276c24327a9cd0e64dd07
[]
no_license
Great001/GZ_Guide
077fb1712c6453fdba4952f736e5b763eb059840
a245f20bd0985613ef7377e8a074b0e03afe19bd
refs/heads/master
2021-01-23T04:33:45.643397
2017-04-24T05:41:59
2017-04-24T05:41:59
86,208,674
0
0
null
null
null
null
UTF-8
Java
false
false
4,812
java
package com.lhc.android.gz_guide.activity; import android.app.AlertDialog; import android.content.DialogInterface; import android.content.SharedPreferences; import android.content.res.Configuration; import android.content.res.Resources; import android.os.Bundle; import android.util.DisplayMetrics; import android.view.View; import android.widget.LinearLayout; import android.widget.TextView; import com.lhc.android.gz_guide.GZGuide_APP; import com.lhc.android.gz_guide.R; import com.lhc.android.gz_guide.util.NavigationUtil; import com.lhc.android.gz_guide.util.ToastUtil; import java.util.Locale; public class GeneralSettingActivity extends BaseActivity implements View.OnClickListener { private LinearLayout mLlLanguage; private TextView mTvLanSelected; private TextView mTvFontSize; private TextView mTvFlow; private TextView mTvCacheClear; private int selectLanguage = 0; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_general_setting); initView(); } @Override public int getTitleRes() { return R.string.general_setting; } public void initView() { mLlLanguage = (LinearLayout) findViewById(R.id.ll_language_setting); mTvLanSelected = (TextView) findViewById(R.id.tv_language_selected); mTvCacheClear = (TextView) findViewById(R.id.tv_cache_clear); mTvFlow = (TextView) findViewById(R.id.tv_flow_setting); mTvFontSize = (TextView) findViewById(R.id.tv_font_size_setting); SharedPreferences sp = getSharedPreferences(GZGuide_APP.SP_APP_CONFIG, MODE_PRIVATE); String language = sp.getString(GZGuide_APP.KEY_LANGUAGE, "NULL"); if ("zh".equals(language)) { mTvLanSelected.setText(R.string.selected_language_zh); selectLanguage = 0; } else if ("en".equals(language)) { mTvLanSelected.setText(R.string.selected_language_en); selectLanguage = 1; } mLlLanguage.setOnClickListener(this); mTvFlow.setOnClickListener(this); mTvFontSize.setOnClickListener(this); mTvCacheClear.setOnClickListener(this); } @Override public void onClick(View v) { switch (v.getId()) { case R.id.ll_language_setting: showLanguageChoices(); break; case R.id.tv_font_size_setting: ToastUtil.show(this, R.string.font_size_not_need_change); break; case R.id.tv_cache_clear: ToastUtil.show(this, R.string.cache_clear_finish); break; case R.id.tv_flow_setting: ToastUtil.show(this, R.string.current_flow); break; default: break; } } public void showLanguageChoices() { String[] languages = {getResources().getString(R.string.selected_language_zh), getResources().getString(R.string.selected_language_en)}; AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setSingleChoiceItems(languages, selectLanguage, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { switch (which) { case 0: changeLanguage(Locale.SIMPLIFIED_CHINESE); mTvLanSelected.setText(R.string.selected_language_zh); break; case 1: changeLanguage(Locale.ENGLISH); mTvLanSelected.setText(R.string.selected_language_en); break; default: break; } dialog.cancel(); NavigationUtil.navigateToMainActivity(GeneralSettingActivity.this); } }); builder.create().show(); } //应用内语言切换 public void changeLanguage(Locale locale) { Resources resources = getResources(); DisplayMetrics dm = resources.getDisplayMetrics(); Configuration config = resources.getConfiguration(); config.locale = locale; resources.updateConfiguration(config, dm); saveLanguageConfig(locale); } //保存语言设置 public void saveLanguageConfig(Locale locale) { String language; if (locale.equals(Locale.SIMPLIFIED_CHINESE)) { language = "zh"; } else { language = "en"; } SharedPreferences sp = getSharedPreferences(GZGuide_APP.SP_APP_CONFIG, MODE_PRIVATE); sp.edit().putString(GZGuide_APP.KEY_LANGUAGE, language).commit(); } }
[ "515838965@qq.com" ]
515838965@qq.com
35de50a7f2863b2587e060cf28d7131abe0ec8c1
45dd3fd97707638c0e1ee04c04d6f0ccfac92de6
/1.10.2/src/compat111/java/com/rwtema/extrautils2/compatibility/CraftingHelper112.java
f20fb35678e65f1fdb9d0c9e6a8258a3f77c3a94
[]
no_license
Zarkov2/Extra-Utilities-2-Source
3f754127e838c3dba88de8f4f6c1ac9e01a6b7b5
bcdbc91a79a0ea1690b512889a6f45be4319a33d
refs/heads/master
2020-03-22T15:46:48.376696
2018-07-09T11:54:16
2018-07-09T11:55:54
140,277,754
0
0
null
2018-07-09T11:46:45
2018-07-09T11:46:45
null
UTF-8
Java
false
false
4,839
java
package com.rwtema.extrautils2.compatibility; import com.rwtema.extrautils2.gui.backend.WidgetCraftingMatrix; import com.rwtema.extrautils2.itemhandler.XUCrafter; import com.rwtema.extrautils2.tile.TileCrafter; import com.rwtema.extrautils2.utils.datastructures.ConcatList; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; import net.minecraft.item.crafting.IRecipe; import net.minecraft.item.crafting.ShapedRecipes; import net.minecraft.item.crafting.ShapelessRecipes; import net.minecraft.world.World; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; import javax.annotation.Nonnull; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.function.BiFunction; public class CraftingHelper112 { public static List<IRecipe> getRecipeList() { return CraftingManager.func_77594_a().func_77592_b(); } public static Object[] getShapedIngredientRecipes(Object... recipes){ return new Object[]{"S", 'S', Items.STICK}; } public static void processRecipe(XUShapedRecipe shapedRecipe, ItemStack result, Object... recipe) { int width = 0; int height = 0; String shape = ""; int idx = 0; if (recipe[idx] instanceof BiFunction) { shapedRecipe.finalOutputTransform = (BiFunction<ItemStack, InventoryCrafting, ItemStack>) recipe[idx]; if (recipe[idx + 1] instanceof Object[]) { recipe = (Object[]) recipe[idx + 1]; } else { idx++; } } if (recipe[idx] instanceof Boolean) { shapedRecipe.setMirrored((Boolean) recipe[idx]); if (recipe[idx + 1] instanceof Object[]) { recipe = (Object[]) recipe[idx + 1]; } else { idx++; } } if (recipe[idx] instanceof String[]) { String[] parts = ((String[]) recipe[idx++]); for (String s : parts) { width = s.length(); shape += s; } height = parts.length; } else { while (recipe[idx] instanceof String) { String s = (String) recipe[idx++]; shape += s; width = s.length(); height++; } } if (width * height != shape.length()) { String ret = "Invalid shaped ore recipe: "; for (Object tmp : recipe) { ret += tmp + ", "; } ret += shapedRecipe.getRecipeOutput(); throw new RuntimeException(ret); } HashMap<Character, Object> itemMap = new HashMap<>(); for (; idx < recipe.length; idx += 2) { Character chr = (Character) recipe[idx]; Object in = recipe[idx + 1]; itemMap.put(chr, getRecipeObject(in)); } Object[] input = new Object[width * height]; int x = 0; for (char chr : shape.toCharArray()) { input[x++] = itemMap.get(chr); } shapedRecipe.setWidth(width); shapedRecipe.setHeight(height); shapedRecipe.setInput(input); } public static Object getRecipeObject(Object in) { ConcatList<ItemStack> list = new ConcatList<>(); XUShapedRecipe.handleListInput(list, in); Object out; if (list.subLists.size() == 1) { if (list.size() == 1) { out = list.modifiableList.get(0); } else { out = list.modifiableList; } } else { if (list.subLists.size() == 2 && list.modifiableList.isEmpty()) { out = list.subLists.get(1); } else out = list; } return out; } public static ItemStack getMatchingResult(WidgetCraftingMatrix widgetCraftingMatrix, EntityPlayer player) { return CraftingManager.func_77594_a().findMatchingResult(widgetCraftingMatrix.crafter, player.world); } @Nonnull public static List<Object> getRecipeInputs(IRecipe curRecipe) { List<Object> input = new ArrayList<>(); if (curRecipe instanceof ShapedRecipes || curRecipe instanceof ShapedOreRecipe) { int w, h; Object[] inputs; if (curRecipe instanceof ShapedOreRecipe) { ShapedOreRecipe recipe = (ShapedOreRecipe) curRecipe; inputs = recipe.getInput(); w = TileCrafter.SOR_WIDTH.getUnchecked(recipe); h = TileCrafter.SOR_HEIGHT.getUnchecked(recipe); } else { ShapedRecipes recipe = (ShapedRecipes) curRecipe; inputs = recipe.recipeItems; w = recipe.recipeWidth; h = recipe.recipeHeight; } Object[] inputs3x3 = new Object[9]; for (int x = 0; x < w; x++) { for (int y = 0; y < h; y++) { if (x >= 0 && x < w && y >= 0 && y < h) { inputs3x3[x + y * 3] = inputs[x + y * w]; } } } Collections.addAll(input, inputs3x3); } else if (curRecipe instanceof ShapelessRecipes) { input.addAll(((ShapelessRecipes) curRecipe).recipeItems); } else if (curRecipe instanceof ShapelessOreRecipe) { input.addAll(((ShapelessOreRecipe) curRecipe).getInput()); } return input; } public static Object unwrapIngredients(Object o) { return o; } }
[ "rwtema@gmail.com" ]
rwtema@gmail.com
876082bafa495f19eefbee2f75bcc9ca70db81ab
0712d8fc8ed8d967888a7a98d152dc48ce8a2033
/3bgogiOpera/src/main/java/com/gogi/proj/orders/vo/IrregularOrderVO.java
05ac99dc40773e60d98e112565217e041fd9ccde
[]
no_license
CptgodKi/3bgogiShereOpera
f1ec0fd745cd905ae27ca59b07a892650f0fa51d
d4c26c1a9ebd2610f7cc2e37e499325b39104bcb
refs/heads/master
2023-08-29T16:14:35.271703
2021-11-01T07:53:24
2021-11-01T07:53:24
289,178,114
0
0
null
null
null
null
UTF-8
Java
false
false
2,164
java
package com.gogi.proj.orders.vo; import java.sql.Timestamp; //주문서 입력 후 구매자 체크사항 public class IrregularOrderVO { private int iroPk; //고유값 private int ssFk; // 스토어 구분 private String iroName; //구매자명 private String iroPhoneNumber; //구매자 핸드폰 번호 private String iroDetail; //확인 할 사항 private boolean iroFlag; //확인 여부 private Timestamp iroRegdate; //등록일 public IrregularOrderVO() { super(); // TODO Auto-generated constructor stub } public IrregularOrderVO(int iroPk, int ssFk, String iroName, String iroPhoneNumber, String iroDetail, boolean iroFlag, Timestamp iroRegdate) { super(); this.iroPk = iroPk; this.ssFk = ssFk; this.iroName = iroName; this.iroPhoneNumber = iroPhoneNumber; this.iroDetail = iroDetail; this.iroFlag = iroFlag; this.iroRegdate = iroRegdate; } public int getIroPk() { return iroPk; } public void setIroPk(int iroPk) { this.iroPk = iroPk; } public int getSsFk() { return ssFk; } public void setSsFk(int ssFk) { this.ssFk = ssFk; } public String getIroName() { return iroName; } public void setIroName(String iroName) { this.iroName = iroName; } public String getIroPhoneNumber() { return iroPhoneNumber; } public void setIroPhoneNumber(String iroPhoneNumber) { this.iroPhoneNumber = iroPhoneNumber; } public String getIroDetail() { return iroDetail; } public void setIroDetail(String iroDetail) { this.iroDetail = iroDetail; } public boolean isIroFlag() { return iroFlag; } public void setIroFlag(boolean iroFlag) { this.iroFlag = iroFlag; } public Timestamp getIroRegdate() { return iroRegdate; } public void setIroRegdate(Timestamp iroRegdate) { this.iroRegdate = iroRegdate; } @Override public String toString() { return "IrregularOrderVO [iroPk=" + iroPk + ", ssFk=" + ssFk + ", iroName=" + iroName + ", iroPhoneNumber=" + iroPhoneNumber + ", iroDetail=" + iroDetail + ", iroFlag=" + iroFlag + ", iroRegdate=" + iroRegdate + "]"; } }
[ "bicroid@gmail.com" ]
bicroid@gmail.com
c422774191a75d30859a3704c7608a8422e52b76
b493cc74e82640b8518548e8cfc7c489d22ab814
/src/main/java/com/grich/hsnp/model/user/VlabUser.java
2d5ee66ca5e22607f897fc127c353f522f1cfc47
[]
no_license
haigemsa/NETTY-HSNP
79c546b76792b2ba7ec4c60290dd3eeef8496ac2
c668b43eb65619061b798c3cb2e9434f9e12d148
refs/heads/master
2023-07-01T13:21:03.051952
2021-08-01T15:30:18
2021-08-01T15:30:18
389,393,910
1
0
null
null
null
null
UTF-8
Java
false
false
2,919
java
package com.grich.hsnp.model.user; import com.fasterxml.jackson.annotation.JsonIgnore; import io.swagger.annotations.ApiModelProperty; import java.math.BigDecimal; import java.util.Date; import javax.persistence.*; import lombok.AllArgsConstructor; import lombok.Builder; import lombok.Data; import lombok.NoArgsConstructor; /** * Created by Mybatis Generator on 2020/05/11 * @author William */ @Data @Builder @NoArgsConstructor @AllArgsConstructor public class VlabUser { /** * 用户ID(UUID) */ @Id @ApiModelProperty("用户ID(UUID)") private String id; /** * 昵称 */ @ApiModelProperty("昵称") private String nickName; /** * 微信用户唯一标识 */ @JsonIgnore @ApiModelProperty("微信用户唯一标识") private String openId; /** * 微信会话密钥 */ @JsonIgnore @ApiModelProperty(value = "微信会话密钥",hidden = true) private String sessionKey; /** * 密码 */ @ApiModelProperty(value ="密码",hidden = true) @JsonIgnore private String password; /** * 真实姓名 */ @ApiModelProperty("真实姓名") private String realname; /** * 身份证号码 */ @ApiModelProperty(value = "身份证号码",hidden = true) @JsonIgnore private String idCard; /** * 账户余额 */ @ApiModelProperty(value = "账户余额") private BigDecimal balance; /** * 手机号 */ @ApiModelProperty("手机号") private String mobile; /** * 头像 */ @Column(name = "head_image_url") @ApiModelProperty("头像") private String headImageUrl; /** * 出生年月日 */ @ApiModelProperty("出生年月日") private String birthdate; /** * 用户类别:0 - 普通用户;1 - 管理员用户 */ @ApiModelProperty("用户类别:0 - 普通用户;1 - 管理员用户") private Integer userType; /** * 性别:0 - 女;1 - 男 */ @ApiModelProperty("性别:0 - 女;1 - 男") private Integer sex; /** * 状态:0 - 已删除;1 - 正常, 2 - 锁定 */ @ApiModelProperty("状态:0 - 已删除;1 - 正常, 2 - 锁定") private Integer status; /** * 邮箱 */ @ApiModelProperty("邮箱") private String email; /** * 备注 */ @ApiModelProperty("备注") private String remark; /** * 创建时间 */ @Column(name = "create_time") @ApiModelProperty("创建时间") private Date createTime; /** * 更新时间 */ @Column(name = "update_time") @ApiModelProperty("更新时间") private Date updateTime; /** * 上次登录时间 */ @Column(name = "last_login_time") @ApiModelProperty("上次登录时间") private Date lastLoginTime; }
[ "haigemsa@qq.com" ]
haigemsa@qq.com
654e6fc2a21dca741f34fab1ded5b14b74a95a27
60b3aa0ae501058f26326b77bc5292e1c3a72859
/ClassDemo/genericTest/src/genericTest/InterImpl2.java
23d7859a0c85757ac577d1436c5a22ccd677ce65
[]
no_license
puyanLiu/javaAndAndroidDemo
36ea3538ded86be3ad70202f09276e324b4ba173
b4c1b8623f6c25fb80c4a1f405c9664f5b399baa
refs/heads/master
2021-09-28T20:12:23.145754
2018-11-20T02:33:13
2018-11-20T02:33:13
null
0
0
null
null
null
null
UTF-8
Java
false
false
210
java
package genericTest; /** * @author liupuyan * 还不确定什么类型 * @param <T> */ public class InterImpl2<T> implements Inter<T> { @Override public void show(T t) { System.out.println(t); } }
[ "814168332@qq.com" ]
814168332@qq.com
db0e312ab80172784d983dda3ccb1de1f3e7d59b
05c69e981dc513f72c06c8bdeeeba1cd574f1ffc
/Programmr/Strings/sumNumber_Completed/Challenge.java
92c7b30446075d26830c33f0218281033a1bda6d
[]
no_license
Koaja/Programmr
90316963a60027a241ad1c01c4ba48443d5145d0
6cd268501179f0e23b4ec718fffa136af52732c6
refs/heads/master
2021-01-18T22:09:20.664522
2016-06-15T12:57:33
2016-06-15T12:57:33
46,869,453
0
0
null
null
null
null
UTF-8
Java
false
false
590
java
package sumNumber_Completed; import java.util.Scanner; class Challenge { public static void main(String args[]) { Scanner scanner = new Scanner(System.in); System.out.println("Enter a string:"); String string = scanner.nextLine(); System.out.println("Sum:" + sumNumbers(string)); } /// {write your code here public static int sumNumbers(String str) { String[] array = str.split("[a-zA-Z]"); int sum = 0; for (int i = 0; i < array.length; i++) { try { sum += Integer.parseInt(array[i]); } catch (NumberFormatException e) { } } return sum; } /// } }
[ "balea.cristian90@gmail.com" ]
balea.cristian90@gmail.com
ec8b5f9d8de4e72a09cf9796dfccb84573a5cf65
f46c3c059d274f9125b5ddf706e050f25f8fcc6d
/cmfz_fjq/src/main/java/com/baizhi/controller/MenuController.java
f5090536c807e758cbfcb0cb2c2bf9426170bdc1
[]
no_license
gitissosogood/cmfz
bcdd12cab2807acc81671ad3d125136e06537d7a
4304b90924c5ef9610187a3daa3ecab31741f51c
refs/heads/master
2020-05-16T18:27:51.741811
2019-04-24T12:34:43
2019-04-24T12:34:43
183,225,487
0
0
null
null
null
null
UTF-8
Java
false
false
645
java
package com.baizhi.controller; import com.baizhi.entity.Menu; import com.baizhi.service.MenuService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.RequestMapping; import java.util.List; import java.util.Map; @Controller @RequestMapping("menu") public class MenuController { @Autowired private MenuService menuService; @RequestMapping("queryAll") public String queryAll(Map map) { List<Menu> menuList = menuService.queryAll(); map.put("menuList", menuList); return "main/main"; } }
[ "931625521@qq.com" ]
931625521@qq.com
59eb043fbd81c7552a69b83a564e70f4555a3493
c04f06755278d084cc7653b7efe9afe1e9caf168
/marknode-integration-test/src/test/java/org/marknode/integration/BoundsIntegrationTest.java
ac4519989d22dfecc7c3ae05c1d9b9890c40f2cb
[ "BSD-2-Clause", "Apache-2.0" ]
permissive
nickhristov/marknode
54f44cd11061ebea60b489b5c9ec54e777264014
fbfd9e19874af5e02efa0c66b424a0e4de9e54a4
refs/heads/master
2021-05-01T08:14:36.047793
2016-03-19T07:56:58
2016-03-19T07:56:58
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,518
java
package org.marknode.integration; import org.marknode.node.Node; import org.marknode.parser.Parser; import org.marknode.spec.SpecExample; import org.marknode.spec.SpecReader; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import java.util.List; import static org.testng.Assert.assertNotNull; /** * Tests various substrings of the spec examples to check for out of bounds exceptions. */ public class BoundsIntegrationTest { private static final Parser PARSER = Parser.builder().build(); @DataProvider(name = "data") public Object[][] data() { List<SpecExample> examples = SpecReader.readExamples(); Object[][] data = new Object[examples.size()][]; for (int i = 0; i < examples.size(); i++) { final SpecExample example = examples.get(i); data[i] = new Object[]{example.getSource()}; } return data; } @Test(dataProvider = "data") public void testSubstrings(String input) { // Check possibly truncated block/inline starts for (int i = 1; i < input.length() - 1; i++) { parse(input.substring(i)); } // Check possibly truncated block/inline ends for (int i = input.length() - 1; i > 1; i--) { parse(input.substring(0, i)); } } private void parse(String input) { try { Node parsed = PARSER.parse(input); // Parsing should always return a node assertNotNull(parsed); } catch (Exception e) { throw new AssertionError("Parsing failed, input: " + input, e); } } }
[ "delight.wjk@gmail.com" ]
delight.wjk@gmail.com
4ecf879cc3b2c37a509dc67b2b42bf719926718c
b0b08d185f11bee8b11f6524583f992079ea0879
/core/src/com/snake/entity/EntityBase.java
6006e3f3e079adb9015a8093c14412e08dbbf363
[]
no_license
Hennrie/simpleSnakeGame
27e0dcaefc6c15d9b21a899821b3a612172e52cb
f05230fdf950af865813bde99860bda0915e61e1
refs/heads/master
2021-02-05T03:05:18.373802
2020-02-28T10:45:19
2020-02-28T10:45:19
243,737,515
0
0
null
null
null
null
UTF-8
Java
false
false
1,295
java
package com.snake.entity; import com.badlogic.gdx.math.Rectangle; /** * Created by goran on 26/09/2016. */ @Deprecated public abstract class EntityBase { // == attributes == protected float x; protected float y; protected float width = 1; protected float height = 1; protected Rectangle bounds; // == constructors == public EntityBase() { bounds = new Rectangle(x, y, width, height); } // == public methods == public void setPosition(float x, float y) { this.x = x; this.y = y; updateBounds(); } public void setSize(float width, float height) { this.width = width; this.height = height; updateBounds(); } public float getX() { return x; } public float getY() { return y; } public void setX(float x) { this.x = x; updateBounds(); } public void setY(float y) { this.y = y; updateBounds(); } public float getWidth() { return width; } public float getHeight() { return height; } public Rectangle getBounds() { return bounds; } public void updateBounds() { bounds.setPosition(x, y); bounds.setSize(width, height); } }
[ "horst91@gmx.net" ]
horst91@gmx.net
5506b24df155ae7c3703874f09a39a5db740cafb
ff3ac89fe8c02b64eadd4049fe4f1aee41297963
/buri-core-test/src/test/java/org/escafe/buri/engine/processor/impl/NadejyakoBuriTest.java
36201f4430b6d90483d3b76dbda86f589d297e79
[]
no_license
seasarorg/s2buri
9402125ade5b4d7c38f2a766dd468a5556356922
fbaf32dd3ec2a815dfe3f4426f10d6b0ce53547d
refs/heads/master
2021-01-23T07:15:30.961379
2013-10-04T05:03:42
2013-10-04T05:03:42
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,541
java
package org.escafe.buri.engine.processor.impl; import java.math.BigDecimal; import java.util.Date; import org.escafe.buri.engine.BuriEngine; import org.escafe.buri.engine.processor.BuriProcessorInfo; import org.escafe.buri.engine.processor.SimpleBuriProcessor; import org.escafe.buri.entity.AcquisitionType; import org.escafe.buri.entity.FurnitureItem; import org.seasar.extension.unit.S2TestCase; public class NadejyakoBuriTest extends S2TestCase { private final String PATH = "buri/dicon/buriSimple.dicon"; private BuriEngine buriEngine; private SimpleBuriProcessor invoker_; public NadejyakoBuriTest(String name) { super(name); } @Override protected void setUp() throws Exception { super.setUp(); include(PATH); } public void testDummy() { // なでじゃこがうまくいくようになるまでテスト中止 } public void te1stなでじゃこをぶりから呼んでみるTx() { buriEngine.readWorkFlowFromResource("wakanagoxpdl/なでじゃこ.xpdl", "なでなで"); FurnitureItem furnitureItem = new FurnitureItem(); furnitureItem.type = "サーバ"; furnitureItem.name = "PS3"; furnitureItem.acquisition = new Date(); furnitureItem.acquisitionType = AcquisitionType.LEASE; BuriProcessorInfo info = new BuriProcessorInfo(); info.put("備品", furnitureItem); info.put("リース", new BigDecimal(1)); invoker_.toNextStatus("なでなで.なでじゃこてすと.開始", furnitureItem, info); System.out.println(furnitureItem); } }
[ "j5ik2o@gmail.com" ]
j5ik2o@gmail.com
0bc5624b7f10f23912ab557f6bc84851b87da7e1
eb5cf4ab43912940e26758b00a8a82c02a18adff
/src/main/java/com/xmage/dm01/utils/RSAUtil.java
5edccb934ebc7532793294e57a369cea1ca4b55f
[]
no_license
ahmachan/bootDm01
1105633075d99b14da37e2499993a4b236258c99
162a3feb94d0b593cec5ba4afe615ee17cd57a31
refs/heads/master
2020-04-07T23:34:38.655774
2018-11-30T10:44:03
2018-11-30T10:44:03
158,817,766
0
0
null
null
null
null
UTF-8
Java
false
false
10,043
java
package com.xmage.dm01.utils; //import sun.misc.BASE64Decoder; //import sun.misc.BASE64Encoder; import org.apache.commons.codec.binary.Base64; import java.security.*; import java.security.interfaces.RSAPrivateKey; import java.security.interfaces.RSAPublicKey; import java.security.spec.PKCS8EncodedKeySpec; import java.security.spec.X509EncodedKeySpec; import javax.crypto.Cipher; import javax.crypto.KeyGenerator; import javax.crypto.SecretKey; import javax.crypto.spec.SecretKeySpec; import java.util.HashMap; import java.util.Map; /** * @ClassName: RSAUtil * @Description: 公钥、密钥生成和校验 * **/ public class RSAUtil { public static final String KEY_ALGORTHM="RSA";//加密类型 public static final String SIGNATURE_ALGORITHM="MD5withRSA"; public static final String CIPHER = "aes-256-cbc"; public static final String PUBLIC_KEY = "RSAPublicKey";//公钥 public static final String PRIVATE_KEY = "RSAPrivateKey";//私钥 /** * BASE64解密 * @param byteData * @return * @throws Exception */ public static byte[] decryptBASE64(String data){ //String strByte = Arrays.toString(Base64.decodeBase64(str)); //String strByte = new String(byteData); return Base64.decodeBase64(data); } /** * BASE64加密 * @param data * @return * @throws Exception */ public static String encryptBASE64(byte[] data) throws Exception{ //return (new Base64()).encodeToString(data.getBytes("UTF-8")); return (new Base64()).encodeToString(data); } /** * 初始化密钥 * @return * @throws Exception */ public static Map<String,Object> initKey()throws Exception{ KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(KEY_ALGORTHM); keyPairGenerator.initialize(1024); KeyPair keyPair = keyPairGenerator.generateKeyPair(); //公钥 RSAPublicKey publicKey = (RSAPublicKey) keyPair.getPublic(); //私钥 RSAPrivateKey privateKey = (RSAPrivateKey) keyPair.getPrivate(); Map<String,Object> keyMap = new HashMap<String, Object>(2); keyMap.put(PUBLIC_KEY, publicKey); keyMap.put(PRIVATE_KEY, privateKey); return keyMap; } /** * 取得公钥,并转化为String类型 * @param keyMap * @return * @throws Exception */ public static String getPublicKey(Map<String, Object> keyMap)throws Exception{ Key key = (Key) keyMap.get(PUBLIC_KEY); return encryptBASE64(key.getEncoded()); } /** * 取得私钥,并转化为String类型 * @param keyMap * @return * @throws Exception */ public static String getPrivateKey(Map<String, Object> keyMap) throws Exception{ Key key = (Key) keyMap.get(PRIVATE_KEY); return encryptBASE64(key.getEncoded()); } /** * 用公钥加密 * @param data 加密数据 * @param key 密钥 * @return * @throws Exception */ public static byte[] encryptByPublicKey(byte[] data,String key)throws Exception{ //对公钥解密 byte[] keyBytes = decryptBASE64(key); //取公钥 X509EncodedKeySpec x509EncodedKeySpec = new X509EncodedKeySpec(keyBytes); KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORTHM); Key publicKey = keyFactory.generatePublic(x509EncodedKeySpec); //对数据解密 Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm()); cipher.init(Cipher.ENCRYPT_MODE, publicKey); return cipher.doFinal(data); } /** * 用私钥解密 * @param data 加密数据 * @param key 密钥 * @return * @throws Exception */ public static byte[] decryptByPrivateKey(byte[] data,String key)throws Exception{ //对私钥解密 byte[] keyBytes = decryptBASE64(key); PKCS8EncodedKeySpec pkcs8EncodedKeySpec = new PKCS8EncodedKeySpec(keyBytes); KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORTHM); Key privateKey = keyFactory.generatePrivate(pkcs8EncodedKeySpec); //对数据解密 Cipher cipher = Cipher.getInstance(keyFactory.getAlgorithm()); cipher.init(Cipher.DECRYPT_MODE, privateKey); return cipher.doFinal(data); } /** * 用私钥对信息生成数字签名 * @param data //加密数据 * @param privateKey //私钥 * @return * @throws Exception */ public static String sign(byte[] data,String privateKey)throws Exception{ //解密私钥 byte[] keyBytes = decryptBASE64(privateKey); //构造PKCS8EncodedKeySpec对象 PKCS8EncodedKeySpec pkcs8EncodedKeySpec = new PKCS8EncodedKeySpec(keyBytes); //指定加密算法 KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORTHM); //取私钥匙对象 PrivateKey privateKey2 = keyFactory.generatePrivate(pkcs8EncodedKeySpec); //用私钥对信息生成数字签名 Signature signature = Signature.getInstance(SIGNATURE_ALGORITHM); signature.initSign(privateKey2); signature.update(data); return encryptBASE64(signature.sign()); } /** * 校验数字签名 * @param data 加密数据 * @param publicKey 公钥 * @param sign 数字签名 * @return * @throws Exception */ public static boolean verify(byte[] data,String publicKey,String sign)throws Exception{ //解密公钥 byte[] keyBytes = decryptBASE64(publicKey); //构造X509EncodedKeySpec对象 X509EncodedKeySpec x509EncodedKeySpec = new X509EncodedKeySpec(keyBytes); //指定加密算法 KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORTHM); //取公钥匙对象 PublicKey publicKey2 = keyFactory.generatePublic(x509EncodedKeySpec); Signature signature = Signature.getInstance(SIGNATURE_ALGORITHM); signature.initVerify(publicKey2); signature.update(data); //验证签名是否正常 return signature.verify(decryptBASE64(sign)); } public static byte[] aesDecrypt(byte[] data, byte rawKeyData[]) throws GeneralSecurityException { // 处理密钥 //SecretKeySpec key = new SecretKeySpec(rawKeyData, "DES"); // 解密 //Cipher cipher = Cipher.getInstance("DES/ECB/PKCS5Padding"); SecretKeySpec key = new SecretKeySpec(rawKeyData, "AES"); Cipher cipher = Cipher.getInstance("AES/ECB/PKCS7Padding"); cipher.init(Cipher.DECRYPT_MODE, key); return cipher.doFinal(data); } public static byte[] desEncrypt(byte[] source, byte rawKeyData[]) throws GeneralSecurityException { // 处理密钥 SecretKeySpec key = new SecretKeySpec(rawKeyData, "AES"); // 加密 Cipher cipher = Cipher.getInstance("AES/ECB/PKCS7Padding"); cipher.init(Cipher.ENCRYPT_MODE, key); return cipher.doFinal(source); } public static byte[] encryptAES256(String content, String password) { try { //"AES":请求的密钥算法的标准名称 -指定加密算法 KeyGenerator kgen = KeyGenerator.getInstance("AES"); //256:密钥生成参数;securerandom:密钥生成器的随机源 SecureRandom securerandom = new SecureRandom(tohash256Deal(password)); kgen.init(256, securerandom); //生成秘密(对称)密钥 SecretKey secretKey = kgen.generateKey(); //返回基本编码格式的密钥 byte[] enCodeFormat = secretKey.getEncoded(); //根据给定的字节数组构造一个密钥。enCodeFormat:密钥内容;"AES":与给定的密钥内容相关联的密钥算法的名称 SecretKeySpec key = new SecretKeySpec(enCodeFormat, "AES"); //将提供程序添加到下一个可用位置 //Security.addProvider(new BouncyCastleProvider()); //创建一个实现指定转换的 Cipher对象,该转换由指定的提供程序提供。 //"AES/ECB/PKCS7Padding":转换的名称;"BC":提供程序的名称 Cipher cipher = Cipher.getInstance("AES/ECB/PKCS7Padding"); cipher.init(Cipher.ENCRYPT_MODE, key); byte[] byteContent = content.getBytes("utf-8"); byte[] cryptograph = cipher.doFinal(byteContent); return (new Base64()).encode(cryptograph); ///return Base64.encode(cryptograph); } catch (Exception e) { e.printStackTrace(); } return null; } public static String decryptAES256(byte[] cryptograph, String password) { try { KeyGenerator kgen = KeyGenerator.getInstance("AES"); SecureRandom securerandom = new SecureRandom(tohash256Deal(password)); kgen.init(256, securerandom); SecretKey secretKey = kgen.generateKey(); byte[] enCodeFormat = secretKey.getEncoded(); SecretKeySpec key = new SecretKeySpec(enCodeFormat, "AES"); //Security.addProvider(new BouncyCastleProvider()); Cipher cipher = Cipher.getInstance("AES/ECB/PKCS7Padding"); cipher.init(Cipher.DECRYPT_MODE, key); //byte[] content = cipher.doFinal(Base64.decode(cryptograph)); byte[] content = cipher.doFinal((new Base64()).encode(cryptograph)); return new String(content); } catch (Exception e) { e.printStackTrace(); } return null; } public static String parseByte2HexStr(byte buf[]) { StringBuffer sb = new StringBuffer(); for (int i = 0; i < buf.length; i++) { String hex = Integer.toHexString(buf[i] & 0xFF); if (hex.length() == 1) { hex = '0' + hex; } sb.append(hex.toUpperCase()); } return sb.toString(); } private static byte[] tohash256Deal(String datastr) { try { MessageDigest digester=MessageDigest.getInstance("SHA-256"); digester.update(datastr.getBytes()); byte[] hex=digester.digest(); return hex; } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e.getMessage()); } } }
[ "chenxm@koalac.com" ]
chenxm@koalac.com
d30190b96c83a6f4069260f8ede5d5a5ce1ee704
dd17fef23d94f0eb52dcdb53c7805b5d712d2ff1
/Properties.java
2b300ada6d2dacbb735fe0f2af0cf91de318be2a
[]
no_license
gsfk/Analogy_java
457982874319d8f5846111694eff2ae46530498c
7c922022944bdebf41332126d43e3c214e021aa4
refs/heads/master
2021-01-10T23:48:45.382960
2016-10-17T01:14:26
2016-10-17T01:14:26
70,094,405
0
0
null
null
null
null
UTF-8
Java
false
false
211
java
public enum Properties { ASSOCIATIVITY, COMMUTATIVITY, CLOSURE, LEFT_IDENTITY_LEFT_INVERSE, RIGHT_IDENTITY_LEFT_INVERSE, LEFT_IDENTITY_RIGHT_INVERSE, RIGHT_IDENTITY_RIGHT_INVERSE, }
[ "G2@Gordons-MacBook-Pro.local" ]
G2@Gordons-MacBook-Pro.local
f0de830f938e51d0d41b26873d2e0ac4e78cf34b
a1d39b88c346b00dfeb4506e9a7a863f879eb53d
/src/com/leetcode/LRUCache.java
8c9be17bc4a3380ba306da5c581b84378542d72f
[]
no_license
xiaohanchen/AlgorithmTraining
09c3ea6baff4dac6bb47bac1bdf4be136cb6c7e7
19e83da3df413a2ec4e4816fe261c0d8681460dc
refs/heads/master
2021-09-14T05:54:35.119408
2018-05-08T23:42:27
2018-05-08T23:42:27
114,456,063
0
0
null
null
null
null
UTF-8
Java
false
false
1,280
java
package com.leetcode; public class LRUCache { //age of DLinkedNode head; DLinkedNode tail; int capacity; int count; public LRUCache(int capacity) { this.capacity = capacity; this.count = 0; } public int get(int key) { return -1; } public void put(int key, int value) { } class DLinkedNode { int key; int value; DLinkedNode pre; DLinkedNode post; } /** * Always add the new node right after head; */ private void addNode(DLinkedNode node){ node.pre = head; node.post = head.post; head.post.pre = node; head.post = node; } /** * Remove an existing node from the linked list. */ private void removeNode(DLinkedNode node){ DLinkedNode pre = node.pre; DLinkedNode post = node.post; pre.post = post; post.pre = pre; } /** * Move certain node in between to the head. */ private void moveToHead(DLinkedNode node){ this.removeNode(node); this.addNode(node); } // pop the current tail. private DLinkedNode popTail(){ DLinkedNode res = tail.pre; this.removeNode(res); return res; } }
[ "cxhdtcvvv@gmail.com" ]
cxhdtcvvv@gmail.com
0ff8a98125d022cd875b389bd709324ac9d4092c
6bd60729d32540828f888a2c88ba0f7e91fcc2c4
/Android/CS8803-Mobile-Appplications-and-Services/app/src/main/java/com/jluo80/amazinggifter/model/Gift.java
3937aeddab65c45762f682f589d3a384d2a2d105
[]
no_license
TongzheZhang/CodeWork
2dcd41efad673e60dad519290c311b5edec10eb0
8934f7d4645b2555a9f85ebb36a75c7bb3cdc211
refs/heads/master
2020-06-29T13:26:41.028747
2018-05-07T02:11:13
2018-05-07T02:11:13
74,423,259
1
0
null
null
null
null
UTF-8
Java
false
false
3,160
java
package com.jluo80.amazinggifter.model; /** * Created by Jiahao on 7/2/2016. */ public class Gift { private String unique_key; private String category; private String due_date; private String initiator_id; private String item_id; private String item_url; private String name; private String picture_url; private String post_time; private double price; private double progress; private String reason; private String receiver_id; public Gift() {} public Gift(String category, String due_date, String initiator_id, String item_id, String item_url, String name, String picture_url, String post_time, double price, double progress, String reason, String receiver_id) { this.category = category; this.due_date = due_date; this.initiator_id = initiator_id; this.item_id = item_id; this.item_url = item_url; this.name = name; this.picture_url = picture_url; this.post_time = post_time; this.price = price; this.progress = progress; this.reason = reason; this.receiver_id = receiver_id; } public String getUnique_key() { return unique_key; } public void setUnique_key(String unique_key) { this.unique_key = unique_key; } public String getCategory() { return category; } public void setCategory(String category) { this.category = category; } public String getDue_date() { return due_date; } public void setDue_date(String due_date) { this.due_date = due_date; } public String getInitiator_id() { return initiator_id; } public void setInitiator_id(String initiator_id) { this.initiator_id = initiator_id; } public String getItem_id() { return item_id; } public void setItem_id(String item_id) { this.item_id = item_id; } public String getItem_url(){ return item_url; } public void setItem_url(String item_url){ this.item_url = item_url; } public String getName(){ return name; } public void setName(String name){ this.name = name; } public String getPicture_url(){ return picture_url; } public void setPicture_url(String picture_url){ this.picture_url = picture_url; } public String getPost_time() { return post_time; } public void setPost_time(String post_time) { this.post_time = post_time; } public double getPrice(){ return price; } public void setPrice(double price){ this.price = price; } public double getProgress() { return progress; } public void setProgress(double progress) { this.progress = progress; } public String getReason() { return reason; } public void setReason(String reason) { this.reason = reason; } public String getReceiver_id() { return receiver_id; } public void setReceiver_id(String receiver_id) { this.receiver_id = receiver_id; } }
[ "richard10ztz@gmail.com" ]
richard10ztz@gmail.com
45f3293a3e53166b6bfe6758afa031f40f94cc67
0a826107a0cc2af2a76fdf21a123bf675b781af5
/src/com/p1/mobile/p1android/ui/listeners/OnViewMeasuredListener.java
8d7d0c786d42a5d7472ba097cfb681a86fe3b368
[ "Apache-2.0" ]
permissive
cuipengpeng/p1-android
a8855b44d14f4d047694c30d272c07fde3d91694
60b3d6c06bc02a223590bc694889da8e55b62219
refs/heads/master
2021-01-15T11:48:51.290257
2013-08-07T08:37:23
2013-08-07T08:37:23
null
0
0
null
null
null
null
UTF-8
Java
false
false
264
java
package com.p1.mobile.p1android.ui.listeners; public interface OnViewMeasuredListener { /** * This method is generally called multiple times. It should doublecheck with old values or only contain light logic. */ public void onViewMeasured(); }
[ "451192425@qq.com" ]
451192425@qq.com
2ed17bae9f0c8c572200ba172fd4417926ca6e66
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/2/2_45d7524cf40770f04a5a8753395f5a2e8ae8ef3f/GameMenuPopup/2_45d7524cf40770f04a5a8753395f5a2e8ae8ef3f_GameMenuPopup_s.java
e290952b51b2533f3ea0b252cb9f9531938432d0
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
7,485
java
/* ################################################################## # GNU BACKGAMMON MOBILE # ################################################################## # # # Authors: Domenico Martella - Davide Saurino # # E-mail: info@alcacoop.it # # Date: 19/12/2012 # # # ################################################################## # # # Copyright (C) 2012 Alca Societa' Cooperativa # # # # This file is part of GNU BACKGAMMON MOBILE. # # GNU BACKGAMMON MOBILE 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. # # # # GNU BACKGAMMON MOBILE 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 v3 along with this program. # # If not, see <http://http://www.gnu.org/licenses/> # # # ################################################################## */ package it.alcacoop.backgammon.ui; import it.alcacoop.backgammon.GnuBackgammon; import it.alcacoop.backgammon.fsm.BaseFSM.Events; import it.alcacoop.backgammon.fsm.GameFSM.States; import it.alcacoop.backgammon.logic.MatchState; import com.badlogic.gdx.scenes.scene2d.Actor; import com.badlogic.gdx.scenes.scene2d.InputEvent; import com.badlogic.gdx.scenes.scene2d.InputListener; import com.badlogic.gdx.scenes.scene2d.Stage; import com.badlogic.gdx.scenes.scene2d.actions.Actions; import com.badlogic.gdx.scenes.scene2d.ui.Table; import com.badlogic.gdx.scenes.scene2d.ui.TextButton; import com.badlogic.gdx.scenes.scene2d.ui.TextButton.TextButtonStyle; import com.badlogic.gdx.scenes.scene2d.utils.ClickListener; import com.badlogic.gdx.scenes.scene2d.utils.Drawable; public final class GameMenuPopup extends Table { private Table t1; private Drawable background; private static TextButton undo; private static TextButton resign; private static TextButton abandon; private TextButton options; private Actor a; private Runnable noop; private boolean visible; public GameMenuPopup(Stage stage) { noop = new Runnable(){ @Override public void run() { } }; setWidth(stage.getWidth()); setHeight(stage.getHeight()/(6.8f-GnuBackgammon.ss)); setX(0); setY(-getHeight()); background = GnuBackgammon.skin.getDrawable("popup-region"); setBackground(background); a = new Actor(); a.addListener(new InputListener(){ @Override public boolean touchDown(InputEvent event, float x, float y, int pointer, int button) { hide(noop); return true; } }); t1 = new Table(); t1.setFillParent(true); TextButtonStyle tl = GnuBackgammon.skin.get("button", TextButtonStyle.class); undo = new TextButton("Undo Move", tl); undo.addListener(new ClickListener(){ @Override public void clicked(InputEvent event, float x, float y) { hide(new Runnable(){ @Override public void run() { if (undo.isDisabled()) return; GnuBackgammon.Instance.board.undoMove(); }}); } }); resign = new TextButton("Resign Game", tl); resign.addListener(new ClickListener(){ @Override public void clicked(InputEvent event, float x, float y) { hide(new Runnable(){ @Override public void run() { if (resign.isDisabled()) return; GnuBackgammon.fsm.state(States.DIALOG_HANDLER); GnuBackgammon.fsm.processEvent(Events.ACCEPT_RESIGN, 0); }}); } }); abandon = new TextButton("Abandon Match", tl); abandon.addListener(new ClickListener(){@Override public void clicked(InputEvent event, float x, float y) { hide(new Runnable(){ @Override public void run() { if (abandon.isDisabled()) return; GnuBackgammon.fsm.state(States.DIALOG_HANDLER); UIDialog.getYesNoDialog( Events.ABANDON_MATCH, "Really exit this match?", 0.82f, GnuBackgammon.Instance.board.getStage()); }}); }}); options = new TextButton("Options", tl); options.addListener(new ClickListener(){@Override public void clicked(InputEvent event, float x, float y) { hide(new Runnable(){ @Override public void run() { UIDialog.getOptionsDialog(0.82f, GnuBackgammon.Instance.board.getStage()); }}); }}); float pad = getHeight()/15; float w = getWidth()/3.3f - pad; add(undo).fill().expand().pad(pad).width(w); add(resign).fill().expand().pad(pad).width(w); add(abandon).fill().expand().pad(pad).width(w); add(options).fill().expand().pad(pad).width(w); visible = false; addActor(t1); } public static void setDisabledButtons() { if ((MatchState.matchType==0) && (MatchState.fMove==1)) { //CPU IS PLAYING undo.setDisabled(true); resign.setDisabled(true); abandon.setDisabled(true); undo.setColor(1,1,1,0.4f); resign.setColor(1,1,1,0.4f); abandon.setColor(1,1,1,0.4f); } else { undo.setDisabled(false); resign.setDisabled(false); abandon.setDisabled(false); undo.setColor(1,1,1,1); resign.setColor(1,1,1,1); abandon.setColor(1,1,1,1); } } private void show() { visible = true; addAction(Actions.moveTo(0, 0, 0.1f)); } private void hide(Runnable r) { visible = false; addAction(Actions.sequence( Actions.moveTo(0, -getHeight(), 0.1f), Actions.run(r) )); } public void toggle() { if (visible) hide(noop); else { GnuBackgammon.Instance.board.points.reset(); if (GnuBackgammon.Instance.board.selected!=null) GnuBackgammon.Instance.board.selected.highlight(false); show(); } } public Actor hit (float x, float y, boolean touchable) { Actor hit = super.hit(x, y, touchable); if (visible) { if (hit != null) return hit; else { return a; } } else { return hit; } } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
96a983ad05b166c0e0b3039d5edd812eec506f8c
a354b8264b50a47f81361543966a567b8601a94e
/project1227/src/p0103/ChatC.java
0992981b3a59ac1767b0940721cefd1c62576958
[]
no_license
myungjae18/JavaSE
bce6b898c0797512fc2d160bb6e1604b3955db81
d21556280c5d5845b6ebe1cf0afa886049d78db8
refs/heads/master
2020-05-20T09:20:11.341301
2019-05-08T12:59:56
2019-05-08T12:59:56
null
0
0
null
null
null
null
UHC
Java
false
false
542
java
package p0103; import javax.swing.*; import java.awt.*; import java.awt.event.*; public class ChatC extends JFrame{ //앞으로 개발 시 필요한 건 보유(필요 객체를 has a 관계로 갖자) JTextArea area; JScrollPane scroll; JPanel p_south; JTextField t_input; public ChatC(){ area=new JTextArea(); scroll=new JScrollPane(area); p_south=new JPanel(); t_input=new JTextField(12); p_south.add(t_input); add(scroll); add(p_south, BorderLayout.SOUTH); setBounds(400,500,300,400); setVisible(true); } }
[ "01087153603a@gmail.com" ]
01087153603a@gmail.com
b65079921032377a93d30e24846c18157d8de3e9
b2fc3c814bbff3c3820b4033231a560ec0ec930d
/Vinculacion I-E/Proceso vinculacion I-E/src/main/java/Domain/Converters/CriteriosAdapter.java
e8eed50c7d7c85e4fdc4593b969a89c43d8c22b1
[]
no_license
dprez8/GestionDeContabilidad
9a8304880ca4c61ac286a9562a98db440f99f379
e44882dcc3a353d11c6323eae9b1fefe6bc93ae5
refs/heads/master
2023-02-11T12:41:55.931756
2021-01-08T02:45:05
2021-01-08T02:45:05
327,776,760
0
0
null
null
null
null
UTF-8
Java
false
false
1,976
java
package Domain.Converters; import Domain.Entities.Criterios.*; import com.google.gson.TypeAdapter; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonToken; import com.google.gson.stream.JsonWriter; import java.io.IOException; import java.util.ArrayList; import java.util.List; public class CriteriosAdapter extends TypeAdapter<Criterio> { @Override public void write(final JsonWriter jsonWriter, final Criterio criterio ) throws IOException { } @Override public Criterio read( final JsonReader jsonReader ) throws IOException { JsonToken token = jsonReader.peek(); if(token.equals(JsonToken.STRING)) { // Nos llego un solo criterio String criterioString = jsonReader.nextString(); CriterioUnico criterioUnico = criterioFromString(criterioString); return criterioUnico; } else if(token.equals(JsonToken.BEGIN_ARRAY)) { // Nos llego varios criterios, por lo tanto MIX List<CriterioUnico> criterioList = new ArrayList<>(); jsonReader.beginArray(); while(!token.equals(JsonToken.END_ARRAY)) { String criterioString = jsonReader.nextString(); criterioList.add(criterioFromString(criterioString)); token = jsonReader.peek(); } jsonReader.endArray(); Mix criterioMix = new Mix(); criterioMix.setCriteriosUnicos(criterioList); return criterioMix; } return null; } public CriterioUnico criterioFromString(String string) { CriterioUnico criterio = null; switch (string) { case "OrdenValorPrimeroEgreso": criterio = new OrdenValorPrimeroEgreso(); break; case "OrdenValorPrimeroIngreso": criterio = new OrdenValorPrimeroIngreso(); break; case "Fecha": criterio = new Fecha(); break; } return criterio; } }
[ "lautarorobles_oro@hotmail.com" ]
lautarorobles_oro@hotmail.com
10fa5a73b35acfbe080150ace42f1f71a52560f9
2b9e332e6c0d2fc1dd321d1995b00e67cd60d103
/android/src/ru/geekbrains/zsa/game/AndroidLauncher.java
4cd7acf08eba9fe4b6cee8507881e813bd6196c4
[]
no_license
PaulFrere/SpaceBattle
1ac4e74c62850caa80e9cb0864a3f4deb09582b4
87f88f6d9c381da7bb95bdb463a6ce177bcb26b3
refs/heads/master
2023-03-30T22:54:20.359465
2021-04-02T06:58:37
2021-04-02T06:58:37
304,032,720
0
0
null
2021-04-02T06:58:38
2020-10-14T13:59:43
Java
UTF-8
Java
false
false
524
java
package ru.geekbrains.zsa.game; import android.os.Bundle; import com.badlogic.gdx.backends.android.AndroidApplication; import com.badlogic.gdx.backends.android.AndroidApplicationConfiguration; import ru.geekbrains.zsa.SpaceBattle; public class AndroidLauncher extends AndroidApplication { @Override protected void onCreate (Bundle savedInstanceState) { super.onCreate(savedInstanceState); AndroidApplicationConfiguration config = new AndroidApplicationConfiguration(); initialize(new SpaceBattle(), config); } }
[ "paulfrere91@gmail.ru" ]
paulfrere91@gmail.ru
8cc32d42a5ad5ae4776ec97cf82ec8a6807ad642
1f0be937904dec7b51c6de99a3cc58ab0da35e81
/portlet/catalog/catalog-portlet-service/src/main/java/org/nterlearning/datamodel/catalog/service/ExternalLinkLocalServiceClp.java
94b25bf069f8177495af93f83571e79b12425cbe
[]
no_license
sbreidba/nter.portal-core-devel
032b5ee0f918e3d662db1e5d2c1e6f412853003b
1900a8e6122d63c1eff81a0bbf1c83d62e603cc7
refs/heads/master
2022-08-20T15:00:13.207226
2014-01-31T20:17:01
2014-01-31T20:17:01
37,631,560
0
0
null
2022-03-21T20:31:16
2015-06-18T01:56:54
Java
UTF-8
Java
false
false
26,453
java
package org.nterlearning.datamodel.catalog.service; import com.liferay.portal.kernel.util.ClassLoaderProxy; import com.liferay.portal.kernel.util.MethodHandler; import com.liferay.portal.kernel.util.MethodKey; public class ExternalLinkLocalServiceClp implements ExternalLinkLocalService { private ClassLoaderProxy _classLoaderProxy; private MethodKey _addExternalLinkMethodKey0; private MethodKey _createExternalLinkMethodKey1; private MethodKey _deleteExternalLinkMethodKey2; private MethodKey _deleteExternalLinkMethodKey3; private MethodKey _dynamicQueryMethodKey4; private MethodKey _dynamicQueryMethodKey5; private MethodKey _dynamicQueryMethodKey6; private MethodKey _dynamicQueryCountMethodKey7; private MethodKey _fetchExternalLinkMethodKey8; private MethodKey _getExternalLinkMethodKey9; private MethodKey _getPersistedModelMethodKey10; private MethodKey _getExternalLinksMethodKey11; private MethodKey _getExternalLinksCountMethodKey12; private MethodKey _updateExternalLinkMethodKey13; private MethodKey _updateExternalLinkMethodKey14; private MethodKey _getBeanIdentifierMethodKey15; private MethodKey _setBeanIdentifierMethodKey16; private MethodKey _findByCourseIdMethodKey17; private MethodKey _findByCourseIdWithTypeMethodKey18; private MethodKey _findByComponentIdMethodKey19; private MethodKey _findByComponentIdWithTypeMethodKey20; public ExternalLinkLocalServiceClp(ClassLoaderProxy classLoaderProxy) { _classLoaderProxy = classLoaderProxy; _addExternalLinkMethodKey0 = new MethodKey(_classLoaderProxy.getClassName(), "addExternalLink", org.nterlearning.datamodel.catalog.model.ExternalLink.class); _createExternalLinkMethodKey1 = new MethodKey(_classLoaderProxy.getClassName(), "createExternalLink", long.class); _deleteExternalLinkMethodKey2 = new MethodKey(_classLoaderProxy.getClassName(), "deleteExternalLink", long.class); _deleteExternalLinkMethodKey3 = new MethodKey(_classLoaderProxy.getClassName(), "deleteExternalLink", org.nterlearning.datamodel.catalog.model.ExternalLink.class); _dynamicQueryMethodKey4 = new MethodKey(_classLoaderProxy.getClassName(), "dynamicQuery", com.liferay.portal.kernel.dao.orm.DynamicQuery.class); _dynamicQueryMethodKey5 = new MethodKey(_classLoaderProxy.getClassName(), "dynamicQuery", com.liferay.portal.kernel.dao.orm.DynamicQuery.class, int.class, int.class); _dynamicQueryMethodKey6 = new MethodKey(_classLoaderProxy.getClassName(), "dynamicQuery", com.liferay.portal.kernel.dao.orm.DynamicQuery.class, int.class, int.class, com.liferay.portal.kernel.util.OrderByComparator.class); _dynamicQueryCountMethodKey7 = new MethodKey(_classLoaderProxy.getClassName(), "dynamicQueryCount", com.liferay.portal.kernel.dao.orm.DynamicQuery.class); _fetchExternalLinkMethodKey8 = new MethodKey(_classLoaderProxy.getClassName(), "fetchExternalLink", long.class); _getExternalLinkMethodKey9 = new MethodKey(_classLoaderProxy.getClassName(), "getExternalLink", long.class); _getPersistedModelMethodKey10 = new MethodKey(_classLoaderProxy.getClassName(), "getPersistedModel", java.io.Serializable.class); _getExternalLinksMethodKey11 = new MethodKey(_classLoaderProxy.getClassName(), "getExternalLinks", int.class, int.class); _getExternalLinksCountMethodKey12 = new MethodKey(_classLoaderProxy.getClassName(), "getExternalLinksCount"); _updateExternalLinkMethodKey13 = new MethodKey(_classLoaderProxy.getClassName(), "updateExternalLink", org.nterlearning.datamodel.catalog.model.ExternalLink.class); _updateExternalLinkMethodKey14 = new MethodKey(_classLoaderProxy.getClassName(), "updateExternalLink", org.nterlearning.datamodel.catalog.model.ExternalLink.class, boolean.class); _getBeanIdentifierMethodKey15 = new MethodKey(_classLoaderProxy.getClassName(), "getBeanIdentifier"); _setBeanIdentifierMethodKey16 = new MethodKey(_classLoaderProxy.getClassName(), "setBeanIdentifier", java.lang.String.class); _findByCourseIdMethodKey17 = new MethodKey(_classLoaderProxy.getClassName(), "findByCourseId", java.lang.Long.class); _findByCourseIdWithTypeMethodKey18 = new MethodKey(_classLoaderProxy.getClassName(), "findByCourseIdWithType", java.lang.Long.class, java.lang.String.class); _findByComponentIdMethodKey19 = new MethodKey(_classLoaderProxy.getClassName(), "findByComponentId", java.lang.Long.class); _findByComponentIdWithTypeMethodKey20 = new MethodKey(_classLoaderProxy.getClassName(), "findByComponentIdWithType", java.lang.Long.class, java.lang.String.class); } public org.nterlearning.datamodel.catalog.model.ExternalLink addExternalLink( org.nterlearning.datamodel.catalog.model.ExternalLink externalLink) throws com.liferay.portal.kernel.exception.SystemException { Object returnObj = null; MethodHandler methodHandler = new MethodHandler(_addExternalLinkMethodKey0, ClpSerializer.translateInput(externalLink)); try { returnObj = _classLoaderProxy.invoke(methodHandler); } catch (Throwable t) { if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException) t; } if (t instanceof RuntimeException) { throw (RuntimeException) t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return (org.nterlearning.datamodel.catalog.model.ExternalLink) ClpSerializer.translateOutput(returnObj); } public org.nterlearning.datamodel.catalog.model.ExternalLink createExternalLink( long linkId) { Object returnObj = null; MethodHandler methodHandler = new MethodHandler(_createExternalLinkMethodKey1, linkId); try { returnObj = _classLoaderProxy.invoke(methodHandler); } catch (Throwable t) { if (t instanceof RuntimeException) { throw (RuntimeException) t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return (org.nterlearning.datamodel.catalog.model.ExternalLink) ClpSerializer.translateOutput(returnObj); } public void deleteExternalLink(long linkId) throws com.liferay.portal.kernel.exception.PortalException, com.liferay.portal.kernel.exception.SystemException { MethodHandler methodHandler = new MethodHandler(_deleteExternalLinkMethodKey2, linkId); try { _classLoaderProxy.invoke(methodHandler); } catch (Throwable t) { if (t instanceof com.liferay.portal.kernel.exception.PortalException) { throw (com.liferay.portal.kernel.exception.PortalException) t; } if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException) t; } if (t instanceof RuntimeException) { throw (RuntimeException) t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } } public void deleteExternalLink( org.nterlearning.datamodel.catalog.model.ExternalLink externalLink) throws com.liferay.portal.kernel.exception.SystemException { MethodHandler methodHandler = new MethodHandler(_deleteExternalLinkMethodKey3, ClpSerializer.translateInput(externalLink)); try { _classLoaderProxy.invoke(methodHandler); } catch (Throwable t) { if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException) t; } if (t instanceof RuntimeException) { throw (RuntimeException) t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } } @SuppressWarnings("rawtypes") public java.util.List dynamicQuery( com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) throws com.liferay.portal.kernel.exception.SystemException { Object returnObj = null; MethodHandler methodHandler = new MethodHandler(_dynamicQueryMethodKey4, ClpSerializer.translateInput(dynamicQuery)); try { returnObj = _classLoaderProxy.invoke(methodHandler); } catch (Throwable t) { if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException) t; } if (t instanceof RuntimeException) { throw (RuntimeException) t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return (java.util.List) ClpSerializer.translateOutput(returnObj); } @SuppressWarnings("rawtypes") public java.util.List dynamicQuery( com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end) throws com.liferay.portal.kernel.exception.SystemException { Object returnObj = null; MethodHandler methodHandler = new MethodHandler(_dynamicQueryMethodKey5, ClpSerializer.translateInput(dynamicQuery), start, end); try { returnObj = _classLoaderProxy.invoke(methodHandler); } catch (Throwable t) { if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException) t; } if (t instanceof RuntimeException) { throw (RuntimeException) t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return (java.util.List) ClpSerializer.translateOutput(returnObj); } @SuppressWarnings("rawtypes") public java.util.List dynamicQuery( com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end, com.liferay.portal.kernel.util.OrderByComparator orderByComparator) throws com.liferay.portal.kernel.exception.SystemException { Object returnObj = null; MethodHandler methodHandler = new MethodHandler(_dynamicQueryMethodKey6, ClpSerializer.translateInput(dynamicQuery), start, end, ClpSerializer.translateInput(orderByComparator)); try { returnObj = _classLoaderProxy.invoke(methodHandler); } catch (Throwable t) { if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException) t; } if (t instanceof RuntimeException) { throw (RuntimeException) t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return (java.util.List) ClpSerializer.translateOutput(returnObj); } public long dynamicQueryCount( com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) throws com.liferay.portal.kernel.exception.SystemException { Object returnObj = null; MethodHandler methodHandler = new MethodHandler(_dynamicQueryCountMethodKey7, ClpSerializer.translateInput(dynamicQuery)); try { returnObj = _classLoaderProxy.invoke(methodHandler); } catch (Throwable t) { if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException) t; } if (t instanceof RuntimeException) { throw (RuntimeException) t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return ((Long) returnObj).longValue(); } public org.nterlearning.datamodel.catalog.model.ExternalLink fetchExternalLink( long linkId) throws com.liferay.portal.kernel.exception.SystemException { Object returnObj = null; MethodHandler methodHandler = new MethodHandler(_fetchExternalLinkMethodKey8, linkId); try { returnObj = _classLoaderProxy.invoke(methodHandler); } catch (Throwable t) { if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException) t; } if (t instanceof RuntimeException) { throw (RuntimeException) t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return (org.nterlearning.datamodel.catalog.model.ExternalLink) ClpSerializer.translateOutput(returnObj); } public org.nterlearning.datamodel.catalog.model.ExternalLink getExternalLink( long linkId) throws com.liferay.portal.kernel.exception.PortalException, com.liferay.portal.kernel.exception.SystemException { Object returnObj = null; MethodHandler methodHandler = new MethodHandler(_getExternalLinkMethodKey9, linkId); try { returnObj = _classLoaderProxy.invoke(methodHandler); } catch (Throwable t) { if (t instanceof com.liferay.portal.kernel.exception.PortalException) { throw (com.liferay.portal.kernel.exception.PortalException) t; } if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException) t; } if (t instanceof RuntimeException) { throw (RuntimeException) t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return (org.nterlearning.datamodel.catalog.model.ExternalLink) ClpSerializer.translateOutput(returnObj); } public com.liferay.portal.model.PersistedModel getPersistedModel( java.io.Serializable primaryKeyObj) throws com.liferay.portal.kernel.exception.PortalException, com.liferay.portal.kernel.exception.SystemException { Object returnObj = null; MethodHandler methodHandler = new MethodHandler(_getPersistedModelMethodKey10, ClpSerializer.translateInput(primaryKeyObj)); try { returnObj = _classLoaderProxy.invoke(methodHandler); } catch (Throwable t) { if (t instanceof com.liferay.portal.kernel.exception.PortalException) { throw (com.liferay.portal.kernel.exception.PortalException) t; } if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException) t; } if (t instanceof RuntimeException) { throw (RuntimeException) t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return (com.liferay.portal.model.PersistedModel) ClpSerializer.translateOutput(returnObj); } public java.util.List<org.nterlearning.datamodel.catalog.model.ExternalLink> getExternalLinks( int start, int end) throws com.liferay.portal.kernel.exception.SystemException { Object returnObj = null; MethodHandler methodHandler = new MethodHandler(_getExternalLinksMethodKey11, start, end); try { returnObj = _classLoaderProxy.invoke(methodHandler); } catch (Throwable t) { if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException) t; } if (t instanceof RuntimeException) { throw (RuntimeException) t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return (java.util.List<org.nterlearning.datamodel.catalog.model.ExternalLink>) ClpSerializer.translateOutput(returnObj); } public int getExternalLinksCount() throws com.liferay.portal.kernel.exception.SystemException { Object returnObj = null; MethodHandler methodHandler = new MethodHandler(_getExternalLinksCountMethodKey12); try { returnObj = _classLoaderProxy.invoke(methodHandler); } catch (Throwable t) { if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException) t; } if (t instanceof RuntimeException) { throw (RuntimeException) t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return ((Integer) returnObj).intValue(); } public org.nterlearning.datamodel.catalog.model.ExternalLink updateExternalLink( org.nterlearning.datamodel.catalog.model.ExternalLink externalLink) throws com.liferay.portal.kernel.exception.SystemException { Object returnObj = null; MethodHandler methodHandler = new MethodHandler(_updateExternalLinkMethodKey13, ClpSerializer.translateInput(externalLink)); try { returnObj = _classLoaderProxy.invoke(methodHandler); } catch (Throwable t) { if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException) t; } if (t instanceof RuntimeException) { throw (RuntimeException) t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return (org.nterlearning.datamodel.catalog.model.ExternalLink) ClpSerializer.translateOutput(returnObj); } public org.nterlearning.datamodel.catalog.model.ExternalLink updateExternalLink( org.nterlearning.datamodel.catalog.model.ExternalLink externalLink, boolean merge) throws com.liferay.portal.kernel.exception.SystemException { Object returnObj = null; MethodHandler methodHandler = new MethodHandler(_updateExternalLinkMethodKey14, ClpSerializer.translateInput(externalLink), merge); try { returnObj = _classLoaderProxy.invoke(methodHandler); } catch (Throwable t) { if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException) t; } if (t instanceof RuntimeException) { throw (RuntimeException) t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return (org.nterlearning.datamodel.catalog.model.ExternalLink) ClpSerializer.translateOutput(returnObj); } public java.lang.String getBeanIdentifier() { Object returnObj = null; MethodHandler methodHandler = new MethodHandler(_getBeanIdentifierMethodKey15); try { returnObj = _classLoaderProxy.invoke(methodHandler); } catch (Throwable t) { if (t instanceof RuntimeException) { throw (RuntimeException) t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return (java.lang.String) ClpSerializer.translateOutput(returnObj); } public void setBeanIdentifier(java.lang.String beanIdentifier) { MethodHandler methodHandler = new MethodHandler(_setBeanIdentifierMethodKey16, ClpSerializer.translateInput(beanIdentifier)); try { _classLoaderProxy.invoke(methodHandler); } catch (Throwable t) { if (t instanceof RuntimeException) { throw (RuntimeException) t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } } public java.util.List<org.nterlearning.datamodel.catalog.model.ExternalLink> findByCourseId( java.lang.Long courseId) throws com.liferay.portal.kernel.exception.SystemException { Object returnObj = null; MethodHandler methodHandler = new MethodHandler(_findByCourseIdMethodKey17, ClpSerializer.translateInput(courseId)); try { returnObj = _classLoaderProxy.invoke(methodHandler); } catch (Throwable t) { if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException) t; } if (t instanceof RuntimeException) { throw (RuntimeException) t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return (java.util.List<org.nterlearning.datamodel.catalog.model.ExternalLink>) ClpSerializer.translateOutput(returnObj); } public java.util.List<org.nterlearning.datamodel.catalog.model.ExternalLink> findByCourseIdWithType( java.lang.Long courseId, java.lang.String type) throws com.liferay.portal.kernel.exception.SystemException { Object returnObj = null; MethodHandler methodHandler = new MethodHandler(_findByCourseIdWithTypeMethodKey18, ClpSerializer.translateInput(courseId), ClpSerializer.translateInput(type)); try { returnObj = _classLoaderProxy.invoke(methodHandler); } catch (Throwable t) { if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException) t; } if (t instanceof RuntimeException) { throw (RuntimeException) t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return (java.util.List<org.nterlearning.datamodel.catalog.model.ExternalLink>) ClpSerializer.translateOutput(returnObj); } public java.util.List<org.nterlearning.datamodel.catalog.model.ExternalLink> findByComponentId( java.lang.Long componentId) throws com.liferay.portal.kernel.exception.SystemException { Object returnObj = null; MethodHandler methodHandler = new MethodHandler(_findByComponentIdMethodKey19, ClpSerializer.translateInput(componentId)); try { returnObj = _classLoaderProxy.invoke(methodHandler); } catch (Throwable t) { if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException) t; } if (t instanceof RuntimeException) { throw (RuntimeException) t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return (java.util.List<org.nterlearning.datamodel.catalog.model.ExternalLink>) ClpSerializer.translateOutput(returnObj); } public java.util.List<org.nterlearning.datamodel.catalog.model.ExternalLink> findByComponentIdWithType( java.lang.Long componentId, java.lang.String type) throws com.liferay.portal.kernel.exception.SystemException { Object returnObj = null; MethodHandler methodHandler = new MethodHandler(_findByComponentIdWithTypeMethodKey20, ClpSerializer.translateInput(componentId), ClpSerializer.translateInput(type)); try { returnObj = _classLoaderProxy.invoke(methodHandler); } catch (Throwable t) { if (t instanceof com.liferay.portal.kernel.exception.SystemException) { throw (com.liferay.portal.kernel.exception.SystemException) t; } if (t instanceof RuntimeException) { throw (RuntimeException) t; } else { throw new RuntimeException(t.getClass().getName() + " is not a valid exception"); } } return (java.util.List<org.nterlearning.datamodel.catalog.model.ExternalLink>) ClpSerializer.translateOutput(returnObj); } public ClassLoaderProxy getClassLoaderProxy() { return _classLoaderProxy; } }
[ "l.moulder.sri@localhost" ]
l.moulder.sri@localhost
f3eb7957973fe2a1e097b48aa65e607704325619
9a7eb90b964835399d47d58e71bca8ad3ef7fb84
/GraficoBasico/src/ejercicio_3/MiniEncuestaApp.java
dcd7aa3637838ec15736234cb5db63b5cf1348a6
[]
no_license
abmedinas/Expo_prueba
71fbfc1044ed6075d7e519700a1561b3e261f36c
9e1860af242d44954393b146f34d45b3d94b8980
refs/heads/master
2020-09-25T14:01:35.657447
2019-12-06T00:03:02
2019-12-06T00:03:02
226,018,778
0
0
null
null
null
null
UTF-8
Java
false
false
11,537
java
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package ejercicio_3; import javax.swing.ButtonGroup; import javax.swing.JCheckBox; import javax.swing.JOptionPane; import javax.swing.JRadioButton; /** * @author DiscoDurodeRoer */ public class MiniEncuestaApp extends javax.swing.JFrame { public MiniEncuestaApp() { initComponents(); //Creamos una instacia de ButtonGroup ButtonGroup btg=new ButtonGroup(); //Añadimos los botones radiobutton //Si no lo hacemos, los botones seran independientes btg.add(btnWindows); btg.add(btnLinux); btg.add(btnMac); } @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { btnWindows = new javax.swing.JRadioButton(); btnLinux = new javax.swing.JRadioButton(); btnMac = new javax.swing.JRadioButton(); jLabel1 = new javax.swing.JLabel(); ckbProgramacion = new javax.swing.JCheckBox(); jLabel2 = new javax.swing.JLabel(); ckbDiseno = new javax.swing.JCheckBox(); ckbAdministracion = new javax.swing.JCheckBox(); jSeparator1 = new javax.swing.JSeparator(); btnGenerar = new javax.swing.JButton(); jSeparator2 = new javax.swing.JSeparator(); jlHoras = new javax.swing.JSlider(); jLabel3 = new javax.swing.JLabel(); lblHoras = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Mini Encuesta"); btnWindows.setText("Windows"); btnLinux.setText("Linux"); btnMac.setText("Mac"); jLabel1.setText("Elige un sistema operativo"); ckbProgramacion.setText("Programación"); jLabel2.setText("Elige tu especialidad"); ckbDiseno.setText("Diseño gráfico"); ckbAdministracion.setText("Administración"); btnGenerar.setText("Generar"); btnGenerar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnGenerarActionPerformed(evt); } }); jlHoras.setMaximum(10); jlHoras.setValue(0); jlHoras.addChangeListener(new javax.swing.event.ChangeListener() { public void stateChanged(javax.swing.event.ChangeEvent evt) { jlHorasStateChanged(evt); } }); jLabel3.setText("Horas que dedicas en el ordenador"); lblHoras.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); lblHoras.setText("0"); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(66, 66, 66) .addComponent(btnGenerar) .addGap(0, 0, Short.MAX_VALUE)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(22, 22, 22) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(ckbProgramacion) .addComponent(jLabel2) .addComponent(ckbAdministracion) .addComponent(ckbDiseno) .addComponent(jLabel3) .addComponent(jLabel1) .addComponent(btnLinux) .addComponent(btnMac) .addComponent(btnWindows))) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(lblHoras, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jlHoras, javax.swing.GroupLayout.PREFERRED_SIZE, 135, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 189, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 188, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(37, 37, 37) .addComponent(jLabel1) .addGap(18, 18, 18) .addComponent(btnWindows) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(btnLinux) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(btnMac) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(jSeparator1, javax.swing.GroupLayout.PREFERRED_SIZE, 10, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel2) .addGap(13, 13, 13) .addComponent(ckbProgramacion) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(ckbDiseno) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(ckbAdministracion) .addGap(19, 19, 19) .addComponent(jSeparator2, javax.swing.GroupLayout.PREFERRED_SIZE, 11, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel3) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jlHoras, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGroup(layout.createSequentialGroup() .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 1, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(lblHoras, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE))) .addGap(18, 18, 18) .addComponent(btnGenerar) .addContainerGap(21, Short.MAX_VALUE)) ); pack(); setLocationRelativeTo(null); }// </editor-fold>//GEN-END:initComponents private void btnGenerarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnGenerarActionPerformed String informacion="Tu sistema operativo favorito es: "; //Cogemos todos los radiobutton en un array JRadioButton[] rdbs={btnWindows, btnLinux, btnMac}; for(int i=0;i<rdbs.length;i++){ //Si esta seleccionado, coge el texto if(rdbs[i].isSelected()){ informacion+=rdbs[i].getText(); } } //Hacemos igual con los checkboxes JCheckBox[] ckbs={ckbProgramacion, ckbDiseno, ckbAdministracion}; informacion+=", \nTu especialidad es: "; for(int i=0;i<ckbs.length;i++){ if(ckbs[i].isSelected()){ informacion+=ckbs[i].getText()+" "; } } informacion+=" \n El numero de horas que dedicas al ordenador es: "+jlHoras.getValue(); JOptionPane.showMessageDialog(this, informacion, "Muestra de datos", JOptionPane.INFORMATION_MESSAGE); }//GEN-LAST:event_btnGenerarActionPerformed private void jlHorasStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jlHorasStateChanged lblHoras.setText(String.valueOf(jlHoras.getValue())); }//GEN-LAST:event_jlHorasStateChanged /** * @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(MiniEncuestaApp.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(MiniEncuestaApp.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(MiniEncuestaApp.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(MiniEncuestaApp.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new MiniEncuestaApp().setVisible(true); } }); } // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton btnGenerar; private javax.swing.JRadioButton btnLinux; private javax.swing.JRadioButton btnMac; private javax.swing.JRadioButton btnWindows; private javax.swing.JCheckBox ckbAdministracion; private javax.swing.JCheckBox ckbDiseno; private javax.swing.JCheckBox ckbProgramacion; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JSeparator jSeparator1; private javax.swing.JSeparator jSeparator2; private javax.swing.JSlider jlHoras; private javax.swing.JLabel lblHoras; // End of variables declaration//GEN-END:variables }
[ "anggie_medina@hotmail.es" ]
anggie_medina@hotmail.es
74307b49a5099633867521038f07918290422cd7
27511a2f9b0abe76e3fcef6d70e66647dd15da96
/src/com/instagram/android/business/b/a.java
882b88c2d30caee0fe670a48d5410367bcd6d720
[]
no_license
biaolv/com.instagram.android
7edde43d5a909ae2563cf104acfc6891f2a39ebe
3fcd3db2c3823a6d29a31ec0f6abcf5ceca995de
refs/heads/master
2022-05-09T15:05:05.412227
2016-07-21T03:48:36
2016-07-21T03:48:36
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,715
java
package com.instagram.android.business.b; import android.content.Context; import android.content.res.Resources; import android.util.DisplayMetrics; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import com.facebook.s; import com.facebook.u; import com.facebook.w; import com.github.mikephil.charting.c.k; import com.github.mikephil.charting.charts.BarChart; import com.github.mikephil.charting.charts.HorizontalBarChart; import com.github.mikephil.charting.data.b; import com.github.mikephil.charting.data.g; import com.github.mikephil.charting.data.h; import com.github.mikephil.charting.i.d; import com.instagram.android.business.c.n; import com.instagram.android.business.c.o; import com.instagram.common.z.a.e; import java.util.List; public final class a extends e<g, Void> { private final Context a; public a(Context paramContext) { a = paramContext; } public final int a() { return 1; } public final View a(int paramInt, View paramView, ViewGroup paramViewGroup, Object paramObject1, Object paramObject2) { paramObject2 = paramView; if (paramView == null) { paramView = a; paramObject2 = LayoutInflater.from(paramView).inflate(w.horizontal_bar_chart_view, paramViewGroup, false); paramViewGroup = new o(); a = ((HorizontalBarChart)((View)paramObject2).findViewById(u.chart)); f1 = paramView.getResources().getDimensionPixelOffset(s.horizontal_chart_left_margin); float f2 = paramView.getResources().getDimensionPixelOffset(s.chart_horizontal_margin); float f3 = paramView.getResources().getDimensionPixelOffset(s.chart_top_margin); float f4 = paramView.getResources().getDimensionPixelOffset(s.horizontal_chart_bottom_margin); a.b(f1, f3, f2, f4); a.getViewPortHandler().a(f1, f3, f2, f4); ((View)paramObject2).setTag(paramViewGroup); } paramView = a; paramViewGroup = (o)((View)paramObject2).getTag(); paramObject1 = (g)paramObject1; paramInt = 0; while (paramInt < ((g)paramObject1).e().size()) { h localh = (h)((g)paramObject1).c(paramInt); if (localh != null) { localh.a(5.35F); localh.a(n.a(localh, paramView)); localh.a(false); } paramInt += 1; } n.a(a, (g)paramObject1, paramView); float f1 = paramView.getResources().getDimensionPixelOffset(s.horizontal_chart_label_padding) / getResourcesgetDisplayMetricsdensity; a.getXAxis().b(f1); a.setData((b)paramObject1); return (View)paramObject2; } } /* Location: * Qualified Name: com.instagram.android.business.b.a * Java Class Version: 6 (50.0) * JD-Core Version: 0.7.1 */
[ "reverseengineeringer@hackeradmin.com" ]
reverseengineeringer@hackeradmin.com
c8348e9ad7638744097a7fa4daf00a6368aa7320
26dd66af1b87c5a6424ee614c4e2be00151edcf8
/src/org/usfirst/frc/team321/robot/commands/subsystems/manipulator/UseIntakeJoystick.java
98deefbcb9a8f30a5eb86e7b7970abfae1f13e2c
[]
no_license
RoboLancers/FRC_2018
6a62e55794e3fb0b01ac91141c480d2983e00f63
6da40a390544c6c32f7ce40591fbeba1aaa4d01e
refs/heads/master
2021-03-27T10:04:00.365632
2018-05-04T16:09:56
2018-05-04T16:09:56
116,182,328
0
0
null
null
null
null
UTF-8
Java
false
false
1,296
java
package org.usfirst.frc.team321.robot.commands.subsystems.manipulator; import org.usfirst.frc.team321.robot.Robot; import edu.wpi.first.wpilibj.command.Command; public class UseIntakeJoystick extends Command { double power; boolean rumble = false; boolean wasIntaking = false; public UseIntakeJoystick() { requires(Robot.manipulator.getIntake()); } protected void initialize() { Robot.manipulator.getIntake().stop(false); } protected void execute() { if (Robot.oi.xboxController.leftBumper.get()) { power = 0.87; } else if (Robot.oi.xboxController.rightBumper.get()){ power = -0.7; } else { power = -Math.abs(Math.abs(Robot.oi.flightController.getRotateAxisValue()) > 0.5 ? Robot.oi.flightController.getRotateAxisValue() : 0) * 0.25; } if (power > 0) { wasIntaking = true; } else if (power < 0) { wasIntaking = false; } if (wasIntaking && power == 0) { power = 0.2; } Robot.manipulator.getIntake().setAll(power); Robot.oi.xboxController.setRumble(power > 0 && !wasIntaking); } protected void interrupted() { end(); } protected void end() { Robot.oi.xboxController.setRumble(false); } @Override protected boolean isFinished() { return false; } }
[ "brianchen0810@gmail.com" ]
brianchen0810@gmail.com
41a3dc2d9604c36e25f1792c161412c8d70cd23e
9410ef0fbb317ace552b6f0a91e0b847a9a841da
/src/main/java/com/tencentcloudapi/tcss/v20201101/models/DescribeReverseShellWhiteListDetailRequest.java
7c9814e5a85f4c745971b0ccf4bb1be8067a978f
[ "Apache-2.0" ]
permissive
TencentCloud/tencentcloud-sdk-java-intl-en
274de822748bdb9b4077e3b796413834b05f1713
6ca868a8de6803a6c9f51af7293d5e6dad575db6
refs/heads/master
2023-09-04T05:18:35.048202
2023-09-01T04:04:14
2023-09-01T04:04:14
230,567,388
7
4
Apache-2.0
2022-05-25T06:54:45
2019-12-28T06:13:51
Java
UTF-8
Java
false
false
2,138
java
/* * Copyright (c) 2017-2018 THL A29 Limited, a Tencent company. 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. */ package com.tencentcloudapi.tcss.v20201101.models; import com.tencentcloudapi.common.AbstractModel; import com.google.gson.annotations.SerializedName; import com.google.gson.annotations.Expose; import java.util.HashMap; public class DescribeReverseShellWhiteListDetailRequest extends AbstractModel{ /** * Allowed item ID */ @SerializedName("WhiteListId") @Expose private String WhiteListId; /** * Get Allowed item ID * @return WhiteListId Allowed item ID */ public String getWhiteListId() { return this.WhiteListId; } /** * Set Allowed item ID * @param WhiteListId Allowed item ID */ public void setWhiteListId(String WhiteListId) { this.WhiteListId = WhiteListId; } public DescribeReverseShellWhiteListDetailRequest() { } /** * NOTE: Any ambiguous key set via .set("AnyKey", "value") will be a shallow copy, * and any explicit key, i.e Foo, set via .setFoo("value") will be a deep copy. */ public DescribeReverseShellWhiteListDetailRequest(DescribeReverseShellWhiteListDetailRequest source) { if (source.WhiteListId != null) { this.WhiteListId = new String(source.WhiteListId); } } /** * Internal implementation, normal users should not use it. */ public void toMap(HashMap<String, String> map, String prefix) { this.setParamSimple(map, prefix + "WhiteListId", this.WhiteListId); } }
[ "tencentcloudapi@tencent.com" ]
tencentcloudapi@tencent.com
0d5af6ddc37381d7dba4665bb935958fb515e71d
4cba9c30a002f7894ad42c9abc95ae3d329761e1
/javabase-multithreading/src/main/java/守护线程.java
f8ad1a19ef93c3be9b2f8b3166a6bdb92a1ac62f
[]
no_license
lafeier888/learn
d9fa10461f975b73d52ad438cbcd8538e2823ce2
2e5876221ad3c4720accd2bf5072584e9d752466
refs/heads/master
2020-06-01T00:05:04.401548
2019-06-06T09:03:27
2019-06-06T09:03:27
190,549,980
0
0
null
null
null
null
UTF-8
Java
false
false
82
java
public class 守护线程 { public static void main(String[] args) { } }
[ "812747475@qq.com" ]
812747475@qq.com
e709df2e6fab15947e4c10f4cd95ce382ff86f3d
8809f22b1afd8dc87d5d2e9e3c1440a6affc2bcc
/spring_learn/src/cn/spring/spring_proxy/dao/xml_spring_aop/Person.java
f04c53d977550b7a3d85942d609182bfadf3a07a
[]
no_license
vicTheo/Java_Learning
5100eacea3a2274519e225048e5f73155d693b6b
b073c5b6363f84f90de94f00e5448e8d635fdfb8
refs/heads/master
2021-01-10T02:10:26.778061
2015-06-18T13:02:10
2015-06-18T13:02:10
36,284,174
0
0
null
null
null
null
UTF-8
Java
false
false
409
java
package cn.spring.spring_proxy.dao.xml_spring_aop; public class Person { private String pname; private Integer pid; public Person(String pname,Integer pid){ this.pname=pname; this.pid=pid; } public String getPname() { return pname; } public void setPname(String pname) { this.pname = pname; } public Integer getPid() { return pid; } public void setPid(Integer pid) { this.pid = pid; } }
[ "1029207824@qq.com" ]
1029207824@qq.com
892eb61e06f33201467b47177b0644249a4d7354
25cb67f4d7ffd89258fd6fe4e51be0e9eaf57e95
/src/main/java/com/zjw/jdk/xml/convert/utils/JSONPointerException.java
8be4ed5a27eb77da534a79abb3f937e5d8862824
[]
no_license
zhouminsen/jdk
f9b58a20c9dc873622c7d164063e65b2930a5a2a
234b90fb862761fb3868aeb05daeae064743fde2
refs/heads/master
2022-12-22T12:02:25.317531
2020-05-22T03:04:45
2020-05-22T03:04:45
116,328,867
1
0
null
2022-12-16T03:28:05
2018-01-05T02:07:31
Java
UTF-8
Java
false
false
1,632
java
package com.zjw.jdk.xml.convert.utils; /* Copyright (c) 2002 JSON.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. The Software shall be used for Good, not Evil. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /** * The JSONPointerException is thrown by {@link JSONPointer} if an error occurs * during evaluating a pointer. * * @author JSON.org * @version 2016-05-13 */ public class JSONPointerException extends JSONException { private static final long serialVersionUID = 8872944667561856751L; public JSONPointerException(String message) { super(message); } public JSONPointerException(String message, Throwable cause) { super(message, cause); } }
[ "weijia1992427" ]
weijia1992427
e88bbfa275ed6e17ec23c95d2cd714b49dbb154d
69474017e51115048103f5775dbf14d4070eb8ce
/src/main/java/com/uptc/desingMatch/controllers/DraftController.java
f6a50aeb8c99d90721ec8b7fb64dd4f310b0e217
[]
no_license
felipGonzalez/BackenDesing-Match
bd8d0bcf1b8938468c6516880b86857e0cb6969a
d0b8422099d9f808d6a636152f3d722d9cfa15af
refs/heads/master
2021-06-16T11:53:22.870843
2019-07-23T17:12:57
2019-07-23T17:12:57
194,929,144
0
0
null
2021-04-26T19:19:22
2019-07-02T20:18:00
Java
UTF-8
Java
false
false
2,956
java
package com.uptc.desingMatch.controllers; import java.io.File; import java.util.List; import java.util.Optional; import javax.servlet.ServletContext; import javax.validation.Valid; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpStatus; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import com.uptc.desingMatch.models.Company; import com.uptc.desingMatch.models.Draft; import com.uptc.desingMatch.service.CompanyService; import com.uptc.desingMatch.service.DraftService; import com.uptc.desingMatch.util.Const; import com.uptc.desingMatch.util.RestResponse; import com.uptc.desingMatch.util.Util; @RestController @RequestMapping("/draft") @CrossOrigin(origins = {Const.DOMAIN}) public class DraftController { @Autowired private DraftService service; @Autowired private CompanyService service2; @Autowired private ServletContext context; @GetMapping(value="/{id}") public List<Draft> getList(@PathVariable int id){ return service.getList(id); } //guardar Proyecto @PostMapping(value="") public RestResponse save(@RequestBody Draft draft) { if(!this.validate(draft)) { return new RestResponse(HttpStatus.NOT_ACCEPTABLE.value(),"Los campos obligatorios no estan diligenciados "); } service.save(draft); Optional<Company> company = service2.getCompany(draft.getIdCompany()); Util.createImg(context.getRealPath("/finalDisenos")+"/"+company.get().getUrlCompany()+"/"+draft.getIdDraft()); Util.createImg(context.getRealPath("/imgDisenos")+"/"+company.get().getUrlCompany()+"/"+draft.getIdDraft()); return new RestResponse(HttpStatus.OK.value(), "Operacion exitosa"); } private boolean validate(Draft draft) { return (!validateString(draft.getNameDraft())); } private boolean validateString(String string) { return string.isEmpty(); } //Borrar proyecto @DeleteMapping(value = "{id}") public RestResponse remove(@PathVariable int id){ Optional<Draft> draft = service.getDraft(id); try { service.remove(id); return new RestResponse(HttpStatus.OK.value(), "Proyecto borrado"); } catch (Exception e) { try { service.removeCascade(id); return new RestResponse(HttpStatus.OK.value(), "Proyecto y diseños borrados"); } catch (Exception e2) { return new RestResponse(HttpStatus.EXPECTATION_FAILED.value(), "Proyecto no encontrado"); } } } public void deleteData() { String filesPath = context.getRealPath("/img"); File fileFolder = new File(filesPath); } }
[ "afelipgb@gmail.com" ]
afelipgb@gmail.com
3348c45861b7b0323d6c714fbf6b85704c03ae75
f10dafcd4cad941de4a52f93859a29ea73d7c776
/app/src/main/java/com/georgeadaimi/scoutguide/NthLebList.java
130c3de00143ceeb77340c5f93fdb1d466df412d
[]
no_license
george-adaimi/ScoutGuide
5d92a37b3b74a0c002475320d30ef1624695d7d7
72160d1919eed117cd991eddd28289d9329faa17
refs/heads/master
2021-01-20T19:59:40.683189
2016-07-24T05:34:41
2016-07-24T05:34:41
64,050,359
0
0
null
null
null
null
UTF-8
Java
false
false
6,002
java
package com.georgeadaimi.scoutguide; import java.net.MalformedURLException; import com.google.common.util.concurrent.ListenableFuture; import com.google.common.util.concurrent.SettableFuture; import com.microsoft.windowsazure.mobileservices.MobileServiceClient; import com.microsoft.windowsazure.mobileservices.MobileServiceList; import com.microsoft.windowsazure.mobileservices.http.NextServiceFilterCallback; import com.microsoft.windowsazure.mobileservices.http.ServiceFilter; import com.microsoft.windowsazure.mobileservices.http.ServiceFilterRequest; import com.microsoft.windowsazure.mobileservices.http.ServiceFilterResponse; import com.microsoft.windowsazure.mobileservices.table.MobileServiceTable; import android.app.AlertDialog; import android.app.Fragment; import android.os.AsyncTask; import android.os.Bundle; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ListView; import android.widget.ProgressBar; import android.widget.TextView; public class NthLebList extends Fragment { private MobileServiceClient mClient; private MobileServiceTable<Emplacement> mToDoTable; private ProgressBar mProgressBar; private CursorAdapter mAdapter; AsyncTask<Void, Void, Void> task; public NthLebList(){ } @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View view = inflater.inflate(R.layout.listview, container, false); //getActivity().getActionBar().setTitle("North Lebanon"); mProgressBar = (ProgressBar) view.findViewById(R.id.loadingProgressBar); // Initialize the progress bar mProgressBar.setVisibility(ProgressBar.GONE); try { // Create the Mobile Service Client instance, using the provided // Mobile Service URL and key mClient = new MobileServiceClient( "https://scoutguide.azurewebsites.net", getActivity() ).withFilter(new ProgressFilter()); // Get the Mobile Service Table instance to use mToDoTable = mClient.getTable(Emplacement.class); // Create an adapter to bind the items with the view mAdapter = new CursorAdapter(getActivity(), R.layout.listview_item); ListView listViewToDo = (ListView) view.findViewById(R.id.listView1); listViewToDo.setAdapter(mAdapter); TextView delete = (TextView) view.findViewById(R.id.deleteText); delete.setVisibility(View.INVISIBLE); // Load the items from the Mobile Service refreshItemsFromTable(); } catch (MalformedURLException e) { createAndShowDialog(new Exception("There was an error creating the Mobile Service. Verify the URL"), "Error"); } return view; } /** * Creates a dialog and shows it * * @param exception * The exception to show in the dialog * @param title * The dialog title */ private void createAndShowDialog(Exception exception, String title) { Throwable ex = exception; if(exception.getCause() != null){ ex = exception.getCause(); } createAndShowDialog(ex.getMessage(), title); } /** * Refresh the list with the items in the Mobile Service Table */ private void refreshItemsFromTable() { // Get the items that weren't marked as completed and add them in the // adapter task= new AsyncTask<Void, Void, Void>() { @Override protected Void doInBackground(Void... params) { try { final MobileServiceList<Emplacement> result = mToDoTable.where().field("district").eq("North Lebanon").execute().get(); getActivity().runOnUiThread(new Runnable() { @Override public void run() { mAdapter.clear(); for (Emplacement item : result) { mAdapter.add(item); } } }); } catch (Exception exception) { createAndShowDialog(exception, "Error"); } return null; } }.execute(); } /** * Creates a dialog and shows it * * @param message * The dialog message * @param title * The dialog title */ private void createAndShowDialog(String message, String title) { AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setMessage(message); builder.setTitle(title); builder.create().show(); } private class ProgressFilter implements ServiceFilter { @Override public ListenableFuture<ServiceFilterResponse> handleRequest( ServiceFilterRequest request, NextServiceFilterCallback next) { getActivity().runOnUiThread(new Runnable() { @Override public void run() { if (mProgressBar != null) mProgressBar.setVisibility(ProgressBar.VISIBLE); } }); SettableFuture<ServiceFilterResponse> result = SettableFuture.create(); try { ServiceFilterResponse response = next.onNext(request).get(); result.set(response); } catch (Exception exc) { result.setException(exc); } dismissProgressBar(); return result; } private void dismissProgressBar() { getActivity().runOnUiThread(new Runnable() { @Override public void run() { if (mProgressBar != null) mProgressBar.setVisibility(ProgressBar.GONE); } }); } } @Override public void onStop() { super.onStop(); //check the state of the task if(task != null && task.getStatus() == AsyncTask.Status.RUNNING) task.cancel(true); } }
[ "George Adaimi" ]
George Adaimi
4f587656f60f9b3737a5f9599783f830df175472
17a33488736d3f6b84beaacbfcdc15dc43261a9e
/support/cas-server-support-oidc-core-api/src/main/java/org/apereo/cas/oidc/jwks/generator/OidcJsonWebKeystoreModifiedEvent.java
c1057ce2f9bde99cbc60e3fa8d65b4ecee53d51d
[ "Apache-2.0", "LicenseRef-scancode-warranty-disclaimer", "LicenseRef-scancode-free-unknown" ]
permissive
hdeadman/cas
68fa815d55ccc36a31b5037f500a8e827b6a566d
6d3cf1b64b2d4f9ab1ba07ab1105c9b7c77e8870
refs/heads/pr-puppeteerwin2
2023-08-06T05:59:12.248532
2022-03-16T00:32:45
2022-03-16T00:32:45
80,761,455
1
1
Apache-2.0
2022-03-22T00:15:11
2017-02-02T19:38:09
Java
UTF-8
Java
false
false
629
java
package org.apereo.cas.oidc.jwks.generator; import org.apereo.cas.support.events.AbstractCasEvent; import lombok.Getter; import lombok.ToString; import java.io.File; /** * This is {@link OidcJsonWebKeystoreModifiedEvent}. * * @author Misagh Moayyed * @since 6.5.0 */ @ToString(callSuper = true) @Getter public class OidcJsonWebKeystoreModifiedEvent extends AbstractCasEvent { private static final long serialVersionUID = 8059647975948452375L; private final File file; public OidcJsonWebKeystoreModifiedEvent(final Object source, final File file) { super(source); this.file = file; } }
[ "mm1844@gmail.com" ]
mm1844@gmail.com
000ecfaf4aa697c962ddef2d13d3ff621cfcbe14
fa91450deb625cda070e82d5c31770be5ca1dec6
/Diff-Raw-Data/9/9_2c5ad38166ecdf5916bbdb345437a6f60b580880/AdministradorOrdenesDespachoBean/9_2c5ad38166ecdf5916bbdb345437a6f60b580880_AdministradorOrdenesDespachoBean_t.java
b6eeb4c86bfd61c5ccaebc59afc787e9f6bbf8f8
[]
no_license
zhongxingyu/Seer
48e7e5197624d7afa94d23f849f8ea2075bcaec0
c11a3109fdfca9be337e509ecb2c085b60076213
refs/heads/master
2023-07-06T12:48:55.516692
2023-06-22T07:55:56
2023-06-22T07:55:56
259,613,157
6
2
null
2023-06-22T07:55:57
2020-04-28T11:07:49
null
UTF-8
Java
false
false
1,245
java
package despacho.backend.administradores; import java.util.List; import javax.ejb.Stateless; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import despacho.backend.entities.*; @Stateless public class AdministradorOrdenesDespachoBean implements AdministradorOrdenesDespacho { @PersistenceContext(unitName="portalweb.despacho") private EntityManager em; @Override public void agregar(OrdenDespacho ordenDespacho) { this.em.persist(ordenDespacho); } @Override public List<OrdenDespacho> listar() { @SuppressWarnings("unchecked") List<OrdenDespacho> ordenesDespacho = this.em.createQuery(" FROM OrdenDespacho").getResultList(); return ordenesDespacho; } @Override public List<OrdenDespacho> listarPorEstado(String estado) { @SuppressWarnings("unchecked") List<OrdenDespacho> ordenesDespacho = this.em.createQuery(" FROM OrdenDespacho WHERE estado = '" + estado + "' ORDER BY fecha").getResultList(); return ordenesDespacho; } @Override public void actualizar(OrdenDespacho ordenDespacho) { this.em.merge(ordenDespacho); } @Override public OrdenDespacho get(int id) { return this.em.find(OrdenDespacho.class, id); } }
[ "yuzhongxing88@gmail.com" ]
yuzhongxing88@gmail.com
bd77c5afd567284e77d62fda6c1091989a62d70a
aa605322921bea5d68d55ef8b7b83dab48fb3319
/src/test/java/com/example/ConsumingRestApplicationTests.java
75e7014fb7432ac12bb15e8d0f060da4296b1ae0
[]
no_license
atropose/consuming-rest
8e434811c26c9b6a24c8b8d340e640f252298bf0
e3d5cfeb246a2b7013803e23f96dc32064cd330d
refs/heads/master
2023-04-11T03:30:18.819155
2021-04-04T22:03:48
2021-04-04T22:03:48
354,653,892
0
0
null
null
null
null
UTF-8
Java
false
false
210
java
package com.example; import org.junit.jupiter.api.Test; import org.springframework.boot.test.context.SpringBootTest; @SpringBootTest class ConsumingRestApplicationTests { @Test void contextLoads() { } }
[ "atropose76@gmail.com" ]
atropose76@gmail.com
39ec6d0932855753ce5c55ac8b7357ba30048e08
d74c2ca437a58670dc8bfbf20a3babaecb7d0bea
/SAP_858310_lines/Source - 963k/js.webcontainer.service/dev/src/_tc~je~webcontainer/java/com/sap/engine/services/servlets_jsp/server/qos/wcerdresourceprovider.java
45c9f83462c066dba3e3f51b08f2d5174c251f27
[]
no_license
javafullstackstudens/JAVA_SAP
e848e9e1a101baa4596ff27ce1aedb90e8dfaae8
f1b826bd8a13d1432e3ddd4845ac752208df4f05
refs/heads/master
2023-06-05T20:00:48.946268
2021-06-30T10:07:39
2021-06-30T10:07:39
381,657,064
0
0
null
null
null
null
UTF-8
Java
false
false
2,466
java
package com.sap.engine.services.servlets_jsp.server.qos; import com.sap.engine.lib.rcm.Constraint; import com.sap.engine.lib.rcm.Notification; import com.sap.engine.lib.rcm.Resource; import com.sap.engine.lib.rcm.ResourceContext; import com.sap.engine.lib.rcm.ResourceManager; import com.sap.engine.lib.rcm.ResourceProvider; import com.sap.engine.lib.rcm.impl.ResourceManagerImpl; import com.sap.engine.services.servlets_jsp.server.LogContext; import com.sap.engine.services.servlets_jsp.server.ServiceContext; import com.sap.tc.logging.Severity; public class WCERDResourceProvider implements ResourceProvider { private ResourceManager rcm = new ResourceManagerImpl(); private ThreadResource threadResource = null; private RDUsageMonitor wceMonitor = null; private RDConstraint constraint; public WCERDResourceProvider() { super(); //TODO max per consumer int maxPerConsumer = ServiceContext.getServiceContext().getWebContainerProperties().getRDThreadCountFactor() * ServiceContext.getServiceContext().getHttpProvider().getHttpProperties().getFCAServerThreadCount(); threadResource = new ThreadResource("HTTP Worker", 0); rcm.registerResource(this); ResourceContext resCxt = rcm.createResourceContext(threadResource.getName(), RequestDispatcherConsumer.WCE_REQUEST_DISPATCHER_CONSUMER); threadResource.setTotalQuantity(maxPerConsumer); wceMonitor = new RDUsageMonitor(); resCxt.addNotification(wceMonitor); constraint = new RDConstraint(wceMonitor); resCxt.addConstraint(constraint); } @Override public Constraint getDefaultConstrait() { return constraint; } @Override public Notification getDefaultNotification() { return wceMonitor; } @Override public Resource getResource() { return threadResource; } public boolean consume(RequestDispatcherConsumer consumer) { if (LogContext.getLocationQoS().beDebug()) { LogContext.getLocationQoS().logT(Severity.DEBUG, "WCE RD is consuming by [" + consumer.getId() + "]"); } return rcm.consume(consumer, threadResource.getName(), 1); } public void release(RequestDispatcherConsumer consumer) { if (LogContext.getLocationQoS().beDebug()) { LogContext.getLocationQoS().logT(Severity.DEBUG, "WCE RD is released by [" + consumer.getId() + "]"); } rcm.release(consumer, threadResource.getName(), 1); } public RDUsageMonitor getMonitor() { return wceMonitor; } }
[ "Yalin.Arie@checkmarx.com" ]
Yalin.Arie@checkmarx.com
09ae73bb6ab7af6d5a9ea8fd718fcbaf96372677
57069d9ea11c77f61ec65b6a687b139e161a2aec
/src/main/java/me/jiaojian/domain/Catalog.java
2227ffac94f521fc4c380806b4642b822e37e638
[]
no_license
JiaoJian1221/ibook-web
dd861435d265863f17673c89b0b99677fa47bd4e
c534568134579a0ac98000e7c5c7cc6d2e5637f5
refs/heads/master
2021-09-05T21:19:40.015026
2018-01-31T03:24:43
2018-01-31T03:24:43
119,628,634
0
0
null
null
null
null
UTF-8
Java
false
false
1,034
java
package me.jiaojian.domain; import javax.persistence.*; import java.util.List; /** * Created by jiaojian on 2018/1/4. */ @Entity public class Catalog { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String name; @ManyToOne @JoinColumn(name = "channel_id") private Channel channel; @OneToMany @JoinColumn(name = "catalog_id") private List<Book> books; private String jdUri; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public Channel getChannel() { return channel; } public void setChannel(Channel channel) { this.channel = channel; } public String getJdUri() { return jdUri; } public void setJdUri(String jdUri) { this.jdUri = jdUri; } public List<Book> getBooks() { return books; } public void setBooks(List<Book> books) { this.books = books; } }
[ "riz.jiao@gmail.com" ]
riz.jiao@gmail.com
9ff3c063f5dc04a852a87029a3c638b3856d33d3
d6df0692aa0b048c059ec0b47b53885e8180513c
/src/main/java/com/gl365/member/mq/producer/JPushProducer.java
45b4cddff34d3dc91977d9cdf07b3eb028760898
[]
no_license
pengjianbo3478/member
9c4d02d2694060d93fefaa29e7f7272b8f20e555
51a4082253adb49eecb10629a2a166fac2abd2ed
refs/heads/master
2020-03-13T19:36:01.067895
2018-04-27T06:43:52
2018-04-27T06:43:52
131,256,654
0
0
null
null
null
null
UTF-8
Java
false
false
955
java
package com.gl365.member.mq.producer; import javax.annotation.Resource; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Component; import com.gl365.aliyun.ons.OnsProducer; import com.gl365.member.common.JsonUtils; import com.gl365.member.dto.mq.push.PushMQ; import com.gl365.member.mq.consumer.PaymentConsumer; @Component public class JPushProducer { private static final Logger LOG = LoggerFactory.getLogger(PaymentConsumer.class); @Lazy @Resource(name = "gl365-jpush-producer") private OnsProducer jpushProducer; public void send(PushMQ command) { String message = JsonUtils.toJsonString(command); LOG.info("<mq-send>推送通知APP》》》入参:{}", message); try { jpushProducer.send(message); } catch (Exception e) { LOG.error("<mq-send>推送通知APP》》》错误:{}", e); } } }
[ "DEKK@DESKTOP-D6KV7VG" ]
DEKK@DESKTOP-D6KV7VG
854c88d979d0bf42cc06846ff6dd1a6c52dd02f6
62ddade93fbe9682df9d71f684d5270c4a691323
/ch04-aop-aspectj/src/main/java/com/ywt/ba03/MyAspect.java
2dc2dd5ce58006e968b1b9b89d3a9ef79102bfae
[]
no_license
xxxdrawayne/SpringTest
0c1d8852e4c9135d5787b2d33d991dfbaf3107a9
bc7c149e3fa041558b6a5e6718f05cec3a32d7ab
refs/heads/master
2023-03-27T04:17:09.323164
2021-03-26T13:00:34
2021-03-26T13:00:34
351,781,939
0
0
null
null
null
null
UTF-8
Java
false
false
2,192
java
package com.ywt.ba03; import com.ywt.ba02.Student; import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.annotation.AfterReturning; import org.aspectj.lang.annotation.Around; import org.aspectj.lang.annotation.Aspect; import org.springframework.stereotype.Component; import java.util.Date; /** * @author ywt * @version 1.0 * @date 2020/12/1 19:16 */ /** * @Aspect :是Aspectj框架中的注解。 * 作用:表示当前类是切面类。 * 切面类:是用来给业务方法增加功能的类,在这个类中由切面的功能代码。 */ @Aspect @Component("myAspect") public class MyAspect { /** * 环绕方法的定义格式:公共方法public, * 必须有一个返回值,推荐是Object * 方法名称自定义, * 方法是有参数的,固定的参数 ProceedingJointPoint */ /** * @Around:环绕置通知 * 属性:value 切入表达式 * 位置:在方法定义的上面 * 特点:1.它是功能最强的通知 * 2.在目标方法前和后都能增强功能。 * 3.控制目标方法是否被调用执行。 * 4.修改原来的目标方法的执行结果。 影响最后的调用结果。 * * 环绕通知,等同于JDK动态代理的 InvocationHandler接口 * 参数:ProceedingJoinPoint 等同于Method * 返回值:就是目标方法的执行结果,可以被修改 * * 环绕通知:经常做事务,在目标方法之前开启事务,执行目标方法,在目标方法之后执行事务。 */ @Around(value = "execution(* *..SomeServiceImpl.doFirst(..))") public Object myAround(ProceedingJoinPoint pjb) throws Throwable { //实现环绕通知 Object obj = null; System.out.println("在目标方法执行之前,添加日志:"+new Date()); //目标方法调用 obj = pjb.proceed(); //等同于method.invote(); System.out.println("在目标方法执行之后,提交事务"); obj = "sss"; return obj; } }
[ "1912297235@qq.com" ]
1912297235@qq.com
41db315fd1113b1017ccbae1f1314f0627bc961d
d603c031019ae27128a04e8d0fc1597fb3b749f3
/app/src/main/java/com/zinios/dealab/api/APIURLHelper.java
690ebac1dbb29eea70c03ae97f3e83663171738d
[]
no_license
vihangayw/dealab-android
a1fade9271f966006c79a039653474b159b0c971
af878e7885cb707542a7c34a13ee2563e63a3717
refs/heads/master
2023-07-09T23:37:39.601267
2018-11-03T06:25:07
2018-11-03T06:25:07
396,614,172
0
0
null
null
null
null
UTF-8
Java
false
false
963
java
package com.zinios.dealab.api; public class APIURLHelper { private static final String BASE_URL = "http://192.168.8.102:9000/v1/deal"; private static final String ALL_LOCATIONS = "/map-all"; private static final String NEAR_LOCATIONS = "/map-boundary-all"; private static final String DEAL_TODAY = "/all-today"; private static final String LONGITUDE = "lng="; private static final String LATITUDE = "lat="; private static final String BRANCH_ID = "branchId="; public static String getAllLocationsURL() { return BASE_URL.concat(ALL_LOCATIONS); } public static String getAllLocationsURL(int bid) { return BASE_URL.concat(DEAL_TODAY) .concat("?").concat(BRANCH_ID).concat(String.valueOf(bid)); } public static String getNearLocationsURL(double lat, double lng) { return BASE_URL.concat(NEAR_LOCATIONS).concat("?") .concat(LONGITUDE).concat(String.valueOf(lng)) .concat("&") .concat(LATITUDE).concat(String.valueOf(lat)); } }
[ "vyasith@gmail.com" ]
vyasith@gmail.com
6ee78d0d683521ce9213baa79a85e0d0eaa2ff1a
00ce956e611a4b1d214a9d54ca538469359484f9
/hbase-common/src/main/java/org/apache/hadoop/hbase/io/ByteBufferPool.java
e528f028f81d0cd9abe6d792a43de98c85e9ccda
[ "Apache-2.0", "BSD-3-Clause", "MIT", "LicenseRef-scancode-protobuf", "CC-BY-3.0" ]
permissive
enis/hbase-sal
35cecd7917dacae7f5445b971cf009bd9f5a3271
4c122ced6e025805dcb2af07ac60f83482f51a5a
refs/heads/master
2021-01-12T17:53:52.459692
2016-10-22T01:54:01
2016-11-07T22:24:42
71,297,613
1
2
Apache-2.0
2023-03-20T11:56:29
2016-10-18T22:44:52
Java
UTF-8
Java
false
false
6,248
java
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you 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.apache.hadoop.hbase.io; import java.nio.ByteBuffer; import java.util.Queue; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.concurrent.atomic.AtomicInteger; import com.google.common.annotations.VisibleForTesting; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.hadoop.hbase.classification.InterfaceAudience; /** * Like Hadoops' ByteBufferPool only you do not specify desired size when getting a ByteBuffer. This * pool keeps an upper bound on the count of ByteBuffers in the pool and a fixed size of ByteBuffer * that it will create. When requested, if a free ByteBuffer is already present, it will return * that. And when no free ByteBuffer available and we are below the max count, it will create a new * one and return that. * * <p> * Note: This pool returns off heap ByteBuffers by default. If on heap ByteBuffers to be pooled, * pass 'directByteBuffer' as false while construction of the pool. * <p> * This class is thread safe. * * @see ByteBufferListOutputStream */ @InterfaceAudience.Private public class ByteBufferPool { private static final Log LOG = LogFactory.getLog(ByteBufferPool.class); // TODO better config names? // hbase.ipc.server.reservoir.initial.max -> hbase.ipc.server.reservoir.max.buffer.count // hbase.ipc.server.reservoir.initial.buffer.size -> hbase.ipc.server.reservoir.buffer.size public static final String MAX_POOL_SIZE_KEY = "hbase.ipc.server.reservoir.initial.max"; public static final String BUFFER_SIZE_KEY = "hbase.ipc.server.reservoir.initial.buffer.size"; public static final int DEFAULT_BUFFER_SIZE = 64 * 1024;// 64 KB. Making it same as the chunk size // what we will write/read to/from the // socket channel. private final Queue<ByteBuffer> buffers = new ConcurrentLinkedQueue<ByteBuffer>(); private final int bufferSize; private final int maxPoolSize; private AtomicInteger count; // Count of the BBs created already for this pool. private final boolean directByteBuffer; //Whether this pool should return DirectByteBuffers private boolean maxPoolSizeInfoLevelLogged = false; /** * @param bufferSize Size of each buffer created by this pool. * @param maxPoolSize Max number of buffers to keep in this pool. */ public ByteBufferPool(int bufferSize, int maxPoolSize) { this(bufferSize, maxPoolSize, true); } /** * @param bufferSize Size of each buffer created by this pool. * @param maxPoolSize Max number of buffers to keep in this pool. * @param directByteBuffer Whether to create direct ByteBuffer or on heap ByteBuffer. */ public ByteBufferPool(int bufferSize, int maxPoolSize, boolean directByteBuffer) { this.bufferSize = bufferSize; this.maxPoolSize = maxPoolSize; this.directByteBuffer = directByteBuffer; // TODO can add initialPoolSize config also and make those many BBs ready for use. LOG.info("Created ByteBufferPool with bufferSize : " + bufferSize + " and maxPoolSize : " + maxPoolSize); this.count = new AtomicInteger(0); } /** * @return One free ByteBuffer from the pool. If no free ByteBuffer and we have not reached the * maximum pool size, it will create a new one and return. In case of max pool size also * reached, will return null. When pool returned a ByteBuffer, make sure to return it back * to pool after use. * @see #putbackBuffer(ByteBuffer) */ public ByteBuffer getBuffer() { ByteBuffer bb = buffers.poll(); if (bb != null) { // Clear sets limit == capacity. Position == 0. bb.clear(); return bb; } while (true) { int c = this.count.intValue(); if (c >= this.maxPoolSize) { if (maxPoolSizeInfoLevelLogged) { if (LOG.isDebugEnabled()) { LOG.debug("Pool already reached its max capacity : " + this.maxPoolSize + " and no free buffers now. Consider increasing the value for '" + MAX_POOL_SIZE_KEY + "' ?"); } } else { LOG.info("Pool already reached its max capacity : " + this.maxPoolSize + " and no free buffers now. Consider increasing the value for '" + MAX_POOL_SIZE_KEY + "' ?"); maxPoolSizeInfoLevelLogged = true; } return null; } if (!this.count.compareAndSet(c, c + 1)) { continue; } if (LOG.isTraceEnabled()) { LOG.trace("Creating a new offheap ByteBuffer of size: " + this.bufferSize); } return this.directByteBuffer ? ByteBuffer.allocateDirect(this.bufferSize) : ByteBuffer.allocate(this.bufferSize); } } /** * Return back a ByteBuffer after its use. Do not try to return put back a ByteBuffer, not * obtained from this pool. * @param buf ByteBuffer to return. */ public void putbackBuffer(ByteBuffer buf) { if (buf.capacity() != this.bufferSize || (this.directByteBuffer ^ buf.isDirect())) { LOG.warn("Trying to put a buffer, not created by this pool! Will be just ignored"); return; } buffers.offer(buf); } int getBufferSize() { return this.bufferSize; } /** * @return Number of free buffers */ @VisibleForTesting int getQueueSize() { return buffers.size(); } }
[ "anoopsamjohn@gmail.com" ]
anoopsamjohn@gmail.com
8b218dda6d70ab26ea1c4ce890a43c89db520bb7
3d6082261fcdd8121b615e589982c9601faca2f6
/app/src/main/java/com/example/reem/eventmaker/EventsAvailable.java
bf62063dc06f95aaee146ad5e4c46a1ddf32354c
[]
no_license
TareqElgafy/EventMakerApp
a41599b6341bcc6cb5004e24892706ff58f37cc5
37dbfba64a1193140320ac95161a5302d2ffc5a4
refs/heads/master
2016-08-12T11:40:18.252903
2015-10-04T17:09:05
2015-10-04T17:09:05
43,644,478
0
0
null
null
null
null
UTF-8
Java
false
false
3,557
java
package com.example.reem.eventmaker; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.AutoCompleteTextView; import android.widget.Button; import android.widget.TextView; import android.widget.Toast; import java.util.ArrayList; import retrofit.Callback; import retrofit.RestAdapter; import retrofit.RetrofitError; import retrofit.client.Response; /** * Created by Reem on 8/24/2015. */ public class EventsAvailable extends Activity { Button btn_createEvent,btn_viewEvents; AutoCompleteTextView autoCompleteTextView; ShowSend showSend=new ShowSend(); TextView tv; public static ShowReceive eventDetails=new ShowReceive(); protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.events); btn_createEvent = (Button) findViewById(R.id.btn_createEvent); btn_viewEvents=(Button)findViewById(R.id.btn_show); autoCompleteTextView=(AutoCompleteTextView)findViewById(R.id.autoComplete); tv=(TextView)findViewById(R.id.textView2); ArrayAdapter<EventName> adapter = new ArrayAdapter<EventName>(this,android.R.layout.simple_list_item_1,SignIn.events); autoCompleteTextView.setAdapter(adapter); autoCompleteTextView.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { EventName selected = (EventName) parent.getAdapter().getItem(position); showSend.setUser_id(SignIn.user_id); showSend.setId(selected.getId()); RestAdapter adapter = new RestAdapter.Builder() .setLogLevel(RestAdapter.LogLevel.FULL) .setEndpoint(SignIn.Endpoint) .build(); GetAPI api = adapter.create(GetAPI.class); api.show_event(showSend,new Callback<ShowReceive>() { @Override public void success(ShowReceive showReceive, Response response) { eventDetails=showReceive; Intent in =new Intent(getApplicationContext(),EventDetails.class); startActivity(in); // tv.setText(showReceive.getId()+""+showReceive.getUsername()+" "+showReceive.getName()+" " // +showReceive.getDescription()+" "+showReceive.getLocation()+" "+showReceive.getDate()); } @Override public void failure(RetrofitError error) { Toast.makeText(EventsAvailable.this, "Cannot connect to server", Toast.LENGTH_SHORT).show(); } }); } }); btn_createEvent.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent in = new Intent(getApplicationContext(),CreateEvent.class); startActivity(in); } }); btn_viewEvents.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { Intent in2 = new Intent(getApplicationContext(),listActivity.class); startActivity(in2); } }); } }
[ "tarekkzero@gmail.com" ]
tarekkzero@gmail.com
397f0868c0a8905c49fe0202db479889696d2461
042a45380fb482d86d53623cb809649f7f26868b
/hc-pd-dao/src/main/java/com/hc/scm/pd/dao/mapper/PdWorkProcessCategoryMapper.java
f617a918fa9eb0dfa939714ee0703034a594138c
[]
no_license
lijinxi/hc-pd
61aa35fd55a0b99b69a029ab8293af930a28a6ba
216a231be5e1b46c05c95ccf75b37bd598509172
refs/heads/master
2021-01-10T08:42:58.019295
2015-12-17T07:35:20
2015-12-17T07:35:20
47,649,522
0
0
null
null
null
null
UTF-8
Java
false
false
467
java
package com.hc.scm.pd.dao.mapper; import com.hc.scm.common.base.mapper.BaseCrudMapper; /** * Description: 请写出类的用途 * All rights Reserved, Designed By hc* Copyright: Copyright(C) 2014-2015 * Company: Wonhigh. * @author: Administrator * @date: 2015-04-29 17:34:08 * @version 1.0.0 */ public interface PdWorkProcessCategoryMapper extends BaseCrudMapper { public <ModelType> String checkCategoryNo(String workCateCode); }
[ "1767270730@qq.com" ]
1767270730@qq.com
ce74bd7b294c3c4bbc650ccc55161a984348d8a7
c885ef92397be9d54b87741f01557f61d3f794f3
/tests-without-trycatch/Closure-176/com.google.javascript.jscomp.TypeInference/BBC-F0-opt-20/7/com/google/javascript/jscomp/TypeInference_ESTest.java
111f11d1249eed5f5eca1066f981a87b4369a900
[ "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
198,360
java
/* * This file was automatically generated by EvoSuite * Wed Oct 13 16:10:17 GMT 2021 */ package com.google.javascript.jscomp; import org.junit.Test; import static org.junit.Assert.*; import static org.evosuite.runtime.EvoAssertions.*; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSortedMap; import com.google.javascript.jscomp.ClosureCodingConvention; import com.google.javascript.jscomp.CodingConvention; import com.google.javascript.jscomp.Compiler; import com.google.javascript.jscomp.ControlFlowGraph; import com.google.javascript.jscomp.GoogleCodingConvention; import com.google.javascript.jscomp.LinkedFlowScope; import com.google.javascript.jscomp.Scope; import com.google.javascript.jscomp.StatementFusion; import com.google.javascript.jscomp.TypeInference; import com.google.javascript.jscomp.TypedScopeCreator; import com.google.javascript.jscomp.type.ClosureReverseAbstractInterpreter; import com.google.javascript.jscomp.type.FlowScope; import com.google.javascript.jscomp.type.ReverseAbstractInterpreter; import com.google.javascript.jscomp.type.SemanticReverseAbstractInterpreter; import com.google.javascript.rhino.Node; import com.google.javascript.rhino.SimpleErrorReporter; import com.google.javascript.rhino.jstype.BooleanLiteralSet; import com.google.javascript.rhino.jstype.JSType; import com.google.javascript.rhino.jstype.JSTypeNative; import com.google.javascript.rhino.jstype.JSTypeRegistry; import com.google.javascript.rhino.jstype.NamedType; import java.util.List; import java.util.Map; import org.evosuite.runtime.EvoRunner; import org.evosuite.runtime.EvoRunnerParameters; import org.junit.runner.RunWith; @RunWith(EvoRunner.class) @EvoRunnerParameters(mockJVMNonDeterminism = true, useVFS = true, useVNET = true, resetStaticState = true, separateClassLoader = true) public class TypeInference_ESTest extends TypeInference_ESTest_scaffolding { @Test(timeout = 4000) public void test000() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); Node node1 = Node.newString("t", (-2932), 1595); Node node2 = new Node(101, node1, node0, (-1), 4); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node2, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // AND does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test001() throws Throwable { BooleanLiteralSet booleanLiteralSet0 = BooleanLiteralSet.BOTH; // Undeclared exception! // try { TypeInference.getBooleanOutcomes(booleanLiteralSet0, (BooleanLiteralSet) null, true); // fail("Expecting exception: NullPointerException"); // } catch(NullPointerException e) { // // // // no message in exception (getMessage() returned null) // // // verifyException("com.google.javascript.jscomp.TypeInference", e); // } } @Test(timeout = 4000) public void test002() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(38, node0, node0, 1, 12); // Undeclared exception! // try { typeInference0.flowThrough(node1, linkedFlowScope0); // fail("Expecting exception: UnsupportedOperationException"); // } catch(UnsupportedOperationException e) { // // // // NAME 1 is not a string node // // // verifyException("com.google.javascript.rhino.Node", e); // } } @Test(timeout = 4000) public void test003() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); Node node1 = Node.newString(64, "Object#Key"); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); FlowScope flowScope0 = typeInference0.createEntryLattice(); // Undeclared exception! // try { typeInference0.flowThrough(node1, flowScope0); // fail("Expecting exception: NullPointerException"); // } catch(NullPointerException e) { // // // // no message in exception (getMessage() returned null) // // // verifyException("com.google.common.base.Preconditions", e); // } } @Test(timeout = 4000) public void test004() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(100, node0, node0, node0); closureReverseAbstractInterpreter0.append(closureReverseAbstractInterpreter0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: StackOverflowError"); // } catch(StackOverflowError e) { // // // // no message in exception (getMessage() returned null) // // // } } @Test(timeout = 4000) public void test005() throws Throwable { Compiler compiler0 = new Compiler(); GoogleCodingConvention googleCodingConvention0 = new GoogleCodingConvention(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(googleCodingConvention0, (JSTypeRegistry) null); TypeInference typeInference0 = null; // try { typeInference0 = new TypeInference(compiler0, (ControlFlowGraph<Node>) null, closureReverseAbstractInterpreter0, (Scope) null, (Map<String, CodingConvention.AssertionFunctionSpec>) null); // fail("Expecting exception: NullPointerException"); // } catch(NullPointerException e) { // // // // no message in exception (getMessage() returned null) // // // verifyException("com.google.javascript.jscomp.DataFlowAnalysis", e); // } } @Test(timeout = 4000) public void test006() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("com.google.javascript.jscomp.TypeInference$TemplateTypeReplacer"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); Scope scope0 = Scope.createLatticeBottom(node0); ReverseAbstractInterpreter reverseAbstractInterpreter0 = compiler0.getReverseAbstractInterpreter(); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, reverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(93, "Object#Key"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: NullPointerException"); // } catch(NullPointerException e) { // // // // no message in exception (getMessage() returned null) // // // verifyException("com.google.javascript.jscomp.TypeInference", e); // } } @Test(timeout = 4000) public void test007() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); Scope scope0 = Scope.createLatticeBottom(node0); SemanticReverseAbstractInterpreter semanticReverseAbstractInterpreter0 = new SemanticReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, semanticReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); Node node1 = Node.newString(100, "Object#Element"); FlowScope flowScope0 = typeInference0.createEntryLattice(); // Undeclared exception! // try { typeInference0.flowThrough(node1, flowScope0); // fail("Expecting exception: NullPointerException"); // } catch(NullPointerException e) { // // // // no message in exception (getMessage() returned null) // // // verifyException("com.google.javascript.jscomp.TypeInference", e); // } } @Test(timeout = 4000) public void test008() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, true); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(31, ""); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // DELPROP : boolean does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test009() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(90, node0, node0, node0); FlowScope flowScope0 = typeInference0.flowThrough(node1, linkedFlowScope0); assertNotSame(flowScope0, linkedFlowScope0); } @Test(timeout = 4000) public void test010() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); Scope scope0 = Scope.createGlobalScope(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(13, "Object#Element"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // NE Object#Element : boolean does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test011() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); JSTypeNative jSTypeNative0 = JSTypeNative.ARRAY_TYPE; CodingConvention.AssertionFunctionSpec codingConvention_AssertionFunctionSpec0 = new CodingConvention.AssertionFunctionSpec("Object#Key", jSTypeNative0); ImmutableMap<String, CodingConvention.AssertionFunctionSpec> immutableMap0 = ImmutableMap.of("com.google.javascript.jscomp.TypeInference$BooleanOutcomePair", codingConvention_AssertionFunctionSpec0, "Object#Element", codingConvention_AssertionFunctionSpec0, "k", codingConvention_AssertionFunctionSpec0, "com.google.javascript.jscomp.TypeInference$2", codingConvention_AssertionFunctionSpec0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, immutableMap0); Node node1 = Node.newString(51, ""); FlowScope flowScope0 = typeInference0.createEntryLattice(); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, flowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // IN : boolean does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test012() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, true); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); Node node1 = Node.newString(30, "i03'C.iI@\"Nd8yH"); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: NullPointerException"); // } catch(NullPointerException e) { // // // // no message in exception (getMessage() returned null) // // // verifyException("com.google.javascript.jscomp.TypeInference", e); // } } @Test(timeout = 4000) public void test013() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseSyntheticCode("t", "t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(89, "t"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // ASSIGN_BITAND t : number does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test014() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); Scope scope0 = Scope.createLatticeBottom(node0); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(102, node0, node0, node0); SemanticReverseAbstractInterpreter semanticReverseAbstractInterpreter0 = new SemanticReverseAbstractInterpreter(closureCodingConvention0, (JSTypeRegistry) null); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, semanticReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); FlowScope flowScope0 = typeInference0.flowThrough(node1, linkedFlowScope0); assertNotSame(flowScope0, linkedFlowScope0); } @Test(timeout = 4000) public void test015() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, true); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(46, node0, node0, node0); FlowScope flowScope0 = typeInference0.flowThrough(node1, linkedFlowScope0); assertNotSame(flowScope0, linkedFlowScope0); } @Test(timeout = 4000) public void test016() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); Node node1 = Node.newString(101, "Object#Key"); FlowScope flowScope0 = typeInference0.createEntryLattice(); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, flowScope0); // fail("Expecting exception: NullPointerException"); // } catch(NullPointerException e) { // // // // no message in exception (getMessage() returned null) // // // verifyException("com.google.javascript.jscomp.TypeInference", e); // } } @Test(timeout = 4000) public void test017() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(9, node0, node0, node0); Node node2 = new Node(31, node1, node1, node1); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node2, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // DELPROP : boolean does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test018() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); Node node1 = new Node(130, node0, node0, node0); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); FlowScope flowScope0 = typeInference0.flowThrough(node1, linkedFlowScope0); assertNotSame(flowScope0, linkedFlowScope0); } @Test(timeout = 4000) public void test019() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, true); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); Node node1 = Node.newString(49, "k"); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // THROW k does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test020() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); Node node1 = Node.newString(32, "Object#Key"); FlowScope flowScope0 = typeInference0.createEntryLattice(); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, flowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // TYPEOF Object#Key : string does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test021() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(10, node0, node0, node0); Node node2 = new Node(31, node1, node1, node1); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node2, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // DELPROP : boolean does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test022() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); Scope scope0 = Scope.createLatticeBottom(node0); ReverseAbstractInterpreter reverseAbstractInterpreter0 = compiler0.getReverseAbstractInterpreter(); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, reverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(85, "yi,i5"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: NullPointerException"); // } catch(NullPointerException e) { // // // // no message in exception (getMessage() returned null) // // // verifyException("com.google.javascript.jscomp.TypeInference", e); // } } @Test(timeout = 4000) public void test023() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); Scope scope0 = Scope.createLatticeBottom(node0); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); Node node1 = new Node(18, node0, node0, 8, 146); FlowScope flowScope0 = typeInference0.flowThrough(node1, linkedFlowScope0); assertNotSame(flowScope0, linkedFlowScope0); } @Test(timeout = 4000) public void test024() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseSyntheticCode("k", "k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); Node node1 = Node.newString(33, "\"2u7hA*:|"); TypeInference typeInference1 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); FlowScope flowScope0 = typeInference0.createInitialEstimateLattice(); // Undeclared exception! // try { typeInference1.branchedFlowThrough(node1, flowScope0); // fail("Expecting exception: NullPointerException"); // } catch(NullPointerException e) { // // // // no message in exception (getMessage() returned null) // // // verifyException("com.google.javascript.jscomp.TypeInference", e); // } } @Test(timeout = 4000) public void test025() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); NamedType namedType0 = jSTypeRegistry0.createNamedType("{t=L", "k", 55, 32); JSType jSType0 = namedType0.findPropertyType("Object#Element"); ImmutableList<JSType> immutableList0 = ImmutableList.of(jSType0, (JSType) namedType0, (JSType) namedType0, jSType0, (JSType) namedType0, (JSType) namedType0, jSType0, (JSType) namedType0); Node node1 = jSTypeRegistry0.createParameters((List<JSType>) immutableList0); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // PARAM_LIST : ? does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test026() throws Throwable { BooleanLiteralSet booleanLiteralSet0 = BooleanLiteralSet.TRUE; BooleanLiteralSet booleanLiteralSet1 = TypeInference.getBooleanOutcomes(booleanLiteralSet0, booleanLiteralSet0, false); assertEquals(BooleanLiteralSet.TRUE, booleanLiteralSet1); } @Test(timeout = 4000) public void test027() throws Throwable { Compiler compiler0 = new Compiler(); compiler0.parseTestCode("dk"); Node node0 = Node.newString(16, "dk"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Node node1 = new Node(33, node0, 16, 49); Scope scope0 = Scope.createLatticeBottom(node1); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); FlowScope flowScope0 = typeInference0.flowThrough(node1, linkedFlowScope0); assertNotSame(flowScope0, linkedFlowScope0); } @Test(timeout = 4000) public void test028() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(57, "L_"); Node node2 = new Node(33, node1, node1, node1, node1); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node2, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // GETPROP : ? does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test029() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); Scope scope0 = Scope.createLatticeBottom(node0); Node node1 = new Node(37, node0, node0, node0); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); ReverseAbstractInterpreter reverseAbstractInterpreter0 = compiler0.getReverseAbstractInterpreter(); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, reverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: NullPointerException"); // } catch(NullPointerException e) { // // // // no message in exception (getMessage() returned null) // // // verifyException("com.google.javascript.jscomp.TypeInference", e); // } } @Test(timeout = 4000) public void test030() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(38, "k"); node1.addChildrenToFront(node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // NAME k : ? does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test031() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(4, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // RETURN does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test032() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, true); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); CodingConvention.AssertionFunctionSpec codingConvention_AssertionFunctionSpec0 = new CodingConvention.AssertionFunctionSpec("k"); ImmutableSortedMap<String, CodingConvention.AssertionFunctionSpec> immutableSortedMap0 = ImmutableSortedMap.of("9hx", codingConvention_AssertionFunctionSpec0, "com.google.javascript.jscomp.ExternExportsPass", codingConvention_AssertionFunctionSpec0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, immutableSortedMap0); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(1242, node0, node0, node0, 1, 1589); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 1242 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test033() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, true); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(155, "Object#Key"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // CAST Object#Key does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test034() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, true); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(154, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // STRING_KEY does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test035() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(153, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // LABEL_NAME does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test036() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(152, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // DEBUGGER does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test037() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); Scope scope0 = Scope.createLatticeBottom(node0); ReverseAbstractInterpreter reverseAbstractInterpreter0 = compiler0.getReverseAbstractInterpreter(); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, reverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(151, node0, node0, node0); FlowScope flowScope0 = typeInference0.flowThrough(node1, linkedFlowScope0); assertNotSame(flowScope0, linkedFlowScope0); } @Test(timeout = 4000) public void test038() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, true); Scope scope0 = Scope.createLatticeBottom(node0); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(150, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 150 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test039() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice((Scope) null); Node node1 = new Node(149, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // CONST does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test040() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); Scope scope0 = Scope.createLatticeBottom(node0); ReverseAbstractInterpreter reverseAbstractInterpreter0 = compiler0.getReverseAbstractInterpreter(); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, reverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(148, "d7}/srDv.Pf"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // SETTER_DEF d7}/srDv.Pf does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test041() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); FlowScope flowScope0 = typeInference0.createEntryLattice(); Node node1 = new Node(147, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, flowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // GETTER_DEF does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test042() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, true); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice((Scope) null); Node node1 = Node.newString(146, "Object#Key"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 146 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test043() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(145, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 145 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test044() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(144, "k"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 144 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test045() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(143, node0, node0, 32, (-799)); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 143 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test046() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, true); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(142, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 142 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test047() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(141, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 141 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test048() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); FlowScope flowScope0 = typeInference0.createEntryLattice(); Node node1 = new Node(140, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, flowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 140 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test049() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(139, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 139 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test050() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("gBy"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); Scope scope0 = Scope.createGlobalScope(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(138, ""); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 138 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test051() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(137, node0, node0, 2, 39); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 137 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test052() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("r"); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, true); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(136, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 136 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test053() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, true); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(135, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 135 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test054() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); Node node1 = new Node(134, node0, node0, node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); FlowScope flowScope0 = typeInference0.createEntryLattice(); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, flowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 134 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test055() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("0"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(133, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 133 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test056() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); Scope scope0 = Scope.createGlobalScope(node0); ReverseAbstractInterpreter reverseAbstractInterpreter0 = compiler0.getReverseAbstractInterpreter(); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, reverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(131, node0, node0, node0); FlowScope flowScope0 = typeInference0.flowThrough(node1, linkedFlowScope0); assertNotSame(flowScope0, linkedFlowScope0); } @Test(timeout = 4000) public void test057() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); FlowScope flowScope0 = typeInference0.createEntryLattice(); Node node1 = new Node(129, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, flowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 129 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test058() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(128, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 128 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test059() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createGlobalScope(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(127, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 127 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test060() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createGlobalScope(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(126, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // LABEL does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test061() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); Node node1 = Node.newString(125, "Object#Element"); FlowScope flowScope0 = typeInference0.createEntryLattice(); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, flowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // BLOCK Object#Element does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test062() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); ReverseAbstractInterpreter reverseAbstractInterpreter0 = compiler0.getReverseAbstractInterpreter(); CodingConvention codingConvention0 = compiler0.getCodingConvention(); TypedScopeCreator typedScopeCreator0 = new TypedScopeCreator(compiler0, codingConvention0); Scope scope0 = typedScopeCreator0.createInitialScope(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, reverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(124, "Object#Key"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // EMPTY Object#Key does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test063() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureCodingConvention closureCodingConvention0 = (ClosureCodingConvention)compiler0.defaultCodingConvention; ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(123, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 123 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test064() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, true); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice((Scope) null); Node node1 = new Node(122, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // VOID does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test065() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, true); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(121, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 121 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test066() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("gBy"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(120, node0, node0, node0, node0); // Undeclared exception! // try { typeInference0.flowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // no message in exception (getMessage() returned null) // // // verifyException("com.google.common.base.Preconditions", e); // } } @Test(timeout = 4000) public void test067() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(119, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // WITH does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test068() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, true); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(118, ""); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // VAR does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test069() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(117, "t"); FlowScope flowScope0 = typeInference0.flowThrough(node1, linkedFlowScope0); assertNotSame(flowScope0, linkedFlowScope0); } @Test(timeout = 4000) public void test070() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(116, "", 131, 1); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // BREAK 131 does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test071() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(115, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // FOR does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test072() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(114, node0, node0, node0); FlowScope flowScope0 = typeInference0.flowThrough(node1, linkedFlowScope0); assertNotSame(flowScope0, linkedFlowScope0); } @Test(timeout = 4000) public void test073() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, true); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice((Scope) null); Node node1 = new Node(113, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // WHILE does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test074() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); Scope scope0 = Scope.createGlobalScope(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(112, node0, node0, 43, (-1341)); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // DEFAULT_CASE does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test075() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(111, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // CASE does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test076() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseSyntheticCode("k", "k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(110, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // SWITCH does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test077() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, true); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice((Scope) null); Node node1 = new Node(109, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 109 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test078() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, true); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(108, "k"); FlowScope flowScope0 = typeInference0.flowThrough(node1, linkedFlowScope0); assertNotSame(flowScope0, linkedFlowScope0); } @Test(timeout = 4000) public void test079() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createGlobalScope(node0); ImmutableSortedMap<String, CodingConvention.AssertionFunctionSpec> immutableSortedMap0 = ImmutableSortedMap.of(); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, immutableSortedMap0); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(107, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 107 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test080() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); Node node1 = Node.newString(106, "Object#Key"); FlowScope flowScope0 = typeInference0.createEntryLattice(); FlowScope flowScope1 = typeInference0.flowThrough(node1, flowScope0); assertNotSame(flowScope1, flowScope0); } @Test(timeout = 4000) public void test081() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice((Scope) null); Node node1 = Node.newString(105, "Object#Element"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // FUNCTION Object#Element does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test082() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(103, "k"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // DEC k : number does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test083() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice((Scope) null); Node node1 = new Node(99, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 99 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test084() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(98, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: NullPointerException"); // } catch(NullPointerException e) { // // // // no message in exception (getMessage() returned null) // // // verifyException("com.google.javascript.jscomp.TypeInference", e); // } } @Test(timeout = 4000) public void test085() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(97, node0, node0, node0); FlowScope flowScope0 = typeInference0.flowThrough(node1, linkedFlowScope0); assertNotSame(flowScope0, linkedFlowScope0); } @Test(timeout = 4000) public void test086() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); Node node1 = Node.newString(96, "Object#Key"); FlowScope flowScope0 = typeInference0.createEntryLattice(); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, flowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // ASSIGN_DIV Object#Key : number does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test087() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); Node node1 = Node.newString(95, "Object#Key"); FlowScope flowScope0 = typeInference0.createEntryLattice(); FlowScope flowScope1 = typeInference0.flowThrough(node1, flowScope0); assertNotSame(flowScope1, flowScope0); } @Test(timeout = 4000) public void test088() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); Scope scope0 = Scope.createLatticeBottom(node0); ReverseAbstractInterpreter reverseAbstractInterpreter0 = compiler0.getReverseAbstractInterpreter(); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, reverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(94, "Object#Key"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // ASSIGN_SUB Object#Key : number does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test089() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(93, node0, node0, node0); // Undeclared exception! // try { typeInference0.flowThrough(node1, linkedFlowScope0); // fail("Expecting exception: NullPointerException"); // } catch(NullPointerException e) { // // // // no message in exception (getMessage() returned null) // // // verifyException("com.google.javascript.jscomp.TypeInference", e); // } } @Test(timeout = 4000) public void test090() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseSyntheticCode("k", "k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); Node node1 = new Node(91); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // ASSIGN_RSH : number does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test091() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); FlowScope flowScope0 = typeInference0.createEntryLattice(); Node node1 = new Node(88, node0, node0, node0); FlowScope flowScope1 = typeInference0.flowThrough(node1, flowScope0); assertNotSame(flowScope1, flowScope0); } @Test(timeout = 4000) public void test092() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(87, "t"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // ASSIGN_BITOR t : number does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test093() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(84, node0, node0, node0); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); FlowScope flowScope0 = typeInference0.flowThrough(node1, linkedFlowScope0); assertNotSame(flowScope0, linkedFlowScope0); } @Test(timeout = 4000) public void test094() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("gBy"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); Node node1 = new Node(81, node0, node0, 43, 146); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 81 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test095() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(80, "Object#Key"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 80 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test096() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); Node node1 = Node.newString(79, "Object#Key"); FlowScope flowScope0 = typeInference0.createEntryLattice(); FlowScope flowScope1 = typeInference0.flowThrough(node1, flowScope0); assertNotSame(flowScope1, flowScope0); } @Test(timeout = 4000) public void test097() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createGlobalScope(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(78, "t"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 78 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test098() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, true); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice((Scope) null); Node node1 = new Node(77, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // TRY does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test099() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseSyntheticCode("t", "t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(76, "t"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 76 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test100() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("dk"); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); Scope scope0 = Scope.createLatticeBottom(node0); Node node1 = Node.newString(75, "Object#Element"); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node1, false, false); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); FlowScope flowScope0 = typeInference0.flowThrough(node1, linkedFlowScope0); assertNotSame(flowScope0, linkedFlowScope0); } @Test(timeout = 4000) public void test101() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); Node node1 = Node.newString(74, "Object#Key"); FlowScope flowScope0 = typeInference0.createEntryLattice(); FlowScope flowScope1 = typeInference0.flowThrough(node1, flowScope0); assertNotSame(flowScope1, flowScope0); } @Test(timeout = 4000) public void test102() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(73, node0, node0, node0, node0); FlowScope flowScope0 = typeInference0.flowThrough(node1, linkedFlowScope0); assertNotSame(flowScope0, linkedFlowScope0); } @Test(timeout = 4000) public void test103() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); Scope scope0 = Scope.createGlobalScope(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); Node node1 = Node.newString(72, "Object#Key"); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); FlowScope flowScope0 = typeInference0.flowThrough(node1, linkedFlowScope0); assertNotSame(flowScope0, linkedFlowScope0); } @Test(timeout = 4000) public void test104() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(71, node0, node0, node0); FlowScope flowScope0 = typeInference0.flowThrough(node1, linkedFlowScope0); assertNotSame(flowScope0, linkedFlowScope0); } @Test(timeout = 4000) public void test105() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); GoogleCodingConvention googleCodingConvention0 = new GoogleCodingConvention(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(googleCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(70, "t"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 70 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test106() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); Node node1 = Node.newString(69, "Object#Key"); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); FlowScope flowScope0 = typeInference0.flowThrough(node1, linkedFlowScope0); assertNotSame(flowScope0, linkedFlowScope0); } @Test(timeout = 4000) public void test107() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); Scope scope0 = Scope.createGlobalScope(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(66, "k"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 66 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test108() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); Node node1 = Node.newString(65, "Object#Element"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 65 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test109() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); Scope scope0 = Scope.createLatticeBottom(node0); ReverseAbstractInterpreter reverseAbstractInterpreter0 = compiler0.getReverseAbstractInterpreter(); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, reverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(64, "yi,i5"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: NullPointerException"); // } catch(NullPointerException e) { // // // // no message in exception (getMessage() returned null) // // // verifyException("com.google.common.base.Preconditions", e); // } } @Test(timeout = 4000) public void test110() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(62, "k"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 62 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test111() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); Node node1 = new Node(61, node0, node0, node0); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); FlowScope flowScope0 = typeInference0.flowThrough(node1, linkedFlowScope0); assertNotSame(flowScope0, linkedFlowScope0); } @Test(timeout = 4000) public void test112() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice((Scope) null); Node node1 = Node.newString(60, "k"); FlowScope flowScope0 = typeInference0.flowThrough(node1, linkedFlowScope0); assertNotSame(flowScope0, linkedFlowScope0); } @Test(timeout = 4000) public void test113() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(59, "t"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 59 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test114() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); Node node1 = new Node(56, node0, node0, node0); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); FlowScope flowScope0 = typeInference0.flowThrough(node1, linkedFlowScope0); assertNotSame(flowScope0, linkedFlowScope0); } @Test(timeout = 4000) public void test115() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(55, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 55 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test116() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseSyntheticCode("k", "k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(54, node0, 43, 39); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 54 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test117() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, false); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(53, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 53 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test118() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); Node node1 = new Node(52, node0, node0, node0); FlowScope flowScope0 = typeInference0.createEntryLattice(); FlowScope flowScope1 = typeInference0.flowThrough(node1, flowScope0); assertNotSame(flowScope1, flowScope0); } @Test(timeout = 4000) public void test119() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(50, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 50 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test120() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(48, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 48 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test121() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(47, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // REGEXP does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test122() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(45, "k"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // SHEQ k : boolean does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test123() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(44, "k"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // TRUE k does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test124() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); Scope scope0 = Scope.createLatticeBottom(node0); ReverseAbstractInterpreter reverseAbstractInterpreter0 = compiler0.getReverseAbstractInterpreter(); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, reverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(43, "Object#Key"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // FALSE Object#Key does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test125() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(42, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // THIS does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test126() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(41, node0, node0, node0); FlowScope flowScope0 = typeInference0.flowThrough(node1, linkedFlowScope0); assertNotSame(flowScope0, linkedFlowScope0); } @Test(timeout = 4000) public void test127() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newNumber((-37.42955614)); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // NUMBER -37.42955614 does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test128() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(37, "com.google.javascript.rhino.head.Node$PropListItem"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: NullPointerException"); // } catch(NullPointerException e) { // // // // no message in exception (getMessage() returned null) // // // verifyException("com.google.javascript.jscomp.TypeInference", e); // } } @Test(timeout = 4000) public void test129() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(36, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 36 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test130() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(30, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // NEW does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test131() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(29, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // NEG : number does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test132() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); Scope scope0 = Scope.createLatticeBottom(node0); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); Node node1 = Node.newString(28, "<LWVAKiJlW8"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: NullPointerException"); // } catch(NullPointerException e) { // // // // no message in exception (getMessage() returned null) // // // verifyException("com.google.javascript.jscomp.TypeInference", e); // } } @Test(timeout = 4000) public void test133() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); Scope scope0 = Scope.createGlobalScope(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(27, "k"); FlowScope flowScope0 = typeInference0.flowThrough(node1, linkedFlowScope0); assertNotSame(flowScope0, linkedFlowScope0); } @Test(timeout = 4000) public void test134() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(25, "k"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // MOD k : number does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test135() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); Scope scope0 = Scope.createLatticeBottom(node0); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); Node node1 = Node.newString(24, "Object#Element"); FlowScope flowScope0 = typeInference0.createEntryLattice(); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, flowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // DIV Object#Element : number does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test136() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); Scope scope0 = Scope.createLatticeBottom(node0); ReverseAbstractInterpreter reverseAbstractInterpreter0 = compiler0.getReverseAbstractInterpreter(); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, reverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice((Scope) null); Node node1 = new Node(23, node0, node0, node0); FlowScope flowScope0 = typeInference0.flowThrough(node1, linkedFlowScope0); assertNotSame(flowScope0, linkedFlowScope0); } @Test(timeout = 4000) public void test137() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(22, ""); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // SUB : number does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test138() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(21, "<LWVAKiJlW8"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: NullPointerException"); // } catch(NullPointerException e) { // // // // no message in exception (getMessage() returned null) // // // verifyException("com.google.javascript.jscomp.TypeInference", e); // } } @Test(timeout = 4000) public void test139() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("dk"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Node node1 = new Node(20, node0, 16, 49); Scope scope0 = Scope.createLatticeBottom(node1); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); FlowScope flowScope0 = typeInference0.flowThrough(node1, linkedFlowScope0); assertNotSame(flowScope0, linkedFlowScope0); } @Test(timeout = 4000) public void test140() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); Scope scope0 = Scope.createGlobalScope(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(19, "Object#Element"); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // RSH Object#Element : number does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test141() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(17, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // GE : boolean does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test142() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("dk"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); Scope scope0 = Scope.createGlobalScope(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(15, "dk"); Node node2 = StatementFusion.fuseExpressionIntoExpression(node1, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node2, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // COMMA 1 [source_file: com.google.javascript.rhino.Node$ObjectPropListItem@0000000969] : ? does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test143() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(14, node0, node0, 115, 146); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // LT 115 : boolean does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test144() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("0"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); Node node1 = new Node(12, node0, node0, node0); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); FlowScope flowScope0 = typeInference0.flowThrough(node1, linkedFlowScope0); assertNotSame(flowScope0, linkedFlowScope0); } @Test(timeout = 4000) public void test145() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(8, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 8 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test146() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(7, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 7 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test147() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("NzG"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); Scope scope0 = Scope.createLatticeBottom(node0); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(6, node0); FlowScope flowScope0 = typeInference0.flowThrough(node1, linkedFlowScope0); assertNotSame(flowScope0, linkedFlowScope0); } @Test(timeout = 4000) public void test148() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); Node node1 = new Node(5, node0, node0, node0); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalStateException"); // } catch(IllegalStateException e) { // // // // 5 // // // verifyException("com.google.javascript.rhino.Token", e); // } } @Test(timeout = 4000) public void test149() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, false); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); Node node1 = Node.newString(4, "Object#Key"); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); FlowScope flowScope0 = typeInference0.createEntryLattice(); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, flowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // RETURN Object#Key does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test150() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ControlFlowGraph.Branch controlFlowGraph_Branch0 = ControlFlowGraph.Branch.ON_FALSE; controlFlowGraph0.connectToImplicitReturn(node0, controlFlowGraph_Branch0); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node0, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // SCRIPT 1 [synthetic: com.google.javascript.rhino.Node$IntPropListItem@0000000617] [source_file: com.google.javascript.rhino.Node$ObjectPropListItem@0000000618] [input_id: com.google.javascript.rhino.Node$ObjectPropListItem@0000000619] does not have a condition. // // // verifyException("com.google.javascript.jscomp.NodeUtil", e); // } } @Test(timeout = 4000) public void test151() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ControlFlowGraph.Branch controlFlowGraph_Branch0 = ControlFlowGraph.Branch.ON_TRUE; controlFlowGraph0.connectToImplicitReturn(node0, controlFlowGraph_Branch0); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node0, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // SCRIPT 1 [synthetic: com.google.javascript.rhino.Node$IntPropListItem@0000000617] [source_file: com.google.javascript.rhino.Node$ObjectPropListItem@0000000618] [input_id: com.google.javascript.rhino.Node$ObjectPropListItem@0000000619] does not have a condition. // // // verifyException("com.google.javascript.jscomp.NodeUtil", e); // } } @Test(timeout = 4000) public void test152() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseSyntheticCode("t", "t"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ControlFlowGraph.Branch controlFlowGraph_Branch0 = ControlFlowGraph.Branch.UNCOND; controlFlowGraph0.connectToImplicitReturn(node0, controlFlowGraph_Branch0); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); List<FlowScope> list0 = typeInference0.branchedFlowThrough(node0, linkedFlowScope0); assertEquals(1, list0.size()); } @Test(timeout = 4000) public void test153() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, true); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); FlowScope flowScope0 = typeInference0.createInitialEstimateLattice(); List<FlowScope> list0 = typeInference0.branchedFlowThrough(node0, flowScope0); assertTrue(list0.isEmpty()); } @Test(timeout = 4000) public void test154() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); JSTypeRegistry jSTypeRegistry0 = compiler0.getTypeRegistry(); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(100, node0, node0, node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // OR does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test155() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, false); Scope scope0 = Scope.createLatticeBottom(node0); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = Node.newString(86, "k"); ReverseAbstractInterpreter reverseAbstractInterpreter0 = compiler0.getReverseAbstractInterpreter(); JSTypeNative jSTypeNative0 = JSTypeNative.NUMBER_STRING_BOOLEAN; CodingConvention.AssertionFunctionSpec codingConvention_AssertionFunctionSpec0 = new CodingConvention.AssertionFunctionSpec(" r.:h2So", jSTypeNative0); ImmutableSortedMap<String, CodingConvention.AssertionFunctionSpec> immutableSortedMap0 = ImmutableSortedMap.of("YPO)I&tji,K4", codingConvention_AssertionFunctionSpec0, "Object#Key", codingConvention_AssertionFunctionSpec0, "?}lIy8[u Bk#xp8KCl", codingConvention_AssertionFunctionSpec0, "com.google.javascript.jscomp.TypeInference$BooleanOutcomePair", codingConvention_AssertionFunctionSpec0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, reverseAbstractInterpreter0, scope0, immutableSortedMap0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: NullPointerException"); // } catch(NullPointerException e) { // // // // no message in exception (getMessage() returned null) // // // verifyException("com.google.javascript.jscomp.TypeInference", e); // } } @Test(timeout = 4000) public void test156() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, false, true); ClosureCodingConvention closureCodingConvention0 = new ClosureCodingConvention(); SimpleErrorReporter simpleErrorReporter0 = new SimpleErrorReporter(); JSTypeRegistry jSTypeRegistry0 = new JSTypeRegistry(simpleErrorReporter0, true); ClosureReverseAbstractInterpreter closureReverseAbstractInterpreter0 = new ClosureReverseAbstractInterpreter(closureCodingConvention0, jSTypeRegistry0); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, closureReverseAbstractInterpreter0, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(63, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: IllegalArgumentException"); // } catch(IllegalArgumentException e) { // // // // ARRAYLIT : Array does not exist in graph // // // verifyException("com.google.javascript.jscomp.graph.Graph", e); // } } @Test(timeout = 4000) public void test157() throws Throwable { Compiler compiler0 = new Compiler(); Node node0 = compiler0.parseTestCode("k"); ControlFlowGraph<Node> controlFlowGraph0 = new ControlFlowGraph<Node>(node0, true, true); Scope scope0 = Scope.createLatticeBottom(node0); TypeInference typeInference0 = new TypeInference(compiler0, controlFlowGraph0, (ReverseAbstractInterpreter) null, scope0, (Map<String, CodingConvention.AssertionFunctionSpec>) null); LinkedFlowScope linkedFlowScope0 = LinkedFlowScope.createEntryLattice(scope0); Node node1 = new Node(33, node0, node0, node0, node0); // Undeclared exception! // try { typeInference0.branchedFlowThrough(node1, linkedFlowScope0); // fail("Expecting exception: UnsupportedOperationException"); // } catch(UnsupportedOperationException e) { // // // // SCRIPT 1 [synthetic: com.google.javascript.rhino.Node$IntPropListItem@0000000617] [source_file: com.google.javascript.rhino.Node$ObjectPropListItem@0000000618] [input_id: com.google.javascript.rhino.Node$ObjectPropListItem@0000000619] is not a string node // // // verifyException("com.google.javascript.rhino.Node", e); // } } }
[ "pouria.derakhshanfar@gmail.com" ]
pouria.derakhshanfar@gmail.com
890e2d8284995231d2a15325d0385e3ec459cbd0
b0607996d57abfd6d4f057cd65772a14a03ee938
/cache2k-jcache/src/main/java/org/cache2k/jcache/provider/JCacheJmxSupport.java
85aeebb3810a79d62d998eaace18972c8725bcb1
[ "Apache-2.0" ]
permissive
cache2k/cache2k
447328703ca7e4a77487a8063881e33998c29669
0eaa156bdecd617b2aa4c745d0f8844a32609697
refs/heads/master
2023-08-01T03:36:51.443163
2022-11-01T08:25:04
2022-11-01T08:25:04
15,289,581
684
88
Apache-2.0
2023-04-17T17:40:48
2013-12-18T17:25:04
Java
UTF-8
Java
false
false
3,681
java
package org.cache2k.jcache.provider; /*- * #%L * cache2k JCache provider * %% * Copyright (C) 2000 - 2022 headissue GmbH, Munich * %% * 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. * #L% */ import org.cache2k.Cache; import org.cache2k.annotation.Nullable; import org.cache2k.event.CacheClosedListener; import javax.management.InstanceNotFoundException; import javax.management.MBeanServer; import javax.management.ObjectName; import java.lang.management.ManagementFactory; import java.util.concurrent.CompletableFuture; /** * @author Jens Wilke */ @SuppressWarnings("WeakerAccess") public class JCacheJmxSupport implements CacheClosedListener { private static final MBeanServer PLATFORM_SERVER = ManagementFactory.getPlatformMBeanServer(); public static final JCacheJmxSupport SINGLETON = new JCacheJmxSupport(); private JCacheJmxSupport() { } @Override public @Nullable CompletableFuture<Void> onCacheClosed(Cache cache) { disableStatistics(cache); disableJmx(cache); return null; } public void enableStatistics(JCacheAdapter c) { MBeanServer mbs = PLATFORM_SERVER; String name = createStatisticsObjectName(c.cache); try { mbs.registerMBean( new JCacheJmxStatisticsMXBean(c), new ObjectName(name)); } catch (Exception e) { throw new IllegalStateException("Error registering JMX bean, name='" + name + "'", e); } } public void disableStatistics(Cache c) { MBeanServer mbs = PLATFORM_SERVER; String name = createStatisticsObjectName(c); try { mbs.unregisterMBean(new ObjectName(name)); } catch (InstanceNotFoundException ignore) { } catch (Exception e) { throw new IllegalStateException("Error unregister JMX bean, name='" + name + "'", e); } } public void enableJmx(Cache c, javax.cache.Cache ca) { MBeanServer mbs = PLATFORM_SERVER; String name = createJmxObjectName(c); try { mbs.registerMBean(new JCacheJmxCacheMXBean(ca), new ObjectName(name)); } catch (Exception e) { throw new IllegalStateException("Error register JMX bean, name='" + name + "'", e); } } public void disableJmx(Cache c) { MBeanServer mbs = PLATFORM_SERVER; String name = createJmxObjectName(c); try { mbs.unregisterMBean(new ObjectName(name)); } catch (InstanceNotFoundException ignore) { } catch (Exception e) { throw new IllegalStateException("Error unregister JMX bean, name='" + name + "'", e); } } public String createStatisticsObjectName(Cache cache) { return "javax.cache:type=CacheStatistics," + "CacheManager=" + sanitizeName(cache.getCacheManager().getName()) + ",Cache=" + sanitizeName(cache.getName()); } public String createJmxObjectName(Cache cache) { return "javax.cache:type=CacheConfiguration," + "CacheManager=" + sanitizeName(cache.getCacheManager().getName()) + ",Cache=" + sanitizeName(cache.getName()); } /** * Filter illegal chars, same rule as in TCK or RI? */ public static String sanitizeName(String string) { return string == null ? "" : string.replaceAll(":|=|\n|,", "."); } }
[ "jw_github@headissue.com" ]
jw_github@headissue.com
5a8d4bc858b0c9206b82646c17ca2cbf3b1a48a2
ef3f0863342b140d93d05c584b7c7ed1a773abef
/src/test/java/com/springbot/phapdinh/github/web/springbootwebapplication/TodoServiceTests.java
59094c04c5a3a79498d553815eef94b5272d307b
[]
no_license
phapdinh/springbot
3fff27d2191fed07cc15312e9b701eac3efd50e9
e34c03332c9df225622062cf8a6246a2787e29bf
refs/heads/master
2021-06-20T02:14:30.553949
2020-12-11T02:43:58
2020-12-11T02:43:58
146,522,254
0
0
null
2020-12-11T02:43:59
2018-08-29T00:27:28
Java
UTF-8
Java
false
false
710
java
package com.springbot.phapdinh.github.web.springbootwebapplication; import static org.junit.Assert.assertEquals; import java.util.Date; import com.springbot.phapdinh.github.web.springbootwebapplication.model.Todo; import com.springbot.phapdinh.github.web.springbootwebapplication.service.TodoService; import org.junit.Test; public class TodoServiceTests { private TodoService todos = new TodoService(); @Test public void TodoService() { Todo retrievedTodo0 = todos.retrieveTodo(0); Todo todo = new Todo(1, "in28Minutes", "Learn Spring MVC", new Date(), false); Todo retrievedTodo1 = todos.retrieveTodo(1); assertEquals(todo, retrievedTodo1); assertEquals(null, retrievedTodo0); } }
[ "centralparkloop@yahoo.com" ]
centralparkloop@yahoo.com
e920e2fb0ffe3ae73a84a9e6a745d24e4d6522ad
f283c18843cd0f4f54f64957b88160d48c0cb7d9
/Weartry/mobile/src/main/java/com/example/admin/weartry/MyService.java
8d4d203dd21df439d93173a113030e5549e8aeaa
[]
no_license
furyjack/Andorid-Tutorials
99aba4d4706a2234702555ed560c659236a3bb5b
7ca2e84605f30fb283a413eb1dcfbb71524c55e3
refs/heads/master
2021-01-12T04:21:31.323166
2016-12-29T08:04:26
2016-12-29T08:04:26
77,594,789
0
0
null
null
null
null
UTF-8
Java
false
false
1,255
java
package com.example.admin.weartry; import android.content.Intent; import com.google.android.gms.wearable.DataEvent; import com.google.android.gms.wearable.DataEventBuffer; import com.google.android.gms.wearable.DataMap; import com.google.android.gms.wearable.DataMapItem; import com.google.android.gms.wearable.WearableListenerService; public class MyService extends WearableListenerService { @Override public void onDataChanged(DataEventBuffer dataEventBuffer) { super.onDataChanged(dataEventBuffer); for(DataEvent dataevent:dataEventBuffer) { if(dataevent.getType()==DataEvent.TYPE_CHANGED) { DataMap map= DataMapItem.fromDataItem(dataevent.getDataItem()).getDataMap(); String path= dataevent.getDataItem().getUri().getPath(); if(path.equals("/int")) { int num=map.getInt("num"); Intent myintent = new Intent("com.example.admin.weartry"); myintent.putExtra("message",""+ num); myintent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);//You might need this getApplicationContext().sendBroadcast(myintent); } } } } }
[ "lakshaytaneja26@gmail.com" ]
lakshaytaneja26@gmail.com
a0e19613c619d5e3525db45fce4ce4a6ed2c8d50
c5a7bb4a54a7e16d4b6e53b234981f984d54b901
/src/main/java/com/yts/art/DemoClass.java
c482615c5a2957122061048b6ea4bc2234c1fb62
[]
no_license
ashwinnigam/testrepo
00dafeee04eb9f4093f203d833e9d9768fae984d
c01aa97c8f36eef365f3d139e02a0465ba9266a8
refs/heads/master
2021-01-09T13:47:59.235815
2020-02-23T13:33:54
2020-02-23T13:33:54
242,324,859
0
0
null
2020-02-23T13:33:55
2020-02-22T10:51:14
Java
UTF-8
Java
false
false
138
java
package com.yts.art; public class DemoClass { public static void main(String[] args) { System.out.println("some code"); } }
[ "ashwin.nigam91@gmail.com" ]
ashwin.nigam91@gmail.com
f96271b1e69c070c861a1fadbdc69be64b482153
12ae3500b57ffb09f9d1418a0ecacf3bca425a19
/core/src/main/java/com/github/weisj/darklaf/ui/tabbedpane/TabButtonContainer.java
af0b64a3a110d80bd5cde9cb0b02bee410f53ab1
[ "MIT" ]
permissive
x4e/darklaf
67ce92eab2eaa078e5a47fab43af49ae2a86e862
8de4f56c00b6752d6306c815d9bbd63de924f825
refs/heads/master
2023-01-02T14:33:31.642357
2020-10-16T21:12:39
2020-10-16T21:12:39
null
0
0
null
null
null
null
UTF-8
Java
false
false
2,934
java
/* * MIT License * * Copyright (c) 2020 Jannis Weis * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and * associated documentation files (the "Software"), to deal in the Software without restriction, * including without limitation the rights to use, copy, modify, merge, publish, distribute, * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all copies or * substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT * NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * */ package com.github.weisj.darklaf.ui.tabbedpane; import java.awt.*; import javax.swing.*; import javax.swing.plaf.UIResource; import com.github.weisj.darklaf.util.DarkUIUtil; public abstract class TabButtonContainer extends JPanel implements UIResource { protected final JButton button; protected final DarkTabbedPaneUI ui; private final Insets borderInsets; protected TabButtonContainer(final DarkTabbedPaneUI ui) { this.ui = ui; borderInsets = UIManager.getInsets("TabbedPane.tabArea.buttonInsets"); button = createButton(); add(button); setOpaque(false); setLayout(null); } protected abstract JButton createButton(); @Override public void doLayout() { Dimension b = button.getPreferredSize(); int w = Math.min(getWidth(), b.width); int h = Math.min(getHeight(), b.height); int x = (getWidth() - w) / 2; int y = (getHeight() - h) / 2; button.setBounds(x, y, w, h); } @Override public void setBounds(final int x, final int y, final int width, final int height) { super.setBounds(x, y, width, height); doLayout(); } @Override protected void paintComponent(final Graphics g) { super.paintComponent(g); ui.paintTabAreaBorder(g, ui.tabPane.getTabPlacement(), 0, 0, getWidth(), getHeight()); } @Override public Dimension getPreferredSize() { return DarkUIUtil.addInsets(button.getPreferredSize(), getInsets()); } @Override public Insets getInsets() { if (ui.isHorizontalTabPlacement()) { return new Insets(0, borderInsets.left, 0, borderInsets.right); } else { return new Insets(borderInsets.top, 0, borderInsets.bottom, 0); } } }
[ "weisj@arcor.de" ]
weisj@arcor.de
7e7dc7c3bcedc37a8b353c1cd2a8554daec872c6
0f1b156c646af5bb9b4ac3feaec65c0f4199d043
/backend/src/main/java/com/mygroup/project/model/dto/specialized/OpinionFormDTO.java
e8066a869c3ffded3a0b99f817fdfaeb22871f2e
[]
no_license
I-AzraeL-I/Projekt-Kompetencyjny-GRUPA2
8015ef81169ced00b5010169b0559e2e09031394
aea39bdeab12925f5ee5476c2bd58092cb6e45a1
refs/heads/main
2023-02-21T20:59:22.790721
2021-01-28T12:45:26
2021-01-28T12:45:26
304,338,599
0
0
null
null
null
null
UTF-8
Java
false
false
559
java
package com.mygroup.project.model.dto.specialized; import lombok.Getter; import lombok.Setter; import org.hibernate.validator.constraints.Length; import javax.validation.constraints.Max; import javax.validation.constraints.Min; import javax.validation.constraints.NotBlank; import javax.validation.constraints.NotNull; @Getter @Setter public class OpinionFormDTO { @NotBlank @Length(max = 255) private String comment; @NotNull @Min(value = 0) @Max(value = 5) private Integer rating; @NotNull private Long tutorId; }
[ "Durmix@users.noreply.github.com" ]
Durmix@users.noreply.github.com
12498d4f4f613ab64bbc441a86644c96bd946fb8
9998e826df8ba268cd62238f2b428f821a78359c
/src/main/java/com/organization/bo/EmployeeBOImpl.java
77458b085c82b78514fc4107690483ba4d5a8f51
[]
no_license
metallicatony/EmpGeoMongoWebapp
c170beb8f43738b719aa9f839c282c56cf8d6144
44b86750f23ba005b8ef19d304406c7780de7a13
refs/heads/master
2016-09-06T15:52:35.390109
2015-05-15T06:02:12
2015-05-15T06:02:12
35,656,366
0
0
null
null
null
null
UTF-8
Java
false
false
4,158
java
package com.organization.bo; import java.util.List; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Scope; import org.springframework.data.mongodb.core.query.Update; import org.springframework.stereotype.Component; import com.organization.adapter.EmployeeAdapter; import com.organization.domain.Employee; import com.organization.exception.AddressException; import com.organization.helper.EmployeeHelper; import com.organization.repository.EmployeeRepository; import com.organization.service.request.EmployeeRequest; import com.organization.service.response.EmployeeResponse; import com.organization.service.response.EmployeeResponses; @Component("employeeBO") @Scope("prototype") public class EmployeeBOImpl implements EmployeeBO { @Autowired private EmployeeRepository employeeRepository; @Autowired private EmployeeAdapter employeeAdapter; @Autowired private EmployeeHelper employeeHelper; private static final String default_radius = "20"; private static final Logger log = LoggerFactory.getLogger(EmployeeBOImpl.class); public EmployeeResponses getAllEmployees(String lname, String address, String radius) throws AddressException, Exception { Double[] latlng = null; // convert address to lat and long if (address != null) { latlng = employeeHelper.geoCode(address); radius = (radius != null) ? radius : default_radius; } // get all employees List<Employee> empDomainList = employeeRepository.findAll(lname, latlng, radius); // convert employee list to employee response EmployeeResponses empResponseList = null; if (empDomainList != null && empDomainList.size() > 0) { empResponseList = employeeAdapter.convertToEmployeeResponse(empDomainList); } else { // throw unknown input exception } log.info("employeeResponseList={}", empResponseList); return empResponseList; } public EmployeeResponse getEmployeeById(String empId) throws Exception { EmployeeResponse employeeResponse = null; Employee employee = employeeRepository.findById(empId); if (employee != null) { employeeResponse = employeeAdapter.convertToEmployeeResponse(employee); } log.info("employeeResponse={}", employeeResponse); return employeeResponse; } public EmployeeResponse updateEmployee(Long empId, EmployeeRequest employeeRequest) throws AddressException, Exception { EmployeeResponse employeeResponse = null; Employee employee = null; Update updateObject = null; Double[] latlng = null; if (employeeRequest != null) { latlng = employeeHelper.getGeoResult(employeeRequest.getAddress()); updateObject = employeeAdapter.buildDocument(employeeRequest, latlng); employee = employeeRepository.updateEmployee(empId, updateObject); if (employee != null && employee.getEmpId() != null) { employeeResponse = getEmployeeById(employee.getEmpId().toString()); } } log.info("employeeResponse={}", employeeResponse); return employeeResponse; } public EmployeeResponse createEmployee(EmployeeRequest employeeRequest) throws AddressException, Exception { EmployeeResponse employeeResponse = null; Employee employee = null; Double[] latlng = null; if (employeeRequest != null) { Long empId = employeeRepository.getNextId(); log.info("new employeeId={}", empId); latlng = employeeHelper.getGeoResult(employeeRequest.getAddress()); employee = employeeAdapter.buildDocument(empId, employeeRequest, latlng); employeeRepository.createEmployee(employee); if (employee.get_id() != null) { employeeResponse = employeeAdapter.convertToEmployeeResponse(employee); } } log.info("employeeResponse={}", employeeResponse); return employeeResponse; } public EmployeeResponse deleteEmployee(Long empId) throws Exception { EmployeeResponse employeeResponse = null; Employee employee = employeeRepository.deleteEmployee(empId); if (employee != null) { employeeResponse = employeeAdapter.convertToEmployeeResponse(employee); } log.info("employeeResponse={}", employeeResponse); return employeeResponse; } }
[ "metallicatony@gmail.com" ]
metallicatony@gmail.com
d30baa38474ed0a6b19858895e42846d33b50dd4
38f2f5d6a05f1c733af019dec2befc65383d806d
/src/com/pm/order/busin/OrderFromBusin.java
17d9c5f8516f00178f3755d6f9db6fc6af0451d2
[]
no_license
guanzihao/pm
374cb27249fe5a273b088b903f8a8834c65921ab
60a57e3bb2505ca9ad12ba267454c744354352ce
refs/heads/master
2021-01-18T09:55:51.308939
2017-08-15T09:15:40
2017-08-15T09:15:40
100,359,341
0
0
null
null
null
null
UTF-8
Java
false
false
4,693
java
package com.pm.order.busin; /** * 订单的业务接口 * @author Administrator * */ import java.util.Date; import java.util.List; import com.pm.order.bean.BgEcExpDomain; import com.pm.order.bean.BgIcExpDomain; import com.pm.order.bean.CcEcExpDomain; import com.pm.order.bean.CcIcExpDomain; import com.pm.order.bean.DingdanAddtion; import com.pm.order.bean.WlEcExpDomain; import com.pm.order.bean.WlIcExpDomain; import com.pm.order.bean.WmEcExpDomain; import com.pm.order.bean.WmIcExpDomain; import com.sup.order.bean.OrderFrom; public interface OrderFromBusin { /** * 按类型保存任务 * @param taskId */ void saveTaskIdOrderFrom(String taskId); /** * 根据 任务Id得到一条任务信息 * @param id * @return */ OrderFrom getOrderFrom(String id); /** * @Description 根据任务ID返回订单列表 * @author Chu Zhaocheng * @date 2017年6月15日 下午12:52:28 * @action listOrderFrom * @return List<OrderFrom> */ List<OrderFrom> listOrderFrom(String taskId); /** * 对订单进行修改操作 * @param task */ void saveOrderFrom(OrderFrom orderFrom,String suppersId,String flowTypeId,String taskId,String currUserId); /** * 根据类型Id和主任务Id得到一个子订单信息 * @param typeId * @param taskId */ OrderFrom getTypeIdByOrderFrom(String typeId, String taskId); /** * 客服对订单进行终止 * @param id */ void terminationOrderFrom(String id); /** * 根据订单类型得到订单的数量 * @param id * @param flag -1:提前 0:按时 1: 延迟 2:同类型的全部订单 * @return */ Integer getOrderStatusCount(String id,String flag, String name,String supName, String startDate, String endDate); /** * 会员订单数 * @param endDate * @param startDate * @param endDate * @return */ List<Integer> getOrderMemberNum(Date startDate, Date endDate); /** * 进口报关导出报表 * @param orderCode * @param startDate * @param endDate * @param name * @param supName * @return */ List<BgIcExpDomain> getBgImccOrderExecl(String typeId,String orderCode, String startDate, String endDate, String supName, String name); /** * 出口报关导出报表 * @param orderCode * @param startDate * @param endDate * @param name * @param supName * @return */ List<BgEcExpDomain> getBgEmccOrderExecl(String typeId,String orderCode, String startDate, String endDate, String supName, String name); /** * 物流出口导出报表 * @param orderCode * @param startDate * @param endDate * @param name * @param supName * @return */ List<WlIcExpDomain> getWlImccOrderExecl(String typeId,String orderCode, String startDate, String endDate, String supName, String name); /** * 物流进口导出报表 * @param orderCode * @param startDate * @param endDate * @param name * @param supName * @return */ List<WlEcExpDomain> getWlEmccOrderExecl(String typeId,String orderCode, String startDate, String endDate, String supName, String name); /** * 外贸进口导出报表 * @param orderCode * @param startDate * @param endDate * @return */ List<WmIcExpDomain> getWmImccOrderExecl(String typeId,String orderCode, String startDate, String endDate); /** * 外贸出口导出报表 * @param orderCode * @param startDate * @param endDate * @param name * @param supName * @return */ List<WmEcExpDomain> getWmEmccOrderExecl(String typeId,String orderCode, String startDate, String endDate, String supName, String name); /** * 仓储进库导出报表 * @param orderCode * @param startDate * @param endDate * @param name * @param supName * @return */ List<CcIcExpDomain> getCcImccOrderExecl(String typeId,String orderCode, String startDate, String endDate, String supName, String name); /** * 仓储出库导出报表 * @param orderCode * @param startDate * @param endDate * @param name * @param supName * @return */ List<CcEcExpDomain> getCcEmccOrderExecl(String typeId,String orderCode, String startDate, String endDate, String supName, String name); /** * 查询补充信息 * @param id * @return */ DingdanAddtion getOrderAddtion(String id); }
[ "guanzihao568@163.com" ]
guanzihao568@163.com
b34b8ef740707a7d08e9935a0471d564bd97d13f
dd276cd187a30367f3ae7fae52aa982db7233188
/src/java/entity/mpm/PontosFortesInternos.java
d524d5c79c7a1fcc083d1d2ada1d59c3f209eb7e
[]
no_license
tenclar/sgcn
7b4320df7e8c6cddb3326e2f08c19c63ccdf0a15
8486cac62d1f857403b16ccc6480e9fe5e633155
refs/heads/master
2021-09-08T11:28:24.477425
2015-03-13T16:04:10
2015-03-13T16:04:10
13,866,831
0
0
null
null
null
null
UTF-8
Java
false
false
1,708
java
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package entity.mpm; import java.io.Serializable; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.ManyToOne; import javax.persistence.Table; /** * * @author tenclar */ @Entity @Table(name="mpm_pontosfortesinternos") public class PontosFortesInternos implements Serializable{ @Id @GeneratedValue private Integer id; @ManyToOne private PontoForteInterno pontoforteinterno; @ManyToOne private Plano plano; public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public PontoForteInterno getPontoforteinterno() { return pontoforteinterno; } public void setPontoforteinterno(PontoForteInterno pontoforteinterno) { this.pontoforteinterno = pontoforteinterno; } public Plano getPlano() { return plano; } public void setPlano(Plano plano) { this.plano = plano; } @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final PontosFortesInternos other = (PontosFortesInternos) obj; if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) { return false; } return true; } @Override public int hashCode() { int hash = 3; hash = 61 * hash + (this.id != null ? this.id.hashCode() : 0); return hash; } }
[ "tenclarvalus@gmail.com" ]
tenclarvalus@gmail.com
64ba57bf72541488eb42702f9ab007b00bf83930
7927344fbe02af07ef137a3b3453a9891c586238
/net/minecraft/tileentity/TileEntityCommandBlock.java
f3cde59db041036aa62f9150870dbde8c3e1eb4c
[ "MIT" ]
permissive
Hexeption/How-to-code-an-advanced-hacked-client-for-1.9
a9d4df9c1254402c5ccf47912dbd8c6e1d9894c3
f23beceb4b2996e0de24b2822aae940dae1fc88e
refs/heads/master
2021-01-18T22:41:13.800852
2016-12-11T18:25:26
2016-12-11T18:25:26
53,270,980
9
19
null
2016-06-05T07:24:26
2016-03-06T19:04:09
Java
UTF-8
Java
false
false
6,314
java
package net.minecraft.tileentity; import io.netty.buffer.ByteBuf; import net.minecraft.block.Block; import net.minecraft.block.BlockCommandBlock; import net.minecraft.block.state.IBlockState; import net.minecraft.command.CommandResultStats; import net.minecraft.entity.Entity; import net.minecraft.init.Blocks; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.Packet; import net.minecraft.network.play.server.SPacketUpdateTileEntity; import net.minecraft.server.MinecraftServer; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3d; import net.minecraft.world.World; public class TileEntityCommandBlock extends TileEntity { private boolean powered; private boolean auto; private boolean conditionMet; private boolean field_184262_h; private final CommandBlockBaseLogic commandBlockLogic = new CommandBlockBaseLogic() { public BlockPos getPosition() { return TileEntityCommandBlock.this.pos; } public Vec3d getPositionVector() { return new Vec3d((double)TileEntityCommandBlock.this.pos.getX() + 0.5D, (double)TileEntityCommandBlock.this.pos.getY() + 0.5D, (double)TileEntityCommandBlock.this.pos.getZ() + 0.5D); } public World getEntityWorld() { return TileEntityCommandBlock.this.getWorld(); } public void setCommand(String command) { super.setCommand(command); TileEntityCommandBlock.this.markDirty(); } public void updateCommand() { IBlockState iblockstate = TileEntityCommandBlock.this.worldObj.getBlockState(TileEntityCommandBlock.this.pos); TileEntityCommandBlock.this.getWorld().notifyBlockUpdate(TileEntityCommandBlock.this.pos, iblockstate, iblockstate, 3); } public int func_145751_f() { return 0; } public void func_145757_a(ByteBuf p_145757_1_) { p_145757_1_.writeInt(TileEntityCommandBlock.this.pos.getX()); p_145757_1_.writeInt(TileEntityCommandBlock.this.pos.getY()); p_145757_1_.writeInt(TileEntityCommandBlock.this.pos.getZ()); } public Entity getCommandSenderEntity() { return null; } public MinecraftServer getServer() { return TileEntityCommandBlock.this.worldObj.getMinecraftServer(); } }; public void writeToNBT(NBTTagCompound compound) { super.writeToNBT(compound); this.commandBlockLogic.writeDataToNBT(compound); compound.setBoolean("powered", this.isPowered()); compound.setBoolean("conditionMet", this.isConditionMet()); compound.setBoolean("auto", this.isAuto()); } public void readFromNBT(NBTTagCompound compound) { super.readFromNBT(compound); this.commandBlockLogic.readDataFromNBT(compound); this.setPowered(compound.getBoolean("powered")); this.setConditionMet(compound.getBoolean("conditionMet")); this.setAuto(compound.getBoolean("auto")); } public Packet<?> getDescriptionPacket() { if (this.func_184257_h()) { this.func_184252_d(false); NBTTagCompound nbttagcompound = new NBTTagCompound(); this.writeToNBT(nbttagcompound); return new SPacketUpdateTileEntity(this.pos, 2, nbttagcompound); } else { return null; } } public boolean func_183000_F() { return true; } public CommandBlockBaseLogic getCommandBlockLogic() { return this.commandBlockLogic; } public CommandResultStats getCommandResultStats() { return this.commandBlockLogic.getCommandResultStats(); } public void setPowered(boolean p_184250_1_) { this.powered = p_184250_1_; } public boolean isPowered() { return this.powered; } public boolean isAuto() { return this.auto; } public void setAuto(boolean p_184253_1_) { boolean flag = this.auto; this.auto = p_184253_1_; if (!flag && p_184253_1_ && !this.powered && this.worldObj != null && this.func_184251_i() != TileEntityCommandBlock.Mode.SEQUENCE) { Block block = this.getBlockType(); if (block instanceof BlockCommandBlock) { BlockPos blockpos = this.getPos(); BlockCommandBlock blockcommandblock = (BlockCommandBlock)block; this.conditionMet = !this.func_184258_j() || blockcommandblock.func_185562_e(this.worldObj, blockpos, this.worldObj.getBlockState(blockpos)); this.worldObj.scheduleUpdate(blockpos, block, block.tickRate(this.worldObj)); if (this.conditionMet) { blockcommandblock.func_185563_c(this.worldObj, blockpos); } } } } public boolean isConditionMet() { return this.conditionMet; } public void setConditionMet(boolean p_184249_1_) { this.conditionMet = p_184249_1_; } public boolean func_184257_h() { return this.field_184262_h; } public void func_184252_d(boolean p_184252_1_) { this.field_184262_h = p_184252_1_; } public TileEntityCommandBlock.Mode func_184251_i() { Block block = this.getBlockType(); return block == Blocks.command_block ? TileEntityCommandBlock.Mode.REDSTONE : (block == Blocks.repeating_command_block ? TileEntityCommandBlock.Mode.AUTO : (block == Blocks.chain_command_block ? TileEntityCommandBlock.Mode.SEQUENCE : TileEntityCommandBlock.Mode.REDSTONE)); } public boolean func_184258_j() { IBlockState iblockstate = this.worldObj.getBlockState(this.getPos()); return iblockstate.getBlock() instanceof BlockCommandBlock ? ((Boolean)iblockstate.getValue(BlockCommandBlock.CONDITIONAL)).booleanValue() : false; } /** * validates a tile entity */ public void validate() { this.blockType = null; super.validate(); } public static enum Mode { SEQUENCE, AUTO, REDSTONE; } }
[ "minecraftfun201@gmail.com" ]
minecraftfun201@gmail.com
bf246876a8da4177cbc028729bb6c6305e6f3f2d
62a85772d935e6b58c5abd28f4ca2b561e52a19d
/src/test/java/testesRepositorioClientes/BDDTest.java
623873924b833d4e220d7903108ecf098bb9c5fe
[]
no_license
jeancarlos2015/servicocontrolepedidos
4f93ea1f64593620b23ebee2f29aa5b4ffbba689
5f0c7d4960147473be4145835e8ace4af3339cf8
refs/heads/master
2021-05-07T15:12:50.645904
2017-12-13T01:09:49
2017-12-13T01:09:49
109,979,817
0
0
null
null
null
null
UTF-8
Java
false
false
272
java
package testesRepositorioClientes; import cucumber.api.CucumberOptions; import cucumber.api.junit.Cucumber; import org.junit.runner.RunWith; @RunWith(Cucumber.class) @CucumberOptions(features = "src/main/resources/featuresRepositorioClientes") public class BDDTest { }
[ "jeancarlospenas28@gmail.com" ]
jeancarlospenas28@gmail.com
ce793828ed9af60355206c0b38594675412dac39
2e7da7b4a945ad9d713712ec944700def43006c5
/playground/src/battleship/Ship.java
dc0e4f8703bc5aa2067df633c0a818aab139ef41
[]
no_license
cnewmiller/se350_projects
cd8243e23d5711112945bb076a0676fa675e073c
f9082f0c3ce51a80a7cd18fa9bb6d476dff66f20
refs/heads/master
2021-01-23T17:42:57.986227
2017-11-19T21:31:01
2017-11-19T21:31:01
102,774,124
0
1
null
null
null
null
UTF-8
Java
false
false
795
java
package battleship; public class Ship { public enum Orientations{Horizontal, Vertical}; int x, y; //the top left corner int len; String name; Orientations orientation; Ship(int x1, int y1, int len, Ship.Orientations or){ this.x = x1; this.y = y1; this.len = len; this.name = (5 == len ? "carrier" : (3 == len ? "submarine" : "Unknown ship type")); this.orientation = or; }; @Override public String toString() { return String.format("Name: %s\nLeft corner = %d, top corner = %d, length = %d", name, x, y, len); } public String getCoordsFormatted() { return String.format("%s found: (%d,%d) to (%d,%d)",this.name, x, y, (orientation == Orientations.Horizontal ? x+len-1 : x), (orientation == Orientations.Vertical ? y+len-1 : y)); } }
[ "cnewmiller@gmail.com" ]
cnewmiller@gmail.com
a52f01343e7bad603ab9798b6111a996d9390e5f
87912046ca1a6e204d87d5fd06361738b4a11027
/src/main/java/com/async/metrics/module/AspectsModule.java
2ded9aebd4bf4ad0fe4a005ff08ccd536ceeb8b1
[]
no_license
dalalsunil1986/async-metrics-codahale
0537d93edff323764fd81ff65193ee7aed668110
70bee68f4efa406ae92bfdfebe0298e498941fcf
refs/heads/master
2020-12-14T12:34:56.623546
2019-09-29T20:38:15
2019-09-29T20:38:15
null
0
0
null
null
null
null
UTF-8
Java
false
false
948
java
package com.async.metrics.module; import com.async.metrics.aspect.AsyncExceptionMeteredAspect; import com.async.metrics.aspect.AsyncTimedAspect; import com.codahale.metrics.MetricRegistry; import com.google.inject.AbstractModule; import com.google.inject.Provides; import com.google.inject.Singleton; import org.aspectj.lang.Aspects; public class AspectsModule extends AbstractModule { private final MetricRegistry metricRegistry; public AspectsModule(MetricRegistry metricRegistry) { this.metricRegistry = metricRegistry; } @Override protected void configure() { initializeAspects(); } @Provides @Singleton private MetricRegistry getMetricRegistry() { return this.metricRegistry; } private void initializeAspects() { requestInjection(Aspects.aspectOf(AsyncTimedAspect.class)); requestInjection(Aspects.aspectOf(AsyncExceptionMeteredAspect.class)); } }
[ "amangargcse@outlook.com" ]
amangargcse@outlook.com
d71d62ffc9c6bcf3ace914753509057aac7af0a2
8a6dfcd056e104a7e0ad5fb516690120d4d469e7
/commontools/src/main/java/com/cccts/helpers/Log4jHelper.java
f596a09aa02dbc7bbb23904be521c192f8caee55
[]
no_license
ewsq/gateway808
0847b6237f4c7dd59287165e67f6738f649ab2f0
ff1e0fcb145fad94186199cbf2ed2cc78fa597c8
refs/heads/master
2022-01-25T01:02:51.045617
2019-07-01T00:21:43
2019-07-01T00:21:43
null
0
0
null
null
null
null
UTF-8
Java
false
false
1,324
java
package com.cccts.helpers; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.core.config.ConfigurationSource; import org.apache.logging.log4j.core.config.Configurator; import java.io.File; import java.io.FileInputStream; public final class Log4jHelper { /** * 启用自定义log4j2.xml的路径,在conf目录下 */ public static void useCustomerConfig (){ ConfigurationSource source; String relativePath = "log4j2.xml"; String filePath = System.getProperty("user.dir") + System.getProperty("file.separator") + "conf" + System.getProperty("file.separator") + relativePath; File log4jFile = new File(filePath); try { if (log4jFile.exists()) { source = new ConfigurationSource(new FileInputStream(log4jFile), log4jFile); Configurator.initialize(null, source); } else { System.out.println("loginit failed"); System.exit(1); } } catch (Exception e) { e.printStackTrace(); System.exit(0); } } public static Logger getLogger(String loggerName) { return LogManager.getLogger(loggerName); } }
[ "98346@sina.com" ]
98346@sina.com
dcdeb64bed085c8d79871626d7acfeb9ae945494
13423c5c9ec11b1c14c4477ba22f41f3627812b9
/web/src/main/java/com/socialworld/web/entity/Chat.java
86c794ab4dde65d74998d3bffbb76047c1e07e4f
[]
no_license
Stoyanov22/SocialWorld
099eda740453de6c5f3fac1dddf8534932418dd6
ea221353221b87b72e25511ad31328902963064e
refs/heads/master
2021-01-16T09:41:36.006213
2020-10-09T19:22:29
2020-10-09T19:22:29
243,065,209
0
0
null
null
null
null
UTF-8
Java
false
false
2,178
java
package com.socialworld.web.entity; import java.util.Date; import java.util.Objects; public class Chat { private String id; private String content; private Date timestamp; private String fromUserId; private String toUserId; public Chat(){ } public Chat(String id, String content, Date timestamp, String fromUserId, String toUserId) { this.id = id; this.content = content; this.timestamp = timestamp; this.fromUserId = fromUserId; this.toUserId = toUserId; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getContent() { return content; } public void setContent(String content) { this.content = content; } public Date getTimestamp() { return timestamp; } public void setTimestamp(Date timestamp) { this.timestamp = timestamp; } public String getFromUserId() { return fromUserId; } public void setFromUserId(String fromUserId) { this.fromUserId = fromUserId; } public String getToUserId() { return toUserId; } public void setToUserId(String toUserId) { this.toUserId = toUserId; } @Override public String toString() { return "Chat{" + "id='" + id + '\'' + ", content='" + content + '\'' + ", timestamp=" + timestamp + ", fromUserId='" + fromUserId + '\'' + ", toUserId='" + toUserId + '\'' + '}'; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; Chat chat = (Chat) o; return id.equals(chat.id) && content.equals(chat.content) && timestamp.equals(chat.timestamp) && fromUserId.equals(chat.fromUserId) && toUserId.equals(chat.toUserId); } @Override public int hashCode() { return Objects.hash(id, content, timestamp, fromUserId, toUserId); } }
[ "iliyan.stoyanov.22@gmail.com" ]
iliyan.stoyanov.22@gmail.com
f44987012c4a5597b3b82a6383de5bbda86853c0
a11ba1b53c0e1e978b5f4f55a38b4ff5b13d5e36
/ui/src/main/java/org/apache/hop/ui/trans/steps/dimensionlookup/DimensionLookupDialog.java
24332ad8c717dd64d2fcfa97e5724ee79d0917df
[ "Apache-2.0" ]
permissive
lipengyu/hop
157747f4da6d909a935b4510e01644935333fef9
8afe35f0705f44d78b5c33c1ba3699f657f8b9dc
refs/heads/master
2020-09-12T06:31:58.176011
2019-11-11T21:17:59
2019-11-11T21:17:59
222,341,727
1
0
Apache-2.0
2019-11-18T01:50:19
2019-11-18T01:50:18
null
UTF-8
Java
false
false
72,669
java
/*! ****************************************************************************** * * Pentaho Data Integration * * Copyright (C) 2002-2018 by Hitachi Vantara : http://www.pentaho.com * ******************************************************************************* * * 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.apache.hop.ui.trans.steps.dimensionlookup; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Set; import org.eclipse.swt.SWT; import org.eclipse.swt.custom.CCombo; import org.eclipse.swt.custom.CTabFolder; import org.eclipse.swt.custom.CTabItem; import org.eclipse.swt.custom.ScrolledComposite; import org.eclipse.swt.events.FocusAdapter; import org.eclipse.swt.events.FocusEvent; import org.eclipse.swt.events.FocusListener; import org.eclipse.swt.events.ModifyEvent; import org.eclipse.swt.events.ModifyListener; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.events.ShellAdapter; import org.eclipse.swt.events.ShellEvent; import org.eclipse.swt.graphics.Cursor; import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.layout.FormAttachment; import org.eclipse.swt.layout.FormData; import org.eclipse.swt.layout.FormLayout; import org.eclipse.swt.layout.GridData; import org.eclipse.swt.layout.GridLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Event; import org.eclipse.swt.widgets.Group; import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Listener; import org.eclipse.swt.widgets.MessageBox; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableItem; import org.eclipse.swt.widgets.Text; import org.apache.hop.core.Const; import org.apache.hop.core.util.Utils; import org.apache.hop.core.Props; import org.apache.hop.core.SQLStatement; import org.apache.hop.core.database.Database; import org.apache.hop.core.database.DatabaseMeta; import org.apache.hop.core.exception.HopException; import org.apache.hop.core.plugins.PluginInterface; import org.apache.hop.core.row.RowMetaInterface; import org.apache.hop.core.row.ValueMetaInterface; import org.apache.hop.i18n.BaseMessages; import org.apache.hop.trans.TransMeta; import org.apache.hop.trans.step.BaseStepMeta; import org.apache.hop.trans.step.StepDialogInterface; import org.apache.hop.trans.step.StepMeta; import org.apache.hop.trans.steps.dimensionlookup.DimensionLookupMeta; import org.apache.hop.ui.core.database.dialog.DatabaseExplorerDialog; import org.apache.hop.ui.core.database.dialog.SQLEditor; import org.apache.hop.ui.core.dialog.EnterSelectionDialog; import org.apache.hop.ui.core.dialog.ErrorDialog; import org.apache.hop.ui.core.widget.ColumnInfo; import org.apache.hop.ui.core.widget.TableView; import org.apache.hop.ui.core.widget.TextVar; import org.apache.hop.ui.trans.step.BaseStepDialog; import org.apache.hop.ui.trans.step.TableItemInsertListener; import org.apache.hop.ui.util.HelpUtils; /** * Dialog for the Dimension Lookup/Update step. */ public class DimensionLookupDialog extends BaseStepDialog implements StepDialogInterface { private static Class<?> PKG = DimensionLookupMeta.class; // for // i18n // purposes, // needed // by // Translator2!! private CTabFolder wTabFolder; private FormData fdTabFolder; private CTabItem wKeyTab, wFieldsTab; private FormData fdKeyComp, fdFieldsComp; private CCombo wConnection; private Label wlSchema; private TextVar wSchema; private Button wbSchema; private FormData fdbSchema; private Label wlTable; private Button wbTable; private TextVar wTable; private Label wlCommit; private Text wCommit; private Label wlUseCache; private Button wUseCache; private Label wlPreloadCache; private Button wPreloadCache; private Label wlCacheSize; private Text wCacheSize; private Label wlTk; private CCombo wTk; private Label wlTkRename; private Text wTkRename; private Group gTechGroup; private Label wlAutoinc; private Button wAutoinc; private Label wlTableMax; private Button wTableMax; private Label wlSeqButton; private Button wSeqButton; private Text wSeq; private Label wlVersion; private CCombo wVersion; private Label wlDatefield; private CCombo wDatefield; private Label wlFromdate; private CCombo wFromdate; private Label wlUseAltStartDate; private Button wUseAltStartDate; private CCombo wAltStartDate; private CCombo wAltStartDateField; private Label wlMinyear; private Text wMinyear; private Label wlTodate; private CCombo wTodate; private Label wlMaxyear; private Text wMaxyear; private Label wlUpdate; private Button wUpdate; private Label wlKey; private TableView wKey; private Label wlUpIns; private TableView wUpIns; private Button wGet, wCreate; private Listener lsGet, lsCreate; private DimensionLookupMeta input; private boolean backupUpdate, backupAutoInc; private DatabaseMeta ci; private ColumnInfo[] ciUpIns; private ColumnInfo[] ciKey; private Map<String, Integer> inputFields; private boolean gotPreviousFields = false; private boolean gotTableFields = false; /** * List of ColumnInfo that should have the field names of the selected database table */ private List<ColumnInfo> tableFieldColumns = new ArrayList<ColumnInfo>(); private ScrolledComposite sComp; private Composite helpComp; private Composite comp; public DimensionLookupDialog( Shell parent, Object in, TransMeta tr, String sname ) { super( parent, (BaseStepMeta) in, tr, sname ); input = (DimensionLookupMeta) in; inputFields = new HashMap<String, Integer>(); } public String open() { Shell parent = getParent(); Display display = parent.getDisplay(); shell = new Shell( parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN ); props.setLook( shell ); ModifyListener lsMod = new ModifyListener() { public void modifyText( ModifyEvent e ) { input.setChanged(); } }; FocusListener lsConnectionFocus = new FocusAdapter() { public void focusLost( FocusEvent event ) { input.setChanged(); setTableFieldCombo(); } }; ModifyListener lsTableMod = new ModifyListener() { public void modifyText( ModifyEvent arg0 ) { input.setChanged(); setTableFieldCombo(); } }; backupChanged = input.hasChanged(); backupUpdate = input.isUpdate(); backupAutoInc = input.isAutoIncrement(); ci = input.getDatabaseMeta(); GridLayout shellLayout = new GridLayout(); shellLayout.numColumns = 1; shell.setLayout( shellLayout ); shell.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.Shell.Title" ) ); int middle = props.getMiddlePct(); int margin = Const.MARGIN; Composite sCompParent = new Composite( shell, SWT.NONE ); sCompParent.setLayout( new FillLayout( SWT.VERTICAL ) ); GridData sCompGridData = new GridData( GridData.FILL_BOTH ); sCompGridData.grabExcessHorizontalSpace = true; sCompGridData.grabExcessVerticalSpace = true; sCompParent.setLayoutData( sCompGridData ); sComp = new ScrolledComposite( sCompParent, SWT.V_SCROLL | SWT.H_SCROLL ); sComp.setLayout( new FormLayout() ); sComp.setExpandHorizontal( true ); sComp.setExpandVertical( true ); helpComp = new Composite( shell, SWT.NONE ); helpComp.setLayout( new FormLayout() ); GridData helpCompData = new GridData(); helpCompData.grabExcessHorizontalSpace = true; helpCompData.grabExcessVerticalSpace = false; helpComp.setLayoutData( helpCompData ); setShellImage( shell, input ); comp = new Composite( sComp, SWT.NONE ); props.setLook( comp ); FormLayout fileLayout = new FormLayout(); fileLayout.marginWidth = 3; fileLayout.marginHeight = 3; comp.setLayout( fileLayout ); // Stepname line wlStepname = new Label( comp, SWT.RIGHT ); wlStepname.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.Stepname.Label" ) ); props.setLook( wlStepname ); fdlStepname = new FormData(); fdlStepname.left = new FormAttachment( 0, 0 ); fdlStepname.right = new FormAttachment( middle, -margin ); fdlStepname.top = new FormAttachment( 0, margin ); wlStepname.setLayoutData( fdlStepname ); wStepname = new Text( comp, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); wStepname.setText( stepname ); props.setLook( wStepname ); wStepname.addModifyListener( lsMod ); fdStepname = new FormData(); fdStepname.left = new FormAttachment( middle, 0 ); fdStepname.top = new FormAttachment( 0, margin ); fdStepname.right = new FormAttachment( 100, 0 ); wStepname.setLayoutData( fdStepname ); // Update the dimension? wlUpdate = new Label( comp, SWT.RIGHT ); wlUpdate.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.Update.Label" ) ); props.setLook( wlUpdate ); FormData fdlUpdate = new FormData(); fdlUpdate.left = new FormAttachment( 0, 0 ); fdlUpdate.right = new FormAttachment( middle, -margin ); fdlUpdate.top = new FormAttachment( wStepname, margin ); wlUpdate.setLayoutData( fdlUpdate ); wUpdate = new Button( comp, SWT.CHECK ); props.setLook( wUpdate ); FormData fdUpdate = new FormData(); fdUpdate.left = new FormAttachment( middle, 0 ); fdUpdate.top = new FormAttachment( wStepname, margin ); fdUpdate.right = new FormAttachment( 100, 0 ); wUpdate.setLayoutData( fdUpdate ); // Clicking on update changes the options in the update combo boxes! wUpdate.addSelectionListener( new SelectionAdapter() { public void widgetSelected( SelectionEvent e ) { input.setUpdate( !input.isUpdate() ); input.setChanged(); setFlags(); } } ); // Connection line wConnection = addConnectionLine( comp, wUpdate, middle, margin ); if ( input.getDatabaseMeta() == null && transMeta.nrDatabases() == 1 ) { wConnection.select( 0 ); } // wConnection.addModifyListener(lsConnectionMod); // wConnection.addSelectionListener(lsSelection); wConnection.addFocusListener( lsConnectionFocus ); wConnection.addModifyListener( new ModifyListener() { public void modifyText( ModifyEvent e ) { // We have new content: change ci connection: ci = transMeta.findDatabase( wConnection.getText() ); setFlags(); } } ); // Schema line... wlSchema = new Label( comp, SWT.RIGHT ); wlSchema.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.TargetSchema.Label" ) ); props.setLook( wlSchema ); FormData fdlSchema = new FormData(); fdlSchema.left = new FormAttachment( 0, 0 ); fdlSchema.right = new FormAttachment( middle, -margin ); fdlSchema.top = new FormAttachment( wConnection, margin ); wlSchema.setLayoutData( fdlSchema ); wbSchema = new Button( comp, SWT.PUSH | SWT.CENTER ); props.setLook( wbSchema ); wbSchema.setText( BaseMessages.getString( PKG, "System.Button.Browse" ) ); fdbSchema = new FormData(); fdbSchema.top = new FormAttachment( wConnection, margin ); fdbSchema.right = new FormAttachment( 100, 0 ); wbSchema.setLayoutData( fdbSchema ); wSchema = new TextVar( transMeta, comp, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); props.setLook( wSchema ); wSchema.addModifyListener( lsTableMod ); FormData fdSchema = new FormData(); fdSchema.left = new FormAttachment( middle, 0 ); fdSchema.top = new FormAttachment( wConnection, margin ); fdSchema.right = new FormAttachment( wbSchema, -margin ); wSchema.setLayoutData( fdSchema ); // Table line... wlTable = new Label( comp, SWT.RIGHT ); wlTable.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.TargeTable.Label" ) ); props.setLook( wlTable ); FormData fdlTable = new FormData(); fdlTable.left = new FormAttachment( 0, 0 ); fdlTable.right = new FormAttachment( middle, -margin ); fdlTable.top = new FormAttachment( wbSchema, margin ); wlTable.setLayoutData( fdlTable ); wbTable = new Button( comp, SWT.PUSH | SWT.CENTER ); props.setLook( wbTable ); wbTable.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.Browse.Button" ) ); FormData fdbTable = new FormData(); fdbTable.right = new FormAttachment( 100, 0 ); fdbTable.top = new FormAttachment( wbSchema, margin ); wbTable.setLayoutData( fdbTable ); wTable = new TextVar( transMeta, comp, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); props.setLook( wTable ); wTable.addModifyListener( lsTableMod ); FormData fdTable = new FormData(); fdTable.left = new FormAttachment( middle, 0 ); fdTable.top = new FormAttachment( wbSchema, margin ); fdTable.right = new FormAttachment( wbTable, 0 ); wTable.setLayoutData( fdTable ); // Commit size ... wlCommit = new Label( comp, SWT.RIGHT ); wlCommit.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.Commit.Label" ) ); props.setLook( wlCommit ); FormData fdlCommit = new FormData(); fdlCommit.left = new FormAttachment( 0, 0 ); fdlCommit.right = new FormAttachment( middle, -margin ); fdlCommit.top = new FormAttachment( wTable, margin ); wlCommit.setLayoutData( fdlCommit ); wCommit = new Text( comp, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); props.setLook( wCommit ); wCommit.addModifyListener( lsMod ); FormData fdCommit = new FormData(); fdCommit.left = new FormAttachment( middle, 0 ); fdCommit.top = new FormAttachment( wTable, margin ); fdCommit.right = new FormAttachment( 100, 0 ); wCommit.setLayoutData( fdCommit ); // Use Cache? wlUseCache = new Label( comp, SWT.RIGHT ); wlUseCache.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.UseCache.Label" ) ); props.setLook( wlUseCache ); FormData fdlUseCache = new FormData(); fdlUseCache.left = new FormAttachment( 0, 0 ); fdlUseCache.right = new FormAttachment( middle, -margin ); fdlUseCache.top = new FormAttachment( wCommit, margin ); wlUseCache.setLayoutData( fdlUseCache ); wUseCache = new Button( comp, SWT.CHECK ); props.setLook( wUseCache ); wUseCache.addSelectionListener( new SelectionAdapter() { public void widgetSelected( SelectionEvent arg0 ) { setFlags(); input.setChanged(); } } ); FormData fdUseCache = new FormData(); fdUseCache.left = new FormAttachment( middle, 0 ); fdUseCache.top = new FormAttachment( wCommit, margin ); fdUseCache.right = new FormAttachment( 100, 0 ); wUseCache.setLayoutData( fdUseCache ); // Preload cache? wlPreloadCache = new Label( comp, SWT.RIGHT ); wlPreloadCache.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.PreloadCache.Label" ) ); props.setLook( wlPreloadCache ); FormData fdlPreloadCache = new FormData(); fdlPreloadCache.left = new FormAttachment( 0, 0 ); fdlPreloadCache.right = new FormAttachment( middle, -margin ); fdlPreloadCache.top = new FormAttachment( wUseCache, margin ); wlPreloadCache.setLayoutData( fdlPreloadCache ); wPreloadCache = new Button( comp, SWT.CHECK ); props.setLook( wPreloadCache ); wPreloadCache.addSelectionListener( new SelectionAdapter() { public void widgetSelected( SelectionEvent arg0 ) { setFlags(); input.setChanged(); } } ); FormData fdPreloadCache = new FormData(); fdPreloadCache.left = new FormAttachment( middle, 0 ); fdPreloadCache.top = new FormAttachment( wUseCache, margin ); fdPreloadCache.right = new FormAttachment( 100, 0 ); wPreloadCache.setLayoutData( fdPreloadCache ); // Cache size ... wlCacheSize = new Label( comp, SWT.RIGHT ); wlCacheSize.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.CacheSize.Label" ) ); props.setLook( wlCacheSize ); FormData fdlCacheSize = new FormData(); fdlCacheSize.left = new FormAttachment( 0, 0 ); fdlCacheSize.right = new FormAttachment( middle, -margin ); fdlCacheSize.top = new FormAttachment( wPreloadCache, margin ); wlCacheSize.setLayoutData( fdlCacheSize ); wCacheSize = new Text( comp, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); props.setLook( wCacheSize ); wCacheSize.addModifyListener( lsMod ); FormData fdCacheSize = new FormData(); fdCacheSize.left = new FormAttachment( middle, 0 ); fdCacheSize.top = new FormAttachment( wPreloadCache, margin ); fdCacheSize.right = new FormAttachment( 100, 0 ); wCacheSize.setLayoutData( fdCacheSize ); wlTkRename = new Label( comp, SWT.RIGHT ); wTabFolder = new CTabFolder( comp, SWT.BORDER ); props.setLook( wTabFolder, Props.WIDGET_STYLE_TAB ); // //////////////////////// // START OF KEY TAB /// // / wKeyTab = new CTabItem( wTabFolder, SWT.NONE ); wKeyTab.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.KeyTab.CTabItem" ) ); FormLayout keyLayout = new FormLayout(); keyLayout.marginWidth = 3; keyLayout.marginHeight = 3; Composite wKeyComp = new Composite( wTabFolder, SWT.NONE ); props.setLook( wKeyComp ); wKeyComp.setLayout( keyLayout ); // // The Lookup fields: usually the key // wlKey = new Label( wKeyComp, SWT.NONE ); wlKey.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.KeyFields.Label" ) ); props.setLook( wlKey ); FormData fdlKey = new FormData(); fdlKey.left = new FormAttachment( 0, 0 ); fdlKey.top = new FormAttachment( 0, margin ); fdlKey.right = new FormAttachment( 100, 0 ); wlKey.setLayoutData( fdlKey ); int nrKeyCols = 2; int nrKeyRows = ( input.getKeyStream() != null ? input.getKeyStream().length : 1 ); ciKey = new ColumnInfo[nrKeyCols]; ciKey[0] = new ColumnInfo( BaseMessages.getString( PKG, "DimensionLookupDialog.ColumnInfo.DimensionField" ), ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] { "" }, false ); ciKey[1] = new ColumnInfo( BaseMessages.getString( PKG, "DimensionLookupDialog.ColumnInfo.FieldInStream" ), ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] { "" }, false ); tableFieldColumns.add( ciKey[0] ); wKey = new TableView( transMeta, wKeyComp, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL, ciKey, nrKeyRows, lsMod, props ); FormData fdKey = new FormData(); fdKey.left = new FormAttachment( 0, 0 ); fdKey.top = new FormAttachment( wlKey, margin ); fdKey.right = new FormAttachment( 100, 0 ); fdKey.bottom = new FormAttachment( 100, 0 ); wKey.setLayoutData( fdKey ); fdKeyComp = new FormData(); fdKeyComp.left = new FormAttachment( 0, 0 ); fdKeyComp.top = new FormAttachment( 0, 0 ); fdKeyComp.right = new FormAttachment( 100, 0 ); fdKeyComp.bottom = new FormAttachment( 100, 0 ); wKeyComp.setLayoutData( fdKeyComp ); wKeyComp.layout(); wKeyTab.setControl( wKeyComp ); // /////////////////////////////////////////////////////////// // / END OF KEY TAB // /////////////////////////////////////////////////////////// // Fields tab... // wFieldsTab = new CTabItem( wTabFolder, SWT.NONE ); wFieldsTab.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.FieldsTab.CTabItem.Title" ) ); Composite wFieldsComp = new Composite( wTabFolder, SWT.NONE ); props.setLook( wFieldsComp ); FormLayout fieldsCompLayout = new FormLayout(); fieldsCompLayout.marginWidth = Const.FORM_MARGIN; fieldsCompLayout.marginHeight = Const.FORM_MARGIN; wFieldsComp.setLayout( fieldsCompLayout ); // THE UPDATE/INSERT TABLE wlUpIns = new Label( wFieldsComp, SWT.NONE ); wlUpIns.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.UpdateOrInsertFields.Label" ) ); props.setLook( wlUpIns ); FormData fdlUpIns = new FormData(); fdlUpIns.left = new FormAttachment( 0, 0 ); fdlUpIns.top = new FormAttachment( 0, margin ); wlUpIns.setLayoutData( fdlUpIns ); int UpInsCols = 3; int UpInsRows = ( input.getFieldStream() != null ? input.getFieldStream().length : 1 ); ciUpIns = new ColumnInfo[UpInsCols]; ciUpIns[0] = new ColumnInfo( BaseMessages.getString( PKG, "DimensionLookupDialog.ColumnInfo.DimensionField" ), ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] { "" }, false ); ciUpIns[1] = new ColumnInfo( BaseMessages.getString( PKG, "DimensionLookupDialog.ColumnInfo.StreamField" ), ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] { "" }, false ); ciUpIns[2] = new ColumnInfo( BaseMessages.getString( PKG, "DimensionLookupDialog.ColumnInfo.TypeOfDimensionUpdate" ), ColumnInfo.COLUMN_TYPE_CCOMBO, input.isUpdate() ? DimensionLookupMeta.typeDesc : DimensionLookupMeta.typeDescLookup ); tableFieldColumns.add( ciUpIns[0] ); wUpIns = new TableView( transMeta, wFieldsComp, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL, ciUpIns, UpInsRows, lsMod, props ); FormData fdUpIns = new FormData(); fdUpIns.left = new FormAttachment( 0, 0 ); fdUpIns.top = new FormAttachment( wlUpIns, margin ); fdUpIns.right = new FormAttachment( 100, 0 ); fdUpIns.bottom = new FormAttachment( 100, 0 ); wUpIns.setLayoutData( fdUpIns ); // // Search the fields in the background // final Runnable runnable = new Runnable() { public void run() { StepMeta stepMeta = transMeta.findStep( stepname ); if ( stepMeta != null ) { try { RowMetaInterface row = transMeta.getPrevStepFields( stepMeta ); // Remember these fields... for ( int i = 0; i < row.size(); i++ ) { inputFields.put( row.getValueMeta( i ).getName(), i ); } setComboBoxes(); } catch ( HopException e ) { logError( BaseMessages.getString( PKG, "System.Dialog.GetFieldsFailed.Message" ) ); } } } }; new Thread( runnable ).start(); fdFieldsComp = new FormData(); fdFieldsComp.left = new FormAttachment( 0, 0 ); fdFieldsComp.top = new FormAttachment( 0, 0 ); fdFieldsComp.right = new FormAttachment( 100, 0 ); fdFieldsComp.bottom = new FormAttachment( 100, 0 ); wFieldsComp.setLayoutData( fdFieldsComp ); wFieldsComp.layout(); wFieldsTab.setControl( wFieldsComp ); fdTabFolder = new FormData(); fdTabFolder.left = new FormAttachment( 0, 0 ); fdTabFolder.top = new FormAttachment( wCacheSize, margin ); fdTabFolder.right = new FormAttachment( 100, 0 ); fdTabFolder.height = 200; wTabFolder.setLayoutData( fdTabFolder ); // Technical key field: wlTk = new Label( comp, SWT.RIGHT ); wlTk.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.TechnicalKeyField.Label" ) ); props.setLook( wlTk ); FormData fdlTk = new FormData(); fdlTk.left = new FormAttachment( 0, 0 ); fdlTk.right = new FormAttachment( middle, -margin ); fdlTk.top = new FormAttachment( wTabFolder, 2 * margin ); wlTk.setLayoutData( fdlTk ); wTk = new CCombo( comp, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); props.setLook( wTk ); wTk.addModifyListener( lsMod ); FormData fdTk = new FormData(); fdTk.left = new FormAttachment( middle, 0 ); fdTk.top = new FormAttachment( wTabFolder, 2 * margin ); fdTk.right = new FormAttachment( 50 + middle / 2, 0 ); wTk.setLayoutData( fdTk ); wTk.addFocusListener( new FocusListener() { public void focusLost( org.eclipse.swt.events.FocusEvent e ) { } public void focusGained( org.eclipse.swt.events.FocusEvent e ) { Cursor busy = new Cursor( shell.getDisplay(), SWT.CURSOR_WAIT ); shell.setCursor( busy ); getFieldsFromTable(); shell.setCursor( null ); busy.dispose(); } } ); wlTkRename.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.NewName.Label" ) ); props.setLook( wlTkRename ); FormData fdlTkRename = new FormData(); fdlTkRename.left = new FormAttachment( 50 + middle / 2, margin ); fdlTkRename.top = new FormAttachment( wTabFolder, 2 * margin ); wlTkRename.setLayoutData( fdlTkRename ); wTkRename = new Text( comp, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); props.setLook( wTkRename ); wTkRename.addModifyListener( lsMod ); FormData fdTkRename = new FormData(); fdTkRename.left = new FormAttachment( wlTkRename, margin ); fdTkRename.top = new FormAttachment( wTabFolder, 2 * margin ); fdTkRename.right = new FormAttachment( 100, 0 ); wTkRename.setLayoutData( fdTkRename ); // ////////////////////////////////////////////////// // The key creation box // ////////////////////////////////////////////////// gTechGroup = new Group( comp, SWT.SHADOW_ETCHED_IN ); gTechGroup.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.TechGroup.Label" ) ); GridLayout gridLayout = new GridLayout( 3, false ); gTechGroup.setLayout( gridLayout ); FormData fdTechGroup = new FormData(); fdTechGroup.left = new FormAttachment( middle, 0 ); fdTechGroup.top = new FormAttachment( wTkRename, 2 * margin ); fdTechGroup.right = new FormAttachment( 100, 0 ); gTechGroup.setBackground( shell.getBackground() ); // the default looks ugly gTechGroup.setLayoutData( fdTechGroup ); // Use maximum of table + 1 wTableMax = new Button( gTechGroup, SWT.RADIO ); props.setLook( wTableMax ); wTableMax.setSelection( false ); GridData gdTableMax = new GridData(); wTableMax.setLayoutData( gdTableMax ); wTableMax .setToolTipText( BaseMessages.getString( PKG, "DimensionLookupDialog.TableMaximum.Tooltip", Const.CR ) ); wlTableMax = new Label( gTechGroup, SWT.LEFT ); wlTableMax.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.TableMaximum.Label" ) ); props.setLook( wlTableMax ); GridData gdlTableMax = new GridData( GridData.FILL_BOTH ); gdlTableMax.horizontalSpan = 2; gdlTableMax.verticalSpan = 1; wlTableMax.setLayoutData( gdlTableMax ); // Sequence Check Button wSeqButton = new Button( gTechGroup, SWT.RADIO ); props.setLook( wSeqButton ); wSeqButton.setSelection( false ); GridData gdSeqButton = new GridData(); wSeqButton.setLayoutData( gdSeqButton ); wSeqButton.setToolTipText( BaseMessages.getString( PKG, "DimensionLookupDialog.Sequence.Tooltip", Const.CR ) ); wlSeqButton = new Label( gTechGroup, SWT.LEFT ); wlSeqButton.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.Sequence.Label" ) ); props.setLook( wlSeqButton ); GridData gdlSeqButton = new GridData(); wlSeqButton.setLayoutData( gdlSeqButton ); wSeq = new Text( gTechGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); props.setLook( wSeq ); wSeq.addModifyListener( lsMod ); GridData gdSeq = new GridData( GridData.FILL_HORIZONTAL ); wSeq.setLayoutData( gdSeq ); wSeq.addFocusListener( new FocusListener() { public void focusGained( FocusEvent arg0 ) { input.setTechKeyCreation( DimensionLookupMeta.CREATION_METHOD_SEQUENCE ); wSeqButton.setSelection( true ); wAutoinc.setSelection( false ); wTableMax.setSelection( false ); } public void focusLost( FocusEvent arg0 ) { } } ); // Use an autoincrement field? wAutoinc = new Button( gTechGroup, SWT.RADIO ); props.setLook( wAutoinc ); wAutoinc.setSelection( false ); GridData gdAutoinc = new GridData(); wAutoinc.setLayoutData( gdAutoinc ); wAutoinc .setToolTipText( BaseMessages.getString( PKG, "DimensionLookupDialog.AutoincButton.Tooltip", Const.CR ) ); wlAutoinc = new Label( gTechGroup, SWT.LEFT ); wlAutoinc.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.Autoincrement.Label" ) ); props.setLook( wlAutoinc ); GridData gdlAutoinc = new GridData(); wlAutoinc.setLayoutData( gdlAutoinc ); // ////////////////////////////////////////////////// // The key creation box END // ////////////////////////////////////////////////// // Version key field: wlVersion = new Label( comp, SWT.RIGHT ); wlVersion.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.Version.Label" ) ); props.setLook( wlVersion ); FormData fdlVersion = new FormData(); fdlVersion.left = new FormAttachment( 0, 0 ); fdlVersion.right = new FormAttachment( middle, -margin ); fdlVersion.top = new FormAttachment( gTechGroup, 2 * margin ); wlVersion.setLayoutData( fdlVersion ); wVersion = new CCombo( comp, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); props.setLook( wVersion ); wVersion.addModifyListener( lsMod ); FormData fdVersion = new FormData(); fdVersion.left = new FormAttachment( middle, 0 ); fdVersion.top = new FormAttachment( gTechGroup, 2 * margin ); fdVersion.right = new FormAttachment( 100, 0 ); wVersion.setLayoutData( fdVersion ); wVersion.addFocusListener( new FocusListener() { public void focusLost( org.eclipse.swt.events.FocusEvent e ) { } public void focusGained( org.eclipse.swt.events.FocusEvent e ) { Cursor busy = new Cursor( shell.getDisplay(), SWT.CURSOR_WAIT ); shell.setCursor( busy ); getFieldsFromTable(); shell.setCursor( null ); busy.dispose(); } } ); // Datefield line wlDatefield = new Label( comp, SWT.RIGHT ); wlDatefield.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.Datefield.Label" ) ); props.setLook( wlDatefield ); FormData fdlDatefield = new FormData(); fdlDatefield.left = new FormAttachment( 0, 0 ); fdlDatefield.right = new FormAttachment( middle, -margin ); fdlDatefield.top = new FormAttachment( wVersion, 2 * margin ); wlDatefield.setLayoutData( fdlDatefield ); wDatefield = new CCombo( comp, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); props.setLook( wDatefield ); wDatefield.addModifyListener( lsMod ); FormData fdDatefield = new FormData(); fdDatefield.left = new FormAttachment( middle, 0 ); fdDatefield.top = new FormAttachment( wVersion, 2 * margin ); fdDatefield.right = new FormAttachment( 100, 0 ); wDatefield.setLayoutData( fdDatefield ); wDatefield.addFocusListener( new FocusListener() { public void focusLost( org.eclipse.swt.events.FocusEvent e ) { } public void focusGained( org.eclipse.swt.events.FocusEvent e ) { Cursor busy = new Cursor( shell.getDisplay(), SWT.CURSOR_WAIT ); shell.setCursor( busy ); getFields(); shell.setCursor( null ); busy.dispose(); } } ); // Fromdate line // // 0 [wlFromdate] middle [wFromdate] (100-middle)/3 [wlMinyear] // 2*(100-middle)/3 [wMinyear] 100% // wlFromdate = new Label( comp, SWT.RIGHT ); wlFromdate.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.Fromdate.Label" ) ); props.setLook( wlFromdate ); FormData fdlFromdate = new FormData(); fdlFromdate.left = new FormAttachment( 0, 0 ); fdlFromdate.right = new FormAttachment( middle, -margin ); fdlFromdate.top = new FormAttachment( wDatefield, 2 * margin ); wlFromdate.setLayoutData( fdlFromdate ); wFromdate = new CCombo( comp, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); props.setLook( wFromdate ); wFromdate.addModifyListener( lsMod ); FormData fdFromdate = new FormData(); fdFromdate.left = new FormAttachment( middle, 0 ); fdFromdate.right = new FormAttachment( middle + ( 100 - middle ) / 3, -margin ); fdFromdate.top = new FormAttachment( wDatefield, 2 * margin ); wFromdate.setLayoutData( fdFromdate ); wFromdate.addFocusListener( new FocusListener() { public void focusLost( org.eclipse.swt.events.FocusEvent e ) { } public void focusGained( org.eclipse.swt.events.FocusEvent e ) { Cursor busy = new Cursor( shell.getDisplay(), SWT.CURSOR_WAIT ); shell.setCursor( busy ); getFieldsFromTable(); shell.setCursor( null ); busy.dispose(); } } ); // Minyear line wlMinyear = new Label( comp, SWT.RIGHT ); wlMinyear.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.Minyear.Label" ) ); props.setLook( wlMinyear ); FormData fdlMinyear = new FormData(); fdlMinyear.left = new FormAttachment( wFromdate, margin ); fdlMinyear.right = new FormAttachment( middle + 2 * ( 100 - middle ) / 3, -margin ); fdlMinyear.top = new FormAttachment( wDatefield, 2 * margin ); wlMinyear.setLayoutData( fdlMinyear ); wMinyear = new Text( comp, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); props.setLook( wMinyear ); wMinyear.addModifyListener( lsMod ); FormData fdMinyear = new FormData(); fdMinyear.left = new FormAttachment( wlMinyear, margin ); fdMinyear.right = new FormAttachment( 100, 0 ); fdMinyear.top = new FormAttachment( wDatefield, 2 * margin ); wMinyear.setLayoutData( fdMinyear ); wMinyear.setToolTipText( BaseMessages.getString( PKG, "DimensionLookupDialog.Minyear.ToolTip" ) ); // Add a line with an option to specify an alternative start date... // wlUseAltStartDate = new Label( comp, SWT.RIGHT ); wlUseAltStartDate .setText( BaseMessages.getString( PKG, "DimensionLookupDialog.UseAlternativeStartDate.Label" ) ); props.setLook( wlUseAltStartDate ); FormData fdlUseAltStartDate = new FormData(); fdlUseAltStartDate.left = new FormAttachment( 0, 0 ); fdlUseAltStartDate.right = new FormAttachment( middle, -margin ); fdlUseAltStartDate.top = new FormAttachment( wFromdate, margin ); wlUseAltStartDate.setLayoutData( fdlUseAltStartDate ); wUseAltStartDate = new Button( comp, SWT.CHECK ); props.setLook( wUseAltStartDate ); wUseAltStartDate.setToolTipText( BaseMessages.getString( PKG, "DimensionLookupDialog.UseAlternativeStartDate.Tooltip", Const.CR ) ); FormData fdUseAltStartDate = new FormData(); fdUseAltStartDate.left = new FormAttachment( middle, 0 ); fdUseAltStartDate.top = new FormAttachment( wFromdate, margin ); wUseAltStartDate.setLayoutData( fdUseAltStartDate ); wUseAltStartDate.addSelectionListener( new SelectionAdapter() { public void widgetSelected( SelectionEvent e ) { setFlags(); input.setChanged(); } } ); // The choice... // wAltStartDate = new CCombo( comp, SWT.BORDER ); props.setLook( wAltStartDate ); // All options except for "No alternative"... wAltStartDate.removeAll(); for ( int i = 1; i < DimensionLookupMeta.getStartDateAlternativeDescriptions().length; i++ ) { wAltStartDate.add( DimensionLookupMeta.getStartDateAlternativeDescriptions()[i] ); } wAltStartDate.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.AlternativeStartDate.SelectItemDefault" ) ); wAltStartDate.setToolTipText( BaseMessages.getString( PKG, "DimensionLookupDialog.AlternativeStartDate.Tooltip", Const.CR ) ); FormData fdAltStartDate = new FormData(); fdAltStartDate.left = new FormAttachment( wUseAltStartDate, 2 * margin ); fdAltStartDate.right = new FormAttachment( wUseAltStartDate, 200 ); fdAltStartDate.top = new FormAttachment( wFromdate, margin ); wAltStartDate.setLayoutData( fdAltStartDate ); wAltStartDate.addModifyListener( new ModifyListener() { public void modifyText( ModifyEvent arg0 ) { setFlags(); input.setChanged(); } } ); wAltStartDateField = new CCombo( comp, SWT.SINGLE | SWT.BORDER ); props.setLook( wAltStartDateField ); wAltStartDateField.setToolTipText( BaseMessages.getString( PKG, "DimensionLookupDialog.AlternativeStartDateField.Tooltip", Const.CR ) ); FormData fdAltStartDateField = new FormData(); fdAltStartDateField.left = new FormAttachment( wAltStartDate, 2 * margin ); fdAltStartDateField.right = new FormAttachment( 100, 0 ); fdAltStartDateField.top = new FormAttachment( wFromdate, margin ); wAltStartDateField.setLayoutData( fdAltStartDateField ); wAltStartDateField.addFocusListener( new FocusListener() { public void focusLost( org.eclipse.swt.events.FocusEvent e ) { } public void focusGained( org.eclipse.swt.events.FocusEvent e ) { Cursor busy = new Cursor( shell.getDisplay(), SWT.CURSOR_WAIT ); shell.setCursor( busy ); getFieldsFromTable(); shell.setCursor( null ); busy.dispose(); } } ); // Todate line wlTodate = new Label( comp, SWT.RIGHT ); wlTodate.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.Todate.Label" ) ); props.setLook( wlTodate ); FormData fdlTodate = new FormData(); fdlTodate.left = new FormAttachment( 0, 0 ); fdlTodate.right = new FormAttachment( middle, -margin ); fdlTodate.top = new FormAttachment( wAltStartDate, margin ); wlTodate.setLayoutData( fdlTodate ); wTodate = new CCombo( comp, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); props.setLook( wTodate ); wTodate.addModifyListener( lsMod ); FormData fdTodate = new FormData(); fdTodate.left = new FormAttachment( middle, 0 ); fdTodate.right = new FormAttachment( middle + ( 100 - middle ) / 3, -margin ); fdTodate.top = new FormAttachment( wAltStartDate, margin ); wTodate.setLayoutData( fdTodate ); wTodate.addFocusListener( new FocusListener() { public void focusLost( org.eclipse.swt.events.FocusEvent e ) { } public void focusGained( org.eclipse.swt.events.FocusEvent e ) { Cursor busy = new Cursor( shell.getDisplay(), SWT.CURSOR_WAIT ); shell.setCursor( busy ); getFieldsFromTable(); shell.setCursor( null ); busy.dispose(); } } ); // Maxyear line wlMaxyear = new Label( comp, SWT.RIGHT ); wlMaxyear.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.Maxyear.Label" ) ); props.setLook( wlMaxyear ); FormData fdlMaxyear = new FormData(); fdlMaxyear.left = new FormAttachment( wTodate, margin ); fdlMaxyear.right = new FormAttachment( middle + 2 * ( 100 - middle ) / 3, -margin ); fdlMaxyear.top = new FormAttachment( wAltStartDate, margin ); wlMaxyear.setLayoutData( fdlMaxyear ); wMaxyear = new Text( comp, SWT.SINGLE | SWT.LEFT | SWT.BORDER ); props.setLook( wMaxyear ); wMaxyear.addModifyListener( lsMod ); FormData fdMaxyear = new FormData(); fdMaxyear.left = new FormAttachment( wlMaxyear, margin ); fdMaxyear.right = new FormAttachment( 100, 0 ); fdMaxyear.top = new FormAttachment( wAltStartDate, margin ); wMaxyear.setLayoutData( fdMaxyear ); wMaxyear.setToolTipText( BaseMessages.getString( PKG, "DimensionLookupDialog.Maxyear.ToolTip" ) ); // THE BOTTOM BUTTONS wOK = new Button( comp, SWT.PUSH ); wOK.setText( BaseMessages.getString( PKG, "System.Button.OK" ) ); wGet = new Button( comp, SWT.PUSH ); wGet.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.GetFields.Button" ) ); wCreate = new Button( comp, SWT.PUSH ); wCreate.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.SQL.Button" ) ); wCancel = new Button( comp, SWT.PUSH ); wCancel.setText( BaseMessages.getString( PKG, "System.Button.Cancel" ) ); setButtonPositions( new Button[] { wOK, wCancel, wGet, wCreate }, margin, wMaxyear ); FormData fdComp = new FormData(); fdComp.left = new FormAttachment( 0, 0 ); fdComp.top = new FormAttachment( 0, 0 ); fdComp.right = new FormAttachment( 100, 0 ); fdComp.bottom = new FormAttachment( 100, 0 ); comp.setLayoutData( fdComp ); comp.pack(); Rectangle bounds = comp.getBounds(); sComp.setContent( comp ); sComp.setExpandHorizontal( true ); sComp.setExpandVertical( true ); sComp.setMinWidth( bounds.width ); sComp.setMinHeight( bounds.height ); // Add listeners lsOK = new Listener() { public void handleEvent( Event e ) { ok(); } }; lsGet = new Listener() { public void handleEvent( Event e ) { get(); } }; lsCreate = new Listener() { public void handleEvent( Event e ) { create(); } }; lsCancel = new Listener() { public void handleEvent( Event e ) { cancel(); } }; wOK.addListener( SWT.Selection, lsOK ); wGet.addListener( SWT.Selection, lsGet ); wCreate.addListener( SWT.Selection, lsCreate ); wCancel.addListener( SWT.Selection, lsCancel ); setTableMax(); setSequence(); setAutoincUse(); lsDef = new SelectionAdapter() { public void widgetDefaultSelected( SelectionEvent e ) { ok(); } }; wStepname.addSelectionListener( lsDef ); wSchema.addSelectionListener( lsDef ); wTable.addSelectionListener( lsDef ); wCommit.addSelectionListener( lsDef ); wCacheSize.addSelectionListener( lsDef ); wTk.addSelectionListener( lsDef ); wTkRename.addSelectionListener( lsDef ); wSeq.addSelectionListener( lsDef ); wVersion.addSelectionListener( lsDef ); wDatefield.addSelectionListener( lsDef ); wFromdate.addSelectionListener( lsDef ); wMinyear.addSelectionListener( lsDef ); wTodate.addSelectionListener( lsDef ); wMaxyear.addSelectionListener( lsDef ); // Detect X or ALT-F4 or something that kills this window... shell.addShellListener( new ShellAdapter() { public void shellClosed( ShellEvent e ) { cancel(); } } ); wbSchema.addSelectionListener( new SelectionAdapter() { public void widgetSelected( SelectionEvent e ) { getSchemaNames(); } } ); wbTable.addSelectionListener( new SelectionAdapter() { public void widgetSelected( SelectionEvent e ) { getTableName(); } } ); wTabFolder.setSelection( 0 ); // Set the shell size, based upon previous time... setSize(); getData(); setTableFieldCombo(); input.setChanged( backupChanged ); shell.open(); while ( !shell.isDisposed() ) { if ( !display.readAndDispatch() ) { display.sleep(); } } return stepname; } public void setFlags() { ColumnInfo colinf = new ColumnInfo( BaseMessages.getString( PKG, "DimensionLookupDialog.ColumnInfo.Type" ), ColumnInfo.COLUMN_TYPE_CCOMBO, input.isUpdate() ? DimensionLookupMeta.typeDesc : DimensionLookupMeta.typeDescLookup ); wUpIns.setColumnInfo( 2, colinf ); if ( input.isUpdate() ) { wUpIns.setColumnText( 2, BaseMessages.getString( PKG, "DimensionLookupDialog.UpdateOrInsertFields.ColumnText.SteamFieldToCompare" ) ); wUpIns.setColumnText( 3, BaseMessages.getString( PKG, "DimensionLookupDialog.UpdateOrInsertFields.ColumnTextTypeOfDimensionUpdate" ) ); wUpIns.setColumnToolTip( 2, BaseMessages.getString( PKG, "DimensionLookupDialog.UpdateOrInsertFields.ColumnToolTip" ) + Const.CR + "Punch Through: Kimball Type I" + Const.CR + "Update: Correct error in last version" ); } else { wUpIns.setColumnText( 2, BaseMessages.getString( PKG, "DimensionLookupDialog.UpdateOrInsertFields.ColumnText.NewNameOfOutputField" ) ); wUpIns.setColumnText( 3, BaseMessages.getString( PKG, "DimensionLookupDialog.UpdateOrInsertFields.ColumnText.TypeOfReturnField" ) ); wUpIns.setColumnToolTip( 2, BaseMessages.getString( PKG, "DimensionLookupDialog.UpdateOrInsertFields.ColumnToolTip2" ) ); } wUpIns.optWidth( true ); // In case of lookup: disable commitsize, etc. boolean update = wUpdate.getSelection(); wlCommit.setEnabled( update ); wCommit.setEnabled( update ); wlMinyear.setEnabled( update ); wMinyear.setEnabled( update ); wlMaxyear.setEnabled( update ); wMaxyear.setEnabled( update ); wlMinyear.setEnabled( update ); wMinyear.setEnabled( update ); wlVersion.setEnabled( update ); wVersion.setEnabled( update ); wlTkRename.setEnabled( !update ); wTkRename.setEnabled( !update ); wCreate.setEnabled( update ); // Set the technical creation key fields correct... then disable // depending on update or not. Then reset if we're updating. It makes // sure that the disabled options because of database restrictions // will always be properly grayed out. setAutoincUse(); setSequence(); setTableMax(); // Surpisingly we can't disable these fields as they influence the // calculation of the "Unknown" key // If we have a MySQL database with Auto-increment for example, the // "unknown" is 1. // If we have a MySQL database with Table-max the "unknown" is 0. // // gTechGroup.setEnabled( update ); // wlAutoinc.setEnabled( update ); // wAutoinc.setEnabled( update ); // wlTableMax.setEnabled( update ); // wTableMax.setEnabled( update ); // wlSeqButton.setEnabled( update ); // wSeqButton.setEnabled( update ); // wSeq.setEnabled( update ); if ( update ) { setAutoincUse(); setSequence(); setTableMax(); } // The alternative start date // wAltStartDate.setEnabled( wUseAltStartDate.getSelection() ); int alternative = DimensionLookupMeta.getStartDateAlternative( wAltStartDate.getText() ); wAltStartDateField.setEnabled( alternative == DimensionLookupMeta.START_DATE_ALTERNATIVE_COLUMN_VALUE ); // Caching... // wlPreloadCache.setEnabled( wUseCache.getSelection() && !wUpdate.getSelection() ); wPreloadCache.setEnabled( wUseCache.getSelection() && !wUpdate.getSelection() ); wlCacheSize.setEnabled( wUseCache.getSelection() && !wPreloadCache.getSelection() ); wCacheSize.setEnabled( wUseCache.getSelection() && !wPreloadCache.getSelection() ); } protected void setComboBoxes() { // Something was changed in the row. // final Map<String, Integer> fields = new HashMap<String, Integer>(); // Add the currentMeta fields... fields.putAll( inputFields ); Set<String> keySet = fields.keySet(); List<String> entries = new ArrayList<String>( keySet ); String[] fieldNames = entries.toArray( new String[entries.size()] ); Const.sortStrings( fieldNames ); ciKey[1].setComboValues( fieldNames ); ciUpIns[1].setComboValues( fieldNames ); } public void setAutoincUse() { boolean enable = ( ci == null ) || ( ci.supportsAutoinc() && ci.supportsAutoGeneratedKeys() ); wlAutoinc.setEnabled( enable ); wAutoinc.setEnabled( enable ); if ( !enable && wAutoinc.getSelection() ) { wAutoinc.setSelection( false ); wSeqButton.setSelection( false ); wTableMax.setSelection( true ); } } public void setTableMax() { wlTableMax.setEnabled( true ); wTableMax.setEnabled( true ); } public void setSequence() { boolean seq = ( ci == null ) || ci.supportsSequences(); wSeq.setEnabled( seq ); wlSeqButton.setEnabled( seq ); wSeqButton.setEnabled( seq ); if ( !seq && wSeqButton.getSelection() ) { wAutoinc.setSelection( false ); wSeqButton.setSelection( false ); wTableMax.setSelection( true ); } } /** * Copy information from the meta-data input to the dialog fields. */ public void getData() { if ( log.isDebug() ) { logDebug( BaseMessages.getString( PKG, "DimensionLookupDialog.Log.GettingKeyInfo" ) ); } if ( input.getKeyStream() != null ) { for ( int i = 0; i < input.getKeyStream().length; i++ ) { TableItem item = wKey.table.getItem( i ); if ( input.getKeyLookup()[i] != null ) { item.setText( 1, input.getKeyLookup()[i] ); } if ( input.getKeyStream()[i] != null ) { item.setText( 2, input.getKeyStream()[i] ); } } } if ( input.getFieldStream() != null ) { for ( int i = 0; i < input.getFieldStream().length; i++ ) { TableItem item = wUpIns.table.getItem( i ); if ( input.getFieldLookup()[i] != null ) { item.setText( 1, input.getFieldLookup()[i] ); } if ( input.getFieldStream()[i] != null ) { item.setText( 2, input.getFieldStream()[i] ); } item.setText( 3, DimensionLookupMeta.getUpdateType( input.isUpdate(), input.getFieldUpdate()[i] ) ); } } wUpdate.setSelection( input.isUpdate() ); if ( input.getSchemaName() != null ) { wSchema.setText( input.getSchemaName() ); } if ( input.getTableName() != null ) { wTable.setText( input.getTableName() ); } if ( input.getKeyField() != null ) { wTk.setText( input.getKeyField() ); } if ( input.getKeyRename() != null ) { wTkRename.setText( input.getKeyRename() ); } wAutoinc.setSelection( input.isAutoIncrement() ); if ( input.getVersionField() != null ) { wVersion.setText( input.getVersionField() ); } if ( input.getSequenceName() != null ) { wSeq.setText( input.getSequenceName() ); } if ( input.getDatabaseMeta() != null ) { wConnection.setText( input.getDatabaseMeta().getName() ); } else if ( transMeta.nrDatabases() == 1 ) { wConnection.setText( transMeta.getDatabase( 0 ).getName() ); } if ( input.getDateField() != null ) { wDatefield.setText( input.getDateField() ); } if ( input.getDateFrom() != null ) { wFromdate.setText( input.getDateFrom() ); } if ( input.getDateTo() != null ) { wTodate.setText( input.getDateTo() ); } String techKeyCreation = input.getTechKeyCreation(); if ( techKeyCreation == null ) { // Determine the creation of the technical key for // backwards compatibility. Can probably be removed at // version 3.x or so (Sven Boden). DatabaseMeta database = input.getDatabaseMeta(); if ( database == null || !database.supportsAutoinc() ) { input.setAutoIncrement( false ); } wAutoinc.setSelection( input.isAutoIncrement() ); wSeqButton.setSelection( input.getSequenceName() != null && input.getSequenceName().length() > 0 ); if ( !input.isAutoIncrement() && ( input.getSequenceName() == null || input.getSequenceName().length() <= 0 ) ) { wTableMax.setSelection( true ); } if ( database != null && database.supportsSequences() && input.getSequenceName() != null ) { wSeq.setText( input.getSequenceName() ); input.setAutoIncrement( false ); wTableMax.setSelection( false ); } } else { // HOP post 2.2 version: // The "creation" field now determines the behaviour of the // key creation. if ( DimensionLookupMeta.CREATION_METHOD_AUTOINC.equals( techKeyCreation ) ) { wAutoinc.setSelection( true ); wSeqButton.setSelection( false ); wTableMax.setSelection( false ); } else if ( ( DimensionLookupMeta.CREATION_METHOD_SEQUENCE.equals( techKeyCreation ) ) ) { wSeqButton.setSelection( true ); wAutoinc.setSelection( false ); wTableMax.setSelection( false ); } else { // the rest wTableMax.setSelection( true ); wAutoinc.setSelection( false ); wSeqButton.setSelection( false ); input.setTechKeyCreation( DimensionLookupMeta.CREATION_METHOD_TABLEMAX ); } if ( input.getSequenceName() != null ) { wSeq.setText( input.getSequenceName() ); } } wCommit.setText( "" + input.getCommitSize() ); wUseCache.setSelection( input.getCacheSize() >= 0 ); wPreloadCache.setSelection( input.isPreloadingCache() ); if ( input.getCacheSize() >= 0 ) { wCacheSize.setText( "" + input.getCacheSize() ); } wMinyear.setText( "" + input.getMinYear() ); wMaxyear.setText( "" + input.getMaxYear() ); wUpIns.removeEmptyRows(); wUpIns.setRowNums(); wUpIns.optWidth( true ); wKey.removeEmptyRows(); wKey.setRowNums(); wKey.optWidth( true ); ci = transMeta.findDatabase( wConnection.getText() ); // The alternative start date... // wUseAltStartDate.setSelection( input.isUsingStartDateAlternative() ); if ( input.isUsingStartDateAlternative() ) { wAltStartDate.setText( DimensionLookupMeta.getStartDateAlternativeDesc( input.getStartDateAlternative() ) ); } wAltStartDateField.setText( Const.NVL( input.getStartDateFieldName(), "" ) ); setFlags(); wStepname.selectAll(); wStepname.setFocus(); } private void cancel() { stepname = null; input.setChanged( backupChanged ); input.setUpdate( backupUpdate ); input.setAutoIncrement( backupAutoInc ); dispose(); } private void ok() { if ( Utils.isEmpty( wStepname.getText() ) ) { return; } getInfo( input ); stepname = wStepname.getText(); // return value if ( input.getDatabaseMeta() == null ) { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "DimensionLookupDialog.InvalidConnection.DialogMessage" ) ); mb.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.InvalidConnection.DialogTitle" ) ); mb.open(); return; } dispose(); } private void getInfo( DimensionLookupMeta in ) { in.setUpdate( wUpdate.getSelection() ); // Table ktable = wKey.table; int nrkeys = wKey.nrNonEmpty(); int nrfields = wUpIns.nrNonEmpty(); in.allocate( nrkeys, nrfields ); logDebug( BaseMessages.getString( PKG, "DimensionLookupDialog.Log.FoundKeys", String.valueOf( nrkeys ) ) ); //CHECKSTYLE:Indentation:OFF for ( int i = 0; i < nrkeys; i++ ) { TableItem item = wKey.getNonEmpty( i ); in.getKeyLookup()[i] = item.getText( 1 ); in.getKeyStream()[i] = item.getText( 2 ); } if ( log.isDebug() ) { logDebug( BaseMessages.getString( PKG, "DimensionLookupDialog.Log.FoundFields", String.valueOf( nrfields ) ) ); } //CHECKSTYLE:Indentation:OFF for ( int i = 0; i < nrfields; i++ ) { TableItem item = wUpIns.getNonEmpty( i ); in.getFieldLookup()[i] = item.getText( 1 ); in.getFieldStream()[i] = item.getText( 2 ); in.getFieldUpdate()[i] = DimensionLookupMeta.getUpdateType( in.isUpdate(), item.getText( 3 ) ); } in.setSchemaName( wSchema.getText() ); in.setTableName( wTable.getText() ); in.setKeyField( wTk.getText() ); in.setKeyRename( wTkRename.getText() ); if ( wAutoinc.getSelection() ) { in.setTechKeyCreation( DimensionLookupMeta.CREATION_METHOD_AUTOINC ); in.setAutoIncrement( true ); // for downwards compatibility in.setSequenceName( null ); } else if ( wSeqButton.getSelection() ) { in.setTechKeyCreation( DimensionLookupMeta.CREATION_METHOD_SEQUENCE ); in.setAutoIncrement( false ); in.setSequenceName( wSeq.getText() ); } else { // all the rest in.setTechKeyCreation( DimensionLookupMeta.CREATION_METHOD_TABLEMAX ); in.setAutoIncrement( false ); in.setSequenceName( null ); } in.setAutoIncrement( wAutoinc.getSelection() ); if ( in.getKeyRename() != null && in.getKeyRename().equalsIgnoreCase( in.getKeyField() ) ) { in.setKeyRename( null ); // Don't waste space&time if it's the same } in.setVersionField( wVersion.getText() ); in.setDatabaseMeta( transMeta.findDatabase( wConnection.getText() ) ); in.setDateField( wDatefield.getText() ); in.setDateFrom( wFromdate.getText() ); in.setDateTo( wTodate.getText() ); in.setCommitSize( Const.toInt( wCommit.getText(), 0 ) ); if ( wUseCache.getSelection() ) { in.setCacheSize( Const.toInt( wCacheSize.getText(), -1 ) ); } else { in.setCacheSize( -1 ); } in.setPreloadingCache( wPreloadCache.getSelection() ); if ( wPreloadCache.getSelection() ) { in.setCacheSize( 0 ); } in.setMinYear( Const.toInt( wMinyear.getText(), Const.MIN_YEAR ) ); in.setMaxYear( Const.toInt( wMaxyear.getText(), Const.MAX_YEAR ) ); in.setUsingStartDateAlternative( wUseAltStartDate.getSelection() ); in.setStartDateAlternative( DimensionLookupMeta.getStartDateAlternative( wAltStartDate.getText() ) ); in.setStartDateFieldName( wAltStartDateField.getText() ); } private void getTableName() { int connr = wConnection.getSelectionIndex(); if ( connr < 0 ) { return; } DatabaseMeta inf = transMeta.getDatabase( connr ); logDebug( BaseMessages.getString( PKG, "DimensionLookupDialog.Log.LookingAtConnection" ) + inf.toString() ); DatabaseExplorerDialog std = new DatabaseExplorerDialog( shell, SWT.NONE, inf, transMeta.getDatabases() ); std.setSelectedSchemaAndTable( wSchema.getText(), wTable.getText() ); if ( std.open() ) { wSchema.setText( Const.NVL( std.getSchemaName(), "" ) ); wTable.setText( Const.NVL( std.getTableName(), "" ) ); setTableFieldCombo(); } } private void get() { if ( wTabFolder.getSelection() == wFieldsTab ) { if ( input.isUpdate() ) { getUpdate(); } else { getLookup(); } } else { getKeys(); } } /** * Get the fields from the previous step and use them as "update fields". Only get the the fields which are not yet in * use as key, or in the field table. Also ignore technical key, version, fromdate, todate. */ private void getUpdate() { try { RowMetaInterface r = transMeta.getPrevStepFields( stepname ); if ( r != null && !r.isEmpty() ) { BaseStepDialog.getFieldsFromPrevious( r, wUpIns, 2, new int[] { 1, 2 }, new int[] {}, -1, -1, new TableItemInsertListener() { public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) { tableItem .setText( 3, BaseMessages.getString( PKG, "DimensionLookupDialog.TableItem.Insert.Label" ) ); int idx = wKey.indexOfString( v.getName(), 2 ); return idx < 0 && !v.getName().equalsIgnoreCase( wTk.getText() ) && !v.getName().equalsIgnoreCase( wVersion.getText() ) && !v.getName().equalsIgnoreCase( wFromdate.getText() ) && !v.getName().equalsIgnoreCase( wTodate.getText() ); } } ); } } catch ( HopException ke ) { new ErrorDialog( shell, BaseMessages.getString( PKG, "DimensionLookupDialog.FailedToGetFields.DialogTitle" ), BaseMessages.getString( PKG, "DimensionLookupDialog.FailedToGetFields.DialogMessage" ), ke ); } } // Set table "dimension field" and "technical key" drop downs private void setTableFieldCombo() { Runnable fieldLoader = new Runnable() { public void run() { if ( !wTable.isDisposed() && !wConnection.isDisposed() && !wSchema.isDisposed() ) { final String tableName = wTable.getText(), connectionName = wConnection.getText(), schemaName = wSchema.getText(); // clear for ( ColumnInfo colInfo : tableFieldColumns ) { colInfo.setComboValues( new String[] {} ); } // Ensure other table field dropdowns are refreshed fields when they // next get focus gotTableFields = false; if ( !Utils.isEmpty( tableName ) ) { DatabaseMeta ci = transMeta.findDatabase( connectionName ); if ( ci != null ) { Database db = new Database( loggingObject, ci ); try { db.connect(); RowMetaInterface r = db.getTableFieldsMeta( transMeta.environmentSubstitute( schemaName ), transMeta.environmentSubstitute( tableName ) ); if ( null != r ) { String[] fieldNames = r.getFieldNames(); if ( null != fieldNames ) { for ( ColumnInfo colInfo : tableFieldColumns ) { colInfo.setComboValues( fieldNames ); } wTk.setItems( fieldNames ); } } } catch ( Exception e ) { for ( ColumnInfo colInfo : tableFieldColumns ) { colInfo.setComboValues( new String[] {} ); } // ignore any errors here. drop downs will not be // filled, but no problem for the user } finally { try { if ( db != null ) { db.disconnect(); } } catch ( Exception ignored ) { // ignore any errors here. db = null; } } } } } } }; shell.getDisplay().asyncExec( fieldLoader ); } /** * Get the fields from the table in the database and use them as lookup keys. Only get the the fields which are not * yet in use as key, or in the field table. Also ignore technical key, version, fromdate, todate. */ private void getLookup() { DatabaseMeta databaseMeta = transMeta.findDatabase( wConnection.getText() ); if ( databaseMeta != null ) { Database db = new Database( loggingObject, databaseMeta ); db.shareVariablesWith( transMeta ); try { db.connect(); RowMetaInterface r = db.getTableFieldsMeta( wSchema.getText(), wTable.getText() ); if ( r != null && !r.isEmpty() ) { BaseStepDialog.getFieldsFromPrevious( r, wUpIns, 2, new int[] { 1, 2 }, new int[] { 3 }, -1, -1, new TableItemInsertListener() { public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) { int idx = wKey.indexOfString( v.getName(), 2 ); return idx < 0 && !v.getName().equalsIgnoreCase( wTk.getText() ) && !v.getName().equalsIgnoreCase( wVersion.getText() ) && !v.getName().equalsIgnoreCase( wFromdate.getText() ) && !v.getName().equalsIgnoreCase( wTodate.getText() ); } } ); } } catch ( HopException e ) { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.ErrorOccurred.DialogTitle" ) ); mb.setMessage( BaseMessages.getString( PKG, "DimensionLookupDialog.ErrorOccurred.DialogMessage" ) + Const.CR + e.getMessage() ); mb.open(); } finally { db.disconnect(); } } } private void getFields() { if ( !gotPreviousFields ) { try { String field = wDatefield.getText(); RowMetaInterface r = transMeta.getPrevStepFields( stepname ); if ( r != null ) { wDatefield.setItems( r.getFieldNames() ); } if ( field != null ) { wDatefield.setText( field ); } } catch ( HopException ke ) { new ErrorDialog( shell, BaseMessages.getString( PKG, "DimensionLookupDialog.ErrorGettingFields.Title" ), BaseMessages .getString( PKG, "DimensionLookupDialog.ErrorGettingFields.Message" ), ke ); } gotPreviousFields = true; } } private void getFieldsFromTable() { if ( !gotTableFields ) { if ( !Utils.isEmpty( wTable.getText() ) ) { DatabaseMeta ci = transMeta.findDatabase( wConnection.getText() ); if ( ci != null ) { Database db = new Database( loggingObject, ci ); try { db.connect(); RowMetaInterface r = db.getTableFieldsMeta( transMeta.environmentSubstitute( wSchema.getText() ), transMeta.environmentSubstitute( wTable.getText() ) ); if ( null != r ) { String[] fieldNames = r.getFieldNames(); if ( null != fieldNames ) { // Version String version = wVersion.getText(); wVersion.setItems( fieldNames ); if ( version != null ) { wVersion.setText( version ); } // from date String fromdate = wFromdate.getText(); wFromdate.setItems( fieldNames ); if ( fromdate != null ) { wFromdate.setText( fromdate ); } // to date String todate = wTodate.getText(); wTodate.setItems( fieldNames ); if ( todate != null ) { wTodate.setText( todate ); } // tk String tk = wTk.getText(); wTk.setItems( fieldNames ); if ( tk != null ) { wTk.setText( tk ); } // AltStartDateField String sd = wAltStartDateField.getText(); wAltStartDateField.setItems( fieldNames ); if ( sd != null ) { wAltStartDateField.setText( sd ); } } } } catch ( Exception e ) { // ignore any errors here. drop downs will not be // filled, but no problem for the user } } } gotTableFields = true; } } /** * Get the fields from the previous step and use them as "keys". Only get the the fields which are not yet in use as * key, or in the field table. Also ignore technical key, version, fromdate, todate. */ private void getKeys() { try { RowMetaInterface r = transMeta.getPrevStepFields( stepname ); if ( r != null && !r.isEmpty() ) { BaseStepDialog.getFieldsFromPrevious( r, wKey, 2, new int[] { 1, 2 }, new int[] { 3 }, -1, -1, new TableItemInsertListener() { public boolean tableItemInserted( TableItem tableItem, ValueMetaInterface v ) { int idx = wKey.indexOfString( v.getName(), 2 ); return idx < 0 && !v.getName().equalsIgnoreCase( wTk.getText() ) && !v.getName().equalsIgnoreCase( wVersion.getText() ) && !v.getName().equalsIgnoreCase( wFromdate.getText() ) && !v.getName().equalsIgnoreCase( wTodate.getText() ); } } ); Table table = wKey.table; for ( int i = 0; i < r.size(); i++ ) { ValueMetaInterface v = r.getValueMeta( i ); int idx = wKey.indexOfString( v.getName(), 2 ); int idy = wUpIns.indexOfString( v.getName(), 2 ); if ( idx < 0 && idy < 0 && !v.getName().equalsIgnoreCase( wTk.getText() ) && !v.getName().equalsIgnoreCase( wVersion.getText() ) && !v.getName().equalsIgnoreCase( wFromdate.getText() ) && !v.getName().equalsIgnoreCase( wTodate.getText() ) ) { TableItem ti = new TableItem( table, SWT.NONE ); ti.setText( 1, v.getName() ); ti.setText( 2, v.getName() ); ti.setText( 3, v.getTypeDesc() ); } } wKey.removeEmptyRows(); wKey.setRowNums(); wKey.optWidth( true ); } } catch ( HopException ke ) { new ErrorDialog( shell, BaseMessages.getString( PKG, "DimensionLookupDialog.FailedToGetFields.DialogTitle" ), BaseMessages.getString( PKG, "DimensionLookupDialog.FailedToGetFields.DialogMessage" ), ke ); } } @Override protected Button createHelpButton( Shell shell, StepMeta stepMeta, PluginInterface plugin ) { return HelpUtils.createHelpButton( helpComp, HelpUtils.getHelpDialogTitle( plugin ), plugin ); } // Generate code for create table... // Conversions done by Database // For Sybase ASE: don't keep everything in lowercase! private void create() { try { DimensionLookupMeta info = new DimensionLookupMeta(); getInfo( info ); String name = stepname; // new name might not yet be linked to other // steps! StepMeta stepinfo = new StepMeta( BaseMessages.getString( PKG, "DimensionLookupDialog.Stepinfo.Title" ), name, info ); RowMetaInterface prev = transMeta.getPrevStepFields( stepname ); String message = null; if ( Utils.isEmpty( info.getKeyField() ) ) { message = BaseMessages.getString( PKG, "DimensionLookupDialog.Error.NoTechnicalKeySpecified" ); } if ( Utils.isEmpty( info.getTableName() ) ) { message = BaseMessages.getString( PKG, "DimensionLookupDialog.Error.NoTableNameSpecified" ); } if ( message == null ) { SQLStatement sql = info.getSQLStatements( transMeta, stepinfo, prev, repository, metaStore ); if ( !sql.hasError() ) { if ( sql.hasSQL() ) { SQLEditor sqledit = new SQLEditor( transMeta, shell, SWT.NONE, info.getDatabaseMeta(), transMeta.getDbCache(), sql .getSQL() ); sqledit.open(); } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_INFORMATION ); mb.setMessage( BaseMessages.getString( PKG, "DimensionLookupDialog.NoSQLNeeds.DialogMessage" ) ); mb.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.NoSQLNeeds.DialogTitle" ) ); mb.open(); } } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( sql.getError() ); mb.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.SQLError.DialogTitle" ) ); mb.open(); } } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( message ); mb.setText( BaseMessages.getString( PKG, "System.Dialog.Error.Title" ) ); mb.open(); } } catch ( HopException ke ) { new ErrorDialog( shell, BaseMessages.getString( PKG, "DimensionLookupDialog.UnableToBuildSQLError.DialogMessage" ), BaseMessages.getString( PKG, "DimensionLookupDialog.UnableToBuildSQLError.DialogTitle" ), ke ); } } private void getSchemaNames() { DatabaseMeta databaseMeta = transMeta.findDatabase( wConnection.getText() ); if ( databaseMeta != null ) { Database database = new Database( loggingObject, databaseMeta ); try { database.connect(); String[] schemas = database.getSchemas(); if ( null != schemas && schemas.length > 0 ) { schemas = Const.sortStrings( schemas ); EnterSelectionDialog dialog = new EnterSelectionDialog( shell, schemas, BaseMessages.getString( PKG, "DimensionLookupDialog.AvailableSchemas.Title", wConnection.getText() ), BaseMessages .getString( PKG, "DimensionLookupDialog.AvailableSchemas.Message", wConnection.getText() ) ); String d = dialog.open(); if ( d != null ) { wSchema.setText( Const.NVL( d, "" ) ); setTableFieldCombo(); } } else { MessageBox mb = new MessageBox( shell, SWT.OK | SWT.ICON_ERROR ); mb.setMessage( BaseMessages.getString( PKG, "DimensionLookupDialog.NoSchema.Error" ) ); mb.setText( BaseMessages.getString( PKG, "DimensionLookupDialog.GetSchemas.Error" ) ); mb.open(); } } catch ( Exception e ) { new ErrorDialog( shell, BaseMessages.getString( PKG, "System.Dialog.Error.Title" ), BaseMessages .getString( PKG, "DimensionLookupDialog.ErrorGettingSchemas" ), e ); } finally { database.disconnect(); } } } }
[ "mattcasters@gmail.com" ]
mattcasters@gmail.com
11cf15cea0ce58ac0bef697974107a27f6148537
fc989dccaeba788c599ee0fc5cd0505dd8908f94
/cci/urlify.java
97614242a7f819ef998aabc1ec3c1b5fec412647
[]
no_license
arthurdamm/algorithms-practice
fec4425b955e70dba0c60ae658efe13098b7ae06
2a4a4c625bdf68b5ce1f24c894640069be8fa29f
refs/heads/master
2022-03-11T13:43:30.061612
2022-03-11T04:20:06
2022-03-11T04:20:06
216,130,117
2
0
null
null
null
null
UTF-8
Java
false
false
1,374
java
/* Cracking the Code Interview 1.3 * checks if str1 is a permutation of str2 */ import java.util.*; public class urlify { public static void main(String[] args) { System.out.println("example: [" + urlifyBrute("Mr John Smith ", 13) + "]"); System.out.println("example: [" + urlifyBrute("Mr John Sm i th ", 15) + "]"); } public static void print(Object arg) { System.out.println(arg); } static String urlifyBrute(String arg, int len) { char[] str = arg.toCharArray(); int spaces = 0; // Count the number of spaces in first pass. for (int i = 0; i < len; i++) if (str[i] == ' ') spaces++; // Now start from the back, shifting everything by spaces * 2 for (int i = len - 1, shift = spaces * 2; i >= 0; i--) { print("Char:" + str[i]); // every time we hit a space... if (str[i] == ' ') { // replace chars (there is enough space made behind us) str[i + shift - 2] = '%'; str[i + shift - 1] = '2'; str[i + shift] = '0'; // reduce shifting shift -= 2; } else // just shift str[i + shift] = str[i]; print(Arrays.toString(str)); } return new String(str); } }
[ "indigoarthur@gmail.com" ]
indigoarthur@gmail.com
fc507b3280045fd8af30990f01835545040e9f93
71d31a10b8569a84cee9bdb426f8fb11e0068114
/src/com/company/Model/Golden.java
480d56f95ed52d4d5d82c82c65afcae477a1caa1
[]
no_license
proton2/generics
135f24bcd6b46094ad6b572f5a093f42ffd5e7ae
eb7cbc524aae89134be767662d4ae1e068d3ce5a
refs/heads/master
2021-05-05T13:36:07.152498
2017-09-28T10:20:28
2017-09-28T10:20:28
105,058,487
0
0
null
null
null
null
UTF-8
Java
false
false
301
java
package com.company.Model; import com.company.Model.Apple; /** * Created by b.yacenko on 27.09.2017. */ public class Golden extends Apple { public Golden() { } public Golden(String aName) { super(aName); } public Golden(String aName, String aSort) { super(aName, aSort); } }
[ "b.yacenko@bftcom.com" ]
b.yacenko@bftcom.com
c78ad18e1056b0eeaa4e674dd05db0496dad1d99
61e2d1fbf4edfac1f8e2bd37608a8fa59b38c858
/src/heritagePackage/Vehicle.java
c58d4ccc33343f33da72a62850ff705b895ab373
[]
no_license
Luiso88/GenericTypes
7d6ff788ae6b8ba43621a7b37c051ce14f576ef4
359fc70ed1194a21a4c8e2fa4c9e1b5141377610
refs/heads/master
2022-04-24T11:59:58.187520
2020-04-26T10:46:54
2020-04-26T10:46:54
255,138,553
0
0
null
null
null
null
UTF-8
Java
false
false
1,223
java
package heritagePackage; public abstract class Vehicle { private int wheels; public Vehicle(int newWheels, String newDriver, String newColour, int newSpeed, double newPositionX) { this.wheels = newWheels; this.driver = newDriver; this.colour = newColour; this.speed = newSpeed; this.positionX = newPositionX; } private double relativeMovement(int time) { return speed * time; } protected int getWheels() { return wheels; } protected double getRelativeMovement(int time) { return relativeMovement(time); } public void setWheels(int wheels) { this.wheels = wheels; } public String getDriver() { return driver; } public void setDriver(String driver) { this.driver = driver; } public String getColour() { return colour; } public void setColour(String colour) { this.colour = colour; } public int getSpeed() { return speed; } public void setSpeed(int speed) { this.speed = speed; } public double getPositionX() { return positionX; } public void setPositionX(double positionX) { this.positionX = positionX; } private String driver; private String colour; protected int speed; protected double positionX; protected abstract void move(int time); }
[ "lcastillo770@gmail.com" ]
lcastillo770@gmail.com
a01633b0997edd3724af78955611d9302d7a99e2
6aab36022e31063b609479bbdbdd7d0817c0cd39
/src/main/java/com/zeal/shiyulin/common/utils/excel/ImportExcel.java
b9d39bd978426321f2cca3967355064159ee653a
[]
no_license
GodLikeZeal/autocode
f7c5a7329da6f613453d86b41561631dd612c5d7
10ecfddb57485219ac0f163031a2a6facfb0b5dd
refs/heads/master
2020-03-13T07:12:35.473189
2018-04-25T15:41:12
2018-04-25T15:41:18
131,020,899
0
0
null
null
null
null
UTF-8
Java
false
false
10,949
java
package com.zeal.shiyulin.common.utils.excel; /** * Copyright &copy; 2012-2014 zealAll rights reserved. */ import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; import java.lang.reflect.Field; import java.lang.reflect.Method; import java.util.Collections; import java.util.Comparator; import java.util.Date; import java.util.List; import com.zeal.shiyulin.common.utils.Reflections; import com.zeal.shiyulin.common.utils.excel.annotation.ExcelField; import org.apache.commons.lang3.StringUtils; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.openxml4j.exceptions.InvalidFormatException; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.DateUtil; import org.apache.poi.ss.usermodel.Row; import org.apache.poi.ss.usermodel.Sheet; import org.apache.poi.ss.usermodel.Workbook; import org.apache.poi.xssf.usermodel.XSSFWorkbook; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.web.multipart.MultipartFile; import com.google.common.collect.Lists; /** * 导入Excel文件(支持“XLS”和“XLSX”格式) * @author zeal * @version 2013-03-10 */ public class ImportExcel { private static Logger log = LoggerFactory.getLogger(ImportExcel.class); /** * 工作薄对象 */ private Workbook wb; /** * 工作表对象 */ private Sheet sheet; /** * 标题行号 */ private int headerNum; /** * 构造函数 * @param path 导入文件,读取第一个工作表 * @param headerNum 标题行号,数据行号=标题行号+1 * @throws InvalidFormatException * @throws IOException */ public ImportExcel(String fileName, int headerNum) throws InvalidFormatException, IOException { this(new File(fileName), headerNum); } /** * 构造函数 * @param path 导入文件对象,读取第一个工作表 * @param headerNum 标题行号,数据行号=标题行号+1 * @throws InvalidFormatException * @throws IOException */ public ImportExcel(File file, int headerNum) throws InvalidFormatException, IOException { this(file, headerNum, 0); } /** * 构造函数 * @param path 导入文件 * @param headerNum 标题行号,数据行号=标题行号+1 * @param sheetIndex 工作表编号 * @throws InvalidFormatException * @throws IOException */ public ImportExcel(String fileName, int headerNum, int sheetIndex) throws InvalidFormatException, IOException { this(new File(fileName), headerNum, sheetIndex); } /** * 构造函数 * @param path 导入文件对象 * @param headerNum 标题行号,数据行号=标题行号+1 * @param sheetIndex 工作表编号 * @throws InvalidFormatException * @throws IOException */ public ImportExcel(File file, int headerNum, int sheetIndex) throws InvalidFormatException, IOException { this(file.getName(), new FileInputStream(file), headerNum, sheetIndex); } /** * 构造函数 * @param file 导入文件对象 * @param headerNum 标题行号,数据行号=标题行号+1 * @param sheetIndex 工作表编号 * @throws InvalidFormatException * @throws IOException */ public ImportExcel(MultipartFile multipartFile, int headerNum, int sheetIndex) throws InvalidFormatException, IOException { this(multipartFile.getOriginalFilename(), multipartFile.getInputStream(), headerNum, sheetIndex); } /** * 构造函数 * @param path 导入文件对象 * @param headerNum 标题行号,数据行号=标题行号+1 * @param sheetIndex 工作表编号 * @throws InvalidFormatException * @throws IOException */ public ImportExcel(String fileName, InputStream is, int headerNum, int sheetIndex) throws InvalidFormatException, IOException { if (StringUtils.isBlank(fileName)){ throw new RuntimeException("导入文档为空!"); }else if(fileName.toLowerCase().endsWith("xls")){ this.wb = new HSSFWorkbook(is); }else if(fileName.toLowerCase().endsWith("xlsx")){ this.wb = new XSSFWorkbook(is); }else{ throw new RuntimeException("文档格式不正确!"); } if (this.wb.getNumberOfSheets()<sheetIndex){ throw new RuntimeException("文档中没有工作表!"); } this.sheet = this.wb.getSheetAt(sheetIndex); this.headerNum = headerNum; log.debug("Initialize success."); } /** * 获取行对象 * @param rownum * @return */ public Row getRow(int rownum){ return this.sheet.getRow(rownum); } /** * 获取数据行号 * @return */ public int getDataRowNum(){ return headerNum+1; } /** * 获取最后一个数据行号 * @return */ public int getLastDataRowNum(){ return this.sheet.getLastRowNum()+headerNum; } /** * 获取最后一个列号 * @return */ public int getLastCellNum(){ return this.getRow(headerNum).getLastCellNum(); } /** * 获取单元格值 * @param row 获取的行 * @param column 获取单元格列号 * @return 单元格值 */ public Object getCellValue(Row row, int column){ Object val = ""; try{ Cell cell = row.getCell(column); if (cell != null){ if (cell.getCellType() == Cell.CELL_TYPE_NUMERIC){ val = cell.getNumericCellValue(); }else if (cell.getCellType() == Cell.CELL_TYPE_STRING){ val = cell.getStringCellValue(); }else if (cell.getCellType() == Cell.CELL_TYPE_FORMULA){ val = cell.getCellFormula(); }else if (cell.getCellType() == Cell.CELL_TYPE_BOOLEAN){ val = cell.getBooleanCellValue(); }else if (cell.getCellType() == Cell.CELL_TYPE_ERROR){ val = cell.getErrorCellValue(); } } }catch (Exception e) { return val; } return val; } /** * 获取导入数据列表 * @param cls 导入对象类型 * @param groups 导入分组 */ public <E> List<E> getDataList(Class<E> cls, int... groups) throws InstantiationException, IllegalAccessException{ List<Object[]> annotationList = Lists.newArrayList(); // Get annotation field Field[] fs = cls.getDeclaredFields(); for (Field f : fs){ ExcelField ef = f.getAnnotation(ExcelField.class); if (ef != null && (ef.type()==0 || ef.type()==2)){ if (groups!=null && groups.length>0){ boolean inGroup = false; for (int g : groups){ if (inGroup){ break; } for (int efg : ef.groups()){ if (g == efg){ inGroup = true; annotationList.add(new Object[]{ef, f}); break; } } } }else{ annotationList.add(new Object[]{ef, f}); } } } // Get annotation method Method[] ms = cls.getDeclaredMethods(); for (Method m : ms){ ExcelField ef = m.getAnnotation(ExcelField.class); if (ef != null && (ef.type()==0 || ef.type()==2)){ if (groups!=null && groups.length>0){ boolean inGroup = false; for (int g : groups){ if (inGroup){ break; } for (int efg : ef.groups()){ if (g == efg){ inGroup = true; annotationList.add(new Object[]{ef, m}); break; } } } }else{ annotationList.add(new Object[]{ef, m}); } } } // Field sorting Collections.sort(annotationList, new Comparator<Object[]>() { public int compare(Object[] o1, Object[] o2) { return new Integer(((ExcelField)o1[0]).sort()).compareTo( new Integer(((ExcelField)o2[0]).sort())); }; }); //log.debug("Import column count:"+annotationList.size()); // Get excel data List<E> dataList = Lists.newArrayList(); for (int i = this.getDataRowNum(); i < this.getLastDataRowNum(); i++) { E e = (E)cls.newInstance(); int column = 0; Row row = this.getRow(i); StringBuilder sb = new StringBuilder(); for (Object[] os : annotationList){ Object val = this.getCellValue(row, column++); if (val != null){ ExcelField ef = (ExcelField)os[0]; // If is dict type, get dict value if (StringUtils.isNotBlank(ef.dictType())){ //val = DictUtils.getDictValue(val.toString(), ef.dictType(), ""); //log.debug("Dictionary type value: ["+i+","+colunm+"] " + val); } // Get param type and type cast Class<?> valType = Class.class; if (os[1] instanceof Field){ valType = ((Field)os[1]).getType(); }else if (os[1] instanceof Method){ Method method = ((Method)os[1]); if ("get".equals(method.getName().substring(0, 3))){ valType = method.getReturnType(); }else if("set".equals(method.getName().substring(0, 3))){ valType = ((Method)os[1]).getParameterTypes()[0]; } } //log.debug("Import value type: ["+i+","+column+"] " + valType); try { if (valType == String.class){ String s = String.valueOf(val.toString()); if(StringUtils.endsWith(s, ".0")){ val = StringUtils.substringBefore(s, ".0"); }else{ val = String.valueOf(val.toString()); } }else if (valType == Integer.class){ val = Double.valueOf(val.toString()).intValue(); }else if (valType == Long.class){ val = Double.valueOf(val.toString()).longValue(); }else if (valType == Double.class){ val = Double.valueOf(val.toString()); }else if (valType == Float.class){ val = Float.valueOf(val.toString()); }else if (valType == Date.class){ val = DateUtil.getJavaDate((Double)val); }else{ if (ef.fieldType() != Class.class){ val = ef.fieldType().getMethod("getValue", String.class).invoke(null, val.toString()); }else{ val = Class.forName(this.getClass().getName().replaceAll(this.getClass().getSimpleName(), "fieldtype."+valType.getSimpleName()+"Type")).getMethod("getValue", String.class).invoke(null, val.toString()); } } } catch (Exception ex) { log.info("Get cell value ["+i+","+column+"] error: " + ex.toString()); val = null; } // set entity value if (os[1] instanceof Field){ Reflections.invokeSetter(e, ((Field)os[1]).getName(), val); }else if (os[1] instanceof Method){ String mthodName = ((Method)os[1]).getName(); if ("get".equals(mthodName.substring(0, 3))){ mthodName = "set"+StringUtils.substringAfter(mthodName, "get"); } Reflections.invokeMethod(e, mthodName, new Class[] {valType}, new Object[] {val}); } } sb.append(val+", "); } dataList.add(e); log.debug("Read success: ["+i+"] "+sb.toString()); } return dataList; } // /** // * 导入测试 // */ // public static void main(String[] args) throws Throwable { // // ImportExcel ei = new ImportExcel("target/export.xlsx", 1); // // for (int i = ei.getDataRowNum(); i < ei.getLastDataRowNum(); i++) { // Row row = ei.getRow(i); // for (int j = 0; j < ei.getLastCellNum(); j++) { // Object val = ei.getCellValue(row, j); // System.out.print(val+", "); // } // System.out.print("\n"); // } // // } }
[ "zhangleifor@163.com" ]
zhangleifor@163.com
47d6381b741e87e76ca031f53e4c688e12121524
44abee7981ec47704f59d0cb9345efc4b909ad4f
/src/chap18/textbook/s180504/PrintStreamExample.java
0e9af22397a89213ceaa69121072ce892a6840b8
[]
no_license
hyojjjin/java20200929
ad24e96c2c3837f695951be783c59418559eceee
8a2d7b34bc814465c83ae0efa0bd59f29205c738
refs/heads/master
2023-03-11T22:56:51.890496
2021-03-02T01:08:15
2021-03-02T01:08:15
299,485,576
0
0
null
null
null
null
UTF-8
Java
false
false
517
java
package chap18.textbook.s180504; import java.io.FileOutputStream; import java.io.PrintStream; public class PrintStreamExample { public static void main(String[] args) throws Exception { FileOutputStream fos = new FileOutputStream("file.txt"); PrintStream ps = new PrintStream(fos); ps.println("[프린터 보조 스트림"); ps.print("마치"); ps.println("프린터가 출력하는 것처럼"); ps.println("데이터를 출력합니다."); ps.flush(); ps.close(); fos.close(); } }
[ "hjjin2_@naver.com" ]
hjjin2_@naver.com
0864e3830298aa73167cc93ab4704405e57f049e
6d5ebe72b9001e67eab8d5082f9ec5760608e27d
/MyFirstProject/src/boris/teams/Week1.java
bf865a144e50f14c7d2d80a572f9a7f1444eec25
[]
no_license
bgoetz22/git-test
3e56b9d29cdad2dc7f3e0425ee3dd0a791d2aaa8
ae5b97e7fdb3aa070bd90e7a7db2de9cb60d01d5
refs/heads/master
2023-08-04T00:04:56.465104
2021-09-24T19:16:19
2021-09-24T19:16:19
408,982,979
0
0
null
null
null
null
UTF-8
Java
false
false
952
java
package boris.teams; public class Week1 { public static void main(String[] args) { // TODO Comment whatever I want int age = 34; String firstName = "Boris"; String lastName = "Goetz"; String wholeName = firstName + " " + lastName; double accountBalance = 23.70; char middleinitial = 'V'; System.out.println("Hello, my name is wholeName"); System.out.println(age); System.out.println("Hello, my name is " + wholeName ); System.out.println("Halo, ich heibe " + firstName +" "+ lastName); System.out.println("I am " + age ); System.out.println(". I am " + age * 8); System.out.println("The definition of love and beauty and wierdness is " + wholeName); System.out.println("Jason takes a bite out of crime and acts like he is " + age/17); System.out.println(accountBalance / 12); System.out.println(firstName +" "+ lastName); System.out.println(firstName +" "+ middleinitial +" "+ lastName); } }
[ "boris.geotz@gmail.com" ]
boris.geotz@gmail.com
179896fb07759d38b637ffa5205207981def2037
dc7bf4e3217f820b6c161cade8184b32f18cb85d
/1.OOP/2.Learn_OOP_In_Java/oop_design/interface_segregation/transaction/CustomerTransaction.java
c98994054caaaced81e051e08d5e5d35de3ce145
[]
no_license
Hopw06/Software_Design
a777802c6668290d7f1ef3cc011e54a311ba678a
27c4095b029408ea40b3224bdbaf4e676b741fb5
refs/heads/master
2023-02-24T13:52:07.330485
2021-01-29T12:21:04
2021-01-29T12:21:04
312,309,692
0
0
null
null
null
null
UTF-8
Java
false
false
1,785
java
package com.company.oop_design.interface_segregation.transaction; import com.company.oop_design.interface_segregation.model.Customer; import com.company.oop_design.interface_segregation.model.Product; import java.util.Date; import java.util.List; /* This principle state that no client should be forced to depend on code that they do not use. Such as here: AccountsReceivable only use prepareInvoice, chargeCustomer methods. => So it should only accept an Accounting instance to perform these methods ReportGenerator only use getName, getDate, productBreakDown methods. => So it should only accept a Reporting instance to perform these methods. A fat class which has many responsibilities Use interface to separate behavior is a good idea. */ public class CustomerTransaction implements Accounting, Reporting { private Customer mCustomer; private List<Product> mProducts; public CustomerTransaction(Customer customer, List<Product> products) { this.mCustomer = customer; this.mProducts = products; } // methods for reporting public String getName() { return mCustomer.getName(); } public Date getDate() { return new Date(); } public String productBreakDown() { String productsReporting = ""; for (Product product : mProducts) { productsReporting += product.getProductId() + " " + product.getProductName() + "\n"; } return productsReporting; } // methods for accounting public void prepareInvoice() { System.out.println("prepare invoice"); } public void chargeCustomer() { System.out.println("change customer"); } }
[ "vuxuanphong06@gmail.com" ]
vuxuanphong06@gmail.com
f19f21986bc627eed48007a639f1645756662499
5e14786bb9d356a7735985bc0adc4acc7b4ecdcf
/src/main/java/com/jeecg/empchangewf/controller/EmpChangeWfController.java
1d7cf7f423a7b8d39c51f79d29962f1ff0753e4d
[]
no_license
zskang/jeecg-humSystem
bc3db30cca3cdcebd30910a8ccc663d86804ae00
a524bedd77dcd551e40a876780f8ebb3a48bdede
refs/heads/master
2020-12-25T15:17:51.864453
2016-09-12T11:49:48
2016-09-12T11:49:48
66,537,154
0
0
null
null
null
null
UTF-8
Java
false
false
14,090
java
package com.jeecg.empchangewf.controller; import com.jeecg.empchangewf.entity.EmpChangeWfEntity; import com.jeecg.empchangewf.service.EmpChangeWfServiceI; import java.util.ArrayList; import java.util.List; import java.text.SimpleDateFormat; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; import org.jeecgframework.core.common.controller.BaseController; import org.jeecgframework.core.common.exception.BusinessException; import org.jeecgframework.core.common.hibernate.qbc.CriteriaQuery; import org.jeecgframework.core.common.model.json.AjaxJson; import org.jeecgframework.core.common.model.json.DataGrid; import org.jeecgframework.core.constant.Globals; import org.jeecgframework.core.util.StringUtil; import org.jeecgframework.tag.core.easyui.TagUtil; import org.jeecgframework.web.system.pojo.base.TSDepart; import org.jeecgframework.web.system.service.SystemService; import org.jeecgframework.core.util.MyBeanUtils; import java.io.OutputStream; import org.jeecgframework.core.util.BrowserUtils; import org.jeecgframework.poi.excel.ExcelExportUtil; import org.jeecgframework.poi.excel.ExcelImportUtil; import org.jeecgframework.poi.excel.entity.ExportParams; import org.jeecgframework.poi.excel.entity.ImportParams; import org.jeecgframework.poi.excel.entity.TemplateExportParams; import org.jeecgframework.poi.excel.entity.vo.NormalExcelConstants; import org.jeecgframework.poi.excel.entity.vo.TemplateExcelConstants; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.jeecgframework.core.util.ResourceUtil; import java.io.IOException; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartHttpServletRequest; import java.util.Map; import org.jeecgframework.core.util.ExceptionUtil; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Controller; import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.bind.annotation.ResponseStatus; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpStatus; import org.jeecgframework.core.beanvalidator.BeanValidators; import java.util.Set; import javax.validation.ConstraintViolation; import javax.validation.Validator; import java.net.URI; import org.springframework.http.MediaType; import org.springframework.web.util.UriComponentsBuilder; /** * @Title: Controller * @Description: 员工异动流程表 * @author onlineGenerator * @date 2016-09-06 17:23:59 * @version V1.0 * */ @Controller @RequestMapping("/empChangeWfController") public class EmpChangeWfController extends BaseController { /** * Logger for this class */ private static final Logger logger = Logger.getLogger(EmpChangeWfController.class); @Autowired private EmpChangeWfServiceI empChangeWfService; @Autowired private SystemService systemService; @Autowired private Validator validator; /** * 员工异动流程表列表 页面跳转 * * @return */ @RequestMapping(params = "list") public ModelAndView list(HttpServletRequest request) { return new ModelAndView("com/jeecg/empchangewf/empChangeWfList"); } /** * easyui AJAX请求数据 * * @param request * @param response * @param dataGrid * @param user */ @RequestMapping(params = "datagrid") public void datagrid(EmpChangeWfEntity empChangeWf,HttpServletRequest request, HttpServletResponse response, DataGrid dataGrid) { CriteriaQuery cq = new CriteriaQuery(EmpChangeWfEntity.class, dataGrid); //查询条件组装器 org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, empChangeWf, request.getParameterMap()); try{ //自定义追加查询条件 }catch (Exception e) { throw new BusinessException(e.getMessage()); } cq.add(); this.empChangeWfService.getDataGridReturn(cq, true); TagUtil.datagrid(response, dataGrid); } /** * 删除员工异动流程表 * * @return */ @RequestMapping(params = "doDel") @ResponseBody public AjaxJson doDel(EmpChangeWfEntity empChangeWf, HttpServletRequest request) { String message = null; AjaxJson j = new AjaxJson(); empChangeWf = systemService.getEntity(EmpChangeWfEntity.class, empChangeWf.getId()); message = "员工异动流程表删除成功"; try{ empChangeWfService.delete(empChangeWf); systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO); }catch(Exception e){ e.printStackTrace(); message = "员工异动流程表删除失败"; throw new BusinessException(e.getMessage()); } j.setMsg(message); return j; } /** * 批量删除员工异动流程表 * * @return */ @RequestMapping(params = "doBatchDel") @ResponseBody public AjaxJson doBatchDel(String ids,HttpServletRequest request){ String message = null; AjaxJson j = new AjaxJson(); message = "员工异动流程表删除成功"; try{ for(String id:ids.split(",")){ EmpChangeWfEntity empChangeWf = systemService.getEntity(EmpChangeWfEntity.class, id ); empChangeWfService.delete(empChangeWf); systemService.addLog(message, Globals.Log_Type_DEL, Globals.Log_Leavel_INFO); } }catch(Exception e){ e.printStackTrace(); message = "员工异动流程表删除失败"; throw new BusinessException(e.getMessage()); } j.setMsg(message); return j; } /** * 添加员工异动流程表 * * @param ids * @return */ @RequestMapping(params = "doAdd") @ResponseBody public AjaxJson doAdd(EmpChangeWfEntity empChangeWf, HttpServletRequest request) { String message = null; AjaxJson j = new AjaxJson(); message = "员工异动流程表添加成功"; try{ empChangeWfService.save(empChangeWf); systemService.addLog(message, Globals.Log_Type_INSERT, Globals.Log_Leavel_INFO); }catch(Exception e){ e.printStackTrace(); message = "员工异动流程表添加失败"; throw new BusinessException(e.getMessage()); } j.setMsg(message); return j; } /** * 更新员工异动流程表 * * @param ids * @return */ @RequestMapping(params = "doUpdate") @ResponseBody public AjaxJson doUpdate(EmpChangeWfEntity empChangeWf, HttpServletRequest request) { String message = null; AjaxJson j = new AjaxJson(); message = "员工异动流程表更新成功"; EmpChangeWfEntity t = empChangeWfService.get(EmpChangeWfEntity.class, empChangeWf.getId()); try { MyBeanUtils.copyBeanNotNull2Bean(empChangeWf, t); empChangeWfService.saveOrUpdate(t); systemService.addLog(message, Globals.Log_Type_UPDATE, Globals.Log_Leavel_INFO); } catch (Exception e) { e.printStackTrace(); message = "员工异动流程表更新失败"; throw new BusinessException(e.getMessage()); } j.setMsg(message); return j; } /** * 员工异动流程表新增页面跳转 * * @return */ @RequestMapping(params = "goAdd") public ModelAndView goAdd(EmpChangeWfEntity empChangeWf, HttpServletRequest req) { if (StringUtil.isNotEmpty(empChangeWf.getId())) { empChangeWf = empChangeWfService.getEntity(EmpChangeWfEntity.class, empChangeWf.getId()); req.setAttribute("empChangeWfPage", empChangeWf); } return new ModelAndView("com/jeecg/empchangewf/empChangeWf-add"); } /** * 员工异动流程表编辑页面跳转 * * @return */ @RequestMapping(params = "goUpdate") public ModelAndView goUpdate(EmpChangeWfEntity empChangeWf, HttpServletRequest req) { if (StringUtil.isNotEmpty(empChangeWf.getId())) { empChangeWf = empChangeWfService.getEntity(EmpChangeWfEntity.class, empChangeWf.getId()); req.setAttribute("empChangeWfPage", empChangeWf); } return new ModelAndView("com/jeecg/empchangewf/empChangeWf-update"); } /** * 导入功能跳转 * * @return */ @RequestMapping(params = "upload") public ModelAndView upload(HttpServletRequest req) { req.setAttribute("controller_name","empChangeWfController"); return new ModelAndView("common/upload/pub_excel_upload"); } /** * 导出excel * * @param request * @param response */ @RequestMapping(params = "exportXls") public String exportXls(EmpChangeWfEntity empChangeWf,HttpServletRequest request,HttpServletResponse response , DataGrid dataGrid,ModelMap modelMap) { CriteriaQuery cq = new CriteriaQuery(EmpChangeWfEntity.class, dataGrid); org.jeecgframework.core.extend.hqlsearch.HqlGenerateUtil.installHql(cq, empChangeWf, request.getParameterMap()); List<EmpChangeWfEntity> empChangeWfs = this.empChangeWfService.getListByCriteriaQuery(cq,false); modelMap.put(NormalExcelConstants.FILE_NAME,"员工异动流程表"); modelMap.put(NormalExcelConstants.CLASS,EmpChangeWfEntity.class); modelMap.put(NormalExcelConstants.PARAMS,new ExportParams("员工异动流程表列表", "导出人:"+ResourceUtil.getSessionUserName().getRealName(), "导出信息")); modelMap.put(NormalExcelConstants.DATA_LIST,empChangeWfs); return NormalExcelConstants.JEECG_EXCEL_VIEW; } /** * 导出excel 使模板 * * @param request * @param response */ @RequestMapping(params = "exportXlsByT") public String exportXlsByT(EmpChangeWfEntity empChangeWf,HttpServletRequest request,HttpServletResponse response , DataGrid dataGrid,ModelMap modelMap) { modelMap.put(NormalExcelConstants.FILE_NAME,"员工异动流程表"); modelMap.put(NormalExcelConstants.CLASS,EmpChangeWfEntity.class); modelMap.put(NormalExcelConstants.PARAMS,new ExportParams("员工异动流程表列表", "导出人:"+ResourceUtil.getSessionUserName().getRealName(), "导出信息")); modelMap.put(NormalExcelConstants.DATA_LIST,new ArrayList()); return NormalExcelConstants.JEECG_EXCEL_VIEW; } @SuppressWarnings("unchecked") @RequestMapping(params = "importExcel", method = RequestMethod.POST) @ResponseBody public AjaxJson importExcel(HttpServletRequest request, HttpServletResponse response) { AjaxJson j = new AjaxJson(); MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; Map<String, MultipartFile> fileMap = multipartRequest.getFileMap(); for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) { MultipartFile file = entity.getValue();// 获取上传文件对象 ImportParams params = new ImportParams(); params.setTitleRows(2); params.setHeadRows(1); params.setNeedSave(true); try { List<EmpChangeWfEntity> listEmpChangeWfEntitys = ExcelImportUtil.importExcel(file.getInputStream(),EmpChangeWfEntity.class,params); for (EmpChangeWfEntity empChangeWf : listEmpChangeWfEntitys) { empChangeWfService.save(empChangeWf); } j.setMsg("文件导入成功!"); } catch (Exception e) { j.setMsg("文件导入失败!"); logger.error(ExceptionUtil.getExceptionMessage(e)); }finally{ try { file.getInputStream().close(); } catch (IOException e) { e.printStackTrace(); } } } return j; } @RequestMapping(method = RequestMethod.GET) @ResponseBody public List<EmpChangeWfEntity> list() { List<EmpChangeWfEntity> listEmpChangeWfs=empChangeWfService.getList(EmpChangeWfEntity.class); return listEmpChangeWfs; } @RequestMapping(value = "/{id}", method = RequestMethod.GET) @ResponseBody public ResponseEntity<?> get(@PathVariable("id") String id) { EmpChangeWfEntity task = empChangeWfService.get(EmpChangeWfEntity.class, id); if (task == null) { return new ResponseEntity(HttpStatus.NOT_FOUND); } return new ResponseEntity(task, HttpStatus.OK); } @RequestMapping(method = RequestMethod.POST, consumes = MediaType.APPLICATION_JSON_VALUE) @ResponseBody public ResponseEntity<?> create(@RequestBody EmpChangeWfEntity empChangeWf, UriComponentsBuilder uriBuilder) { //调用JSR303 Bean Validator进行校验,如果出错返回含400错误码及json格式的错误信息. Set<ConstraintViolation<EmpChangeWfEntity>> failures = validator.validate(empChangeWf); if (!failures.isEmpty()) { return new ResponseEntity(BeanValidators.extractPropertyAndMessage(failures), HttpStatus.BAD_REQUEST); } //保存 empChangeWfService.save(empChangeWf); //按照Restful风格约定,创建指向新任务的url, 也可以直接返回id或对象. String id = empChangeWf.getId(); URI uri = uriBuilder.path("/rest/empChangeWfController/" + id).build().toUri(); HttpHeaders headers = new HttpHeaders(); headers.setLocation(uri); return new ResponseEntity(headers, HttpStatus.CREATED); } @RequestMapping(value = "/{id}", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE) public ResponseEntity<?> update(@RequestBody EmpChangeWfEntity empChangeWf) { //调用JSR303 Bean Validator进行校验,如果出错返回含400错误码及json格式的错误信息. Set<ConstraintViolation<EmpChangeWfEntity>> failures = validator.validate(empChangeWf); if (!failures.isEmpty()) { return new ResponseEntity(BeanValidators.extractPropertyAndMessage(failures), HttpStatus.BAD_REQUEST); } //保存 empChangeWfService.saveOrUpdate(empChangeWf); //按Restful约定,返回204状态码, 无内容. 也可以返回200状态码. return new ResponseEntity(HttpStatus.NO_CONTENT); } @RequestMapping(value = "/{id}", method = RequestMethod.DELETE) @ResponseStatus(HttpStatus.NO_CONTENT) public void delete(@PathVariable("id") String id) { empChangeWfService.deleteEntityById(EmpChangeWfEntity.class, id); } }
[ "253479240@qq.com" ]
253479240@qq.com
c566c6a0ffbc27e29e78719e5ef30ade20f7e861
4a9283ac8e992d9db217822e025262f9be4a1b46
/core/src/com/averyduffin/spaceexplorer/box2d/UserData.java
deb21ec859f460c69695b459ee8e03530cff47cb
[]
no_license
averyduffin/SpaceExplorer
97e1fdbc8bc511f5117648ac5b524ffd629af93e
e90c75770f076c235cfc33d33ecdaebc79bc073f
refs/heads/master
2020-05-25T09:29:48.316104
2015-04-17T05:55:43
2015-04-17T05:55:43
33,576,507
0
0
null
null
null
null
UTF-8
Java
false
false
741
java
package com.averyduffin.spaceexplorer.box2d; import com.averyduffin.spaceexplorer.enums.UserDataType; public abstract class UserData { protected UserDataType userDataType; protected float width; protected float height; public UserData(){ } public UserData(float width, float height) { this.width = width; this.height = height; } public UserDataType getUserDataType(){ return userDataType; } public float getWidth() { return width; } public void setWidth(float width) { this.width = width; } public float getHeight() { return height; } public void setHeight(float height) { this.height = height; } }
[ "averyduffin@gmail.com" ]
averyduffin@gmail.com
a0d213837b5894f7458b9741735b51150c2e7032
6aca25c0e9152b7d4f37d4ac2474dd4c222007b3
/app/src/main/java/com/isaacsmobiledevelopment/lehmanit17/budgetapplication/DataBackend.java
ba7f2cf763c67bcbab41c4289c285a782ad4b7d5
[]
no_license
IsaacLehman/BudgetApplication
aee352bcdb762f5af0e8ad3bcf5a7d60a1c4860f
faec5aae8c342755e92b1a1cf8cbc996a51e42d3
refs/heads/master
2020-09-12T20:21:17.442720
2019-11-18T20:51:09
2019-11-18T20:51:09
222,542,092
0
0
null
null
null
null
UTF-8
Java
false
false
1,417
java
package com.isaacsmobiledevelopment.lehmanit17.budgetapplication; import android.content.Context; import java.io.IOException; import java.util.ArrayList; /** * Gets all the file data on open and writes all the file data upon close * @author LEHMANIT17 * */ public class DataBackend extends ExpenceOperations{ CSVfile csvFile; budgetFile budgetKeyFile; budgetFile userBudgetFile; public DataBackend(String csvFileName, String budgetKeyFileName, String userBudgetFileName, Context context) { csvFile = new CSVfile(csvFileName, ";", context); budgetKeyFile = new budgetFile(budgetKeyFileName, ";", ",", context); userBudgetFile = new budgetFile(userBudgetFileName, ";", ",", context); } public void resetUserBudgetFile() throws IOException{ userBudgetFile.fileTools.clearFile(); ArrayList<BudgetCategory> budgetKeys = budgetKeyFile.getbudgetDataFromFile(); userBudgetFile.writebudgetDataToFile(budgetKeys); } public void writeBudget(ArrayList<BudgetCategory> budget) throws IOException { userBudgetFile.writebudgetDataToFile(budget); } public ArrayList<BudgetCategory> getBudget() throws IOException { return userBudgetFile.getbudgetDataFromFile(); } public void writeExpences(ArrayList<Expence> expences) throws IOException { csvFile.appendExpences(expences); } public ArrayList<Expence> getExpences() throws IOException{ return csvFile.getCSVDataFromFile(); } }
[ "Pizza123#" ]
Pizza123#
9287135457670cda08ce77127249d59495de3063
7fe40170bdb9620f51887ec52df2430defd94345
/src/main/java/com/ultracart/admin/v2/models/GiftCertificatesResponse.java
5669bd24b94efa955ff42e3293a9c85771f6e3ab
[ "Apache-2.0" ]
permissive
UltraCart/rest_api_v2_sdk_java
15878b91beef97843f2938f3048a7010e7328127
bfecb94bb931dfe190d98663d8b1593c6f9dfabb
refs/heads/master
2023-02-08T13:38:03.769682
2023-01-31T20:48:35
2023-01-31T20:48:35
67,046,576
0
2
Apache-2.0
2022-06-23T01:46:12
2016-08-31T14:48:01
Java
UTF-8
Java
false
false
5,352
java
/* * UltraCart Rest API V2 * UltraCart REST API Version 2 * * OpenAPI spec version: 2.0.0 * Contact: support@ultracart.com * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ package com.ultracart.admin.v2.models; import java.util.Objects; import java.util.Arrays; import com.google.gson.TypeAdapter; import com.google.gson.annotations.JsonAdapter; import com.google.gson.annotations.SerializedName; import com.google.gson.stream.JsonReader; import com.google.gson.stream.JsonWriter; import com.ultracart.admin.v2.models.Error; import com.ultracart.admin.v2.models.GiftCertificate; import com.ultracart.admin.v2.models.ResponseMetadata; import com.ultracart.admin.v2.models.Warning; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import java.io.IOException; import java.util.ArrayList; import java.util.List; /** * GiftCertificatesResponse */ @javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2023-01-31T15:48:16.171-05:00") public class GiftCertificatesResponse { @SerializedName("error") private Error error = null; @SerializedName("gift_certificates") private List<GiftCertificate> giftCertificates = null; @SerializedName("metadata") private ResponseMetadata metadata = null; @SerializedName("success") private Boolean success = null; @SerializedName("warning") private Warning warning = null; public GiftCertificatesResponse error(Error error) { this.error = error; return this; } /** * Get error * @return error **/ @ApiModelProperty(value = "") public Error getError() { return error; } public void setError(Error error) { this.error = error; } public GiftCertificatesResponse giftCertificates(List<GiftCertificate> giftCertificates) { this.giftCertificates = giftCertificates; return this; } public GiftCertificatesResponse addGiftCertificatesItem(GiftCertificate giftCertificatesItem) { if (this.giftCertificates == null) { this.giftCertificates = new ArrayList<GiftCertificate>(); } this.giftCertificates.add(giftCertificatesItem); return this; } /** * Get giftCertificates * @return giftCertificates **/ @ApiModelProperty(value = "") public List<GiftCertificate> getGiftCertificates() { return giftCertificates; } public void setGiftCertificates(List<GiftCertificate> giftCertificates) { this.giftCertificates = giftCertificates; } public GiftCertificatesResponse metadata(ResponseMetadata metadata) { this.metadata = metadata; return this; } /** * Get metadata * @return metadata **/ @ApiModelProperty(value = "") public ResponseMetadata getMetadata() { return metadata; } public void setMetadata(ResponseMetadata metadata) { this.metadata = metadata; } public GiftCertificatesResponse success(Boolean success) { this.success = success; return this; } /** * Indicates if API call was successful * @return success **/ @ApiModelProperty(value = "Indicates if API call was successful") public Boolean isSuccess() { return success; } public void setSuccess(Boolean success) { this.success = success; } public GiftCertificatesResponse warning(Warning warning) { this.warning = warning; return this; } /** * Get warning * @return warning **/ @ApiModelProperty(value = "") public Warning getWarning() { return warning; } public void setWarning(Warning warning) { this.warning = warning; } @Override public boolean equals(java.lang.Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } GiftCertificatesResponse giftCertificatesResponse = (GiftCertificatesResponse) o; return Objects.equals(this.error, giftCertificatesResponse.error) && Objects.equals(this.giftCertificates, giftCertificatesResponse.giftCertificates) && Objects.equals(this.metadata, giftCertificatesResponse.metadata) && Objects.equals(this.success, giftCertificatesResponse.success) && Objects.equals(this.warning, giftCertificatesResponse.warning); } @Override public int hashCode() { return Objects.hash(error, giftCertificates, metadata, success, warning); } @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class GiftCertificatesResponse {\n"); sb.append(" error: ").append(toIndentedString(error)).append("\n"); sb.append(" giftCertificates: ").append(toIndentedString(giftCertificates)).append("\n"); sb.append(" metadata: ").append(toIndentedString(metadata)).append("\n"); sb.append(" success: ").append(toIndentedString(success)).append("\n"); sb.append(" warning: ").append(toIndentedString(warning)).append("\n"); sb.append("}"); return sb.toString(); } /** * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ private String toIndentedString(java.lang.Object o) { if (o == null) { return "null"; } return o.toString().replace("\n", "\n "); } }
[ "perry@ultracart.com" ]
perry@ultracart.com
f72eebea885e402568d656f1d569da1e750f93ce
d2df2e68ee1d0bb84243add5dcfd8920fb790333
/modules/distribution-service-aws-s3/src/main/java/org/opencastproject/distribution/aws/s3/PresignedUrlMediaPackageSerializer.java
f2de22bd49804f56a42cdc9ebea006693723149b
[ "LicenseRef-scancode-free-unknown", "ECL-2.0", "LicenseRef-scancode-unknown-license-reference", "Apache-2.0", "LicenseRef-scancode-unknown" ]
permissive
rfharokh/Opencast
ec5603939759c9cc05acb4bd82b378761b9652b8
971702a4bbfafda9dfa1aeb0d3723b878bb693b7
refs/heads/develop
2021-06-18T14:43:21.193592
2021-01-26T08:17:30
2021-01-26T08:17:30
166,364,821
1
1
ECL-2.0
2019-03-01T08:26:15
2019-01-18T07:40:53
Java
UTF-8
Java
false
false
2,725
java
/** * Licensed to The Apereo Foundation under one or more contributor license * agreements. See the NOTICE file distributed with this work for additional * information regarding copyright ownership. * * * The Apereo Foundation licenses this file to you under the Educational * Community 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://opensource.org/licenses/ecl2.txt * * 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.opencastproject.distribution.aws.s3; import org.opencastproject.distribution.aws.s3.api.AwsS3DistributionService; import org.opencastproject.mediapackage.MediaPackageSerializer; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import java.net.URI; import java.net.URISyntaxException; /** * Implementation of a {@link MediaPackageSerializer} that will support presigned URL feature for a Mediapackage */ public class PresignedUrlMediaPackageSerializer implements MediaPackageSerializer { private static final Logger logger = LoggerFactory.getLogger(PresignedUrlMediaPackageSerializer.class); public static final int RANKING = 10; /** S3 distribution service used for generate presigned URL */ private AwsS3DistributionService service; public PresignedUrlMediaPackageSerializer() { logger.info("Init PresignedUrlMediaPackageSerializer"); } public void setService(AwsS3DistributionService service) { this.service = service; } /** * {@inheritDoc} * * Generate a presigned URI for the given URI if AwsS3DistributionService is enabled. */ @Override public URI decodeURI(URI uri) throws URISyntaxException { URI presignedURI = null; if (service instanceof AwsS3DistributionServiceImpl) { presignedURI = ((AwsS3DistributionServiceImpl)service).presignedURI(uri); } logger.debug("Decode in presigned URL serializer: {} -> {}", uri, presignedURI); return presignedURI; } /** * {@inheritDoc} */ @Override public URI encodeURI(URI uri) throws URISyntaxException { URI encodedUri = null; logger.debug("Encode in presigned URL serializer: {} -> {}", uri, encodedUri); return uri; } /** * {@inheritDoc} */ @Override public int getRanking() { return RANKING; } }
[ "gaojun@fudan.edu.cn" ]
gaojun@fudan.edu.cn
e0c2ea29162f20b4322fcfe9b0281816eed6512c
0d157968ecd484d880d26d9c52f47755548f1680
/src/main/java/com/ifuture/adonline/web/rest/errors/ErrorConstants.java
ee3df41fe862515d65ac59b1021808486d536794
[]
no_license
yongchongwu/adonline
43a7cc1015ecf194ed4049f0d562ef3e1d3ccbd9
7ac8fbf6b12d01778894ee1cc8f06b3422bc9eae
refs/heads/master
2021-05-08T17:37:28.962803
2018-01-30T03:56:16
2018-01-30T03:56:16
103,366,712
0
0
null
null
null
null
UTF-8
Java
false
false
525
java
package com.ifuture.adonline.web.rest.errors; public final class ErrorConstants { public static final String ERR_CONCURRENCY_FAILURE = "error.concurrencyFailure"; public static final String ERR_ACCESS_DENIED = "error.accessDenied"; public static final String ERR_VALIDATION = "error.validation"; public static final String ERR_METHOD_NOT_SUPPORTED = "error.methodNotSupported"; public static final String ERR_INTERNAL_SERVER_ERROR = "error.internalServerError"; private ErrorConstants() { } }
[ "yongchongwu@126.com" ]
yongchongwu@126.com
f3f1a07c04cb8919b233576d11618eb841c2cfc6
235829b735c56b1bdc80769b11e7f34929853151
/src/br/common/utils/XmlResponse.java
b4d629b0cdcf019bf46a2bdcea4acb86b1a73b81
[]
no_license
gwenu/BookRegister
6809db9c626b3ae1f2ce83c7ac820b9b2d7c4da7
48712b7866c40b1867de15564774792b52c90f2f
refs/heads/master
2021-01-02T08:34:25.706527
2015-04-21T19:50:14
2015-04-21T19:50:14
22,175,044
0
0
null
null
null
null
UTF-8
Java
false
false
288
java
package br.common.utils; import java.io.OutputStream; public class XmlResponse<T> { public String xmlToString(T obj) { OutputStream os = new XmlWriter<T>(obj).writeToXml(); String responseXml = StreamUtil.convertStreamToString(os); return responseXml; } }
[ "poluektova.ol@gmail.com" ]
poluektova.ol@gmail.com
b281e908aa0aa17d95041b77991f9c95bf23a498
db83fd79662bb15f7c89e2e2589cf2881a2faa8f
/src/wget/WgetTest.java
eda739c465c8772d13270e50569cd8fca229dd71
[]
no_license
liuwm/wget
f885e1f4788acf8d09932a735267d84ee67f55a7
e1e69b9c50a22a65ae780bd8af0fdf1e23d420c5
refs/heads/master
2021-01-10T08:12:33.932910
2015-05-21T05:42:52
2015-05-21T05:42:52
35,993,392
0
0
null
null
null
null
UTF-8
Java
false
false
929
java
package wget; import java.util.Arrays; import java.util.Collection; import org.junit.Assert; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; import org.junit.runners.Parameterized.Parameters; @RunWith(Parameterized.class) public class WgetTest { private String input; private boolean expected; public WgetTest(String input,boolean expected){ this.input = input; this.expected = expected; } @Parameters @SuppressWarnings("unchecked") public static Collection prepareData(){ Object[][] object = {{"",false},{"http://www.baidu.com",true},{"www.baidu.com",false},{"http://",false},{"http://dow3.pc6.com/gm/EditPlus3_ha.zip",true}}; return Arrays.asList(object); } @Test public void testSaveFile() { Wget wget = new Wget(); boolean result = wget.saveFile(input); Assert.assertEquals(expected, result); } }
[ "John@192.168.7.201" ]
John@192.168.7.201
147b99043d36a0ace8b53b3a4c3a4082e146ebe0
319324796ca587e78cc96de7e039630300ef9f0e
/codeforces/StoneOnTheTable.java
38786a534751325e953a22fa167b6cc938c856f7
[]
no_license
RhythmAgg/java-Problems
1bc96c78a5f6b1e6e0e8ba5d26884113bbb91f7e
ae7529ae25d542f6c2ea8f444eb8a160cc77e8ba
refs/heads/master
2023-09-03T09:10:50.624371
2021-11-22T12:29:41
2021-11-22T12:29:41
430,695,421
0
0
null
null
null
null
UTF-8
Java
false
false
436
java
package codeforces; import java.util.Scanner; public class StoneOnTheTable { public static void main(String[] args) { Scanner sc=new Scanner(System.in); sc.nextLine(); String s=sc.nextLine(); sc.close(); int count=0; for(int i=0;i<s.length()-1;i++){ if(s.charAt(i)==s.charAt(i+1)){ count++; } } System.out.print(count); } }
[ "aggarwalrhythm2211@gmail.com" ]
aggarwalrhythm2211@gmail.com
d7db963a7cf597586fc161229241210d21063a1a
e5e439c4faa2b3981926a7c66a3a009483161443
/src/main/java/cn/choleece/rpc/demo/provider/ServerBootStrap.java
fd3d8d73f8fcb8f08c1e632a931ca6fbafd363cf
[]
no_license
choleece/rpc-demo
1e81485253513b7df4bb4bc90e6e193a75ba331c
6193a5f16a0c3d7a1f187fc730ff360ec4bbafe0
refs/heads/master
2020-04-24T23:39:42.017133
2019-02-24T15:06:09
2019-02-24T15:06:09
172,352,013
0
0
null
null
null
null
UTF-8
Java
false
false
269
java
package cn.choleece.rpc.demo.provider; import cn.choleece.rpc.demo.netty.NettyServer; /** * Created by choleece on 2019/2/22. */ public class ServerBootStrap { public static void main(String[] args) { NettyServer.startServer("localhost", 8088); } }
[ "choleece@163.com" ]
choleece@163.com
6d3182711e78476ddd7c9232dfcecac2194a3ca8
4a866cb2b9830ccfec0e3ff191b91ecff3bc52d9
/src/Bar/Business/LoginController.java
60ae81c0f7d570781890a001d04ee3b1a7e413b0
[]
no_license
juliocos/exercicio-bar
9c6664bd5c19d892ad9e0931013b79a8a52490b3
1e11183a1f319b7c07fe23988c055ebfaaa15c02
refs/heads/master
2020-03-09T13:06:35.124634
2018-04-09T16:33:35
2018-04-09T16:33:35
128,802,099
0
0
null
null
null
null
UTF-8
Java
false
false
1,297
java
package Bar.Business; import Bar.Main; import Bar.Persistence.Customer; import Bar.Persistence.Member; import javafx.event.ActionEvent; import javafx.fxml.FXML; import javafx.scene.control.Button; import javafx.scene.control.RadioButton; import javafx.scene.control.TextField; import javafx.scene.control.ToggleGroup; public class LoginController { @FXML private TextField cpf; @FXML private TextField name; @FXML private TextField age; @FXML private TextField memberId; @FXML private ToggleGroup gender; @FXML private RadioButton male; @FXML private RadioButton female; @FXML private Button checkin; public void checkin(ActionEvent event) { char genderSelected = male.isSelected() ? 'M' : 'F'; if(memberId.getText().length() > 0 && !memberId.getText().isEmpty()) { Member m = new Member(cpf.getText(), name.getText(), Integer.parseInt(age.getText()), genderSelected, Integer.parseInt(memberId.getText())); Main.bar.addCustomer(m); } else { Customer c = new Customer(cpf.getText(), name.getText(), Integer.parseInt(age.getText()), genderSelected); Main.bar.addCustomer(c); } System.out.println(Main.bar.getCustomers()); } }
[ "juliosantos@juliocesar@systemhaus.com.br" ]
juliosantos@juliocesar@systemhaus.com.br
ef2affaae2192937d92c1aa03a5103ecaaf4fc82
84e156edb40800866b625d3541119e970acad1e1
/bitcamp-java-application4-server/src/main/java/com/eomcs/lms/service/BoardService.java
c142c61abb914bb549d799137927f6302242897b
[]
no_license
Hecklebot/bitcamp-java-20190527
c063803b02015ca0a45ef590b3d5ca1c25201285
c22f695c788ab8da21f7148aa09ec477c57b2a50
refs/heads/master
2020-06-13T20:15:46.420583
2019-10-21T08:12:55
2019-10-21T08:12:55
194,775,337
2
0
null
2020-04-30T11:58:11
2019-07-02T02:41:01
Java
UTF-8
Java
false
false
462
java
package com.eomcs.lms.service; import java.util.List; import com.eomcs.lms.domain.Board; // 역할: // => 게시물 관리 업무를 수행 // => 트랜잭션 제어 // => 여러 페이지 컨트롤러가 사용한다. public interface BoardService { List<Board> list() throws Exception; Board get(int no) throws Exception; void insert(Board board) throws Exception; void update(Board board) throws Exception; void delete(int no) throws Exception; }
[ "iuehakdrk@gmail.com" ]
iuehakdrk@gmail.com
b706f8458b6feb1d1e3c2f6f84e500d564eabcca
3c82999aab38b057ac137e5c1980f139150c9665
/src/main/java/com/dognessnetwork/customer/dto/User.java
d7013c4f360b077f6f96716788ffa3524a8f28c0
[]
no_license
XiaoXiongPotter/customer
1285bdb6a8644b0e4bd392b16f5902007541688b
4243919af1941917493fefab3a8a8d9f1ade2281
refs/heads/master
2020-03-29T18:10:26.154234
2018-08-24T09:55:13
2018-08-24T09:55:13
150,197,890
0
0
null
null
null
null
UTF-8
Java
false
false
2,428
java
package com.dognessnetwork.customer.dto; import java.util.Collection; import java.util.Set; import org.springframework.roo.addon.dto.annotations.RooDTO; import org.springframework.roo.addon.javabean.annotations.RooJavaBean; import org.springframework.security.core.GrantedAuthority; import com.fasterxml.jackson.annotation.JsonIgnore; @RooDTO @RooJavaBean public class User extends org.springframework.security.core.userdetails.User{ /** * */ private static final long serialVersionUID = 500L; public User(String username, String password, Collection<? extends GrantedAuthority> authorities) { super(username, password, true, true, true, true, authorities); } public User(String username, String password, boolean enabled, boolean accountNonExpired, boolean credentialsNonExpired, boolean accountNonLocked, Collection<? extends GrantedAuthority> authorities) { super(username, password, enabled, accountNonExpired, credentialsNonExpired, accountNonLocked, authorities); } @JsonIgnore @Override public Collection<GrantedAuthority> getAuthorities() { return super.getAuthorities(); } @JsonIgnore @Override public boolean isAccountNonExpired() { return super.isAccountNonExpired(); } @JsonIgnore @Override public boolean isAccountNonLocked() { return super.isAccountNonLocked(); } @JsonIgnore @Override public boolean isCredentialsNonExpired() { return super.isCredentialsNonExpired(); } private long id; private String name; private String mobile; private String email; private Integer status; private String creatTime; public long getId() { return id; } public void setId(long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getMobile() { return mobile; } public void setMobile(String mobile) { this.mobile = mobile; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public Integer getStatus() { return status; } public void setStatus(Integer status) { this.status = status; } public String getCreatTime() { return creatTime; } public void setCreatTime(String creatTime) { this.creatTime = creatTime; } }
[ "Dogness@DESKTOP-AIKF84U" ]
Dogness@DESKTOP-AIKF84U
04b9292fd00f84a79864380b72d9473d24a69890
8e43aec43bfb980868f9dd12b253b0ea144c7e88
/src/DataStructures/JavaList.java
a7bc82fabe927a1227f7b3a6fcaa410567acb41c
[]
no_license
daniloJava/Puzzle-Hackerrank
e68db3e3341d5eb7f366bbeb96b04c21109f8861
f6ea13386284f6d4cc26ffc398cc2428661d47c5
refs/heads/master
2021-01-20T20:08:51.305229
2019-04-03T03:04:57
2019-04-03T03:04:57
63,831,827
1
0
null
null
null
null
UTF-8
Java
false
false
709
java
package DataStructures; import java.util.ArrayList; import java.util.List; import java.util.Scanner; public class JavaList { public static void main(String[] args) { Scanner in = new Scanner(System.in); int size = in.nextInt(); List<Integer> numbers = new ArrayList<>(); for (int i = 0; i < size; i++) { numbers.add(in.nextInt()); } int numberQueries = in.nextInt(); for (int i = 0; i < numberQueries; i++) { if ("Insert".equalsIgnoreCase(in.next())) { int index = in.nextInt(); int element = in.nextInt(); numbers.add(index, element); } else { int index = in.nextInt(); numbers.remove(index); } } numbers.forEach(n -> System.out.print(n + " ")); } }
[ "dmanoel@magnasistemas.com.br" ]
dmanoel@magnasistemas.com.br
4ac73733ffdb153f70e976aafb2f9a0b0d56cd79
5e1313cfd708eb29e5baae1d21b9b3c737d33f23
/camera/src/com/commonsware/cwac/camera/ImageCleanupTask.java
26f28f1cb33ba426f2c6205f37a29e453dd759a7
[ "Apache-2.0" ]
permissive
nilsymbol/cwac-camera
dc725c65606c98ce6b211b7e517f5ff6b4d906f2
9e61fd085e55830b52abdc26ad2ab156be1dbdc1
refs/heads/master
2021-05-29T06:42:29.218456
2014-02-08T22:11:02
2014-02-08T22:11:02
null
0
0
null
null
null
null
UTF-8
Java
false
false
5,914
java
/*** Copyright (c) 2013-2014 CommonsWare, LLC 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.commonsware.cwac.camera; import android.annotation.TargetApi; import android.app.ActivityManager; import android.content.Context; import android.content.pm.ApplicationInfo; import android.graphics.Bitmap; import android.graphics.BitmapFactory; import android.graphics.Matrix; import android.hardware.Camera; import android.os.Build; import android.util.Log; import java.io.ByteArrayOutputStream; import java.io.IOException; import com.android.mms.exif.ExifInterface; public class ImageCleanupTask extends Thread { private byte[] data; private int cameraId; private PictureTransaction xact=null; private boolean applyMatrix=true; ImageCleanupTask(Context ctxt, byte[] data, int cameraId, PictureTransaction xact) { this.data=data; this.cameraId=cameraId; this.xact=xact; float heapPct=(float)data.length / calculateHeapSize(ctxt); applyMatrix=(heapPct < xact.host.maxPictureCleanupHeapUsage()); } @Override public void run() { Camera.CameraInfo info=new Camera.CameraInfo(); Camera.getCameraInfo(cameraId, info); Matrix matrix=null; Bitmap cleaned=null; ExifInterface exif=null; if (applyMatrix) { if (info.facing == Camera.CameraInfo.CAMERA_FACING_FRONT) { if (xact.host.getDeviceProfile().portraitFFCFlipped() && (xact.displayOrientation == 90 || xact.displayOrientation == 270)) { matrix=flip(new Matrix()); } else if (xact.mirrorFFC()) { matrix=mirror(new Matrix()); } } try { int imageOrientation=0; if (xact.host.getDeviceProfile().useDeviceOrientation()) { imageOrientation=xact.displayOrientation; } else { exif=new ExifInterface(); exif.readExif(data); int exifOrientation= exif.getTagIntValue(ExifInterface.TAG_ORIENTATION); if (exifOrientation == 6) { imageOrientation=90; } else if (exifOrientation == 8) { imageOrientation=270; } else if (exifOrientation == 3) { imageOrientation=180; } else if (exifOrientation == 1) { imageOrientation=0; } else { // imageOrientation= // xact.host.getDeviceProfile().getDefaultOrientation(); // // if (imageOrientation == -1) { // imageOrientation=xact.displayOrientation; // } } } if (imageOrientation != 0) { matrix= rotate((matrix == null ? new Matrix() : matrix), imageOrientation); } } catch (IOException e) { Log.e("CWAC-Camera", "Exception parsing JPEG", e); // TODO: ripple to client } if (matrix != null) { Bitmap original= BitmapFactory.decodeByteArray(data, 0, data.length); cleaned= Bitmap.createBitmap(original, 0, 0, original.getWidth(), original.getHeight(), matrix, true); original.recycle(); } } if (xact.needBitmap) { if (cleaned == null) { cleaned=BitmapFactory.decodeByteArray(data, 0, data.length); } xact.host.saveImage(xact, cleaned); } if (xact.needByteArray) { if (matrix != null) { ByteArrayOutputStream out=new ByteArrayOutputStream(); // if (exif == null) { cleaned.compress(Bitmap.CompressFormat.JPEG, 100, out); // } // else { // exif.deleteTag(ExifInterface.TAG_ORIENTATION); // // try { // exif.writeExif(cleaned, out); // } // catch (IOException e) { // Log.e("CWAC-Camera", "Exception writing to JPEG", e); // // TODO: ripple to client // } // } data=out.toByteArray(); try { out.close(); } catch (IOException e) { Log.e(CameraView.TAG, "Exception in closing a BAOS???", e); } } xact.host.saveImage(xact, data); } System.gc(); } // from http://stackoverflow.com/a/8347956/115145 private Matrix mirror(Matrix input) { float[] mirrorY= { -1, 0, 0, 0, 1, 0, 0, 0, 1 }; Matrix matrixMirrorY=new Matrix(); matrixMirrorY.setValues(mirrorY); input.postConcat(matrixMirrorY); return(input); } private Matrix flip(Matrix input) { float[] mirrorY= { -1, 0, 0, 0, 1, 0, 0, 0, 1 }; Matrix matrixMirrorY=new Matrix(); matrixMirrorY.setValues(mirrorY); input.preScale(1.0f, -1.0f); input.postConcat(matrixMirrorY); return(input); } private Matrix rotate(Matrix input, int degree) { input.setRotate(degree); return(input); } @TargetApi(Build.VERSION_CODES.HONEYCOMB) private static int calculateHeapSize(Context ctxt) { ActivityManager am= (ActivityManager)ctxt.getSystemService(Context.ACTIVITY_SERVICE); int memoryClass=am.getMemoryClass(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) { if ((ctxt.getApplicationInfo().flags & ApplicationInfo.FLAG_LARGE_HEAP) != 0) { memoryClass=am.getLargeMemoryClass(); } } return(memoryClass * 1048576); // MB * bytes in MB } }
[ "mmurphy@commonsware.com" ]
mmurphy@commonsware.com
42ff5ff4311bc41c280109d14811a0c31ea86e9e
3f037bcaf39ac6e07dcf67e613695e2bb4629978
/spring-security-oauth/src/main/java/com/springsecurityoauth/entities/Role.java
1ebff30d467682f5073f0ad5fc123f68262af7ee
[]
no_license
poojapathak0001/microservice
ff6dc4cabcafdaff191b81ad7a5851c22ec73fc0
37691a1b7991f18cae5a4f934821cb25d6119a0d
refs/heads/master
2021-04-12T08:57:21.903351
2018-03-27T02:18:00
2018-03-27T02:18:00
126,841,714
0
0
null
null
null
null
UTF-8
Java
false
false
453
java
package com.springsecurityoauth.entities; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; @Entity public class Role { @Id @GeneratedValue private Long id; String name; Role() {} public Role(String name) { this.name = name; } public String getName() { return name; } public void setName(String name) { this.name = name; } }
[ "poojapathak0001@gmail.com" ]
poojapathak0001@gmail.com
e95d58883ce7c1da91bcdbb55116b6cd86655a47
bf2966abae57885c29e70852243a22abc8ba8eb0
/aws-java-sdk-lightsail/src/main/java/com/amazonaws/services/lightsail/model/transform/CreateContactMethodRequestMarshaller.java
b931d747ef511f580e43a4c479445696e488ea37
[ "Apache-2.0" ]
permissive
kmbotts/aws-sdk-java
ae20b3244131d52b9687eb026b9c620da8b49935
388f6427e00fb1c2f211abda5bad3a75d29eef62
refs/heads/master
2021-12-23T14:39:26.369661
2021-07-26T20:09:07
2021-07-26T20:09:07
246,296,939
0
0
Apache-2.0
2020-03-10T12:37:34
2020-03-10T12:37:33
null
UTF-8
Java
false
false
2,398
java
/* * Copyright 2016-2021 Amazon.com, Inc. or its affiliates. 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. A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file 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.amazonaws.services.lightsail.model.transform; import javax.annotation.Generated; import com.amazonaws.SdkClientException; import com.amazonaws.services.lightsail.model.*; import com.amazonaws.protocol.*; import com.amazonaws.annotation.SdkInternalApi; /** * CreateContactMethodRequestMarshaller */ @Generated("com.amazonaws:aws-java-sdk-code-generator") @SdkInternalApi public class CreateContactMethodRequestMarshaller { private static final MarshallingInfo<String> PROTOCOL_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD) .marshallLocationName("protocol").build(); private static final MarshallingInfo<String> CONTACTENDPOINT_BINDING = MarshallingInfo.builder(MarshallingType.STRING) .marshallLocation(MarshallLocation.PAYLOAD).marshallLocationName("contactEndpoint").build(); private static final CreateContactMethodRequestMarshaller instance = new CreateContactMethodRequestMarshaller(); public static CreateContactMethodRequestMarshaller getInstance() { return instance; } /** * Marshall the given parameter object. */ public void marshall(CreateContactMethodRequest createContactMethodRequest, ProtocolMarshaller protocolMarshaller) { if (createContactMethodRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createContactMethodRequest.getProtocol(), PROTOCOL_BINDING); protocolMarshaller.marshall(createContactMethodRequest.getContactEndpoint(), CONTACTENDPOINT_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } } }
[ "" ]
94a15b53999a4c0948029c59950856fe01c95e19
eee908a695990d1aa27951365fe79111b81d0712
/Bozze/Implementazione/Tutto_Elettronica/src/it/unisa/control/ModificaRuoloControl.java
d50c872a2ad2bf28022c80077ed27e9e414c0c76
[]
no_license
gaeta987/ProgettoIngegneriaDelSoftware-TuttoElettronica
c859e48735fc8db843e86cfb50680488b241a82a
896d5a31df1d98b83946011f1c1f11fae655a993
refs/heads/master
2020-06-18T04:25:49.091756
2019-02-13T19:00:30
2019-02-13T19:00:30
196,162,745
1
0
null
null
null
null
UTF-8
Java
false
false
2,015
java
package it.unisa.control; import java.io.IOException; import java.sql.SQLException; import javax.servlet.ServletException; import javax.servlet.annotation.WebServlet; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import it.unisa.bean.UserBean; import it.unisa.model.UserManager; import it.unisa.model.UserManagerDM; /** * Servlet implementation class ModificaRuoloControl */ @WebServlet("/ModificaRuoloControl") public class ModificaRuoloControl extends HttpServlet { private static final long serialVersionUID = 1L; static UserManager<UserBean> clienteModel = new UserManagerDM(); /** * @see HttpServlet#HttpServlet() */ public ModificaRuoloControl() { super(); // TODO Auto-generated constructor stub } /** * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response) */ protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { String userRoles =(String)request.getSession().getAttribute("userRoles"); if(userRoles == null || !userRoles.equalsIgnoreCase("admin")){ response.sendRedirect("./login.jsp"); return; } String cf = request.getParameter("cf"); String vecchioRuolo = request.getParameter("vecchioRuolo"); String ruolo = request.getParameter("ruolo"); try { clienteModel.doUpdateCliente(clienteModel.doRetrieveByKey(cf), ruolo); } catch (SQLException e) { // TODO Auto-generated catch block e.printStackTrace(); } response.sendRedirect(request.getContextPath() + "/VisualizzaDatiControl"); } /** * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { // TODO Auto-generated method stub doGet(request, response); } }
[ "43777589+ger716@users.noreply.github.com" ]
43777589+ger716@users.noreply.github.com