method_id stringlengths 36 36 | cyclomatic_complexity int32 0 9 | method_text stringlengths 14 410k |
|---|---|---|
09bca461-2edb-4baa-bc3f-b32d9d9c27ed | 7 | public void findBlockID(){
//System.out.println("train ID: "+ trainId);
//System.out.println("train distance: "+ trainDist[trainId-1][1]);
double newDist;
if(getLineColor() == 0)
newDist = totalDistance - trainDistRed[trainId-1][1];
... |
d869e119-8524-4a48-819f-538191a72087 | 1 | public boolean InsertarDetallePunto(DetallePunto p){
if (p!=null) {
cx.Insertar(p);
return true;
}else {
return false;
}
} |
e15a4eab-613f-437d-a818-7cf6019835b6 | 8 | private static int decode4to3(byte[] source, int srcOffset,
byte[] destination, int destOffset, int options) {
// Lots of error checking and exception throwing
if (source == null) {
throw new NullPointerException("Source array was null.");
} // end if
if (destina... |
4d30ee60-2ab9-4c9b-94eb-a215daf8fe72 | 2 | public boolean isDescendantOf(TreeContainerRow row) {
TreeContainerRow parent = mParent;
while (parent != null) {
if (parent == row) {
return true;
}
parent = parent.mParent;
}
return false;
} |
707b98e3-735d-46bb-a5e6-45ad897f9931 | 7 | private void handlePHPRequest(HttpExchange exchange, String path) throws IOException
{
String hasil = "";
String phpHome = cliCommand;
Headers responseHeaders = exchange.getResponseHeaders();
responseHeaders.set("Content-Type", "text/html");
exchange.sendResponseHeaders(200, ... |
d2199d4a-39ed-4f25-822d-202859fa7288 | 8 | private Element CreateRows()
{
Element rows = doc.createElement("rows");
for (int rdx=0; rdx < dataGrid.Rows(); rdx++)
{
Element row = doc.createElement("row");
Element header = doc.createElement("row-header");
header.appendChild... |
bfa934df-806c-4b16-ad05-a53df683b0e8 | 4 | public static void handleEnableAsyncMetadataMethod(HTSMsg msg, HTSPServerConnection conn, HTSPMonitor monitor) throws IOException {
Collection<String> requiredFields = Arrays.asList(new String[]{});
if (msg.keySet().containsAll(requiredFields)){
HTSMsg reply = new HTSMsg();
handleExtraFields(msg,reply);
co... |
85c8d8e7-5f14-43f8-a89f-278340fa793f | 0 | public String getSourceLine() {
return sourceLine;
} |
786b90f7-f623-4fac-8dc2-9520a2724b64 | 5 | @Override
public void mouseReleased(MouseEvent me) {
if (echiquier.getPieceCase(this.pInit) != null) {
if (me.getPoint().x < 800 && me.getPoint().y < 800) {
if (this.echiquier.deplacerPiece(echiquier.getPieceCase(this.pInit), ((ChessFrame) this.fenetre).getCoord(me.getPoint()))) ... |
4e1d0f2a-a208-4e7f-b9d2-30859f0e0ab9 | 5 | @SuppressWarnings({ "unchecked", "rawtypes" })
public StartDialog(final PacketFactoryInterface pf, Status statusParam) {
this.status = statusParam;
setResizable(false);
setModalityType(ModalityType.APPLICATION_MODAL);
setTitle("Start Game");
setBounds(BORDER, BORDER, BORDER2,... |
966b3098-7193-442d-80bf-b663b5b9d17f | 5 | public boolean match(Sim_event ev)
{
if (ev == null) {
return false;
}
boolean result = false;
try
{
// find an event with a matching tag first
if ( tag_ == ev.get_tag() )
{
Object obj = ev.get_data();
... |
aead856d-a3cf-4d4c-ab9b-90ac53d5c35e | 4 | public Game.PlayerTurn[][] getGridArray() {
boolean test = false;
if (test || m_test) {
System.out.println("FileManager :: getGridArray() BEGIN");
}
if (test || m_test) {
System.out.println("FileManager :: getGridArray() END");
}
return m_gridArray;
} |
54d561e3-9afe-4f40-bf27-37d3c9a076e2 | 2 | public void actionPerformed(ActionEvent event) {
if(event.getActionCommand().equals(zoomIn.getActionCommand())){
parent.zoomIn();
}
else if(event.getActionCommand().equals(zoomOut.getActionCommand())){
parent.zoomOut();
}
} |
f2bb27e8-413a-49f6-aeaa-b302d5894b0e | 0 | @Test
@Ignore // Callback ordering is not supported
public void runTestOrdering1() throws IOException {
InfoflowResults res = analyzeAPKFile("Callbacks_Ordering1.apk");
Assert.assertNotNull(res);
Assert.assertEquals(0, res.size());
} |
e6705f9a-6469-4f2c-b452-90b6651f609d | 8 | public boolean generate(World par1World, Random par2Random, int par3, int par4, int par5)
{
for (int var6 = 0; var6 < 20; ++var6)
{
int var7 = par3 + par2Random.nextInt(4) - par2Random.nextInt(4);
int var8 = par4;
int var9 = par5 + par2Random.nextInt(4) - par2Rand... |
2ca3350a-f2b0-48d9-8828-b11b1cec5de7 | 6 | public void realEnvido(boolean envido, boolean envidoEnvido, Humano jugadorH, Contador contador, boolean mentir){
System.out.println("\n"+this.getNombre()+": Real Envido");
ArrayList<Boolean> respuesta = new ArrayList<Boolean>();
respuesta = jugadorH.cantoRealEnvido(envido, envidoEnvido, contador, this, mentir);
... |
ae21a94c-134c-401c-a14d-b7d4efde9f94 | 5 | private static int getPresidence(char inf)
throws NotInfix{
/*
* Presidence table:
* + 0
* - 1
* * 2
* / 3
* ^ 4
*/
switch( inf ){
case '+' :
return 0;
case '-' :
return 1;
case '*' :
return 2;
case '/' :
return 3;
case '^' :
return 4;
default:... |
8a119d2b-572c-449e-973d-6e3f506f1123 | 6 | private static void exportPricesCSV() {
StringBuilder sb = new StringBuilder();
sb.append("id;price;Typ;Set;Itemname;Level;Stars;Useful;Armortype;");
sb.append("\n");
for (Shoes s : shoes) {
String x = s.getPrice() + "";
x = x.replace(".", ",");
sb.append(s.getId() + ";" + x + ";Shoes;"
+ s.getI... |
1cab3a5c-ff0a-49f6-8e3d-a78872a5b864 | 2 | public Iterator getChilds() {
final Iterator fieldIter = fieldIdents.iterator();
final Iterator methodIter = methodIdents.iterator();
return new Iterator() {
boolean fieldsNext = fieldIter.hasNext();
public boolean hasNext() {
return fieldsNext ? true : methodIter.hasNext();
}
public Object nex... |
b4aed054-e0e8-40e9-b606-4c4d2dd6d062 | 2 | public static void reloadChannels() {
if (ChannelsFile == null) {
ChannelsFile = new File(PlayerChat.plugin.getDataFolder(), "channels.yml");
}
Channels = YamlConfiguration.loadConfiguration(ChannelsFile);
InputStream defConfigStream = PlayerChat.plugin.getResource("channels.yml");
if (defConfigStream != n... |
2b3c68a1-9a75-4004-af21-05cf2b21ec9c | 6 | @Override
public boolean onLoop( Game game, GameState state, GameInput input, Graphics2D gr )
{
long nanosElapsed = state.tick();
time += nanosElapsed;
int updateCount = 0;
while (time >= frameRate && updateCount < maxUpdates)
{
game.input( input );
input.clear();
if (!game.isPlaying())
{
... |
d49037d7-a685-413a-bec4-64b39cf9f533 | 4 | public static void main(String[] args) throws IOException {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
StringBuilder out = new StringBuilder();
String line = "";
while ((line = in.readLine()) != null) {
double[] v = readDoubles(line);
boolean allZero = true;
for (int i = ... |
c848aeb1-c35c-4f42-86c9-0cf983178664 | 6 | @Override
protected void randomizeData(Random rng, Battle battle, int position) {
for (int i = 0; i < battle.objectCount(); i++) {
BattleObject obj = battle.getObject(i);
int objValue = obj.getValue();
// If object is an enemy, randomize it.
if (obj.getType() == BattleObject.Type.ENEMY && obj.getSide() ... |
91585127-ce50-45da-9f13-44eef9fc8d1b | 8 | public void pullDataFile(String fileName, Course[][] courses)
{
int courseNumber = 0, creditHours = 0;
String department = "", courseTitle = "";
int semester = 0, course = 0;
char grade = 'G';
file = new File(fileName);
try
{
Scanner scan = new Scanner(file);
while (scan.hasNext())
{
... |
3f2b6ba5-76f7-461f-bb17-2c21eb1b0f66 | 5 | public static ArrayList<String> division(int dividend, int divisor) throws NumberFormatException, IOException{
ArrayList<String> pseudographics = new ArrayList<String>();
try{
ArrayList<Integer> digitsInDividend = new ArrayList<Integer>();
ArrayList<Integer> resultByDigits = new ArrayList<Integer>();
boolean ... |
6ba13a9e-3f93-4ab0-ad48-55e1fcfb033a | 1 | public VCNTreeItem getCurrentTreeItem() {
if (editor == null) {
return null;
}
return editor.getTreeItem();
} |
f4e567bd-fe90-486f-8cc1-70e3a14cbaeb | 3 | Features getFeature(int mouseY) {
int numFeatures = Features.count();
if (hexSideInPixels <= 0) {
return Features.getFeature(0);
}
int spacing = 2 * hexSideInPixels + internalMarginInPixels;
int i = (mouseY - topMargin + internalMarginInPixels / 2) / (spacing);
... |
16cca0c7-b4ae-4101-83ce-fd737214120d | 9 | public void printAula( String nomAula){
ArrayList<String> atributs = cper.llegirAula(nomUnitat+"-"+nomAula);
int t = Integer.parseInt(atributs.get(0));
String n = atributs.get (1);
int c = Integer.parseInt (atributs.get(2));
int b = Integer.parseInt (atributs.get(3));
if ... |
7cfe2837-7820-45ab-961c-d96b28ef45df | 2 | public void parse(String row) {
String[] strings = StringUtils.splitPreserveAllTokens(row, this.inputDelimiter);
if (initSize == -1) { // Not initialized
this.initSize = strings.length;
}
if (initSize != strings.length) {
throw new IllegalArgumentException("Wrong column size. Init Size [" + initSize + "]... |
7c2f9320-72ae-47cb-bc65-29c8c30be98a | 4 | public int getVisibleSize()
{
if ( (visibleVersionsCount < 0) || dataVisibilityChanged)
{
int len = langVersions.size() ;
int vLen = 0 ;
// count all visible languages
for ( int t = 0 ; t < len ; t++ )
{
// System.out.println( "language " +get(t).getFullLanguageName() ) ;... |
119f7e26-fe81-4d2c-83d3-fa061cc3c429 | 7 | private boolean checkHealth0(Node node) {
try {
NioChannel channel = connectionManager.getChannel(node.getHostname(),
node.getPort());
if (channel.isOpen()) {
if (!node.isOptionsEnabled()) {
return true;
}
// Put the channel in the recycled channel's list
buffer.clear();
... |
0cc800da-67d9-4c6a-b469-d9a80096f50e | 9 | public static void main(String[] args)
{
ArrayList<Item> shoppingCart = new ArrayList<Item>();
if (args.length != 1)
{
System.err.println ("Error: Incorrect number of command line arguments");
System.exit(-1);
}
try
{
FileReader freader = new FileReader(args[0]);
BufferedReader rea... |
02974d9b-9778-4ffd-8ac6-53c1955673f8 | 2 | @Override
public void actionPerformed(ActionEvent event)
{
if(((JButton) event.getSource()).getText() == "Annuler")
{
this.grilleCombinaisonJeu.remiseAZeroCombinaisonAffichée();
}
if(((JButton) event.getSource()).getText() == "Valider")
{
this.combinaisonValidee = true ;
}
} |
1f9720ad-8baa-4ded-8b4a-98061abbf42a | 4 | public void refreshTagSelector()
{
// Find the tags that were selected before the refresh
HashSet<String> previouslySelected = new HashSet<String>();
for (int index : tagSelector.getSelectedIndices())
{
if (tagSelector.isSelectedIndex(index))
{
previouslySelected.add(tagSelector.getModel().getElement... |
fc29395a-3e09-4f3e-869f-e01750bb99dd | 5 | private int stripMultipartHeaders(ByteBuffer b, int offset) {
int i;
for (i = offset; i < b.limit(); i++) {
if (b.get(i) == '\r' && b.get(++i) == '\n' && b.get(++i) == '\r' && b.get(++i) == '\n') {
break;
}
}
return i + ... |
dea4e5e7-fca6-49f2-bd4c-bb9aa2cf1a9c | 6 | private void fillParameters(ServletRequest request, ParameterGraph parameterGraph) {
for (Parameter para : parameterGraph.getParmaeters()) {
if (para instanceof SimpleParameter) {
SimpleParameter simplePara = (SimpleParameter) para;
String[] values = request.getParame... |
c5fb496e-cdb7-4342-b963-0a2f6ea55f42 | 3 | public void updateLauncher(){
try {
// URL updatePath = new URL(McLauncher.McLauncherPath);
// ReadableByteChannel rbc = Channels.newChannel(updatePath.openStream());
// FileOutputStream fos = new FileOutputStream("McLauncher.jar");
// fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
// fos.close();
... |
7ec2ae4b-3c70-4de3-a261-cca394a2fd1f | 3 | public void tourDesMonstres(){
if (!fini()){
for (int i=0; i<monstres.recensement(); i++){
Monstre m = (Monstre) monstres.getSoldat(i);
if (!m.estMort()){
// Chaque monstre joue...
}
}
/* Rese... |
b0b4d305-44fd-47c1-8fa4-7c952c975812 | 8 | protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
response.setCharacterEncoding("UTF-8");
response.setContentType("text/html;charset=utf-8");
String method = Util.nullToString(request.getParameter("method"));
if("viewA... |
5759f33c-84c1-46f4-ad4e-a1b79e782b97 | 0 | Point(int x, int y)
{
this.x = x;
this.y = y;
} |
fcd5e0e1-34ca-4ba5-a362-51ef06740241 | 7 | protected final Statement prepareStatement(Connection conn, String sql) throws SQLException {
final int index = sql.indexOf(';');
Statement stmt = (index >= 0)
? conn.prepareStatement(sql.substring(0, index))
: conn.createStatement();
try {
if (stmt in... |
e502746b-1139-4bf7-83c6-6ca7575d686f | 3 | public FlipHash(int cursorX, int cursorY, boolean[][] traversable, boolean[][] board)
{
this.cursorX = cursorX;
this.cursorY = cursorY;
this.board = new BitSet();
final int height = board.length;
final int width = board[ 0 ].length;
int tiles = 0;
for (int y = 0; y < height; y++)
{
for (int... |
c56d27ff-cf41-4e92-a525-2cf3cbdb2390 | 5 | public static byte[] convert(boolean[] pieces) {
int length = pieces.length / 8;
int mod = pieces.length % 8;
if(mod != 0){
++length;
}
byte[] retVal = new byte[length];
int boolIndex = 0;
for (int byteIndex = 0; byteIndex < retVal.length; ++byteIndex) {
for (int bitIndex = 7; bitIndex >= 0; --bi... |
785f5e3b-c566-4445-aea4-9bded6653edd | 7 | @Override public int compareTo(Hand otherHand) {
List<Card> thisHand = getHandValues().get(this);
List<Card> thatHand = getHandValues().get(otherHand);
if (thisHand == null || thatHand == null) {
return 0;
}
if (thisHand.size() > thatHand.size()) {
return 1;
} else if (thisHand.size() < that... |
a2ff1484-6d1b-42f5-96be-9c587326ab46 | 3 | public boolean removeSection(String name) {
String normName = normSection(name);
if (this.commonName != null && this.commonName.equals(normName)) {
throw new IllegalArgumentException("Can't remove common section");
}
if (hasSection(normName)) {
this.sections.remov... |
fd465090-daaa-4d94-9f44-cfe995e27f98 | 1 | public void mouseExited(MouseEvent e) {
if(getState() == ENABLED) {
textColor = "white";
} else {
textColor = "gray";
}
} |
588b6356-c3ea-4c92-accd-9e9edfd8cd7f | 6 | public static String reverseWords(String s) {
StringBuilder result = new StringBuilder();
for (int i = s.length() - 1, end = 0; i >=0 ; i--) {
char c = s.charAt(i);
if (c != ' ')
result.insert(end, c);
else if (result.length() > 0
&& result.charAt(result.length() - 1) != ' ') {
result.appen... |
a26b52a0-ea56-41e2-8a82-0d18b91ff0d9 | 3 | public static String unicode(String src) {
byte[] bytes = src.getBytes(Charsets.UTF_16);// 转为UTF-16字节数组
int length = bytes.length;
if (length > 2) {// 由于转换出来的字节数组前两位属于UNICODE固定标记,因此要过滤掉
int i = 2;
StringBuilder sb = new StringBuilder((length - i) * 3);
boolean isOdd = false;
for (; i < length; i++) {
... |
383ac506-46ad-4617-b3e0-d18a7a4bc9f9 | 9 | public void movePieceOnBoard(String command, Position pieceStart, Position pieceEnd)
{
String player = whitePlayerTurn() ? "Black" : "White";
int x1 = pieceStart.getPositionX();
int y1 = pieceStart.getPositionY();
int x2 = pieceEnd.getPositionX();
int y2 = pieceEnd.getPositionY();
String startSpot = c... |
bf8941e4-57fb-4637-9865-7fc0d8022858 | 8 | public String calculateProbs(String url, double parent_score, double div_score, double anchor_score)
{
String[] data = new String[5];
data[0] = url;
String parent, div, anchor;
float relevant_yes, relevant_no, temp_parent[], temp_div[], temp_anchor[];
if(pare... |
46668245-ad3d-4da1-9bdd-cfa576ab89f7 | 2 | private void loadpos() {
if (cap == null) {
return;
}
String name = cap.text;
if (storePosSet.contains(name)) {
c = new Coord(Config.window_props.getProperty(name + "_pos",
c.toString()));
return;
}
} |
a4aac2c1-d059-4e63-a4cf-e863e5fabc2f | 9 | public static void main(String args[]) throws Throwable {
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
StringBuilder sb = new StringBuilder();
for(int i=0;i<lAdy.length;i++)lAdy[i]=new ArrayList<Integer>();
for (String ln;(ln=in.readLine())!=null;) {
StringTokenizer st=new String... |
7641001b-a0dd-4bf5-bad5-22968d42c5f8 | 7 | public static void addThisYear(double meanUtil, double utilStdDev){
supplies.add(City.economy.getSupplyString());
demands.add(City.economy.getDemandString());
prices.add(City.economy.getPriceString());
String popString = new String(City.year + ",");
int male = 0; //must divide by pop
int[] homeClass = ne... |
f94beec1-abba-400f-b9f4-7ed7d88e37f6 | 0 | public static void f(MyIncrement mi) {
mi.increment();
} |
daba515b-3ce5-4120-86b8-e3dae299836f | 9 | public void drawGameOver()
{
Graphics2D g = image.createGraphics();
int mX = 0;
int mY = 0;
if ( getMousePosition() != null )
{
mX = (int)getMousePosition().getX();
mY = (int)getMousePosition().getY();
}
g.setColor( Color.black );
... |
ec5ab585-6f9b-4f43-bebc-1f2f54860f98 | 4 | public ListNode reverseBetween(ListNode head, int m, int n) {
ListNode dummy = new ListNode(0);
ListNode p = dummy;
dummy.next = head;
int i = 1;
while(p.next != null && i < m){
p = p.next;
++i;
}
ListNode back = p.next;
ListNode pp = p;
while(pp.next != null && i <= n){
pp = pp.next;
++i;... |
a23a2c7d-09fd-4be4-b084-faafe9f66738 | 0 | public senseDir getSenseDirVal() {
return senseDirVal;
} |
27406d2c-9d47-4eca-bf81-2bfc11bb4b1c | 4 | public void init() throws RemoteException {
for (ICamera camera : serverProxy.getCameras()) {
if (cCameraUser == null
|| (!camera.getOwnerName().equals(
cCameraUser.getOwnerName()))) {
CCamera cCamera = new CCamera((ACamera) camera,
serverProxy, "http://espacezives.free.fr/pyramid.wrl");
... |
edde0593-0af5-45ee-b420-6b29d6e281e5 | 1 | public PlanBoeseKrieg(JSONObject object) throws FatalError {
super(object, "BoeseKrieg");
if (PlanBoeseKrieg.list == null) {
PlanBoeseKrieg.list = new OpponentList();
}
} |
92250c53-ba9f-4760-aee3-2f9d01b0aa3a | 9 | static byte WallSignFix(byte data, String kierunek)
{
if (kierunek.equals("right"))
{
if (data == 2) {
return 5;
}
if (data == 4) {
return 2;
}
if (data == 5) {
return 3;
}
if (data == 3) {
return 4;
}
}
else
{
i... |
cfed1797-4563-4e7b-9df8-41a58b06e1cb | 3 | private int getNumberOfAlive(int time){
if (vectors[0][0] == null){
return vectors[0].length;
}
int res = 0;
for (Vector vector: vectors[time]){
if (vector.getBeing().isHuman()){
res++;
}
}
return res;
} |
e641199d-da85-4400-a70d-374c88041959 | 3 | public void updateArchive(Archive archive) {
dull = true;
CacheIndice indice = cache.getIndice(0);
try {
if (archive == interfaces) {
byte[] interfaceData = RSInterface.getData();
archive.updateFile(archive.indexOf("data"), interfaceData);
byte[] data = archive.recompile();
indice.updateFile(3,... |
846fa540-c82c-4beb-a50b-ca72ee275c01 | 1 | public void shiftRight() {
if(currentIndex < galleryImageIcons.size() - 1) {
PopImage.view.setImageIcon(galleryImageIcons.get(++currentIndex));
}
} |
4341265c-60f0-4ca0-a1c3-3d2152c48d67 | 0 | public Ambient(){} |
1db373c5-ba9f-45d7-8734-c36975a8a9e4 | 7 | protected LoginResult charcrANSIDone(final LoginSessionImpl loginObj, final Session session)
{
final MOB mob=loginObj.mob;
session.setMob(loginObj.mob);
if((session.getClientTelnetMode(Session.TELNET_MSP))
&&(!CMSecurity.isDisabled(CMSecurity.DisFlag.MSP)))
mob.setAttribute(MOB.Attrib.SOUND,true);
if((ses... |
3af87b6b-fcf2-4511-9272-426a8e6d878f | 9 | public static void check(List<TableEntity> tables) {
for (TableEntity table : tables) {
List<ColumnEntity> c = table.columns;
for (RecordEntity record : table.records) {
List<String> e = record.expecteds;
List<String> a = record.actuals;
if... |
8e6f6b80-37fb-444f-b49e-e04cb72568a1 | 4 | public static void main(String[] args){
int i = 999;
int j = 999;
int kaibun;
for(i = 999; i > 0; i--)
{
kaibun = (1000 * i) +(100 * (i % 10)) + (10 * ((i / 10) % 10)) + (1 * ((i / 100) % 10));
for(j = 999; j > 0; j--)
{
if((kaibun % j == 0) && (kaibun / j) < 1000)
... |
dd793763-acbc-4290-9884-7baf75785bd6 | 6 | public void disconnect() {
if (socket != null) {
try {
socket.close();
} catch (IOException e) {
// ignore
}
socket = null;
}
if (input != null) {
try {
input.close();
} catch (IOException e) {
// ignore
}
}
if (output != null) {
try {
output.close();
} catch (IO... |
9e03bb52-0fad-407b-bbb2-d8eec31fa888 | 9 | public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
NotifiedMethodInvocationReport that = (NotifiedMethodInvocationReport) o;
if (invocation != null ? !invocation.equals(that.invocation) : that.invocation != null) ret... |
128e6e8a-fdb7-483e-8992-52485356ae54 | 5 | public ArrayList<Object> ifGift(SalesReceiptPO receipt){
ArrayList<Object> returnPromotions=new ArrayList<Object>();
for(PromotionPO p:promotions){
if(p.getPromotionType()==PromotionSort.Gifts){
if(receipt.getFinalprice()>=p.getLeastPrice()
&&checkDateValid(receipt.getSerialNumber(), p)
&&checkCu... |
cceb8e40-520e-402f-8e38-c4155a494080 | 1 | @Override
public List<Integer> save(List<TransMode> beans, GenericSaveQuery saveGeneric, Connection conn) throws DaoQueryException {
try {
return saveGeneric.sendQuery(SAVE_QUERY, conn, Params.fill(beans, (TransMode bean) -> {
Object[] objects = new Object[1];
obj... |
c6d9f9b7-143a-4ea4-87de-e8041c3cb227 | 2 | private xAuthPlayer loadPlayer(String playerName) {
Connection conn = plugin.getDbCtrl().getConnection();
PreparedStatement ps = null;
ResultSet rs = null;
try {
String sql = String.format("SELECT `id` FROM `%s` WHERE `playername` = ?",
plugin.getDbCtrl().getTable(Table.ACCOUNT));
ps = conn.prepareS... |
3013eb85-11c0-4ae0-a928-cd3da26ccaba | 0 | public Clock(BufMgr javamgr) {
super(javamgr);
} |
482bbe09-9265-447f-95c7-8451f4be5ef1 | 5 | @Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof ItemPropertyValue)) {
return false;
}
ItemPropertyValue other = (ItemPropertyValue) object;
if ((this.itemPrope... |
a159c8c0-c5d1-4431-a1e7-4503ff356733 | 6 | public boolean insertSkillSet(UserSkillSet userSkillSet) {
Connection connection = new DbConnection().getConnection();
PreparedStatement preparedStatement = null;
boolean flag = false;
List<SkillRating> skillRatings = userSkillSet.getSkills();
Iterator<SkillRating> iterator = skillRatings.iterator();
try {
... |
adf96569-ab64-4a5e-9d31-5a5429746173 | 9 | WordDescription(XMLStreamReader reader){
WordType type = null;
Pattern endsWithPattern = null;
String value = null;
String functionalGroupType = null;
String endsWithGroupValueAtr = null;
String endsWithGroupType = null;
String endsWithGroupSubType = null;
for (int i = 0, l = reader.getAttribute... |
f97ff6ab-b235-42a3-93d9-7cd84a20ff7b | 0 | public void setX(int x) {
this.x = x;
} |
40be695e-e3ce-4558-8c6a-fcb05e9b5f41 | 0 | public void set(float value)
{
increase = value > dValue;
this.value = value;
} |
0fb5d42a-979a-48d5-971d-74474c84201e | 8 | private static boolean isID(String word) {
boolean flag = false;
int i = 0;
if (Word.isKey(word))
return flag;
char temp = word.charAt(i);
if (isLetter(temp) || temp == '_') {
for (i = 1; i < word.length(); i++) {
temp = word.charAt(i);
if (isLetter(temp) || temp == '_' || isDigit(temp))
co... |
18c32df3-e9e6-47a2-9a5f-db2b7efee934 | 0 | public void setLibelle(String libelle) {
this.libelle = libelle;
} |
4ff2602d-2713-4fcc-99de-b7d9c1ee8a05 | 2 | public Automaton convertToAutomaton(Grammar grammar) {
ArrayList list = new ArrayList();
Automaton automaton = new Automaton();
createStatesForConversion(grammar, automaton);
Production[] productions = grammar.getProductions();
for (int k = 0; k < productions.length; k++) {
list.add(getTransitionForProduct... |
d675b179-146e-4543-a426-5d13bc00322f | 1 | public static boolean zip(String zip){
if(zip.matches("(\\d){5}(-(\\d){4})?"))
return true;
return false;
} |
a33342f0-3fa1-41c0-aa4e-2bb2d320f4f8 | 6 | public static byte[] convertPNGToBlob(Image image) throws IOException {
//Create the byte array
int width = image.width;
int height = image.height;
byte[] data = new byte[width*height*4];
//Convert pixels to data.
int ci = 0;
for (int y = 0; y < height; y++) {
for (int x = 0; x < width; x++) {
int... |
fb2191d3-9d3f-40bb-9c98-a3429c4c871b | 9 | public char readCharacter() //exclusively for token
{
if(console)
{
if (buffer == null || !buffer.hasMoreTokens())
try
{
buffer = new StringTokenizer(myInFile.readLine());
return buffer.nextToken().charAt(0);
... |
75120da7-2e93-495b-aa61-b457731ca69d | 0 | public int GetOnBusTicks()
{
//get the tick time person got on the bus
return onBusTicks;
} |
96d22f24-c28c-45be-bfc8-cb2105937782 | 2 | public void addFirst(E e) {
if (e == null)
throw new NullPointerException();
elements[head = (head - 1) & (elements.length - 1)] = e;
if (head == tail)
doubleCapacity();
} |
f2e0e946-0a98-44c5-907d-6fee063c6090 | 0 | public void setApodo(String apodo) {
this.apodo = apodo;
} |
79088ea1-ebc9-4706-9315-c658ac9ad4df | 4 | public static String toString(JSONObject jo) throws JSONException {
StringBuilder sb = new StringBuilder();
sb.append(escape(jo.getString("name")));
sb.append("=");
sb.append(escape(jo.getString("value")));
if (jo.has("expires")) {
sb.append(";expires=");
... |
aac5ca9f-2bbf-4241-a569-3f5b9ff78185 | 4 | private int start(int i) {
int first = this.firstNonEmptyBucket();
if(i < first) {
return -1;
} else if(i == first) {
return 0;
}
int result = 0;
for(int j = first; j < i; j++) {
if(buckets[j] != null) {
result += buc... |
899e12ed-8522-474f-9622-5f0801518a94 | 8 | public void attackPlayersWithin(int gfx, int maxDamage, int range) {
for (Player p : server.playerHandler.players)
{
if(p != null)
{
client person = (client)p;
if((person.playerName != null || person.playerName != "null"))
{
if(person.distanceToPoint(absX, absY) <= range && person.play... |
8efd18eb-5c19-4a3c-8251-52488349f897 | 1 | private void jLabel5MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLabel5MouseClicked
if(this.jPanel4.isVisible())
this.jPanel4.setVisible(false);
else
this.jPanel4.setVisible(true);
}//GEN-LAST:event_jLabel5MouseClicked |
1133ce42-dd7f-4866-9713-302efb5e4fe7 | 2 | private int compareByte(byte b1, byte b2) {
if ((b1 & 0xFF) > (b2 & 0xFF)) // 比较是否大于
return 1;
else if ((b1 ^ b2) == 0)// 判断是否相等
return 0;
else
return -1;
} |
aeba7904-4612-4405-ad17-21eb354eb918 | 4 | private void GetTasksForAsset(Asset SelectedAsset) {
AssetTasks.clear();
taskList.repaint();
ResultSet tasksOnAssetListResultSet = null;
Statement statement;
try {
statement = connection.createStatement();
Asset asset = (Asset) assetList... |
b58f2001-2de0-4740-aaf2-6074c71dc096 | 6 | public static Strategie getRandom() {
Strategie s = new Strategie();
String a1 = parts[(new Random()).nextInt(parts.length)];
String a2 = null;
do {
a2 = parts[(new Random()).nextInt(parts.length)];
} while(a2.equals(a1));
String a3 = null;
do {
a3 = parts[(new Random()).nextInt(parts.length)];
... |
a2ad4101-9b03-43c6-ace9-a7995ee2a860 | 5 | @Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof TObject)) {
return false;
}
TObject other = (TObject) object;
if ((this.id == null && other.id != null) || (thi... |
0b65e1a9-3b54-4d5b-a89a-505375fdce0a | 1 | private void prevQbtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_prevQbtnActionPerformed
setResponse();
if(qIndex > 0)
{
ShowQuestion(qIndex - 1);
qIndex--;
}
}//GEN-LAST:event_prevQbtnActionPerformed |
dacc1d2b-98f0-4938-b906-d25798879438 | 7 | public static String printPerfs(List<Counter> list) {
if (list == null || list.size() == 0)
return "";
StringBuilder builder = new StringBuilder(1024);
int maxLength = 0;
for (Counter base : list) {
maxLength = Math.max(base.getName().length(), maxLength);
}
String lastCat = null;
String lastGro... |
f1bb7a37-9076-4e96-9fe3-556eca8a80e9 | 8 | public static LocInCell getLocInCell(Dir d1, Dir d2)
{
if (oneIs(Dir.Up, d1, d2) && oneIs(Dir.Left, d1, d2))
return LocInCell.UpperLeft;
if (oneIs(Dir.Up, d1, d2) && oneIs(Dir.Right, d1, d2))
return LocInCell.UpperRight;
if (oneIs(Dir.Down, d1, d2) && oneIs(Dir.Left, ... |
ca2e7a3f-8fce-4db6-8b13-b4fadcd73827 | 3 | public void setLines() {
lines = new ArrayList<>();
panels = new ArrayList<>();
for (DrawableItem pi : this.l.getDrawable()) {
if (pi instanceof PathItem && !((PathItem) pi).hidden) {
lines.add((GeneralPath) ((GeneralPath) (pi.getShape())).clone());
}
... |
f2af793e-7d05-4358-a69a-59a7d97323c4 | 7 | public Enumeration enumerateRequests() {
Vector newVector = new Vector();
if (m_subFlowPreview != null) {
String text = "Show preview";
if (m_previewWindow != null) {
text = "$"+text;
}
newVector.addElement(text);
}
for (int i = 0; i < m_subFlow.size(); i++) {
BeanInstance... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.